From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) by sourceware.org (Postfix) with ESMTPS id 90CAB3858D35 for ; Tue, 16 Apr 2024 11:55:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 90CAB3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 90CAB3858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1135 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713268550; cv=none; b=kECwru3RbeVpRfAoi0ocWSNHQYy0Mayc8yDHEFXtTWYy14QK50riNb3oad0S+0w5DnnqLdhvi1m2hCUBInKxR5IXDJAYKZth25hRu7ZF177WZBgmtM2lyDSLeqJPU//p3d/Esl62WfQGZGooWfeckz0vgxi+jqtbNwros22kv0c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713268550; c=relaxed/simple; bh=UWaXI55q46iBK6vbE/IDKIeBtB63OTBGRp2anv5+dzU=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=ARvrHAebBao5Wt6ONIf8kwvpn/Cv75wzZmsa9jMwrrwsAsyspgAZltNyZeH3H9IjIrdvf0T3JkXXYc1gJU61oKCJii1PdBheF7NPT3ajNmZSZn/y3FuSUuPZDcGePaglW0KusEZC9XpL08OI7d+OKUDgy3P/smN25gfWHKpzz18= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-61ac45807cbso20648097b3.1 for ; Tue, 16 Apr 2024 04:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713268548; x=1713873348; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=AzJFhhzso7vXb/9KtyVltxCJ56CtMNejVHhlhXfp/MM=; b=NSkI4DpE/BVfkoFpqz8VegX/Z8mbCTGn4qqnd1c6S72p8RGZII0YuVtkQhxhvqhvWV pIFSPklbwyDAXN0LKv+c2chMlcH6HsEhVIn1bOHrSzRHWdrtdWYLemQYOE5LB5IEHiAR XNIiAJ2J5EZTrLN8TndJfuGrt0gdQiszNtRnlH5+y+R6TxsQZd0twQxcoFaUWdGnao9+ WN6fCXNZ9dEhxd000wf9AHuDznK2npZX08BoDUwKsuEVDJ/p1Za/NxpqojzvScqt4qu6 nKOR6TOxcwLX+WNNVnYTPqTEbOqifsX/pRRaU06wXnaBxfHnW9jBRpAax6X9G7j/BbFw YjwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713268548; x=1713873348; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AzJFhhzso7vXb/9KtyVltxCJ56CtMNejVHhlhXfp/MM=; b=SIjq2840Ujgc/yXvi47qr9Ws3LNo4n9M9fv0bXKt48F4hJd6hShIK6BL5hZnT9rEyF IQv2LTLXpq/Yjvc0gVHI07soYKKPm/1kJInuukAfhLmPISNEZd7OTmD6zS6DfCN1uIq0 KZHJStZSc7woCd1o32aZZCRNqec5iHbWeDOq4XjdI0UvW+cTrfnvpz6OqbC+Tut1A+QE umXyzoNHKA0fq/yINquIoWMIqaQXAwgk96Ae61dIofvW4X3m54Dcx8E/yXUG0ui9RdT4 lkBMZXoiwSAYBtDX2h99gph3sIn+h5Fz2XRMsp2RDyJ8IyqPz2J7kbLavSO9HVnSpqV9 w7Ig== X-Forwarded-Encrypted: i=1; AJvYcCV7XyBn5yFLimnMfGAK7nl0cGuHpp0YJcPDqTHxG6q/9BmDjgW5BTW2B02u875GoFYCJ9D1JpVrjtzZ1K8Lj/vIeot5CppYCA== X-Gm-Message-State: AOJu0Yz+atex+prQUqo/kpoxgm2fi/sU6ztx7uXxvJKY/iDLLwvt9O2e u3dqw3UnFifD1hrV7d3qR2pvZvioUErcwExkb1AeO0bWy6oKTx3lAE3yQZze9PevQPIJSsbweAF dQK/RL8CpfUw7y87HvOwLUJe2hHQ= X-Google-Smtp-Source: AGHT+IFKJ3XnfjC3pHySetwjuEKSwB13oiUsTRYj7WrAiiJ8GC0qswuhi3Xao+P7jWiHlQQXsipdstP2kyh+oH3yAks= X-Received: by 2002:a81:d80e:0:b0:619:da17:87be with SMTP id d14-20020a81d80e000000b00619da1787bemr6728954ywj.42.1713268547831; Tue, 16 Apr 2024 04:55:47 -0700 (PDT) MIME-Version: 1.0 References: <68d55961-5e33-4c71-b097-3acc6ab1d427@redhat.com> In-Reply-To: From: "H.J. Lu" Date: Tue, 16 Apr 2024 04:55:11 -0700 Message-ID: Subject: Re: avoiding undesirable undef[weak] syms after relocatable linking To: Alexandre Oliva Cc: Nick Clifton , binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3013.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,WEIRD_QUOTING autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Apr 15, 2024 at 11:00=E2=80=AFPM Alexandre Oliva wrote: > > Hello, H.J., > > On Apr 13, 2024, "H.J. Lu" wrote: > > >> $ gas/as-new t.s -o t.o && binutils/ar cr t.a t.o && binutils/ranlib > >> t.a && gas/as-new m.s -o m.o && ld/ld-new m.o t.a -o m -r && > >> binutils/nm-new m | grep bar > >> w bar > >> $ ld/ld-new --version > >> GNU ld (GNU Binutils) 2.42.50.20240413 > >> [...] > >> $ git log > >> commit 4ad25f3bed6bc4c010962b11fde1c70ce8c22cae > >> [...] > > > Please open a bug report. > > Can do (and thanks for the patch), but... Are you positive that that's > a bug to begin with? Since there are no relocations against the undefined weak symbol, it is not necessary to have it in the symbol table. > I am concerned that changing it might break something, though I can't > quite put my finger on what it is that might break with this change. > > Say, given another object file, say x.o, to be final-linked with the > result of the relocatable link that this patch would change, couldn't a > symbol that resolved to the undefweak become a final link failure after > the change? Or if the relocatable link output was made part of a > dynamic library, couldn't something break in case the undefweak symbol > was meant to be dynamically exported, but would now be entirely gone? Since there is no relocation against it, it should be OK. > That's why I was thinking of controlling this behavior change with an > option. > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > More tolerance and less prejudice are key for inclusion and diversity > Excluding neuro-others for not behaving ""normal"" is *not* inclusive --=20 H.J.