From patchwork Thu Apr 3 17:53:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 3933671 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9E01BBFF02 for ; Thu, 3 Apr 2014 17:54:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC0DE201F9 for ; Thu, 3 Apr 2014 17:54:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E206D2026D for ; Thu, 3 Apr 2014 17:54:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753025AbaDCRxw (ORCPT ); Thu, 3 Apr 2014 13:53:52 -0400 Received: from mail-pb0-f48.google.com ([209.85.160.48]:48891 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752973AbaDCRxv (ORCPT ); Thu, 3 Apr 2014 13:53:51 -0400 Received: by mail-pb0-f48.google.com with SMTP id md12so2197343pbc.21 for ; Thu, 03 Apr 2014 10:53:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wJYT6I9jS/PJ73Ars9Mnlu3dCOHLZSqH0TSM1q2cwOY=; b=BeKjfbwJ7LxGACMx0GI/EbVPcw2oMk8gyyAJLzAlZVXE3y2vPK8qqniK+M4FpSpcx9 cKDMGfGSRpLUSC6Zsn3ifopNEsem6ANFpvKnIBMSquKdoqQSe9kr9R73HoIkf/pC+3qK gAxSdGc78p0YJROGjfEkS1rTQ+ctCtNFr/HJgg+/9h9QRe/dJ3fFdrwlm2Vxlw9fBGM/ +D5nevIfha0a4NqeZbpYOiiKnacwsu+d3/YT4PoM4bLVV09vNlIFqc4h4Daox53+GZRN 5YtX2i+B1LMvKB3pHZnnVJQ0uvhv18lORIMDyTlF0G7mxuryFqOxwMxHac65v8kjsGvl qOtQ== X-Gm-Message-State: ALoCoQlMbUfCysoyAVUU/oJg6AtORP2zePDJjrIpkb6SKuZXPk2t4+F3ykmy4eB7P0lQ1fPb/yfD X-Received: by 10.67.13.134 with SMTP id ey6mr9124243pad.44.1396547630771; Thu, 03 Apr 2014 10:53:50 -0700 (PDT) Received: from localhost ([2001:5a8:4:83c0:f9a8:196f:3ecc:ff09]) by mx.google.com with ESMTPSA id c7sm12557705pbt.0.2014.04.03.10.53.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Apr 2014 10:53:49 -0700 (PDT) From: Andy Lutomirski To: "H. Peter Anvin" , Markus Trippelsdorf Cc: linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, Andy Lutomirski Subject: [PATCH] x86, vdso: Make the vdso linker script compatible with Gold Date: Thu, 3 Apr 2014 10:53:43 -0700 Message-Id: <243fa205098d112ec759c9b1b26785c09f399833.1396547532.git.luto@amacapital.net> X-Mailer: git-send-email 1.9.0 In-Reply-To: <20140403174339.GA284@x4> References: <20140403174339.GA284@x4> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Gold can't parse the script due to: https://sourceware.org/bugzilla/show_bug.cgi?id=16804 With a workaround in place for that issue, Gold 2.23 crashes due to: https://sourceware.org/bugzilla/show_bug.cgi?id=15355 This works around the former bug and avoids the second by removing the unnecessary vvar and hpet sections and segments. The vdso and hpet symbols are still there, and nothing needed the sections or segments. Reported-by: Markus Trippelsdorf Signed-off-by: Andy Lutomirski --- arch/x86/vdso/vdso-layout.lds.S | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/arch/x86/vdso/vdso-layout.lds.S b/arch/x86/vdso/vdso-layout.lds.S index 2e263f3..9df017a 100644 --- a/arch/x86/vdso/vdso-layout.lds.S +++ b/arch/x86/vdso/vdso-layout.lds.S @@ -9,12 +9,9 @@ SECTIONS #ifdef BUILD_VDSO32 #include - .hpet_sect : { - hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE); - } :text :hpet_sect + hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE); - .vvar_sect : { - vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE); + vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE); /* Place all vvars at the offsets in asm/vvar.h. */ #define EMIT_VVAR(name, offset) vvar_ ## name = vvar + offset; @@ -22,7 +19,6 @@ SECTIONS #include #undef __VVAR_KERNEL_LDS #undef EMIT_VVAR - } :text :vvar_sect #endif . = SIZEOF_HEADERS; @@ -61,7 +57,12 @@ SECTIONS */ . = ALIGN(0x100); - .text : { *(.text*) } :text =0x90909090 + .text : { *(.text*) } :text =0x90909090, + + /* + * The comma above works around a bug in gold: + * https://sourceware.org/bugzilla/show_bug.cgi?id=16804 + */ /DISCARD/ : { *(.discard) @@ -84,8 +85,4 @@ PHDRS dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ note PT_NOTE FLAGS(4); /* PF_R */ eh_frame_hdr PT_GNU_EH_FRAME; -#ifdef BUILD_VDSO32 - vvar_sect PT_NULL FLAGS(4); /* PF_R */ - hpet_sect PT_NULL FLAGS(4); /* PF_R */ -#endif }