summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlinted <linted@users.noreply.github.com>2022-09-26 13:40:50 -0400
committerWaldemar Brodkorb <wbx@openadk.org>2022-09-27 09:08:51 +0200
commit0f2cede0fafc059348c3a0c470a82be1c3ed7d4b (patch)
tree4d522e23e6ca0e896e9eaf333d73705780d2baf9
parent0c979facbd8b9c4af702edebec80a58fdb3b3e92 (diff)
Added some documentation on how to add static-pie support to the porting guide
Signed-off-by: linted <linted@users.noreply.github.com>
-rw-r--r--docs/porting.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/porting.txt b/docs/porting.txt
index 380645801..31c188ae1 100644
--- a/docs/porting.txt
+++ b/docs/porting.txt
@@ -12,6 +12,8 @@ you are hacking on.
the shared library loader work requires you first have basic architecture
support working. Thus you should add ARCH_HAS_NO_SHARED and
ARCH_HAS_NO_LDSO to Config.ARCH's TARGET_ARCH
+- When static pie support is added this TARGET_arch can be appended to the
+ list in extra/Configs/Config.in
====================
=== libc sysdeps ===
@@ -56,6 +58,15 @@ you are hacking on.
usually these are written in assembler, but you may be able to cheat and
write them in C ... see other ports for more information
+- Once static and pie executables are stable, static-pie support can be
+ added by modifying crt1.S to calculate the address that the kernel loaded
+ the main elf. Once the elf load address is found, call reloc_static_pie to
+ perform all the dynamic relocations normally handled by ldso. This new
+ code should be placed at the begining of _start and surrounded by defines
+ so that it is only compiled into rcrt1.o and not the static or shared
+ versions. This is usually done by using the special L_rcrt1 preprocessor
+ define. i386 and x86_64 have good reference implementations.
+
====================
=== ldso sysdeps ===
====================