PERFORCE change 132612 for review
John Birrell
jb at FreeBSD.org
Sat Jan 5 22:56:32 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=132612
Change 132612 by jb at jb_freebsd1 on 2008/01/06 06:56:14
Add functions back again after they got walloped ages ago during
an integration from a tree with different parentage.
Affected files ...
.. //depot/projects/dtrace/src/sys/kern/link_elf.c#13 edit
.. //depot/projects/dtrace/src/sys/kern/link_elf_obj.c#10 edit
Differences ...
==== //depot/projects/dtrace/src/sys/kern/link_elf.c#13 (text+ko) ====
@@ -121,6 +121,9 @@
static int link_elf_each_function_name(linker_file_t,
int (*)(const char *, void *),
void *);
+static int link_elf_each_function_nameval(linker_file_t,
+ int (*)(linker_file_t, linker_symval_t*, void *),
+ void *);
static void link_elf_reloc_local(linker_file_t);
static Elf_Addr elf_lookup(linker_file_t lf, Elf_Size symidx, int deps);
@@ -134,6 +137,7 @@
KOBJMETHOD(linker_link_preload_finish, link_elf_link_preload_finish),
KOBJMETHOD(linker_lookup_set, link_elf_lookup_set),
KOBJMETHOD(linker_each_function_name, link_elf_each_function_name),
+ KOBJMETHOD(linker_each_function_nameval, link_elf_each_function_nameval),
{ 0, 0 }
};
@@ -1222,6 +1226,30 @@
return (0);
}
+static int
+link_elf_each_function_nameval(linker_file_t file,
+ int (*callback)(linker_file_t, linker_symval_t *, void *), void *opaque)
+{
+ linker_symval_t symval;
+ elf_file_t ef = (elf_file_t)file;
+ const Elf_Sym* symp;
+ int i, error;
+
+ /* Exhaustive search */
+ for (i = 0, symp = ef->ddbsymtab; i < ef->ddbsymcnt; i++, symp++) {
+ if (symp->st_value != 0 &&
+ ELF_ST_TYPE(symp->st_info) == STT_FUNC) {
+ error = link_elf_symbol_values(file, (c_linker_sym_t) symp, &symval);
+ if (error)
+ return (error);
+ error = callback(file, &symval, opaque);
+ if (error)
+ return (error);
+ }
+ }
+ return (0);
+}
+
#ifdef __ia64__
/*
* Each KLD has its own GP. The GP value for each load module is given by
==== //depot/projects/dtrace/src/sys/kern/link_elf_obj.c#10 (text+ko) ====
@@ -124,6 +124,9 @@
void ***, void ***, int *);
static int link_elf_each_function_name(linker_file_t,
int (*)(const char *, void *), void *);
+static int link_elf_each_function_nameval(linker_file_t,
+ int (*)(linker_file_t, linker_symval_t*, void *),
+ void *);
static void link_elf_reloc_local(linker_file_t);
static Elf_Addr elf_obj_lookup(linker_file_t lf, Elf_Size symidx, int deps);
@@ -138,6 +141,7 @@
KOBJMETHOD(linker_link_preload_finish, link_elf_link_preload_finish),
KOBJMETHOD(linker_lookup_set, link_elf_lookup_set),
KOBJMETHOD(linker_each_function_name, link_elf_each_function_name),
+ KOBJMETHOD(linker_each_function_nameval, link_elf_each_function_nameval),
{ 0, 0 }
};
@@ -1064,6 +1068,30 @@
return (0);
}
+static int
+link_elf_each_function_nameval(linker_file_t file,
+ int (*callback)(linker_file_t, linker_symval_t *, void *), void *opaque)
+{
+ linker_symval_t symval;
+ elf_file_t ef = (elf_file_t)file;
+ const Elf_Sym* symp;
+ int i, error;
+
+ /* Exhaustive search */
+ for (i = 0, symp = ef->ddbsymtab; i < ef->ddbsymcnt; i++, symp++) {
+ if (symp->st_value != 0 &&
+ ELF_ST_TYPE(symp->st_info) == STT_FUNC) {
+ error = link_elf_symbol_values(file, (c_linker_sym_t) symp, &symval);
+ if (error)
+ return (error);
+ error = callback(file, &symval, opaque);
+ if (error)
+ return (error);
+ }
+ }
+ return (0);
+}
+
/*
* 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
More information about the p4-projects
mailing list