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


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

Re: Linker problem with short relocations


Hi,

[....]
> 	GLOBL	short_test, entry
> 	
> 	text
> entry:	move.l	short_test.w,d0
> 	bra	entry

You are explicitly using the adressing mode "Absolute Short" by
adding the ".w" to your operand. In this mode the address range 
goes from 0...$7FFF and $FFFF8000... $FFFFFFFF.
or in other words from -32768 ... 32767.

That's no bug - it's a (Motorola) addressing feature!

> I link these together (starting with the first), with a linker scriptthat
> specifies BSS to start at $400, so that short addressing is possible for the
> first variables.
> 
> However, when I get past the $8000 limit (by using more space for test_start
> in this example), I get the following code after linking (output format is
> binary, TEXT is at $00e00000):
> 
>    0:   4e70            reset
>    2:   4ef9 00e0 0008  jmp 0xe00008
>    8:   2038 8000       movel 0xffff8000,%d0  ; <---- this is not OK
>    c:   60fa            bras 0x8
> 
> Which means that the linker generated a relocation into the BSS segment for
> a short access which now points to $FFFF8000 instead of $00008000 (where the
> RAM is) - without giving me any warning.
> 
> How do I make the linker produce warnings (or even errors) in this case?

As said - no linker Problem - use absolute addressing without the 
.w suffix for an access above $7FFF.

The feature is, to provide a faster and shorter access for 
1. system variables (0...$7FFF) and 
2. where you should put periperals or the provided onboard 
modules like TPU, SIM, QSM ... (MC683xx) are mapped in.
Thats from $FFFF8000...$FFFFFFFF.


Richard.

---
Dipl.-Ing. (FH) Richard Apeltauer
FH Ravensburg-Weingarten, Labor Robotertechnik
Doggenriedstrasse, D-88250 Weingarten
Tel: +49-751-501708  Fax: +49-751-49240
WWW: http://robotik.fbp.fh-weingarten.de
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.