From 415b6b3df13c27afd71963e450d151fc9bb8ea40 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Mon, 25 Jun 2018 14:09:52 -0700 Subject: 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 Signed-off-by: H. Peter Anvin (Intel) --- asm/directiv.c | 1 + asm/parser.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/asm/directiv.c b/asm/directiv.c index 68a74a12..89750c8c 100644 --- a/asm/directiv.c +++ b/asm/directiv.c @@ -399,6 +399,7 @@ bool process_directives(char *directive) "in pass two"); in_absolute = true; location.segment = NO_SEG; + location.offset = absolute.offset; break; } diff --git a/asm/parser.c b/asm/parser.c index 40188410..64d7a024 100644 --- a/asm/parser.c +++ b/asm/parser.c @@ -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); } } -- cgit v1.2.1