diff --git a/repos/base/src/ld/genode_dyn.ld b/repos/base/src/ld/genode_dyn.ld index 57ec92f0f6..a3a77fef1a 100644 --- a/repos/base/src/ld/genode_dyn.ld +++ b/repos/base/src/ld/genode_dyn.ld @@ -212,17 +212,6 @@ SECTIONS } .jcr : { KEEP (*(.jcr)) } .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) } - .dynamic : - { - *(.dynamic) - - /* - * Make sure to have a least one entry within the dynamic section, so the - * dynamic sgement point to something valid in case there are no dynamic - * symbols - */ - LONG(0x0); - } : rw : dynamic /* merge .got.plt and .got into .got, since the ARM toolchain for OKL4 * set's * DT_PLTGOT to .got instead of .got.plt */ @@ -247,6 +236,20 @@ SECTIONS LONG(0x0); } .data1 : { *(.data1) } + + .dynamic : + { + *(.dynamic) + + /* + * Make sure to have a least one entry within the dynamic section, so the + * dynamic segment points to something valid in case there are no dynamic + * symbols in a binary. These semi-static binaries are not supported by + * our dynamic linker that depends on the .dynamic section. + */ + LONG(0x0); + } : rw : dynamic + _edata = .; PROVIDE (edata = .); __bss_start = .; .bss : @@ -264,7 +267,7 @@ SECTIONS * pad the .data section. */ . = ALIGN(. != 0 ? 32 / 8 : 1); - } + } : rw . = ALIGN(32 / 8); . = ALIGN(32 / 8); _end = .; PROVIDE (end = .); diff --git a/repos/base/src/ld/genode_rel.ld b/repos/base/src/ld/genode_rel.ld index 9b5add9066..85c44dfb93 100644 --- a/repos/base/src/ld/genode_rel.ld +++ b/repos/base/src/ld/genode_rel.ld @@ -15,10 +15,10 @@ PHDRS { - ro PT_LOAD; - rw PT_LOAD; - dynamic PT_DYNAMIC; - eh_frame PT_GNU_EH_FRAME; + ro PT_LOAD; + rw PT_LOAD; + dynamic PT_DYNAMIC; + eh_frame PT_GNU_EH_FRAME; } SECTIONS @@ -97,7 +97,7 @@ SECTIONS { /* * Leave space for parent capability parameters at start of data - * section. The protection domain creator is reponsible for storing + * section. The protection-domain creator is reponsible for storing * sane values here. */ _parent_cap = .; @@ -130,6 +130,7 @@ SECTIONS .ARM.extab : { *(.ARM.extab*) } + __exidx_start = .; .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) @@ -189,7 +190,6 @@ SECTIONS .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) } .data1 : { *(.data1) } - .dynamic : { *(.dynamic) } : dynamic : rw /* See: genode_dyn.ld */ .got : { *(.got.plt) *(.got) } /* Exception handling */ @@ -199,6 +199,9 @@ SECTIONS KEEP (*(.eh_frame)) LONG(0) } + + .dynamic : { *(.dynamic) } : rw : dynamic + _edata = .; PROVIDE (edata = .); __bss_start = .; .bss : @@ -216,7 +219,7 @@ SECTIONS * pad the .data section. */ . = ALIGN(. != 0 ? 32 / 8 : 1); - } + } : rw . = ALIGN(32 / 8); . = ALIGN(32 / 8); _end = .; PROVIDE (end = .);