aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2013-10-16 14:25:45 +0200
committerPetr Machata <pmachata@redhat.com>2013-10-23 01:00:03 +0200
commitb8f0d8b5859a7d69f6aed4904a87ac6a423285f6 (patch)
tree205b96f070af03c244f7a415315a06021c2c690c
parentc65c24a7e4645559a0fb050ff5a96ec248827562 (diff)
downloadltrace-b8f0d8b5859a7d69f6aed4904a87ac6a423285f6.tar.gz
Allow the prototype to be specified directly at the symbol
-rw-r--r--library.c1
-rw-r--r--library.h5
-rw-r--r--output.c3
3 files changed, 9 insertions, 0 deletions
diff --git a/library.c b/library.c
index 5405474..1f425e0 100644
--- a/library.c
+++ b/library.c
@@ -159,6 +159,7 @@ private_library_symbol_init(struct library_symbol *libsym,
libsym->latent = latent;
libsym->delayed = delayed;
libsym->enter_addr = (void *)(uintptr_t)addr;
+ libsym->proto = NULL;
}
static void
diff --git a/library.h b/library.h
index 01c7689..9b687b1 100644
--- a/library.h
+++ b/library.h
@@ -50,6 +50,11 @@ struct library_symbol {
const char *name;
arch_addr_t enter_addr;
enum toplt plt_type;
+
+ /* If this is non-NULL, this prototype is used instead of
+ * looking up one in LIB->protolib. */
+ struct prototype *proto;
+
int own_name : 1;
/* This is relevant for PLT symbols. Latent PLT symbols are
diff --git a/output.c b/output.c
index b2bb6dc..1778cd1 100644
--- a/output.c
+++ b/output.c
@@ -211,6 +211,9 @@ find_proto_cb(struct process *proc, struct library *lib, void *d)
static struct prototype *
lookup_symbol_prototype(struct process *proc, struct library_symbol *libsym)
{
+ if (libsym->proto != NULL)
+ return libsym->proto;
+
struct library *lib = libsym->lib;
if (lib != NULL) {
struct find_proto_data data = { libsym->name };