absolute: in absolute space, need to use absolute.segment

We can be in absolute space and still end up with segment-relative
references.  This is in fact the meaning of absolute.segment.  Make
sure we define the labels appropriately.

Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin (Intel) 2018-06-25 14:09:52 -07:00
parent 6bc18f1978
commit 415b6b3df1
2 changed files with 3 additions and 1 deletions

View File

@ -399,6 +399,7 @@ bool process_directives(char *directive)
"in pass two");
in_absolute = true;
location.segment = NO_SEG;
location.offset = absolute.offset;
break;
}

View File

@ -486,7 +486,8 @@ restart_parse:
* Generally fix things. I think this is right as it is, but
* am still not certain.
*/
define_label(result->label, location.segment,
define_label(result->label,
in_absolute ? absolute.segment : location.segment,
location.offset, true);
}
}