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] ld: Unify STT_GNU_IFUNC handling


On Mon, May 28, 2018 at 12:42 AM, Alan Modra <amodra@gmail.com> wrote:
> On Fri, May 25, 2018 at 09:37:47AM -0700, H.J. Lu wrote:
>> Take STT_GNU_IFUNC handling scattered across targets and gather it in
>> the generic ELF linker.
>>
>> OK for master?
>>
>> H.J.
>> ---
>> bfd/
>>
>>       PR ld/23238
>>       * elf-s390-common.c (elf_s390_add_symbol_hook): Removed.
>>       * elf32-arc.c (elf_arc_add_symbol_hook): Likewise.
>>       (elf_backend_add_symbol_hook): Likewise.
>>       * elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
>>       (elf_backend_add_symbol_hook): Likewise.
>>       * elf32-s390.c (elf_backend_add_symbol_hook): Likewise.
>>       * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
>>       (elf_backend_add_symbol_hook): Likewise.
>>       * elf64-s390.c (elf_backend_add_symbol_hook): Likewise.
>>       * elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
>>       * elfxx-aarch64.h (_bfd_aarch64_elf_add_symbol_hook): Likewise.
>>       (elf_backend_add_symbol_hook): Likewise.
>>       * elf32-arm.c (elf32_arm_add_symbol_hook): Remove STT_GNU_IFUNC
>>       handling.
>>       * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
>>       * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
>>       * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
>>       * elflink.c (elf_link_add_object_symbols): Set
>>       elf_gnu_symbol_ifunc for STT_GNU_IFUNC symbols.
>>
>> ld/
>>
>>       PR ld/23238
>>       * testsuite/ld-ifunc/ifunc-26.d: New file.
>>       * testsuite/ld-ifunc/ifunc-26.s: Likewise.
>>       * testsuite/ld-ifunc/ifunc.exp: Run *.d tests without a
>>       working compiler.
>
> This is OK when you have run the testsuite over our large set of
> targets.  I suspect you might run into errors and need to modify the
> new testcase.

The new test is limited to:

# IFUNC support has only been implemented for the ix86, x86_64, powerpc,
# aarch64, sparc, and S/390 so far.
if {!(([istarget "i?86-*-*"]
       || [istarget "x86_64-*-*"]
       || [istarget "powerpc*-*-*"]
       || [istarget "aarch64*-*-*"]
       || [istarget "sparc*-*-*"]
       || [istarget "s390*-*-*"])
      && ([istarget "*-*-elf*"]
          || [istarget "*-*-nacl*"]
          || [istarget "*-*-linux*"]
          || [istarget "*-*-gnu*"])) } {
    verbose "IFUNC tests not run - target does not support IFUNC"
    return
}

# Skip targets where -shared is not supported

if ![check_shared_lib_support] {
    return
}

# This test does not need a compiler...
run_dump_test "ifuncmod5"

set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
foreach t $test_list {
    # We need to strip the ".d", but can leave the dirname.
    verbose [file rootname $t]
    run_dump_test [file rootname $t]
}

I tested my patch for all IFUNC tests.

-- 
H.J.


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