summaryrefslogtreecommitdiff
path: root/libbsd
diff options
context:
space:
mode:
authorPeng Fan <van.freenix@gmail.com>2013-09-05 13:05:17 +0800
committerPeng Fan <van.freenix@gmail.com>2013-09-05 13:47:39 +0800
commita48d508e21d4baa3e7c395218a3bce5ad2359d96 (patch)
tree1c23d06a17c09fe5db4f9d1d82ff6a6694ae3ad9 /libbsd
parent65096e5cf330be0eaed449c5ec44afb50225e41f (diff)
file details and debug support
This patch contains the file details part and linkmap support. In order to save space, the linkmap part and file details part are merged into one implementation. Both use the same pointer, obj->detail. Signed-off-by: Peng Fan <van.freenix@gmail.com>
Diffstat (limited to 'libbsd')
-rw-r--r--libbsd/include/link_elf.h50
1 files changed, 35 insertions, 15 deletions
diff --git a/libbsd/include/link_elf.h b/libbsd/include/link_elf.h
index 7236b5d..679d8e1 100644
--- a/libbsd/include/link_elf.h
+++ b/libbsd/include/link_elf.h
@@ -10,26 +10,46 @@
#include <sys/types.h>
#include <machine/elf_machdep.h>
+#include <stdint.h>
-typedef struct link_map {
- caddr_t l_addr; /* Base Address of library */
-#ifdef __mips__
- caddr_t l_offs; /* Load Offset of library */
-#endif
- const char *l_name; /* Absolute Path to Library */
- void *l_ld; /* Pointer to .dynamic in memory */
- struct link_map *l_next; /* linked list of of mapped libs */
- struct link_map *l_prev;
-} Link_map;
+enum sections
+{
+ rap_text = 0,
+ rap_const = 1,
+ rap_ctor = 2,
+ rap_dtor = 3,
+ rap_data = 4,
+ rap_bss = 5,
+ rap_secs = 6
+};
+
+/**
+ * Object details.
+ */
+typedef struct
+{
+ char* name;
+ uint32_t offset;
+ uint32_t size;
+ uint32_t rap_id;
+}section_detail;
+
+struct link_map {
+ char* name; /**< Name of the obj. */
+ uint32_t sec_num; /**< The count of section. */
+ section_detail* sec_detail; /**< The section details. */
+ uint32_t* sec_addr[rap_secs]; /**< The RAP section addr. */
+ struct link_map* l_next; /**< Linked list of mapped libs. */
+ struct link_map* l_prev;
+};
struct r_debug {
- int r_version; /* not used */
+ int r_version; /* not used */
struct link_map *r_map; /* list of loaded images */
- void (*r_brk)(void); /* pointer to break point */
enum {
- RT_CONSISTENT, /* things are stable */
- RT_ADD, /* adding a shared library */
- RT_DELETE /* removing a shared library */
+ RT_CONSISTENT, /* things are stable */
+ RT_ADD, /* adding a shared library */
+ RT_DELETE /* removing a shared library */
} r_state;
};