This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] readelf: DW_CFA_set_loc operand is an address


On 11/25/2015 08:00 AM, Ben Gamari wrote:
> Previously this was incorrectly assumed to be an ULEB128. Hilarity
> ensued.

Is the error visible in any testcase?  Or can you add a test?

> This appears to be the case in both DWARF 3, DWARF 4, and LSB 5.
> ---
>  src/readelf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/readelf.c b/src/readelf.c
> index 5f6e4ed..7c3237f 100644
> --- a/src/readelf.c
> +++ b/src/readelf.c
> @@ -4971,7 +4971,7 @@ print_cfa_program (const unsigned char *readp, const unsigned char *const endp,
>  	  case DW_CFA_set_loc:
>  	    if ((uint64_t) (endp - readp) < 1)
>  	      goto invalid;
> -	    get_uleb128 (op1, readp, endp);
> +	    op1 = read_addr_unaligned_inc (ptr_size, dbg, readp);
>  	    op1 += vma_base;
>  	    printf ("     set_loc %" PRIu64 "\n", op1 * code_align);
>  	    break;
> 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]