From 637e2b2440f69e22932edd71bd2f0b1210dc32ea Mon Sep 17 00:00:00 2001 From: Filippo Arcidiacono Date: Fri, 31 Jul 2009 14:56:38 +0200 Subject: ldso: Add implementation of ld.so standalone execution The dynamic linker can be run either indirectly through running some dynamically linked program or library (in which case no command line options to the dynamic linker can be passed and, in the ELF case, the dynamic linker which is stored in the .interp section of the program is executed) or directly by running: /lib/ld-uClibc.so.* [OPTIONS] [PROGRAM [ARGUMENTS]] Stand-alone execution is a prerequisite for adding prelink capabilities to uClibc dynamic linker, as well useful for testing an updated version of the dynamic linker without breaking the whole system. Currently supported option: --library-path PATH use given PATH instead of content of the environment variable LD_LIBRARY_PATH (Mandatory for prelinking) Not supported options: --list list all dependencies and how they are resolved --verify verify that given object really is a dynamically linked object we can handle --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names in LIST This feature can be enabled by setting LDSO_STANDALONE_SUPPORT=y Signed-off-by: Filippo Arcidiacono Signed-off-by: Carmelo Amoroso --- ldso/ldso/dl-startup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ldso/ldso/dl-startup.c') diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c index a51b583a4..2aefa6d74 100644 --- a/ldso/ldso/dl-startup.c +++ b/ldso/ldso/dl-startup.c @@ -321,12 +321,12 @@ DL_START(unsigned long args) __rtld_stack_end = (void *)(argv - 1); - _dl_get_ready_to_run(tpnt, load_addr, auxvt, envp, argv - DL_GET_READY_TO_RUN_EXTRA_ARGS); + _dl_elf_main = (int (*)(int, char **, char **)) + _dl_get_ready_to_run(tpnt, (DL_LOADADDR_TYPE) header, auxvt, envp, argv + DL_GET_READY_TO_RUN_EXTRA_ARGS); /* Transfer control to the application. */ SEND_STDERR_DEBUG("transfering control to application @ "); - _dl_elf_main = (int (*)(int, char **, char **)) auxvt[AT_ENTRY].a_un.a_val; SEND_ADDRESS_STDERR_DEBUG(_dl_elf_main, 1); #if !defined(START) -- cgit v1.2.3