From patchwork Thu Jan 4 00:31:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 184880 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5342142dyb; Wed, 3 Jan 2024 16:33:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGce7ZeDyoOcGjwg3kUiMVuGCiuHYa164iXXIzhJhHcCV87Psqj5QVqWPFZk95CaD7dfRa8 X-Received: by 2002:a05:6830:2695:b0:6dc:249:d6cc with SMTP id l21-20020a056830269500b006dc0249d6ccmr10683385otu.30.1704328383071; Wed, 03 Jan 2024 16:33:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704328383; cv=pass; d=google.com; s=arc-20160816; b=eFDxbMlRnz01blbH37IliLvBOmd2wAjtjWI8gprxgzoRfRhQpLbA4x/JHUQbwOa2yS 1z9CofGSQHoD/u8Nb2u0zfC2qCIPVhXsCfMFJ3nrm3o3DV1NJ3n2Y6bzsL92KzVG+Ho9 puLqsFSN7q0V8cMneCdpAEJuRbZ/t+HaiXrVJujLHFlmCkegr5CDI1yWyrKgCYWSbK/Q XrZRvMmb/4GGdKBza6W/9YXLjb75X5/kpG9AlpNGemIyEBOuIcgusTZcChoJcbG+FE4x fuBluMaDyNqP824D186qsrnhV5fDmd22oRh1jxvIKESWAeGuIZkp8SvMppGyBi9mIfxZ zINg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:arc-filter:dmarc-filter:delivered-to; bh=gMGgxdGVSauZps9NaGtup93FxA2sBjBNEhqlBmWW3AQ=; fh=WVbX9yJPjA3Sbj3O2a4+vkxn67ULTBfK9J7vHctA4H0=; b=fVgJznFguN5famoMYHvAafF190hkXZgRYJ3ORbrEImyaFsX801c4jynU5eHCtmxN0U 16yXGjtwlNrsOMIlM7ClpS9Lnz9OFus+OnkItgfH3EKPOlY98kQJPymuy7p8ZXmAHAG+ ZxRUOmJca79F2ZaI2Y4yCNdvZ0XbnrOAU1HU9iWRDHri5J/KM3OrLJBX/OjbuoAGoCal Me5HonsI6sXUpd9PCMHoyw06XIEACMIYRBaMTIaNaP7UeBfzs9gCygiQ2AfFrblvaVgk N1T40gZGDlTrNWNLkf1awzR0w81adrZe+pT1VJHgfrSzgB7bbSR808M0WAFg+fC23eoc 060Q== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n17-20020a05622a11d100b004282063d011si7575060qtk.23.2024.01.03.16.33.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 16:33:03 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BDEA6385800D for ; Thu, 4 Jan 2024 00:33:02 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 415823858286 for ; Thu, 4 Jan 2024 00:31:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 415823858286 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 415823858286 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=45.83.234.184 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704328318; cv=none; b=lKK67mWXJp2V7PIChQCCbzm9ZvGJJmTBBa/Y8hjOTL8vQuR6bSBcxng7xvSBN5Al7/jGEBkFm1vXam0MSb9qOjbEHd73xY1IMxv1LjA6a0ajewQn1+dKyC/j2Hro/QCxwfjXgKt8lwkWrX0dB64+T9rcx5uf4xCcF5bFHoFin4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704328318; c=relaxed/simple; bh=hOy0Ipo8khvxkvO+1ZgbU3HkhjSvnt4UlopPKBn4Pi8=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=rquYV8IB0nRwN8b/rJDPRVP1//N8oCd/7hpAdzDr2o9lFwhJYmoxH/f0OHt8g8Ivo/wElpxcj4nbT5xdzVJw61r7Yg1WhYzGVerTfEdbE9hGQOLxs6/PJTfogCea+2iJ51koLxXvstVdNXDDFiiOu8O1w5yS4WXwAUjS/Met7a4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from csb.redhat.com (deer0x03.wildebeest.org [172.31.17.133]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 445AA302BB42; Thu, 4 Jan 2024 01:31:56 +0100 (CET) Received: by csb.redhat.com (Postfix, from userid 10916) id 348EACEF2C; Thu, 4 Jan 2024 01:31:56 +0100 (CET) From: Mark Wielaard To: binutils@sourceware.org Cc: Palmer Dabbelt , David Abdurachmanov , Mark Wielaard Subject: [PATCH] bfd: riscv_maybe_function_sym check _bfd_elf_is_local_label_name Date: Thu, 4 Jan 2024 01:31:31 +0100 Message-Id: <20240104003131.820681-2-mark@klomp.org> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240104003131.820681-1-mark@klomp.org> References: <20240104003131.820681-1-mark@klomp.org> MIME-Version: 1.0 X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787117838653774727 X-GMAIL-MSGID: 1787117838653774727 This fixes the ld "Handle no DWARF information" testcase. Which currently fails on riscv because a local label name is assumed to be the current function name. bfd/ChangeLog: * elfnn-riscv.c (riscv_maybe_function_sym): Also check _bfd_elf_is_local_label_name. --- bfd/elfnn-riscv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index 509d61e5017..15c7fa3f89e 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -5452,7 +5452,8 @@ riscv_maybe_function_sym (const asymbol *sym, bfd_vma *code_off) { if (sym->flags & BSF_LOCAL - && riscv_elf_is_mapping_symbols (sym->name)) + && (riscv_elf_is_mapping_symbols (sym->name) + || _bfd_elf_is_local_label_name (sec->owner, sym->name))) return 0; return _bfd_elf_maybe_function_sym (sym, sec, code_off);