if (eh != NULL && (sec->flags & SEC_CODE) != 0)
eh->has_non_got_reloc = 1;
do_relocation:
- /* STT_GNU_IFUNC symbol must go through PLT even if it is
- locally defined and undefined symbol may turn out to be
- a STT_GNU_IFUNC symbol later. */
+ /* We are called after all symbols have been resolved. Only
+ relocation against STT_GNU_IFUNC symbol must go through
+ PLT. */
if (h != NULL
&& (bfd_link_executable (info)
- || ((h->type == STT_GNU_IFUNC
- || h->root.type == bfd_link_hash_undefweak
- || h->root.type == bfd_link_hash_undefined)
- && SYMBOLIC_BIND (info, h))))
+ || h->type == STT_GNU_IFUNC))
{
/* If this reloc is in a read-only section, we might
need a copy reloc. We can't check reliably at this
pointer:
if (eh != NULL && (sec->flags & SEC_CODE) != 0)
eh->has_non_got_reloc = 1;
- /* STT_GNU_IFUNC symbol must go through PLT even if it is
- locally defined and undefined symbol may turn out to be
- a STT_GNU_IFUNC symbol later. */
+ /* We are called after all symbols have been resolved. Only
+ relocation against STT_GNU_IFUNC symbol must go through
+ PLT. */
if (h != NULL
&& (bfd_link_executable (info)
- || ((h->type == STT_GNU_IFUNC
- || h->root.type == bfd_link_hash_undefweak
- || h->root.type == bfd_link_hash_undefined)
- && SYMBOLIC_BIND (info, h))))
+ || h->type == STT_GNU_IFUNC))
{
/* If this reloc is in a read-only section, we might
need a copy reloc. We can't check reliably at this
run_dump_test "pr19636-2d"
run_dump_test "pr19636-2d-nacl"
run_dump_test "pr19636-2e"
+run_dump_test "pr19636-2e-nacl"
run_dump_test "pr19636-3a"
run_dump_test "pr19636-3b"
run_dump_test "pr19636-3c"
--- /dev/null
+#source: pr19636-2.s
+#as: --32 -mrelax-relocations=no
+#ld: -shared -Bsymbolic -m elf_i386
+#readelf : -r --wide --dyn-syms
+#target: i?86-*-nacl* x86_64-*-nacl*
+
+Relocation section '\.rel\.dyn' at offset [0x0-9a-f]+ contains 3 entries:
+ +Offset +Info +Type +Sym. Value +Symbol's Name
+[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
+[0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
+[0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
+
+Relocation section '\.rel\.plt' at offset [0x0-9a-f]+ contains 1 entries:
+ +Offset +Info +Type +Sym. Value +Symbol's Name
+[0-9a-f]+ +[0-9a-f]+ +R_386_JUMP_SLOT +0+ +func
+
+Symbol table '\.dynsym' contains [0-9]+ entries:
+ +Num: +Value +Size Type +Bind +Vis +Ndx Name
+#...
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +WEAK +DEFAULT +UND +func
+#pass
#as: --32 -mrelax-relocations=no
#ld: -shared -Bsymbolic -m elf_i386
#readelf : -r --wide --dyn-syms
+#notarget: i?86-*-nacl* x86_64-*-nacl*
Relocation section '\.rel\.dyn' at offset [0x0-9a-f]+ contains 3 entries:
+Offset +Info +Type +Sym. Value +Symbol's Name
[0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
[0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
-Relocation section '\.rel\.plt' at offset [0x0-9a-f]+ contains 1 entries:
- +Offset +Info +Type +Sym. Value +Symbol's Name
-[0-9a-f]+ +[0-9a-f]+ +R_386_JUMP_SLOT +0+ +func
-
Symbol table '\.dynsym' contains [0-9]+ entries:
+Num: +Value +Size Type +Bind +Vis +Ndx Name
#...