From 5d8e371ea30b544dfd2604a189c993aa742d5c22 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Fri, 6 Apr 2012 22:07:26 +0000 Subject: [PATCH] Relate functions to their offsets in executable objects as well --- src/format/elf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/format/elf.c b/src/format/elf.c index 6e70d59..0740595 100644 --- a/src/format/elf.c +++ b/src/format/elf.c @@ -540,7 +540,8 @@ static int _decode32_symtab(FormatPlugin * format, Elf32_Ehdr * ehdr, else if(ELF32_ST_TYPE(sym.st_info) == STT_FUNC) { offset = -1; - if(ehdr->e_type &= ET_REL) + if(ehdr->e_type == ET_REL || ehdr->e_type == ET_EXEC + || ehdr->e_type == ET_DYN) offset = sym.st_value; /* record the function */ helper->set_function(helper->format, i, @@ -739,7 +740,8 @@ static int _decode64_symtab(FormatPlugin * format, Elf64_Ehdr * ehdr, else if(ELF64_ST_TYPE(sym.st_info) == STT_FUNC) { offset = -1; - if(ehdr->e_type &= ET_REL) + if(ehdr->e_type == ET_REL || ehdr->e_type == ET_EXEC + || ehdr->e_type == ET_DYN) offset = sym.st_value; /* record the function */ helper->set_function(helper->format, i,