From patchwork Wed Jan 20 17:27:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 43330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EFEC4B7C09 for ; Thu, 21 Jan 2010 05:18:39 +1100 (EST) Received: from localhost ([127.0.0.1]:52109 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXf6E-0007Z6-So for incoming@patchwork.ozlabs.org; Wed, 20 Jan 2010 13:16:14 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXeLM-0007YV-Lq for qemu-devel@nongnu.org; Wed, 20 Jan 2010 12:27:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXeLI-0007T9-TW for qemu-devel@nongnu.org; Wed, 20 Jan 2010 12:27:48 -0500 Received: from [199.232.76.173] (port=38946 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXeLH-0007SC-Ij for qemu-devel@nongnu.org; Wed, 20 Jan 2010 12:27:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27045) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXeLG-0002KH-Ua for qemu-devel@nongnu.org; Wed, 20 Jan 2010 12:27:43 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0KHReOQ020563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Jan 2010 12:27:40 -0500 Received: from localhost.localdomain (vpn1-4-216.ams2.redhat.com [10.36.4.216]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0KHRVt5028417; Wed, 20 Jan 2010 12:27:38 -0500 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 20 Jan 2010 18:27:25 +0100 Message-Id: <46e48d568d222e4fe2d186ade619cbe5cee3ac22.1264008180.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id o0KHReOQ020563 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: =?UTF-8?q?Lo=C3=AFc=20Minier?= Subject: [Qemu-devel] [PATCH 5/5] Fix missing symbols in .rel/.rela.plt sections X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Loïc Minier 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. Signed-off-by: Loïc Minier Signed-off-by: Juan Quintela --- 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))