diff --git a/translate.cxx b/translate.cxx index f792343..1874163 100644 --- a/translate.cxx +++ b/translate.cxx @@ -6845,8 +6845,10 @@ dump_unwindsym_cxt (Dwfl_Module *m, Dwarf_Addr dwbias = 0; dwfl_module_getdwarf (m, &dwbias); - c->output << ".sec_load_offset = 0x" - << hex << debug_frame_off - dwbias << dec << "\n"; + /* Note we use dec, not hex, in case host width > target width + and offset is negative. */ + c->output << ".sec_load_offset = " + << debug_frame_off - dwbias << "\n"; c->output << "#else\n"; c->output << ".debug_hdr = NULL,\n"; @@ -6865,8 +6867,10 @@ dump_unwindsym_cxt (Dwfl_Module *m, c->output << "#if defined(STP_NEED_LINE_DATA)\n"; Dwarf_Addr dwbias = 0; dwfl_module_getdwarf (m, &dwbias); - c->output << ".sec_load_offset = 0x" - << hex << debug_frame_off - dwbias << dec << "\n"; + /* Note we use dec, not hex, in case host width > target width + and offset is negative. */ + c->output << ".sec_load_offset = " + << debug_frame_off - dwbias << "\n"; c->output << "#else\n"; } c->output << ".sec_load_offset = 0\n";