summaryrefslogtreecommitdiff
path: root/libexec/ld.so
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-09-27 06:58:34 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-09-27 06:58:34 +0000
commitba6bb4fbd306beb75ac95a04e8e0547b26dc0c4c (patch)
treec54d041e8bbbba912208423db63e282756a6347c /libexec/ld.so
parent4f5cbdda2ec54772e18de5d99404fea696acbdf4 (diff)
Local symbols don't need to have a name. Don't barf on them.
They are often generated by gcc c++ exceptions.
Diffstat (limited to 'libexec/ld.so')
-rw-r--r--libexec/ld.so/sparc64/rtld_machine.c39
1 files changed, 30 insertions, 9 deletions
diff --git a/libexec/ld.so/sparc64/rtld_machine.c b/libexec/ld.so/sparc64/rtld_machine.c
index 00413f7aa2b..12b5b86d0e7 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.7 2001/09/26 14:57:56 art Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.8 2001/09/27 06:58:33 art Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -273,16 +273,37 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
sym += ELF_R_SYM(relas->r_info);
symn = object->dyn.strtab + sym->st_name;
- this = NULL;
- ooff = _dl_find_symbol(symn, _dl_objects, &this, 0, 1);
- if (this == NULL) {
+ if (sym->st_shndx != SHN_UNDEF &&
+ ELF_ST_BIND(sym->st_info) == STB_LOCAL) {
+ value += loff;
+ } else {
+ this = NULL;
+ ooff = _dl_find_symbol(symn, _dl_objects,
+ &this, 0, 1);
+ if (this == NULL) {
resolve_failed:
- _dl_printf("%s: %s :can't resolve reference '%s'\n",
- _dl_progname, object->load_name, symn);
- fails++;
- continue;
+ _dl_printf("%s: %s :can't resolve "
+ "reference '%s'\n",
+ _dl_progname, object->load_name,
+ symn);
+ fails++;
+ continue;
+ }
+#ifdef notyet
+/*
+ * XXX Hmm, we should change the API of _dl_find_symbol and do this in there,
+ * XXX or maybe make a wrapper.
+ */
+ if (this->st_size != sym->st_size &&
+ sym->st_size != 0) {
+ _dl_printf("%s: %s : WARNING: "
+ "symbol(%s) size mismatch ",
+ _dl_progname, object->load_name,
+ symn);
+ _dl_printf("relink your program\n");
+ }
+#endif
}
-
value += (Elf_Addr)(ooff + this->st_value);
}