mirror of
https://github.com/ksherlock/merlin-utils.git
synced 2024-06-02 08:41:33 +00:00
EXT support. 8/16+ added EXT as an operand to import an absolute linker value into the local symbol table.
This commit is contained in:
parent
637df6ee33
commit
57525d5464
12
link.cpp
12
link.cpp
|
@ -932,6 +932,18 @@ void evaluate(label_t label, opcode_t opcode, const char *cursor) {
|
||||||
define(label, number_operand(cursor, local_symbol_table), LBL_GEQ);
|
define(label, number_operand(cursor, local_symbol_table), LBL_GEQ);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case OP_EXT: {
|
||||||
|
/* no label is a no-op. */
|
||||||
|
if (label.empty()) break;
|
||||||
|
|
||||||
|
/* otherwise, it imports an absolute label into the local symbol table */
|
||||||
|
auto e = find_symbol(label, false);
|
||||||
|
if (!e || !e->absolute) throw std::runtime_error("Bad address");
|
||||||
|
define(label, e->value, LBL_EXT);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case OP_SEG: {
|
case OP_SEG: {
|
||||||
/* OMF object file linker - set the object file seg name */
|
/* OMF object file linker - set the object file seg name */
|
||||||
std::string name = label_operand(cursor);
|
std::string name = label_operand(cursor);
|
||||||
|
|
4
link.h
4
link.h
|
@ -36,6 +36,8 @@ c = command file
|
||||||
POS n y n
|
POS n y n
|
||||||
LEN n y n
|
LEN n y n
|
||||||
|
|
||||||
|
EXT n n y << imports from linker to command
|
||||||
|
|
||||||
*/
|
*/
|
||||||
enum {
|
enum {
|
||||||
LBL_EQU = (1 << 0),
|
LBL_EQU = (1 << 0),
|
||||||
|
@ -45,6 +47,8 @@ enum {
|
||||||
LBL_EQ = (1 << 2),
|
LBL_EQ = (1 << 2),
|
||||||
LBL_POS = (1 << 1),
|
LBL_POS = (1 << 1),
|
||||||
LBL_LEN = (1 << 1),
|
LBL_LEN = (1 << 1),
|
||||||
|
|
||||||
|
LBL_EXT = (1 << 2)
|
||||||
};
|
};
|
||||||
|
|
||||||
void process_script(const char *argv);
|
void process_script(const char *argv);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user