This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] dwarf: Bail out if debug info needs relocation
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 11 Sep 2018 11:47:58 +0930
- Subject: Re: [PATCH] dwarf: Bail out if debug info needs relocation
- References: <20180907195832.5423-1-hjl.tools@gmail.com>
On Fri, Sep 07, 2018 at 12:58:32PM -0700, H.J. Lu wrote:
> PR ld/23425
> * dwarf2.c (find_abstract_instance): Bail out if debug info
> needs relocation.
> ---
> bfd/dwarf2.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
> index 8fadb5c4b6..bce5db9c7e 100644
> --- a/bfd/dwarf2.c
> +++ b/bfd/dwarf2.c
> @@ -2839,6 +2839,9 @@ find_abstract_instance (struct comp_unit * unit,
> total = info_ptr_end - info_ptr;
> if (!die_ref || die_ref >= total)
> {
> + /* Bail out if the debug info needs relocation. */
> + if ((unit->stash->sec->flags & SEC_RELOC))
> + return TRUE;
> _bfd_error_handler
> (_("DWARF error: invalid abstract instance DIE ref"));
> bfd_set_error (bfd_error_bad_value);
Every .debug_info section will have relocations, so this completely
disables the error checking here. Too much sweeping under the rug.
I believe the problem is described by the comment just above this
code: "We only support DW_FORM_ref_addr within the same file".
--
Alan Modra
Australia Development Lab, IBM