+
+/* We don't want gas to fixup the following program memory related relocations.
+ We will need them in case that we want to do linker relaxation.
+ We could in principle keep these fixups in gas when not relaxing.
+ However, there is no serious performance penalty when making the linker
+ make the fixup work. Check also that fx_addsy is not NULL, in order to make
+ sure that the fixup refers to some sort of label. */
+#define TC_VALIDATE_FIX(FIXP,SEG,SKIP) \
+ if ( (FIXP->fx_r_type == BFD_RELOC_AVR_7_PCREL \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_13_PCREL \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_PM \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_GS \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_PM \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_GS \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_HH8_LDI_PM \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_PM_NEG \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_PM_NEG \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_HH8_LDI_PM_NEG \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_8_LO \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_8_HI \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_8_HLO \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_16_PM) \
+ && FIXP->fx_addsy != NULL \
+ && FIXP->fx_subsy == NULL) \
+ { \
+ symbol_mark_used_in_reloc (FIXP->fx_addsy); \
+ goto SKIP; \
+ }
+
+/* This macro is evaluated for any fixup with a fx_subsy that
+ fixup_segment cannot reduce to a number. If the macro returns
+ false an error will be reported. */
+#define TC_VALIDATE_FIX_SUB(fix, seg) avr_validate_fix_sub (fix)
+extern int avr_validate_fix_sub (struct fix *);
+
+/* This target is buggy, and sets fix size too large. */
+#define TC_FX_SIZE_SLACK(FIX) 2
+
+/* AVR instructions are 2 or 4 bytes long. */
+#define DWARF2_LINE_MIN_INSN_LENGTH 2
+
+/* 32 bits pseudo-addresses are used on AVR. */
+#define DWARF2_ADDR_SIZE(bfd) 4
+
+/* Enable cfi directives. */
+#define TARGET_USE_CFIPOP 1
+
+/* The stack grows down, and is only byte aligned. */
+#define DWARF2_CIE_DATA_ALIGNMENT -1
+
+/* Define the column that represents the PC. */
+#define DWARF2_DEFAULT_RETURN_COLUMN 36
+
+/* Define a hook to setup initial CFI state. */
+extern void tc_cfi_frame_initial_instructions (void);
+#define tc_cfi_frame_initial_instructions tc_cfi_frame_initial_instructions
+
+/* The difference between same-section symbols may be affected by linker
+ relaxation, so do not resolve such expressions in the assembler. */
+#define md_allow_local_subtract(l,r,s) avr_allow_local_subtract (l, r, s)
+extern bfd_boolean avr_allow_local_subtract (expressionS *, expressionS *, segT);
+
+#define elf_tc_final_processing avr_elf_final_processing
+extern void avr_elf_final_processing (void);
+
+#define md_pre_output_hook avr_pre_output_hook ()
+extern void avr_pre_output_hook (void);
+
+#define md_undefined_symbol avr_undefined_symbol
+extern symbolS* avr_undefined_symbol (char*);
+
+#define md_post_relax_hook avr_post_relax_hook ()
+extern void avr_post_relax_hook (void);
+
+#define HANDLE_ALIGN(fragP) avr_handle_align (fragP)
+extern void avr_handle_align (fragS *);
+
+struct avr_frag_data
+{
+ unsigned is_org : 1;
+ unsigned is_align : 1;
+ unsigned has_fill : 1;
+
+ char fill;
+ offsetT alignment;
+ unsigned int prev_opcode;
+};
+#define TC_FRAG_TYPE struct avr_frag_data
+#define TC_FRAG_INIT(frag, max_bytes) avr_frag_init (frag)
+extern void avr_frag_init (fragS *);