rtld.c (129792) | rtld.c (130661) |
---|---|
1/*- 2 * Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra. 3 * Copyright 2003 Alexander Kabaev <kan@FreeBSD.ORG>. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * | 1/*- 2 * Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra. 3 * Copyright 2003 Alexander Kabaev <kan@FreeBSD.ORG>. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/libexec/rtld-elf/rtld.c 129792 2004-05-28 00:05:28Z eik $ | 26 * $FreeBSD: head/libexec/rtld-elf/rtld.c 130661 2004-06-18 02:01:37Z tmm $ |
27 */ 28 29/* 30 * Dynamic linker for ELF. 31 * 32 * John Polstra <jdp@polstra.com>. 33 */ 34 --- 122 unchanged lines hidden (view full) --- 157 STAILQ_HEAD_INITIALIZER(list_fini); 158 159static Elf_Sym sym_zero; /* For resolving undefined weak refs. */ 160 161#define GDB_STATE(s,m) r_debug.r_state = s; r_debug_state(&r_debug,m); 162 163extern Elf_Dyn _DYNAMIC; 164#pragma weak _DYNAMIC | 27 */ 28 29/* 30 * Dynamic linker for ELF. 31 * 32 * John Polstra <jdp@polstra.com>. 33 */ 34 --- 122 unchanged lines hidden (view full) --- 157 STAILQ_HEAD_INITIALIZER(list_fini); 158 159static Elf_Sym sym_zero; /* For resolving undefined weak refs. */ 160 161#define GDB_STATE(s,m) r_debug.r_state = s; r_debug_state(&r_debug,m); 162 163extern Elf_Dyn _DYNAMIC; 164#pragma weak _DYNAMIC |
165#ifndef RTLD_IS_DYNAMIC 166#define RTLD_IS_DYNAMIC() (&_DYNAMIC != NULL) 167#endif |
|
165 166/* 167 * These are the functions the dynamic linker exports to application 168 * programs. They are the only symbols the dynamic linker is willing 169 * to export from itself. 170 */ 171static func_ptr_type exports[] = { 172 (func_ptr_type) &_rtld_error, --- 830 unchanged lines hidden (view full) --- 1003 */ 1004 memset(&objtmp, 0, sizeof(objtmp)); 1005 objtmp.path = NULL; 1006 objtmp.rtld = true; 1007 objtmp.mapbase = mapbase; 1008#ifdef PIC 1009 objtmp.relocbase = mapbase; 1010#endif | 168 169/* 170 * These are the functions the dynamic linker exports to application 171 * programs. They are the only symbols the dynamic linker is willing 172 * to export from itself. 173 */ 174static func_ptr_type exports[] = { 175 (func_ptr_type) &_rtld_error, --- 830 unchanged lines hidden (view full) --- 1006 */ 1007 memset(&objtmp, 0, sizeof(objtmp)); 1008 objtmp.path = NULL; 1009 objtmp.rtld = true; 1010 objtmp.mapbase = mapbase; 1011#ifdef PIC 1012 objtmp.relocbase = mapbase; 1013#endif |
1011 if (&_DYNAMIC != 0) { | 1014 if (RTLD_IS_DYNAMIC()) { |
1012 objtmp.dynamic = rtld_dynamic(&objtmp); 1013 digest_dynamic(&objtmp, 1); 1014 assert(objtmp.needed == NULL); 1015 assert(!objtmp.textrel); 1016 1017 /* 1018 * Temporarily put the dynamic linker entry into the object list, so 1019 * that symbols can be found. --- 1422 unchanged lines hidden --- | 1015 objtmp.dynamic = rtld_dynamic(&objtmp); 1016 digest_dynamic(&objtmp, 1); 1017 assert(objtmp.needed == NULL); 1018 assert(!objtmp.textrel); 1019 1020 /* 1021 * Temporarily put the dynamic linker entry into the object list, so 1022 * that symbols can be found. --- 1422 unchanged lines hidden --- |