PERFORCE change 135753 for review
John Birrell
jb at FreeBSD.org
Tue Feb 19 23:11:48 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=135753
Change 135753 by jb at jb_freebsd1 on 2008/02/19 23:11:34
Add a linker_ctf structure to pass all the CTF stuff back in.
Affected files ...
.. //depot/projects/dtrace/src/sys/kern/kern_linker.c#30 edit
.. //depot/projects/dtrace/src/sys/kern/linker_if.m#8 edit
.. //depot/projects/dtrace/src/sys/sys/linker.h#20 edit
Differences ...
==== //depot/projects/dtrace/src/sys/kern/kern_linker.c#30 (text+ko) ====
@@ -648,9 +648,9 @@
}
int
-linker_ctf_get(linker_file_t file, const uint8_t **data, int *len)
+linker_ctf_get(linker_file_t file, linker_ctf_t *lc)
{
- return (LINKER_CTF_GET(file, data, len));
+ return (LINKER_CTF_GET(file, lc));
}
static int
@@ -701,7 +701,7 @@
*/
int
linker_file_function_listall(linker_file_t lf,
- int (*callback_func)(linker_file_t, linker_symval_t *, void *), void *arg)
+ linker_function_nameval_callback_t callback_func, void *arg)
{
return (LINKER_EACH_FUNCTION_NAMEVAL(lf, callback_func, arg));
}
==== //depot/projects/dtrace/src/sys/kern/linker_if.m#8 (text+ko) ====
@@ -97,12 +97,11 @@
#
# Load CTF data if necessary and if there is a .SUNW_ctf section
-# in the ELF file, returning a pointer to the data and the length.
+# in the ELF file, returning info in the linker CTF structure.
#
METHOD int ctf_get {
linker_file_t file;
- const uint8_t **data;
- int *len;
+ linker_ctf_t *lc;
};
#
==== //depot/projects/dtrace/src/sys/sys/linker.h#20 (text+ko) ====
@@ -59,7 +59,7 @@
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 @@
/*
* 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.
@@ -266,7 +266,20 @@
int elf_reloc_local(linker_file_t _lf, Elf_Addr base, const void *_rel, int _type, elf_lookup_fn _lu);
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);
-int linker_ctf_get(linker_file_t, const uint8_t **, int *);
+
+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);
More information about the p4-projects
mailing list