This is the mail archive of the 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: BFD relocations

Greetings, and thanks for your reply!

Alan Modra <> writes:

> On Sat, Jul 27, 2002 at 12:59:04AM -0400, Camm Maguire wrote:
> > Greetings!  
> > 
> > When called to retrieve non-relocatable output (i.e. with the
> > output_bfd parameter set to 0), bfd_get_relocated_section_contents
> > works on the following platforms:
> > 
> > elf: i386 ppc s390 m68k arm sparc
> > 
> > The following platforms fail:
> > 
> > elf: mips alpha ia64 hppa
> > coff: i386
> > 
> > 1) Is it intended to support this routine on all platforms eventually?
> What itch will it scratch?

In lisp, one frequently wants to load an object *at a specific
address* into a running program, incorporate the object in the
program's data structures, and execute the object as necessary.  gcl
makes use of this functionality.  Later, when a lisp image is saved,
the loaded objects are automatically incorporated in it.  To my
understanding, this cannot be achieved via dlopen.

> > 2) Are patches enabling this function likely to be accepted rather
> > 	easily, or are they likely to break other currently used
> > 	routines? 
> Implementing this function likely won't break anything.


> > 3) Are there recommended guidelines for such patches?  I.e. relatively
> > 	safe places for modifications?
> You'll likely need to implement missing special_function entries for
> reloc howto structures.  It may work out easier in some cases to
> implement a new get_relocated_section_contents function rather than
> trying to use bfd_generic_get_relocated_section_contents.

OK.  A standalone get_relocated_section_contents function per arch
seems the way to go.  I was contemplating modifying the lower level
functions on the order of mips_elf_hi16_reloc, etc., but this does
seem more dangerous.  

The way I'd go about this is to follow what ld does in a debugger.  Is
there a better source of information somewhere?

Also, is there a reason why some arches currently work and others
don't?  I.e., is it just oversight thus far due to the fact that no
one uses the get_relocated_section_contents, or are there arch
specific difficulties which make such a function hard on certain
platforms, e.g. the gp_disp, etc.?

Take care,

> -- 
> Alan Modra
> IBM OzLabs - Linux Technology Centre
> _______________________________________________
> Gcl-devel mailing list

Camm Maguire	
"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]