summaryrefslogtreecommitdiff
path: root/libc/misc/internals/Makefile.in
diff options
context:
space:
mode:
authorlinted <linted@users.noreply.github.com>2022-07-23 16:25:41 -0400
committerWaldemar Brodkorb <wbx@openadk.org>2022-07-26 09:56:03 +0200
commit2c58afdb3ae6f900583cf7264cba6ab8a797e3e2 (patch)
treeabb641e31fcab71a4e78905fd0124ca8b9a25eae /libc/misc/internals/Makefile.in
parent01961b12bc71d6eb4d9bda3632d73bb6764b8e85 (diff)
Added support for creation of Static Position-Independent Executables (PIE) on i386, x86_64, and arm.
This patch adds the generation of rcrt1.o which is used by gcc when compiling with the --static-pie flag. rcrt1.o differs from crt1.o and Scrt1.o in that it the executable has a dynamic section but no relocations have been performed prior to _start being called. crt1.o assumes there to be no dynamic relocations, and Scrt1.o has all relocations performed prior to execution by lsdo. The new reloc_static_pie function handles parsing the dynamic section, and performing the relocations in a architecture agnostic method. It also sets _dl_load_base which is used when initalizing TLS to ensure loading from the proper location. This allows for easier porting of static-pie support to additional architectures as only modifications to crt1.S to find the load address are required. Signed-off-by: linted <linted@users.noreply.github.com>
Diffstat (limited to 'libc/misc/internals/Makefile.in')
-rw-r--r--libc/misc/internals/Makefile.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/libc/misc/internals/Makefile.in b/libc/misc/internals/Makefile.in
index a8e4e36f9..4a6e73d2d 100644
--- a/libc/misc/internals/Makefile.in
+++ b/libc/misc/internals/Makefile.in
@@ -34,6 +34,7 @@ libc-static-$(UCLIBC_FORMAT_FLAT_SEP_DATA) += \
libc-static-$(UCLIBC_FORMAT_SHARED_FLAT) += \
$(MISC_INTERNALS_OUT)/shared_flat_initfini.o \
$(MISC_INTERNALS_OUT)/shared_flat_add_library.o
+libc-static-$(STATIC_PIE) += $(MISC_INTERNALS_OUT)/reloc_static_pie.o
libc-shared-$(UCLIBC_FORMAT_SHARED_FLAT) += \
$(MISC_INTERNALS_OUT)/shared_flat_initfini.os \
$(MISC_INTERNALS_OUT)/shared_flat_add_library.os