Skip to content

Commit

Permalink
fix Issue 13779 - gdb can't find frame base when using ld.gold
Browse files Browse the repository at this point in the history
- missing relocation addend .debug_info reference to .debug_loc
  • Loading branch information
MartinNowak committed Nov 27, 2014
1 parent 330cede commit 26fd7e3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/backend/dwarf.c
Expand Up @@ -1213,10 +1213,21 @@ void dwarf_func_term(Symbol *sfunc)
dwarf_appreladdr(infoseg, infobuf, seg, funcoffset);
dwarf_appreladdr(infoseg, infobuf, seg, funcoffset + sfunc->Ssize);

// DW_AT_frame_base
#if ELFOBJ
dwarf_addrel(infoseg,infobuf->size(),debug_loc_seg, 0);
if (I64)
{
dwarf_addrel(infoseg,infobuf->size(),debug_loc_seg, debug_loc_buf->size());
infobuf->write32(0);
}
else
{
dwarf_addrel(infoseg,infobuf->size(),debug_loc_seg, 0);
infobuf->write32(debug_loc_buf->size());
}
#else
infobuf->write32(debug_loc_buf->size());
#endif
infobuf->write32(debug_loc_buf->size()); // DW_AT_frame_base

if (haveparameters)
{
Expand Down

0 comments on commit 26fd7e3

Please sign in to comment.