From patchwork Mon Dec 16 15:01:18 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: 103186 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 D4B9C385840B for ; Mon, 16 Dec 2024 15:07:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4B9C385840B 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=hX4NeYJo 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 1EB15385840D for ; Mon, 16 Dec 2024 15:06:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1EB15385840D 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 1EB15385840D 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=1734361596; cv=none; b=SztQLvD4tmWNADt1gKAja+llcZFHLdcYLH1aoifF2MpiYNARzn86vFPTvVuBsuIv/QJUdHlSxU+BKnIBfg+WxWDAihwck4t6cbqD4KhyYCuFJt4QlnSlY9yKLI54s6cSzezf+W6MDnwwO8Py3ih2sLiq47Kg7BYcN933l9pHuJU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734361596; c=relaxed/simple; bh=/NpiV9ecCsFylwoP4AnxgYKAmtUAK7gPQMfdNlkmUKE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=hxzAimgFOuNtedzOugoFlrR1zgVEZcMdNc2FK5hCpIdCVvyahL0js7fCjmZhyUFpZ6Vwc6d75RzlDltV+CVYleAsGqH7rRzPO3KFtq9TwaQLTKOy01DhWp5tcdjCAIHuFv3HVjzeaM8BjBnVcV3vWbK7XrvcJf9c5Oa5QrwR3AE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1EB15385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734361595; 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=jlOqq81pzA1TFgjTRS437MpLR6nJcRyG+qiDrZG7bJ0=; b=hX4NeYJozC9It2KL4HmTY2KYoBqP/9fwIUMF7x3n+Ch09R35zrrdB9klKxU3/zuqxvuTwR wI335J1U8CaNaZKps+2zJil2qOb7DSdc2r+6cdwRC6EB6gDE2kJDzoH5lq6KAMDsfFveNi 9CeLzddcyFQ1BOkQsv1bAHZfYF7aRz4= Received: from mx-prod-mc-03.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-651-QG3WGuzUMOGFwG-mkRvwqQ-1; Mon, 16 Dec 2024 10:06:34 -0500 X-MC-Unique: QG3WGuzUMOGFwG-mkRvwqQ-1 X-Mimecast-MFC-AGG-ID: QG3WGuzUMOGFwG-mkRvwqQ 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7A1C81955F3E; Mon, 16 Dec 2024 15:06:33 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.242.10]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 195DD1953969; Mon, 16 Dec 2024 15:06:28 +0000 (UTC) From: =?utf-8?q?Alexandra_H=C3=A1jkov=C3=A1?= To: binutils@sourceware.org Cc: ccoutant@gmail.com, iant@google.com Subject: [PATCH v3] elfcpp/dwarf.h: Add post DWARF5 constants to DW_LANG enum Date: Mon, 16 Dec 2024 16:01:18 +0100 Message-ID: <20241216150137.1473028-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: ci4uT6gE2GX8KM79EIhfeic82x7LD1R9urXTj0IHkIw_1734361593 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. --- v3: Fix missing ',' Fix indentation 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..1ce59c668f1 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 = 0x0038, + 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"),