[PATCH] gas/Dwarf: properly skip zero-size functions

Jan Beulich jbeulich@suse.com
Tue Aug 9 15:05:15 GMT 2022

On 09.08.2022 16:51, Nick Clifton wrote:
>> +	  expressionS size = { .X_op = O_constant };
> Does this expression guarantee that the other fields in size are
> initialised to zero ?

Designated initializers set all unmentioned fields to zero just like
initializers of static variables would do: "... all subobjects that
are not initialized explicitly shall be initialized implicitly the
same as objects that have static storage duration" (quoted from C99).

>  If not, then:
>> +#endif
>> +	  if (size.X_op == O_constant && size.X_add_number == 0)
>> +	    continue;
> size.X_add_number could be uninitialized here.
> Apart from fixing that, (if I am right about designated initializers), the
> rest of the patch looks fine to me.

Thanks. I simply didn't want to commit it right away, but give
people already involved in the bug to potentially actually try it
out first. But I'm not going to wait too long with actually
committing it (and also putting it on the branch).


More information about the Binutils mailing list