From 95adc01517efce365da4e40e0d2a081ec4497928 Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Wed, 23 Feb 2011 12:56:43 +0100 Subject: Add support for DSBT ELF to ld.so This adds support for DSBT ELF to ld.so. This uses loadmaps like FD-PIC. Some code is added in ld.so to initialize the DSBT tables, and there's also a new target macro FINISH_BOOTSTRAP_RELOC. Signed-off-by: Mark Salter Signed-off-by: Aurelien Jacquiot Signed-off-by: Bernd Schmidt --- ldso/include/dl-elf.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ldso/include/dl-elf.h') diff --git a/ldso/include/dl-elf.h b/ldso/include/dl-elf.h index 5aec64f0d..7fbb373b4 100644 --- a/ldso/include/dl-elf.h +++ b/ldso/include/dl-elf.h @@ -165,7 +165,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. */ -#ifndef __FDPIC__ +#if !defined __FDPIC__ && !defined __DSBT__ if (load_off != 0) #endif { @@ -179,6 +179,15 @@ unsigned int __dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info ADJUST_DYN_INFO(DT_GNU_HASH_IDX, load_off); #endif } +#ifdef __DSBT__ + /* Get the mapped address of the DSBT base. */ + ADJUST_DYN_INFO(DT_DSBT_BASE_IDX, load_off); + + /* Initialize loadmap dsbt info. */ + load_off.map->dsbt_table = dynamic_info[DT_DSBT_BASE_IDX]; + load_off.map->dsbt_size = dynamic_info[DT_DSBT_SIZE_IDX]; + load_off.map->dsbt_index = dynamic_info[DT_DSBT_INDEX_IDX]; +#endif #undef ADJUST_DYN_INFO return rtld_flags; } -- cgit v1.2.3