This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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] Optimize .eh_frame sections in ld, create PT_GNU_EH_FRAME ELF segment (take 2)


On Wed, Dec 12, 2001 at 01:43:48PM -0500, Jakub Jelinek wrote:
> 
> The following patch has been updated to incorporate Alan's comments plus one
> bug fix (eh_frame_ptr (DW_EH_PE_pcrel encoding) was using start of
> .eh_frame_hdr as base, not the address of the eh_frame_ptr field, so it was
> 4 bytes off.
> Ok to commit?

OK, but fix these before comitting.

> +++ bfd/elf-eh-frame.c	Wed Dec 12 20:12:34 2001
> +int cie_compare (c1, c2)
> +      && c1->initial_insn_length
> +	 == c2->initial_insn_length

Missing parentheses

> +	    {
> +	      cie_offset = sec_info->entry[i].new_offset;
> +	      cie_offset += sec_info->entry[i].sec->output_section->vma
> +			    + sec_info->entry[i].sec->output_offset
> +			    - sec->output_section->vma
> +			    - sec->output_offset;

Another.

> +		    if ((per_encoding & 0xf0) == DW_EH_PE_aligned)
> +		      buf = contents
> +			    + ((buf - contents + per_width - 1)
> +			       & ~((bfd_size_type) per_width - 1));

Again.

> +	    case DW_EH_PE_pcrel:
> +	      value += sec_info->entry[i].offset
> +		       - sec_info->entry[i].new_offset;
> +	      address += sec->output_section->vma + sec->output_offset
> +			 + sec_info->entry[i].new_offset + 8;

And here.

> +	  if (sec_info->entry[i].make_relative)
> +	    value -= sec->output_section->vma + sec->output_offset
> +		     + sec_info->entry[i].new_offset + 8;

And here.

> +	      hdr_info->array[hdr_info->array_count++].fde
> +		= sec->output_section->vma + sec->output_offset
> +		  + sec_info->entry[i].new_offset;

And here.

Hint: Under emacs, mark the whole file then run "indent-region" and see
what changes.  Emacs does tend to break comment formatting.  eg.

  /* This table indentation is removed:
     Some_Field
          0
          1

     Writing it this way works:
     . Some_Field
     .      0
     .      1

     Please yourself whether you want to go this far in making your
     source emacs-proof.  */

No need to repost the patch just for these formatting fixes!

Alan


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