aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2009-06-02 18:51:34 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2009-06-02 18:51:34 +0000
commit94313f361f6116eb48c1f07e82ec7c4ae1dfe2a8 (patch)
treea0651b295dcf1292cda691524a14355144fda04f /ld
parent7afd84dc1f020ccc7e867f41ef49656314ec4338 (diff)
downloadgdb-94313f361f6116eb48c1f07e82ec7c4ae1dfe2a8.zip
gdb-94313f361f6116eb48c1f07e82ec7c4ae1dfe2a8.tar.gz
gdb-94313f361f6116eb48c1f07e82ec7c4ae1dfe2a8.tar.bz2
bfd/
* coff-rs6000.c (xcoff_ppc_relocate_section): Allow undefined symbols to be left unimported when linking statically. * xcofflink.c (xcoff_link_add_symbols): Ignore global linkage code when linking statically. ld/testsuite/ * ld-powerpc/aix-glink-3.s, ld-powerpc/aix-glink-3a.s, ld-powerpc/aix-glink-3b.s, ld-powerpc/aix-glink-3.dd, ld-powerpc/aix-glink-3-32.d, ld-powerpc/aix-glink-3-64.d: New tests. * ld-powerpc/aix52.exp: Run them. Move the lineno tests to maintain alphabetical order.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-powerpc/aix-glink-3-32.d5
-rw-r--r--ld/testsuite/ld-powerpc/aix-glink-3-64.d5
-rw-r--r--ld/testsuite/ld-powerpc/aix-glink-3.dd14
-rw-r--r--ld/testsuite/ld-powerpc/aix-glink-3.s5
-rw-r--r--ld/testsuite/ld-powerpc/aix-glink-3a.s10
-rw-r--r--ld/testsuite/ld-powerpc/aix-glink-3b.s11
-rw-r--r--ld/testsuite/ld-powerpc/aix52.exp40
8 files changed, 88 insertions, 10 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 6c73acf..fc606d1 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2009-06-02 Richard Sandiford <r.sandiford@uk.ibm.com>
+
+ * ld-powerpc/aix-glink-3.s, ld-powerpc/aix-glink-3a.s,
+ ld-powerpc/aix-glink-3b.s, ld-powerpc/aix-glink-3.dd,
+ ld-powerpc/aix-glink-3-32.d, ld-powerpc/aix-glink-3-64.d: New tests.
+ * ld-powerpc/aix52.exp: Run them. Move the lineno tests to maintain
+ alphabetical order.
+
2009-06-02 H.J. Lu <hongjiu.lu@intel.com>
* ld-ifunc/ifunc-5-i386.d: Renamed to ...
diff --git a/ld/testsuite/ld-powerpc/aix-glink-3-32.d b/ld/testsuite/ld-powerpc/aix-glink-3-32.d
new file mode 100644
index 0000000..754789f
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/aix-glink-3-32.d
@@ -0,0 +1,5 @@
+#name: Glink test 3 (error) (32-bit)
+#source: aix-glink-3.s
+#as: -a32
+#ld: -b32 -bnoautoimp tmpdir/aix-glink-3b.so
+#error: undefined reference to `\.g'
diff --git a/ld/testsuite/ld-powerpc/aix-glink-3-64.d b/ld/testsuite/ld-powerpc/aix-glink-3-64.d
new file mode 100644
index 0000000..3ea6817
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/aix-glink-3-64.d
@@ -0,0 +1,5 @@
+#name: Glink test 3 (error) (64-bit)
+#source: aix-glink-3.s
+#as: -a64
+#ld: -b64 -bnoautoimp tmpdir/aix64-glink-3b.so
+#error: undefined reference to `\.g'
diff --git a/ld/testsuite/ld-powerpc/aix-glink-3.dd b/ld/testsuite/ld-powerpc/aix-glink-3.dd
new file mode 100644
index 0000000..b154936
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/aix-glink-3.dd
@@ -0,0 +1,14 @@
+
+.*
+
+
+Disassembly of section \.text:
+
+0*10000000 <\.f>:
+ *10000000: 48 00 00 05 bl 10000004 <\.g>
+
+0*10000004 <\.g>:
+ *10000004: 4e 80 00 20 bl?r
+
+0*10000008 <__start>:
+ *10000008: 4b ff ff f9 bl 10000000 <\.f>
diff --git a/ld/testsuite/ld-powerpc/aix-glink-3.s b/ld/testsuite/ld-powerpc/aix-glink-3.s
new file mode 100644
index 0000000..355dcc6
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/aix-glink-3.s
@@ -0,0 +1,5 @@
+ .extern .f
+ .globl __start
+ .csect __start[PR]
+__start:
+ bl .f
diff --git a/ld/testsuite/ld-powerpc/aix-glink-3a.s b/ld/testsuite/ld-powerpc/aix-glink-3a.s
new file mode 100644
index 0000000..76aad8c
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/aix-glink-3a.s
@@ -0,0 +1,10 @@
+ .toc
+
+ .globl .g
+ .csect .g[PR]
+.g:
+ blr
+
+ .globl g
+ .csect g[DS]
+g: .long .g,TOC[tc0],0
diff --git a/ld/testsuite/ld-powerpc/aix-glink-3b.s b/ld/testsuite/ld-powerpc/aix-glink-3b.s
new file mode 100644
index 0000000..0bedb3b
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/aix-glink-3b.s
@@ -0,0 +1,11 @@
+ .toc
+
+ .extern .g
+ .globl .f
+ .csect .f[PR]
+.f:
+ bl .g
+
+ .globl f
+ .csect f[DS]
+f: .long .f,TOC[tc0],0
diff --git a/ld/testsuite/ld-powerpc/aix52.exp b/ld/testsuite/ld-powerpc/aix52.exp
index 25479dd..d608490 100644
--- a/ld/testsuite/ld-powerpc/aix52.exp
+++ b/ld/testsuite/ld-powerpc/aix52.exp
@@ -145,16 +145,6 @@ set aix52tests {
{{objdump {-D -j.text -j.data} aix-glink-1-SIZE.dd}}
"aix-glink-1.so"}
- {"Line number test 1 (no discards)" "-e.main"
- "" {aix-lineno-1.s}
- {{objdump -dS aix-lineno-1a.dd} {nm {} aix-lineno-1a.nd}}
- "aix-lineno-1a.exe"}
-
- {"Line number test 1 (discard locals)" "-e.main -x"
- "" {aix-lineno-1.s}
- {{objdump -dS aix-lineno-1b.dd} {nm {} aix-lineno-1b.nd}}
- "aix-lineno-1b.exe"}
-
{"Glink test 2 (part a)" "-shared -bE:aix-glink-2a.ex"
"" {aix-glink-2a.s}
{}
@@ -176,6 +166,32 @@ set aix52tests {
{{objdump -d aix-glink-2-SIZE.dd}}
"aix-glink-2"}
+ {"Glink test 3 (shared library a)"
+ "-shared -bexpall"
+ "" {aix-glink-3a.s}
+ {} "aix-glink-3a.so"}
+
+ {"Glink test 3 (shared library b)"
+ "-shared -bexpall"
+ "" {aix-glink-3b.s}
+ {} "aix-glink-3b.so"}
+
+ {"Glink test 3 (main test)"
+ "-bnoautoimp tmpdir/aix-glink-3b.so tmpdir/aix-glink-3a.so"
+ "" {aix-glink-3.s}
+ {{objdump -d aix-glink-3.dd}}
+ "aix-glink-3"}
+
+ {"Line number test 1 (no discards)" "-e.main"
+ "" {aix-lineno-1.s}
+ {{objdump -dS aix-lineno-1a.dd} {nm {} aix-lineno-1a.nd}}
+ "aix-lineno-1a.exe"}
+
+ {"Line number test 1 (discard locals)" "-e.main -x"
+ "" {aix-lineno-1.s}
+ {{objdump -dS aix-lineno-1b.dd} {nm {} aix-lineno-1b.nd}}
+ "aix-lineno-1b.exe"}
+
{"Relocatable test 1" "-r"
"" {aix-rel-1.s}
{{objdump -hr aix-rel-1.od}} "aix-rel-1.ro"}
@@ -236,5 +252,9 @@ foreach test $aix52tests {
}
}
+run_dump_test "aix-glink-1-32"
+run_dump_test "aix-glink-1-64"
+run_dump_test "aix-glink-3-32"
+run_dump_test "aix-glink-3-64"
run_dump_test "aix-weak-3-32"
run_dump_test "aix-weak-3-64"