This is the mail archive of the gcc@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: -msep-data without -fPIC ?


On Wed, Jan 18, 2006 at 12:11:46AM +0100, Philippe De Muyter wrote:
> > GCC diffs upto 3.4.0 are available here:
> > 
> >    ftp://ftp.back2roots.org/pub/geekgadgets/amiga/m68k/alpha/gcc/
> 
> I have downloaded them, and found the -baserel(32) and -resident(32) options.

-resident is translated to -baserel for the compiler.

> That seems to be a good starting point, but is not precisely what I meant.
> 
> What I meant is :
> 
> 	.text segment is not pic and is linked for a well known address,
> 	.rodata segment is linked for a fixed address.
> 	Initialized data containing references to the text or rodata
> 	are kept in rodata, as they need no relocation.

Your port has to select the proper section itself. The address for these
sections should be selected by ld.

> 	data, bss, and initialized data containing references to data or bss
> 	are accessed via a5
> 
> Is that available ?

Thats almost excatly what -baserel does: every code access to data or bss
goes through an index register which is PIC_OFFSET_TABLE_REGNUM (thats %A4
with the AmigaOS port). data or bss references from the data segment itself
are resolved by the program loader. The resident option is used if one wants
to duplicate the combined data/bss segment. ld emits all offsets within the
data segment which have to be adapted for the new segment start address.

Gunther


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