[Ltrace-devel] [PATCH 03/11] Store the address and size of the ELF object's DYNAMIC section
Joe Damato
ice799 at gmail.com
Mon Nov 8 23:47:36 UTC 2010
---
ltrace-elf.c | 3 +++
ltrace-elf.h | 2 ++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/ltrace-elf.c b/ltrace-elf.c
index 4b0c0bf..858a313 100644
--- a/ltrace-elf.c
+++ b/ltrace-elf.c
@@ -142,6 +142,9 @@ do_init_elf(struct ltelf *lte, const char *filename) {
Elf_Data *data;
size_t j;
+ lte->dyn_addr = shdr.sh_addr;
+ lte->dyn_sz = shdr.sh_size;
+
data = elf_getdata(scn, NULL);
if (data == NULL || elf_getdata(scn, data) != NULL)
error(EXIT_FAILURE, 0,
diff --git a/ltrace-elf.h b/ltrace-elf.h
index 426f7b8..45db727 100644
--- a/ltrace-elf.h
+++ b/ltrace-elf.h
@@ -24,6 +24,8 @@ struct ltelf {
Elf32_Word *hash;
int hash_type;
int lte_flags;
+ GElf_Addr dyn_addr;
+ size_t dyn_sz;
#ifdef __mips__
size_t pltgot_addr;
size_t mips_local_gotno;
--
1.7.0.4
More information about the Ltrace-devel
mailing list