From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nds7X-0001Ve-8N for qemu-devel@nongnu.org; Sat, 06 Feb 2010 16:23:15 -0500 Received: from [199.232.76.173] (port=60191 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nds7V-0001VW-Tm for qemu-devel@nongnu.org; Sat, 06 Feb 2010 16:23:13 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nds7S-0004bU-Tg for qemu-devel@nongnu.org; Sat, 06 Feb 2010 16:23:13 -0500 Received: from hall.aurel32.net ([88.191.82.174]:42358) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nds7S-0004bI-Jf for qemu-devel@nongnu.org; Sat, 06 Feb 2010 16:23:10 -0500 Date: Sat, 6 Feb 2010 22:23:07 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] Fix missing symbols in .rel/.rela.plt sections Message-ID: <20100206212307.GA15349@volta.aurel32.net> References: <1264936972-29634-1-git-send-email-lool@dooz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1264936972-29634-1-git-send-email-lool@dooz.org> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-15?Q?Lo=EFc?= Minier Cc: qemu-devel@nongnu.org On Sun, Jan 31, 2010 at 12:22:52PM +0100, Loïc Minier wrote: > Fix .rel.plt sections in the output to not only include .rel.plt > sections from the input but also the .rel.iplt sections and to define > the hidden symbols __rel_iplt_start and __rel_iplt_end around > .rel.iplt as otherwise we get undefined references to these when > linking statically to a multilib libc.a. This fixes the static build > under i386. > > Apply similar logic to rela.plt/.iplt and __rela_iplt/_plt_start/_end to > fix the static build under amd64. Thanks, applied. > Signed-off-by: Loïc Minier > --- > i386.ld | 16 ++++++++++++++-- > x86_64.ld | 16 ++++++++++++++-- > 2 files changed, 28 insertions(+), 4 deletions(-) > > diff --git a/i386.ld b/i386.ld > index f2dafec..f8df7bf 100644 > --- a/i386.ld > +++ b/i386.ld > @@ -39,8 +39,20 @@ SECTIONS > .rela.fini : { *(.rela.fini) } > .rel.bss : { *(.rel.bss) } > .rela.bss : { *(.rela.bss) } > - .rel.plt : { *(.rel.plt) } > - .rela.plt : { *(.rela.plt) } > + .rel.plt : > + { > + *(.rel.plt) > + PROVIDE_HIDDEN (__rel_iplt_start = .); > + *(.rel.iplt) > + PROVIDE_HIDDEN (__rel_iplt_end = .); > + } > + .rela.plt : > + { > + *(.rela.plt) > + PROVIDE_HIDDEN (__rela_iplt_start = .); > + *(.rela.iplt) > + PROVIDE_HIDDEN (__rela_iplt_end = .); > + } > .init : { *(.init) } =0x47ff041f > .text : > { > diff --git a/x86_64.ld b/x86_64.ld > index 24ea77d..46d8d4d 100644 > --- a/x86_64.ld > +++ b/x86_64.ld > @@ -35,8 +35,20 @@ SECTIONS > .rela.got : { *(.rela.got) } > .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } > .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } > - .rel.plt : { *(.rel.plt) } > - .rela.plt : { *(.rela.plt) } > + .rel.plt : > + { > + *(.rel.plt) > + PROVIDE_HIDDEN (__rel_iplt_start = .); > + *(.rel.iplt) > + PROVIDE_HIDDEN (__rel_iplt_end = .); > + } > + .rela.plt : > + { > + *(.rela.plt) > + PROVIDE_HIDDEN (__rela_iplt_start = .); > + *(.rela.iplt) > + PROVIDE_HIDDEN (__rela_iplt_end = .); > + } > .init : > { > KEEP (*(.init)) > -- > 1.6.5 > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net