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: PATCH: fix ld failure when reading AIX 7 object files


On Jul 1, 2013, at 11:35 PM, Richard Sandiford <rsandifo@linux.vnet.ibm.com> wrote:

> Tristan Gingold <gingold@adacore.com> writes:
>> Index: bfd/coff-rs6000.c
>> ===================================================================
>> RCS file: /cvs/src/src/bfd/coff-rs6000.c,v
>> retrieving revision 1.109
>> diff -c -r1.109 coff-rs6000.c
>> *** bfd/coff-rs6000.c	16 May 2013 15:41:40 -0000	1.109
>> --- bfd/coff-rs6000.c	1 Jul 2013 13:49:50 -0000
>> ***************
>> *** 3539,3552 ****
>> 
>>    /* .sv64 = x_smclas == 17
>>       This is an invalid csect for 32 bit apps.  */
>> !   static const char *names[19] =
>> !   {
>> !     ".pr", ".ro", ".db", ".tc", ".ua", ".rw", ".gl", ".xo",
>> !     ".sv", ".bs", ".ds", ".uc", ".ti", ".tb", NULL, ".tc0",
>> !     ".td", NULL, ".sv3264"
>> !   };
>> ! 
>> !   if ((19 >= aux->x_csect.x_smclas)
>>        && (NULL != names[aux->x_csect.x_smclas]))
>>      {
>>        return_value = bfd_make_section_anyway
>> --- 3555,3568 ----
>> 
>>    /* .sv64 = x_smclas == 17
>>       This is an invalid csect for 32 bit apps.  */
>> !   static const char * const names[] =
>> !    {
>> !      ".pr", ".ro", ".db", ".tc", ".ua", ".rw", ".gl", ".xo", /* 0 - 7 */
>> !      ".sv", ".bs", ".ds", ".uc", ".ti", ".tb", NULL, ".tc0", /* 8 - 15 */
>> !      ".td", NULL, ".sv3264", NULL, ".tl", ".ul", ".te"
>> !    };
>> !  
>> !   if ((aux->x_csect.x_smclas < sizeof (names) / sizeof (*names))
>>        && (NULL != names[aux->x_csect.x_smclas]))
>>      {
>>        return_value = bfd_make_section_anyway
> 
> Thanks for getting rid of the hard-coded constant, but ARRAY_SIZE (names)
> would be even cleaner.  You might need to include libiberty.h first.

Ah thanks, I haven't looked at it enough.
> 
> OK with that change, thanks.

Now committed.

Tristan.


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