[PATCH 2/2] elf: Add GNU_PROPERTY_1_NEEDED check
Alan Modra
amodra@gmail.com
Tue Jun 22 00:06:26 GMT 2021
On Mon, Jun 21, 2021 at 03:34:38PM -0700, Fangrui Song wrote:
> clang -fno-pic -fno-direct-access-extern-data works with clang>=12.0.0 today.
-fno-direct-access-extern-data or variations on that also seem good to
me. -fpic-extern would also work. I liked -fprotected-abi because
it shows the intent of correcting abi issues related to protected
visibility. (Yes, it affects code for all undefined symbols because
the compiler clearly isn't seeing the entire program if there are
undefined symbols.)
The main thing that struck me about -fsingle-global-definition is that
the option doesn't do what it says. You can still have multiple
global definitions of a given symbol, one in the executable and one in
each of the shared libraries making up the complete program. Which of
course is no different to code without -fsingle-global-definition.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list