+2015-08-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/18801
+ * elf32-i386.c (elf_i386_size_dynamic_sections): Issue an error
+ for read-only segment with dynamic IFUNC relocations.
+ * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
+
2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
* elfxx-mips.c (STUB_MOVE): Change to use 'or' only.
if ((info->flags & DF_TEXTREL) != 0)
{
+ if ((elf_tdata (output_bfd)->has_gnu_symbols
+ & elf_gnu_symbol_ifunc) == elf_gnu_symbol_ifunc)
+ {
+ info->callbacks->einfo
+ (_("%P%X: read-only segment has dynamic IFUNC relocations; recompile with -fPIC\n"));
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
if (!add_dynamic_entry (DT_TEXTREL, 0))
return FALSE;
}
if ((info->flags & DF_TEXTREL) != 0)
{
+ if ((elf_tdata (output_bfd)->has_gnu_symbols
+ & elf_gnu_symbol_ifunc) == elf_gnu_symbol_ifunc)
+ {
+ info->callbacks->einfo
+ (_("%P%X: read-only segment has dynamic IFUNC relocations; recompile with -fPIC\n"));
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
if (!add_dynamic_entry (DT_TEXTREL, 0))
return FALSE;
}
+2015-08-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/18801
+ * ld-i386/i386.exp: Run pr18801.
+ * ld-x86-64/x86-64.exp: Likewise.
+ * ld-i386/pr18801.d: New file.
+ * ld-i386/pr18801.s: Likewise.
+ * ld-x86-64/pr18801.d: Likewise.
+ * ld-x86-64/pr18801.s: Likewise.
+
2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
* ld-mips-elf/compressed-plt-1-n32-mips16.od: Update test.
run_dump_test "pr17057"
run_dump_test "pr17935-1"
run_dump_test "pr17935-2"
+run_dump_test "pr18801"
run_dump_test "pr18815"
# Add $PLT_CFLAGS if PLT is expected.
--- /dev/null
+#as: --32
+#ld: -m elf_i386 -pie
+#error: read-only segment has dynamic IFUNC relocations; recompile with -fPIC
--- /dev/null
+ .text
+ .type selector, %function
+foo:
+ movl $0, %eax
+ ret
+selector:
+ mov $foo, %eax
+ ret
+ .type selector, %gnu_indirect_function
+ .globl _start
+_start:
+ mov $selector, %eax
+ call *%eax
+ ret
+ .section .note.GNU-stack,"",@progbits
--- /dev/null
+#as: --64
+#ld: -melf_x86_64 -pie
+#error: read-only segment has dynamic IFUNC relocations; recompile with -fPIC
--- /dev/null
+ .text
+ .type selector, %function
+foo:
+ movl $0, %eax
+ ret
+selector:
+ movabs $foo, %rax
+ ret
+ .type selector, %gnu_indirect_function
+ .globl _start
+_start:
+ movabs $selector, %rax
+ call *%rax
+ ret
+ .section .note.GNU-stack,"",@progbits
run_dump_test "pr17935-2"
run_dump_test "pr18160"
run_dump_test "pr18176"
+run_dump_test "pr18801"
run_dump_test "pr18815"
# Add $PLT_CFLAGS if PLT is expected.