aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/ia64/pr60465-gprel64.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/ia64/pr60465-gprel64.c')
-rw-r--r--gcc/testsuite/gcc.target/ia64/pr60465-gprel64.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/ia64/pr60465-gprel64.c b/gcc/testsuite/gcc.target/ia64/pr60465-gprel64.c
new file mode 100644
index 00000000000..c00ecc947d9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/ia64/pr60465-gprel64.c
@@ -0,0 +1,27 @@
+/* { dg-do compile { target ia64-*-* } } */
+/* { dg-options "-O2 -fpic" } */
+/* { dg-final { scan-assembler-not "@ltoffx" } } */
+
+/* Test imitates early ld.so setup in glibc
+ where no dynamic relocations must be present. */
+
+struct rtld_global
+{
+ long *p[77];
+};
+
+struct rtld_global _rtld_local __attribute__ ((visibility ("hidden"), section (".sdata")));
+
+static void __attribute__ ((unused, noinline))
+elf_get_dynamic_info (struct rtld_global * g, long * dyn)
+{
+ long **info = g->p;
+
+ info[(0x6ffffeff - *dyn) + 66] = dyn;
+}
+
+void __attribute__ ((unused, noinline))
+_dl_start (long * dyn)
+{
+ elf_get_dynamic_info(&_rtld_local, dyn);
+}