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:
Peter Wemm 2008-11-02 01:10:54 +00:00
parent 2db63c5e38
commit 5d053f461c
27 changed files with 46 additions and 4 deletions

View File

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

View File

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

View File

@ -37,6 +37,7 @@ ENTRY(fabs)
movsd signbit(%rip), %xmm0
andnpd %xmm1, %xmm0
ret
END(fabs)
.data
signbit:

View File

@ -86,3 +86,4 @@ ENTRY(modf)
movsd -8(%rsp),%xmm0
ret
END(modf)

View File

@ -99,3 +99,4 @@ ENTRY(rfork_thread)
#else
jmp HIDENAME(cerror)
#endif
END(rfork_thread)

View File

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

View File

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

View File

@ -15,3 +15,4 @@ ENTRY(div)
salq $32,%rdx
orq %rdx,%rax
ret
END(div)

View File

@ -13,3 +13,4 @@ ENTRY(ldiv)
cqto
idivq %rsi
ret
END(ldiv)

View File

@ -13,3 +13,4 @@ ENTRY(lldiv)
cqto
idivq %rsi
ret
END(lldiv)

View File

@ -22,3 +22,4 @@ L1:
setne %al
movsbl %al,%eax
ret
END(bcmp)

View File

@ -86,3 +86,12 @@ ENTRY(bcopy)
movsq
cld
ret
#ifdef MEMCOPY
END(memcpy)
#else
#ifdef MEMMOVE
END(memmove)
#else
END(bcopy)
#endif
#endif

View File

@ -41,3 +41,4 @@ L1: movq %rsi,%rcx /* zero remainder by bytes */
stosb
ret
END(bzero)

View File

@ -39,3 +39,4 @@ L6: xorl %eax,%eax /* Perform unsigned comparison */
movb -1(%rsi),%dl
subl %edx,%eax
ret
END(memcmp)

View File

@ -58,3 +58,4 @@ L1: rep
movq %r11,%rax
ret
END(memset)

View File

@ -163,3 +163,4 @@ ENTRY(strcat)
.Ldone:
ret
END(strcat)

View File

@ -71,3 +71,4 @@ ENTRY(strcmp)
movzbq %dl,%rdx
subq %rdx,%rax
ret
END(strcmp)

View File

@ -109,3 +109,4 @@ ENTRY(strcpy)
.Ldone:
ret
END(strcpy)

View File

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

View File

@ -53,3 +53,4 @@ ENTRY(exect)
#else
jmp HIDENAME(cerror)
#endif
END(exect)

View File

@ -52,3 +52,4 @@ ENTRY(__sys_getcontext)
#else
jmp HIDENAME(cerror)
#endif
END(__sys_getcontext)

View File

@ -57,3 +57,4 @@ ENTRY(__sys_pipe)
#else
jmp HIDENAME(cerror)
#endif
END(__sys_pipe)

View File

@ -57,3 +57,4 @@ err:
#else
jmp HIDENAME(cerror)
#endif
END(ptrace)

View File

@ -54,3 +54,4 @@ ENTRY(__sys_reboot)
#else
jmp HIDENAME(cerror)
#endif
END(__sys_reboot)

View File

@ -85,3 +85,4 @@ err:
#else
jmp HIDENAME(cerror)
#endif
END(sbrk)

View File

@ -62,3 +62,4 @@ ENTRY(__sys_setlogin)
#else
jmp HIDENAME(cerror)
#endif
END(__sys_setlogin)

View File

@ -56,3 +56,4 @@ ENTRY(__sys_vfork)
#else
jmp HIDENAME(cerror)
#endif
END(__sys_vfork)