diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-03-04 06:37:34 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-03-04 06:37:54 -0800 |
commit | 07492f668d2173da7a2bda3707ff0985e0f460b6 (patch) | |
tree | 5495148ee6fc8e585e00cca748ac0351995bf8d4 /ld/testsuite/ld-elf/shared.exp | |
parent | 9411fd44aa4adfb0caeebd9e4355a3441d9bc104 (diff) | |
download | gdb-07492f668d2173da7a2bda3707ff0985e0f460b6.zip gdb-07492f668d2173da7a2bda3707ff0985e0f460b6.tar.gz gdb-07492f668d2173da7a2bda3707ff0985e0f460b6.tar.bz2 |
Treat common symbol in executable as definition
Common symbol in executable is a definition, which overrides definition
from shared objects. When linker sees a new definition from a shared
object, the new dynamic definition should be overridden by the previous
common symbol in executable.
bfd/
PR ld/19579
* elflink.c (_bfd_elf_merge_symbol): Treat common symbol in
executable as definition if the new definition comes from a
shared library.
ld/
PR ld/19579
* testsuite/ld-elf/pr19579a.c: New file.
* testsuite/ld-elf/pr19579b.c: Likewise.
* testsuite/ld-elf/shared.exp: Run PR ld/19579 test.
Diffstat (limited to 'ld/testsuite/ld-elf/shared.exp')
-rw-r--r-- | ld/testsuite/ld-elf/shared.exp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 678ab1b..ef0747d 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -524,6 +524,21 @@ if { [istarget *-*-linux*] {} \ "libpr2404b.a" \ ] \ + [list \ + "Build pr19579a.o" \ + "" "-fPIE" \ + {pr19579a.c} \ + {} \ + "libpr19579a.a" \ + ] \ + [list \ + "Build libpr19579.so" \ + "-shared" \ + "-fPIC" \ + {pr19579b.c} \ + {} \ + "libpr19579.so" \ + ] \ ] run_ld_link_exec_tests [] [list \ [list \ @@ -580,6 +595,15 @@ if { [istarget *-*-linux*] "pass.out" \ "-O2 -fPIC -I../bfd" \ ] \ + [list \ + "Run pr19579" \ + "-pie -z text tmpdir/pr19579a.o tmpdir/libpr19579.so" \ + "" \ + {dummy.c} \ + "pr19579" \ + "pass.out" \ + "-fPIE" \ + ] \ ] } |