about summary refs log tree commit diff
path: root/crt
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2024-08-10 19:49:24 -0400
committerRich Felker <dalias@aerifal.cx>2024-08-10 19:49:24 -0400
commit9c78557af0a5e521cdb46a4ca7630f2987d2523e (patch)
tree02029b6904cf228c26d0d1edba4de52633acb397 /crt
parent882aedf6a13891f887d20f6a4184a13e94793b84 (diff)
downloadmusl-9c78557af0a5e521cdb46a4ca7630f2987d2523e.tar.gz
musl-9c78557af0a5e521cdb46a4ca7630f2987d2523e.tar.xz
musl-9c78557af0a5e521cdb46a4ca7630f2987d2523e.zip
use hidden visibility for C entry point function _start_c
the file-level crt_arch.h asm fragments generally make direct
(non-PLT) calls from _start to _start_c, which is only valid when
there is a local, non-interposable definition for _start_c. generally,
the linker is expected to know that local definitions in a main
executable (as opposed to shared library) output are non-interposable,
making this work, but historically there have been linker bugs in this
area, and microblaze is reportedly still broken, flagging the
relocation for the call as a textrel.

the equivalent _dlstart_c, called from the same crt_arch.h asm
fragments, has always used hidden visibility without problem, and
semantically it should be hidden, so make it hidden. this ensures the
direct call is always valid regardless of whether the linker properly
special-cases main executable output.
Diffstat (limited to 'crt')
-rw-r--r--crt/crt1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crt/crt1.c b/crt/crt1.c
index 8fe8ab5d..10601215 100644
--- a/crt/crt1.c
+++ b/crt/crt1.c
@@ -11,7 +11,7 @@ weak void _fini();
 int __libc_start_main(int (*)(), int, char **,
 	void (*)(), void(*)(), void(*)());
 
-void _start_c(long *p)
+hidden void _start_c(long *p)
 {
 	int argc = p[0];
 	char **argv = (void *)(p+1);