aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2005-05-20 21:57:12 +0000
committerDaniel Jacobowitz <drow@false.org>2005-05-20 21:57:12 +0000
commit4dc4a9a515d83cbef3d06d21b934df37e85d663c (patch)
treec0a226ebcb87e21cb73f3bc2060fe26585e20a0f /ld
parentdd1a320be63abd442e85607f8052ff597901efe5 (diff)
downloadgdb-4dc4a9a515d83cbef3d06d21b934df37e85d663c.zip
gdb-4dc4a9a515d83cbef3d06d21b934df37e85d663c.tar.gz
gdb-4dc4a9a515d83cbef3d06d21b934df37e85d663c.tar.bz2
bfd/
* bfd/elf32-ppc.c (struct ppc_elf_link_hash_entry): Add new field has_sda_refs. (ppc_elf_copy_indirect_symbol): Copy has_sda_refs. (ppc_elf_check_relocs): Set has_sda_refs. (ppc_elf_adjust_dynamic_symbol): Check has_sda_refs before eliminating copy relocations. Use has_sda_refs to place variables in .sbss. (ppc_elf_finish_dynamic_symbol): Use has_sda_refs to place variables in .sbss. ld/testsuite/ * ld-powerpc/sdalib.s, ld-powerpc/sdadyn.s, ld-powerpc/sdadyn.d: New files. * ld-powerpc/powerpc.exp: Run the new test.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/ld-powerpc/powerpc.exp4
-rw-r--r--ld/testsuite/ld-powerpc/sdadyn.d8
-rw-r--r--ld/testsuite/ld-powerpc/sdadyn.s3
-rw-r--r--ld/testsuite/ld-powerpc/sdalib.s4
5 files changed, 25 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 2a07252..8cf395a 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2005-05-20 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * ld-powerpc/sdalib.s, ld-powerpc/sdadyn.s, ld-powerpc/sdadyn.d: New
+ files.
+ * ld-powerpc/powerpc.exp: Run the new test.
+
2005-05-20 Bob Wilson <bob.wilson@acm.org>
* ld-undefined/undefined.exp: Revert xfail for xtensa-*-*.
diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp
index 9e452fb..593d7e2 100644
--- a/ld/testsuite/ld-powerpc/powerpc.exp
+++ b/ld/testsuite/ld-powerpc/powerpc.exp
@@ -69,6 +69,10 @@ set ppcelftests {
{{readelf -WSsrl tlsso32.r} {objdump -dr tlsso32.d}
{objdump -sj.got tlsso32.g} {objdump -sj.tdata tlsso32.t}}
"tls32.so"}
+ {"Shared library with global symbol" "-shared -melf32ppc" "" {sdalib.s}
+ {} "sdalib.so"}
+ {"Dynamic application with SDA" "-melf32ppc tmpdir/sdalib.so" "" {sdadyn.s}
+ {{objdump -R sdadyn.d}} "sdadyn"}
}
set ppc64elftests {
diff --git a/ld/testsuite/ld-powerpc/sdadyn.d b/ld/testsuite/ld-powerpc/sdadyn.d
new file mode 100644
index 0000000..42e389f
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/sdadyn.d
@@ -0,0 +1,8 @@
+
+.*: +file format elf32-powerpc
+
+DYNAMIC RELOCATION RECORDS
+OFFSET TYPE VALUE
+#...
+.* R_PPC_COPY lib_var
+#pass
diff --git a/ld/testsuite/ld-powerpc/sdadyn.s b/ld/testsuite/ld-powerpc/sdadyn.s
new file mode 100644
index 0000000..1b2d13f
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/sdadyn.s
@@ -0,0 +1,3 @@
+ .globl _start
+_start:
+ lwz 3,lib_var@sda21(0)
diff --git a/ld/testsuite/ld-powerpc/sdalib.s b/ld/testsuite/ld-powerpc/sdalib.s
new file mode 100644
index 0000000..8a59938
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/sdalib.s
@@ -0,0 +1,4 @@
+ .globl lib_var
+ .type lib_var, @object
+lib_var:
+ .word 1