From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 225533858C74 for ; Wed, 9 Mar 2022 01:33:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 225533858C74 Received: by mail-pf1-x432.google.com with SMTP id e15so893417pfv.11 for ; Tue, 08 Mar 2022 17:33:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=AJXazNL4TkHX0ytY2RE4bnzzW+UMvP8DOTwMmUqbzZU=; b=Rf7s8n4AYHYXQVLsb1cHoT9GjpvpCEPDuIfNtUKuJZOeDFva6/cITGbdJdCJROGXIM 1R+9JB8dehy3Z37gpzAEN3MY9FeXY1Zl04BBIWcwT4MQsw85Ooz1xVpZNs0PKjEh+Cdm op2KMM/TUCgGBhNt6e/hQdq7o5djOu/+G2cuhcn0Qc9sMVxpl/c6jmLL73AKV2Wf1JvS Zh3ky0yflibrJUH3MZRsiLFg+HsG+a9HZrOODfQ13TfaKdO+sLk2JMYA3bpN/qG5NFoi x956NwPs4odrV4qtPi3/F67tu4I+wQuIjLgoTWoYjtfihnbOp+km46qJn8edj6XLmskz wUkg== X-Gm-Message-State: AOAM530TBGGwDnDoKIbmdOuwHclH4QVoapQl3UdLzTVC4T6llUhhr9Pa EFem1KILybct9Qp1nWabxUqk8ZS13QG95A== X-Google-Smtp-Source: ABdhPJyQR35LKcJDaYplPRsmgDR7rOioEcfoTUvY2wnrzm+hWSuW0z4oJHQ6EzjNazOgjoD5qAObzg== X-Received: by 2002:a63:2142:0:b0:35d:a95f:d1e9 with SMTP id s2-20020a632142000000b0035da95fd1e9mr16512199pgm.237.1646789586441; Tue, 08 Mar 2022 17:33:06 -0800 (PST) Received: from google.com ([2620:15c:2ce:200:b944:372f:a947:e538]) by smtp.gmail.com with ESMTPSA id pj13-20020a17090b4f4d00b001bf2ff56430sm4322084pjb.30.2022.03.08.17.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:33:05 -0800 (PST) Date: Tue, 8 Mar 2022 17:33:00 -0800 From: =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= To: binutils@sourceware.org, Cary Coutant Subject: Re: [PATCH] gold: Remove GNU ld incompatible --[no-]define-common [BZ #28871] Message-ID: <20220309013300.rqyugif2arfgkaea@google.com> References: <20220208090759.1115537-1-maskray@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-27.3 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2022 01:33:11 -0000 On 2022-02-18, Fāng-ruì Sòng wrote: >On Tue, Feb 8, 2022 at 1:08 AM Fangrui Song wrote: >> >> In 2008, 0dfbdef4c43cfe12bb3e2505ebe5acc651a35c98 confused >> --define-common with -d/FORCE_COMMON_ALLOCATION and implemented >> --define-common with -d semantics. >> >> Just remove the GNU ld incompatible --[no-]define-common. >> --- >> gold/gold.cc | 2 +- >> gold/options.cc | 14 ++++---------- >> gold/options.h | 9 ++++----- >> 3 files changed, 9 insertions(+), 16 deletions(-) >> >> diff --git a/gold/gold.cc b/gold/gold.cc >> index 2891d16c7c9..a93489e225e 100644 >> --- a/gold/gold.cc >> +++ b/gold/gold.cc >> @@ -708,7 +708,7 @@ queue_middle_tasks(const General_options& options, >> // Allocate common symbols. We use a blocker to run this before the >> // Scan_relocs tasks, because it writes to the symbol table just as >> // they do. >> - if (parameters->options().define_common()) >> + if (parameters->options().dc()) >> { >> this_blocker = new Task_token(true); >> this_blocker->add_blocker(); >> diff --git a/gold/options.cc b/gold/options.cc >> index 04be98a3e39..a6c4bda1ae8 100644 >> --- a/gold/options.cc >> +++ b/gold/options.cc >> @@ -1136,16 +1136,10 @@ General_options::finalize() >> gold_assert(this->strip_debug()); >> } >> >> - // For us, -dc and -dp are synonyms for --define-common. >> - if (this->dc()) >> - this->set_define_common(true); >> - if (this->dp()) >> - this->set_define_common(true); >> - >> - // We also set --define-common if we're not relocatable, as long as >> - // the user didn't explicitly ask for something different. >> - if (!this->user_set_define_common()) >> - this->set_define_common(!this->relocatable()); >> + // A non-relocatable link always allocates space to COMMON symbols. >> + // -dc, -d, and -dp can force allocation for a relocatable link. >> + if (!this->relocatable() || this->d() || this->dp()) >> + this->set_dc(true); >> >> // execstack_status_ is a three-state variable; update it based on >> // -z [no]execstack. >> diff --git a/gold/options.h b/gold/options.h >> index 9509a445e8e..a994bdcf42a 100644 >> --- a/gold/options.h >> +++ b/gold/options.h >> @@ -787,13 +787,12 @@ class General_options >> >> // d >> >> - DEFINE_bool(define_common, options::TWO_DASHES, 'd', false, >> - N_("Define common symbols"), >> - N_("Do not define common symbols in relocatable output")); >> DEFINE_bool(dc, options::ONE_DASH, '\0', false, >> - N_("Alias for -d"), NULL); >> + N_("Allocate space to COMMON symbols for the relocatable link"), NULL); >> + DEFINE_bool(d, options::ONE_DASH, '\0', false, >> + N_("Alias for -dc"), NULL); >> DEFINE_bool(dp, options::ONE_DASH, '\0', false, >> - N_("Alias for -d"), NULL); >> + N_("Alias for -dc"), NULL); >> >> DEFINE_string(debug, options::TWO_DASHES, '\0', "", >> N_("Turn on debugging"), >> -- >> 2.35.0.263.gb82422642f-goog >> > >Ping... ping^2 :)