aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2009-01-11 21:09:49 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2009-01-11 21:09:49 +0000
commit80c29487db33cf7e597402790cdf62785e7a89cb (patch)
tree04d3162299f1d83d746dff927c8ff7e8e66b9522 /ld
parent5f61c20e05b3752fb9ab5b2aeea6adc8bf515db5 (diff)
downloadgdb-80c29487db33cf7e597402790cdf62785e7a89cb.zip
gdb-80c29487db33cf7e597402790cdf62785e7a89cb.tar.gz
gdb-80c29487db33cf7e597402790cdf62785e7a89cb.tar.bz2
bfd/
* elflink.c (_bfd_elf_section_already_linked): Handle g++-3.4 relocations in `.gnu.linkonce.r.*' referencing its `.gnu.linkonce.t.*'. ld/testsuite/ * ld-elf/linkoncerdiff.d, ld-elf/linkoncerdiff1.s, ld-elf/linkoncerdiff2.s: New.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog5
-rw-r--r--ld/testsuite/ld-elf/linkoncerdiff.d6
-rw-r--r--ld/testsuite/ld-elf/linkoncerdiff1.s7
-rw-r--r--ld/testsuite/ld-elf/linkoncerdiff2.s22
4 files changed, 40 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index f0728e5..1c8b545 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * ld-elf/linkoncerdiff.d, ld-elf/linkoncerdiff1.s,
+ ld-elf/linkoncerdiff2.s: New.
+
2009-01-07 Hans-Peter Nilsson <hp@axis.com>
* ld-cris/tls-e-20.d, ld-cris/tls-e-20a.d, ld-cris/tls-e-21.d,
diff --git a/ld/testsuite/ld-elf/linkoncerdiff.d b/ld/testsuite/ld-elf/linkoncerdiff.d
new file mode 100644
index 0000000..8eec3d2
--- /dev/null
+++ b/ld/testsuite/ld-elf/linkoncerdiff.d
@@ -0,0 +1,6 @@
+#source: linkoncerdiff1.s
+#source: linkoncerdiff2.s
+#ld: -r
+#readelf: -r
+There are no relocations in this file.
+#pass
diff --git a/ld/testsuite/ld-elf/linkoncerdiff1.s b/ld/testsuite/ld-elf/linkoncerdiff1.s
new file mode 100644
index 0000000..9e8e17e
--- /dev/null
+++ b/ld/testsuite/ld-elf/linkoncerdiff1.s
@@ -0,0 +1,7 @@
+ .section .gnu.linkonce.t.foo, "a", %progbits
+ .globl symfoo
+symfoo:
+
+ .section .gnu.linkonce.t.bar, "a", %progbits
+ .globl symbar
+symbar:
diff --git a/ld/testsuite/ld-elf/linkoncerdiff2.s b/ld/testsuite/ld-elf/linkoncerdiff2.s
new file mode 100644
index 0000000..1e8c2ba
--- /dev/null
+++ b/ld/testsuite/ld-elf/linkoncerdiff2.s
@@ -0,0 +1,22 @@
+ .section .gnu.linkonce.t.foo, "a", %progbits
+1:
+ .globl symfoo
+symfoo:
+ .long 0
+
+ .section .gnu.linkonce.t.bar, "a", %progbits
+2:
+ .globl symbar
+symbar:
+ .long 0
+
+ .section .gnu.linkonce.r.foo, "a", %progbits
+ .long 1b
+ .long symfoo
+/* ld currently incorrectly silently discards this relocation. Just such
+ relocations are never produced by g++-3.4 so this suppressed error message
+ is not a problem:
+ #error: `.gnu.linkonce.t.bar' referenced in section `.gnu.linkonce.r.foo' of tmpdir/dump1.o: defined in discarded section `.gnu.linkonce.t.bar' of tmpdir/dump1.o
+ */
+ .long 2b
+ .long symbar