diff options
author | Roland McGrath <roland@gnu.org> | 1996-06-02 21:35:43 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1996-06-02 21:35:43 +0000 |
commit | 6c03c2cf27b1a12cbf680377e4796b88a20ed9db (patch) | |
tree | b197b18a54a6f15f71e0cd1679f91a25d1d0239f /elf/dl-lookup.c | |
parent | 9004bc202e5ea7b8eabca183f4e6c6abe573f802 (diff) | |
download | glibc-6c03c2cf27b1a12cbf680377e4796b88a20ed9db.zip glibc-6c03c2cf27b1a12cbf680377e4796b88a20ed9db.tar.gz glibc-6c03c2cf27b1a12cbf680377e4796b88a20ed9db.tar.bz2 |
* elf/dl-lookup.c (_dl_lookup_symbol): Arg NOSELF renamed to NOPLT.
Reject SHN_UNDEF defns iff NOPLT is nonzero.
* elf/link.h (_dl_lookup_symbol): Update prototype and comment.
* elf/dl-runtime.c (fixup): Pass 1 to _dl_lookup_symbol for NOPLT.
* elf/dlsym.c (dlsym): Pass 0.
* elf/rtld.c (dl_main): Likewise.
* elf/dl-reloc.c (_dl_relocate_object: resolve): Second arg R_OFFSET
replaced with NOPLT flag. Pass it through to _dl_lookup_symbol.
* elf/do-rel.h (elf_dynamic_do_rel): Update prototype of RESOLVE arg.
Pass `elf_machine_pltrel_p (R->r_type)' result as NOPLT flag value.
* sysdeps/i386/dl-machine.h (elf_machine_pltrel_p): New macro.
* sysdeps/m68k/dl-machine.h (elf_machine_pltrel_p): Likewise.
* sysdeps/stub/dl-machine.h (elf_machine_pltrel_p): Likewise.
Diffstat (limited to 'elf/dl-lookup.c')
-rw-r--r-- | elf/dl-lookup.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c index cb337d4..90c9b6a 100644 --- a/elf/dl-lookup.c +++ b/elf/dl-lookup.c @@ -1,5 +1,5 @@ /* Look up a symbol in the loaded objects. -Copyright (C) 1995 Free Software Foundation, Inc. +Copyright (C) 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,16 +22,15 @@ Cambridge, MA 02139, USA. */ #include <link.h> #include <assert.h> -/* Search loaded objects' symbol tables for a definition of - the symbol UNDEF_NAME. If NOSELF is nonzero, then *REF - cannot satisfy the reference itself; some different binding - must be found. */ +/* Search loaded objects' symbol tables for a definition of the symbol + UNDEF_NAME. If NOPLT is nonzero, then a PLT entry cannot satisfy the + reference; some different binding must be found. */ Elf32_Addr _dl_lookup_symbol (const char *undef_name, const Elf32_Sym **ref, struct link_map *symbol_scope, const char *reference_name, - int noself) + int noplt) { unsigned long int hash = elf_hash (undef_name); struct link_map *map; @@ -60,8 +59,7 @@ _dl_lookup_symbol (const char *undef_name, const Elf32_Sym **ref, const Elf32_Sym *sym = &symtab[symidx]; if (sym->st_value == 0 || /* No value. */ - sym->st_shndx == SHN_UNDEF || /* PLT entry. */ - (noself && sym == *ref)) /* The reference can't define it. */ + (noplt && sym->st_shndx == SHN_UNDEF)) /* Unwanted PLT entry. */ continue; switch (ELF32_ST_TYPE (sym->st_info)) |