The binary needs to be compiled with debugging symbols to find that information. You can read the info from the DWARF debugging symbols. Here's a demonstration:
Given this code:
#include <iostream>
struct MyType {
int a, b,c;
float d;
};
int main(int argc, char *argv[])
{
struct MyType t;
std::cout << sizeof(t);
}
You can compile it with g++ -g demo.c
Dump the debugging symbols with
objdump -W ./a.out
There will be a section like
<1><13c7>: Abbrev Number: 20 (DW_TAG_structure_type)
<13c8> DW_AT_name : (indirect string, offset: 0x8af): MyType
<13cc> DW_AT_byte_size : 16
<13cd> DW_AT_decl_file : 1
<13ce> DW_AT_decl_line : 2
<13cf> DW_AT_sibling : <0x13fc>
There we go, MyType has a size of 16.
If the binary doesn't have debugging symbols, you're rather out of luck. You'd have to know a place where the code deals with the size of the type your're interested in, disassemble the binary, find that part of the code.