This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: [arm-thumb] about "-fpic"
- From: Richard Earnshaw <rearnsha at cambridge dot arm dot com>
- To: asroot at innoace dot com
- Cc: gcc-help at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Mon, 16 Sep 2002 14:01:28 +0100
- Subject: Re: [arm-thumb] about "-fpic"
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> hi,
> I want to generate position independent thumb executable code,
> and load RO(.text, .rodata etc) and RW(.data, .bss) section in different
> memory area. ( in ARM7TDMI env. )
> ( At each loading time, the difference between RO start address and RW start
> address is not fixed )
> To avoid rodata address reference error, i loaded ".got" section next to
> .text section.
> And surely, i fixed GOT entry when loading it.
> but i found it did not have any "static" variables in GOT entry.
> It uses offset from GOT address in case of static variables.
> This means .got, .text. and .data should be placed contiguously,
> How can i solve above problem?
You can't. That's how the -fPIC model is designed to work. All the
sections must be consecutive in memory.
>
> I hope the reference from .text to RO(.text, .rodata) area should be PC
> relative not GOT relative nor GOT entry based,
> and the reference from .text to RW(.data, .bss etc) area should be GOT entry
> based.
> Is it possible?
>
Sorry no. At this time only the SVR4-like PIC model is supported.
R.