[PATCH 2/2] elf: Add GNU_PROPERTY_1_NEEDED check

Alan Modra amodra@gmail.com
Mon Jun 21 10:46:45 GMT 2021


I'm happy with the direction of this patch series, but do consult with
ARM maintainers before committing.

On Sun, Jun 20, 2021 at 03:50:29PM -0700, H.J. Lu via Binutils wrote:
> If GNU_PROPERTY_1_NEEDED_SINGLE_GLOBAL_DEFINITION is set on any input
> relocatable files:
> 
> 1. Don't generate copy relocations.
> 2. Turn off extern_protected_data.
> 3. Treate reference to protected symbols with single global definition
> as local.
> 4. Set GNU_PROPERTY_1_NEEDED_SINGLE_GLOBAL_DEFINITION on output.
> 5. Add -z [no]single-global-definition to control single global definition.

This doesn't seem a good name.  I think the name should have
"protected" in it somewhere, since what you are doing here affects the
way the x86 and arm toolchains treat protected visibility symbols.

Hmm, do you even need a new linker option?  Powerpc toolchains behave
as you are proposing for x86, without needing special linker options.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list