[PATCH] gas/ELF: Assume merge entity size of 1 if it's missing

Jan Beulich jbeulich@suse.com
Wed Jan 8 07:12:48 GMT 2025


On 08.01.2025 03:33, Thiago Jung Bauermann wrote:
> Jan Beulich <jbeulich@suse.com> writes:
>> On 03.01.2025 04:28, Thiago Jung Bauermann wrote:
>>> @@ -569,6 +570,26 @@ get_absolute_expression (void)
>>>    return get_absolute_expr (&exp);
>>>  }
>>>
>>> +/* Return value of absolute expression starting at INPUT_LINE_POINTER and
>>> +   set KIND to either O_constant, O_absent or O_illegal depending on
>>> +   whether the expression was constant, absent or something else
>>> +   entirely.  */
>>> +
>>> +offsetT
>>> +get_absolute_expression_kind (operatorT *kind)
>>> +{
>>> +  expressionS exp;
>>> +  offsetT value;
>>> +
>>> +  value = get_absolute_expr (&exp);
>>> +  if (exp.X_op == O_absent || exp.X_op == O_constant)
>>> +      *kind = exp.X_op;
>>> +  else
>>> +      *kind = O_illegal;
>>> +
>>> +  return value;
>>> +}
>>
>> Personally I question such oddly named, overly special purpose helpers.
>> Callers needing details on the expression simply should be using the
>> respective underlying functions.
> 
> I did it this way because get_absolute_expr is a static function. Would
> it be acceptable if the patch exported it instead?

I suppose that would be okay, yes. Yet how about calling
expression_and_evaluate() directly, and going from there?

Jan


More information about the Binutils mailing list