提交 1b1cafa5 编写于 作者: R Rich Felker

apply hidden visibility to tlsdesc accessor functions

these functions are never called directly; only their addresses are
used, so PLT indirections should never happen unless a broken
application tries to redefine them, but it's still best to make them
hidden.
上级 ca7977b5
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// return a[1]; // return a[1];
// } // }
.global __tlsdesc_static .global __tlsdesc_static
.hidden __tlsdesc_static
.type __tlsdesc_static,@function .type __tlsdesc_static,@function
__tlsdesc_static: __tlsdesc_static:
ldr x0,[x0,#8] ldr x0,[x0,#8]
...@@ -19,6 +20,7 @@ __tlsdesc_static: ...@@ -19,6 +20,7 @@ __tlsdesc_static:
// return __tls_get_new(p) - tp; // return __tls_get_new(p) - tp;
// } // }
.global __tlsdesc_dynamic .global __tlsdesc_dynamic
.hidden __tlsdesc_dynamic
.type __tlsdesc_dynamic,@function .type __tlsdesc_dynamic,@function
__tlsdesc_dynamic: __tlsdesc_dynamic:
stp x1,x2,[sp,#-32]! stp x1,x2,[sp,#-32]!
......
...@@ -250,6 +250,7 @@ static struct symdef find_sym(struct dso *dso, const char *s, int need_def) ...@@ -250,6 +250,7 @@ static struct symdef find_sym(struct dso *dso, const char *s, int need_def)
return def; return def;
} }
__attribute__((__visibility__("hidden")))
ptrdiff_t __tlsdesc_static(), __tlsdesc_dynamic(); ptrdiff_t __tlsdesc_static(), __tlsdesc_dynamic();
static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stride) static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stride)
......
.text .text
.global __tlsdesc_static .global __tlsdesc_static
.hidden __tlsdesc_static
.type __tlsdesc_static,@function .type __tlsdesc_static,@function
__tlsdesc_static: __tlsdesc_static:
mov 4(%eax),%eax mov 4(%eax),%eax
...@@ -8,6 +9,7 @@ __tlsdesc_static: ...@@ -8,6 +9,7 @@ __tlsdesc_static:
.hidden __tls_get_new .hidden __tls_get_new
.global __tlsdesc_dynamic .global __tlsdesc_dynamic
.hidden __tlsdesc_dynamic
.type __tlsdesc_dynamic,@function .type __tlsdesc_dynamic,@function
__tlsdesc_dynamic: __tlsdesc_dynamic:
mov 4(%eax),%eax mov 4(%eax),%eax
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
#include <stddef.h> #include <stddef.h>
#include "libc.h" #include "libc.h"
__attribute__((__visibility__("hidden")))
ptrdiff_t __tlsdesc_static(), __tlsdesc_dynamic();
ptrdiff_t __tlsdesc_static() ptrdiff_t __tlsdesc_static()
{ {
return 0; return 0;
......
.text .text
.global __tlsdesc_static .global __tlsdesc_static
.hidden __tlsdesc_static
.type __tlsdesc_static,@function .type __tlsdesc_static,@function
__tlsdesc_static: __tlsdesc_static:
mov 8(%rax),%rax mov 8(%rax),%rax
...@@ -8,6 +9,7 @@ __tlsdesc_static: ...@@ -8,6 +9,7 @@ __tlsdesc_static:
.hidden __tls_get_new .hidden __tls_get_new
.global __tlsdesc_dynamic .global __tlsdesc_dynamic
.hidden __tlsdesc_dynamic
.type __tlsdesc_dynamic,@function .type __tlsdesc_dynamic,@function
__tlsdesc_dynamic: __tlsdesc_dynamic:
mov 8(%rax),%rax mov 8(%rax),%rax
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册