summaryrefslogtreecommitdiff
path: root/recipes/uclibc/uclibc-git/fix-thumb1-PIE.patch
blob: 3bb88891df0b8872afb078236a7a90d50953c13e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
diff --git a/Rules.mak b/Rules.mak
index f6fa818..fe03c81 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -339,7 +339,7 @@ ifeq ($(TARGET_ARCH),arm)
 	CPU_CFLAGS-$(CONFIG_ARM720T)+=-mtune=arm7tdmi -march=armv4t
 	CPU_CFLAGS-$(CONFIG_ARM920T)+=-mtune=arm9tdmi -march=armv4t
 	CPU_CFLAGS-$(CONFIG_ARM922T)+=-mtune=arm9tdmi -march=armv4t
-	CPU_CFLAGS-$(CONFIG_ARM926T)+=-mtune=arm9tdmi -march=armv5t
+	CPU_CFLAGS-$(CONFIG_ARM926T)+=-mtune=arm9e -march=armv5te
 	CPU_CFLAGS-$(CONFIG_ARM10T)+=-mtune=arm10tdmi -march=armv5t
 	CPU_CFLAGS-$(CONFIG_ARM1136JF_S)+=-mtune=arm1136jf-s -march=armv6
 	CPU_CFLAGS-$(CONFIG_ARM1176JZ_S)+=-mtune=arm1176jz-s -march=armv6
@@ -598,7 +598,7 @@ endif
 
 LDFLAGS:=$(LDFLAGS_NOSTRIP) -Wl,-z,defs
 ifeq ($(DODEBUG),y)
-CFLAGS += -O0 -g3 -DDEBUG
+CFLAGS += -O0 -g -DDEBUG
 else
 CFLAGS += $(OPTIMIZATION)
 endif
diff --git a/libc/sysdeps/linux/arm/crt1.S b/libc/sysdeps/linux/arm/crt1.S
index 18e3686..f2d9507 100644
--- a/libc/sysdeps/linux/arm/crt1.S
+++ b/libc/sysdeps/linux/arm/crt1.S
@@ -133,7 +133,6 @@ _start:
 
 #ifdef __PIC__
 	ldr r4, .L_GOT
-.L_GOT_OFF:
 	adr r5, .L_GOT
 	add r4, r5, r4
 
@@ -201,8 +200,8 @@ _start:
 
 #ifdef __PIC__
 	ldr sl, .L_GOT
-.L_GOT_OFF:
-	add sl, pc, sl
+	adr a4, .L_GOT
+	add sl, sl, a4
 
 	ldr ip, .L_GOT+4	/* _fini */
 	ldr a1, [sl, ip]
@@ -238,11 +237,7 @@ _start:
 
 #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 _GLOBAL_OFFSET_TABLE_ - .L_GOT
 	.word _fini(GOT)
 	.word _init(GOT)
 	.word main(GOT)