This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: Change an object file without explicit copying
- From: andre_hauser at hsgmed dot com
- To: hjl at lucon dot org
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 10 Jul 2002 10:58:13 +0200
- Subject: RE: Change an object file without explicit copying
Hi H.J.,
I am using bfd because I need its functionality for performing relocations;
that's why I can't change to libelf.
In my actual program, a bfd(1) is opened for reading an ELF file and copied
to a bfd(2) created with bfd_openw() (some of the object's details are being
modified while doing this).
Then I close this recently created bfd(2) and copy it byte by byte
(i.e. without using bfd) to another file(3), which serves as destination
for its original file(2)'s relocated sections' contents.
I would be happy if I could open bfd(1) for changing, make a copy of it and then perform
the relocation with these two objects resp. files.
Greetings André
> -----Original Message-----
> From: H. J. Lu [mailto:hjl@lucon.org]
> Sent: Sunday, July 07, 2002 4:36 PM
> To: André Hauser
> Cc: binutils@sources.redhat.com
> Subject: Re: Change an object file without explicit copying
>
>
> On Sun, Jul 07, 2002 at 08:00:55AM +0200, André Hauser wrote:
> > Dear forum,
> > I want to use bfd to update an existing ELF file, i.e. open a bfd,
> > perform some changes and save the file afterwards.
> > Is there a way of doing this without copying the source
> file? I found
> > only the two functions bfd_openw() and bfd_openr() for
> creating a new
> > resp. opening a bfd; calling bfd_make_writable() in conjunction with
> > bfd_openr() did not work, my object file wasn't updated
> after closing
> > the bfd.
> >
>
> Have you tried libelf?
>
> H.J.
>