From c7d19f9923c66a2ddb47272f1e8fec8b804f54c4 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 14 Jun 2011 23:15:08 -0400 Subject: [PATCH] restore use of .type in asm, but use modern @function (vs %function) this seems to be necessary to make the linker accept the functions in a shared library (perhaps to generate PLT entries?) strictly speaking libc-internal asm should not need it. i might clean that up later. --- src/internal/i386/syscall.s | 1 + src/internal/x86_64/syscall.s | 1 + src/setjmp/i386/longjmp.s | 2 ++ src/setjmp/i386/setjmp.s | 3 +++ src/setjmp/x86_64/longjmp.s | 2 ++ src/setjmp/x86_64/setjmp.s | 3 +++ src/signal/i386/restore.s | 2 ++ src/signal/i386/sigsetjmp.s | 1 + src/signal/x86_64/restore.s | 2 ++ src/signal/x86_64/sigsetjmp.s | 1 + src/thread/i386/__set_thread_area.s | 1 + src/thread/i386/__unmapself.s | 1 + src/thread/i386/cancellation2.s | 2 ++ src/thread/i386/cancellation3.s | 1 + src/thread/i386/clone.s | 1 + src/thread/i386/syscall_cp.s | 1 + src/thread/x86_64/__set_thread_area.s | 1 + src/thread/x86_64/__unmapself.s | 1 + src/thread/x86_64/clone.s | 1 + src/thread/x86_64/syscall_cp.s | 1 + 20 files changed, 29 insertions(+) diff --git a/src/internal/i386/syscall.s b/src/internal/i386/syscall.s index 083db1ce..327d4cc0 100644 --- a/src/internal/i386/syscall.s +++ b/src/internal/i386/syscall.s @@ -1,4 +1,5 @@ .global __syscall +.type __syscall,@function __syscall: pushl %ebx pushl %esi diff --git a/src/internal/x86_64/syscall.s b/src/internal/x86_64/syscall.s index 931f44f6..6e0db09c 100644 --- a/src/internal/x86_64/syscall.s +++ b/src/internal/x86_64/syscall.s @@ -1,4 +1,5 @@ .global __syscall +.type __syscall,@function __syscall: movq %rdi,%rax movq %rsi,%rdi diff --git a/src/setjmp/i386/longjmp.s b/src/setjmp/i386/longjmp.s index b139d9fe..772d28dd 100644 --- a/src/setjmp/i386/longjmp.s +++ b/src/setjmp/i386/longjmp.s @@ -1,5 +1,7 @@ .global _longjmp .global longjmp +.type _longjmp,@function +.type longjmp,@function _longjmp: longjmp: mov 4(%esp),%edx diff --git a/src/setjmp/i386/setjmp.s b/src/setjmp/i386/setjmp.s index d53c1a63..586d4390 100644 --- a/src/setjmp/i386/setjmp.s +++ b/src/setjmp/i386/setjmp.s @@ -1,6 +1,9 @@ .global __setjmp .global _setjmp .global setjmp +.type __setjmp,@function +.type _setjmp,@function +.type setjmp,@function __setjmp: _setjmp: setjmp: diff --git a/src/setjmp/x86_64/longjmp.s b/src/setjmp/x86_64/longjmp.s index 70271bf5..444076f1 100644 --- a/src/setjmp/x86_64/longjmp.s +++ b/src/setjmp/x86_64/longjmp.s @@ -1,6 +1,8 @@ /* Copyright 2011 Nicholas J. Kain, licensed GNU LGPL 2.1 or later */ .global _longjmp .global longjmp +.type _longjmp,@function +.type longjmp,@function _longjmp: longjmp: mov %rsi,%rax /* val will be longjmp return */ diff --git a/src/setjmp/x86_64/setjmp.s b/src/setjmp/x86_64/setjmp.s index d5ff113a..5b3173b9 100644 --- a/src/setjmp/x86_64/setjmp.s +++ b/src/setjmp/x86_64/setjmp.s @@ -2,6 +2,9 @@ .global __setjmp .global _setjmp .global setjmp +.type __setjmp,@function +.type _setjmp,@function +.type setjmp,@function __setjmp: _setjmp: setjmp: diff --git a/src/signal/i386/restore.s b/src/signal/i386/restore.s index 298ba9a5..a30b69c4 100644 --- a/src/signal/i386/restore.s +++ b/src/signal/i386/restore.s @@ -1,10 +1,12 @@ .global __restore +.type __restore,@function __restore: popl %eax movl $119, %eax int $0x80 .global __restore_rt +.type __restore_rt,@function __restore_rt: movl $173, %eax int $0x80 diff --git a/src/signal/i386/sigsetjmp.s b/src/signal/i386/sigsetjmp.s index 0e7eefb0..06e0a614 100644 --- a/src/signal/i386/sigsetjmp.s +++ b/src/signal/i386/sigsetjmp.s @@ -1,4 +1,5 @@ .global sigsetjmp +.type sigsetjmp,@function sigsetjmp: mov 4(%esp),%eax mov 8(%esp),%ecx diff --git a/src/signal/x86_64/restore.s b/src/signal/x86_64/restore.s index f6bb6ff1..682af2dd 100644 --- a/src/signal/x86_64/restore.s +++ b/src/signal/x86_64/restore.s @@ -1,5 +1,7 @@ .global __restore_rt .global __restore +.type __restore_rt,@function +.type __restore,@function __restore_rt: __restore: movl $15, %eax diff --git a/src/signal/x86_64/sigsetjmp.s b/src/signal/x86_64/sigsetjmp.s index ac02adb2..e883ac44 100644 --- a/src/signal/x86_64/sigsetjmp.s +++ b/src/signal/x86_64/sigsetjmp.s @@ -1,5 +1,6 @@ /* Copyright 2011 Nicholas J. Kain, licensed GNU LGPL 2.1 or later */ .global sigsetjmp +.type sigsetjmp,@function sigsetjmp: andl %esi,%esi movq %rsi,64(%rdi) diff --git a/src/thread/i386/__set_thread_area.s b/src/thread/i386/__set_thread_area.s index 2a2e31a4..a43525ec 100644 --- a/src/thread/i386/__set_thread_area.s +++ b/src/thread/i386/__set_thread_area.s @@ -1,5 +1,6 @@ .text .global __set_thread_area +.type __set_thread_area,@function __set_thread_area: pushl %ebx movl 8(%esp),%ecx diff --git a/src/thread/i386/__unmapself.s b/src/thread/i386/__unmapself.s index b5e9c713..d6569594 100644 --- a/src/thread/i386/__unmapself.s +++ b/src/thread/i386/__unmapself.s @@ -1,5 +1,6 @@ .text .global __unmapself +.type __unmapself,@function __unmapself: movl $91,%eax movl 4(%esp),%ebx diff --git a/src/thread/i386/cancellation2.s b/src/thread/i386/cancellation2.s index 6f3f6940..4e4438b5 100644 --- a/src/thread/i386/cancellation2.s +++ b/src/thread/i386/cancellation2.s @@ -1,5 +1,6 @@ .text .global __pthread_register_cancel +.type __pthread_register_cancel,@function __pthread_register_cancel: pushl %eax call __pthread_register_cancel_3 @@ -7,6 +8,7 @@ __pthread_register_cancel: ret .global __pthread_unregister_cancel +.type __pthread_unregister_cancel,@function __pthread_unregister_cancel: pushl %eax call __pthread_unregister_cancel_3 diff --git a/src/thread/i386/cancellation3.s b/src/thread/i386/cancellation3.s index 6096b8ce..88340224 100644 --- a/src/thread/i386/cancellation3.s +++ b/src/thread/i386/cancellation3.s @@ -1,5 +1,6 @@ .text .global __pthread_unwind_next +.type __pthread_unwind_next,@function __pthread_unwind_next: pushl %eax call __pthread_unwind_next_3 diff --git a/src/thread/i386/clone.s b/src/thread/i386/clone.s index 4133915b..7af5f5db 100644 --- a/src/thread/i386/clone.s +++ b/src/thread/i386/clone.s @@ -1,5 +1,6 @@ .text .global __uniclone +.type __uniclone,@function __uniclone: movl 4(%esp),%ecx subl $24,%ecx diff --git a/src/thread/i386/syscall_cp.s b/src/thread/i386/syscall_cp.s index fa435f32..05e867a1 100644 --- a/src/thread/i386/syscall_cp.s +++ b/src/thread/i386/syscall_cp.s @@ -1,5 +1,6 @@ .text .global __syscall_cp_asm +.type __syscall_cp_asm,@function __syscall_cp_asm: pushl %ebx pushl %esi diff --git a/src/thread/x86_64/__set_thread_area.s b/src/thread/x86_64/__set_thread_area.s index 75f19a86..99c5356a 100644 --- a/src/thread/x86_64/__set_thread_area.s +++ b/src/thread/x86_64/__set_thread_area.s @@ -1,6 +1,7 @@ /* Copyright 2011 Nicholas J. Kain, licensed GNU LGPL 2.1 or later */ .text .global __set_thread_area +.type __set_thread_area,@function __set_thread_area: mov %rdi,%rsi /* shift for syscall */ movl $0x1002,%edi /* SET_FS register */ diff --git a/src/thread/x86_64/__unmapself.s b/src/thread/x86_64/__unmapself.s index 438f5eb8..99c1b7c1 100644 --- a/src/thread/x86_64/__unmapself.s +++ b/src/thread/x86_64/__unmapself.s @@ -1,6 +1,7 @@ /* Copyright 2011 Nicholas J. Kain, licensed GNU LGPL 2.1 or later */ .text .global __unmapself +.type __unmapself,@function __unmapself: movl $11,%eax /* SYS_munmap */ syscall /* munmap(arg2,arg3) */ diff --git a/src/thread/x86_64/clone.s b/src/thread/x86_64/clone.s index ce67cc62..bf128a47 100644 --- a/src/thread/x86_64/clone.s +++ b/src/thread/x86_64/clone.s @@ -1,6 +1,7 @@ /* Copyright 2011 Nicholas J. Kain, licensed GNU LGPL 2.1 or later */ .text .global __uniclone +.type __uniclone,@function /* rdi = child_stack, rsi = start, rdx = pthread_struct */ __uniclone: subq $8,%rsp /* pad parent stack to prevent branch later */ diff --git a/src/thread/x86_64/syscall_cp.s b/src/thread/x86_64/syscall_cp.s index 20819288..b0363547 100644 --- a/src/thread/x86_64/syscall_cp.s +++ b/src/thread/x86_64/syscall_cp.s @@ -1,5 +1,6 @@ .text .global __syscall_cp_asm +.type __syscall_cp_asm,@function __syscall_cp_asm: lea 1f(%rip),%rax mov %rax,8(%rdi)