From 54643d687840bfb0242a024dfd170fcf912ae1e7 Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Fri, 1 Nov 2019 13:39:07 +0100 Subject: [PATCH] base: add entry to .dynanmic section in genode_dyn.ld Make sure that at least entry is present in the .dynamic section, so the PT_DYNAMIC segment points to something valid in case there are no dynamic symbols. issue #3537 --- repos/base/src/ld/genode_dyn.ld | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/repos/base/src/ld/genode_dyn.ld b/repos/base/src/ld/genode_dyn.ld index ba90918378..5fa6ddc29e 100644 --- a/repos/base/src/ld/genode_dyn.ld +++ b/repos/base/src/ld/genode_dyn.ld @@ -213,7 +213,17 @@ 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) } : rw : dynamic + .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 */