[PATCH v3] gas: add .cv_ucomp and .cv_scomp pseudo-directives

Mark Harmstone mark@harmstone.com
Wed Nov 13 03:07:50 GMT 2024


Thanks Jan. Great, I'll push it with those changes made.

On 12/11/2024 13:26, Jan Beulich wrote:
> On 12.11.2024 02:40, Mark Harmstone wrote:
>> --- a/gas/codeview.c
>> +++ b/gas/codeview.c
>> @@ -533,6 +533,84 @@ codeview_generate_asm_lineno (void)
>>     lf->num_lines++;
>>   }
>>   
>> +/* Output a compressed CodeView integer.  The return value is the number of
>> +   bytes used.  */
>> +
>> +unsigned int
>> +output_cv_comp (char *p, offsetT value, int sign)
>> +{
>> +  char *orig = p;
>> +
>> +  if (sign)
>> +    {
>> +      if (value < -0xfffffff || value > 0xfffffff)
>> +	as_fatal (_("value cannot be expressed as a .cv_scomp"));
>> +    }
>> +  else
>> +    {
>> +      if (value > 0x1fffffff)
>> +	as_fatal (_("value cannot be expressed as a .cv_ucomp"));
>> +    }
> 
> No as_fatal() please unless we really can't continue. as_bad() plus
> returning 0 here ought to allow further progress, I think.
> 
> For the !sign case don't you also need to check for >= 0 (or cast
> value to valueT / addressT)?
> 
>> --- a/gas/testsuite/gas/pe/pe.exp
>> +++ b/gas/testsuite/gas/pe/pe.exp
>> @@ -38,6 +38,11 @@ run_dump_test "section-exclude"
>>   
>>   run_dump_test "set"
>>   
>> +if { [istarget "aarch64-*-*"] || [istarget "i*86-*-*"]
>> +    || [istarget "x86_64-*-*"] } then {
>> +  run_dump_test "cv_comp"
>> +}
> 
> What about arm*-*-*, which also has O_secrel?
> 
> Okay with respective adjustments and (as before) the testsuite passing
> for all targets that the directive is usable with.
> 
> Jan



More information about the Binutils mailing list