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: Adjust initial FDE address if pcrel before printing.


> +  /* Needed if we find pc relative addresses.  */

"PC-relative"

> +  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
field itself".

> +	  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.


Thanks,
Roland

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