This is the mail archive of the binutils@sourceware.org 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 1/3] bfd: DW_AT_high_pc can be relative to DW_AT_low_pc.


On Fri, Apr 27, 2012 at 02:15:19PM +0200, Mark Wielaard wrote:
> --- a/bfd/dwarf2.c
> +++ b/bfd/dwarf2.c
> @@ -2092,6 +2092,7 @@ scan_unit_for_symbols (struct comp_unit *unit)
>        struct varinfo *var;
>        bfd_vma low_pc = 0;
>        bfd_vma high_pc = 0;
> +      int high_pc_relative = 0;

Please use bfd_boolean high_pc_relative = FALSE; instead.
>  
>        abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
>        info_ptr += bytes_read;
> @@ -2197,6 +2198,8 @@ scan_unit_for_symbols (struct comp_unit *unit)
>  
>  		case DW_AT_high_pc:
>  		  high_pc = attr.u.val;
> +		  if (attr.form != DW_FORM_addr)
> +		    high_pc_relative = 1;

And high_pc_relative = attr.form != DW_FORM_addr; here.

> @@ -2275,6 +2278,9 @@ scan_unit_for_symbols (struct comp_unit *unit)
>  	    }
>  	}
>  
> +      if (high_pc_relative == 1)
> +	high_pc += low_pc;

And just if (high_pc_relative) here.
Similarly elsewhere.

Ok for trunk with those changes, thanks.

	Jakub


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