patterso@cs.scarolina.edu (Mitchell Patterson) (06/27/91)
I'm trying to implement incremental loading on a DECstation 2100 under Ultrix
4.0, and that message about jump relocation is what I get when I try to set
the start of the text segment to an address that is some magic amount
higher than that of a function in the file I'm using as a base. What's the
limit for a jump? A page boundary? Can I get around it? If so, does anyone
have any ideas?
Here's what I'm doing:
(1) Compile the file test.c with the flag -G 0 set. That file contains
the following:
int foo()
{
puts("I'm here!");
}
(2) I have another program which does this:
(a) Read the section headers for .text, .data, and .bss to get
their sizes.
(b) Add those sizes up and malloc that much memory. I believe
malloc(3) claims that the memory it returns is suitably
aligned for just about anything.
(c) Issue this command:
"ld -A <base program> -N -T <the address returned by malloc> test.o"
The -N tells ld to make data follow text and to make text
writeable, I believe; it may be a frill.
(d) I sit for a little while, and then I get that message about
jump relocation out of range. I've played with it a little,
sending bogus values to -T like 48; the loader doesn't complain.
Since I'd like to use ld to handle the relocation instead of doing it myself,
I'd appreciate any advice anyone can give. I mainly need to know how to get
ld to relocate based on an arbitrarily-large (*) value for -T.
Thanks!
Mitch
(*) since malloc will probably return high addresses?
--
-----------------------------------------------------------------------------
I have 6 personalities, but they're all identical.
Mitch Patterson - eXpert eXplorer project - patterso@usceast.cs.scarolina.edu
-----------------------------------------------------------------------------