[PATCH v1 1/4] aarch64 gas: free hash tables in md_begin() to avoid memory leaks

Richard Earnshaw (foss) Richard.Earnshaw@arm.com
Mon Mar 2 13:10:30 GMT 2026


On 24/02/2026 16:39, Jan Beulich wrote:
> On 24.02.2026 17:26, Matthieu Longo wrote:
>> The AArch64 GAS backend allocates several hash tables in md_begin(). All of
>> these hash tables use strings as keys; some of those strings are dynamically
>> allocated, while others are statically allocated. None of these hash tables
>> have ever been deallocated in aarch64_md_end(), resulting in memory leaks
>> that spam LeakSanitizer reports.
>>
>> The first part of the fix deallocates the hash tables in aarch64_md_end().
> 
> By how much does this increase assembly time for small or medium size input?
> 
> Jan

Can't we just wrap this code inside an ifdef so that it's only triggered when the sanitizers are enabled?  It's all pretty pointless given that we're going to exit anyway.

R.


More information about the Binutils mailing list