From 71863e733e37f6480dd502dbd03c56e99a09b08f Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 21 Mar 2013 14:47:34 +0000 Subject: [PATCH] PR gas/15282 * tc-avr.c (mcu_has_3_byte_pc): New function. (tc_cfi_frame_initial_instructions): Call it to find return address size. --- gas/ChangeLog | 7 +++++++ gas/config/tc-avr.c | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index bbc5774005b..4e09946371d 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2013-03-21 Senthil Kumar Selvaraj + + PR gas/15282 + * tc-avr.c (mcu_has_3_byte_pc): New function. + (tc_cfi_frame_initial_instructions): Call it to find return + address size. + 2013-03-20 Alexis Deruelle PR gas/15095 diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c index 0bc972e4b02..e47741777eb 100644 --- a/gas/config/tc-avr.c +++ b/gas/config/tc-avr.c @@ -1,7 +1,6 @@ /* tc-avr.c -- Assembler code for the ATMEL AVR - Copyright 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, - 2010, 2012, 2013 Free Software Foundation, Inc. + Copyright 1999-2013 Free Software Foundation, Inc. Contributed by Denis Chertykov This file is part of GAS, the GNU Assembler. @@ -1587,11 +1586,21 @@ avr_cons_fix_new (fragS *frag, pexp_mod_data = &exp_mod_data[0]; } +static bfd_boolean +mcu_has_3_byte_pc (void) +{ + int mach = avr_mcu->mach; + + return mach == bfd_mach_avr6 + || mach == bfd_mach_avrxmega6 + || mach == bfd_mach_avrxmega7; +} + void tc_cfi_frame_initial_instructions (void) { /* AVR6 pushes 3 bytes for calls. */ - int return_size = (avr_mcu->mach == bfd_mach_avr6 ? 3 : 2); + int return_size = (mcu_has_3_byte_pc () ? 3 : 2); /* The CFA is the caller's stack location before the call insn. */ /* Note that the stack pointer is dwarf register number 32. */ -- 2.30.2