public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* [arm-thumb] About "-fpic"
       [not found] ` <3D810594.9070406@moene.indiv.nluug.nl>
@ 2002-09-12 18:56   ` asroot
  0 siblings, 0 replies; 3+ messages in thread
From: asroot @ 2002-09-12 18:56 UTC (permalink / raw)
  To: gcc-help, gcc-gnats, gcc-bugs

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.


 
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [arm-thumb] about "-fpic"
  2002-09-15 19:01 [arm-thumb] about "-fpic" asroot
@ 2002-09-16  6:02 ` Richard Earnshaw
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Earnshaw @ 2002-09-16  6:02 UTC (permalink / raw)
  To: asroot; +Cc: gcc-help, gcc-bugs, Richard.Earnshaw

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [arm-thumb] about "-fpic"
@ 2002-09-15 19:01 asroot
  2002-09-16  6:02 ` Richard Earnshaw
  0 siblings, 1 reply; 3+ messages in thread
From: asroot @ 2002-09-15 19:01 UTC (permalink / raw)
  To: gcc-help, gcc-bugs

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-09-16 13:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.SOL.4.21.0209121443070.354-300000@ironwood.sucs.soton.ac.uk>
     [not found] ` <3D810594.9070406@moene.indiv.nluug.nl>
2002-09-12 18:56   ` [arm-thumb] About "-fpic" asroot
2002-09-15 19:01 [arm-thumb] about "-fpic" asroot
2002-09-16  6:02 ` Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).