Dears,
In my project, first compile aa_1.c, aa_2.c .. in folder A, compile bb_1.c bb_2.c .. from folder B. Then use gcc-ar achieves to libapps.a. At last, link with other static libraries.
Now I want to calculate text, rodata, data, bss section of folder A.
My method is gcc-nm -S --size-sort folder/*.o
, and accumulate text, rodata, data, bss section. But some function may be optimized away because no one call it.
So how call i calculate text, data, rodata, bss size?
I also have another question, use gcc-nm -S --size-sort a.o
there is no 'b' type. But use gcc-size a.o
show bss section is 8 bytes. So which is right?
Can you kindly give me some advice.
Best Regards, Qiao