+2018-03-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22929
+ * elf32-i386.c (elf_i386_relocate_section): Treat relocation
+ against IFUNC symbol in SHT_NOTE section without SHF_ALLOC as
+ relocation against FUNC symbol.
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
+
2018-03-07 Renlin Li <renlin.li@arm.com>
PR ld/20402
if ((input_section->flags & SEC_ALLOC) == 0)
{
+ /* If this is a SHT_NOTE section without SHF_ALLOC, treat
+ STT_GNU_IFUNC symbol as STT_FUNC. */
+ if (elf_section_type (input_section) == SHT_NOTE)
+ goto skip_ifunc;
/* Dynamic relocs are not propagated for SEC_DEBUGGING
sections because such sections are not SEC_ALLOC and
thus ld.so will not process them. */
}
}
+skip_ifunc:
resolved_to_zero = (eh != NULL
&& UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh));
if ((input_section->flags & SEC_ALLOC) == 0)
{
+ /* If this is a SHT_NOTE section without SHF_ALLOC, treat
+ STT_GNU_IFUNC symbol as STT_FUNC. */
+ if (elf_section_type (input_section) == SHT_NOTE)
+ goto skip_ifunc;
/* Dynamic relocs are not propagated for SEC_DEBUGGING
sections because such sections are not SEC_ALLOC and
thus ld.so will not process them. */
}
}
+skip_ifunc:
resolved_to_zero = (eh != NULL
&& UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh));
+2018-03-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22929
+ * testsuite/ld-i386/i386.exp: Run PR ld/22929 test.
+ * testsuite/ld-x86-64/x86-64.exp: Likewise.
+ * testsuite/ld-i386/pr22929.d: New file.
+ * testsuite/ld-i386/pr22929.s: Likewise.
+ * testsuite/ld-x86-64/pr22929.d: Likewise.
+ * testsuite/ld-x86-64/pr22929.s: Likewise.
+
2018-03-07 Max Filippov <jcmvbkbc@gmail.com>
* emulparams/elf32xtensa.sh (COMMONPAGESIZE): Define.
run_dump_test "pr22115-1d"
run_dump_test "pr22135"
run_dump_test "pr22782"
+run_dump_test "pr22929"
if { !([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"]
--- /dev/null
+#as: --32
+#ld: -melf_i386 -shared
+#readelf: -r --wide -s
+
+There are no relocations in this file.
+#...
+Symbol table '.symtab' contains [0-9]+ entries:
+ Num: Value Size Type Bind Vis Ndx Name
+#...
+[ \t]+[a-f0-9]+: [a-f0-9]+ +1 IFUNC +GLOBAL DEFAULT +[a-f0-9]+ +foo
+#...
--- /dev/null
+ .text
+ .globl foo
+ .type foo, %gnu_indirect_function
+foo:
+ ret
+ .size foo, .-foo
+ .pushsection .gnu.build.attributes, "", %note
+ .dc.l 6 # size of name
+ .dc.l 16 # descsz = sizeof (addresses)
+ .dc.l 0x101 # type = FUNC
+ .dc.b 0x47, 0x41, 0x2a, 0x2, 0, 0 # name (numeric: -fstack-protector status)
+ .dc.b 0, 0 # Padding
+ .dc.a foo
+ .dc.a foo_end # description (symbol name)
+ .popsection
+
+foo_end:
+ .section .rodata.cst4,"aM",@progbits,4
+ .align 4
+.LC0:
+ .long 1065353216
--- /dev/null
+#as: --64
+#ld: -melf_x86_64 -shared
+#readelf: -r --wide -s
+
+There are no relocations in this file.
+#...
+Symbol table '.symtab' contains [0-9]+ entries:
+ Num: Value Size Type Bind Vis Ndx Name
+#...
+[ \t]+[a-f0-9]+: [a-f0-9]+ +1 IFUNC +GLOBAL DEFAULT +[a-f0-9]+ +foo
+#...
--- /dev/null
+ .text
+ .globl foo
+ .type foo, %gnu_indirect_function
+foo:
+ ret
+ .size foo, .-foo
+ .pushsection .gnu.build.attributes, "", %note
+ .dc.l 6 # size of name
+ .dc.l 16 # descsz = sizeof (addresses)
+ .dc.l 0x101 # type = FUNC
+ .dc.b 0x47, 0x41, 0x2a, 0x2, 0, 0 # name (numeric: -fstack-protector status)
+ .dc.b 0, 0 # Padding
+ .dc.a foo
+ .dc.a foo_end # description (symbol name)
+ .popsection
+
+foo_end:
+ .section .rodata.cst4,"aM",@progbits,4
+ .align 4
+.LC0:
+ .long 1065353216
run_dump_test "pr20253-5b"
run_dump_test "tlsdesc2"
run_dump_test "pr22048"
+run_dump_test "pr22929"
proc undefined_weak {cflags ldflags} {
set testname "Undefined weak symbol"