diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2002-08-23 22:57:04 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2002-08-23 22:57:04 +0000 |
commit | bfce6caf8080fa2d4f5024cab4059d709567fae4 (patch) | |
tree | 76cf0b5a29cb9439e94d9326ba53457e1dcb7f01 /libexec/ld.so/powerpc/rtld_machine.c | |
parent | 9958388d0a4d2166f3f7b1acfaae96e99f8843b7 (diff) |
Change arguments to _dl_find_symbol() myself, warnnotfound, and inplt into
a single flags field with bits representing each. Use defines to create
the appropriate masks.
Add a new argument sym_size to warn about symbols which have
the incorrect size. This replaces 'ifdef notyet' code which
was in several of the md files with a single version.
sym_size == 0 means do not check, and symbols of type FUNC are
not checked.
Diffstat (limited to 'libexec/ld.so/powerpc/rtld_machine.c')
-rw-r--r-- | libexec/ld.so/powerpc/rtld_machine.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/libexec/ld.so/powerpc/rtld_machine.c b/libexec/ld.so/powerpc/rtld_machine.c index 9ea6e483bf9..4efb4154f92 100644 --- a/libexec/ld.so/powerpc/rtld_machine.c +++ b/libexec/ld.so/powerpc/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.13 2002/08/11 16:51:04 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.14 2002/08/23 22:57:03 drahn Exp $ */ /* * Copyright (c) 1999 Dale Rahn @@ -139,7 +139,7 @@ _dl_printf("object relocation size %x, numrela %x\n", Elf32_Addr ooff; const Elf32_Sym *sym, *this; const char *symn; - int inplt; + int type; if (ELF32_R_SYM(relas->r_info) == 0xffffff) continue; @@ -148,14 +148,18 @@ _dl_printf("object relocation size %x, numrela %x\n", sym += ELF32_R_SYM(relas->r_info); this = sym; symn = object->dyn.strtab + sym->st_name; + type = ELF32_R_TYPE(relas->r_info); ooff = 0; if (ELF32_R_SYM(relas->r_info) && !(ELF32_ST_BIND(sym->st_info) == STB_LOCAL && ELF32_ST_TYPE (sym->st_info) == STT_NOTYPE)) { - inplt = (ELF32_R_TYPE(relas->r_info) == RELOC_JMP_SLOT); - ooff = _dl_find_symbol(symn, _dl_objects, &this, 0, 0, inplt); + ooff = _dl_find_symbol(symn, _dl_objects, &this, + SYM_SEARCH_ALL|SYM_NOWARNNOTFOUND| + ((type == RELOC_JMP_SLOT) ? SYM_PLT:SYM_NOTPLT), + sym->st_size); + if (!this && ELF32_ST_BIND(sym->st_info) == STB_GLOBAL) { _dl_printf("%s: %s :can't resolve reference '%s'\n", _dl_progname, object->load_name, symn); @@ -163,7 +167,7 @@ _dl_printf("object relocation size %x, numrela %x\n", } } - switch (ELF32_R_TYPE(relas->r_info)) { + switch (type) { #if 1 case RELOC_32: if (ELF32_ST_BIND(sym->st_info) == STB_LOCAL && @@ -358,7 +362,11 @@ _dl_dcbf(r_addr); if (object != cobj) { /* only look in this object */ src_loff = _dl_find_symbol(symn, cobj, - &cpysrc, 1, 1, 0); + &cpysrc, + SYM_SEARCH_SELF|SYM_NOWARNNOTFOUND| + ((type == RELOC_JMP_SLOT) ? + SYM_PLT : SYM_NOTPLT), + sym->st_size); } } if (cpysrc == NULL) { |