Add a function to list symbols in a file and their values at the
same time rather than having to list the symbols and then go back and look each one up by name.
This commit is contained in:
parent
804a2cd238
commit
9bd9c03e92
@ -690,6 +690,16 @@ linker_file_lookup_set(linker_file_t file, const char *name,
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* List all functions in a file.
|
||||
*/
|
||||
int
|
||||
linker_file_function_listall(linker_file_t lf,
|
||||
int (*callback_func)(linker_file_t, linker_symval_t *, void *), void *arg)
|
||||
{
|
||||
return (LINKER_EACH_FUNCTION_NAMEVAL(lf, callback_func, arg));
|
||||
}
|
||||
|
||||
caddr_t
|
||||
linker_file_lookup_symbol(linker_file_t file, const char *name, int deps)
|
||||
{
|
||||
|
@ -63,6 +63,17 @@ METHOD int each_function_name {
|
||||
void* opaque;
|
||||
};
|
||||
|
||||
#
|
||||
# Call the callback with each specified function and it's value
|
||||
# defined in the file.
|
||||
# Stop and return the error if the callback returns an error.
|
||||
#
|
||||
METHOD int each_function_nameval {
|
||||
linker_file_t file;
|
||||
linker_function_nameval_callback_t callback;
|
||||
void* opaque;
|
||||
};
|
||||
|
||||
#
|
||||
# Search for a linker set in a file. Return a pointer to the first
|
||||
# entry (which is itself a pointer), and the number of entries.
|
||||
|
@ -59,6 +59,8 @@ typedef struct linker_symval {
|
||||
size_t size;
|
||||
} linker_symval_t;
|
||||
|
||||
typedef int (*linker_function_nameval_callback_t)(linker_file_t, linker_symval_t *, void *);
|
||||
|
||||
struct common_symbol {
|
||||
STAILQ_ENTRY(common_symbol) link;
|
||||
char* name;
|
||||
@ -153,6 +155,12 @@ caddr_t linker_file_lookup_symbol(linker_file_t _file, const char* _name,
|
||||
int linker_file_lookup_set(linker_file_t _file, const char *_name,
|
||||
void *_start, void *_stop, int *_count);
|
||||
|
||||
/*
|
||||
* List all functions in a file.
|
||||
*/
|
||||
int linker_file_function_listall(linker_file_t, int (*)(linker_file_t,
|
||||
linker_symval_t *, void *), void *);
|
||||
|
||||
/*
|
||||
* Functions soley for use by the linker class handlers.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user