[PATCH v2] aarch64: silence GCS warnings on shared libraries for -z gcs=implicit

Matthieu Longo matthieu.longo@arm.com
Fri Jan 16 16:40:35 GMT 2026


On 14/01/2026 20:51, Alice Carlotti wrote:
>> +  aarch64_feature_marking_report gcs_report;
>> +  aarch64_feature_marking_report gcs_report_dynamic;
> I think you could slightly simplify the code by initialising these to the
> values from sw_protections.  This would allow you to remove the else blocks and
> shorten the if condition.

I purposely didn't initialize gcs_report and gcs_report_dynamic with the values from sw_protections.
The fallback value is not always the value from sw_protections, but can also be MARKING_NONE. Setting it before the switch would let the reader wrongly think that this is the default value.
Consequently, it seems preferable in this case to get all the assignation code inside the same 'case' to improve readability.

Matthieu


More information about the Binutils mailing list