aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2021-04-24 19:28:25 +0100
committerIain Sandoe <iain@sandoe.co.uk>2021-04-24 19:31:25 +0100
commita1765b421eb3d01ecc88fb0cdec9f06bfdaab8e2 (patch)
tree047d005bf1d21dad304a7a22dd7799473e291565 /gcc
parentfb6b24c66ea5a2ccbf6fb9f299c20a69f962ac9b (diff)
downloadgcc-a1765b421eb3d01ecc88fb0cdec9f06bfdaab8e2.zip
gcc-a1765b421eb3d01ecc88fb0cdec9f06bfdaab8e2.tar.gz
gcc-a1765b421eb3d01ecc88fb0cdec9f06bfdaab8e2.tar.bz2
Revert "Darwin : Adjust darwin_binds_local_p for PIC code [PR100152]."
Unfortunately, although this is required to fix the PR, and is notionally correct, it regresses some of the sanitizer and IPA tests. Reverting until this can be analysed. This reverts commit b6600392bf71c4a9785f8f49948b611425896830.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/darwin.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 36b460a..5d17391 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -3134,25 +3134,16 @@ darwin_file_end (void)
/* TODO: Add a language hook for identifying if a decl is a vtable. */
#define DARWIN_VTABLE_P(DECL) 0
-/* Cross-module name binding.
- Darwin's dynamic linker supports interposition and lazy symbol binding.
- If we are generating PIC code and a symbol is public, then it could
- potentially be indirected via a lazy-resolver stub; we cannot tell at
- compile-time if this will be done (since the indirection can be the
- result of adding a -flat-namespace option at link-time). Here we are
- conservative and assume that any such symbol cannot bind locally.
- The default implementation for binds_local_p handles undefined, weak and
- common symbols which are always indirected. */
+/* Cross-module name binding. Darwin does not support overriding
+ functions at dynamic-link time, except for vtables in kexts. */
bool
darwin_binds_local_p (const_tree decl)
{
/* We use the "shlib" input to indicate that a symbol should be
- considered overridable. Older versions of the kernel also support
- interposition for extensions (although this code is a place-holder
- until there is an implementation for DARWIN_VTABLE_P). */
+ considered overridable; only relevant for vtables in kernel modules
+ on earlier system versions, and with a TODO to complete. */
bool force_overridable = TARGET_KEXTABI && DARWIN_VTABLE_P (decl);
- force_overridable |= MACHOPIC_PURE;
return default_binds_local_p_3 (decl, force_overridable /* shlib */,
false /* weak dominate */,
false /* extern_protected_data */,