Xref: utzoo comp.sys.mips:1768 comp.unix.ultrix:7898 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!spool.mu.edu!samsung!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!orion.oac.uci.edu!unogate!mvb.saic.com!ncr-sd!ncrcae!opusc!usceast!patterso From: patterso@cs.scarolina.edu (Mitchell Patterson) Newsgroups: comp.sys.mips,comp.unix.ultrix Subject: ``jump relocation out-of-range''? Summary: ld -A -N -T Keywords: incremental loading, dynamic linking, confusion Message-ID: Date: 26 Jun 91 22:26:00 GMT Sender: usenet@usceast.cs.scarolina.edu (USENET News System) Distribution: comp Organization: USC Department of Computer Science Lines: 46 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 -N -T 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 -----------------------------------------------------------------------------