diff --git a/repos/base-linux/src/ld/stack_area.ld b/repos/base-linux/src/ld/stack_area.ld index 18dcb4709..69f7a0e7d 100644 --- a/repos/base-linux/src/ld/stack_area.ld +++ b/repos/base-linux/src/ld/stack_area.ld @@ -1,5 +1,5 @@ /* - * \brief Linux-specific linker script additions (STDLIB = no) + * \brief Linux-specific linker script additions * \author Christian Helmuth * \date 2010-09-22 */ @@ -19,17 +19,13 @@ PHDRS SECTIONS { /* - * The virtual gap between start of text segment (0x0) and stack area - * must be sufficiently large to hold either the entire dynamic linker (text + - * data) or core (0x1000000 + text + data). Note, core-linux includes 80 MiB - * core-local memory in the BSS. + * Start of Linux binary and stack area */ - . = 0x8000000; /* 128 MiB */ + . = 0x40000000; /* 1GB */ _stack_area_start = .; /* - * Since Linux loads ldso page-aligned, we align the stack area after - * loading to a 1 MiB boundary, therefore we reserve one MiB more here. + * 256 MB */ - .stack_area : { . += 0x10100000; } : stack_area + .stack_area : { . += 0x10000000; } : stack_area } diff --git a/repos/base/lib/mk/ld-platform.inc b/repos/base/lib/mk/ld-platform.inc index dc0b206f2..db3a04e49 100644 --- a/repos/base/lib/mk/ld-platform.inc +++ b/repos/base/lib/mk/ld-platform.inc @@ -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