What is 'jump relocation out-of-range' ?

Chris Torek chris at mimsy.umd.edu
Thu Mar 8 21:58:23 AEST 1990


In article <2468.25dfeb50 at esat.kuleuven.ac.be> elsen at esat.kuleuven.ac.be
asks what

>/lib/libc.a(_exit.o): jump relocation out-of-range, bad object 
>file produced, can't jump from 0x412d28 to 0x1000334c (abort)
>*** Error code 1

means.

The MIPS compiler/linker puts code at addresses 0x00400000 upward,
and puts data at 0x10000000 upward.  If you accidentally try to invoke
data as code, the compiler generates `jump' (actually jalr, Jump And
Link Register) instructions from code locations (_exit, 0x412d28) to data
locations (abort, 0x1000334c), but this is too far away (more than 2^26)
for the jalr instruction's address field, so that the linker complains.
This is better than on the VAX, where the linker makes the subroutine
call go to the data location, and then the program explodes at runtime.

What you have done is name a global variable `abort'.  The C library
_exit() routine calls abort() under some (unknown) circumstances.  When
it wants to call abort(), it will instead try to call your abort variable.
Who knows what will happen then. . . .
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.ultrix mailing list