From a441f0969b88ce3c15ef8e6a5d84aaf1eedf892a Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 1 Jan 2017 12:34:45 -0500 Subject: [PATCH] sec data support. --- dumpobj.cpp | 9 ++++++++- obj816.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dumpobj.cpp b/dumpobj.cpp index dbcac72..fd03e43 100644 --- a/dumpobj.cpp +++ b/dumpobj.cpp @@ -19,6 +19,12 @@ #define O_BINARY 0 #endif + +/* not documented */ +#ifndef SEC_DATA +#define SEC_DATA 0x80 +#endif + enum class endian { little = __ORDER_LITTLE_ENDIAN__, big = __ORDER_BIG_ENDIAN__, @@ -605,7 +611,7 @@ bool dump_obj(const char *name, int fd) section = sec; d.set_pc(sections[section].pc); labels = labels_for_section(symbols, section); - d.set_code(section == 1 || section > 4); + d.set_code((sections[sec].flags & SEC_DATA) == 0); } break; } @@ -671,6 +677,7 @@ bool dump_obj(const char *name, int fd) _(SEC_CONST); _(SEC_DIRECT); _(SEC_NONAME); + _(SEC_DATA); fputs("\n", stdout); } diff --git a/obj816.h b/obj816.h index 9a68454..c6969b7 100644 --- a/obj816.h +++ b/obj816.h @@ -126,6 +126,7 @@ enum { C_NULL, C_AUTO, C_EXT, C_STAT, C_REG, C_EXTDEF, C_ARG, #define SEC_CONST 0x0010 #define SEC_DIRECT 0x0020 #define SEC_NONAME 0x0040 +#define SEC_DATA 0x0080 /* pre-defined sections */ enum {SECT_PAGE0, SECT_CODE, SECT_KDATA, SECT_DATA, SECT_UDATA };