updated ARM code s!#error!#warning!

This commit is contained in:
ensc 2008-10-18 17:02:52 +00:00
commit 40415ddcc8

View file

@ -1,4 +1,4 @@
From bbeb245bbb5bc919f8f4d2049ba463ed349ef759 Mon Sep 17 00:00:00 2001
From 6160ca8256603d1f1a929f01238bf43866552dee Mon Sep 17 00:00:00 2001
From: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Date: Sat, 19 Apr 2008 17:35:14 +0200
Subject: [PATCH] Support for dynamic PAGE_SIZE
@ -66,7 +66,7 @@ auxilary elf-info table. Now, this is not available anymore and I
use a type derived from __WORD_SIZE.
---
alpha/start.S | 9 ++++
arm/start.S | 12 ++++--
arm/start.S | 13 ++++++-
dietdirent.h | 6 ++-
dietelfinfo.h | 20 ++++++++++
dietfeatures.h | 14 +++++++
@ -98,14 +98,14 @@ use a type derived from __WORD_SIZE.
test/runtests.sh | 2 +-
test/sysconf.c | 80 ++++++++++++++++++++++++++++++++++++++++
x86_64/start.S | 16 ++++++++
33 files changed, 374 insertions(+), 44 deletions(-)
33 files changed, 378 insertions(+), 41 deletions(-)
create mode 100644 dietelfinfo.h
create mode 100644 dietpagesize.h
create mode 100644 libcruft/__get_elf_aux_value.c
create mode 100644 test/sysconf.c
diff --git a/alpha/start.S b/alpha/start.S
index 7e7cf9b..e5e64a1 100644
index 7e7cf9b..b13c9c9 100644
--- a/alpha/start.S
+++ b/alpha/start.S
@@ -24,6 +24,15 @@ _start:
@ -113,7 +113,7 @@ index 7e7cf9b..e5e64a1 100644
stq $18, environ
+#ifdef WANT_ELFINFO
+# error "MAKE ME alpha ASSEMBLER!"
+# warning "MAKE ME alpha ASSEMBLER!"
+1: ldq $19, $18 ; load *envp into $19
+ addq $18, 1, $18 ; increment *envp
+ orr $19, $19, $19
@ -125,10 +125,10 @@ index 7e7cf9b..e5e64a1 100644
/* in v0 ($0) is the ld.so _fini pointer */
mov $0, $19 /* mov v0(dynload) to a3 */
diff --git a/arm/start.S b/arm/start.S
index fcd3d7c..e7e3be7 100644
index ccbac48..c9cee01 100644
--- a/arm/start.S
+++ b/arm/start.S
@@ -23,11 +23,18 @@ _start:
@@ -59,11 +59,22 @@ _start:
#ifdef __DYN_LIB
ldr sl, .L4
1: add sl, pc, sl
@ -142,19 +142,16 @@ index fcd3d7c..e7e3be7 100644
+1: ldr r5, [a3], #4 @ load *envp and increment it
+ cmp r5, #0 @ read value==0?
+ bne 1b
+#ifdef __DYN_LIB
+ str a3, [ip, sl] @ __elfinfo = envp
+#else
+ str a3, [ip, #4] @ __elfinfo = envp
+#endif
+#endif
+
#ifdef PROFILING
stmdb sp!, { r0 - r3 }
ldr r0, .L5
@@ -70,6 +77,3 @@ _exit:
.L5: .word .text
.L6: .word _etext
#endif
-
-
-
diff --git a/dietdirent.h b/dietdirent.h
index dbd7206..c9c7127 100644
--- a/dietdirent.h
@ -305,7 +302,7 @@ index 94a4f73..0c2c71d 100644
pushl $_etext
pushl $.text
diff --git a/ia64/start.S b/ia64/start.S
index 50fd015..bac10cb 100644
index 50fd015..5389a4f 100644
--- a/ia64/start.S
+++ b/ia64/start.S
@@ -40,6 +40,16 @@ _start:
@ -313,7 +310,7 @@ index 50fd015..bac10cb 100644
st8 [r14] = out2 /* store envp in environ */
+#ifdef WANT_ELFINFO
+# error "MAKE ME IE64 CODE!"
+# warning "MAKE ME IE64 CODE!"
+1: ld8 r9 = [out2], 8 /* load *envp and increment it */
+ orr r9 = r9, r9 /* test for NULL */
+ bne 1b
@ -582,7 +579,7 @@ index e9c15cb..b98195c 100644
case _SC_ARG_MAX:
return ARG_MAX;
diff --git a/mips/start.S b/mips/start.S
index 57144b3..002fcf8 100644
index 57144b3..4c659a6 100644
--- a/mips/start.S
+++ b/mips/start.S
@@ -47,6 +47,15 @@ __start:
@ -590,7 +587,7 @@ index 57144b3..002fcf8 100644
add $a2, $a2, $a1
sw $a2, environ
+#ifdef WANT_ELFINFO
+# error "MAKE ME MIPS CODE!"
+# warning "MAKE ME MIPS CODE!"
+1: addu $a2, $a2, 4 /* increment envp */
+ lw $4, -4($a2) /* load envp[-1]; TODO: is $4 a proper
+ temporary register? */
@ -602,7 +599,7 @@ index 57144b3..002fcf8 100644
la $25, exit
move $4,$2
diff --git a/parisc/start.S b/parisc/start.S
index 69d9cce..0f064be 100644
index 69d9cce..b5d8793 100644
--- a/parisc/start.S
+++ b/parisc/start.S
@@ -34,6 +34,16 @@ _start:
@ -610,7 +607,7 @@ index 69d9cce..0f064be 100644
ldo RP%environ(%r19), %r19
+#ifdef WANT_ELFINFO
+# error "MAKE ME PARISC CODE!"
+# warning "MAKE ME PARISC CODE!"
+1: add %r20, %r19, %r19 ; envp += 4
+ ldw -4(0,%r19), %r21 ; load envp[-4] into %r21
+ comibf =,0, 0,%21,1b ; compare %21 with 0 without nullification
@ -663,7 +660,7 @@ index a9208ff..46b4bf0 100644
/* #warning dynamic */
mr 6,7
diff --git a/s390/start.S b/s390/start.S
index c0f971f..d071564 100644
index c0f971f..1d9106a 100644
--- a/s390/start.S
+++ b/s390/start.S
@@ -30,6 +30,17 @@ _start:
@ -671,7 +668,7 @@ index c0f971f..d071564 100644
st %r4,0(%r1)
+#ifdef WANT_ELFINFO
+# error "VERIFY ME!"
+# warning "VERIFY ME!"
+1: ahi %r4, 4 # increment envp
+ l %r12, -4(0,%r4) # load envp[-1] into %r12
+ or %r12, %r12 # test %r12 for NULL
@ -685,7 +682,7 @@ index c0f971f..d071564 100644
l %r1,0(%r13)
basr %r14,%r1
diff --git a/s390x/start.S b/s390x/start.S
index 25895a6..db71fc9 100644
index 25895a6..51d4604 100644
--- a/s390x/start.S
+++ b/s390x/start.S
@@ -26,6 +26,17 @@ _start:
@ -693,7 +690,7 @@ index 25895a6..db71fc9 100644
stg %r4,0(%r13)
+#ifdef WANT_ELFINFO
+# error "VERIFY ME!"
+# warning "VERIFY ME!"
+1: aghi %r4, 8 # increment envp
+ lg %r12, -8(0,%r4) # load envp[-1] into %r12
+ ogr %r12, %r12 # test %r12 for NULL
@ -732,7 +729,7 @@ index b7dce2e..ce3bfcb 100644
return result;
}
diff --git a/sparc/start.S b/sparc/start.S
index a7841e3..6037eae 100644
index a7841e3..bb463c9 100644
--- a/sparc/start.S
+++ b/sparc/start.S
@@ -25,6 +25,17 @@ _start:
@ -740,7 +737,7 @@ index a7841e3..6037eae 100644
st %o2, [%o3]
+#ifdef WANT_ELFINFO
+# error "VERIFY ME!"
+# warning "VERIFY ME!"
+1: add %o2, %o2, 4
+ ld [%o2-4], %o4
+ orcc %o4, %o4, %o4
@ -754,7 +751,7 @@ index a7841e3..6037eae 100644
address of the shared library termination function, which will be
registered with atexit(). If we are statically linked, this will
diff --git a/sparc64/start.S b/sparc64/start.S
index a79c4e7..f0e7d82 100644
index a79c4e7..a884658 100644
--- a/sparc64/start.S
+++ b/sparc64/start.S
@@ -25,6 +25,17 @@ _start:
@ -762,7 +759,7 @@ index a79c4e7..f0e7d82 100644
stx %o2, [%o3]
+#ifdef WANT_ELFINFO
+# error "VERIFY ME!"
+# warning "VERIFY ME!"
+1: add %o2, %o2, 8
+ ldx [%o2-8], %o4
+ orcc %o4, %o4, %o4
@ -955,5 +952,5 @@ index adc461a..3915e33 100644
#ifdef PROFILING
pushq %rdi /* save reg args */
--
1.5.4.5
1.5.5.1