diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2005-09-22 01:33:10 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2005-09-22 01:33:10 +0000 |
commit | 5b5ae816738dee5610782157ce0dddcfecc6d19f (patch) | |
tree | a9fe8e435c59ebe62fa71b2892416ed479b7ab34 /libexec/ld.so | |
parent | 4ca9b37d2d5d1992aeaf8ce55b7c5e06b2047220 (diff) |
Use std missing symbol print instead of MD custom, do not warn on weak
undefined symbols, or count them as failures. inspired kurt@
Diffstat (limited to 'libexec/ld.so')
-rw-r--r-- | libexec/ld.so/alpha/rtld_machine.c | 7 | ||||
-rw-r--r-- | libexec/ld.so/amd64/rtld_machine.c | 10 | ||||
-rw-r--r-- | libexec/ld.so/arm/rtld_machine.c | 10 | ||||
-rw-r--r-- | libexec/ld.so/hppa/rtld_machine.c | 11 | ||||
-rw-r--r-- | libexec/ld.so/i386/rtld_machine.c | 10 | ||||
-rw-r--r-- | libexec/ld.so/mips64/rtld_machine.c | 12 | ||||
-rw-r--r-- | libexec/ld.so/powerpc/rtld_machine.c | 19 | ||||
-rw-r--r-- | libexec/ld.so/resolve.c | 6 | ||||
-rw-r--r-- | libexec/ld.so/sparc/rtld_machine.c | 11 | ||||
-rw-r--r-- | libexec/ld.so/sparc64/rtld_machine.c | 10 |
10 files changed, 41 insertions, 65 deletions
diff --git a/libexec/ld.so/alpha/rtld_machine.c b/libexec/ld.so/alpha/rtld_machine.c index 53067ec4f08..c6bece14fdf 100644 --- a/libexec/ld.so/alpha/rtld_machine.c +++ b/libexec/ld.so/alpha/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.33 2005/09/21 23:12:09 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.34 2005/09/22 01:33:07 drahn Exp $ */ /* * Copyright (c) 1999 Dale Rahn @@ -148,9 +148,8 @@ _dl_printf("unaligned RELATIVE: %p type: %d %s 0x%lx -> 0x%lx\n", r_addr, } continue; resolve_failed: - _dl_printf("%s: %s :can't resolve reference '%s'\n", - _dl_progname, object->load_name, symn); - fails++; + if (ELF_ST_BIND(sym->st_info) != STB_WEAK) + fails++; } __asm __volatile("imb" : : : "memory"); diff --git a/libexec/ld.so/amd64/rtld_machine.c b/libexec/ld.so/amd64/rtld_machine.c index 9bd9826e683..f6cefd666ec 100644 --- a/libexec/ld.so/amd64/rtld_machine.c +++ b/libexec/ld.so/amd64/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.9 2005/09/21 23:12:09 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.10 2005/09/22 01:33:08 drahn Exp $ */ /* * Copyright (c) 2002,2004 Dale Rahn @@ -241,11 +241,9 @@ _dl_md_reloc(elf_object_t *object, int rel, int relsz) sym, NULL); if (this == NULL) { resolve_failed: - _dl_printf("%s: %s: can't resolve " - "reference '%s'\n", - _dl_progname, object->load_name, - symn); - fails++; + if (ELF_ST_BIND(sym->st_info) != + STB_WEAK) + fails++; continue; } value += (Elf_Addr)(ooff + this->st_value); diff --git a/libexec/ld.so/arm/rtld_machine.c b/libexec/ld.so/arm/rtld_machine.c index b02306f7e2f..7524a6a5e6e 100644 --- a/libexec/ld.so/arm/rtld_machine.c +++ b/libexec/ld.so/arm/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.8 2005/09/21 23:12:10 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.9 2005/09/22 01:33:08 drahn Exp $ */ /* * Copyright (c) 2004 Dale Rahn @@ -242,11 +242,9 @@ _dl_md_reloc(elf_object_t *object, int rel, int relsz) sym, NULL); if (this == NULL) { resolve_failed: - _dl_printf("%s: %s: can't resolve " - "reference '%s'\n", - _dl_progname, object->load_name, - symn); - fails++; + if (ELF_ST_BIND(sym->st_info) != + STB_WEAK) + fails++; continue; } value += (Elf_Addr)(ooff + this->st_value); diff --git a/libexec/ld.so/hppa/rtld_machine.c b/libexec/ld.so/hppa/rtld_machine.c index da5602f748a..330a8440252 100644 --- a/libexec/ld.so/hppa/rtld_machine.c +++ b/libexec/ld.so/hppa/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.9 2005/09/21 23:12:10 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.10 2005/09/22 01:33:08 drahn Exp $ */ /* * Copyright (c) 2004 Michael Shalayeff @@ -162,13 +162,12 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz) if (ELF_R_SYM(rela->r_info) && sym->st_name) { ooff = _dl_find_symbol_bysym(object, ELF_R_SYM(rela->r_info), &this, - SYM_SEARCH_ALL|SYM_NOWARNNOTFOUND| + SYM_SEARCH_ALL|SYM_WARNNOTFOUND| ((type == RELOC_DIR32) ? SYM_NOTPLT : SYM_PLT), sym, &sobj); - if (!this) { - _dl_printf("%s: %s: can't resolve reference '%s'\n", - _dl_progname, object->load_name, symn); - fails++; + if (this == NULL) { + if (ELF_ST_BIND(sym->st_info) != STB_WEAK) + fails++; continue; } } diff --git a/libexec/ld.so/i386/rtld_machine.c b/libexec/ld.so/i386/rtld_machine.c index d6b9c188868..6b953bf9f1b 100644 --- a/libexec/ld.so/i386/rtld_machine.c +++ b/libexec/ld.so/i386/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.18 2005/09/21 23:12:10 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.19 2005/09/22 01:33:08 drahn Exp $ */ /* * Copyright (c) 2002 Dale Rahn @@ -234,11 +234,9 @@ _dl_md_reloc(elf_object_t *object, int rel, int relsz) sym, NULL); if (this == NULL) { resolve_failed: - _dl_printf("%s: %s: can't resolve " - "reference '%s'\n", - _dl_progname, object->load_name, - symn); - fails++; + if (ELF_ST_BIND(sym->st_info) != + STB_WEAK) + fails++; continue; } value += (Elf_Addr)(ooff + this->st_value); diff --git a/libexec/ld.so/mips64/rtld_machine.c b/libexec/ld.so/mips64/rtld_machine.c index 30acba90d3d..91e8e52a41b 100644 --- a/libexec/ld.so/mips64/rtld_machine.c +++ b/libexec/ld.so/mips64/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.7 2005/09/21 23:12:10 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.8 2005/09/22 01:33:08 drahn Exp $ */ /* * Copyright (c) 1998-2004 Opsycon AB, Sweden. @@ -104,18 +104,12 @@ _dl_md_reloc(elf_object_t *object, int rel, int relsz) !(ELF64_ST_BIND(sym->st_info) == STB_LOCAL && ELF64_ST_TYPE (sym->st_info) == STT_NOTYPE)) { ooff = _dl_find_symbol(symn, &this, - SYM_SEARCH_ALL | SYM_NOWARNNOTFOUND | SYM_PLT, + SYM_SEARCH_ALL | SYM_WARNNOTFOUND | SYM_PLT, sym, object, NULL); if (this == NULL) { - if (ELF32_ST_BIND(sym->st_info) == STB_GLOBAL) { - _dl_printf("%s: %s :can't resolve " - "reference '%s'\n", - _dl_progname, object->load_name, - symn); - + if (ELF_ST_BIND(sym->st_info) != STB_WEAK) fails++; - } continue; } } diff --git a/libexec/ld.so/powerpc/rtld_machine.c b/libexec/ld.so/powerpc/rtld_machine.c index edb3dd1aa56..368414a82e1 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.37 2005/09/21 23:12:11 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.38 2005/09/22 01:33:08 drahn Exp $ */ /* * Copyright (c) 1999 Dale Rahn @@ -199,14 +199,8 @@ _dl_printf("object relocation size %x, numrela %x\n", sym, NULL); if (this == NULL) { - if (ELF32_ST_BIND(sym->st_info) == STB_GLOBAL) { - _dl_printf("%s: %s :can't resolve " - "reference '%s'\n", - _dl_progname, object->load_name, - symn); - + if (ELF_ST_BIND(sym->st_info) != STB_WEAK) fails++; - } continue; } } @@ -384,11 +378,9 @@ _dl_printf(" symn [%s] val 0x%x\n", symn, val); src_loff = 0; src_loff = _dl_find_symbol(symn, &cpysrc, - SYM_SEARCH_OTHER|SYM_NOWARNNOTFOUND| SYM_NOTPLT, + SYM_SEARCH_OTHER|SYM_WARNNOTFOUND| SYM_NOTPLT, sym, object, NULL); - if (cpysrc == NULL) { - _dl_printf("symbol not found [%s] \n", symn); - } else { + if(cpysrc != NULL) { size = sym->st_size; if (sym->st_size != cpysrc->st_size) { _dl_printf("symbols size differ [%s] \n", @@ -403,7 +395,8 @@ _dl_printf(" found other symbol at %x size %d\n", _dl_bcopy((void *)(src_loff + cpysrc->st_value), (void *)(ooff + this->st_value+ relas->r_addend), size); - } + } else + fails++; } break; case RELOC_NONE: diff --git a/libexec/ld.so/resolve.c b/libexec/ld.so/resolve.c index 1a39efab9b0..0ad4bbd5faa 100644 --- a/libexec/ld.so/resolve.c +++ b/libexec/ld.so/resolve.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolve.c,v 1.32 2005/09/21 23:12:09 drahn Exp $ */ +/* $OpenBSD: resolve.c,v 1.33 2005/09/22 01:33:07 drahn Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -358,7 +358,9 @@ found: if (found == 0) { - if (flags & SYM_WARNNOTFOUND) + if ((ref_sym == NULL || + (ELF_ST_BIND(ref_sym->st_info) != STB_WEAK)) && + (flags & SYM_WARNNOTFOUND)) _dl_printf("%s:%s: undefined symbol '%s'\n", _dl_progname, req_obj->load_name, name); return (0); diff --git a/libexec/ld.so/sparc/rtld_machine.c b/libexec/ld.so/sparc/rtld_machine.c index 9e41e4aa401..541d5840e01 100644 --- a/libexec/ld.so/sparc/rtld_machine.c +++ b/libexec/ld.so/sparc/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.25 2005/09/21 23:12:11 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.26 2005/09/22 01:33:08 drahn Exp $ */ /* * Copyright (c) 1999 Dale Rahn @@ -248,12 +248,9 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz) sym, NULL); if (this == NULL) { resolve_failed: - _dl_printf("%s: %s: can't resolve " - "reference '%s'\n", - _dl_progname, - object->load_name, - symn); - fails++; + if (ELF_ST_BIND(sym->st_info) != + STB_WEAK) + fails++; continue; } value += (Elf_Addr)(ooff + this->st_value); diff --git a/libexec/ld.so/sparc64/rtld_machine.c b/libexec/ld.so/sparc64/rtld_machine.c index 78b6db69b64..9d0e03db27b 100644 --- a/libexec/ld.so/sparc64/rtld_machine.c +++ b/libexec/ld.so/sparc64/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.36 2005/09/21 23:12:11 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.37 2005/09/22 01:33:09 drahn Exp $ */ /* * Copyright (c) 1999 Dale Rahn @@ -269,11 +269,9 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz) sym, NULL); if (this == NULL) { resolve_failed: - _dl_printf("%s: %s: can't resolve " - "reference '%s'\n", - _dl_progname, object->load_name, - symn); - fails++; + if (ELF_ST_BIND(sym->st_info) != + STB_WEAK) + fails++; continue; } value += (Elf_Addr)(ooff + this->st_value); |