Add another testcase for PR ld/19719

This test checks run-time relocation overflow with GOT relocation and
32-bit relocation against the same symbol.

	PR ld/19719
	* testsuite/ld-x86-64/pr19719.d: New file.
	* testsuite/ld-x86-64/pr19719.s: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Run pr19719.
This commit is contained in:
H.J. Lu 2016-04-19 20:11:55 -07:00
parent b73bf8516f
commit 87d455c042
4 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2016-04-19 H.J. Lu <hongjiu.lu@intel.com>
PR ld/19719
* testsuite/ld-x86-64/pr19719.d: New file.
* testsuite/ld-x86-64/pr19719.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr19719.
2016-04-18 Matthew Fortune <matthew.fortune@imgtec.com>
* ld.texinfo: Document NOCROSSREFS_TO script command.

View File

@ -0,0 +1,3 @@
#as: --64
#ld: -pie -melf_x86_64
#error: .*relocation R_X86_64_32 against undefined symbol `foo' can not be used when making a shared object; recompile with -fPIC

View File

@ -0,0 +1,16 @@
.text
.globl _start
.type _start, @function
_start:
movl foo_p(%rip), %eax
movq foo@GOTPCREL(%rip), %rax
ret
.size _start, .-_start
.globl foo_p
.data
.align 4
.type foo_p, @object
.weak foo
.size foo_p, 4
foo_p:
.long foo

View File

@ -440,6 +440,7 @@ run_dump_test "pr19609-7c"
run_dump_test "pr19609-7d"
run_dump_test "pr19939a"
run_dump_test "pr19939b"
run_dump_test "pr19719"
proc undefined_weak {cflags ldflags} {
set testname "Undefined weak symbol"