aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authornobody <>2012-09-19 00:53:31 +0000
committernobody <>2012-09-19 00:53:31 +0000
commit3bc079a79eb8922ca8c812af67f55b25d07b866e (patch)
tree6a67372d5645057a1c7a707c06378441325475c3 /ld
parent37775ec929494a14393eaa3ce88a12a9d215f6da (diff)
downloadgdb-3bc079a79eb8922ca8c812af67f55b25d07b866e.zip
gdb-3bc079a79eb8922ca8c812af67f55b25d07b866e.tar.gz
gdb-3bc079a79eb8922ca8c812af67f55b25d07b866e.tar.bz2
This commit was manufactured by cvs2svn to create branch 'binutils-
2_23-branch'. Cherrypick from master 2012-09-19 00:53:30 UTC H.J. Lu <hjl.tools@gmail.com> 'Properly handle common symbol and weak function': ld/testsuite/ld-elf/comm-data3.sd ld/testsuite/ld-elf/comm-data3a.s ld/testsuite/ld-elf/comm-data3b.s ld/testsuite/ld-ifunc/ifunc-17a-i386.d ld/testsuite/ld-ifunc/ifunc-17a-x86-64.d ld/testsuite/ld-ifunc/ifunc-17a.s ld/testsuite/ld-ifunc/ifunc-17b-i386.d ld/testsuite/ld-ifunc/ifunc-17b-x86-64.d ld/testsuite/ld-ifunc/ifunc-17b.s ld/testsuite/ld-ifunc/ifunc-common-1.out ld/testsuite/ld-ifunc/ifunc-common-1a.c ld/testsuite/ld-ifunc/ifunc-common-1b.c
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-elf/comm-data3.sd3
-rw-r--r--ld/testsuite/ld-elf/comm-data3a.s11
-rw-r--r--ld/testsuite/ld-elf/comm-data3b.s6
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-17a-i386.d10
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-17a-x86-64.d10
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-17a.s11
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-17b-i386.d10
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-17b-x86-64.d10
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-17b.s6
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-common-1.out1
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-common-1a.c9
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-common-1b.c12
12 files changed, 99 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/comm-data3.sd b/ld/testsuite/ld-elf/comm-data3.sd
new file mode 100644
index 0000000..5a96ed7
--- /dev/null
+++ b/ld/testsuite/ld-elf/comm-data3.sd
@@ -0,0 +1,3 @@
+#...
+ +[0-9]+: +[0-9a-f]+ +4 +OBJECT +GLOBAL +DEFAULT +[1-9] foo
+#pass
diff --git a/ld/testsuite/ld-elf/comm-data3a.s b/ld/testsuite/ld-elf/comm-data3a.s
new file mode 100644
index 0000000..e0bde49
--- /dev/null
+++ b/ld/testsuite/ld-elf/comm-data3a.s
@@ -0,0 +1,11 @@
+ .globl main
+ .globl start
+ .globl _start
+ .globl __start
+ .text
+main:
+start:
+_start:
+__start:
+ .byte 0
+ .common foo,4,4
diff --git a/ld/testsuite/ld-elf/comm-data3b.s b/ld/testsuite/ld-elf/comm-data3b.s
new file mode 100644
index 0000000..837a099
--- /dev/null
+++ b/ld/testsuite/ld-elf/comm-data3b.s
@@ -0,0 +1,6 @@
+ .weak foo
+ .type foo,%function
+ .size foo,1
+ .text
+foo:
+ .byte 1
diff --git a/ld/testsuite/ld-ifunc/ifunc-17a-i386.d b/ld/testsuite/ld-ifunc/ifunc-17a-i386.d
new file mode 100644
index 0000000..303b54e
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-17a-i386.d
@@ -0,0 +1,10 @@
+#source: ifunc-17a.s
+#source: ifunc-17b.s
+#ld: -static -m elf_i386
+#as: --32
+#readelf: -s --wide
+#target: x86_64-*-* i?86-*-*
+
+#...
+ +[0-9]+: +[0-9a-f]+ +4 +OBJECT +GLOBAL +DEFAULT +[1-9] foo
+#pass
diff --git a/ld/testsuite/ld-ifunc/ifunc-17a-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-17a-x86-64.d
new file mode 100644
index 0000000..965ef63
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-17a-x86-64.d
@@ -0,0 +1,10 @@
+#source: ifunc-17a.s
+#source: ifunc-17b.s
+#ld: -static -m elf_x86_64
+#as: --64
+#readelf: -s --wide
+#target: x86_64-*-*
+
+#...
+ +[0-9]+: +[0-9a-f]+ +4 +OBJECT +GLOBAL +DEFAULT +[1-9] foo
+#pass
diff --git a/ld/testsuite/ld-ifunc/ifunc-17a.s b/ld/testsuite/ld-ifunc/ifunc-17a.s
new file mode 100644
index 0000000..e0bde49
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-17a.s
@@ -0,0 +1,11 @@
+ .globl main
+ .globl start
+ .globl _start
+ .globl __start
+ .text
+main:
+start:
+_start:
+__start:
+ .byte 0
+ .common foo,4,4
diff --git a/ld/testsuite/ld-ifunc/ifunc-17b-i386.d b/ld/testsuite/ld-ifunc/ifunc-17b-i386.d
new file mode 100644
index 0000000..82ccac2
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-17b-i386.d
@@ -0,0 +1,10 @@
+#source: ifunc-17b.s
+#source: ifunc-17a.s
+#ld: -static -m elf_i386
+#as: --32
+#readelf: -s --wide
+#target: x86_64-*-* i?86-*-*
+
+#...
+ +[0-9]+: +[0-9a-f]+ +4 +OBJECT +GLOBAL +DEFAULT +[1-9] foo
+#pass
diff --git a/ld/testsuite/ld-ifunc/ifunc-17b-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-17b-x86-64.d
new file mode 100644
index 0000000..7527eae
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-17b-x86-64.d
@@ -0,0 +1,10 @@
+#source: ifunc-17b.s
+#source: ifunc-17a.s
+#ld: -static -m elf_x86_64
+#as: --64
+#readelf: -s --wide
+#target: x86_64-*-*
+
+#...
+ +[0-9]+: +[0-9a-f]+ +4 +OBJECT +GLOBAL +DEFAULT +[1-9] foo
+#pass
diff --git a/ld/testsuite/ld-ifunc/ifunc-17b.s b/ld/testsuite/ld-ifunc/ifunc-17b.s
new file mode 100644
index 0000000..66abe04
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-17b.s
@@ -0,0 +1,6 @@
+ .weak foo
+ .type foo, %gnu_indirect_function
+ .size foo,1
+ .text
+foo:
+ .byte 1
diff --git a/ld/testsuite/ld-ifunc/ifunc-common-1.out b/ld/testsuite/ld-ifunc/ifunc-common-1.out
new file mode 100644
index 0000000..31a3ce2
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-common-1.out
@@ -0,0 +1 @@
+PASSED: 0
diff --git a/ld/testsuite/ld-ifunc/ifunc-common-1a.c b/ld/testsuite/ld-ifunc/ifunc-common-1a.c
new file mode 100644
index 0000000..794ca45
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-common-1a.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int foo;
+int
+main ()
+{
+ printf ("PASSED: %d\n", foo);
+ return 0;
+}
diff --git a/ld/testsuite/ld-ifunc/ifunc-common-1b.c b/ld/testsuite/ld-ifunc/ifunc-common-1b.c
new file mode 100644
index 0000000..1235942
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-common-1b.c
@@ -0,0 +1,12 @@
+void alt (void) { }
+
+void foo (void);
+void * foo_ifunc (void) __asm__ ("foo");
+__asm__(".type foo, %gnu_indirect_function");
+__asm__(".weak foo");
+
+void *
+foo_ifunc (void)
+{
+ return alt;
+}