summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-07-05 19:31:48 +0000
committerMike Frysinger <vapier@gentoo.org>2006-07-05 19:31:48 +0000
commitf088c1cd44866d97994059293c5c7beab8732622 (patch)
tree5e09acd14b0106a0a64db91ce77be920f736c0a0 /ldso
parent84905b3ef09632e2497776320fefef348d4e85d3 (diff)
patch from Bernd Schmidt to abstract away initializing of prog load addresses
Diffstat (limited to 'ldso')
-rw-r--r--ldso/include/dl-defs.h8
-rw-r--r--ldso/ldso/ldso.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/ldso/include/dl-defs.h b/ldso/include/dl-defs.h
index 5cf260183..db65f78f6 100644
--- a/ldso/include/dl-defs.h
+++ b/ldso/include/dl-defs.h
@@ -84,6 +84,14 @@ typedef struct {
((LOADADDR) = (BASEADDR))
#endif
+/* Initialize a LOADADDR representing the program. It's called from
+ * DL_BOOT only.
+ */
+#ifndef DL_INIT_LOADADDR_PROG
+# define DL_INIT_LOADADDR_PROG(LOADADDR, BASEADDR) \
+ ((LOADADDR) = (DL_LOADADDR_TYPE)(BASEADDR))
+#endif
+
/* Test whether a given ADDR is more likely to be within the memory
* region mapped to TPNT (a struct elf_resolve *) than to TFROM.
* Everywhere that this is used, TFROM is initially NULL, and whenever
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 82eb044bb..a6209678e 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -295,7 +295,7 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
for (idx = 0; idx < auxvt[AT_PHNUM].a_un.a_val; idx++, phdr++)
if (phdr->p_type == PT_PHDR) {
- app_tpnt->loadaddr = (ElfW(Addr)) (auxvt[AT_PHDR].a_un.a_val - phdr->p_vaddr);
+ DL_INIT_LOADADDR_PROG(app_tpnt->loadaddr, auxvt[AT_PHDR].a_un.a_val - phdr->p_vaddr);
break;
}