diff options
-rw-r--r-- | lib/libc/amd64/sys/setlogin.S | 5 | ||||
-rw-r--r-- | lib/libc/gen/getlogin.c | 2 | ||||
-rw-r--r-- | lib/libc/i386/sys/setlogin.S | 9 | ||||
-rw-r--r-- | sys/amd64/include/asm.h | 1 | ||||
-rw-r--r-- | sys/i386/include/asm.h | 3 |
5 files changed, 4 insertions, 16 deletions
diff --git a/lib/libc/amd64/sys/setlogin.S b/lib/libc/amd64/sys/setlogin.S index a451491..73b5364 100644 --- a/lib/libc/amd64/sys/setlogin.S +++ b/lib/libc/amd64/sys/setlogin.S @@ -48,12 +48,7 @@ ENTRY(__sys_setlogin) mov $SYS_setlogin,%rax KERNCALL jb HIDENAME(cerror) -#ifdef PIC - movq PIC_GOT(CNAME(_logname_valid)),%rdx - movl $0,(%rdx) -#else movl $0,CNAME(_logname_valid)(%rip) -#endif ret /* setlogin(name) */ END(__sys_setlogin) diff --git a/lib/libc/gen/getlogin.c b/lib/libc/gen/getlogin.c index 569cf42..4dab3cb 100644 --- a/lib/libc/gen/getlogin.c +++ b/lib/libc/gen/getlogin.c @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); extern int _getlogin(char *, int); -int _logname_valid; /* known to setlogin() */ +int _logname_valid __hidden; /* known to setlogin() */ static pthread_mutex_t logname_mutex = PTHREAD_MUTEX_INITIALIZER; static char * diff --git a/lib/libc/i386/sys/setlogin.S b/lib/libc/i386/sys/setlogin.S index c6436b5..9247955 100644 --- a/lib/libc/i386/sys/setlogin.S +++ b/lib/libc/i386/sys/setlogin.S @@ -41,16 +41,9 @@ __FBSDID("$FreeBSD$"); .globl CNAME(_logname_valid) /* in _getlogin() */ SYSCALL(setlogin) -#ifdef PIC PIC_PROLOGUE - pushl %eax - movl PIC_GOT(CNAME(_logname_valid)),%eax - movl $0,(%eax) - popl %eax + movl $0,PIC_GOTOFF(CNAME(_logname_valid)) PIC_EPILOGUE -#else - movl $0,CNAME(_logname_valid) -#endif ret /* setlogin(name) */ END(__sys_setlogin) diff --git a/sys/amd64/include/asm.h b/sys/amd64/include/asm.h index 7efd642..078da03 100644 --- a/sys/amd64/include/asm.h +++ b/sys/amd64/include/asm.h @@ -43,7 +43,6 @@ #define PIC_GOT(x) x@GOTPCREL(%rip) #else #define PIC_PLT(x) x -#define PIC_GOT(x) x #endif /* diff --git a/sys/i386/include/asm.h b/sys/i386/include/asm.h index 7ce3d57..cc8bfe0 100644 --- a/sys/i386/include/asm.h +++ b/sys/i386/include/asm.h @@ -49,11 +49,12 @@ popl %ebx #define PIC_PLT(x) x@PLT #define PIC_GOT(x) x@GOT(%ebx) +#define PIC_GOTOFF(x) x@GOTOFF(%ebx) #else #define PIC_PROLOGUE #define PIC_EPILOGUE #define PIC_PLT(x) x -#define PIC_GOT(x) x +#define PIC_GOTOFF(x) x #endif /* |