summaryrefslogtreecommitdiffstats
path: root/src/include/compiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/compiler.h')
-rw-r--r--src/include/compiler.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/compiler.h b/src/include/compiler.h
index 4140a356..7b5a58d6 100644
--- a/src/include/compiler.h
+++ b/src/include/compiler.h
@@ -59,6 +59,15 @@ __asm__ ( ".equ\t" OBJECT_SYMBOL_STR ", 0" );
#define REQUIRE_OBJECT(object) \
__asm__ ( ".equ\tneed_" #object ", obj_" #object );
+/* Force visibility of all symbols to "hidden", i.e. inform gcc that
+ * all symbol references resolve strictly within our final binary.
+ * This avoids unnecessary PLT/GOT entries on x86_64.
+ *
+ * This is a stronger claim than specifying "-fvisibility=hidden",
+ * since it also affects symbols marked with "extern".
+ */
+#pragma GCC visibility push(hidden)
+
/** @def DBG
*
* Print a debugging message.