This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH] readelf: Adjust initial FDE address if pcrel before printing.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 21 Dec 2012 14:13:11 -0800
- Subject: Re: [PATCH] readelf: Adjust initial FDE address if pcrel before printing.
> + /* Needed if we find pc relative addresses. */
> + GElf_Addr bias;
> + dwfl_module_getelf (dwflmod, &bias);
Check for errors?
> + /* pcrel for an FDE address really means data relative. */
Two spaces at the end of a sentence. "data-relative".
Or explain better: "relative to the runtime address of the start_address
> + Dwarf_Addr pc_start = initial_location;
> + if ((fde_encoding & 0x70) == DW_EH_PE_pcrel)
> + pc_start += ((uint64_t) shdr->sh_addr
> + + (base - (const unsigned char *) data->d_buf))
> + - bias;
Put it inside the parens so auto-indentation always works.
> + pc_start &= (ptr_size == 4
> + ? UINT64_C (0xffffffff)
> + : UINT64_C (0xffffffffffffffff));
Why is this necessary? It needs a comment.