On 2006-05-31, Charles Turner <[EMAIL PROTECTED]> wrote:
> Greetings-
>
> I've been writing some code in Gnu Gas for prc-tools and I had a
> question about syntax. I looked at the ASM output of a C file to get the
> following:
>
>>   lea [EMAIL PROTECTED](%a5),%a1 /*FRED7b*/
>>   move.l %a1,%a0
>>   clr.l 28(%a0)
>
> which clears the long at struct DataRel offset 28.
>
> I'd like to say something like:
>
>>   clr.l [EMAIL PROTECTED](%a5)
>
> but the compiler complains. Is this not possible, or do I have the
> syntax wrong?
>
> More importantly, where can I read more about the "@END" reference so I
> can get a general understanding of referencing structs in Gas?
>
> Best and thanks!
>
> Charles Turner

I'll try to provide a partial answer. The @END type of relocation is a 
hack specific for prc-tools to cope with the fact that we do not know 
where the data and bss sections are located untill runtime. M68k register 
A5 points to the end of the data section when 'launched with globals'.
Hence all references to variables in the data section are done with this 
prc-tools specific relocation type relative to the end of the data section.
Look for COFF_RELEND_RELOC in the binutils sources of prc-tools-2.3 if you 
really want to know the nitty gritty.
As far as I know you will need to do what the C compiler does to get at 
the long att offset 28 of the struct DataRel, but I do not mind if 
somebody correct me ;-).

HTH

Ton van Overbeek

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to