svn commit: trunk/uClibc/libc/sysdeps/linux/arm
aldot at uclibc.org
aldot at uclibc.org
Tue Nov 25 12:26:43 UTC 2008
Author: aldot
Date: 2008-11-25 04:26:42 -0800 (Tue, 25 Nov 2008)
New Revision: 24138
Log:
- Fix thumb2 PIE (Joseph S. Myers)
This patch fixes position-independent executables (PIEs) for Thumb-2. In
Thumb assembly, instructions reading pc give a value 4 greater than the
address of the instruction, rather than 8 greater as in ARM mode, so the
offset to the GOT needs to have the right offset. (The Thumb-1 code
already gets this right; it's the code shared by ARM and Thumb-2 that
needs fixing.)
Modified:
trunk/uClibc/libc/sysdeps/linux/arm/crt1.S
Changeset:
Modified: trunk/uClibc/libc/sysdeps/linux/arm/crt1.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/arm/crt1.S 2008-11-25 01:36:03 UTC (rev 24137)
+++ trunk/uClibc/libc/sysdeps/linux/arm/crt1.S 2008-11-25 12:26:42 UTC (rev 24138)
@@ -238,7 +238,11 @@
#ifdef __PIC__
.L_GOT:
+#ifdef __thumb__
+ .word _GLOBAL_OFFSET_TABLE_-(.L_GOT_OFF+4)
+#else /* __thumb2__ */
.word _GLOBAL_OFFSET_TABLE_-(.L_GOT_OFF+8)
+#endif
.word _fini(GOT)
.word _init(GOT)
.word main(GOT)
More information about the uClibc-cvs
mailing list