From b9766aa08c90b6718d5497d6a6cf9e6f737e5141 Mon Sep 17 00:00:00 2001 From: Filippo Arcidiacono Date: Thu, 26 Aug 2010 12:00:03 +0200 Subject: ldso: Fix loadaddr and mappaddr when prelink support is enabled. Fixed loadaddr and mappaddr fields to correctly work when prelink support is enabled. - loadaddr is an offset relative to the first loadable segment. - mapaddr is the address where the object has been mapped in memory. Non PIC library detection fixed too. Signed-off-by: Filippo Arcidiacono Signed-off-by: Carmelo Amoroso --- ldso/ldso/ldso.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'ldso/ldso/ldso.c') diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c index b056f8af2..e0d323a9f 100644 --- a/ldso/ldso/ldso.c +++ b/ldso/ldso/ldso.c @@ -329,6 +329,7 @@ static struct elf_resolve * add_ldso(struct elf_resolve *tpnt, tpnt->dynamic_info, (unsigned long)tpnt->dynamic_addr, 0); + tpnt->mapaddr = load_addr; if (_dl_stat(tpnt->libname, &st) >= 0) { tpnt->st_dev = st.st_dev; tpnt->st_ino = st.st_ino; @@ -551,9 +552,6 @@ of this helper program; chances are you did not intend to run this program.\n\ app_tpnt->rtld_flags = unlazy | RTLD_GLOBAL; - if (app_tpnt->libtype == elf_executable) - app_tpnt->loadaddr = 0; - /* * This is used by gdb to locate the chain of shared libraries that are * currently loaded. -- cgit v1.2.3