about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-04-24 22:13:03 +0200
committerFlorian Weimer <fweimer@redhat.com>2020-04-24 22:13:03 +0200
commit50a2d83c08a94a10f88a1fedeb7a6e3667a6b732 (patch)
tree4fdc0dd13db811d4b08db15aee6ad8381fc16d67 /elf
parent781dacc4f41332098e3a272514b20a490a7ebc8c (diff)
downloadglibc-50a2d83c08a94a10f88a1fedeb7a6e3667a6b732.tar.gz
glibc-50a2d83c08a94a10f88a1fedeb7a6e3667a6b732.tar.xz
glibc-50a2d83c08a94a10f88a1fedeb7a6e3667a6b732.zip
elf: Introduce <elf_machine_sym_no_match.h>
MIPS needs to ignore certain existing symbols during symbol lookup.
The old scheme uses the ELF_MACHINE_SYM_NO_MATCH macro, with an
inline function, within its own header, with a sysdeps override for
MIPS.  This allows re-use of the function from another file (without
having to include <dl-machine.h> or providing the default definition
for ELF_MACHINE_SYM_NO_MATCH).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-lookup.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 12a229f06c..807f3ea9b6 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -28,18 +28,12 @@
 #include <libc-lock.h>
 #include <tls.h>
 #include <atomic.h>
+#include <elf_machine_sym_no_match.h>
 
 #include <assert.h>
 
-/* Return nonzero if check_match should consider SYM to fail to match a
-   symbol reference for some machine-specific reason.  */
-#ifndef ELF_MACHINE_SYM_NO_MATCH
-# define ELF_MACHINE_SYM_NO_MATCH(sym) 0
-#endif
-
 #define VERSTAG(tag)	(DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (tag))
 
-
 struct sym_val
   {
     const ElfW(Sym) *s;
@@ -78,7 +72,7 @@ check_match (const char *const undef_name,
   if (__glibc_unlikely ((sym->st_value == 0 /* No value.  */
 			 && sym->st_shndx != SHN_ABS
 			 && stt != STT_TLS)
-			|| ELF_MACHINE_SYM_NO_MATCH (sym)
+			|| elf_machine_sym_no_match (sym)
 			|| (type_class & (sym->st_shndx == SHN_UNDEF))))
     return NULL;