diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-07-05 07:04:18 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-07-05 07:04:18 +0000 |
commit | 9faf71ce6876714b7d378be9baa3c666869ae0f0 (patch) | |
tree | 4606ef9898978d5045d0482dd08ff693a47c03f3 | |
parent | 48e99a87d27a65f9621ad9c265c363925da4b7ae (diff) |
patch from Bernd Schmidt to abstract away load addresses
-rw-r--r-- | ldso/include/dl-defs.h | 11 | ||||
-rw-r--r-- | ldso/ldso/dl-startup.c | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/ldso/include/dl-defs.h b/ldso/include/dl-defs.h index 878ebc3b8..2d4f1d655 100644 --- a/ldso/include/dl-defs.h +++ b/ldso/include/dl-defs.h @@ -1,6 +1,6 @@ /* vi: set sw=4 ts=4: */ /* - * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org> + * Copyright (C) 2000-2006 by Erik Andersen <andersen@codepoet.org> * * GNU Lesser General Public License version 2.1 or later. */ @@ -66,4 +66,13 @@ typedef struct { #endif +/* Initialize a LOADADDR representing the loader itself. It's only + * called from DL_BOOT, so additional arguments passed to it may be + * referenced. + */ +#ifndef DL_INIT_LOADADDR_BOOT +# define DL_INIT_LOADADDR_BOOT(LOADADDR, BASEADDR) \ + ((LOADADDR) = (BASEADDR)) +#endif + #endif /* _LD_DEFS_H */ diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c index 451edbf1b..18658cb26 100644 --- a/ldso/ldso/dl-startup.c +++ b/ldso/ldso/dl-startup.c @@ -4,7 +4,7 @@ * after resolving ELF shared library symbols * * Copyright (C) 2005 by Joakim Tjernlund - * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org> + * Copyright (C) 2000-2006 by Erik Andersen <andersen@codepoet.org> * Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, * David Engel, Hongjiu Lu and Mitch D'Souza * @@ -168,7 +168,7 @@ static void * __attribute_used__ _dl_start(unsigned long args) * (esp since SEND_STDERR() needs this on some platforms... */ if (!auxvt[AT_BASE].a_un.a_val) auxvt[AT_BASE].a_un.a_val = elf_machine_load_address(); - load_addr = auxvt[AT_BASE].a_un.a_val; + DL_INIT_LOADADDR_BOOT(load_addr, auxvt[AT_BASE].a_un.a_val); header = (ElfW(Ehdr) *) auxvt[AT_BASE].a_un.a_val; /* Check the ELF header to make sure everything looks ok. */ |