[PATCH] libdw: handle DW_FORM_indirect when reading attributes

Mark Wielaard mark@klomp.org
Sat May 1 16:03:37 GMT 2021


Hi,

On Sat, 2021-05-01 at 17:59 +0200, Mark Wielaard wrote:
> There is __libdw_form_val_compute_len which already handles
> DW_FORM_indirect:
> 
>     case DW_FORM_indirect:
>       get_uleb128 (u128, valp, endp);
>       // XXX Is this really correct?
>       result = __libdw_form_val_len (cu, u128, valp);
>       if (result != (size_t) -1)
>         result += valp - startp;
>       else
>         return (size_t) -1;
>       break;
> 
> I believe the XXX question can be answered with: Yes, the result is the
> size of the actual FORM data plus the size of the uleb128 encoding that
> FORM (which is valp - startp). And it probably should check like your
> code does that valp != DW_FORM_indirect && valp !=
> DW_FORM_implicit_const. I'll sent a patch to do that.

Patch attached.

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libdw-Document-and-handle-DW_FORM_indirect-in-__libd.patch
Type: text/x-patch
Size: 1770 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/elfutils-devel/attachments/20210501/50302176/attachment.bin>


More information about the Elfutils-devel mailing list