From f88bb681ba22d77a19abfb4c1617c826298ed473 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Wed, 4 Jul 2018 17:55:16 +0200 Subject: rtld: Add #if defined (__FDPIC__) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Like for other FDPIC targets, add defined(__FDPIC__) where needed. * include/link.h: Include bits/elf-fdpic.h if __FDPIC__ is defined. (link_map): Use elf32_fdpic_loadaddr if __FDPIC__ is defined. (dl_phdr_info): Likewise. * ldso/include/dl-elf.h (__dl_parse_dynamic_info): Support __FDPIC__. * ldso/include/dl-hash.h (elf_resolve): Add funcdesc_ht field if __FDPIC__ is defined. * ldso/ldso/dl-hash.c (_dl_find_hash): Support __FDPIC__. * libc/misc/elf/dl-iterate-phdr.c (dl_iterate_phdr): Support __FDPIC__. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon --- ldso/include/dl-elf.h | 2 +- ldso/include/dl-hash.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'ldso/include') diff --git a/ldso/include/dl-elf.h b/ldso/include/dl-elf.h index a827b8d6d..2b99958d9 100644 --- a/ldso/include/dl-elf.h +++ b/ldso/include/dl-elf.h @@ -202,7 +202,7 @@ unsigned int __dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info /* Don't adjust .dynamic unnecessarily. For FDPIC targets, we'd have to walk all the loadsegs to find out if it was actually unnecessary, so skip this optimization. */ -#if !defined __FRV_FDPIC__ && !defined __BFIN_FDPIC__ && !defined __DSBT__ +#if !defined __FRV_FDPIC__ && !defined __BFIN_FDPIC__ && !defined __DSBT__ && !defined __FDPIC__ if (load_off != 0) #endif { diff --git a/ldso/include/dl-hash.h b/ldso/include/dl-hash.h index cb46bec62..d1deea9f3 100644 --- a/ldso/include/dl-hash.h +++ b/ldso/include/dl-hash.h @@ -134,7 +134,7 @@ struct elf_resolve { unsigned long data_words; #endif -#if defined(__FRV_FDPIC__) || defined(__BFIN_FDPIC__) +#if defined(__FRV_FDPIC__) || defined(__BFIN_FDPIC__) || defined(__FDPIC__) /* Every loaded module holds a hashtable of function descriptors of functions defined in it, such that it's easy to release the memory when the module is dlclose()d. */ -- cgit v1.2.3