This is the mail archive of the
mailing list for the binutils project.
Re: [Gcl-devel] Re: BFD relocations
- From: Camm Maguire <camm at enhanced dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: Daniel Jacobowitz <drow at mvista dot com>, Paul Koning <pkoning at equallogic dot com>, binutils at sources dot redhat dot com, gcl-devel at gnu dot org
- Date: 27 Jul 2002 12:07:57 -0400
- Subject: Re: [Gcl-devel] Re: BFD relocations
- References: <20020604223014.GA7579@nevyn.them.org> <email@example.com> <20020605230537.GA4336@nevyn.them.org> <firstname.lastname@example.org> <20020606010956.GA7291@nevyn.them.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <20020610230608.GA15617@nevyn.them.org> <firstname.lastname@example.org> <20020727070639.GS26054@bubble.sa.bigpond.net.au>
Greetings, and thanks for your reply!
Alan Modra <email@example.com> 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.?
> Alan Modra
> IBM OzLabs - Linux Technology Centre
> Gcl-devel mailing list
Camm Maguire firstname.lastname@example.org
"The earth is but one country, and mankind its citizens." -- Baha'u'llah