[PATCH v0 03/15] gas: parse object attributes v2

Matthieu Longo matthieu.longo@arm.com
Thu Mar 20 14:16:22 GMT 2025


On 2025-03-11 08:03, Jan Beulich wrote:
> On 10.03.2025 18:51, Matthieu Longo wrote:
>> From: Richard Ball <richard.ball@arm.com>
>>
>> Co-Authored-By: Matthieu Longo <matthieu.longo@arm.com>
>> ---
>>   gas/config/obj-elf.c    | 411 ++++++++++++++++++++++++++++++++++++++++
>>   gas/config/obj-elf.h    |  27 +++
>>   gas/config/tc-aarch64.c | 102 ++++++++++
>>   gas/config/tc-aarch64.h |   5 +
>>   4 files changed, 545 insertions(+)
> 
> Same as patch 2 - this needs to come with a description. That description would
> include explanation of the split between generic ELF and Arm64 specific code.
> It's not obvious to me whether any other architecture really would want to
> re-use the machinery. Plus ...
> 

Hopefully addressed in the next revision.

>> --- a/gas/config/obj-elf.c
>> +++ b/gas/config/obj-elf.c
>> @@ -41,6 +41,10 @@
>>   #include "elf/alpha.h"
>>   #endif
>>   
>> +#ifdef TC_AARCH64
>> +#include "elf/aarch64.h"
>> +#endif
>> +
>>   #ifdef TC_MIPS
>>   #include "elf/mips.h"
>>   #endif
> 
> ... despite pre-existing examples like the MIPS one here I don't think we
> should lightly accept further arch-specific code in supposedly arch-agnostic
> files.
> 

The reason why I had to include this header is because I need to call 
CONVERT_SYMBOLIC_ATTRIBUTE.
A refactoring would be needed in this area I guess. Instead of using 
this macro, there should be a method on a backend object similarly to 
what we have in bfd. I didn't find such a class for gas. Everything 
seems to be exposed via macros.

>> @@ -2127,6 +2131,413 @@ obj_elf_seen_attribute (int vendor, unsigned int tag)
>>     return false;
>>   }
>>   
>> +static bool
>> +extract_string_literal (attribute_arg_value* arg_out)
> 
> Style nit (here and elsewhere): * and blank want to change places.

Fixed.

> 
> Jan


More information about the Binutils mailing list