mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
20 lines
249 B
C
20 lines
249 B
C
|
int __attribute__((section("my_section"))) a[2] = {0x1234, 0x5678};
|
||
|
|
||
|
extern int __start_my_section;
|
||
|
|
||
|
extern int (*p)(void);
|
||
|
|
||
|
int
|
||
|
dump()
|
||
|
{
|
||
|
int* ap = &__start_my_section;
|
||
|
return ap[0];
|
||
|
}
|
||
|
|
||
|
void
|
||
|
__attribute__((constructor))
|
||
|
foo()
|
||
|
{
|
||
|
p = dump;
|
||
|
}
|