1/* { dg-do compile { target ia64-*-* } } */
2/* { dg-options "-O2 -fpic" } */
3/* { dg-final { scan-assembler-not "@ltoffx" } } */
4
5/* Test imitates early ld.so setup in glibc
6   where no dynamic relocations must be present. */
7
8struct rtld_global
9{
10    long *p[77];
11};
12
13struct rtld_global _rtld_local __attribute__ ((visibility ("hidden"), section (".sdata")));
14
15static void __attribute__ ((unused, noinline))
16elf_get_dynamic_info (struct rtld_global * g, long * dyn)
17{
18  long **info = g->p;
19
20  info[(0x6ffffeff - *dyn) + 66] = dyn;
21}
22
23void __attribute__ ((unused, noinline))
24_dl_start (long * dyn)
25{
26  elf_get_dynamic_info(&_rtld_local, dyn);
27}
28