aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-avr.h
diff options
context:
space:
mode:
authorDenis Chertykov <chertykov@gmail.com>2014-04-10 19:50:33 +0400
committerDenis Chertykov <chertykov@gmail.com>2014-04-10 19:50:33 +0400
commite4ef1b6c3fee295ab41138bf77a82dff16f1d7c3 (patch)
tree4f6ad10afb271882fe8624a082ecb088a1db0feb /gas/config/tc-avr.h
parent9d497a19eabe25b3af1cdd50a957592ed22658e5 (diff)
downloadgdb-e4ef1b6c3fee295ab41138bf77a82dff16f1d7c3.zip
gdb-e4ef1b6c3fee295ab41138bf77a82dff16f1d7c3.tar.gz
gdb-e4ef1b6c3fee295ab41138bf77a82dff16f1d7c3.tar.bz2
bfd/ChangeLog
* elf32-avr.c: Add DIFF relocations for AVR. (avr_final_link_relocate): Handle the DIFF relocs. (bfd_elf_avr_diff_reloc): New. (elf32_avr_is_diff_reloc): New. (elf32_avr_adjust_diff_reloc_value): Reduce difference value. (elf32_avr_relax_delete_bytes): Recompute difference after deleting bytes. * reloc.c: Add BFD_RELOC_AVR_DIFF8/16/32 relocations gas/ChangeLog * config/tc-avr.c: Add new flag mlink-relax. (md_show_usage): Add flag and help text. (md_parse_option): Record whether link relax is turned on. (relaxable_section): New. (avr_validate_fix_sub): New. (avr_force_relocation): New. (md_apply_fix): Generate DIFF reloc. (avr_allow_local_subtract): New. * config/tc-avr.h (TC_LINKRELAX_FIXUP): Define to 0. (TC_FORCE_RELOCATION): Define. (TC_FORCE_RELOCATION_SUB_SAME): Define. (TC_VALIDATE_FIX_SUB): Define. (avr_force_relocation): Declare. (avr_validate_fix_sub): Declare. (md_allow_local_subtract): Define. (avr_allow_local_subtract): Declare. gas/testsuite/ChangeLog * gas/avr/diffreloc_withrelax.d: New testcase. * gas/avr/noreloc_withoutrelax.d: Likewise. * gas/avr/relax.s: Likewise. include/ChangeLog * elf/avr.h: Add new DIFF relocs. ld/testsuite/ChangeLog * ld-avr/norelax_diff.d: New testcase. * ld-avr/relax_diff.d: Likewise. * ld-avr/relax.s: Likewise.
Diffstat (limited to 'gas/config/tc-avr.h')
-rw-r--r--gas/config/tc-avr.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/gas/config/tc-avr.h b/gas/config/tc-avr.h
index df75ac7..fb596ad 100644
--- a/gas/config/tc-avr.h
+++ b/gas/config/tc-avr.h
@@ -112,6 +112,18 @@ extern void avr_cons_fix_new (fragS *,int, int, expressionS *,
visible symbols can be overridden. */
#define EXTERN_FORCE_RELOC 0
+/* If defined, this macro allows control over whether fixups for a
+ given section will be processed when the linkrelax variable is
+ set. Define it to zero and handle things in md_apply_fix instead.*/
+#define TC_LINKRELAX_FIXUP(SEG) 0
+
+/* If this macro returns non-zero, it guarantees that a relocation will be emitted
+ even when the value can be resolved locally. Do that if linkrelax is turned on */
+#define TC_FORCE_RELOCATION(fix) avr_force_relocation (fix)
+#define TC_FORCE_RELOCATION_SUB_SAME(fix, seg) \
+ (! SEG_NORMAL (seg) || avr_force_relocation (fix))
+extern int avr_force_relocation (struct fix *);
+
/* Values passed to md_apply_fix don't include the symbol value. */
#define MD_APPLY_SYM_VALUE(FIX) 0
@@ -169,6 +181,12 @@ extern long md_pcrel_from_section (struct fix *, segT);
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
@@ -190,3 +208,8 @@ extern long md_pcrel_from_section (struct fix *, segT);
/* 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);