tomaka/redshirt

Compile ARM in position-independant-code mode

Opened this issue · 1 comments

diff --git a/arm-freestanding.json b/arm-freestanding.json
index 511cf52..bb0968d 100644
--- a/arm-freestanding.json
+++ b/arm-freestanding.json
@@ -20,10 +20,11 @@
     "max-atomic-width": 32,
     "os": "none",
     "panic-strategy": "abort",
+    "position-independent-executables": true,
     "pre-link-args": {
         "ld": ["--script", "arm-freestanding.ld"]
     },
-    "relocation-model": "static",
+    "relocation-model": "pic",
     "target-c-int-width": "32",
     "target-endian": "little",
     "target-pointer-width": "32",

This doesn't compile at the moment because of stack.
We need to change the code in order to allocate a stack in a different (and also multiprocess-friendly) way.

Another issue is the code in the linker script that relies on an absolute address being valid for the initial relative jump (ugh).