This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Relocating section at virtual address 0


DaniÃl Mantione <daniel@deadlock.et.tudelft.nl> writes:

> The problem was that the compiler was
> declaring variables with .comm, and variables declared with .comm always
> get into the .bss section, even if declared into another section.

That's because common symbols don't actually have a section.  A common
symbol is an undefined reference to another symbol, with the special
property that if no definition is found the linker will automatically
create one.  The linker will by default create that definition in
.bss, although you can change that in the linker script.  There is no
way to say "this is an undefined reference, but if no definition is
found please create a symbol in section S."

If you don't want common symbols in gcc output, use -fno-common, q.v.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]