Date: Sun, 2 Nov 2008 01:10:55 +0000 (UTC) From: Peter Wemm <peter@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r184547 - in head/lib/libc/amd64: . gen stdlib string sys Message-ID: <200811020110.mA21At7Y024785@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: peter Date: Sun Nov 2 01:10:54 2008 New Revision: 184547 URL: http://svn.freebsd.org/changeset/base/184547 Log: 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. Modified: head/lib/libc/amd64/SYS.h head/lib/libc/amd64/gen/_setjmp.S head/lib/libc/amd64/gen/fabs.S head/lib/libc/amd64/gen/modf.S head/lib/libc/amd64/gen/rfork_thread.S head/lib/libc/amd64/gen/setjmp.S head/lib/libc/amd64/gen/sigsetjmp.S head/lib/libc/amd64/stdlib/div.S head/lib/libc/amd64/stdlib/ldiv.S head/lib/libc/amd64/stdlib/lldiv.S head/lib/libc/amd64/string/bcmp.S head/lib/libc/amd64/string/bcopy.S head/lib/libc/amd64/string/bzero.S head/lib/libc/amd64/string/memcmp.S head/lib/libc/amd64/string/memset.S head/lib/libc/amd64/string/strcat.S head/lib/libc/amd64/string/strcmp.S head/lib/libc/amd64/string/strcpy.S head/lib/libc/amd64/sys/brk.S head/lib/libc/amd64/sys/exect.S head/lib/libc/amd64/sys/getcontext.S head/lib/libc/amd64/sys/pipe.S head/lib/libc/amd64/sys/ptrace.S head/lib/libc/amd64/sys/reboot.S head/lib/libc/amd64/sys/sbrk.S head/lib/libc/amd64/sys/setlogin.S head/lib/libc/amd64/sys/vfork.S Modified: head/lib/libc/amd64/SYS.h ============================================================================== --- head/lib/libc/amd64/SYS.h Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/SYS.h Sun Nov 2 01:10:54 2008 (r184547) @@ -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 Modified: head/lib/libc/amd64/gen/_setjmp.S ============================================================================== --- head/lib/libc/amd64/gen/_setjmp.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/gen/_setjmp.S Sun Nov 2 01:10:54 2008 (r184547) @@ -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) Modified: head/lib/libc/amd64/gen/fabs.S ============================================================================== --- head/lib/libc/amd64/gen/fabs.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/gen/fabs.S Sun Nov 2 01:10:54 2008 (r184547) @@ -37,6 +37,7 @@ ENTRY(fabs) movsd signbit(%rip), %xmm0 andnpd %xmm1, %xmm0 ret +END(fabs) .data signbit: Modified: head/lib/libc/amd64/gen/modf.S ============================================================================== --- head/lib/libc/amd64/gen/modf.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/gen/modf.S Sun Nov 2 01:10:54 2008 (r184547) @@ -86,3 +86,4 @@ ENTRY(modf) movsd -8(%rsp),%xmm0 ret +END(modf) Modified: head/lib/libc/amd64/gen/rfork_thread.S ============================================================================== --- head/lib/libc/amd64/gen/rfork_thread.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/gen/rfork_thread.S Sun Nov 2 01:10:54 2008 (r184547) @@ -99,3 +99,4 @@ ENTRY(rfork_thread) #else jmp HIDENAME(cerror) #endif +END(rfork_thread) Modified: head/lib/libc/amd64/gen/setjmp.S ============================================================================== --- head/lib/libc/amd64/gen/setjmp.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/gen/setjmp.S Sun Nov 2 01:10:54 2008 (r184547) @@ -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) Modified: head/lib/libc/amd64/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/amd64/gen/sigsetjmp.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/gen/sigsetjmp.S Sun Nov 2 01:10:54 2008 (r184547) @@ -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) Modified: head/lib/libc/amd64/stdlib/div.S ============================================================================== --- head/lib/libc/amd64/stdlib/div.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/stdlib/div.S Sun Nov 2 01:10:54 2008 (r184547) @@ -15,3 +15,4 @@ ENTRY(div) salq $32,%rdx orq %rdx,%rax ret +END(div) Modified: head/lib/libc/amd64/stdlib/ldiv.S ============================================================================== --- head/lib/libc/amd64/stdlib/ldiv.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/stdlib/ldiv.S Sun Nov 2 01:10:54 2008 (r184547) @@ -13,3 +13,4 @@ ENTRY(ldiv) cqto idivq %rsi ret +END(ldiv) Modified: head/lib/libc/amd64/stdlib/lldiv.S ============================================================================== --- head/lib/libc/amd64/stdlib/lldiv.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/stdlib/lldiv.S Sun Nov 2 01:10:54 2008 (r184547) @@ -13,3 +13,4 @@ ENTRY(lldiv) cqto idivq %rsi ret +END(lldiv) Modified: head/lib/libc/amd64/string/bcmp.S ============================================================================== --- head/lib/libc/amd64/string/bcmp.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/bcmp.S Sun Nov 2 01:10:54 2008 (r184547) @@ -22,3 +22,4 @@ L1: setne %al movsbl %al,%eax ret +END(bcmp) Modified: head/lib/libc/amd64/string/bcopy.S ============================================================================== --- head/lib/libc/amd64/string/bcopy.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/bcopy.S Sun Nov 2 01:10:54 2008 (r184547) @@ -86,3 +86,12 @@ ENTRY(bcopy) movsq cld ret +#ifdef MEMCOPY +END(memcpy) +#else +#ifdef MEMMOVE +END(memmove) +#else +END(bcopy) +#endif +#endif Modified: head/lib/libc/amd64/string/bzero.S ============================================================================== --- head/lib/libc/amd64/string/bzero.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/bzero.S Sun Nov 2 01:10:54 2008 (r184547) @@ -41,3 +41,4 @@ L1: movq %rsi,%rcx /* zero remainder by stosb ret +END(bzero) Modified: head/lib/libc/amd64/string/memcmp.S ============================================================================== --- head/lib/libc/amd64/string/memcmp.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/memcmp.S Sun Nov 2 01:10:54 2008 (r184547) @@ -39,3 +39,4 @@ L6: xorl %eax,%eax /* Perform unsigned movb -1(%rsi),%dl subl %edx,%eax ret +END(memcmp) Modified: head/lib/libc/amd64/string/memset.S ============================================================================== --- head/lib/libc/amd64/string/memset.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/memset.S Sun Nov 2 01:10:54 2008 (r184547) @@ -58,3 +58,4 @@ L1: rep movq %r11,%rax ret +END(memset) Modified: head/lib/libc/amd64/string/strcat.S ============================================================================== --- head/lib/libc/amd64/string/strcat.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/strcat.S Sun Nov 2 01:10:54 2008 (r184547) @@ -163,3 +163,4 @@ ENTRY(strcat) .Ldone: ret +END(strcat) Modified: head/lib/libc/amd64/string/strcmp.S ============================================================================== --- head/lib/libc/amd64/string/strcmp.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/strcmp.S Sun Nov 2 01:10:54 2008 (r184547) @@ -71,3 +71,4 @@ ENTRY(strcmp) movzbq %dl,%rdx subq %rdx,%rax ret +END(strcmp) Modified: head/lib/libc/amd64/string/strcpy.S ============================================================================== --- head/lib/libc/amd64/string/strcpy.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/strcpy.S Sun Nov 2 01:10:54 2008 (r184547) @@ -109,3 +109,4 @@ ENTRY(strcpy) .Ldone: ret +END(strcpy) Modified: head/lib/libc/amd64/sys/brk.S ============================================================================== --- head/lib/libc/amd64/sys/brk.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/brk.S Sun Nov 2 01:10:54 2008 (r184547) @@ -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) Modified: head/lib/libc/amd64/sys/exect.S ============================================================================== --- head/lib/libc/amd64/sys/exect.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/exect.S Sun Nov 2 01:10:54 2008 (r184547) @@ -53,3 +53,4 @@ ENTRY(exect) #else jmp HIDENAME(cerror) #endif +END(exect) Modified: head/lib/libc/amd64/sys/getcontext.S ============================================================================== --- head/lib/libc/amd64/sys/getcontext.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/getcontext.S Sun Nov 2 01:10:54 2008 (r184547) @@ -52,3 +52,4 @@ ENTRY(__sys_getcontext) #else jmp HIDENAME(cerror) #endif +END(__sys_getcontext) Modified: head/lib/libc/amd64/sys/pipe.S ============================================================================== --- head/lib/libc/amd64/sys/pipe.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/pipe.S Sun Nov 2 01:10:54 2008 (r184547) @@ -57,3 +57,4 @@ ENTRY(__sys_pipe) #else jmp HIDENAME(cerror) #endif +END(__sys_pipe) Modified: head/lib/libc/amd64/sys/ptrace.S ============================================================================== --- head/lib/libc/amd64/sys/ptrace.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/ptrace.S Sun Nov 2 01:10:54 2008 (r184547) @@ -57,3 +57,4 @@ err: #else jmp HIDENAME(cerror) #endif +END(ptrace) Modified: head/lib/libc/amd64/sys/reboot.S ============================================================================== --- head/lib/libc/amd64/sys/reboot.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/reboot.S Sun Nov 2 01:10:54 2008 (r184547) @@ -54,3 +54,4 @@ ENTRY(__sys_reboot) #else jmp HIDENAME(cerror) #endif +END(__sys_reboot) Modified: head/lib/libc/amd64/sys/sbrk.S ============================================================================== --- head/lib/libc/amd64/sys/sbrk.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/sbrk.S Sun Nov 2 01:10:54 2008 (r184547) @@ -85,3 +85,4 @@ err: #else jmp HIDENAME(cerror) #endif +END(sbrk) Modified: head/lib/libc/amd64/sys/setlogin.S ============================================================================== --- head/lib/libc/amd64/sys/setlogin.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/setlogin.S Sun Nov 2 01:10:54 2008 (r184547) @@ -62,3 +62,4 @@ ENTRY(__sys_setlogin) #else jmp HIDENAME(cerror) #endif +END(__sys_setlogin) Modified: head/lib/libc/amd64/sys/vfork.S ============================================================================== --- head/lib/libc/amd64/sys/vfork.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/vfork.S Sun Nov 2 01:10:54 2008 (r184547) @@ -56,3 +56,4 @@ ENTRY(__sys_vfork) #else jmp HIDENAME(cerror) #endif +END(__sys_vfork)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811020110.mA21At7Y024785>