This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
forcing to emit absolute addresses in the .debug_loc setion
- From: Umesh Kalappa <umesh dot kalappa0 at gmail dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: binutils at sourceware dot org
- Date: Fri, 30 Jan 2015 12:55:52 +0530
- Subject: forcing to emit absolute addresses in the .debug_loc setion
- Authentication-results: sourceware.org; auth=none
Hi Guys,
Myself was very new to dwarf debugging format and recently we migrate
GCC compiler to 4.8.3 toolchain from 4.5.2 ans using same binutils
2.23.51.
we are seeing the weird issue with .debug_loc entries and assembler
pop up with below error
/tmp/ccUj1tbg.s: Assembler messages:
/tmp/ccUj1tbg.s:778: Error: can't resolve `.LVL0' {.text section} -
`.text._ZN10__cxxabiv117__array_type_infoD2Ev' {*UND* section}
/tmp/ccUj1tbg.s:779: Error: can't resolve `.LVL1' {.text section} -
`.text._ZN10__cxxabiv117__array_type_infoD2Ev' {*UND* section}
/tmp/ccUj1tbg.s:782: Error: can't resolve `.LVL1' {.text section} -
`.text._ZN10__cxxabiv117__array_type_infoD2Ev' {*UND* section}
corresponding .debug_loc entries
.section .debug_loc,info
.Ldebug_loc0:
.LLST0:
.4byte .LVL0-.text._ZN10__cxxabiv117__array_type_infoD2Ev
.4byte .LVL1-1-.text._ZN10__cxxabiv117__array_type_infoD2Ev
.2byte 0x1
.byte 0x54
.4byte .LVL1-1-.text._ZN10__cxxabiv117__array_type_infoD2Ev
.4byte .LFE72-.text._ZN10__cxxabiv117__array_type_infoD2Ev
.2byte 0x4
.byte 0xf3
.uleb128 0x1
.byte 0x54
.byte 0x9f
.4byte 0
.4byte 0
googling on the above issue was with no luck :( ,after going through
the dwarf format it was found that ,the above .debug_loc entries are
relatively not absloute,please correct me here if my assumption was
wrong and we need to stick to dwarf-2 format not to like 3,4, or 5 .
second,was tweaked/forced the compiler to generate abs address like
static void
output_loc_list (dw_loc_list_ref list_head)
{
else if (/*!have_multiple_function_sections*/0) //our hacked thing
and weird too
{
dw2_asm_output_delta (DWARF2_ADDR_SIZE, curr->begin, curr->section,
"Location list begin address (%s)",
list_head->ll_symbol);
dw2_asm_output_delta (DWARF2_ADDR_SIZE, curr->end, curr->section,
"Location list end address (%s)",
list_head->ll_symbol);
}
else
{
dw2_asm_output_addr (DWARF2_ADDR_SIZE, curr->begin,
"Location list begin address (%s)",
list_head->ll_symbol);
dw2_asm_output_addr (DWARF2_ADDR_SIZE, curr->end,
"Location list end address (%s)",
list_head->ll_symbol);
}
}
now the .debug_loc section looks like
.section .debug_loc,info
.Ldebug_loc0:
.LLST0:
.4byte .LVL0
.4byte .LVL1-1
.2byte 0x1
.byte 0x54
.4byte .LVL1-1
.4byte .LFE72
.2byte 0x4
.byte 0xf3
.uleb128 0x1
.byte 0x54
.byte 0x9f
.4byte 0
.4byte 0
now everything goes well,But we are looking the cause and proper fix too.
So please guys, pass us your insights / suggestion / comments on this.
Thank you
~Umesh