This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Generate DW_AT_ranges for non-contiguous code
- From: Andreas Schwab <schwab at suse dot de>
- To: Sterling Augustine <sterling at tensilica dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 10 Oct 2006 13:30:23 +0200
- Subject: Re: Generate DW_AT_ranges for non-contiguous code
- References: <44CE90B7.1080002@tensilica.com>
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."