aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386/pr19319b.S
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-12-01 14:45:51 -0800
committerH.J. Lu <hjl.tools@gmail.com>2015-12-01 14:45:51 -0800
commitead3d5427a2df5e33316d4ad045510c1d2078c2a (patch)
treeafaddd5cd1679a6122659a741de7f8b217785e74 /ld/testsuite/ld-i386/pr19319b.S
parent974eac9d7694ca14dcdf6d1a74777a265fffdb95 (diff)
downloadgdb-ead3d5427a2df5e33316d4ad045510c1d2078c2a.zip
gdb-ead3d5427a2df5e33316d4ad045510c1d2078c2a.tar.gz
gdb-ead3d5427a2df5e33316d4ad045510c1d2078c2a.tar.bz2
Properly check symbol defined by assignment in linker script
Symbol defined by a linker assignment may have type bfd_link_hash_new or bfd_link_hash_undefined. And h->def_regular is always set. elf_i386_convert_load and elf_x86_64_convert_load should check h->def_regular as well as bfd_link_hash_undefined and bfd_link_hash_new to see if a symbol is defined by a linker script. bfd/ PR ld/19319 * elf32-i386.c (elf_i386_convert_load): Check h->def_regular instead of bfd_link_hash_new. * elf64-x86-64.c (elf_x86_64_convert_load): Likewise. Skip relocation overflow for bfd_link_hash_undefined and bfd_link_hash_new if h->def_regular is set. ld/testsuite/ PR ld/19319 * ld-i386/i386.exp: Run pr19319 test. * ld-x86-64/x86-64.exp: Likewise. * ld-i386/pr19319.dd: New file. * ld-i386/pr19319a.S: Likewise. * ld-i386/pr19319b.S: Likewise. * ld-x86-64/pr19319.dd: Likewise. * ld-x86-64/pr19319a.S: Likewise. * ld-x86-64/pr19319b.S: Likewise.
Diffstat (limited to 'ld/testsuite/ld-i386/pr19319b.S')
-rw-r--r--ld/testsuite/ld-i386/pr19319b.S11
1 files changed, 11 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/pr19319b.S b/ld/testsuite/ld-i386/pr19319b.S
new file mode 100644
index 0000000..98294f6
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr19319b.S
@@ -0,0 +1,11 @@
+ .text
+ .globl _start
+ .type _start, @function
+_start:
+ movl __start_my_section@GOT(%ecx), %eax
+ ret
+ .size _start, .-_start
+ .section my_section,"aw",@progbits
+ .align 8
+ .long 4660
+ .long 22136