[PATCH] Add -fgnu-retain/-fno-gnu-retain

Jakub Jelinek jakub@redhat.com
Thu Feb 18 12:08:54 GMT 2021


On Thu, Feb 18, 2021 at 12:00:59PM +0000, Jozef Lawrynowicz wrote:
> If we can add ".retain <symbol_name>" to GAS, then I agree, current GCC
> SHF_GNU_RETAIN behavior should be removed. For GCC 12 we leverage
> .retain to implement the functionality where "used" saves symbols form
> linker garbage collection, without modifying section names or the
> structure of the object file.

Even in that case I think it is a bad idea to change the "used" attribute
behavior, not everyone using "used" attribute needs or wants that behavior,
so it should be a functionality provided by a separate new attribute.

	Jakub



More information about the Binutils mailing list