aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-02-11 10:28:33 -0800
committerH.J. Lu <hjl.tools@gmail.com>2016-02-11 15:20:13 -0800
commite20365c5d03f0f5eb341e04aafa88f30715e502e (patch)
tree036550fff88e456fb4bb1d1e6307600e5b7e4590 /ld/testsuite/ld-i386
parent7cae9051edc2e3b11b5c79c08edfb91ee7f4e2e4 (diff)
downloadgdb-e20365c5d03f0f5eb341e04aafa88f30715e502e.zip
gdb-e20365c5d03f0f5eb341e04aafa88f30715e502e.tar.gz
gdb-e20365c5d03f0f5eb341e04aafa88f30715e502e.tar.bz2
Enable -Bsymbolic and -Bsymbolic-functions to PIE
Before binutils 2.26, -Bsymbolic and -Bsymbolic-functions were also applied to PIE so that "ld -pie -Bsymbolic -E" can be used to export symbols in PIE with local binding. This patch re-enables -Bsymbolic and -Bsymbolic-functions for PIE. PR ld/19615 * ld.texinfo: Document -Bsymbolic and -Bsymbolic-functions for PIE. * lexsup.c (parse_args): Enable -Bsymbolic and -Bsymbolic-functions for PIE. * testsuite/ld-i386/i386.exp: Run pr19175. * testsuite/ld-i386/pr19615.d: New file. * testsuite/ld-i386/pr19615.s: Likewise. * testsuite/ld-x86-64/pr19615.d: Likewise. * testsuite/ld-x86-64/pr19615.s: Likewise.
Diffstat (limited to 'ld/testsuite/ld-i386')
-rw-r--r--ld/testsuite/ld-i386/i386.exp1
-rw-r--r--ld/testsuite/ld-i386/pr19615.d13
-rw-r--r--ld/testsuite/ld-i386/pr19615.s13
3 files changed, 27 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 9d392c2..1a79694 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -319,6 +319,7 @@ run_dump_test "load5a"
run_dump_test "load5b"
run_dump_test "load6"
run_dump_test "pr19175"
+run_dump_test "pr19615"
if { !([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"]
diff --git a/ld/testsuite/ld-i386/pr19615.d b/ld/testsuite/ld-i386/pr19615.d
new file mode 100644
index 0000000..86aebd1
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr19615.d
@@ -0,0 +1,13 @@
+#as: --32
+#ld: -pie -Bsymbolic -E -melf_i386
+#readelf: -r --wide --dyn-syms
+
+Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
+ Offset Info Type Sym. Value Symbol's Name
+[0-9a-f]+ +[0-9a-f]+ +R_386_RELATIVE +
+
+Symbol table '.dynsym' contains [0-9]+ entries:
+ Num: Value Size Type Bind Vis Ndx Name
+#...
+[ ]*[a-f0-9]+: [a-f0-9]+ 0 FUNC GLOBAL DEFAULT [a-f0-9]+ xyzzy
+#...
diff --git a/ld/testsuite/ld-i386/pr19615.s b/ld/testsuite/ld-i386/pr19615.s
new file mode 100644
index 0000000..1d85926
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr19615.s
@@ -0,0 +1,13 @@
+ .text
+ .globl _start
+ .type _start, @function
+_start:
+ ret
+
+ .globl xyzzy /* This symbol should be exported */
+ .type xyzzy, @function
+xyzzy:
+ ret
+
+ .section ".xyzzy_ptr","aw",%progbits
+ .dc.a xyzzy