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]

[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?

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?

Thanks in advance


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