mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
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.
This commit is contained in:
committed by
Nick Clifton
parent
b65dc60b23
commit
a82c7d9030
15
gas/frags.c
15
gas/frags.c
@@ -24,6 +24,20 @@
|
||||
|
||||
extern fragS zero_address_frag;
|
||||
extern fragS predefined_address_frag;
|
||||
|
||||
static int totalfrags;
|
||||
|
||||
int
|
||||
get_frag_count (void)
|
||||
{
|
||||
return totalfrags;
|
||||
}
|
||||
|
||||
void
|
||||
clear_frag_count (void)
|
||||
{
|
||||
totalfrags = 0;
|
||||
}
|
||||
|
||||
/* Initialization for frag routines. */
|
||||
|
||||
@@ -70,6 +84,7 @@ frag_alloc (struct obstack *ob)
|
||||
ptr = (fragS *) obstack_alloc (ob, SIZEOF_STRUCT_FRAG);
|
||||
obstack_alignment_mask (ob) = oalign;
|
||||
memset (ptr, 0, SIZEOF_STRUCT_FRAG);
|
||||
totalfrags++;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user