summaryrefslogtreecommitdiff
path: root/ldso/include
diff options
context:
space:
mode:
authorMark Salter <msalter@redhat.com>2011-02-23 12:56:43 +0100
committerBernd Schmidt <bernds@codesourcery.com>2011-03-05 18:10:15 +0100
commit95adc01517efce365da4e40e0d2a081ec4497928 (patch)
tree8695a2d9a6f636baed3e935591369fe910f90beb /ldso/include
parentf4eebb6146ea3f6917481d5d24f3d99e97236399 (diff)
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 <msalter@redhat.com> Signed-off-by: Aurelien Jacquiot <a-jacquiot@ti.com> Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
Diffstat (limited to 'ldso/include')
-rw-r--r--ldso/include/dl-defs.h2
-rw-r--r--ldso/include/dl-elf.h11
2 files changed, 11 insertions, 2 deletions
diff --git a/ldso/include/dl-defs.h b/ldso/include/dl-defs.h
index 2d6303cfe..be0a81da3 100644
--- a/ldso/include/dl-defs.h
+++ b/ldso/include/dl-defs.h
@@ -212,7 +212,7 @@ typedef struct {
_dl_find_hash for this reloc TYPE. TPNT is the module in which the
matching SYM was found. */
#ifndef DL_FIND_HASH_VALUE
-# define DL_FIND_HASH_VALUE(TPNT, TYPE, SYM) (DL_RELOC_ADDR ((SYM)->st_value, (TPNT)->loadaddr))
+# define DL_FIND_HASH_VALUE(TPNT, TYPE, SYM) (DL_RELOC_ADDR ((TPNT)->loadaddr, (SYM)->st_value))
#endif
/* Unmap all previously-mapped segments accumulated in LOADADDR.
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;
}