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]

Linker problem with short relocations


Hello,

I am cross-compiling for m68k-coff, and I seem to have have a problem with
the linker (is this the correct list for such questions?).

Given the following two test sources:

	bss
	GLOBL	short_test
test_start:	ds.b	$1000-$400
	ds.b $7000
test_end:
short_test:	ds.l	1
	
	TEXT
	reset
	jmp	entry



and

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


I link these together (starting with the first), with a linker script that
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?

cu
Michael
-- 
Michael Schwingen, Ahornstrasse 36, 52074 Aachen
_______________________________________________
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.