[PATCH] aarch64: Don't assert on long system registers

Nick Clifton nickc@redhat.com
Mon Aug 10 15:28:55 GMT 2020


Hi Alex,

> Please see the reworked patch attached. I had a go at using a fixed-size array
> for the name field but this ended up being quite an invasive change since we
> tend to assume that this field is a pointer. This also ends up wasting space in
> the binary.
> 
> With this patch I'm proposing an alternative approach which is to assert that
> the system register names are no longer than AARCH64_MAX_SYSREG_NAME_LEN when
> they are inserted into the hash table.
> 
> While this won't catch someone adding an unusually-long system register at
> compile time, the resulting GAS binary will crash unconditionally on startup,
> which will ensure that this gets caught quickly in any case.
> 
> Testing:
>  * Regression tested on aarch64-none-elf.
> 
> Is the updated patch OK for master?

Nice.  Thanks for taking the time to rework the patch.  Approved - please apply.

Cheers
  Nick
 



More information about the Binutils mailing list