+2012-03-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/13880
+ * elf32-i386.c (elf_i386_relocate_section): Don't issue an error
+ for R_386_GOTOFF relocation against protected function if
+ SYMBOLIC_BIND is true.
+
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Don't issue an
+ error for R_X86_64_GOTOFF64 relocation against protected function
+ when building executable or SYMBOLIC_BIND is true.
+
2012-03-16 Roland McGrath <mcgrathr@google.com>
* config.bfd: Handle x86_64-*-nacl*.
return FALSE;
}
else if (!info->executable
+ && !SYMBOLIC_BIND (info, h)
&& h->type == STT_FUNC
&& ELF_ST_VISIBILITY (h->other) == STV_PROTECTED)
{
/* Check to make sure it isn't a protected function symbol
for shared library since it may not be local when used
as function address. */
- if (info->shared
+ if (!info->executable
&& h
+ && !SYMBOLIC_BIND (info, h)
&& h->def_regular
&& h->type == STT_FUNC
&& ELF_ST_VISIBILITY (h->other) == STV_PROTECTED)
+2012-03-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/13880
+ * ld-i386/i386.exp: Run protected4 and protected5.
+ * ld-x86-64/x86-64.exp: Likewise.
+
+ * ld-i386/protected4.d: New.
+ * ld-i386/protected4.s: Likewise.
+ * ld-i386/protected5.d: Likewise.
+ * ld-i386/protected5.s: Likewise.
+ * ld-x86-64/protected4.d: Likewise.
+ * ld-x86-64/protected4.s: Likewise.
+ * ld-x86-64/protected5.d: Likewise.
+ * ld-x86-64/protected5.s: Likewise.
+
2012-03-19 Andreas Schwab <schwab@linux-m68k.org>
* ld-m68k/m68k.exp ("TLS indirect symbol use"): Pass
run_dump_test "protected1"
run_dump_test "protected2"
run_dump_test "protected3"
+run_dump_test "protected4"
+run_dump_test "protected5"
run_dump_test "tlspie1"
run_dump_test "tlspie2"
run_dump_test "nogot1"
--- /dev/null
+#as: --32
+#ld: -shared -Bsymbolic -melf_i386
+#readelf: -r
+
+There are no relocations in this file.
--- /dev/null
+ .text
+ .protected foo
+ .globl foo
+ .type foo, @function
+foo:
+ ret
+ .size foo, .-foo
+ .globl bar
+ .type bar, @function
+bar:
+ movl foo@GOTOFF(%ecx), %eax
+ .size bar, .-bar
--- /dev/null
+#as: --32
+#ld: -pie -melf_i386
+#readelf: -r
+
+There are no relocations in this file.
--- /dev/null
+ .text
+ .protected foo
+ .globl foo
+ .type foo, @function
+foo:
+ ret
+ .size foo, .-foo
+ .globl _start
+ .type _start, @function
+_start:
+ movl foo@GOTOFF(%ecx), %eax
+ .size _start, .-_start
--- /dev/null
+#as: --64
+#ld: -shared -Bsymbolic -melf_x86_64
+#readelf: -r
+
+There are no relocations in this file.
--- /dev/null
+ .text
+ .protected foo
+ .globl foo
+ .type foo, @function
+foo:
+ ret
+ .size foo, .-foo
+ .globl bar
+ .type bar, @function
+bar:
+ movabsq $foo@GOTOFF, %rax
+ .size bar, .-bar
--- /dev/null
+#as: --64
+#ld: -pie -melf_x86_64
+#readelf: -r
+
+There are no relocations in this file.
--- /dev/null
+ .text
+ .protected foo
+ .globl foo
+ .type foo, @function
+foo:
+ ret
+ .size foo, .-foo
+ .globl _start
+ .type _start, @function
+_start:
+ movabsq $foo@GOTOFF, %rax
+ .size _start, .-_start
run_dump_test "protected2-l1om"
run_dump_test "protected3"
run_dump_test "protected3-l1om"
+run_dump_test "protected4"
+run_dump_test "protected5"
run_dump_test "tlsle1"
run_dump_test "tlspie1"
run_dump_test "unique1"