提交 d96b12b7 编写于 作者: R Rich Felker

rework cancellation weak alias logic not to depend on archive order

if the order of object files in the static archive libc.a was not
respected by the linker, the old logic could wrongly cause POSIX
symbols outside of the ISO C namespace to be pulled into pure C
programs. this should not happen with well-behaved linkers, but
relying on the link order was a bad idea anyway.

files are renamed to better reflect their contents now that they don't
need names to control their order as members in the archive file.
上级 ea496d6c
...@@ -8,10 +8,11 @@ static long sccp(syscall_arg_t nr, ...@@ -8,10 +8,11 @@ static long sccp(syscall_arg_t nr,
return (__syscall)(nr, u, v, w, x, y, z); return (__syscall)(nr, u, v, w, x, y, z);
} }
weak_alias(sccp, __syscall_cp); weak_alias(sccp, __syscall_cp_c);
static void dummy() long (__syscall_cp)(syscall_arg_t nr,
syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
syscall_arg_t x, syscall_arg_t y, syscall_arg_t z)
{ {
return __syscall_cp_c(nr, u, v, w, x, y, z);
} }
weak_alias(dummy, __testcancel);
...@@ -13,7 +13,7 @@ long __syscall_cp_asm(volatile void *, syscall_arg_t, ...@@ -13,7 +13,7 @@ long __syscall_cp_asm(volatile void *, syscall_arg_t,
syscall_arg_t, syscall_arg_t, syscall_arg_t, syscall_arg_t, syscall_arg_t, syscall_arg_t,
syscall_arg_t, syscall_arg_t, syscall_arg_t); syscall_arg_t, syscall_arg_t, syscall_arg_t);
long (__syscall_cp)(syscall_arg_t nr, long __syscall_cp_c(syscall_arg_t nr,
syscall_arg_t u, syscall_arg_t v, syscall_arg_t w, syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
syscall_arg_t x, syscall_arg_t y, syscall_arg_t z) syscall_arg_t x, syscall_arg_t y, syscall_arg_t z)
{ {
......
#include "pthread_impl.h" #include "pthread_impl.h"
#include "libc.h"
void __testcancel(void); static void dummy()
{
}
weak_alias(dummy, __testcancel);
void pthread_testcancel() void pthread_testcancel()
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册