diff options
author | Richard Henderson <rth@redhat.com> | 2003-03-11 22:00:33 +0000 |
---|---|---|
committer | Richard Henderson <rth@redhat.com> | 2003-03-11 22:00:33 +0000 |
commit | 6174d9c85e9c00fcbf75f23e81064d2bcadb6d10 (patch) | |
tree | 4429c4c4981f13d29d84fab4bf5a1acacb66bf35 /gas/dwarf2dbg.c | |
parent | d8cbbf95b270134639f2c6c43a511106c3d46fb4 (diff) | |
download | gdb-6174d9c85e9c00fcbf75f23e81064d2bcadb6d10.zip gdb-6174d9c85e9c00fcbf75f23e81064d2bcadb6d10.tar.gz gdb-6174d9c85e9c00fcbf75f23e81064d2bcadb6d10.tar.bz2 |
* dwarf2dbg.c (generic_dwarf2_emit_offset): New.
(TC_DWARF2_EMIT_OFFSET): Provide default.
(out_debug_aranges, out_debug_info): Use it.
* config/tc-ia64.c (ia64_dwarf2_emit_offset): New.
(ia64_cons_fix_new): Move FUNC_DTP_RELATIVE handling ...
(ia64_gen_real_reloc_type): ... here.
* config/tc-ia64.h (TC_DWARF2_EMIT_OFFSET): New.
Diffstat (limited to 'gas/dwarf2dbg.c')
-rw-r--r-- | gas/dwarf2dbg.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 58ac0f5..3b863cd 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -52,6 +52,9 @@ # define DWARF2_ADDR_SIZE(bfd) (bfd_arch_bits_per_address (bfd) / 8); #endif +#ifndef TC_DWARF2_EMIT_OFFSET +# define TC_DWARF2_EMIT_OFFSET generic_dwarf2_emit_offset +#endif #ifdef BFD_ASSEMBLER @@ -160,6 +163,7 @@ static char const fake_label_name[] = ".L0\001"; /* The size of an address on the target. */ static unsigned int sizeof_address; +static void generic_dwarf2_emit_offset PARAMS((symbolS *, unsigned int)); static struct line_subseg *get_line_subseg PARAMS ((segT, subsegT)); static unsigned int get_filenum PARAMS ((const char *, unsigned int)); static struct frag *first_frag_for_seg PARAMS ((segT)); @@ -186,6 +190,21 @@ static void out_debug_aranges PARAMS ((segT, segT)); static void out_debug_abbrev PARAMS ((segT)); static void out_debug_info PARAMS ((segT, segT, segT)); +/* Create an offset to .dwarf2_*. */ + +static void +generic_dwarf2_emit_offset (symbol, size) + symbolS *symbol; + unsigned int size; +{ + expressionS expr; + + expr.X_op = O_symbol; + expr.X_add_symbol = symbol; + expr.X_add_number = 0; + emit_expr (&expr, size); +} + /* Find or create an entry for SEG+SUBSEG in ALL_SEGS. */ static struct line_subseg * @@ -1209,10 +1228,8 @@ out_debug_aranges (aranges_seg, info_seg) out_two (2); /* Offset to .debug_info. */ - expr.X_op = O_symbol; - expr.X_add_symbol = section_symbol (info_seg); - expr.X_add_number = 0; - emit_expr (&expr, 4); + /* ??? sizeof_offset */ + TC_DWARF2_EMIT_OFFSET (section_symbol (info_seg), 4); /* Size of an address (offset portion). */ out_byte (addr_size); @@ -1339,10 +1356,7 @@ out_debug_info (info_seg, abbrev_seg, line_seg) out_two (2); /* .debug_abbrev offset */ - expr.X_op = O_symbol; - expr.X_add_symbol = section_symbol (abbrev_seg); - expr.X_add_number = 0; - emit_expr (&expr, sizeof_offset); + TC_DWARF2_EMIT_OFFSET (section_symbol (abbrev_seg), sizeof_offset); /* Target address size. */ out_byte (sizeof_address); @@ -1351,10 +1365,8 @@ out_debug_info (info_seg, abbrev_seg, line_seg) out_uleb128 (1); /* DW_AT_stmt_list */ - expr.X_op = O_symbol; - expr.X_add_symbol = section_symbol (line_seg); - expr.X_add_number = 0; - emit_expr (&expr, 4); + /* ??? sizeof_offset */ + TC_DWARF2_EMIT_OFFSET (section_symbol (line_seg), 4); /* These two attributes may only be emitted if all of the code is contiguous. Multiple sections are not that. */ |