diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2018-06-25 14:09:52 -0700 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2018-06-25 14:09:52 -0700 |
commit | 415b6b3df13c27afd71963e450d151fc9bb8ea40 (patch) | |
tree | 409c9e998e43352ac43201605212a901040da5d1 | |
parent | 6bc18f1978257dae185c5f64e2e85f06c806424a (diff) | |
download | nasm-415b6b3df13c27afd71963e450d151fc9bb8ea40.tar.gz |
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>
-rw-r--r-- | asm/directiv.c | 1 | ||||
-rw-r--r-- | asm/parser.c | 3 |
2 files changed, 3 insertions, 1 deletions
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); } } |