This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: fix ld failure when reading AIX 7 object files
- From: Tristan Gingold <gingold at adacore dot com>
- To: Richard Sandiford <rsandifo at linux dot vnet dot ibm dot com>
- Cc: Tristan Gingold <gingold at adacore dot com>, "binutils\ at sourceware dot org Development" <binutils at sourceware dot org>
- Date: Tue, 2 Jul 2013 09:44:20 +0200
- Subject: Re: PATCH: fix ld failure when reading AIX 7 object files
- References: <11A312CE-42FE-4718-A039-512C986DF846 at adacore dot com> <87ip0u6k1j dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com>
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.