summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2010-11-11 16:53:25 +0000
committered <ed@FreeBSD.org>2010-11-11 16:53:25 +0000
commit5f1c2ebcce278ea22b2818f58bef8a236c8b9ebe (patch)
treeb44616ee43ee1914cda25f093e3c2260cf9f97e7
parent1b04dcdfa7b5e42e464878eca0bbb3236498629b (diff)
downloadFreeBSD-src-5f1c2ebcce278ea22b2818f58bef8a236c8b9ebe.zip
FreeBSD-src-5f1c2ebcce278ea22b2818f58bef8a236c8b9ebe.tar.gz
Set symbol visibility to hidden.
Not doing so may cause all sorts of random libraries to expose libcompiler_rt's functions, which should of course not be done. Discussed with: kan, kib
-rw-r--r--contrib/compiler-rt/lib/assembly.h6
-rw-r--r--lib/libcompiler_rt/Makefile2
2 files changed, 4 insertions, 4 deletions
diff --git a/contrib/compiler-rt/lib/assembly.h b/contrib/compiler-rt/lib/assembly.h
index c2d5a34..c124e19 100644
--- a/contrib/compiler-rt/lib/assembly.h
+++ b/contrib/compiler-rt/lib/assembly.h
@@ -33,7 +33,7 @@
#ifdef VISIBILITY_HIDDEN
#define DEFINE_COMPILERRT_FUNCTION(name) \
.globl SYMBOL_NAME(name) SEPARATOR \
- .private_extern SYMBOL_NAME(name) SEPARATOR \
+ .hidden SYMBOL_NAME(name) SEPARATOR \
SYMBOL_NAME(name):
#else
#define DEFINE_COMPILERRT_FUNCTION(name) \
@@ -43,12 +43,12 @@
#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
.globl SYMBOL_NAME(name) SEPARATOR \
- .private_extern SYMBOL_NAME(name) SEPARATOR \
+ .hidden SYMBOL_NAME(name) SEPARATOR \
SYMBOL_NAME(name):
#define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \
.globl name SEPARATOR \
- .private_extern name SEPARATOR \
+ .hidden name SEPARATOR \
name:
#endif /* COMPILERRT_ASSEMBLY_H */
diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile
index e290f1d..2da28aa 100644
--- a/lib/libcompiler_rt/Makefile
+++ b/lib/libcompiler_rt/Makefile
@@ -6,7 +6,7 @@ LIB= compiler_rt
NO_PIC=
WARNS?= 2
-CFLAGS+=${PICFLAG}
+CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN
.if ${MACHINE_CPUARCH} == "amd64"
CRTARCH=x86_64
OpenPOWER on IntegriCloud