diff options
Diffstat (limited to 'gas/config/tc-avr.c')
-rw-r--r-- | gas/config/tc-avr.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c index ef8cf93..98fc0f5 100644 --- a/gas/config/tc-avr.c +++ b/gas/config/tc-avr.c @@ -24,6 +24,8 @@ #include "as.h" #include "safe-ctype.h" #include "subsegs.h" +#include "dw2gencfi.h" + struct avr_opcodes_s { @@ -1543,3 +1545,18 @@ avr_cons_fix_new (fragS *frag, exp_mod_pm = 0; } } + +void +tc_cfi_frame_initial_instructions (void) +{ + /* AVR6 pushes 3 bytes for calls. */ + int return_size = (avr_mcu->mach == bfd_mach_avr6 ? 3 : 2); + + /* The CFA is the caller's stack location before the call insn. */ + /* Note that the stack pointer is dwarf register number 32. */ + cfi_add_CFA_def_cfa (32, return_size); + + /* Note that AVR consistently uses post-decrement, which means that things + do not line up the same way as for targers that use pre-decrement. */ + cfi_add_CFA_offset (DWARF2_DEFAULT_RETURN_COLUMN, 1-return_size); +} |