Projet_SETI_RISC-V/riscv-gnu-toolchain/binutils/ld/testsuite/ld-gc/pr19161-2.c

20 lines
249 B
C
Raw Normal View History

2023-03-06 14:48:14 +01:00
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;
}