From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5853 invoked by alias); 10 Jul 2002 08:58:19 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 5806 invoked from network); 10 Jul 2002 08:58:18 -0000 Received: from unknown (HELO msgbas1.cos.agilent.com) (192.25.240.36) by sources.redhat.com with SMTP; 10 Jul 2002 08:58:18 -0000 Received: from msgrel1.germany.agilent.com (msgrel1.germany.agilent.com [134.40.2.57]) by msgbas1.cos.agilent.com (Postfix) with ESMTP id 6963BB235; Wed, 10 Jul 2002 02:58:17 -0600 (MDT) Received: from pollux.germany.agilent.com (pollux.germany.agilent.com [134.40.35.20]) by msgrel1.germany.agilent.com (Postfix) with SMTP id 7FF6551B; Wed, 10 Jul 2002 10:58:16 +0200 (METDST) Received: from 134.40.35.20 by pollux.germany.agilent.com (InterScan E-Mail VirusWall NT); Wed, 10 Jul 2002 10:58:16 +0200 Received: by pollux with Internet Mail Service (5.5.2653.19) id <3FSCR3GJ>; Wed, 10 Jul 2002 10:58:16 +0200 Message-ID: From: andre_hauser@hsgmed.com To: hjl@lucon.org Cc: binutils@sources.redhat.com Subject: RE: Change an object file without explicit copying Date: Wed, 10 Jul 2002 03:09:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2002-07/txt/msg00225.txt.bz2 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= =20 to a bfd(2) created with bfd_openw() (some of the object's details are bein= g=20 modified while doing this). Then I close this recently created bfd(2) and copy it byte by byte=20 (i.e. without using bfd) to another file(3), which serves as destination=20 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=20 the relocation with these two objects resp. files. Greetings Andr=E9 =20 > -----Original Message----- > From: H. J. Lu [mailto:hjl@lucon.org] > Sent: Sunday, July 07, 2002 4:36 PM > To: Andr=E9 Hauser > Cc: binutils@sources.redhat.com > Subject: Re: Change an object file without explicit copying >=20 >=20 > On Sun, Jul 07, 2002 at 08:00:55AM +0200, Andr=E9 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=20 > file? I found > > only the two functions bfd_openw() and bfd_openr() for=20 > 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=20 > after closing > > the bfd.=20 > >=20 >=20 > Have you tried libelf? >=20 > H.J. >=20