From 4f0132e337b27f6f5d165a9dfb2bfa04cff7be1b Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Wed, 4 Jul 2018 17:55:18 +0200 Subject: rtld: Avoid FUNCDESC relocation on _start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ldso/ldso/ldso.c (_start): Fix definition for __FDPIC__. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon --- ldso/ldso/ldso.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c index 17818b5fd..c62575797 100644 --- a/ldso/ldso/ldso.c +++ b/ldso/ldso/ldso.c @@ -109,7 +109,13 @@ static unsigned char *_dl_mmap_zero = NULL; /* Also used by _dl_malloc */ static struct elf_resolve **init_fini_list; static struct elf_resolve **scope_elem_list; static unsigned int nlist; /* # items in init_fini_list */ +#ifdef __FDPIC__ +/* We need to take the address of _start instead of its FUNCDESC: + declare it as void* to control the relocation emitted. */ +extern void *_start; +#else extern void _start(void); +#endif #ifdef __UCLIBC_HAS_SSP__ # include -- cgit v1.2.3