This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Relocating an ELF file
On Fri, Jun 07, 2002 at 03:03:02PM +0200, andre_hauser@hsgmed.com wrote:
> I've the following situation.
>
> An ELF file including program header, section info, symbols and relocation
> tables has to be relocated, i.e. a section has to be moved to another memory
> location and all relocatable references from other sections have to be
> adapted.
Is it a shared library or binary?
Unless you link with --emit-reloc, there is IMHO no way to do this for
binaries as you loose a lot of information for that during the link.
Shared libraries are doable quite easily, e.g. with prelink -r 0xsomeaddr somedso.so
But the code to do all that in prelink is not very short and doing it
in bfd framework would be even harder (prelink uses libelf).
Jakub