ld: load dynamic linker at static address on Linux

* move stack area to static address at beginning of binary
* set ELF type of linker from shared to executable

fixes #3479
This commit is contained in:
Sebastian Sumpf
2019-08-20 14:32:01 +02:00
committed by Christian Helmuth
parent 468270f6e9
commit 2fc6cedcc0
2 changed files with 16 additions and 11 deletions

View File

@@ -30,13 +30,22 @@ symbol.map: $(BASE_DIR)/lib/symbols/ld
ifneq ($(filter linux, $(SPECS)),)
ENTRY_POINT = _start_initial_stack
LD_SCRIPT_SO = $(BASE_DIR)/src/ld/genode_rel.ld \
-T$(call select_from_repositories,src/ld/stack_area.ld) \
LD_SCRIPT_SO = $(call select_from_repositories,src/ld/stack_area.ld) \
-T$(BASE_DIR)/src/ld/genode_rel.ld
ifneq ($(filter x86_32, $(SPECS)),)
LD_OPT += -T$(DIR)/linux-32.ld
endif
#
# set dynamic linker ELF type to executable
#
ifeq ($(called_from_lib_mk),yes)
$(LIB).lib.so.stripped: postprocess.tag
postprocess.tag: $(LIB).lib.so
$(VERBOSE)printf "\x02" | dd of=$(LIB).lib.so bs=1 seek=16 count=1 conv=notrunc
endif
else
ENTRY_POINT = _start
LD_OPT += -T$(DIR)/linker.ld