From patchwork Sun Dec 15 15:21:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Alexandra_H=C3=A1jkov=C3=A1?= X-Patchwork-Id: 103142 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D04433858C5F for ; Sun, 15 Dec 2024 15:28:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D04433858C5F Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PBDlivFH X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 8C52F3858D21 for ; Sun, 15 Dec 2024 15:28:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C52F3858D21 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8C52F3858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734276490; cv=none; b=Pq/xh5Br6yLlYui/3IBkA7U16+Gy6RjWgIbXCQ+L1fgi0qEC9RmiTl7kNyMjxKL19zbKpdOB+1sphyX4G6YklrkNEOeM4460gsBPebby5ngqMuy2uAruht/z1dgw0OTuMGxw5TOnHZY2kw6ClYcYjhgeXWWP6oZh+L/VV8YLsLM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734276490; c=relaxed/simple; bh=eHyZmvJxryfwRZ3N6ngCRtpIEl4ftVKO1LPOLf1f+9M=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Fa7B7HXhtTV7lh2aUMzYVlO8ZJpOGucaRdcky5y76rx7JeIisEbVoelEnqC5i/PcparTJKvc/3mEDiI0cSBmdxscHn+DD1MH8aU0FfTEIVxbgd4KrxEYbAKhedzQdeZW4wIct2rxNUwNBKHSmoii2cNBgsyMeCgo0pVIPi/n7EQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C52F3858D21 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734276490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tXOR21ZdCHK/pyfRe0RNuJY9j1Iv291Sqf+mI3nWQSY=; b=PBDlivFHrtq+aXc8yDM8RXV9lWfASkQs4puxzKDSpzdCWLmkBaQGABjlBTHQSG1+vqH3Jc pveysctsacnUMFOT05TcFzYde86Qq67FPtTyjk0UJFkT7g5VI7/NTDpR2U486YQt1HnzH7 g+98SpkpEU9oni83k2M+par1UWC6kIs= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-343-OtiHtbrZM5KcQRz3NqSQMg-1; Sun, 15 Dec 2024 10:28:08 -0500 X-MC-Unique: OtiHtbrZM5KcQRz3NqSQMg-1 X-Mimecast-MFC-AGG-ID: OtiHtbrZM5KcQRz3NqSQMg Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2E201195608C for ; Sun, 15 Dec 2024 15:28:08 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.242.3]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 96F0019560A3; Sun, 15 Dec 2024 15:28:06 +0000 (UTC) From: =?utf-8?q?Alexandra_H=C3=A1jkov=C3=A1?= To: binutils@sourceware.org Cc: ahajkova@redhat.com Subject: [PATCH v2] elfcpp/dwarf.h: Add post DWARF5 constants to DW_LANG enum Date: Sun, 15 Dec 2024 16:21:26 +0100 Message-ID: <20241215152316.1327197-1-ahajkova@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: lLFfI9O4GD0MghQni_RTZCq8Q3q4Wg8Gr5crk4X2puQ_1734276488 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org Also add the post DWARF5 language codes to gold/gdb-index.cc Gdb_index_info_reader::visit_top_die check as --gdb-index only supports C and C++ languages and emits warning otherwise. --- v2: Fix the codes ordering Add all the new post DWARF5 constants from the latests sync with gcc Fix the DW_LANG_Fortran23 number elfcpp/dwarf.h | 25 +++++++++++++++++++++++++ gold/gdb-index.cc | 19 ++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/elfcpp/dwarf.h b/elfcpp/dwarf.h index 2adb8642019..0a17be32a8b 100644 --- a/elfcpp/dwarf.h +++ b/elfcpp/dwarf.h @@ -247,6 +247,31 @@ enum DW_LANG DW_LANG_C_plus_plus_14 = 0x0021, DW_LANG_Fortran03 = 0x0022, DW_LANG_Fortran08 = 0x0023, + DW_LANG_C_plus_plus_17 = 0x002a, + DW_LANG_C_plus_plus_20 = 0x002b, + DW_LANG_C17 = 0x002c, + DW_LANG_Fortran18 = 0x002d, + DW_LANG_Ada2005 = 0x002e, + DW_LANG_Ada2012 = 0x002f, + DW_LANG_HIP = 0x0030, + DW_LANG_Assembly = 0x0031, + DW_LANG_C_sharp = 0x0032, + DW_LANG_Mojo = 0x0033, + DW_LANG_GLSL = 0x0034, + DW_LANG_GLSL_ES = 0x0035, + DW_LANG_HLSL = 0x0036, + DW_LANG_OpenCL_CPP = 0x0037, + DW_LANG_CPP_for_OpenCL = 0x003 + DW_LANG_SYCL = 0x0039, +DW_LANG_C_plus_plus_23 = 0x003a, + DW_LANG_Odin = 0x003b, + DW_LANG_P4 = 0x003c, + DW_LANG_Metal = 0x003d, + DW_LANG_C23 = 0x003e, + DW_LANG_Fortran23 = 0x003f, + DW_LANG_Ruby = 0x0040, + DW_LANG_Move = 0x0041, + DW_LANG_Hylo = 0x0042, DW_LANG_lo_user = 0x8000, // Implementation-defined range start. DW_LANG_hi_user = 0xffff, // Implementation-defined range start. diff --git a/gold/gdb-index.cc b/gold/gdb-index.cc index 4d0ae0941b5..c28c9854538 100644 --- a/gold/gdb-index.cc +++ b/gold/gdb-index.cc @@ -371,9 +371,26 @@ Gdb_index_info_reader::visit_top_die(Dwarf_die* die) || this->cu_language_ == elfcpp::DW_LANG_Fortran90 || this->cu_language_ == elfcpp::DW_LANG_Java || this->cu_language_ == elfcpp::DW_LANG_Ada95 + || this->cu_language_ == elfcpp::DW_LANG_Ada2005 + || this->cu_language_ == elfcpp::DW_LANG_Ada2012 + || this->cu_language_ == elfcpp::DW_LANG_HIP + || this->cu_language_ == elfcpp::DW_LANG_Assembly + || this->cu_language_ == elfcpp::DW_LANG_C_sharp + || this->cu_language_ == elfcpp::DW_LANG_Mojo + || this->cu_language_ == elfcpp::DW_LANG_GLSL + || this->cu_language_ == elfcpp::DW_LANG_GLSL_ES + || this->cu_language_ == elfcpp::DW_LANG_HLSL + || this->cu_language_ == elfcpp::DW_LANG_Odin + || this->cu_language_ == elfcpp::DW_LANG_P4 + || this->cu_language_ == elfcpp::DW_LANG_Metal || this->cu_language_ == elfcpp::DW_LANG_Fortran95 || this->cu_language_ == elfcpp::DW_LANG_Fortran03 - || this->cu_language_ == elfcpp::DW_LANG_Fortran08) + || this->cu_language_ == elfcpp::DW_LANG_Fortran08 + || this->cu_language_ == elfcpp::DW_LANG_Fortran18 + || this->cu_language_ == elfcpp::DW_LANG_Fortran23 + || this->cu_language_ == elfcpp::DW_LANG_Ruby + || this->cu_language_ == elfcpp::DW_LANG_Move + || this->cu_language_ == elfcpp::DW_LANG_Hylo) { gold_warning(_("%s: --gdb-index currently supports " "only C and C++ languages"),