Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!amelia!orville.nas.nasa.gov!hultquis From: hultquis@orville.nas.nasa.gov (Jeff P.M. Hultquist) Newsgroups: comp.sys.sgi Subject: Re: "Relocation out-of-range" errors Message-ID: <3366@amelia.nas.nasa.gov> Date: 9 Oct 89 16:55:18 GMT References: <14188@shamash.cdc.com> <28025@mips.mips.COM> <42681@sgi.sgi.com> Sender: news@amelia.nas.nasa.gov Reply-To: hultquis@nas.nasa.gov (Jeff P.M. Hultquist) Distribution: usa Organization: NASA Ames Research Center, Moffett Field, CA Lines: 27 > From: davea@quasar.wpd.sgi.com (David B. Anderson) > > In article <14188@shamash.cdc.com> pwp@shamash.UUCP (Pete Poorman) writes: > > > A few weeks back Steve Maurer asked what caused > > > "jump relocation out of range" errors, ... > > > Can someone please explain again? > > > > The question was answered by: > > len@synthesis.Synthesis.COM (Len Lattanzi) in <28025@mips.mips.COM> > > > ;;Typically this is caused by one importing module referencing a > > > symbol as text and trying to jump to it. And the exporting module > > > defining the symbol to be data. Text and Data are normally too > > > far apart to jump between. > > In the ZMAGIC format (the format used for executables in IRIX) code starts > at 0x400000 and data starts at 0x10000000. I ran into this problem when implemented a simple dynamic loader for the Personal Iris. The newly compiled code would be loaded into a malloc'ed chunk of memory, and the address of that block would then be treated as a pointer to a function. The way around this problem is to place Data and Text more closely together when building the application. How does one do this? cc -Wl,-D,a000000 This instructs the linker to place the Data segment lower in the address space.