aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf/pr21964-4.c
blob: d50c148027e9df53243fac977e15c060a182c698 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdio.h>

extern int __start___verbose[];
int bar (void)
{
  static int my_var __attribute__ ((section("__verbose"), used)) = 6;
  int *ptr;
  ptr = (int*) dlsym (RTLD_DEFAULT, "__start___verbose");
  if (ptr != NULL || __start___verbose[0] != 6)
    return -1;
  return 0;
}

int
main ()
{
  if (bar () == 0)
    printf ("PASS\n");
  return 0;
}