binutils-gdb/gas/config
Max Filippov fe6c2f1b64 gas: xtensa: rewrite xg_relax_trampoline
Replace linked list of trampoline frags with an ordered array, so that
instead of indexing fixups trampolines could be indexed. Keep each array
in the trampoline_seg structure, so there's no need to rebuild it for
every new processed segment. Don't run relaxation for each trampoline
frag, instead run it for each fixup in the current segment that needs
relaxation at the beginning of each relaxation pass. This way the
complexity of this process drops from about O(n^2 * m) to about
O(log n * m), where n is the number of trampoline frags and m is the
number of fixups that need relaxation in the segment.

gas/
2017-11-27  Max Filippov  <jcmvbkbc@gmail.com>

	* config/tc-xtensa.c (trampoline_index): New structure.
	(trampoline_seg): Replace trampoline list with trampoline index.
	(xg_find_trampoline, xg_add_trampoline_to_index)
	(xg_remove_trampoline_from_index, xg_add_trampoline_to_seg)
	(xg_is_trampoline_frag_full, xg_get_fulcrum)
	(xg_find_best_trampoline, xg_relax_fixup, xg_relax_fixups)
	(xg_is_relaxable_fixup): New functions.
	(J_MARGIN): New macro.
	(xtensa_create_trampoline_frag): Use xg_add_trampoline_to_seg
	instead of open-coded addition to the linked list.
	(dump_trampolines): Iterate through the trampoline_seg::index.
	(cached_fixupS, cached_fixup, fixup_cacheS, fixup_cache)
	(fixup_order, xtensa_make_cached_fixup)
	(xtensa_realloc_fixup_cache, xtensa_cache_relaxable_fixups)
	(xtensa_find_first_cached_fixup, xtensa_delete_cached_fixup)
	(xtensa_add_cached_fixup, check_and_update_trampolines): Remove
	definitions.
	(xg_relax_trampoline): Extract logic into separate functions,
	replace body with a call to xg_relax_fixups.
	(search_trampolines): Replace search in linked list with search
	in index. Change data type of address-tracking variables from
	int to offsetT. Replace abs with labs.
	(xg_append_jump): Finish the trampoline frag if it's full.
	(add_jump_to_trampoline): Remove trampoline frag from the index
	if the frag is full.
	* config/tc-xtensa.h (xtensa_frag_type): Remove next_trampoline.
	* testsuite/gas/xtensa/trampoline.d: Adjust absolute addresses
	as the placement of trampolines has slightly changed.
	* testsuite/gas/xtensa/trampoline.s: Add _nop so that objdump
	stays in sync with instruction stream.
