https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100618
Bug ID: 100618 Summary: Add a -fno-semantic-interposition variant which allows variable interposition Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- Extracted from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100483 The documentation says -fno-semantic-interposition applies to variables. Having an option which only apply to external linkage function definitions will be useful. Assuming no-variable-interposition is unfortunately incompatible with the plethora of copy relocations: -fno-pic emits direct access relocations referencing a global variable. If the global variable turns out to be defined in a shared object, there will be a copy relocation in the executable. The object the shared object sees and the executable sees will be different. See https://maskray.me/blog/2021-05-16-elf-interposition-and-bsymbolic#the-last-alliance-of-elf-and-men for more context.