Browse Source

In a number of places we erroneously used tests such as '#ifdef PIC' when we
should instead have been testing for '#ifdef __PIC__'. This resulted in
NON-PIC code getting mixed into the shared library. Oops!!!
-Erik

Eric Andersen 22 years ago
parent
commit
eeb9d29da8

+ 1 - 1
Makefile

@@ -151,7 +151,7 @@ headers: include/bits/uClibc_config.h
 	    set -e; \
 	    set -e; \
 	    echo " "; \
 	    echo " "; \
 	    echo "The path '$(KERNEL_SOURCE)/include/asm' doesn't exist."; \
 	    echo "The path '$(KERNEL_SOURCE)/include/asm' doesn't exist."; \
-	    echo "I bet you didn't set KERNEL_SOURCE, TARGET_ARCH or UCLIBC_HAS_MMU"; \
+	    echo "I bet you did not set KERNEL_SOURCE, TARGET_ARCH or UCLIBC_HAS_MMU"; \
 	    echo "correctly when you configured uClibc.  Please fix these settings."; \
 	    echo "correctly when you configured uClibc.  Please fix these settings."; \
 	    echo " "; \
 	    echo " "; \
 	    false; \
 	    false; \

+ 1 - 1
libc/sysdeps/linux/alpha/brk.S

@@ -25,7 +25,7 @@
 #define _ERRNO_H
 #define _ERRNO_H
 #include <bits/errno.h>
 #include <bits/errno.h>
 
 
-#ifdef PIC
+#ifdef __PIC__
 .section .bss
 .section .bss
 	.align 3
 	.align 3
 	.globl __curbrk
 	.globl __curbrk

+ 1 - 1
libc/sysdeps/linux/i386/bsd-setjmp.S

@@ -42,7 +42,7 @@ setjmp:
 	/* Call __sigjmp_save.  */
 	/* Call __sigjmp_save.  */
 	pushl $1
 	pushl $1
 	pushl 8(%esp)
 	pushl 8(%esp)
-#ifdef	PIC
+#ifdef	__PIC__
 	/* We cannot use the PLT, because it requires that %ebx be set, but
 	/* We cannot use the PLT, because it requires that %ebx be set, but
            we can't save and restore our caller's value.  Instead, we do an
            we can't save and restore our caller's value.  Instead, we do an
            indirect jump through the GOT, using for the temporary register
            indirect jump through the GOT, using for the temporary register

+ 4 - 4
libc/sysdeps/linux/i386/clone.S

@@ -65,11 +65,11 @@ __clone:
 CLONE_ERROR_LABEL:
 CLONE_ERROR_LABEL:
 	negl    %eax
 	negl    %eax
 	pushl   %eax
 	pushl   %eax
-#ifdef PIC
+#ifdef __PIC__
-	call	L(here)
+	call .Lhere
-L(here):
+.Lhere:
 	popl	%ebx
 	popl	%ebx
-	addl	$_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ebx
+	addl	$_GLOBAL_OFFSET_TABLE_+[.- .Lhere  ], %ebx
 	call    __errno_location@PLT
 	call    __errno_location@PLT
 #else
 #else
 	call	__errno_location
 	call	__errno_location

+ 1 - 1
libc/sysdeps/linux/i386/setjmp.S

@@ -42,7 +42,7 @@ __sigsetjmp:
         movl %ebp, (3 *4)(%eax)  
         movl %ebp, (3 *4)(%eax)  
 
 
 	/* Make a tail call to __sigjmp_save; it takes the same args.  */
 	/* Make a tail call to __sigjmp_save; it takes the same args.  */
-#ifdef	PIC
+#ifdef	__PIC__
 	/* We cannot use the PLT, because it requires that %ebx be set, but
 	/* We cannot use the PLT, because it requires that %ebx be set, but
            we can't save and restore our caller's value.  Instead, we do an
            we can't save and restore our caller's value.  Instead, we do an
            indirect jump through the GOT, using for the temporary register
            indirect jump through the GOT, using for the temporary register

+ 2 - 2
libc/sysdeps/linux/i386/syscall.S

@@ -40,7 +40,7 @@ syscall:
 	cmpl $-4095,%eax
 	cmpl $-4095,%eax
 	jbe .Ldone
 	jbe .Ldone
 
 
-#ifdef PIC
+#ifdef __PIC__
 	call Lhere
 	call Lhere
 Lhere:
 Lhere:
 	popl %ebx
 	popl %ebx
@@ -63,7 +63,7 @@ Lhere:
 	movl %eax,errno
 	movl %eax,errno
 #endif /* __UCLIBC_HAS_THREADS__ */
 #endif /* __UCLIBC_HAS_THREADS__ */
 
 
-#endif /* PIC */
+#endif /* __PIC__ */
 
 
 	movl $-1,%eax
 	movl $-1,%eax
 	.p2align 4,,7
 	.p2align 4,,7

+ 4 - 4
libc/sysdeps/linux/i386/vfork.S

@@ -12,13 +12,13 @@
 vfork:
 vfork:
 	popl %ecx
 	popl %ecx
 	movl $190,%eax
 	movl $190,%eax
-#ifdef PIC
+#ifdef __PIC__
 	pushl %ebx
 	pushl %ebx
 #endif
 #endif
 #APP
 #APP
 	int $0x80
 	int $0x80
 #NO_APP
 #NO_APP
