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: Richard Sandiford <rsandifo at linux dot vnet dot ibm dot com>
- To: Tristan Gingold <gingold at adacore dot com>
- Cc: "binutils\ at sourceware dot org Development" <binutils at sourceware dot org>
- Date: Mon, 01 Jul 2013 22:35:04 +0100
- Subject: Re: PATCH: fix ld failure when reading AIX 7 object files
- References: <11A312CE-42FE-4718-A039-512C986DF846 at adacore dot com>
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.
OK with that change, thanks.
Richard