mirror of
https://github.com/open-simh/simtools.git
synced 2026-03-05 18:59:10 +00:00
Make sure that undefined global symbols don't get reduced to 0 when negated
Test case:
; test complex relocations
; .globl IE.ITS,IE.MON ; implicit
mov #-IE.ITS, space
space: .word IE.ITS ; the only simple relocation
.word -IE.ITS ; all others are complex relocations
.word ^C<IE.ITS>
.word IE.ITS + IE.MON
.word IE.ITS - IE.MON
.word IE.ITS * IE.MON
.word IE.ITS / IE.MON
.word IE.ITS & IE.MON
.word IE.ITS ! IE.MON
This commit is contained in:
4
extree.c
4
extree.c
@@ -352,7 +352,9 @@ EX_TREE *evaluate(
|
||||
/* negate literal */
|
||||
res = new_ex_lit((unsigned) -(int) tp->data.lit);
|
||||
free_tree(tp);
|
||||
} else if (tp->type == EX_SYM || tp->type == EX_TEMP_SYM) {
|
||||
} else if (tp->type == EX_TEMP_SYM ||
|
||||
(tp->type == EX_SYM &&
|
||||
(tp->data.symbol->flags & SYMBOLFLAG_DEFINITION))) {
|
||||
/* Make a temp sym with the negative value of the given
|
||||
sym (this works for symbols within relocatable sections
|
||||
too) */
|
||||
|
||||
Reference in New Issue
Block a user