This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Gcl-devel] Re: relocation overflow


Greetings, and thanks for your reply!

Geoff Keating <geoffk@geoffk.org> writes:

> Daniel Jacobowitz <drow@mvista.com> writes:
> 
> > On Wed, Nov 20, 2002 at 12:01:59PM -0500, Camm Maguire wrote:
> > > Greetings, and thanks for your reply.
> > > 
> > > The relocation type is R_PPC_REL24.  I've got the failure up now in
> > > gdb and can backtrace into the bfd library if this would help.
> > 
> > Presumably it won't help - bear in mind, this is a _24-bit_ relocation. 
> > You have to load modules close enough that that suffices, or else you
> > have to insert trampolines for longer jumps... through a GOT or
> > whatever.
> > 
> > PowerPC GCC doesn't seem to have a long-calls option, so you're just
> > out of luck if you can't fit things in 16MB.  Trampolines may be the
> > way to go.
> 
> The way this is normally done, for programs that load arbitrary
> modules, is that each module is a .so file, is built with -fpic, and
> is loaded using the dlsym functions.  Then the limit is 32Mb per
> module, and you can have as many modules as your address space can
> fit; cross-module calls happen through a PLT which can perform long
> jumps.

OK, when I first read this, I thought that -fPIC would eliminate 24bit
relocs.  I was mistaken, and have just verified that the reloc
overflows are different, but still present, when adding -fPIC.  On
rereading this, it appears as though the dlym code has trampolines to
handle long calls on 24bit relocs.  Maybe I should look here.

> 
> I'm not sure how GCL works, but is it possible that you simply haven't
> built the modules with -fpic?
> 

In general, we're trying to avoid dlopen, as we need to fix the
relative location of the module in the executable's address space
across multiple program invocations.  This allows us to use an Emacs
style unexec to dump an executable image with loaded modules inside
which will have valid references to them when the program is
restarted. 

Take care,


> -- 
> - Geoffrey Keating <geoffk@geoffk.org>
> 
> 
> _______________________________________________
> Gcl-devel mailing list
> Gcl-devel@gnu.org
> http://mail.gnu.org/mailman/listinfo/gcl-devel
> 
> 

-- 
Camm Maguire			     			camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]