BFD relocations

Camm Maguire camm@enhanced.com
Sun Jun 2 20:42:00 GMT 2002


Greetings!  I saw your post about bfd_get_relocated_section_contents
usage in gdb, and was pleasantly surprised that you had found the same
approach I've been trying to implement over the past few days in gcl
for loading, relocating, and executing objects at runtime in Lisp.  

Problem is, it only seems to work in x86 :-(, at least as far as I can
tell.  Kind of defeats the purpose of using bfd for portability :-).
I've gone through the mips case in detail, and one cannot even call
this routine unless one sets the relocateable argument to true, as it
will result in trying to call _bfd_get_gp_value with a null
argument.  Likewise on ppc, the relocation apparently succeeds, but
the source is not correctly relocated. I've noticed that ld doesn't
seem to actually use this routine, but rather uses a variety of
backend specific routines ...._relocate_section.  Arguments to this no
longer seem canonical, alas.

Just wanted to tap your experience.  Have you tested your gdb patch on
other archs?  Any work beside x86?  Is there another path through the
bfd labyrinth that would simply allow one to load a correctly relocated
section at an arbitrary address, after defining the symbols of course?

Any help most appreciated!

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



More information about the Binutils mailing list