This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
[arm-thumb] about "-fpic"
- From: <asroot at innoace dot com>
- To: <gcc-help at gcc dot gnu dot org>,<gcc-bugs at gcc dot gnu dot org>
- Date: Mon, 16 Sep 2002 11:00:21 +0900
- Subject: [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