2017-11-27 15:13:52 -08:00
..
aout_gnu.h
atof-ieee.c
atof-vax.c
bfin-aux.h
bfin-defs.h
bfin-lex-wrapper.c
bfin-lex.l
bfin-parse.y
e-crisaout.c
e-criself.c
e-i386aout.c
e-i386coff.c
e-i386elf.c
e-mipself.c
itbl-mips.h
m68k-parse.h
m68k-parse.y
obj-aout.c
obj-aout.h
obj-coff-seh.c
obj-coff-seh.h
obj-coff.c
obj-coff.h
obj-ecoff.c
obj-ecoff.h
obj-elf.c When creating a .note section to contain a version note, set the section alignment to 4 bytes. 2017-11-27 11:04:17 +00:00
obj-elf.h
obj-evax.c
obj-evax.h
obj-fdpicelf.c
obj-fdpicelf.h
obj-macho.c Fix memory corruption when assembling an i386 darwin source file. 2017-08-10 11:51:42 +01:00
obj-macho.h
obj-multi.c
obj-multi.h Fix build error with --enable-targets=all. 2017-11-23 12:30:47 -08:00
obj-som.c
obj-som.h
rl78-defs.h
rl78-parse.y
rx-defs.h
rx-parse.y
tc-aarch64.c Add new AArch64 FP16 FM{A|S} instructions. 2017-11-16 16:27:35 +00:00
tc-aarch64.h
tc-alpha.c
tc-alpha.h
tc-arc.c
tc-arc.h
tc-arm.c [GAS/ARM] Clarify relation between reg_expected_msgs and arm_reg_type 2017-11-22 14:02:49 +00:00
tc-arm.h
tc-avr.c Fix the AVR assembler so that it will correctly issue warnings about skipped instructions even if subsections are used. 2017-10-19 16:21:51 +01:00
tc-avr.h Fix the AVR assembler so that it will correctly issue warnings about skipped instructions even if subsections are used. 2017-10-19 16:21:51 +01:00
tc-bfin.c
tc-bfin.h
tc-cr16.c gas and ld pluralization fixes 2017-11-07 17:00:37 +10:30
tc-cr16.h
tc-cris.c
tc-cris.h
tc-crx.c PR22348, conflicting global vars in crx and cr16 2017-10-25 22:14:58 +10:30
tc-crx.h
tc-d10v.c
tc-d10v.h
tc-d30v.c
tc-d30v.h
tc-dlx.c
tc-dlx.h
tc-epiphany.c
tc-epiphany.h
tc-fr30.c
tc-fr30.h
tc-frv.c
tc-frv.h
tc-ft32.c FT32B is a new FT32 family member. It has a code compression scheme, which requires the use of linker relaxations. The change is quite large, so submission is in several parts. 2017-11-01 15:33:24 +00:00
tc-ft32.h FT32B is a new FT32 family member. It has a code compression scheme, which requires the use of linker relaxations. The change is quite large, so submission is in several parts. 2017-11-01 15:33:24 +00:00
tc-generic.c
tc-generic.h
tc-h8300.c
tc-h8300.h
tc-hppa.c
tc-hppa.h
tc-i370.c gas and ld pluralization fixes 2017-11-07 17:00:37 +10:30
tc-i370.h
tc-i386-intel.c x86/Intel: don't report multiple errors for a single insn operand 2017-11-23 10:57:54 +01:00
tc-i386.c x86: reject further invalid AVX-512 masking constructs 2017-11-24 08:42:57 +01:00
tc-i386.h
tc-i860.c
tc-i860.h
tc-i960.c
tc-i960.h
tc-ia64.c
tc-ia64.h
tc-ip2k.c
tc-ip2k.h
tc-iq2000.c
tc-iq2000.h
tc-lm32.c
tc-lm32.h
tc-m32c.c
tc-m32c.h
tc-m32r.c
tc-m32r.h
tc-m68hc11.c
tc-m68hc11.h
tc-m68k.c gas and ld pluralization fixes 2017-11-07 17:00:37 +10:30
tc-m68k.h
tc-m68851.h
tc-mcore.c gas and ld pluralization fixes 2017-11-07 17:00:37 +10:30
tc-mcore.h
tc-mep.c
tc-mep.h
tc-metag.c
tc-metag.h
tc-microblaze.c
tc-microblaze.h
tc-mips.c MIPS: Preset EF_MIPS_ABI2 with n32 ELF objects 2017-10-23 15:39:46 +01:00
tc-mips.h
tc-mmix.c
tc-mmix.h
tc-mn10200.c
tc-mn10200.h
tc-mn10300.c
tc-mn10300.h
tc-moxie.c
tc-moxie.h
tc-msp430.c gas and ld pluralization fixes 2017-11-07 17:00:37 +10:30
tc-msp430.h
tc-mt.c
tc-mt.h
tc-nds32.c
tc-nds32.h
tc-nios2.c Fix segfault processing nios2 pseudo-instructions with too few arguments. 2017-10-16 20:45:55 -07:00
tc-nios2.h
tc-ns32k.c
tc-ns32k.h
tc-or1k.c
tc-or1k.h
tc-pdp11.c
tc-pdp11.h
tc-pj.c
tc-pj.h
tc-ppc.c Missing relocation R_PPC_VLE_ADDR20 and add VLE flag to details in readelf 2017-09-05 08:42:27 +09:30
tc-ppc.h Reduce excessive .eh_frame alignment for powerpc 2017-09-21 23:17:44 +09:30
tc-pru.c
tc-pru.h
tc-riscv.c RISC-V: Fix riscv g++ testsuite EH failures. 2017-11-07 09:13:52 -08:00
tc-riscv.h Riscv ld-elf/stab failure and fake label cleanup. 2017-11-22 11:20:48 -08:00
tc-rl78.c
tc-rl78.h
tc-rx.c Improve handling of REPT pseudo op with a negative count. 2017-10-20 11:45:19 +01:00
tc-rx.h
tc-s390.c gas and ld pluralization fixes 2017-11-07 17:00:37 +10:30
tc-s390.h
tc-score7.c
tc-score.c
tc-score.h
tc-sh64.c
tc-sh64.h
tc-sh.c
tc-sh.h
tc-sparc.c gas: enable PC-relative diff relocations on sparc64 2017-08-23 05:46:45 -07:00
tc-sparc.h gas: enable PC-relative diff relocations on sparc64 2017-08-23 05:46:45 -07:00
tc-spu.c
tc-spu.h
tc-tic4x.c
tc-tic4x.h
tc-tic6x.c
tc-tic6x.h
tc-tic30.c
tc-tic30.h
tc-tic54x.c gas and ld pluralization fixes 2017-11-07 17:00:37 +10:30
tc-tic54x.h
tc-tilegx.c
tc-tilegx.h
tc-tilepro.c
tc-tilepro.h
tc-v850.c
tc-v850.h
tc-vax.c
tc-vax.h
tc-visium.c
tc-visium.h
tc-wasm32.c
tc-wasm32.h
tc-xc16x.c
tc-xc16x.h
tc-xgate.c
tc-xgate.h
tc-xstormy16.c
tc-xstormy16.h
tc-xtensa.c gas: xtensa: rewrite xg_relax_trampoline 2017-11-27 15:13:52 -08:00
tc-xtensa.h gas: xtensa: rewrite xg_relax_trampoline 2017-11-27 15:13:52 -08:00
tc-z8k.c
tc-z8k.h
tc-z80.c
tc-z80.h
te-386bsd.h
te-aix5.h
te-aix.h
te-armeabi.h
te-armfbsdeabi.h
te-armfbsdvfp.h
te-armlinuxeabi.h
te-dragonfly.h
te-dynix.h
te-epoc-pe.h
te-freebsd.h
te-generic.h
te-gnu.h
te-go32.h
te-hppa64.h
te-hppa.h
te-hppalinux64.h
te-hpux.h
te-i386aix.h
te-ia64aix.h
te-interix.h
te-irix.h
te-linux.h
te-lynx.h
te-mach.h
te-macos.h
te-nacl.h
te-nbsd532.h
te-nbsd.h
te-netware.h
te-pc532mach.h
te-pe.h
te-pep.h
te-psos.h
te-riscix.h
te-solaris.h
te-sparcaout.h
te-sun3.h
te-svr4.h
te-symbian.h
te-tmips.h
te-uclinux.h
te-vms.c
te-vms.h
te-vxworks.h
te-wince-pe.h
vax-inst.h
xtensa-istack.h
xtensa-relax.c gas and ld pluralization fixes 2017-11-07 17:00:37 +10:30
xtensa-relax.h