This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
[glibc/fw/elf-fixups] Introduce DL_LOOKUP_FOR_RELOCATE flag for _dl_lookup_symbol_x
- From: Florian Weimer <fw at sourceware dot org>
- To: glibc-cvs at sourceware dot org
- Date: 29 Oct 2019 11:36:37 -0000
- Subject: [glibc/fw/elf-fixups] Introduce DL_LOOKUP_FOR_RELOCATE flag for _dl_lookup_symbol_x
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=10c5d5518cd6a90f8e541194889a38061acc7951
commit 10c5d5518cd6a90f8e541194889a38061acc7951
Author: Florian Weimer <fweimer@redhat.com>
Date: Tue Oct 29 12:23:48 2019 +0100
Introduce DL_LOOKUP_FOR_RELOCATE flag for _dl_lookup_symbol_x
This will allow changes in dependency processing during non-lazy
binding, for more precise processing of NODELETE objects: During
initial relocation in dlopen, the fate of NODELETE objects is still
unclear, so objects which are depended upon by NODELETE objects
cannot immediately be marked as NODELETE.
Diff:
---
elf/dl-reloc.c | 3 ++-
sysdeps/generic/ldsodefs.h | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index 725a074..7f201fe 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -244,7 +244,8 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
v = (version); \
_lr = _dl_lookup_symbol_x (strtab + (*ref)->st_name, l, (ref), \
scope, v, _tc, \
- DL_LOOKUP_ADD_DEPENDENCY, NULL); \
+ DL_LOOKUP_ADD_DEPENDENCY \
+ | DL_LOOKUP_FOR_RELOCATE, NULL); \
l->l_lookup_cache.ret = (*ref); \
l->l_lookup_cache.value = _lr; })) \
: l)
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index f3ba13e..7d5b80d 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -914,6 +914,9 @@ enum
DL_LOOKUP_RETURN_NEWEST = 2,
/* Set if dl_lookup* called with GSCOPE lock held. */
DL_LOOKUP_GSCOPE_LOCK = 4,
+ /* Set if dl_lookup is called for non-lazy relocation processing
+ from _dl_relocate_object in elf/dl-reloc.c. */
+ DL_LOOKUP_FOR_RELOCATE = 8,
};
/* Lookup versioned symbol. */