aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-elf')
-rw-r--r--ld/testsuite/ld-elf/pr9676-1.c15
-rw-r--r--ld/testsuite/ld-elf/pr9676-2.c14
-rw-r--r--ld/testsuite/ld-elf/pr9676-3.c7
-rw-r--r--ld/testsuite/ld-elf/pr9676-4.c9
-rw-r--r--ld/testsuite/ld-elf/pr9676.rd5
-rw-r--r--ld/testsuite/ld-elf/shared.exp16
6 files changed, 66 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr9676-1.c b/ld/testsuite/ld-elf/pr9676-1.c
new file mode 100644
index 0000000..f8459c7
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr9676-1.c
@@ -0,0 +1,15 @@
+extern int foo (void) __attribute__((section (".gnu.linkonce.t.1"), weak));
+
+int
+foo (void)
+{
+ return 1;
+}
+
+extern int foo2 (void);
+
+int
+bar (void)
+{
+ return foo2 ();
+}
diff --git a/ld/testsuite/ld-elf/pr9676-2.c b/ld/testsuite/ld-elf/pr9676-2.c
new file mode 100644
index 0000000..e2a3404
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr9676-2.c
@@ -0,0 +1,14 @@
+extern int foo (void) __attribute__((section (".gnu.linkonce.t.1"), weak,
+ __visibility__ ("hidden")));
+
+int
+foo (void)
+{
+ return 1;
+}
+
+int
+foo2 (void)
+{
+ return 1;
+}
diff --git a/ld/testsuite/ld-elf/pr9676-3.c b/ld/testsuite/ld-elf/pr9676-3.c
new file mode 100644
index 0000000..e5985df
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr9676-3.c
@@ -0,0 +1,7 @@
+extern int foo (void) __attribute__((section (".gnu.linkonce.t.1"), weak));
+
+int
+foo (void)
+{
+ return 1;
+}
diff --git a/ld/testsuite/ld-elf/pr9676-4.c b/ld/testsuite/ld-elf/pr9676-4.c
new file mode 100644
index 0000000..d5013c7
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr9676-4.c
@@ -0,0 +1,9 @@
+extern int bar (void);
+extern int foo (void);
+
+int
+x (void)
+{
+ foo ();
+ return bar ();
+}
diff --git a/ld/testsuite/ld-elf/pr9676.rd b/ld/testsuite/ld-elf/pr9676.rd
new file mode 100644
index 0000000..0585b1c
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr9676.rd
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains [0-9]+ entries:
+ +Num: +Value +Size Type +Bind +Vis +Ndx Name
+#...
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +LOCAL +HIDDEN +[0-9]+ +foo
+#...
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index f0bc403..ff8bc8f 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -129,6 +129,22 @@ set build_tests {
{"Build libfunc1.so"
"-shared" "-fPIC"
{func1.c} {} "libfunc1.so"}
+ {"Build libpr9676-1.a"
+ "" "-fPIC"
+ {pr9676-1.c} {} "libpr9676-1.a"}
+ {"Build libpr9676-2.a"
+ "" "-fPIC"
+ {pr9676-2.c} {} "libpr9676-2.a"}
+ {"Build libpr9676-3.so"
+ "-shared" "-fPIC"
+ {pr9676-3.c} {} "libpr9676-3.so"}
+ {"Build libpr9676-4.so"
+ "-shared" "-fPIC"
+ {pr9676-4.c} {} "libpr9676-4.so"}
+ {"Build libpr9676-4a.so"
+ "-shared tmpdir/pr9676-4.o -Ltmpdir -lpr9676-3 -Wl,--start-group -lpr9676-1 -lpr9676-2 -Wl,--end-group"
+ "-fPIC"
+ {dummy.c} {{readelf {-s} pr9676.rd}} "libpr9676-4a.so"}
}
set run_tests {