summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2017-05-01 15:32:37 -0700
committerH. Peter Anvin <hpa@zytor.com>2017-05-01 15:32:37 -0700
commit571592ea63dc6ffcd4b79a168bfb9f30f796e02b (patch)
treeb27c9390d23cc8a83115447dbc616b83c28d15f0
parent217e714e6bfae501cdceeb9ca13b9339502a4f0e (diff)
downloadnasm-571592ea63dc6ffcd4b79a168bfb9f30f796e02b.tar.gz
listing.c: show [ssss] for a segment instead of a bogus address
There is no point in showing a number of a relative segment, so just show [ssss]; even if there is a possible segment offset it is linker-dependent and output format dependent. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--asm/listing.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/asm/listing.c b/asm/listing.c
index bd717f68..05ef0012 100644
--- a/asm/listing.c
+++ b/asm/listing.c
@@ -222,9 +222,16 @@ static void list_output(const struct out_data *data)
break;
}
case OUT_ADDRESS:
- case OUT_SEGMENT:
- list_address(offset, "[]", data->toffset, size);
+ list_address(offset, "[]", data->toffset, size);
break;
+ case OUT_SEGMENT:
+ q[0] = '[';
+ memset(q+1, 's', size << 1);
+ q[(size << 1)+1] = ']';
+ q[(size << 1)+2] = '\0';
+ list_out(offset, q);
+ offset += size;
+ break;
case OUT_RELADDR:
list_address(offset, "()", data->toffset, size);
break;