This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Position-independent linker script symbols
- From: Ian Lance Taylor <iant at google dot com>
- To: "Luke Trowbridge" <ltrowbridge at electrodata dot com>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 14 Jul 2010 03:43:54 -0700
- Subject: Re: Position-independent linker script symbols
- References: <BC50645B76EB48329940743CEAF6A5AF@Luke>
"Luke Trowbridge" <ltrowbridge@electrodata.com> writes:
> The following code is produced:
> a0000000 <main>:
> a0000000: e59f300c ldr r3, [pc, #12] ; a0000014 <__rodata_start__+0x14>
> a0000004: e08f3003 add r3, pc, r3
> a0000008: e59f2008 ldr r2, [pc, #8] ; a0000018 <__rodata_start__+0x18>
> a000000c: e7930002 ldr r0, [r3, r2]
> a0000010: e12fff1e bx lr
> a0000014: 00000010 .word 0x00000010
> a0000018: 00000000 .word 0x00000000
>
> As I understand, this will return 0, instead of the expected
> 0xA0000000.
Are you looking at the final linked executable? I would expect there to
be a relocation on the address at 0xa000018. If it is fully linked,
look at the dynamic relocations.
Ian