This is the mail archive of the 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] LD: Fix .startof.SECNAME/.sizeof.SECNAME tests for MIPS/IRIX

On Thu, Jun 22, 2017 at 2:23 PM, Maciej W. Rozycki <> wrote:
> Correct .startof.SECNAME/.sizeof.SECNAME tests for MIPS/IRIX targets,
> complementing commit dc74becf498f ("ld: Add tests for -Ur") and commit
> da614360f520 ("ld: Add tests for .startof.SECNAME/.sizeof.SECNAME") with
> subsequent updates, and in reference to commit cbd0eecf261c ("Always
> define referenced __start_SECNAME/__stop_SECNAME") and commit
> 7dba9362c172 ("Rewrite __start and __stop symbol handling").
> These targets set the STT_OBJECT type for non-function symbol
> references, according to `elf_frob_symbol' code in gas/config/obj-elf.c:
> #ifdef TC_MIPS
>   /* The Irix 5 and 6 assemblers set the type of any common symbol and
>      any undefined non-function symbol to STT_OBJECT.  We try to be
>      compatible, since newer Irix 5 and 6 linkers care.  However, we
>      only set undefined symbols to be STT_OBJECT if we are on Irix,
>      because that is the only time gcc will generate the necessary
>      .global directives to mark functions.  */
>   if (S_IS_COMMON (symp))
>     symbol_get_bfdsym (symp)->flags |= BSF_OBJECT;
>   if (strstr (TARGET_OS, "irix") != NULL
>       && ! S_IS_DEFINED (symp)
>       && (symbol_get_bfdsym (symp)->flags & BSF_FUNCTION) == 0)
>     symbol_get_bfdsym (symp)->flags |= BSF_OBJECT;
> #endif
> and consequently entries in the symbol table listing from `readelf'
> produced with these tests do not match the NOTYPE pattern expected,
> causing test suite failures:
> FAIL: ld-elf/sizeofa
> FAIL: ld-elf/sizeofc
> FAIL: ld-elf/startofa
> FAIL: ld-elf/startofc
> specifically with the `mips-sgi-irix5' and `mips-sgi-irix6' targets.
> Given that it does not matter for the feature covered by these tests
> whether the type of the symbols produced is STT_NOTYPE or STT_OBJECT
> adjust the problematic cases to accept either type, removing the
> failures observed.
>         ld/
>         * testsuite/ld-elf/sizeofa.d: Also accept the OBJECT type for
>         the symbols examined.
>         * testsuite/ld-elf/sizeofc.d: Likewise.
>         * testsuite/ld-elf/startofa.d: Likewise.
>         * testsuite/ld-elf/startofc.d: Likewise.
> ---
>  Any objections?




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