This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 06/26] arm: Use pc_ofs


Scour the source for raw "-8" adjustments that are related to the
offset created by reading the pc.
---
	* sysdeps/arm/__longjmp.S (__longjmp): Use pc_ofs.
	* sysdeps/arm/setjmp.S (__sigsetjmp): Likewise.
	* sysdeps/unix/arm/sysdep.S (__syscall_error): Likewise.
	* sysdeps/unix/sysv/linux/arm/getcontext.S (__getcontext): Likewise.
	* sysdeps/unix/sysv/linux/arm/setcontext.S (__startcontext): Likewise.
	* sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
	(SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/arm/sysdep.h
	(SYSCALL_ERROR_HANDLER): Likewise.
---
 ports/sysdeps/arm/__longjmp.S                          | 4 ++--
 ports/sysdeps/arm/setjmp.S                             | 4 ++--
 ports/sysdeps/unix/arm/sysdep.S                        | 4 ++--
 ports/sysdeps/unix/sysv/linux/arm/getcontext.S         | 2 +-
 ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h | 2 +-
 ports/sysdeps/unix/sysv/linux/arm/setcontext.S         | 2 +-
 ports/sysdeps/unix/sysv/linux/arm/sysdep.h             | 2 +-
 7 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/ports/sysdeps/arm/__longjmp.S b/ports/sysdeps/arm/__longjmp.S
index 5c04f36..28281d5 100644
--- a/ports/sysdeps/arm/__longjmp.S
+++ b/ports/sysdeps/arm/__longjmp.S
@@ -105,12 +105,12 @@ ENTRY (__longjmp)
 
 #ifdef NEED_HWCAP
 # ifdef IS_IN_rtld
-1:	.long	_GLOBAL_OFFSET_TABLE_ - 0b - 8
+1:	.long	_GLOBAL_OFFSET_TABLE_ - 0b - pc_ofs
 .Lrtld_local_ro:
 	.long	C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
 # else
 #  ifdef PIC
-1:	.long	_GLOBAL_OFFSET_TABLE_ - 0b - 8
+1:	.long	_GLOBAL_OFFSET_TABLE_ - 0b - pc_ofs
 .Lrtld_global_ro:
 	.long	C_SYMBOL_NAME(_rtld_global_ro)(GOT)
 #  else
diff --git a/ports/sysdeps/arm/setjmp.S b/ports/sysdeps/arm/setjmp.S
index 4b7542a..774c78a 100644
--- a/ports/sysdeps/arm/setjmp.S
+++ b/ports/sysdeps/arm/setjmp.S
@@ -91,12 +91,12 @@ ENTRY (__sigsetjmp)
 
 #ifdef NEED_HWCAP
 # ifdef IS_IN_rtld
-1:	.long	_GLOBAL_OFFSET_TABLE_ - 0b - 8
+1:	.long	_GLOBAL_OFFSET_TABLE_ - 0b - pc_ofs
 .Lrtld_local_ro:
 	.long	C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
 # else
 #  ifdef PIC
-1:	.long	_GLOBAL_OFFSET_TABLE_ - 0b - 8
+1:	.long	_GLOBAL_OFFSET_TABLE_ - 0b - pc_ofs
 .Lrtld_global_ro:
 	.long	C_SYMBOL_NAME(_rtld_global_ro)(GOT)
 #  else
diff --git a/ports/sysdeps/unix/arm/sysdep.S b/ports/sysdeps/unix/arm/sysdep.S
index da07d85..76137b3 100644
--- a/ports/sysdeps/unix/arm/sysdep.S
+++ b/ports/sysdeps/unix/arm/sysdep.S
@@ -50,14 +50,14 @@ __syscall_error:
 	mvn r0, #0
 	RETINSTR (, ip)
 
-1:	.word errno(gottpoff) + (. - 2b - 8)
+1:	.word errno(gottpoff) + (. - 2b - pc_ofs)
 #elif RTLD_PRIVATE_ERRNO
 	ldr r1, 1f
 0:	str r0, [pc, r1]
 	mvn r0, $0
 	DO_RET(r14)
 
-1:	.word C_SYMBOL_NAME(rtld_errno) - 0b - 8
+1:	.word C_SYMBOL_NAME(rtld_errno) - 0b - pc_ofs
 #else
 #error "Unsupported non-TLS case"
 #endif
diff --git a/ports/sysdeps/unix/sysv/linux/arm/getcontext.S b/ports/sysdeps/unix/sysv/linux/arm/getcontext.S
index f7857c1..69cae48 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/getcontext.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/getcontext.S
@@ -103,7 +103,7 @@ ENTRY(__getcontext)
 END(__getcontext)
 
 #ifdef PIC
-1:      .long   _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1:      .long   _GLOBAL_OFFSET_TABLE_ - 0b - pc_ofs
 .Lrtld_global_ro:
 	.long   C_SYMBOL_NAME(_rtld_global_ro)(GOT)
 #else
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
index 1b0a244..1745f9e 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
@@ -212,7 +212,7 @@ extern int __local_multiple_threads attribute_hidden;
   ldr ip, [pc, ip];							\
   teq ip, #0;
 #   define PSEUDO_PROLOGUE						\
-  1:  .word __local_multiple_threads - 2f - 8;
+  1:  .word __local_multiple_threads - 2f - pc_ofs;
 #  endif
 # else
 /*  There is no __local_multiple_threads for librt, so use the TCB.  */
diff --git a/ports/sysdeps/unix/sysv/linux/arm/setcontext.S b/ports/sysdeps/unix/sysv/linux/arm/setcontext.S
index 8e71f5b..8d96c57 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/setcontext.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/setcontext.S
@@ -93,7 +93,7 @@ ENTRY(__startcontext)
 END(__startcontext)
 
 #ifdef PIC
-1:      .long   _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1:      .long   _GLOBAL_OFFSET_TABLE_ - 0b - pc_ofs
 .Lrtld_global_ro:
 	.long   C_SYMBOL_NAME(_rtld_global_ro)(GOT)
 #else
diff --git a/ports/sysdeps/unix/sysv/linux/arm/sysdep.h b/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
index 6b5bb14..cb237d9 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -114,7 +114,7 @@ __local_syscall_error:						\
 0:     str     r0, [pc, r1];					\
        mvn     r0, #0;						\
        DO_RET(lr);						\
-1:     .word C_SYMBOL_NAME(rtld_errno) - 0b - 8;
+1:     .word C_SYMBOL_NAME(rtld_errno) - 0b - pc_ofs;
 # else
 #  if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
 #   define POP_PC \
-- 
1.8.1.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]