Generate DW_AT_ranges for non-contiguous code

Andreas Schwab schwab@suse.de
Tue Oct 10 11:30:00 GMT 2006


Sterling Augustine <sterling@tensilica.com> writes:

> @@ -1382,6 +1431,13 @@ out_debug_abbrev (segT abbrev_seg)
>        out_abbrev (DW_AT_low_pc, DW_FORM_addr);
>        out_abbrev (DW_AT_high_pc, DW_FORM_addr);
>      }
> +  else
> +    {
> +      if (DWARF2_FORMAT () == dwarf2_format_32bit)
> +	out_abbrev (DW_AT_ranges, DW_FORM_data4);
> +      else
> +	out_abbrev (DW_AT_ranges, DW_FORM_data8);
> +    }

Here you use DW_FORM_data4.

> @@ -1474,6 +1529,16 @@ out_debug_info (segT info_seg, segT abbr
>        expr.X_add_number = 0;
>        emit_expr (&expr, sizeof_address);
>      }
> +  else
> +    {
> +      /* This attributes is emitted if the code is disjoint.  */
> +      
> +      /* DW_AT_ranges */
> +      expr.X_op = O_symbol;
> +      expr.X_add_symbol = section_symbol (ranges_seg);
> +      expr.X_add_number = 0;
> +      emit_expr (&expr, sizeof_address);

And here you use sizeof_address.  That ain't gonna work.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Binutils mailing list