summaryrefslogtreecommitdiff
path: root/src/format
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-11-26 23:30:01 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-11-26 23:30:01 (GMT)
commit6b1a70c16f83a926f7b1f1fb2af5d6a2e017737b (patch)
tree8ffb0b3d8f3063c612f8cebe4f00a65f8b029a52 /src/format
parenta93a5dca1a7292b7e61ae09b74f3252e04b73488 (diff)
Used several threads without lock to disassemble binary code.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@610 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format')
-rw-r--r--src/format/elf/elf.c6
-rw-r--r--src/format/symbol.h4
2 files changed, 10 insertions, 0 deletions
diff --git a/src/format/elf/elf.c b/src/format/elf/elf.c
index ea520b9..3dc5d64 100644
--- a/src/format/elf/elf.c
+++ b/src/format/elf/elf.c
@@ -432,6 +432,12 @@ static void g_elf_format_refine_portions(const GElfFormat *format, GBinPortion *
sh_flags = ELF_SHDR(format, section, sh_flags);
+ printf("[section % 2hu] 0x%08x -> %x -> %d\n", i, sh_flags,
+ sh_flags & SHF_ALLOC, (sh_flags & SHF_ALLOC) == 0);
+
+ if ((sh_flags & SHF_ALLOC) == 0)
+ continue;
+
if (sh_flags & SHF_EXECINSTR) background = BPC_CODE;
else if (sh_flags & SHF_WRITE) background = BPC_DATA;
else background = BPC_DATA_RO;
diff --git a/src/format/symbol.h b/src/format/symbol.h
index 1368691..6f38020 100644
--- a/src/format/symbol.h
+++ b/src/format/symbol.h
@@ -51,6 +51,10 @@ typedef enum _SymbolType
} SymbolType;
+#define HAS_DATA_INSTR(type) (type == STP_DATA || type == STP_RO_STRING)
+
+
+
#define G_TYPE_BIN_SYMBOL g_binary_symbol_get_type()
#define G_BIN_SYMBOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_binary_symbol_get_type(), GBinSymbol))
#define G_IS_BIN_SYMBOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_binary_symbol_get_type()))