[RFC, V3 1/5] binutils: make read_cie aware of new augmentation char 'G'

Richard Earnshaw (lists) Richard.Earnshaw@arm.com
Tue Jul 8 16:46:28 GMT 2025


On 05/06/2025 07:09, Jan Beulich wrote:
> On 05.06.2025 01:25, Indu Bhagat via Binutils wrote:
>> This allows objdump/readelf to dump DWARF/EH Frame info when the stack
>> frame makes use of MTE tagging.
>>
>> ChangeLog:
>>
>>         * binutils/dwarf.c (read_cie): Add handling for augmentation
>> 	char 'G'.
>>
>> ---
>> [No change in V3]
> 
> And hence my earlier comment has remained unaddressed.

Just my 2c on this.  I think it could be fairly easily handled by renaming init_dwarf_regnames_by_elf_machine_code and init_dwarf_regnames_by_bfd_arch_and_mach to remove the '_regnames', then using those hooks to set up a handler for the augmentation characters.
> 
> Jan
> 
>> --- a/binutils/dwarf.c
>> +++ b/binutils/dwarf.c
>> @@ -9185,6 +9185,8 @@ read_cie (unsigned char *start, unsigned char *end,
>>  	    ;

this would then become


>>  	  else if (*p == 'B')
>>  	    ;
>> +	  else if (*p == 'G')
>> +	    ;

          else if (is_mach_augmentation (*p))
            ;

>>  	  else
>>  	    break;
>>  	  p++;
> 

and for aarch64 we'd handle both 'B' and 'G'.

The only thing to do then is to check if other architectures need to handle 'B', or some of the other characters listed here.  This seems unlikely as 'B' was added with https://sourceware.org/pipermail/binutils/2018-December/105707.html.

and the others ('L' 'P' and 'R') were all added in https://sourceware.org/pipermail/binutils/2001-May/011030.html so could well be common to all 64-bit targets using GCC.

The only remaining issue then would be if some other arguments would need to be passed (eg 'fc', or '&q') to enable processing of the augmentation char in some way.  I'd be inclined to cross that bridge if and when we came to it.

R.


More information about the Binutils mailing list