ld: Unify STT_GNU_IFUNC handling
[deliverable/binutils-gdb.git] / bfd / elflink.c
index 05664b4e89bb4f546a120a26e0479ddea2dfd265..9dfd3e957f358b55e33c73e9eec451268ec40beb 100644 (file)
@@ -4680,10 +4680,17 @@ error_free_dyn:
              (struct bfd_link_hash_entry **) sym_hash)))
        goto error_free_vers;
 
-      if ((flags & BSF_GNU_UNIQUE)
-         && (abfd->flags & DYNAMIC) == 0
-         && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
-       elf_tdata (info->output_bfd)->has_gnu_symbols |= elf_gnu_symbol_unique;
+      if ((abfd->flags & DYNAMIC) == 0
+         && (bfd_get_flavour (info->output_bfd)
+             == bfd_target_elf_flavour))
+       {
+         if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC)
+           elf_tdata (info->output_bfd)->has_gnu_symbols
+             |= elf_gnu_symbol_ifunc;
+         if ((flags & BSF_GNU_UNIQUE))
+           elf_tdata (info->output_bfd)->has_gnu_symbols
+             |= elf_gnu_symbol_unique;
+       }
 
       h = *sym_hash;
       /* We need to make sure that indirect symbol dynamic flags are
This page took 0.02576 seconds and 4 git commands to generate.