sec data support.

This commit is contained in:
Kelvin Sherlock 2017-01-01 12:34:45 -05:00
parent 39dbe71e73
commit a441f0969b
2 changed files with 9 additions and 1 deletions

View File

@ -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);
}

View File

@ -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 };