From 0f2cede0fafc059348c3a0c470a82be1c3ed7d4b Mon Sep 17 00:00:00 2001 From: linted Date: Mon, 26 Sep 2022 13:40:50 -0400 Subject: Added some documentation on how to add static-pie support to the porting guide Signed-off-by: linted --- docs/porting.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 === ==================== -- cgit v1.2.3