From patchwork Fri Feb 28 14:25:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 183962 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp785117ile; Fri, 28 Feb 2020 06:25:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxPZ126MrWxAaXTMLFDwUwDUpSDAlILCe74fpBk5EJNWruC5PcbeXSamMfalvmGfAATbEM5 X-Received: by 2002:aca:c5ca:: with SMTP id v193mr350648oif.62.1582899925850; Fri, 28 Feb 2020 06:25:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582899925; cv=none; d=google.com; s=arc-20160816; b=u5jjATsk5NPdg3R/4YuGDnJh1o3ncW29bqmJV2eWvhLzohIck9lnOWzPHE1jG3FrYV 8WbAjQPHjHsGwRCsCYZeEJYi58+6r4uoeeaLZ8eA31w4z7P5TXfovKfSWVvgq7BloiNv MthvjJuBphsgmqm5mBpE/NTirof4Au6VwftUuLvlxJ+hrsT06LpQu4aDbWoDZ+5oO8hV yepL061r0y3z7Ka10N9Hf6Ha9tUe/phhCEhnzlhaWwPD7sfwlLzkiufOlcQEjRsbdEtQ zXVgOA5bV4O9VD1G/E6z/6ECu6bKGw/16L8JFbbD665mtxEcjHruqxvWxWPZIfdu3BZm 1T9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-subscribe:list-unsubscribe :list-id:precedence:mailing-list:dkim-signature:domainkey-signature; bh=e9O5XWzjkVwkoRUa2AkHK+5C6nLcWZygOLrOIFNMzI8=; b=VCYFvWYgBZnS1y6hCJSMqAayR3EA+tenYpy+8Hu/YREO6ulLBxzw+B+usIHRP6nqVT nmN77RY3OvTtKxVtTuB/OGSiFhmjnzNKm7sNTrGsLsLgjUwvc6wFrOl3y32+WDJhLjEQ DV6vdUgfV2qQvZQZ+zdEFl92hQYd9yc6U6fJ8K69nSaaQVk4V2aWXVZcRO8PHkgok0I0 cGzRmRsJjv9wH7rNSRW6Jj31UM6NgLyPeeCfiaXTaVwdxFnv/QNnvgg1B74FQR38cgKx rOQD09lZlq+cIwwimzKh2/62hGUZqKYkBFb4i81zjgffnfJwcYWT60MDKxrwIc3CD3Yr PfZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=OAMPTwMY; dkim=pass header.i=@linaro.org header.s=google header.b=lU4fmsY7; spf=pass (google.com: domain of libc-alpha-return-110172-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-110172-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id t192si1878700oif.75.2020.02.28.06.25.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 06:25:25 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-110172-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=OAMPTwMY; dkim=pass header.i=@linaro.org header.s=google header.b=lU4fmsY7; spf=pass (google.com: domain of libc-alpha-return-110172-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-110172-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=iyYDjTwYmdRD9aNv+d983Cm8FX6t53hso20wJ+D7B6rlhzeT8CHMF HOBVSYvUsJh1YMASVBYuOdQwtrXILAU0CoEEedFWPtbNvIY/uGNgWJtDoFtSdA+L B8MlY+o80oVckOuoyHJY70ymU3PefehtSeYjr45FJUbNKf10ZssdTE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=BCAcgOMHPbusN7dFBjItd+i3HLs=; b=OAMPTwMYN7NM7J0aKDtCMKZTW5mJ JEQkPuqD42ARd9ogZgKnOsO/BDwDCk2Ms1CXyS9mKYglcWUrC/kozP3GvMsCw20L TuL1P1qrxcgXpDdpYqyXzTGGy2mPKttc6IctDpw2TXaIWVg3icb4dkxWiDd28omy CBLdW6yjj1n9KMM= Received: (qmail 34819 invoked by alias); 28 Feb 2020 14:25:17 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 34808 invoked by uid 89); 28 Feb 2020 14:25:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:test.o, test.o, testo, 2161 X-HELO: mail-qv1-f67.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=e9O5XWzjkVwkoRUa2AkHK+5C6nLcWZygOLrOIFNMzI8=; b=lU4fmsY7DVTcmdjX9yz7/XGFg4FJ3Qi2xND4OZbwTr29ZVW6Pt+oQrbjSXcYKfFRz4 ASzvqleBg2/3A4olSPMObnxrU3ZjCBatmenAoBbsNBs4h+mcJRykYVqXuiP00cNSfy7y 7476Nfdvw2JmnKKDcirYO4yCBCtsghov1gqyh2scc4rsQyGIQollynv/qhlYAoSsy2MB 108l82ltsD/jBdlzY+8qq3vUVtJoX44qqioO/Yin0jCTDKeYBI27CNySFqRXYSj3pNVr tYaXcpk2SQ35hCGPn2MAfo2HPAb1mdUCyTfnuztA90bSNVDd6F46eSrAJIdchjJ5werP kK5A== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH] i386: Use comdat instead of .gnu.linkonce for i386 setup pic register (BZ #20543) Date: Fri, 28 Feb 2020 11:25:08 -0300 Message-Id: <20200228142508.7551-1-adhemerval.zanella@linaro.org> GCC has moved from using .gnu.linkonce for i386 setup pic register with minimum current version (as for binutils minimum binutils that support comdat). Trying to pinpoint when binutils has added comdat support for i686, it seems it was around 2004 [1]. I also checking with some ancient binutils older than 2.16 I see: test.o: In function `__x86.get_pc_thunk.bx': test.o(.text.__x86.get_pc_thunk.bx+0x0): multiple definition of `__x86.get_pc_thunk.bx' /usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/crti.o(.gnu.linkonce.t.__x86.get_pc_thunk.bx+0x0): first defined here Which seems that such version can not handle either comdat at all or a mix of linkonce and comdat. For binutils 2.16.1 I am getting a different issue trying to link a binary with and more recent ctri.o (unrecognized relocation (0x2b) in section `.init', which is R_386_GOT32X and old binutils won't generate it anyway). So I think that either unlikely someone will use an older binutils than the one used to glibc and even this scenario may fail with some issue as the R_386_GOT32X. Also, 2.16.1 is quite old and not really supported (glibc itself required 2.25). Checked on i686-linux-gnu. [1] https://gcc.gnu.org/ml/gcc/2004-05/msg00030.html --- sysdeps/i386/sysdep.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/sysdeps/i386/sysdep.h b/sysdeps/i386/sysdep.h index b4bcd8fb6c..6094af8fec 100644 --- a/sysdeps/i386/sysdep.h +++ b/sysdeps/i386/sysdep.h @@ -61,7 +61,7 @@ lose: SYSCALL_PIC_SETUP \ # define SETUP_PIC_REG(reg) \ .ifndef GET_PC_THUNK(reg); \ - .section .gnu.linkonce.t.GET_PC_THUNK(reg),"ax",@progbits; \ + .section .text.GET_PC_THUNK(reg),"axG",@progbits,GET_PC_THUNK(reg),comdat; \ .globl GET_PC_THUNK(reg); \ .hidden GET_PC_THUNK(reg); \ .p2align 4; \ @@ -97,7 +97,8 @@ GET_PC_THUNK(reg): \ # define SETUP_PIC_REG_STR(reg) \ ".ifndef " GET_PC_THUNK_STR (reg) "\n" \ - ".section .gnu.linkonce.t." GET_PC_THUNK_STR (reg) ",\"ax\",@progbits\n" \ + ".section .text." GET_PC_THUNK_STR (reg) ",\"axG\",@progbits," \ + GET_PC_THUNK_STR (reg) ",comdat\n" \ ".globl " GET_PC_THUNK_STR (reg) "\n" \ ".hidden " GET_PC_THUNK_STR (reg) "\n" \ ".p2align 4\n" \