This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

GCC 68000 register-relative static data addressing


> Hi,
> I am running GCC 2.95.2 for X 68000 on a Solaris host and want to address
> statics using register-relative data addressing in an embedded multi
> tasking environment.
> That is, 
> when I do this:  	return	foo_data;  
>  rather than this: 	mov.l	_foo_data, d0 
>  I need this:		mov.l	12(a5), d0 
> 
Using the "-fpic" option does not do what I want as it loads "a5" from
GLOBAL_OFFSET_TABLE and this is slow and unnecessary.

That is, with the -fpic option I get the following code:
lea (%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %a5 
move.l foo_data@GOT.w(%a5),%d0 

> I have already set "a5" to point to the static data area and used the
> option "-ffixed-a5" to tell GCC not to use this register for anything
> else.
The a5 register is only ever set once for each task that is running and only
gets changed along with the other registers when a task gets switched in or
out.
Is this possible with GCC?
> Ian
> Ian Barnes
> 

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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