summaryrefslogtreecommitdiff
path: root/sys/kern/link_elf_obj.c
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2002-10-15 05:40:07 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2002-10-15 05:40:07 +0000
commit47f750125bc4d739c12cac17e23ff2683c0469f2 (patch)
tree62b0f9ee69593eec2bec443afbb561961105257f /sys/kern/link_elf_obj.c
parent64fa510881ca568ff294cb06bbe09d77253fcde0 (diff)
Notes
Diffstat (limited to 'sys/kern/link_elf_obj.c')
-rw-r--r--sys/kern/link_elf_obj.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
index 83fbe17af215..a2ba84e339e7 100644
--- a/sys/kern/link_elf_obj.c
+++ b/sys/kern/link_elf_obj.c
@@ -1198,6 +1198,18 @@ elf_get_sym(linker_file_t lf, Elf_Word symidx)
return (ef->symtab + symidx);
}
+const char *
+elf_get_symname(linker_file_t lf, Elf_Word symidx)
+{
+ elf_file_t ef = (elf_file_t)lf;
+ const Elf_Sym *sym;
+
+ if (symidx >= ef->nchains)
+ return (NULL);
+ sym = ef->symtab + symidx;
+ return (ef->strtab + sym->st_name);
+}
+
/*
* Symbol lookup function that can be used when the symbol index is known (ie
* in relocations). It uses the symbol index instead of doing a fully fledged