redshirt icon indicating copy to clipboard operation
redshirt copied to clipboard

Compile ARM in position-independant-code mode

Open tomaka opened this issue 5 years ago • 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.

tomaka avatar Feb 16 '20 21:02 tomaka

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

tomaka avatar Feb 18 '20 20:02 tomaka