Projet_SETI_RISC-V/riscv-gnu-toolchain/gdb/ld/testsuite/ld-elf/pr21964-4.c
2023-03-06 14:48:14 +01:00

22 lines
396 B
C

#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;
}