projects
/
binutils-gdb.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
bfd_elf_define_start_stop: Fix check
[binutils-gdb.git]
/
ld
/
testsuite
/
ld-elf
/
pr21964-5.c
1
#define _GNU_SOURCE
2
#include <stdlib.h>
3
#include <stdio.h>
4
#include <dlfcn.h>
5
6
extern
int
foo
(
void
);
7
8
extern
int
__start___verbose
[];
9
extern
int
__stop___verbose
[];
10
int
bar
(
void
)
11
{
12
static int
my_var
__attribute__
((
section
(
"__verbose"
))) =
6
;
13
int
*
ptr
;
14
ptr
= (
int
*)
dlsym
(
RTLD_DEFAULT
,
"__start___verbose"
);
15
if
(!
ptr
|| *
ptr
!=
6
)
16
return
-
1
;
17
return
0
;
18
}
19
20
int
main
()
21
{
22
if
(
bar
() ==
0
)
23
printf
(
"PASS
\n
"
);
24
25
return
0
;
26
}