diff --git a/libc/arch-x86_64/syscalls/__arch_prctl.S b/libc/arch-x86_64/syscalls/__arch_prctl.S index 70f284a56..0adcfd252 100644 --- a/libc/arch-x86_64/syscalls/__arch_prctl.S +++ b/libc/arch-x86_64/syscalls/__arch_prctl.S @@ -16,3 +16,4 @@ ENTRY(__arch_prctl) 1: ret END(__arch_prctl) +.hidden _C_LABEL(__arch_prctl) diff --git a/libc/arch-x86_64/syscalls/__brk.S b/libc/arch-x86_64/syscalls/__brk.S index a50d6cae9..6227f9d85 100644 --- a/libc/arch-x86_64/syscalls/__brk.S +++ b/libc/arch-x86_64/syscalls/__brk.S @@ -16,3 +16,4 @@ ENTRY(__brk) 1: ret END(__brk) +.hidden _C_LABEL(__brk) diff --git a/libc/arch-x86_64/syscalls/__clone.S b/libc/arch-x86_64/syscalls/__clone.S index c10402acf..9de9a681c 100644 --- a/libc/arch-x86_64/syscalls/__clone.S +++ b/libc/arch-x86_64/syscalls/__clone.S @@ -17,3 +17,4 @@ ENTRY(__clone) 1: ret END(__clone) +.hidden _C_LABEL(__clone) diff --git a/libc/arch-x86_64/syscalls/__epoll_pwait.S b/libc/arch-x86_64/syscalls/__epoll_pwait.S index 98f34657e..5be1f2a69 100644 --- a/libc/arch-x86_64/syscalls/__epoll_pwait.S +++ b/libc/arch-x86_64/syscalls/__epoll_pwait.S @@ -17,3 +17,4 @@ ENTRY(__epoll_pwait) 1: ret END(__epoll_pwait) +.hidden _C_LABEL(__epoll_pwait) diff --git a/libc/arch-x86_64/syscalls/__getcpu.S b/libc/arch-x86_64/syscalls/__getcpu.S index becdead71..c669ea69f 100644 --- a/libc/arch-x86_64/syscalls/__getcpu.S +++ b/libc/arch-x86_64/syscalls/__getcpu.S @@ -16,3 +16,4 @@ ENTRY(__getcpu) 1: ret END(__getcpu) +.hidden _C_LABEL(__getcpu) diff --git a/libc/arch-x86_64/syscalls/__getcwd.S b/libc/arch-x86_64/syscalls/__getcwd.S index aed2293c2..dd34d1963 100644 --- a/libc/arch-x86_64/syscalls/__getcwd.S +++ b/libc/arch-x86_64/syscalls/__getcwd.S @@ -16,3 +16,4 @@ ENTRY(__getcwd) 1: ret END(__getcwd) +.hidden _C_LABEL(__getcwd) diff --git a/libc/arch-x86_64/syscalls/__getpriority.S b/libc/arch-x86_64/syscalls/__getpriority.S index 4e7cdc702..588f7fe2f 100644 --- a/libc/arch-x86_64/syscalls/__getpriority.S +++ b/libc/arch-x86_64/syscalls/__getpriority.S @@ -16,3 +16,4 @@ ENTRY(__getpriority) 1: ret END(__getpriority) +.hidden _C_LABEL(__getpriority) diff --git a/libc/arch-x86_64/syscalls/__ioctl.S b/libc/arch-x86_64/syscalls/__ioctl.S index 384cb446a..264ffa44f 100644 --- a/libc/arch-x86_64/syscalls/__ioctl.S +++ b/libc/arch-x86_64/syscalls/__ioctl.S @@ -16,3 +16,4 @@ ENTRY(__ioctl) 1: ret END(__ioctl) +.hidden _C_LABEL(__ioctl) diff --git a/libc/arch-x86_64/syscalls/__openat.S b/libc/arch-x86_64/syscalls/__openat.S index 022bf7fb6..36f7ddc1d 100644 --- a/libc/arch-x86_64/syscalls/__openat.S +++ b/libc/arch-x86_64/syscalls/__openat.S @@ -17,3 +17,4 @@ ENTRY(__openat) 1: ret END(__openat) +.hidden _C_LABEL(__openat) diff --git a/libc/arch-x86_64/syscalls/__ppoll.S b/libc/arch-x86_64/syscalls/__ppoll.S index c6c055ba9..a92dfe502 100644 --- a/libc/arch-x86_64/syscalls/__ppoll.S +++ b/libc/arch-x86_64/syscalls/__ppoll.S @@ -17,3 +17,4 @@ ENTRY(__ppoll) 1: ret END(__ppoll) +.hidden _C_LABEL(__ppoll) diff --git a/libc/arch-x86_64/syscalls/__pselect6.S b/libc/arch-x86_64/syscalls/__pselect6.S index b0bb8bafe..44d5c8d2b 100644 --- a/libc/arch-x86_64/syscalls/__pselect6.S +++ b/libc/arch-x86_64/syscalls/__pselect6.S @@ -17,3 +17,4 @@ ENTRY(__pselect6) 1: ret END(__pselect6) +.hidden _C_LABEL(__pselect6) diff --git a/libc/arch-x86_64/syscalls/__ptrace.S b/libc/arch-x86_64/syscalls/__ptrace.S index 6c45144ff..f032f3e73 100644 --- a/libc/arch-x86_64/syscalls/__ptrace.S +++ b/libc/arch-x86_64/syscalls/__ptrace.S @@ -17,3 +17,4 @@ ENTRY(__ptrace) 1: ret END(__ptrace) +.hidden _C_LABEL(__ptrace) diff --git a/libc/arch-x86_64/syscalls/__reboot.S b/libc/arch-x86_64/syscalls/__reboot.S index f4d92451a..d62ebcdb2 100644 --- a/libc/arch-x86_64/syscalls/__reboot.S +++ b/libc/arch-x86_64/syscalls/__reboot.S @@ -17,3 +17,4 @@ ENTRY(__reboot) 1: ret END(__reboot) +.hidden _C_LABEL(__reboot) diff --git a/libc/arch-x86_64/syscalls/__rt_sigaction.S b/libc/arch-x86_64/syscalls/__rt_sigaction.S index ee50972d7..e2892bf0a 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigaction.S +++ b/libc/arch-x86_64/syscalls/__rt_sigaction.S @@ -17,3 +17,4 @@ ENTRY(__rt_sigaction) 1: ret END(__rt_sigaction) +.hidden _C_LABEL(__rt_sigaction) diff --git a/libc/arch-x86_64/syscalls/__rt_sigpending.S b/libc/arch-x86_64/syscalls/__rt_sigpending.S index a755e2859..d683b37ce 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigpending.S +++ b/libc/arch-x86_64/syscalls/__rt_sigpending.S @@ -16,3 +16,4 @@ ENTRY(__rt_sigpending) 1: ret END(__rt_sigpending) +.hidden _C_LABEL(__rt_sigpending) diff --git a/libc/arch-x86_64/syscalls/__rt_sigprocmask.S b/libc/arch-x86_64/syscalls/__rt_sigprocmask.S index 4f0bed5b9..236b68de2 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigprocmask.S +++ b/libc/arch-x86_64/syscalls/__rt_sigprocmask.S @@ -17,3 +17,4 @@ ENTRY(__rt_sigprocmask) 1: ret END(__rt_sigprocmask) +.hidden _C_LABEL(__rt_sigprocmask) diff --git a/libc/arch-x86_64/syscalls/__rt_sigsuspend.S b/libc/arch-x86_64/syscalls/__rt_sigsuspend.S index 0d80dd3dc..ed45250da 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigsuspend.S +++ b/libc/arch-x86_64/syscalls/__rt_sigsuspend.S @@ -16,3 +16,4 @@ ENTRY(__rt_sigsuspend) 1: ret END(__rt_sigsuspend) +.hidden _C_LABEL(__rt_sigsuspend) diff --git a/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S b/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S index fca8ffa1a..bc2fdef9d 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S @@ -17,3 +17,4 @@ ENTRY(__rt_sigtimedwait) 1: ret END(__rt_sigtimedwait) +.hidden _C_LABEL(__rt_sigtimedwait) diff --git a/libc/arch-x86_64/syscalls/__sched_getaffinity.S b/libc/arch-x86_64/syscalls/__sched_getaffinity.S index 9b6034c90..14765574d 100644 --- a/libc/arch-x86_64/syscalls/__sched_getaffinity.S +++ b/libc/arch-x86_64/syscalls/__sched_getaffinity.S @@ -16,3 +16,4 @@ ENTRY(__sched_getaffinity) 1: ret END(__sched_getaffinity) +.hidden _C_LABEL(__sched_getaffinity) diff --git a/libc/arch-x86_64/syscalls/__syslog.S b/libc/arch-x86_64/syscalls/__syslog.S index ed6a4ff48..db3a3976e 100644 --- a/libc/arch-x86_64/syscalls/__syslog.S +++ b/libc/arch-x86_64/syscalls/__syslog.S @@ -16,3 +16,4 @@ ENTRY(__syslog) 1: ret END(__syslog) +.hidden _C_LABEL(__syslog) diff --git a/libc/arch-x86_64/syscalls/__timer_create.S b/libc/arch-x86_64/syscalls/__timer_create.S index 97f7a569b..c4c4a2e13 100644 --- a/libc/arch-x86_64/syscalls/__timer_create.S +++ b/libc/arch-x86_64/syscalls/__timer_create.S @@ -16,3 +16,4 @@ ENTRY(__timer_create) 1: ret END(__timer_create) +.hidden _C_LABEL(__timer_create) diff --git a/libc/arch-x86_64/syscalls/__timer_delete.S b/libc/arch-x86_64/syscalls/__timer_delete.S index 2d4cbfb87..808884116 100644 --- a/libc/arch-x86_64/syscalls/__timer_delete.S +++ b/libc/arch-x86_64/syscalls/__timer_delete.S @@ -16,3 +16,4 @@ ENTRY(__timer_delete) 1: ret END(__timer_delete) +.hidden _C_LABEL(__timer_delete) diff --git a/libc/arch-x86_64/syscalls/__timer_getoverrun.S b/libc/arch-x86_64/syscalls/__timer_getoverrun.S index 508fb31c7..f5224b48e 100644 --- a/libc/arch-x86_64/syscalls/__timer_getoverrun.S +++ b/libc/arch-x86_64/syscalls/__timer_getoverrun.S @@ -16,3 +16,4 @@ ENTRY(__timer_getoverrun) 1: ret END(__timer_getoverrun) +.hidden _C_LABEL(__timer_getoverrun) diff --git a/libc/arch-x86_64/syscalls/__timer_gettime.S b/libc/arch-x86_64/syscalls/__timer_gettime.S index 87e6994c3..bf3efff13 100644 --- a/libc/arch-x86_64/syscalls/__timer_gettime.S +++ b/libc/arch-x86_64/syscalls/__timer_gettime.S @@ -16,3 +16,4 @@ ENTRY(__timer_gettime) 1: ret END(__timer_gettime) +.hidden _C_LABEL(__timer_gettime) diff --git a/libc/arch-x86_64/syscalls/__timer_settime.S b/libc/arch-x86_64/syscalls/__timer_settime.S index 5bbce2dd4..694216e28 100644 --- a/libc/arch-x86_64/syscalls/__timer_settime.S +++ b/libc/arch-x86_64/syscalls/__timer_settime.S @@ -17,3 +17,4 @@ ENTRY(__timer_settime) 1: ret END(__timer_settime) +.hidden _C_LABEL(__timer_settime) diff --git a/libc/arch-x86_64/syscalls/__waitid.S b/libc/arch-x86_64/syscalls/__waitid.S index 8e0f503e1..5632fb1ce 100644 --- a/libc/arch-x86_64/syscalls/__waitid.S +++ b/libc/arch-x86_64/syscalls/__waitid.S @@ -17,3 +17,4 @@ ENTRY(__waitid) 1: ret END(__waitid) +.hidden _C_LABEL(__waitid) diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py index 2334e3559..578605d32 100755 --- a/libc/tools/gensyscalls.py +++ b/libc/tools/gensyscalls.py @@ -233,10 +233,17 @@ def make__NR_name(name): return "__NR_%s" % (name) -def add_aliases(stub, syscall): +def add_footer(pointer_length, stub, syscall): + # Add any aliases for this syscall. aliases = syscall["aliases"] for alias in aliases: stub += function_alias % { "func" : syscall["func"], "alias" : alias } + + # Use hidden visibility for any functions beginning with underscores. + # TODO: clean up single-underscore names too. + if pointer_length == 64 and syscall["func"].startswith("__"): + stub += '.hidden _C_LABEL(' + syscall["func"] + ')\n' + return stub @@ -334,22 +341,22 @@ class State: syscall["__NR_name"] = make__NR_name(syscall["name"]) if syscall.has_key("arm"): - syscall["asm-arm"] = add_aliases(arm_eabi_genstub(syscall), syscall) + syscall["asm-arm"] = add_footer(32, arm_eabi_genstub(syscall), syscall) if syscall.has_key("x86"): if syscall["socketcall_id"] >= 0: - syscall["asm-x86"] = add_aliases(x86_genstub_socketcall(syscall), syscall) + syscall["asm-x86"] = add_footer(32, x86_genstub_socketcall(syscall), syscall) else: - syscall["asm-x86"] = add_aliases(x86_genstub(syscall), syscall) + syscall["asm-x86"] = add_footer(32, x86_genstub(syscall), syscall) elif syscall["socketcall_id"] >= 0: E("socketcall_id for dispatch syscalls is only supported for x86 in '%s'" % t) return if syscall.has_key("mips"): - syscall["asm-mips"] = add_aliases(mips_genstub(syscall), syscall) + syscall["asm-mips"] = add_footer(32, mips_genstub(syscall), syscall) if syscall.has_key("x86_64"): - syscall["asm-x86_64"] = add_aliases(x86_64_genstub(syscall), syscall) + syscall["asm-x86_64"] = add_footer(64, x86_64_genstub(syscall), syscall) # Scan a Linux kernel asm/unistd.h file containing __NR_* constants