Merge "Use hidden visibility for generated stubs whose names begin with underscores."

This commit is contained in:
Elliott Hughes 2013-10-25 00:20:24 +00:00 committed by Gerrit Code Review
commit bbefbf1a75
27 changed files with 39 additions and 6 deletions

View File

@ -16,3 +16,4 @@ ENTRY(__arch_prctl)
1:
ret
END(__arch_prctl)
.hidden _C_LABEL(__arch_prctl)

View File

@ -16,3 +16,4 @@ ENTRY(__brk)
1:
ret
END(__brk)
.hidden _C_LABEL(__brk)

View File

@ -17,3 +17,4 @@ ENTRY(__clone)
1:
ret
END(__clone)
.hidden _C_LABEL(__clone)

View File

@ -17,3 +17,4 @@ ENTRY(__epoll_pwait)
1:
ret
END(__epoll_pwait)
.hidden _C_LABEL(__epoll_pwait)

View File

@ -16,3 +16,4 @@ ENTRY(__getcpu)
1:
ret
END(__getcpu)
.hidden _C_LABEL(__getcpu)

View File

@ -16,3 +16,4 @@ ENTRY(__getcwd)
1:
ret
END(__getcwd)
.hidden _C_LABEL(__getcwd)

View File

@ -16,3 +16,4 @@ ENTRY(__getpriority)
1:
ret
END(__getpriority)
.hidden _C_LABEL(__getpriority)

View File

@ -16,3 +16,4 @@ ENTRY(__ioctl)
1:
ret
END(__ioctl)
.hidden _C_LABEL(__ioctl)

View File

@ -17,3 +17,4 @@ ENTRY(__openat)
1:
ret
END(__openat)
.hidden _C_LABEL(__openat)

View File

@ -17,3 +17,4 @@ ENTRY(__ppoll)
1:
ret
END(__ppoll)
.hidden _C_LABEL(__ppoll)

View File

@ -17,3 +17,4 @@ ENTRY(__pselect6)
1:
ret
END(__pselect6)
.hidden _C_LABEL(__pselect6)

View File

@ -17,3 +17,4 @@ ENTRY(__ptrace)
1:
ret
END(__ptrace)
.hidden _C_LABEL(__ptrace)

View File

@ -17,3 +17,4 @@ ENTRY(__reboot)
1:
ret
END(__reboot)
.hidden _C_LABEL(__reboot)

View File

@ -17,3 +17,4 @@ ENTRY(__rt_sigaction)
1:
ret
END(__rt_sigaction)
.hidden _C_LABEL(__rt_sigaction)

View File

@ -16,3 +16,4 @@ ENTRY(__rt_sigpending)
1:
ret
END(__rt_sigpending)
.hidden _C_LABEL(__rt_sigpending)

View File

@ -17,3 +17,4 @@ ENTRY(__rt_sigprocmask)
1:
ret
END(__rt_sigprocmask)
.hidden _C_LABEL(__rt_sigprocmask)

View File

@ -16,3 +16,4 @@ ENTRY(__rt_sigsuspend)
1:
ret
END(__rt_sigsuspend)
.hidden _C_LABEL(__rt_sigsuspend)

View File

@ -17,3 +17,4 @@ ENTRY(__rt_sigtimedwait)
1:
ret
END(__rt_sigtimedwait)
.hidden _C_LABEL(__rt_sigtimedwait)

View File

@ -16,3 +16,4 @@ ENTRY(__sched_getaffinity)
1:
ret
END(__sched_getaffinity)
.hidden _C_LABEL(__sched_getaffinity)

View File

@ -16,3 +16,4 @@ ENTRY(__syslog)
1:
ret
END(__syslog)
.hidden _C_LABEL(__syslog)

View File

@ -16,3 +16,4 @@ ENTRY(__timer_create)
1:
ret
END(__timer_create)
.hidden _C_LABEL(__timer_create)

View File

@ -16,3 +16,4 @@ ENTRY(__timer_delete)
1:
ret
END(__timer_delete)
.hidden _C_LABEL(__timer_delete)

View File

@ -16,3 +16,4 @@ ENTRY(__timer_getoverrun)
1:
ret
END(__timer_getoverrun)
.hidden _C_LABEL(__timer_getoverrun)

View File

@ -16,3 +16,4 @@ ENTRY(__timer_gettime)
1:
ret
END(__timer_gettime)
.hidden _C_LABEL(__timer_gettime)

View File

@ -17,3 +17,4 @@ ENTRY(__timer_settime)
1:
ret
END(__timer_settime)
.hidden _C_LABEL(__timer_settime)

View File

@ -17,3 +17,4 @@ ENTRY(__waitid)
1:
ret
END(__waitid)
.hidden _C_LABEL(__waitid)

View File

@ -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