This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc puts .data and .bss symbols in .text segment.
- From: Henrik Stokseth <hensto at online dot no>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 18 Jun 2003 06:55:14 +0200
- Subject: gcc puts .data and .bss symbols in .text segment.
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.