I tried using elftoolchain to parse the dwarf source line annotation
output of vanilla gcc 4.9.2 and it works just fine.  In contrast, as
stated below, parsing the output of the riscv-gcc 4.9.2 produces the
error below: "Line info section too short".  Clearly this is a problem
introduced by the riscv people.

However, objdump parses the dwarf source line output of both compilers
without complaint.  So if I report the bug to the riscv people at
Berkeley that their compiler produces output that objdump likes but
that elftoolchain will not parse, they can easily say that this is a
bug in elftoolchain.

I am basically blocked on this issue, so I am now in bug hell.  Any
assistance would be greatly appreciated.  Can elftoolchain be made a
bit more tolerant?  I will also write the riscv people.

On Mon, Feb 16, 2015 at 1:07 PM, Daniel Wilkerson
<daniel.wilker...@gmail.com> wrote:
> The RISC-V people at Berkeley have modified gcc 4.9.2 to target the
> RISC-V ISA.  I have been able to use elftoolchain to parse the output
> of previous versions of gcc which they have hacked, but not this one.
> When I try to get the dwarf source lines from ELF they produce, as
> follows:
>
> int const dwarf_src_res =
>       dwarf_srclines(root_die, &lines, &num_lines, &dwarf_error);
> . . .
> fprintf(stderr, "Dwarf_Source_Lines:"
>             "DW_DLE_NO_ENTRY:%d, DW_DLV_OK:%d, "
>             "dwarf_src_res: %d\n",
>             DW_DLE_NO_ENTRY, DW_DLV_OK, dwarf_src_res);
> . . .
> dwarf_errmsg(dwarf_error)
>
> I get a dwarf_src_res of 1:
> Dwarf_Source_Lines:DW_DLE_NO_ENTRY:4, DW_DLV_OK:0, dwarf_src_res: 1
>
> And this error message:
> Line info section too short [_dwarf_lineno_init(335)]
>
> However objdump reads and will output the source lines of the same ELF file.
>
> Is anyone else getting this result parsing the DWARF source lines
> coming from, say, unmodified gcc 4.9.2 ?
>
> Daniel

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Elftoolchain-developers mailing list
Elftoolchain-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/elftoolchain-developers

Reply via email to