[v2] elfcpp/dwarf.h: Add post DWARF5 constants to DW_LANG enum

Message ID 20241215152316.1327197-1-ahajkova@redhat.com
State New
Headers
Series [v2] elfcpp/dwarf.h: Add post DWARF5 constants to DW_LANG enum |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Build failed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Build failed

Commit Message

Alexandra Hájková Dec. 15, 2024, 3:21 p.m. UTC
  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(-)
  

Comments

Jan Beulich Dec. 16, 2024, 7:38 a.m. UTC | #1
On 15.12.2024 16:21, Alexandra Hájková wrote:
> 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 +++++++++++++++++++++++++

This part is okay with one adjustment (see below).

>  gold/gdb-index.cc | 19 ++++++++++++++++++-
>  2 files changed, 43 insertions(+), 1 deletion(-)

The gold part wants a gold maintainer's approval, whom you didn't even Cc
(adding now).

> --- 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,

Please add proper indentation here.

Jan

> +  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"),
  
Ian Lance Taylor Dec. 16, 2024, 5:26 p.m. UTC | #2
On Sun, Dec 15, 2024 at 11:38 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 15.12.2024 16:21, Alexandra Hájková wrote:
> > 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 +++++++++++++++++++++++++
>
> This part is okay with one adjustment (see below).
>
> >  gold/gdb-index.cc | 19 ++++++++++++++++++-
> >  2 files changed, 43 insertions(+), 1 deletion(-)
>
> The gold part wants a gold maintainer's approval, whom you didn't even Cc
> (adding now).

The gold changes are fine.  Thanks.

Ian
  

Patch

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"),