Layout of compiled objects

后端 未结 6 691
余生分开走
余生分开走 2020-12-01 01:57

Is there a way—much like viewing the result of preprocessing with gcc -E—to see what my objects look like once compiled into object files?

I

6条回答
  •  无人及你
    2020-12-01 02:11

    For GCC compiled executables, checkout Pahole. It will show you how the compiler laid out your structs/classes and whether or not they have "holes" in them. Holes are padding due to memory alignment rules.

提交回复
热议问题