aboutsummaryrefslogtreecommitdiff
path: root/library.h
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-04-03 02:30:48 +0200
committerPetr Machata <pmachata@redhat.com>2012-04-19 01:35:45 +0200
commit89ac0395a9e018f4d4dbda9d3e27159419a92da2 (patch)
tree9ba702ad7e5cc5bf3a613e959d378f62350a485a /library.h
parent3fd099b71ae9e0c4fe9f48a239523e7037e4baf4 (diff)
downloadltrace-89ac0395a9e018f4d4dbda9d3e27159419a92da2.tar.gz
Differentiate fresh libraries from old by "key", not by base address
- that because base is unknown at the time that library is mapped in, only bias is known. We'd have to read the elf file to determine whether this is the right library or not. Instead we assume that the dynamic linker keeps linked list, and use address of internal structure as the key
Diffstat (limited to 'library.h')
-rw-r--r--library.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/library.h b/library.h
index a517666..befd344 100644
--- a/library.h
+++ b/library.h
@@ -87,6 +87,10 @@ enum callback_status library_symbol_equal_cb(struct library_symbol *libsym,
struct library {
struct library *next;
+ /* Unique key. Two library objects are considered equal, if
+ * they have the same key. */
+ target_address_t key;
+
/* Address where the library is mapped. Two library objects
* are considered equal, if they have the same base. */
target_address_t base;
@@ -149,10 +153,10 @@ enum callback_status library_named_cb(struct Process *proc,
/* A function that can be used as proc_each_library callback. Looks
* for a library with given base.
*
- * NOTE: The base is passed as a POINTER to target_address_t (that
- * because in general, target_address_t doesn't fit in void*). */
-enum callback_status library_with_base_cb(struct Process *proc,
- struct library *lib, void *basep);
+ * NOTE: The key is passed as a POINTER to target_address_t (that
+ * because in general, target_address_t doesn't fit in void*). */
+enum callback_status library_with_key_cb(struct Process *proc,
+ struct library *lib, void *keyp);
/* XXX this should really be in backend.h (as on pmachata/revamp
* branch), or, on this branch, in common.h. But we need