aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2006-06-14 08:27:41 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2006-06-14 08:27:41 +0000
commitcc3e26bed74f5e492b5d042afe2c2616975de445 (patch)
tree2489da5f10688b77c52d166aac4a27ba18242287 /ld
parent5fa222e4424d1e940baaff61d73b704588ff970e (diff)
downloadgdb-cc3e26bed74f5e492b5d042afe2c2616975de445.zip
gdb-cc3e26bed74f5e492b5d042afe2c2616975de445.tar.gz
gdb-cc3e26bed74f5e492b5d042afe2c2616975de445.tar.bz2
bfd/
* elf32-m68k.c (elf_m68k_plt_info): New structure. (elf_m68k_plt0_entry): Add R_68K_PC32-style in-place addends. (elf_m68k_plt_entry): Likewise. (elf_m68k_plt_info): New table. (CFV4E_PLT_ENTRY_SIZE): Rename to... (ISAB_PLT_ENTRY_SIZE): ...this. (CFV4E_FLAG): Delete. (elf_cfv4e_plt0_entry): Rename to... (elf_isab_plt0_entry): ...this. Adjust comments. Use (-6,%pc,%d0) for the second instruction too. (elf_cfv4e_plt_entry): Rename to... (elf_isab_plt_entry): ...this. Adjust comments and use (-6,%pc,%d0). (elf_isab_plt_info): New table. (CPU32_FLAG): Delete. (PLT_CPU32_ENTRY_SIZE): Rename to... (CPU32_PLT_ENTRY_SIZE): ...this. (elf_cpu32_plt0_entry): Update bounds accordingly. Add R_68K_PC32- style in-place addends. (elf_cpu32_plt_entry): Likewise. (elf_cpu32_plt_info): New table. (elf_m68k_link_hash_table): Add a plt_info field. (elf_m68k_link_hash_table_create): Initialize it. (elf_m68k_get_plt_info): New function. (elf_m68k_always_size_sections): Likewise. (elf_m68k_adjust_dynamic_symbol): Use the plt_info hash table field. (elf_m68k_install_pc32): New function. (elf_m68k_finish_dynamic_symbol): Factor code using plt_info and elf_m68k_install_pc32. (elf_m68k_finish_dynamic_sections): Likewise. (elf_m68k_plt_sym_val): Use elf_m68k_get_plt_info. (elf_backend_always_size_sections): Define. ld/testsuite/ * ld-m68k/plt1.s, ld-m68k/plt1-empty.s, ld-m68k/plt1.ld: New files. * ld-m68k/plt1-68020.d, ld-m68k/plt1-cpu32.d: Likewise. * ld-m68k/plt1-isab.d: Likewise. * ld-m68k/m68k.exp: Run new PLT tests.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-m68k/m68k.exp9
-rw-r--r--ld/testsuite/ld-m68k/plt1-68020.d35
-rw-r--r--ld/testsuite/ld-m68k/plt1-cpu32.d43
-rw-r--r--ld/testsuite/ld-m68k/plt1-empty.s3
-rw-r--r--ld/testsuite/ld-m68k/plt1-isab.d44
-rw-r--r--ld/testsuite/ld-m68k/plt1.ld23
-rw-r--r--ld/testsuite/ld-m68k/plt1.s3
8 files changed, 167 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 66a5dac..fb9b87d 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2006-06-14 Richard Sandiford <richard@codesourcery.com>
+
+ * ld-m68k/plt1.s, ld-m68k/plt1-empty.s, ld-m68k/plt1.ld: New files.
+ * ld-m68k/plt1-68020.d, ld-m68k/plt1-cpu32.d: Likewise.
+ * ld-m68k/plt1-isab.d: Likewise.
+ * ld-m68k/m68k.exp: Run new PLT tests.
+
2006-06-12 Thiemo Seufer <ths@mips.com>
* ld-mips-elf/multi-got-no-shared.d: Adjust for recent change of
diff --git a/ld/testsuite/ld-m68k/m68k.exp b/ld/testsuite/ld-m68k/m68k.exp
index a1096a8..042f1b9 100644
--- a/ld/testsuite/ld-m68k/m68k.exp
+++ b/ld/testsuite/ld-m68k/m68k.exp
@@ -53,3 +53,12 @@ run_dump_test "merge-error-1d"
run_dump_test "merge-error-1e"
run_dump_test "merge-ok-1a"
run_dump_test "merge-ok-1b"
+
+foreach { id sources } { a { plt1.s } b { plt1-empty.s plt1.s } } {
+ foreach arch { 68020 cpu32 isab } {
+ run_ld_link_tests [list \
+ [list "PLT 1$id ($arch)" "-shared -T plt1.ld" "-m$arch" \
+ $sources [list [list objdump -dr plt1-$arch.d]] \
+ plt1-${id}-${arch}.so]]
+ }
+}
diff --git a/ld/testsuite/ld-m68k/plt1-68020.d b/ld/testsuite/ld-m68k/plt1-68020.d
new file mode 100644
index 0000000..964acb6
--- /dev/null
+++ b/ld/testsuite/ld-m68k/plt1-68020.d
@@ -0,0 +1,35 @@
+
+.*: file format elf32-m68k
+
+Disassembly of section \.plt:
+
+00020800 <f.@plt-0x14>:
+ 20800: 2f3b 0170 0000 movel %pc@\(30404 <_GLOBAL_OFFSET_TABLE_\+0x4>\),%sp@-
+ 20806: fc02
+ 20808: 4efb 0171 0000 jmp %pc@\(30408 <_GLOBAL_OFFSET_TABLE_\+0x8>\)@\(00000000\)
+ 2080e: fbfe
+ 20810: 0000 0000 orib #0,%d0
+
+00020814 <f.@plt>:
+ 20814: 4efb 0171 0000 jmp %pc@\(3040c <_GLOBAL_OFFSET_TABLE_\+0xc>\)@\(00000000\)
+ 2081a: fbf6
+ 2081c: 2f3c 0000 0000 movel #0,%sp@-
+ 20822: 60ff ffff ffdc bral 20800 <f.@plt-0x14>
+
+00020828 <f.@plt>:
+ 20828: 4efb 0171 0000 jmp %pc@\(30410 <_GLOBAL_OFFSET_TABLE_\+0x10>\)@\(00000000\)
+ 2082e: fbe6
+ 20830: 2f3c 0000 000c movel #12,%sp@-
+ 20836: 60ff ffff ffc8 bral 20800 <f.@plt-0x14>
+
+0002083c <f.@plt>:
+ 2083c: 4efb 0171 0000 jmp %pc@\(30414 <_GLOBAL_OFFSET_TABLE_\+0x14>\)@\(00000000\)
+ 20842: fbd6
+ 20844: 2f3c 0000 0018 movel #24,%sp@-
+ 2084a: 60ff ffff ffb4 bral 20800 <f.@plt-0x14>
+Disassembly of section \.text:
+
+00020c00 <.*>:
+ 20c00: 61ff ffff fc.. bsrl 208.. <f1@plt>
+ 20c06: 61ff ffff fc.. bsrl 208.. <f2@plt>
+ 20c0c: 61ff ffff fc.. bsrl 208.. <f3@plt>
diff --git a/ld/testsuite/ld-m68k/plt1-cpu32.d b/ld/testsuite/ld-m68k/plt1-cpu32.d
new file mode 100644
index 0000000..a497740
--- /dev/null
+++ b/ld/testsuite/ld-m68k/plt1-cpu32.d
@@ -0,0 +1,43 @@
+
+.*: file format elf32-m68k
+
+Disassembly of section \.plt:
+
+00020800 <f.@plt-0x18>:
+ 20800: 2f3b 0170 0000 movel %pc@\(30404 <_GLOBAL_OFFSET_TABLE_\+0x4>\),%sp@-
+ 20806: fc02
+ 20808: 227b 0170 0000 moveal %pc@\(30408 <_GLOBAL_OFFSET_TABLE_\+0x8>\),%a1
+ 2080e: fbfe
+ 20810: 4ed1 jmp %a1@
+ 20812: 0000 0000 orib #0,%d0
+ \.\.\.
+
+00020818 <f.@plt>:
+ 20818: 227b 0170 0000 moveal %pc@\(3040c <_GLOBAL_OFFSET_TABLE_\+0xc>\),%a1
+ 2081e: fbf2
+ 20820: 4ed1 jmp %a1@
+ 20822: 2f3c 0000 0000 movel #0,%sp@-
+ 20828: 60ff ffff ffd6 bral 20800 <f.@plt-0x18>
+ \.\.\.
+
+00020830 <f.@plt>:
+ 20830: 227b 0170 0000 moveal %pc@\(30410 <_GLOBAL_OFFSET_TABLE_\+0x10>\),%a1
+ 20836: fbde
+ 20838: 4ed1 jmp %a1@
+ 2083a: 2f3c 0000 000c movel #12,%sp@-
+ 20840: 60ff ffff ffbe bral 20800 <f.@plt-0x18>
+ \.\.\.
+
+00020848 <f.@plt>:
+ 20848: 227b 0170 0000 moveal %pc@\(30414 <_GLOBAL_OFFSET_TABLE_\+0x14>\),%a1
+ 2084e: fbca
+ 20850: 4ed1 jmp %a1@
+ 20852: 2f3c 0000 0018 movel #24,%sp@-
+ 20858: 60ff ffff ffa6 bral 20800 <f.@plt-0x18>
+ \.\.\.
+Disassembly of section \.text:
+
+00020c00 <.*>:
+ 20c00: 61ff ffff fc.. bsrl 208.. <f1@plt>
+ 20c06: 61ff ffff fc.. bsrl 208.. <f2@plt>
+ 20c0c: 61ff ffff fc.. bsrl 208.. <f3@plt>
diff --git a/ld/testsuite/ld-m68k/plt1-empty.s b/ld/testsuite/ld-m68k/plt1-empty.s
new file mode 100644
index 0000000..a59477d
--- /dev/null
+++ b/ld/testsuite/ld-m68k/plt1-empty.s
@@ -0,0 +1,3 @@
+ .text
+ .globl foo
+foo:
diff --git a/ld/testsuite/ld-m68k/plt1-isab.d b/ld/testsuite/ld-m68k/plt1-isab.d
new file mode 100644
index 0000000..a9aeacb
--- /dev/null
+++ b/ld/testsuite/ld-m68k/plt1-isab.d
@@ -0,0 +1,44 @@
+
+.*: file format elf32-m68k
+
+Disassembly of section \.plt:
+
+00020800 <f.@plt-0x18>:
+# _GLOBAL_OFFSET_TABLE_ + 4 == 0x30404 == 0x20802 + 0xfc02
+ 20800: 203c 0000 fc02 movel #64514,%d0
+ 20806: 2f3b 08fa movel %pc@\(20802 <f.@plt-0x16>,%d0:l\),%sp@-
+# _GLOBAL_OFFSET_TABLE_ + 8 == 0x30408 == 0x2080c + 0xfbfc
+ 2080a: 203c 0000 fbfc movel #64508,%d0
+ 20810: 207b 08fa moveal %pc@\(2080c <f.@plt-0xc>,%d0:l\),%a0
+ 20814: 4ed0 jmp %a0@
+ 20816: 4e71 nop
+
+00020818 <f.@plt>:
+# _GLOBAL_OFFSET_TABLE_ + 12 == 0x3040c == 0x2081a + 0xfbf2
+ 20818: 203c 0000 fbf2 movel #64498,%d0
+ 2081e: 207b 08fa moveal %pc@\(2081a <f.@plt\+0x2>,%d0:l\),%a0
+ 20822: 4ed0 jmp %a0@
+ 20824: 2f3c 0000 0000 movel #0,%sp@-
+ 2082a: 60ff ffff ffd4 bral 20800 <f.@plt-0x18>
+
+00020830 <f.@plt>:
+# _GLOBAL_OFFSET_TABLE_ + 16 == 0x30410 == 0x20832 + 0xfbde
+ 20830: 203c 0000 fbde movel #64478,%d0
+ 20836: 207b 08fa moveal %pc@\(20832 <f.@plt\+0x2>,%d0:l\),%a0
+ 2083a: 4ed0 jmp %a0@
+ 2083c: 2f3c 0000 000c movel #12,%sp@-
+ 20842: 60ff ffff ffbc bral 20800 <f.@plt-0x18>
+
+00020848 <f.@plt>:
+# _GLOBAL_OFFSET_TABLE_ + 20 == 0x30414 == 0x2084a + 0xfbca
+ 20848: 203c 0000 fbca movel #64458,%d0
+ 2084e: 207b 08fa moveal %pc@\(2084a <f.@plt\+0x2>,%d0:l\),%a0
+ 20852: 4ed0 jmp %a0@
+ 20854: 2f3c 0000 0018 movel #24,%sp@-
+ 2085a: 60ff ffff ffa4 bral 20800 <f.@plt-0x18>
+Disassembly of section \.text:
+
+00020c00 <.*>:
+ 20c00: 61ff ffff fc.. bsrl 208.. <f1@plt>
+ 20c06: 61ff ffff fc.. bsrl 208.. <f2@plt>
+ 20c0c: 61ff ffff fc.. bsrl 208.. <f3@plt>
diff --git a/ld/testsuite/ld-m68k/plt1.ld b/ld/testsuite/ld-m68k/plt1.ld
new file mode 100644
index 0000000..718e2ad
--- /dev/null
+++ b/ld/testsuite/ld-m68k/plt1.ld
@@ -0,0 +1,23 @@
+SECTIONS
+{
+ . = 0x20000;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+
+ . = ALIGN (0x400);
+ .rela.plt : { *(.rela.plt) }
+
+ . = ALIGN (0x400);
+ .plt : { *(.plt) }
+
+ . = ALIGN (0x400);
+ .text : { *(.text) }
+
+ . = ALIGN (0x10000);
+ .dynamic : { *(.dynamic) }
+
+ . = ALIGN (0x400);
+ .got : { *(.got.plt) *(.got) }
+}
diff --git a/ld/testsuite/ld-m68k/plt1.s b/ld/testsuite/ld-m68k/plt1.s
new file mode 100644
index 0000000..855fb19
--- /dev/null
+++ b/ld/testsuite/ld-m68k/plt1.s
@@ -0,0 +1,3 @@
+ bsr.l f1@PLTPC
+ bsr.l f2@PLTPC
+ bsr.l f3@PLTPC