Message ID | 20221108225030.371817-1-hjl.tools@gmail.com |
---|---|
State | Accepted |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp18656wru; Tue, 8 Nov 2022 14:50:58 -0800 (PST) X-Google-Smtp-Source: AMsMyM7cA8g3OwycdAqIMtmvx+fmz3IqSgfYWa9uD92kI2v3gf3Kz7wRFUxIsWCs03Dv0yU0Iie4 X-Received: by 2002:a17:906:60c8:b0:78d:a154:ae with SMTP id f8-20020a17090660c800b0078da15400aemr1011721ejk.259.1667947858500; Tue, 08 Nov 2022 14:50:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667947858; cv=none; d=google.com; s=arc-20160816; b=DDHUTc2i7insoeHIxFB4bMjrN5upnXiP8q7byMAQeIrzNWSOf7H8bOjsEUFmx64lma a9kiOX04et9/yMBffPr2XNODgNrKaD1ixb2Hz/XxPR+LPvmBbDUrSqpC/PthpDbKDRte Mo6li8F4vgvYwBU6aWYoMrhipoq8tLuld6Djf1XdjZ2orUzEfrRIASW+v6ESD4ps+IY6 83w2PA+VDqj0gUkKhmSmA2jR8AZaKyuJtahWMNe9uor3YxSXk3ZPu/8AGaNleZucqS3X AQH3QidratvZW1sMPa28joxWlgzVGkuq/gi/TfJ4bbzrKXLrtlDgfBmvNFLGjwsH4wwQ HHOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=WS2Ph9t8fO+nwsqF4uAbM72Z5qY3Tn9FmiyBxaTVsGY=; b=gOCnH044E+FyDESMwugvTydPqxiWMvfSUgku9hNdoeWlppuIcGnjZ2s73Z8zp7ewIW kukj8hNe0L5LhtKgka05gPqagwcvTBPIuPV78InXXkc1I34W5pG/pPjaPSilz6+YFwV8 6va1++FsMSlK3PYWwLYJab14/ElUyiNzHeU8vZgi4McRYVH4fk0mSeXdH3mPIsU2B7ao 3q8ANo3uBhCe3Z7h3wFu7Wc305z0htG4AOKDNKIgwclDwPT105Dbp6PimyGwnBrhjgdF m801iKvje1kMsfZOa/PxlC6vNpT93MgT8idT8G5gZKWkbJILNyVdeKCSXqNGM5PHxVJ5 PZMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=P70q15UM; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id xa8-20020a170906fd8800b0078d148dafa3si15272203ejb.329.2022.11.08.14.50.58 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 14:50:58 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=P70q15UM; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4476E3858417 for <ouuuleilei@gmail.com>; Tue, 8 Nov 2022 22:50:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4476E3858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667947857; bh=WS2Ph9t8fO+nwsqF4uAbM72Z5qY3Tn9FmiyBxaTVsGY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=P70q15UMWkeao012t6z6MfuK7howEfzwePpeKALLSnZTohe/CQ1U2sDmaCQ2/M+gB /ZgXXSJg1PvG9u8hrvmcKpfiQAPI4YRMcGIohPm/tefGLiqfozvXhF9cnZ0XW0INbT YijBmYEy29GUFwr+nrboNkueOn7HJ3Q6vK3N3Kv0= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 720C6385840E for <binutils@sourceware.org>; Tue, 8 Nov 2022 22:50:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 720C6385840E Received: by mail-pf1-x42c.google.com with SMTP id q9so15076270pfg.5 for <binutils@sourceware.org>; Tue, 08 Nov 2022 14:50:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WS2Ph9t8fO+nwsqF4uAbM72Z5qY3Tn9FmiyBxaTVsGY=; b=dKguyIYTVjFioDzjcsml5VUyIk/0iJjztRzTzx3rdsE12zxhBwAtzFG3DZN3G6r4ix 6GGJf9ZnOuWS16sBbl6g2LCMoaLiCvMrzO6wEgVgSuTjPjIXQZJtgemW4snfYGSDUQPz eYtRiQOLbgImr5D2qIw+mUhfM9rMjP3MtUuDyV9MOZ9RES/xmVqTnJqzzRG4ljIgd7BE 1rH58PS2S3E97lx+/nS2d30o36lKaRJZUKxm8sxdQeuPMhHALKK0lKTWFS4GQe/PZEkY lZTlSRQrTzUoC2wjTCOaKnKsLP688yYGvkFmuVP/Mh3VopUSJViK1N2e1uSF3Les34nO yr7w== X-Gm-Message-State: ACrzQf0md8tVQm2foLdu8Cu8hW4CrVnhsA8v+0vSbFw3MeFjmOk8WD1G VnpGM+4v5YKurw3mCenyLyqxlGouA3w= X-Received: by 2002:a63:1345:0:b0:470:30c2:8b0b with SMTP id 5-20020a631345000000b0047030c28b0bmr24482962pgt.434.1667947845819; Tue, 08 Nov 2022 14:50:45 -0800 (PST) Received: from gnu-tgl-3.localdomain ([172.56.31.252]) by smtp.gmail.com with ESMTPSA id x63-20020a626342000000b0056bcc744bdbsm6797960pfb.203.2022.11.08.14.50.35 for <binutils@sourceware.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 14:50:38 -0800 (PST) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 65E6AC01BD for <binutils@sourceware.org>; Tue, 8 Nov 2022 14:50:30 -0800 (PST) To: binutils@sourceware.org Subject: [PATCH] ld: Always output local symbol for relocatable link Date: Tue, 8 Nov 2022 14:50:30 -0800 Message-Id: <20221108225030.371817-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3026.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> From: "H.J. Lu via Binutils" <binutils@sourceware.org> Reply-To: "H.J. Lu" <hjl.tools@gmail.com> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748970093831814882?= X-GMAIL-MSGID: =?utf-8?q?1748970093831814882?= |
Series |
ld: Always output local symbol for relocatable link
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | success | Github commit url |
Commit Message
H.J. Lu
Nov. 8, 2022, 10:50 p.m. UTC
PR ld/29761 * elflink.c (elf_link_output_symstrtab): Don't skip local symbol in SEC_EXCLUDE section for relocatable link. --- bfd/elflink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Tue, Nov 08, 2022 at 02:50:30PM -0800, H.J. Lu via Binutils wrote: > PR ld/29761 > * elflink.c (elf_link_output_symstrtab): Don't skip local symbol > in SEC_EXCLUDE section for relocatable link. OK.
diff --git a/bfd/elflink.c b/bfd/elflink.c index 019ac302905..4ef07394160 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -9997,7 +9997,8 @@ elf_link_output_symstrtab (void *finf, if (name == NULL || *name == '\0' - || (input_sec->flags & SEC_EXCLUDE)) + || (!bfd_link_relocatable (flinfo->info) + && (input_sec->flags & SEC_EXCLUDE))) elfsym->st_name = (unsigned long) -1; else {