-#ifdef PIC
+#ifdef __PIC__
 	popl %ebx
 	popl %ebx
 #endif
 #endif
 	cmpl $-4095,%eax
 	cmpl $-4095,%eax
@@ -28,7 +28,7 @@ vfork:
 .Lerror:
 .Lerror:
 	pushl %ecx
 	pushl %ecx
 
 
-#ifdef PIC
+#ifdef __PIC__
 	pushl %ebx
 	pushl %ebx
 	call .Lhere
 	call .Lhere
 .Lhere:
 .Lhere:
@@ -53,7 +53,7 @@ vfork:
 	movl %eax,errno
 	movl %eax,errno
 #endif /* __UCLIBC_HAS_THREADS__ */
 #endif /* __UCLIBC_HAS_THREADS__ */
 
 
-#endif /* PIC */
+#endif /* __PIC__ */
 	
 	
 	movl $-1,%eax
 	movl $-1,%eax
 	ret
 	ret

+ 1 - 1
libc/sysdeps/linux/mips/syscall.S

@@ -20,7 +20,7 @@
 #include <asm/asm.h>
 #include <asm/asm.h>
 #include <asm/regdef.h>
 #include <asm/regdef.h>
 
 
-#ifdef PIC
+#ifdef __PIC__
 	.option pic2
 	.option pic2
 #endif
 #endif
 .text
 .text

+ 1 - 1
libc/sysdeps/linux/powerpc/mcount.S

@@ -69,7 +69,7 @@ _mcount:
 	stw	r10,40(r1)
 	stw	r10,40(r1)
 	stw	r4, 44(r1)
 	stw	r4, 44(r1)
 	stw	r5,  8(r1)
 	stw	r5,  8(r1)
-#ifdef PIC
+#ifdef __PIC__
 	bl	__mcount_internal@plt
 	bl	__mcount_internal@plt
 #else
 #else
 	bl	__mcount_internal
 	bl	__mcount_internal

+ 1 - 1
libpthread/linuxthreads/cancel.c

@@ -175,7 +175,7 @@ void __pthread_perform_cleanup(void)
 #endif
 #endif
 }
 }
 
 
-#ifndef PIC
+#ifndef __PIC__
 /* We need a hook to force the cancelation wrappers to be linked in when
 /* We need a hook to force the cancelation wrappers to be linked in when
    static libpthread is used.  */
    static libpthread is used.  */
 extern const int __pthread_provide_wrappers;
 extern const int __pthread_provide_wrappers;

+ 1 - 1
libpthread/linuxthreads/oldsemaphore.c

@@ -224,7 +224,7 @@ static void sem_restart_list(pthread_descr waiting)
   }
   }
 }
 }
 
 
-#if defined PIC && DO_VERSIONING
+#if defined __PIC__ && DO_VERSIONING
 symbol_version (__old_sem_init, sem_init, GLIBC_2.0);
 symbol_version (__old_sem_init, sem_init, GLIBC_2.0);
 symbol_version (__old_sem_wait, sem_wait, GLIBC_2.0);
 symbol_version (__old_sem_wait, sem_wait, GLIBC_2.0);
 symbol_version (__old_sem_trywait, sem_trywait, GLIBC_2.0);
 symbol_version (__old_sem_trywait, sem_trywait, GLIBC_2.0);

+ 1 - 1
libpthread/linuxthreads/pthread.c

@@ -1005,7 +1005,7 @@ void __pthread_message(char * fmt, ...)
 #endif
 #endif
 
 
 
 
-#ifndef PIC
+#ifndef __PIC__
 /* We need a hook to force the cancelation wrappers to be linked in when
 /* We need a hook to force the cancelation wrappers to be linked in when
    static libpthread is used.  */
    static libpthread is used.  */
 extern const int __pthread_provide_wrappers;
 extern const int __pthread_provide_wrappers;

+ 1 - 1
libpthread/linuxthreads/weaks.c

@@ -30,7 +30,7 @@ extern void __pthread_return_void __P ((void));
  */
  */
 
 
 /* Those are pthread functions which return 0 if successful. */
 /* Those are pthread functions which return 0 if successful. */
-//#if defined __HAVE_ELF__ && defined PIC && defined DO_VERSIONING
+//#if defined __HAVE_ELF__ && defined __PIC__ && defined DO_VERSIONING
 //weak_alias (__pthread_return_0, __libc_pthread_attr_init_2_0)
 //weak_alias (__pthread_return_0, __libc_pthread_attr_init_2_0)
 //symbol_version (__libc_pthread_attr_init_2_0, pthread_attr_init, GLIBC_2.0);
 //symbol_version (__libc_pthread_attr_init_2_0, pthread_attr_init, GLIBC_2.0);
 //weak_alias (__pthread_return_0, __libc_pthread_attr_init_2_1)
 //weak_alias (__pthread_return_0, __libc_pthread_attr_init_2_1)

+ 1 - 1
libpthread/linuxthreads/wrapsyscall.c

@@ -34,7 +34,7 @@
 #include <sys/syscall.h>
 #include <sys/syscall.h>
 
 
 
 
-#ifndef PIC
+#ifndef __PIC__
 /* We need a hook to force this file to be linked in when static
 /* We need a hook to force this file to be linked in when static
    libpthread is used.  */
    libpthread is used.  */
 const int __pthread_provide_wrappers = 0;
 const int __pthread_provide_wrappers = 0;