Question about your patch

Catherine Moore clm@codesourcery.com
Wed Jan 28 16:38:00 GMT 2009


Thanks Nick.  I just committed the following patch:

2009-01-28  Catherine Moore <clm@codesourcery.com>

         * elf32-arm.c (elf32_arm_check_relocs): Set SEC_ALLOC and
         SEC_LOAD for dynamic relocation sections.


Index: elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.168
retrieving revision 1.169
diff -p -r1.168 -r1.169
*** elf32-arm.c 19 Jan 2009 12:14:04 -0000      1.168
--- elf32-arm.c 28 Jan 2009 16:35:12 -0000      1.169
*************** elf32_arm_check_relocs (bfd *abfd, struc
*** 9643,9649 ****
                         flagword flags;

                         flags = bfd_get_section_flags (dynobj, sreloc);
!                       flags &= ~(SEC_LOAD | SEC_ALLOC);
                         bfd_set_section_flags (dynobj, sreloc, flags);
                       }
                   }
--- 9643,9649 ----
                         flagword flags;

                         flags = bfd_get_section_flags (dynobj, sreloc);
!                       flags |= (SEC_LOAD | SEC_ALLOC);
                         bfd_set_section_flags (dynobj, sreloc, flags);
                       }
                   }

Nick Clifton wrote:

> Hi Catherine,
> 
>> old part:
>> !                       if ((sec->flags & SEC_ALLOC) != 0
>> !                           /* BPABI objects never have dynamic
>> !                              relocations mapped.  */
>> !                           && !htab->symbian_p)
>> !                         flags |= SEC_ALLOC | SEC_LOAD;
> 
>> new part:
>> !                   /* BPABI objects never have dynamic relocations 
>> mapped.  */
>> !                   if (! htab->symbian_p)
>>                       {
>> !                       flagword flags;
>>
>> !                       flags = bfd_get_section_flags (dynobj, sreloc);
>> !                       flags &= ~(SEC_LOAD | SEC_ALLOC);
>> !                       bfd_set_section_flags (dynobj, sreloc, flags);
> 
> 
>> What I'm seeing is that the SEC_ALLOC flag is missing for 
>> .rel.somename sections that are created, which in turn is causing 
>> these sections to be emitted to the output bfd instead of being placed 
>> in the .rel.dyn section.  In particular, it's happening during the 
>> building of libc.so for arm-linux. Did you mean to make that change to 
>> the flags to prevent the SEC_ALLOC flag from being set?
> 
> Nope - that is what they technically call a bug ... :-)  Sorry about 
> that.  Presumably you have a patch that fixes this ?  If not please 
> consider it pre-approved, otherwise I'll write one myself.
> 
> Cheers
>   Nick
> 
> 



More information about the Binutils mailing list