This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [arm-thumb] about "-fpic"


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]