This is the mail archive of the binutils@sourceware.org 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: Common sections


With taking what was done for the x86_64 and applying to my code, I get this:

0000000000041624 g     O COMMON_BIG    0000000000000004 targeta
0000000000041628 g     O COMMON_BIG    0000000000000008 target2
0000000000041624 g     O COMMON_BIG    0000000000000004 target2a
0000000000041628 g     O COMMON_BIG    0000000000000008 target

Which is the same issue...

I'm continuing to look, there have been changes here and there in the
linker by predecessors, I'm looking to see if they might have broken
something else.

Any ideas why this could happen ?

By the way, I now get these messages:
/home2/backend/beyler/cyclops64/local/bin/../lib/gcc/cyclops64-linux-elf/4.3.2/../../../../cyclops64-linux-elf/bin/ld:
Warning: alignment 8 of common symbol `target' in /tmp/ccg7AV0b.o is
greater than the alignment (1) of its section COMMON_BIG
/home2/backend/beyler/cyclops64/local/bin/../lib/gcc/cyclops64-linux-elf/4.3.2/../../../../cyclops64-linux-elf/bin/ld:
Warning: alignment 8 of common symbol `target2' in /tmp/ccg7AV0b.o is
greater than the alignment (1) of its section COMMON_BIG
/home2/backend/beyler/cyclops64/local/bin/../lib/gcc/cyclops64-linux-elf/4.3.2/../../../../cyclops64-linux-elf/bin/ld:
Warning: alignment 4 of common symbol `targeta' in /tmp/ccAd7axj.o is
greater than the alignment (1) of its section COMMON_BIG
/home2/backend/beyler/cyclops64/local/bin/../lib/gcc/cyclops64-linux-elf/4.3.2/../../../../cyclops64-linux-elf/bin/ld:
Warning: alignment 4 of common symbol `target2a' in /tmp/ccAd7axj.o is
greater than the alignment (1) of its section COMMON_BIG

I don't understand why I get this now.

Anyway, as always, thanks for any input,
Jc


On Mon, Jun 7, 2010 at 5:53 PM, Richard Henderson <rth@redhat.com> wrote:
> 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~
>


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