gcc puts .data and .bss symbols in .text segment.

Henrik Stokseth hensto@online.no
Wed Jun 18 07:32:00 GMT 2003


I'm currently wriring on a tool to convert between OMF and COFF object 
file formats. Doing so i have stumbled upon something rather strange in 
the object output from the gcc compiler. Gcc puts symbols that should be 
in .data or .bss into the .text segment instead. Why does Gcc do this, 
and is this even allowed? I mean IIRC the CS segment is read-only. Other 
compilers like borland for instance put initialized and unititialized 
data in their respective segments. How does one tell if a symbol is 
code, bss or data??? I am using gcc 3.2.x.

Note: I am not subscribed to this mailinglist so please CC me any 
answers. Thanks!

-- 
One OS to rule them all,
one OS to find them,
one OS to bring them all
and in the darkness bind them.





More information about the Gcc mailing list