[email protected]:~$ gcc test.c -Ttest.lds -nostdlib -otest.o
[email protected]:~$ nm test.o
fffffffff7fffff8 A __a
0000000008000008 B a
0000000008000000 D b
[email protected]:~$ cat test.lds
SECTIONS
{
. = 0x10000;
.text : { *(.text) }
. = 0x8000000;
.data : { *(.data) }
.bss : { *(.bss) }
__a = 0 - a;
}
[email protected]:~$ cat test.c
int a = 0;
extern int __a;
int *b = &__a;