summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-mmix
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@bitrange.com>2014-05-10 02:50:01 +0200
committerHans-Peter Nilsson <hp@bitrange.com>2014-05-10 02:52:14 +0200
commiteae25ec5773e12af107e65fcf0c94a54bc5180ae (patch)
tree584bbe1178f76697d0cea1e843819b9027d8c0f3 /ld/testsuite/ld-mmix
parentb1f02b89ed9e9c68eab6f645e19634315a6525c4 (diff)
downloadbinutils-gdb-eae25ec5773e12af107e65fcf0c94a54bc5180ae.tar.gz
Fix freeing of link_info.hash
ld: * ldlang.c (lang_finish): Don't call bfd_link_hash_table_free here. (output_bfd_hash_table_free_fn): New variable. (open_output): Save the _bfd_link_hash_table_free function for the output_bfd into output_bfd_hash_table_free_fn. * ldmain.c (ld_cleanup): If set, call output_bfd_hash_table_free_fn on link_info.hash. * ldlang.h (output_bfd_hash_table_free_fn): Declare. ld/testsuite: * ld-mmix/wrap1.d, ld-mmix/wrap1a.s, ld-mmix/wrap1b.s, ld-mmix/wrap1c.s, ld-mmix/wrap2.d, ld-mmix/wrap3.d, ld-mmix/wrap3a.s, ld-mmix/wrap3b.s, ld-mmix/wrap4.d: New tests.
Diffstat (limited to 'ld/testsuite/ld-mmix')
-rw-r--r--ld/testsuite/ld-mmix/wrap1.d21
-rw-r--r--ld/testsuite/ld-mmix/wrap1a.s2
-rw-r--r--ld/testsuite/ld-mmix/wrap1b.s4
-rw-r--r--ld/testsuite/ld-mmix/wrap1c.s4
-rw-r--r--ld/testsuite/ld-mmix/wrap2.d21
-rw-r--r--ld/testsuite/ld-mmix/wrap3.d21
-rw-r--r--ld/testsuite/ld-mmix/wrap3a.s2
-rw-r--r--ld/testsuite/ld-mmix/wrap3b.s4
-rw-r--r--ld/testsuite/ld-mmix/wrap4.d21
9 files changed, 100 insertions, 0 deletions
diff --git a/ld/testsuite/ld-mmix/wrap1.d b/ld/testsuite/ld-mmix/wrap1.d
new file mode 100644
index 00000000000..02d7bef2a09
--- /dev/null
+++ b/ld/testsuite/ld-mmix/wrap1.d
@@ -0,0 +1,21 @@
+#source: start.s
+#source: wrap1a.s
+#source: wrap1b.s
+#source: wrap1c.s
+#ld: -m mmo --wrap deal
+#as: -no-expand
+#objdump: -d
+
+.*: file format mmo
+
+Disassembly of section \.text:
+
+0+ <(_start|Main)>:
+ 0: e3fd0001 setl \$253,0x1
+ 4: f2000001 pushj \$0,8 <__wrap_deal>
+
+0+8 <__wrap_deal>:
+ 8: f0000001 jmp c <deal>
+
+0+c <deal>:
+ c: fd000000 swym 0,0,0
diff --git a/ld/testsuite/ld-mmix/wrap1a.s b/ld/testsuite/ld-mmix/wrap1a.s
new file mode 100644
index 00000000000..88a5cd216e9
--- /dev/null
+++ b/ld/testsuite/ld-mmix/wrap1a.s
@@ -0,0 +1,2 @@
+ .text
+ pushj $0,deal
diff --git a/ld/testsuite/ld-mmix/wrap1b.s b/ld/testsuite/ld-mmix/wrap1b.s
new file mode 100644
index 00000000000..367aea02124
--- /dev/null
+++ b/ld/testsuite/ld-mmix/wrap1b.s
@@ -0,0 +1,4 @@
+ .text
+ .globl __wrap_deal
+__wrap_deal:
+ jmp __real_deal
diff --git a/ld/testsuite/ld-mmix/wrap1c.s b/ld/testsuite/ld-mmix/wrap1c.s
new file mode 100644
index 00000000000..a7678d4f215
--- /dev/null
+++ b/ld/testsuite/ld-mmix/wrap1c.s
@@ -0,0 +1,4 @@
+ .text
+ .globl deal
+deal:
+ swym 0
diff --git a/ld/testsuite/ld-mmix/wrap2.d b/ld/testsuite/ld-mmix/wrap2.d
new file mode 100644
index 00000000000..49b4d3b4f59
--- /dev/null
+++ b/ld/testsuite/ld-mmix/wrap2.d
@@ -0,0 +1,21 @@
+#source: start.s
+#source: wrap1a.s
+#source: wrap1b.s
+#source: wrap1c.s
+#ld: -m elf64mmix --wrap deal
+#as: -no-expand
+#objdump: -d
+
+.*: file format elf64-mmix
+
+Disassembly of section \.text:
+
+0+ <(_start|Main)>:
+ 0: e3fd0001 setl \$253,0x1
+ 4: f2000001 pushj \$0,8 <__wrap_deal>
+
+0+8 <__wrap_deal>:
+ 8: f0000001 jmp c <deal>
+
+0+c <deal>:
+ c: fd000000 swym 0,0,0
diff --git a/ld/testsuite/ld-mmix/wrap3.d b/ld/testsuite/ld-mmix/wrap3.d
new file mode 100644
index 00000000000..80b20f1f3bc
--- /dev/null
+++ b/ld/testsuite/ld-mmix/wrap3.d
@@ -0,0 +1,21 @@
+#source: start.s
+#source: wrap3a.s
+#source: wrap3b.s
+#source: wrap1c.s
+#ld: -m mmo
+#as: -no-expand
+#objdump: -d
+
+.*: file format mmo
+
+Disassembly of section \.text:
+
+0+ <(_start|Main)>:
+ 0: e3fd0001 setl \$253,0x1
+ 4: f2000001 pushj \$0,8 <__wrap_deal>
+
+0+8 <__wrap_deal>:
+ 8: f0000001 jmp c <deal>
+
+0+c <deal>:
+ c: fd000000 swym 0,0,0
diff --git a/ld/testsuite/ld-mmix/wrap3a.s b/ld/testsuite/ld-mmix/wrap3a.s
new file mode 100644
index 00000000000..7192a932445
--- /dev/null
+++ b/ld/testsuite/ld-mmix/wrap3a.s
@@ -0,0 +1,2 @@
+ .text
+ pushj $0,__wrap_deal
diff --git a/ld/testsuite/ld-mmix/wrap3b.s b/ld/testsuite/ld-mmix/wrap3b.s
new file mode 100644
index 00000000000..6a8a6067c12
--- /dev/null
+++ b/ld/testsuite/ld-mmix/wrap3b.s
@@ -0,0 +1,4 @@
+ .text
+ .globl __wrap_deal
+__wrap_deal:
+ jmp deal
diff --git a/ld/testsuite/ld-mmix/wrap4.d b/ld/testsuite/ld-mmix/wrap4.d
new file mode 100644
index 00000000000..a64578d1304
--- /dev/null
+++ b/ld/testsuite/ld-mmix/wrap4.d
@@ -0,0 +1,21 @@
+#source: start.s
+#source: wrap3a.s
+#source: wrap3b.s
+#source: wrap1c.s
+#ld: -m elf64mmix
+#as: -no-expand
+#objdump: -d
+
+.*: file format elf64-mmix
+
+Disassembly of section \.text:
+
+0+ <(_start|Main)>:
+ 0: e3fd0001 setl \$253,0x1
+ 4: f2000001 pushj \$0,8 <__wrap_deal>
+
+0+8 <__wrap_deal>:
+ 8: f0000001 jmp c <deal>
+
+0+c <deal>:
+ c: fd000000 swym 0,0,0