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

@ -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
}