From patchwork Fri Aug 3 08:30:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Storsjo X-Patchwork-Id: 143389 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp204423ljj; Fri, 3 Aug 2018 01:31:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdJpGwaBrFe1McBmLjlsNV/rLUWmshGLjoKeZ6sWHsCf4lMYXieOLgVWl5hClb6RDiPWPoi X-Received: by 2002:a63:dd09:: with SMTP id t9-v6mr2752636pgg.370.1533285074360; Fri, 03 Aug 2018 01:31:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533285074; cv=none; d=google.com; s=arc-20160816; b=q0adE7zizW7F/6+dUyKe7yU7XgCTHFoh0mnTWwb0eQsZ2VLgZJ+Y5wuVZMRF6RyJCx 7nKpzMRWJTirfM6PasqiChHUSGzEcz/VHHmrc69c++XM3CiJw++pnbDtsnlttM4+CFwN 2lzAS6cAIwWiJWq8vPRHODAdT/3MsL0rvKXEX9kKQQ+ShCwb8My/Ky05mx/T+XnwfDtV zlepkIXOSodmJ6E6urn8RxufXDJWkADEBo3xVE0ukdJlqslccLFVHBSwbAWtsDKeUmqQ KDzH1Vn1YD33FeteoOl7je9lE/dHtnmi+ZNCbECgxsKEzpy+qNiXHrdmXSX+idgCY+mq zAWw== 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 :arc-authentication-results; bh=zHmILm3RQ0S7QIBsdXYRCGAtw/W707uWrn3pL3uWk94=; b=yDnhzdmqUoGwHl99ZpJaQNCH9G9w+sWO+uuv+quBA5IMyXEdRyEbQ9qEWrX8eBsIay M9p5kOVuDKx1uYNZdeOPj4TolbMBmFtMY3/llqRUSUfSSRP4kg5PKpXdlXOtmMubVUN5 H8IYP4kXF9+Gbd5Xw3tEuTsk23y4U5Szsx/7Qaeo5Y6l2EsCeZRVu90uv3kQ85KhJD/E eaQlTwxRdoxVZaN9q68THtS6I+fPxVOMwuA469OQt/VPid+Kueujzhd8/smwOYw73dP3 VzyYPycinfCXj2/dZANmVbEbLP5/YWLxsIk0EIskF/FCGSCeSzAMzvoVye5v+PFsAmH/ zU9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Yd3YV8TP; dkim=pass header.i=@martin-st.20150623.gappssmtp.com header.s=20150623 header.b=mFrHoCEO; spf=pass (google.com: domain of binutils-return-102879-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="binutils-return-102879-patch=linaro.org@sourceware.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u5-v6si3355924pls.372.2018.08.03.01.31.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 01:31:14 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-return-102879-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=Yd3YV8TP; dkim=pass header.i=@martin-st.20150623.gappssmtp.com header.s=20150623 header.b=mFrHoCEO; spf=pass (google.com: domain of binutils-return-102879-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="binutils-return-102879-patch=linaro.org@sourceware.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=GXNto6T1h/fdJCSeLezN+TOm/0o26qbrbQLAJbpAV3vnKrPTzw8Wg nZ5pNRj0VF9XUgB4zto8fbewxbHc92BOsq/93VV1P0fXomRSbLfES6UtSb2tHeD3 InW7YVEdcybUIBCgV/oVKu9+FXG/CouZs1y3/VuZJ/LVqXANPKTTBw= 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=ObCYPHE0JyB7FybeA2ZfIZQGe+U=; b=Yd3YV8TPE9jo3/JJIXoBnJFqBmdz GIbnEPuthTVp7GEG6BMWwP6oMeUa/nTaHnjNiZ1NHINcvWyUaGkSQHYY4Cy6hz4U 98YaY8pZxxHoTxfyxZg2iNEv8I0XJjT2sixHc4AVHYXebjJBfEz10hFim9lCUNRo 47UQ4Ffp3t2Jrmg= Received: (qmail 113841 invoked by alias); 3 Aug 2018 08:31:01 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Delivered-To: mailing list binutils@sourceware.org Received: (qmail 113484 invoked by uid 89); 3 Aug 2018 08:30:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Gm-Message-State:AOUpUlG, PROVIDE, overridden, H*r:TLS1 X-HELO: mail-lf1-f43.google.com Received: from mail-lf1-f43.google.com (HELO mail-lf1-f43.google.com) (209.85.167.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Aug 2018 08:30:34 +0000 Received: by mail-lf1-f43.google.com with SMTP id j143-v6so3463217lfj.12 for ; Fri, 03 Aug 2018 01:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=zHmILm3RQ0S7QIBsdXYRCGAtw/W707uWrn3pL3uWk94=; b=mFrHoCEOuWxrnolomJts1A4hJv+2j3CG6fnr9L406FVDpKX/1zF9vHmtAs+hWWz73Q rqFEq/uHGRPjQ7egzRP5EebnPb8JF8eLeK3QOBePpmoPVkvDFdIyrdtWtmHeg3FHc5pt jNtIMeHlHfg3mS/J7p8yiBw+ZTWFxJRqR3vLr07zSnxAIM0OdfkCVtO2uDA+hYZ7VRe2 NQqnr7s7ZllODr6eJ4ymwsh9orvJ3HMqPxaznxD9+9yo7pz16L+TZ7RV0K457i9+ezR+ 5uY3z9897AYk/KKQoGgcFlo3yVveaUZoDj++HaGPZUZI3v3/VcK+amFw3tGri1SSLT3G aQbw== Return-Path: Received: from localhost (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id u23-v6sm633112lfu.4.2018.08.03.01.30.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 03 Aug 2018 01:30:31 -0700 (PDT) From: Martin Storsjo To: binutils@sourceware.org Subject: [PATCH] ld: Improve the comment about overriding __CTOR_LIST__ for mingw targets Date: Fri, 3 Aug 2018 11:30:31 +0300 Message-Id: <20180803083031.71826-1-martin@martin.st> X-IsSubscribed: yes Explain what happens in the cases if the user actually tries to provide such symbols from source as well - it's actually a less dramatic or problematic situation than originally outlined. ld/Changelog: 2018-08-03 Martin Storsjo * scripttempl/pe.sc: Improve the comment about overriding __CTOR_LIST__ and __DTOR_LIST__ symbols. * scripttemp/pep.sc: Likewise. --- mingw-w64 will probably move to unconditionally provide these symbols themselves, in order to improve compatibility with other linkers (lld). The fact that the linker also provides them only causes double list terminator elements; if the code iterating the list is prepared to handle that case, it actually turns out to work fine. --- ld/scripttempl/pe.sc | 10 ++++++---- ld/scripttempl/pep.sc | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) -- 2.15.2 (Apple Git-101.1) diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc index f56d783ea03..3a2a331f681 100644 --- a/ld/scripttempl/pe.sc +++ b/ld/scripttempl/pe.sc @@ -106,10 +106,12 @@ SECTIONS overridden and global constructors will not be run. This does mean that it is not possible for a user to define - their own __CTOR_LIST__ and __DTOR_LIST__ symbols. If that - ability is needed a custom linker script will have to be - used. (The custom script can just be a copy of this script - with the PROVIDE() qualifiers added). + their own __CTOR_LIST__ and __DTOR_LIST__ symbols; if they do, + the content from those variables are included but the symbols + defined here silently take precedence. If they truly need to + redefined, a custom linker script will have to be used. (The + custom script can just be a copy of this script with the + PROVIDE() qualifiers added). See PR 22762 for more details. */ ___CTOR_LIST__ = .; diff --git a/ld/scripttempl/pep.sc b/ld/scripttempl/pep.sc index 3c6c84da9bf..fb88c144430 100644 --- a/ld/scripttempl/pep.sc +++ b/ld/scripttempl/pep.sc @@ -107,10 +107,12 @@ SECTIONS overridden and global constructors will not be run. This does mean that it is not possible for a user to define - their own __CTOR_LIST__ and __DTOR_LIST__ symbols. If that - ability is needed a custom linker script will have to be - used. (The custom script can just be a copy of this script - with the PROVIDE() qualifiers added). + their own __CTOR_LIST__ and __DTOR_LIST__ symbols; if they do, + the content from those variables are included but the symbols + defined here silently take precedence. If they truly need to + redefined, a custom linker script will have to be used. (The + custom script can just be a copy of this script with the + PROVIDE() qualifiers added). See PR 22762 for more details. */ ___CTOR_LIST__ = .;