From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15896 invoked by alias); 13 Apr 2005 15:50:56 -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 15170 invoked from network); 13 Apr 2005 15:50:37 -0000 Received: from unknown (HELO rproxy.gmail.com) (64.233.170.206) by sourceware.org with SMTP; 13 Apr 2005 15:50:37 -0000 Received: by rproxy.gmail.com with SMTP id c16so217380rne for ; Wed, 13 Apr 2005 08:50:37 -0700 (PDT) Received: by 10.38.74.72 with SMTP id w72mr708648rna; Wed, 13 Apr 2005 08:50:33 -0700 (PDT) Received: by 10.38.161.25 with HTTP; Wed, 13 Apr 2005 08:50:33 -0700 (PDT) Message-ID: <23392f030504130850783c0ead@mail.gmail.com> Date: Wed, 13 Apr 2005 15:50:00 -0000 From: Francesco Casadei Reply-To: Francesco Casadei To: binutils@sourceware.org Subject: ELF executable relinking Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-SW-Source: 2005-04/txt/msg00319.txt.bz2 Hi all, I have a simple question I couldn't answer searching the archives or googling the web or groups, so here I am. Basically, I want to add new unrelated code to an existing ELF executable ET_EXEC), by relinking it with a relocatable object (ET_REL). Is it possible to input an executable and one or more relocatable object to the link editor and generate a new executable with code and data from all objects? I tried it but it didn't work, I get 'multiple definition errors' (related to symbols which marks the .dynamic and .got sections). I also tried preserving the relocati= on information within the executable, stripping the duplicate symbols, link with/without libc (already linked to the old executable). Nothing seems to work. The best result I got is a "successfull" relink and segmentation fault. Please CC me as I'm not subscribed to the list. Thank you. Regards, Francesco Casadei