From 7ddd14deffa8d2579c691bb8f19585fb2e7b5de3 Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Wed, 9 Jan 2008 17:30:59 +0000 Subject: gas/ * dwarf2dbg.c (out_sleb128): Delete. (size_fixed_inc_line_addr, emit_fixed_inc_line_addr): New. (out_fixed_inc_line_addr): Delete. (relax_inc_line_addr, dwarf2dbg_estimate_size_before_relax): Call new size_fixed_inc_line_addr if DWARF2_USE_FIXED_ADVANCE_PC is set. (dwarf2dbg_convert_frag): Likewise for emit_fixed_inc_line_addr. (process_entries): Remove calls to out_fixed_inc_line_addr. When DWARF2_USE_FIXED_ADVANCE_PC is set, call relax_inc_line_addr. * read.h (emit_expr_fix): New prototype. * read.c (emit_expr): Move code to emit_expr_fix and use it here. (emit_expr_fix): New. testsuite/ * gas/lns/lns.exp: Run new lns-big-delta test for targets that set DWARF2_USE_FIXED_ADVANCE_PC. * gas/lns/lns-big-delta.s: New. * gas/lns/lns-big-delta.d: New. --- gas/read.c | 62 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 29 deletions(-) (limited to 'gas/read.c') diff --git a/gas/read.c b/gas/read.c index 2f3b238..5718bf4 100644 --- a/gas/read.c +++ b/gas/read.c @@ -1,6 +1,6 @@ /* read.c - read a source file - Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -4175,41 +4175,45 @@ emit_expr (expressionS *exp, unsigned int nbytes) } } else - { - memset (p, 0, nbytes); + emit_expr_fix (exp, nbytes, frag_now, p); +} + +void +emit_expr_fix (expressionS *exp, unsigned int nbytes, fragS *frag, char *p) +{ + memset (p, 0, nbytes); - /* Now we need to generate a fixS to record the symbol value. */ + /* Generate a fixS to record the symbol value. */ #ifdef TC_CONS_FIX_NEW - TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp); + TC_CONS_FIX_NEW (frag, p - frag->fr_literal, nbytes, exp); #else - { - bfd_reloc_code_real_type r; + { + bfd_reloc_code_real_type r; - switch (nbytes) - { - case 1: - r = BFD_RELOC_8; - break; - case 2: - r = BFD_RELOC_16; - break; - case 4: - r = BFD_RELOC_32; - break; - case 8: - r = BFD_RELOC_64; - break; - default: - as_bad (_("unsupported BFD relocation size %u"), nbytes); - r = BFD_RELOC_32; - break; - } - fix_new_exp (frag_now, p - frag_now->fr_literal, (int) nbytes, exp, - 0, r); + switch (nbytes) + { + case 1: + r = BFD_RELOC_8; + break; + case 2: + r = BFD_RELOC_16; + break; + case 4: + r = BFD_RELOC_32; + break; + case 8: + r = BFD_RELOC_64; + break; + default: + as_bad (_("unsupported BFD relocation size %u"), nbytes); + r = BFD_RELOC_32; + break; } + fix_new_exp (frag, p - frag->fr_literal, (int) nbytes, exp, + 0, r); + } #endif - } } #ifdef BITFIELD_CONS_EXPRESSIONS -- cgit v1.1