summaryrefslogtreecommitdiffstats
path: root/sys/kern/link_elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r--sys/kern/link_elf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index 9980005..ea4f0dd 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -1188,6 +1188,16 @@ link_elf_get_gp(linker_file_t lf)
}
#endif
+const Elf_Sym *
+elf_get_sym(linker_file_t lf, Elf_Word symidx)
+{
+ elf_file_t ef = (elf_file_t)lf;
+
+ if (symidx >= ef->nchains)
+ return (NULL);
+ return (ef->symtab + symidx);
+}
+
/*
* 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
OpenPOWER on IntegriCloud