We've been lax about matching END() macros in asm code for some time. This
is used to set the ELF size attribute for functions. It isn't normally critical but some things can make use of it (gdb for stack traces). Valgrind needs it so I'm adding it in. The problem is present on all branches and on both i386 and amd64.
This commit is contained in:
parent
2db63c5e38
commit
5d053f461c
@ -43,13 +43,15 @@
|
||||
.weak CNAME(__CONCAT(_,x)); \
|
||||
.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
|
||||
mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \
|
||||
2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx
|
||||
2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx; \
|
||||
END(__CONCAT(__sys_,x))
|
||||
|
||||
#define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \
|
||||
.weak CNAME(__CONCAT(_,x)); \
|
||||
.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
|
||||
mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret ; \
|
||||
2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx
|
||||
2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx; \
|
||||
END(__CONCAT(__sys_,x))
|
||||
#else
|
||||
#define RSYSCALL(x) ENTRY(__CONCAT(__sys_,x)); \
|
||||
.weak CNAME(x); \
|
||||
@ -57,13 +59,15 @@
|
||||
.weak CNAME(__CONCAT(_,x)); \
|
||||
.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
|
||||
mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \
|
||||
2: jmp HIDENAME(cerror)
|
||||
2: jmp HIDENAME(cerror); \
|
||||
END(__CONCAT(__sys_,x))
|
||||
|
||||
#define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \
|
||||
.weak CNAME(__CONCAT(_,x)); \
|
||||
.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
|
||||
mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \
|
||||
2: jmp HIDENAME(cerror)
|
||||
2: jmp HIDENAME(cerror); \
|
||||
END(__CONCAT(__sys_,x))
|
||||
#endif
|
||||
|
||||
#define KERNCALL movq %rcx, %r10; syscall
|
||||
|
@ -61,6 +61,7 @@ ENTRY(_setjmp)
|
||||
stmxcsr 68(%rax) /* and mxcsr */
|
||||
xorq %rax,%rax
|
||||
ret
|
||||
END(_setjmp)
|
||||
|
||||
.weak CNAME(_longjmp)
|
||||
.set CNAME(_longjmp),CNAME(___longjmp)
|
||||
@ -90,3 +91,4 @@ ENTRY(___longjmp)
|
||||
incq %rax
|
||||
1: movq %rcx,0(%rsp)
|
||||
ret
|
||||
END(___longjmp)
|
||||
|
@ -37,6 +37,7 @@ ENTRY(fabs)
|
||||
movsd signbit(%rip), %xmm0
|
||||
andnpd %xmm1, %xmm0
|
||||
ret
|
||||
END(fabs)
|
||||
|
||||
.data
|
||||
signbit:
|
||||
|
@ -86,3 +86,4 @@ ENTRY(modf)
|
||||
movsd -8(%rsp),%xmm0
|
||||
|
||||
ret
|
||||
END(modf)
|
||||
|
@ -99,3 +99,4 @@ ENTRY(rfork_thread)
|
||||
#else
|
||||
jmp HIDENAME(cerror)
|
||||
#endif
|
||||
END(rfork_thread)
|
||||
|
@ -70,6 +70,7 @@ ENTRY(setjmp)
|
||||
stmxcsr 68(%rcx) /* and mxcsr */
|
||||
xorq %rax,%rax
|
||||
ret
|
||||
END(setjmp)
|
||||
|
||||
.weak CNAME(longjmp)
|
||||
.set CNAME(longjmp),CNAME(__longjmp)
|
||||
@ -108,3 +109,4 @@ ENTRY(__longjmp)
|
||||
incq %rax
|
||||
1: movq %rcx,0(%rsp)
|
||||
ret
|
||||
END(__longjmp)
|
||||
|
@ -77,6 +77,7 @@ ENTRY(sigsetjmp)
|
||||
fnstcw 64(%rcx) /* 8; fpu cw */
|
||||
xorq %rax,%rax
|
||||
ret
|
||||
END(sigsetjmp)
|
||||
|
||||
.weak CNAME(siglongjmp)
|
||||
.set CNAME(siglongjmp),CNAME(__siglongjmp)
|
||||
@ -109,3 +110,4 @@ ENTRY(__siglongjmp)
|
||||
incq %rax
|
||||
1: movq %rcx,0(%rsp)
|
||||
ret
|
||||
END(__siglongjmp)
|
||||
|
@ -15,3 +15,4 @@ ENTRY(div)
|
||||
salq $32,%rdx
|
||||
orq %rdx,%rax
|
||||
ret
|
||||
END(div)
|
||||
|
@ -13,3 +13,4 @@ ENTRY(ldiv)
|
||||
cqto
|
||||
idivq %rsi
|
||||
ret
|
||||
END(ldiv)
|
||||
|
@ -13,3 +13,4 @@ ENTRY(lldiv)
|
||||
cqto
|
||||
idivq %rsi
|
||||
ret
|
||||
END(lldiv)
|
||||
|
@ -22,3 +22,4 @@ L1:
|
||||
setne %al
|
||||
movsbl %al,%eax
|
||||
ret
|
||||
END(bcmp)
|
||||
|
@ -86,3 +86,12 @@ ENTRY(bcopy)
|
||||
movsq
|
||||
cld
|
||||
ret
|
||||
#ifdef MEMCOPY
|
||||
END(memcpy)
|
||||
#else
|
||||
#ifdef MEMMOVE
|
||||
END(memmove)
|
||||
#else
|
||||
END(bcopy)
|
||||
#endif
|
||||
#endif
|
||||
|
@ -41,3 +41,4 @@ L1: movq %rsi,%rcx /* zero remainder by bytes */
|
||||
stosb
|
||||
|
||||
ret
|
||||
END(bzero)
|
||||
|
@ -39,3 +39,4 @@ L6: xorl %eax,%eax /* Perform unsigned comparison */
|
||||
movb -1(%rsi),%dl
|
||||
subl %edx,%eax
|
||||
ret
|
||||
END(memcmp)
|
||||
|
@ -58,3 +58,4 @@ L1: rep
|
||||
movq %r11,%rax
|
||||
|
||||
ret
|
||||
END(memset)
|
||||
|
@ -163,3 +163,4 @@ ENTRY(strcat)
|
||||
|
||||
.Ldone:
|
||||
ret
|
||||
END(strcat)
|
||||
|
@ -71,3 +71,4 @@ ENTRY(strcmp)
|
||||
movzbq %dl,%rdx
|
||||
subq %rdx,%rax
|
||||
ret
|
||||
END(strcmp)
|
||||
|
@ -109,3 +109,4 @@ ENTRY(strcpy)
|
||||
|
||||
.Ldone:
|
||||
ret
|
||||
END(strcpy)
|
||||
|
@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
|
||||
ENTRY(_brk)
|
||||
pushq %rdi
|
||||
jmp ok
|
||||
END(_brk)
|
||||
|
||||
ENTRY(brk)
|
||||
pushq %rdi
|
||||
@ -81,3 +82,4 @@ err:
|
||||
#else
|
||||
jmp HIDENAME(cerror)
|
||||
#endif
|
||||
END(brk)
|
||||
|
@ -53,3 +53,4 @@ ENTRY(exect)
|
||||
#else
|
||||
jmp HIDENAME(cerror)
|
||||
#endif
|
||||
END(exect)
|
||||
|
@ -52,3 +52,4 @@ ENTRY(__sys_getcontext)
|
||||
#else
|
||||
jmp HIDENAME(cerror)
|
||||
#endif
|
||||
END(__sys_getcontext)
|
||||
|
@ -57,3 +57,4 @@ ENTRY(__sys_pipe)
|
||||
#else
|
||||
jmp HIDENAME(cerror)
|
||||
#endif
|
||||
END(__sys_pipe)
|
||||
|
@ -57,3 +57,4 @@ err:
|
||||
#else
|
||||
jmp HIDENAME(cerror)
|
||||
#endif
|
||||
END(ptrace)
|
||||
|
@ -54,3 +54,4 @@ ENTRY(__sys_reboot)
|
||||
#else
|
||||
jmp HIDENAME(cerror)
|
||||
#endif
|
||||
END(__sys_reboot)
|
||||
|
@ -85,3 +85,4 @@ err:
|
||||
#else
|
||||
jmp HIDENAME(cerror)
|
||||
#endif
|
||||
END(sbrk)
|
||||
|
@ -62,3 +62,4 @@ ENTRY(__sys_setlogin)
|
||||
#else
|
||||
jmp HIDENAME(cerror)
|
||||
#endif
|
||||
END(__sys_setlogin)
|
||||
|
@ -56,3 +56,4 @@ ENTRY(__sys_vfork)
|
||||
#else
|
||||
jmp HIDENAME(cerror)
|
||||
#endif
|
||||
END(__sys_vfork)
|
||||
|
Loading…
x
Reference in New Issue
Block a user