diff options
author | Richard Henderson <rth@twiddle.net> | 2013-02-12 17:15:52 -0800 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2013-02-28 00:16:05 -0800 |
commit | 783a65c253b144cd7b500720cf37bbddaf861a03 (patch) | |
tree | 09e6655f98d7e27b1ec35a7ce5140f3ee907a6ad /ports/sysdeps/arm | |
parent | 63cc0e75eadde85676bdde0fe8c90b540c200465 (diff) | |
download | glibc-783a65c253b144cd7b500720cf37bbddaf861a03.tar glibc-783a65c253b144cd7b500720cf37bbddaf861a03.tar.gz glibc-783a65c253b144cd7b500720cf37bbddaf861a03.tar.bz2 glibc-783a65c253b144cd7b500720cf37bbddaf861a03.zip |
arm: Introduce and use PC_OFS
Scour the source for raw "-8" adjustments that are related to the
offset created by reading the pc.
Diffstat (limited to 'ports/sysdeps/arm')
-rw-r--r-- | ports/sysdeps/arm/__longjmp.S | 4 | ||||
-rw-r--r-- | ports/sysdeps/arm/setjmp.S | 4 | ||||
-rw-r--r-- | ports/sysdeps/arm/sysdep.h | 8 |
3 files changed, 12 insertions, 4 deletions
diff --git a/ports/sysdeps/arm/__longjmp.S b/ports/sysdeps/arm/__longjmp.S index 5c04f36457..3d6e114c88 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 4b7542ad35..baa02be39d 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/arm/sysdep.h b/ports/sysdeps/arm/sysdep.h index f5ddab0108..4af7429ac9 100644 --- a/ports/sysdeps/arm/sysdep.h +++ b/ports/sysdeps/arm/sysdep.h @@ -118,3 +118,11 @@ .eabi_attribute 24, 1 #endif /* __ASSEMBLER__ */ + +/* This number is the offset from the pc at the current location. */ +/* ??? At the moment we're not turning on thumb mode in assembly. */ +#if defined(__thumb__) && !defined(__ASSEMBLER__) +# define PC_OFS 4 +#else +# define PC_OFS 8 +#endif |