[review v3] Introduce DL_LOOKUP_FOR_RELOCATE flag for _dl_lookup_symbol_x
Carlos O'Donell (Code Review)
gerrit@gnutoolchain-gerrit.osci.io
Thu Nov 21 12:23:00 GMT 2019
Carlos O'Donell has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/470
......................................................................
Patch Set 3: Code-Review+2
(2 comments)
This looks good to me. We can add and remove any number of bits we need to fix NODELETE tracking. The adding of the bit in RESOLVE_MAP is as good a place as any to put this kind of processing.
OK for master (I reviewed this one out of order because it was easy).
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
| --- elf/dl-reloc.c
| +++ elf/dl-reloc.c
| @@ -240,17 +240,18 @@ #define RESOLVE_MAP(ref, version, r_type) \
| l->l_lookup_cache.type_class = _tc; \
| l->l_lookup_cache.sym = (*ref); \
| const struct r_found_version *v = NULL; \
| if ((version) != NULL && (version)->hash != 0) \
| 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); \
PS3, Line 248:
OK. Add a new bit for tracking this and set it as part of RESOLVE_MAP
call during relocation processing.
| l->l_lookup_cache.ret = (*ref); \
| l->l_lookup_cache.value = _lr; })) \
| : l)
|
| #include "dynamic-link.h"
|
| ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc);
|
| #ifndef PROF
| --- sysdeps/generic/ldsodefs.h
| +++ sysdeps/generic/ldsodefs.h
| @@ -920,16 +920,19 @@ enum
| /* If necessary add dependency between user and provider object. */
| DL_LOOKUP_ADD_DEPENDENCY = 1,
| /* Return most recent version instead of default version for
| unversioned lookup. */
| 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,
PS3, Line 929:
OK. Define the bit.
| };
|
| /* Lookup versioned symbol. */
| extern lookup_t _dl_lookup_symbol_x (const char *undef,
| struct link_map *undef_map,
| const ElfW(Sym) **sym,
| struct r_scope_elem *symbol_scope[],
| const struct r_found_version *version,
| int type_class, int flags,
--
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: Ic7b94a3f7c4719a00ca8e6018088567824da0658
Gerrit-Change-Number: 470
Gerrit-PatchSet: 3
Gerrit-Owner: Florian Weimer <fweimer@redhat.com>
Gerrit-Reviewer: Carlos O'Donell <carlos@redhat.com>
Gerrit-Reviewer: Florian Weimer <fweimer@redhat.com>
Gerrit-Comment-Date: Thu, 21 Nov 2019 12:23:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
More information about the Libc-alpha
mailing list