summaryrefslogtreecommitdiff
path: root/output/outdbg.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-11-26 18:09:56 -0800
committerH. Peter Anvin <hpa@zytor.com>2013-11-26 18:12:39 -0800
commitfd52c277dd6d768545cee39b154e706904581966 (patch)
tree57ffb4113bc8871ca3679ae765c92a1076efa297 /output/outdbg.c
parent80d18b55551e43f0c3e390550ecd396b90265fd3 (diff)
downloadnasm-fd52c277dd6d768545cee39b154e706904581966.tar.gz
output: Allow OUT_ADDRESS with a negative size to mean signed relocation
This only matters for ELF64/ELFx32, at least for now. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'output/outdbg.c')
-rw-r--r--output/outdbg.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/output/outdbg.c b/output/outdbg.c
index 2b750396..bf145585 100644
--- a/output/outdbg.c
+++ b/output/outdbg.c
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 1996-2009 The NASM Authors - All Rights Reserved
+ * Copyright 1996-2013 The NASM Authors - All Rights Reserved
* See the file AUTHORS included with the NASM distribution for
* the specific copyright holders.
*
@@ -127,7 +127,10 @@ static void dbg_out(int32_t segto, const void *data,
int32_t ldata;
int id;
- fprintf(ofile, "out to %"PRIx32", len = %"PRIu64": ", segto, size);
+ if (type == OUT_ADDRESS)
+ fprintf(ofile, "out to %"PRIx32", len = %d: ", segto, (int)size);
+ else
+ fprintf(ofile, "out to %"PRIx32", len = %"PRIu64": ", segto, size);
switch (type) {
case OUT_RESERVE:
@@ -144,8 +147,8 @@ static void dbg_out(int32_t segto, const void *data,
break;
case OUT_ADDRESS:
ldata = *(int64_t *)data;
- fprintf(ofile, "addr %08"PRIx32" (seg %08"PRIx32", wrt %08"PRIx32")\n", ldata,
- segment, wrt);
+ fprintf(ofile, "addr %08"PRIx32" (seg %08"PRIx32", wrt %08"PRIx32")\n",
+ ldata, segment, wrt);
break;
case OUT_REL1ADR:
fprintf(ofile, "rel1adr %02"PRIx8" (seg %08"PRIx32")\n",