summaryrefslogtreecommitdiffstats
path: root/sys/sys/linker.h
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>2008-05-23 00:49:39 +0000
committerjb <jb@FreeBSD.org>2008-05-23 00:49:39 +0000
commit090fe643c2a0482ad0454a18acf9e5b54df003fc (patch)
tree60128931d1442975820875bbdc7c20456ce9f38e /sys/sys/linker.h
parent8c4eed9aad5a7911341733c7a8d074c9fd9e11f1 (diff)
downloadFreeBSD-src-090fe643c2a0482ad0454a18acf9e5b54df003fc.zip
FreeBSD-src-090fe643c2a0482ad0454a18acf9e5b54df003fc.tar.gz
Add hooks for the Compact C Type Format (CTF) data to be attached to
the elf files. This is complicated by the fact that the actual CTF parsing has to be done in CDDL'd code, so the BSD licensed code only knows about the opaque data which it must be able to free.
Diffstat (limited to 'sys/sys/linker.h')
-rw-r--r--sys/sys/linker.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/sys/linker.h b/sys/sys/linker.h
index 6655d46..4ba7a40 100644
--- a/sys/sys/linker.h
+++ b/sys/sys/linker.h
@@ -59,7 +59,7 @@ typedef struct linker_symval {
size_t size;
} linker_symval_t;
-typedef int (*linker_function_nameval_callback_t)(linker_file_t, linker_symval_t *, void *);
+typedef int (*linker_function_nameval_callback_t)(linker_file_t, int, linker_symval_t *, void *);
struct common_symbol {
STAILQ_ENTRY(common_symbol) link;
@@ -158,8 +158,8 @@ int linker_file_lookup_set(linker_file_t _file, const char *_name,
/*
* List all functions in a file.
*/
-int linker_file_function_listall(linker_file_t, int (*)(linker_file_t,
- linker_symval_t *, void *), void *);
+int linker_file_function_listall(linker_file_t,
+ linker_function_nameval_callback_t, void *);
/*
* Functions soley for use by the linker class handlers.
@@ -267,6 +267,20 @@ int elf_reloc_local(linker_file_t _lf, Elf_Addr base, const void *_rel, int _typ
const Elf_Sym *elf_get_sym(linker_file_t _lf, Elf_Size _symidx);
const char *elf_get_symname(linker_file_t _lf, Elf_Size _symidx);
+typedef struct linker_ctf {
+ const uint8_t *ctftab; /* Decompressed CTF data. */
+ int ctfcnt; /* Number of CTF data bytes. */
+ const Elf_Sym *symtab; /* Ptr to the symbol table. */
+ int nsym; /* Number of symbols. */
+ const char *strtab; /* Ptr to the string table. */
+ int strcnt; /* Number of string bytes. */
+ uint32_t **ctfoffp; /* Ptr to array of obj/fnc offsets. */
+ uint32_t **typoffp; /* Ptr to array of type offsets. */
+ long *typlenp; /* Ptr to number of type data entries. */
+} linker_ctf_t;
+
+int linker_ctf_get(linker_file_t, linker_ctf_t *);
+
int elf_cpu_load_file(linker_file_t);
int elf_cpu_unload_file(linker_file_t);
OpenPOWER on IntegriCloud