This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Common sections
On 06/06/2010 01:56 PM, fearyourself wrote:
> However, if I declare in the elf_backend_section_flags hook that this
> section is also a SEC_IS_COMMON, then I get the right addressing.
You don't ever want to set SEC_IS_COMMON in the assembler. If you
want COMMON symbols, then you should define only COMMON symbols and
let the linker construct the COMMON section.
If you want to define a "big common section", look at how the x86_64-elf
port handles its symbols defined with ".largecomm".
Although even more likely you don't want COMMON symbols at all, and
should simply be doing
.section .largebss,"aw",@nobits
.type x,@object
.size x,4000000
x: .zero 4000000
and then have your linker script place .largebss after .bss.
r~