From 62c0e8379c7619022f98331025ac7bb35660750a Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 7 Jul 2009 10:24:52 -0700 Subject: [PATCH] outdbg: fix OUT_REL*ADR, add OUT_REL8ADR The OUT_REL*ADR types pass a pointer which points to an int64_t which then should be truncated down to size. This matters on bigendian platforms. Add OUT_REL8ADR. Signed-off-by: H. Peter Anvin --- output/outdbg.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/output/outdbg.c b/output/outdbg.c index 84d558ea..676185f8 100644 --- a/output/outdbg.c +++ b/output/outdbg.c @@ -157,13 +157,18 @@ static void dbg_out(int32_t segto, const void *data, segment, wrt); break; case OUT_REL2ADR: - fprintf(dbgf, "rel2adr %04x (seg %08"PRIx32")\n", (int)*(int16_t *)data, - segment); + fprintf(dbgf, "rel2adr %04x (seg %08"PRIx32")\n", + (uint16_t)*(int64_t *)data, segment); break; case OUT_REL4ADR: - fprintf(dbgf, "rel4adr %08"PRIx32" (seg %08"PRIx32")\n", *(int32_t *)data, + fprintf(dbgf, "rel4adr %08"PRIx32" (seg %08"PRIx32")\n", + (uint32_t)*(int64_t *)data, segment); break; + case OUT_REL8ADR: + fprintf(dbgf, "rel8adr %016"PRIx64" (seg %08"PRIx32")\n", + (uint64_t)*(int64_t *)data, segment); + break; default: fprintf(dbgf, "unknown\n"); break; -- 2.11.4.GIT