aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2012-04-30 14:32:28 +0000
committerMark Wielaard <mjw@redhat.com>2012-04-30 14:32:28 +0000
commit88ebb0a1567bdc11a39c466735d5fd145f326c1b (patch)
tree7f8af837536e570ffdf4d2d271047eafbb87c0a5 /gas
parent45162986de31c02d5100f87195b1fa97357f815a (diff)
downloadgdb-88ebb0a1567bdc11a39c466735d5fd145f326c1b.zip
gdb-88ebb0a1567bdc11a39c466735d5fd145f326c1b.tar.gz
gdb-88ebb0a1567bdc11a39c466735d5fd145f326c1b.tar.bz2
gas: Make dwarf2dbg.c versions specific and add DW_AT_high_pc case for DWARF 4+.
* dwarf2dbg.c (DWARF2_ARANGES_VERSION): New define to 2. (DWARF2_LINE_VERSION): Likewise. (out_debug_line): Use DWARF2_LINE_VERSION not DWARF2_VERSION. (out_debug_aranges): Use DWARF2_ARANGES_VERSION not DWARF2_VERSION. (out_debug_abbrev): Use DW_FORM_data for DW_AT_high_pc when DWARF2_VERSION >= 4. (out_debug_info): Use difference between start and end as data value for DW_AT_high_pc when DWARF2_VERSION >= 4. * config/tc-ia64.h (DWARF2_LINE_VERSION): Override it.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog12
-rw-r--r--gas/config/tc-ia64.h1
-rw-r--r--gas/dwarf2dbg.c28
3 files changed, 37 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 5eee5d3..7e64233 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,15 @@
+2012-04-26 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf2dbg.c (DWARF2_ARANGES_VERSION): New define to 2.
+ (DWARF2_LINE_VERSION): Likewise.
+ (out_debug_line): Use DWARF2_LINE_VERSION not DWARF2_VERSION.
+ (out_debug_aranges): Use DWARF2_ARANGES_VERSION not DWARF2_VERSION.
+ (out_debug_abbrev): Use DW_FORM_data for DW_AT_high_pc when
+ DWARF2_VERSION >= 4.
+ (out_debug_info): Use difference between start and end as data
+ value for DW_AT_high_pc when DWARF2_VERSION >= 4.
+ * config/tc-ia64.h (DWARF2_LINE_VERSION): Override it.
+
2012-04-27 David S. Miller <davem@davemloft.net>
* doc/c-sparc.text: Document %l34 and %h34.
diff --git a/gas/config/tc-ia64.h b/gas/config/tc-ia64.h
index 96618e9..7cade49 100644
--- a/gas/config/tc-ia64.h
+++ b/gas/config/tc-ia64.h
@@ -327,4 +327,5 @@ typedef struct unwind_record
/* VMS backtraces expect dwarf version 3. */
#ifdef TE_VMS
#define DWARF2_VERSION 3
+#define DWARF2_LINE_VERSION 3
#endif
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 76f5e84..f428f0d 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -93,6 +93,16 @@
#define DWARF2_VERSION 2
#endif
+/* The .debug_aranges version has been 2 in DWARF version 2, 3 and 4. */
+#ifndef DWARF2_ARANGES_VERSION
+#define DWARF2_ARANGES_VERSION 2
+#endif
+
+/* This implementation output version 2 .debug_line information. */
+#ifndef DWARF2_LINE_VERSION
+#define DWARF2_LINE_VERSION 2
+#endif
+
#include "subsegs.h"
#include "dwarf2.h"
@@ -1457,7 +1467,7 @@ out_debug_line (segT line_seg)
line_end = exp.X_add_symbol;
/* Version. */
- out_two (DWARF2_VERSION);
+ out_two (DWARF2_LINE_VERSION);
/* Length of the prologue following this length. */
prologue_end = symbol_temp_make ();
@@ -1565,7 +1575,7 @@ out_debug_aranges (segT aranges_seg, segT info_seg)
aranges_end = exp.X_add_symbol;
/* Version. */
- out_two (DWARF2_VERSION);
+ out_two (DWARF2_ARANGES_VERSION);
/* Offset to .debug_info. */
TC_DWARF2_EMIT_OFFSET (section_symbol (info_seg), sizeof_offset);
@@ -1631,7 +1641,11 @@ out_debug_abbrev (segT abbrev_seg,
if (all_segs->next == NULL)
{
out_abbrev (DW_AT_low_pc, DW_FORM_addr);
- out_abbrev (DW_AT_high_pc, DW_FORM_addr);
+ if (DWARF2_VERSION < 4)
+ out_abbrev (DW_AT_high_pc, DW_FORM_addr);
+ else
+ out_abbrev (DW_AT_high_pc, (sizeof_address == 4
+ ? DW_FORM_data4 : DW_FORM_data8));
}
else
{
@@ -1694,7 +1708,13 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg)
emit_expr (&exp, sizeof_address);
/* DW_AT_high_pc */
- exp.X_op = O_symbol;
+ if (DWARF2_VERSION < 4)
+ exp.X_op = O_symbol;
+ else
+ {
+ exp.X_op = O_subtract;
+ exp.X_op_symbol = all_segs->text_start;
+ }
exp.X_add_symbol = all_segs->text_end;
exp.X_add_number = 0;
emit_expr (&exp, sizeof_address);