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


Ok, I've advanced and tweaked it to work, the only problm I have left
for the moment is that the sizes don't seem to be respected or passed
on.

Because my port is based on the MIPS port, I have this definition :

#define elf_backend_size_info       mips_elf64_size_info

Which contains

    bfd_elf64_slurp_symbol_table,

So it seems that my function defined here :
static void
elf64_myport_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED,
                        asymbol *asym)
{
    elf_symbol_type *elfsym = (elf_symbol_type *) asym;

    switch (elfsym->internal_elf_sym.st_shndx)
    {
        case SHN_MYPORT_LARGE_COMMON:
            asym->section = &_bfd_elf_large_com_section;
            asym->value = elfsym->internal_elf_sym.st_size;
            break;
    }
}

with:
#define elf_backend_symbol_processing elf64_myport_symbol_processing

Never gets called. Any ideas of where I could add this code or should
I do something else ?
Jc


On Tue, Jun 8, 2010 at 5:05 PM, fearyourself <fearyourself@gmail.com> wrote:
> 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]