From 101e6ed3de2272bdc3b5d1fd17afbf5b0c5094fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Henrik=20Sk=C3=A5rstedt?= Date: Thu, 11 Feb 2021 17:34:46 +0100 Subject: [PATCH] fixed Kick Assembler Debugdata output with symbols relative to sections & section naming --- x65.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x65.cpp b/x65.cpp index 29b3f76..a7f3547 100644 --- a/x65.cpp +++ b/x65.cpp @@ -7023,10 +7023,13 @@ bool Asm::SourceDebugExport(strref filename) { if (i->name.same_str("debugbreak")) { continue; } uint32_t value = (uint32_t)i->value; strref sectName; - uint16_t section = i->orig_section; + int16_t section = i->section; + int16_t orig_section = i->orig_section; if (size_t(section) < allSections.size()) { value += allSections[section].start_address; - sectName = allSections[section].name; + } + if (size_t(orig_section) < allSections.size()) { + sectName = allSections[orig_section].name; } fprintf(f, "\t\t" STRREF_FMT ",$%04x," STRREF_FMT ",0,0,0,0,0\n", STRREF_ARG(sectName), value, STRREF_ARG(i->name)); }