From a82c7d9030b67a6a76a5403d0e1641f9e42141ac Mon Sep 17 00:00:00 2001 From: David Weatherford Date: Fri, 21 Mar 2014 11:53:42 +0000 Subject: Add support to the Xtensa target for creating trampolines for out-of-range branches. * tc-xtensa.c (xtensa_check_frag_count, xtensa_create_trampoline_frag) (xtensa_maybe_create_trampoline_frag, init_trampoline_frag) (find_trampoline_seg, search_trampolines, get_best_trampoline) (check_and_update_trampolines, add_jump_to_trampoline) (dump_trampolines): New function. (md_parse_option): Add cases for --[no-]trampolines options. (md_assemble, finish_vinsn, xtensa_end): Add call to xtensa_check_frag_count. (xg_assemble_vliw_tokens): Add call to xtensa_maybe_create_trampoline_frag. (xtensa_relax_frag): Relax fragments with RELAX_TRAMPOLINE state. (relax_frag_immed): Relax jump instructions that cannot reach its target. * tc-xtensa.h (xtensa_relax_statesE::RELAX_TRAMPOLINE): New relax state. * as.texinfo: Document --[no-]trampolines command-line options. * c-xtensa.texi: Document trampolines relaxation and command line options. * frags.c (get_frag_count, clear_frag_count): New function. (frag_alloc): Increment totalfrags counter. * frags.h (get_frag_count, clear_frag_count): New function. * all.exp: Add test for trampoline relaxation. * trampoline.d: Trampoline relaxation expected dump. * trampoline.s: Trampoline relaxation test source. --- gas/config/tc-xtensa.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gas/config/tc-xtensa.h') diff --git a/gas/config/tc-xtensa.h b/gas/config/tc-xtensa.h index 0bf1240..4672bc6 100644 --- a/gas/config/tc-xtensa.h +++ b/gas/config/tc-xtensa.h @@ -180,6 +180,11 @@ enum xtensa_relax_statesE prevent the linker from changing the size of any frag between the section start and the org frag. */ + RELAX_TRAMPOLINE, + /* Every few thousand frags, we insert one of these, just in case we may + need some space for a trampoline (jump to a jump) because the function + has gotten too big. If not needed, it disappears. */ + RELAX_NONE }; -- cgit v1.1