From 8554fb21bb34329201b38c2ae4387fb6f00645cc Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Tue, 22 May 2012 10:53:29 -0400 Subject: Clean up DSBT support The existing DSBT support relies on the kernel to provide DSBT info as part of the load maps passed to user space. The problem with this approach is that the DSBT info is in the dynamic section, so the kernel must access a userspace mapping of the dynamic section (or separately read a copy for the kernel) in order to retrieve the information needed by userspace. This patch reworks the DSBT support to remove the reliance on DSBT info coming from the kernel. Instead, ldso reads the info itself from the dynamic section. One other benefit of this is that it allows the existing kernel FDPIC loader to also load DSBT binaries. Signed-off-by: Mark Salter Signed-off-by: Bernhard Reutner-Fischer --- ldso/ldso/dl-hash.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ldso/ldso/dl-hash.c') diff --git a/ldso/ldso/dl-hash.c b/ldso/ldso/dl-hash.c index 36ebec684..2c659dc58 100644 --- a/ldso/ldso/dl-hash.c +++ b/ldso/ldso/dl-hash.c @@ -115,6 +115,15 @@ struct elf_resolve *_dl_add_elf_hash_table(const char *libname, tpnt->dynamic_addr = (ElfW(Dyn) *)dynamic_addr; tpnt->libtype = loaded_file; +#ifdef __DSBT__ + if (dynamic_info[DT_DSBT_BASE_IDX] != 0) + tpnt->dsbt_table = (void *)dynamic_info[DT_DSBT_BASE_IDX]; + if (dynamic_info[DT_DSBT_SIZE_IDX] != 0) + tpnt->dsbt_size = dynamic_info[DT_DSBT_SIZE_IDX]; + if (dynamic_info[DT_DSBT_INDEX_IDX] != 0) + tpnt->dsbt_index = dynamic_info[DT_DSBT_INDEX_IDX]; +#endif /* __DSBT__ */ + #ifdef __LDSO_GNU_HASH_SUPPORT__ if (dynamic_info[DT_GNU_HASH_IDX] != 0) { Elf32_Word *hash32 = (Elf_Symndx*)dynamic_info[DT_GNU_HASH_IDX]; -- cgit v1.2.3