This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] libdw: Return an error in dwarf_getlocation_attr for missing .debug_addr.
- From: Mark Wielaard <mark at klomp dot org>
- To: elfutils-devel at sourceware dot org
- Date: Sun, 10 Jun 2018 11:05:21 +0200
- Subject: Re: [PATCH] libdw: Return an error in dwarf_getlocation_attr for missing .debug_addr.
- References: <1528451701-12732-1-git-send-email-mark@klomp.org>
On Fri, 2018-06-08 at 11:55 +0200, Mark Wielaard wrote:
> When constructing a "fake" Dwarf_Attribute for DW_OP_GNU_const_index,
> DW_OP_constx, DW_OP_GNU_addr_index or DW_OP_addrx, we would create a
> fake attribute pointing to the actual data in the .debug_addr section.
>
> We would even do that if there was no .debug_addr section assuming
> dwarf_formaddr or dwarf_formudata would generate an error. But when
> there is no .debug_addr there is also no fake_addr_cu, so the
> dwarf_form* functions cannot check the value is correct (and crash).
>
> Fix by returning an error early from dwarf_getlocation_attr indicating
> bad DWARF data.
Pushed to master.