Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/libexec/ld.elf_so Pull up following revision(s) (requeste...



details:   https://anonhg.NetBSD.org/src/rev/18cd8f6c19b4
branches:  netbsd-8
changeset: 850981:18cd8f6c19b4
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu Aug 31 08:36:58 2017 +0000

description:
Pull up following revision(s) (requested by joerg in ticket #236):
        libexec/ld.elf_so/symbol.c: revision 1.69
If a DF_1_NODELETE DSO has been removed from the DAG list, it still
needs to be able to resolve relocations against itself. As such, search
the referencing object explicitly last, if it hasn't been searched
before.

diffstat:

 libexec/ld.elf_so/symbol.c |  19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r b93cd237887c -r 18cd8f6c19b4 libexec/ld.elf_so/symbol.c
--- a/libexec/ld.elf_so/symbol.c        Thu Aug 31 08:34:50 2017 +0000
+++ b/libexec/ld.elf_so/symbol.c        Thu Aug 31 08:36:58 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: symbol.c,v 1.67.6.1 2017/07/04 12:47:58 martin Exp $    */
+/*     $NetBSD: symbol.c,v 1.67.6.2 2017/08/31 08:36:58 bouyer Exp $    */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: symbol.c,v 1.67.6.1 2017/07/04 12:47:58 martin Exp $");
+__RCSID("$NetBSD: symbol.c,v 1.67.6.2 2017/08/31 08:36:58 bouyer Exp $");
 #endif /* not lint */
 
 #include <err.h>
@@ -480,6 +480,21 @@
        }
 
        /*
+        * Finally, look in the referencing object if not linked symbolically.
+        * This is necessary for DF_1_NODELETE objects where the containing DAG
+        * has been unlinked, so local references are resolved properly.
+        */
+       if ((def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) &&
+           !refobj->symbolic && !_rtld_donelist_check(&donelist, refobj)) {
+               rdbg(("search referencing object for %s", name));
+               symp = _rtld_symlook_obj(name, hash, refobj, flags, ventry);
+               if (symp != NULL) {
+                       def = symp;
+                       defobj = refobj;
+               }
+       }
+
+       /*
         * Search the dynamic linker itself, and possibly resolve the
         * symbol from there.  This is how the application links to
         * dynamic linker services such as dlopen.



Home | Main Index | Thread Index | Old Index