[PATCH, nds32] Code refactoring of relaxation.
Kuan-Lin Chen
kuanlinchentw@gmail.com
Tue Sep 16 05:13:00 GMT 2014
Refactor each relaxation pattern to raise the maintainability.
In origin, all patterns is analysed in nds32_elf_relax_section,
so it is hard to debug and maintain. Therefore, we classify all
patterns into different functions in this patch.
Moreover, we adjust all optimizations into nds32_elf_relax_section
to take these optimizations in turn. This can promise all relaxation
being done after calling gld${EMULATION_NAME}_after_allocation.
The plain text ChangeLog is as below:
bfd/ChangeLog
2014-09-16 Kuan-Lin Chen <kuanlinchentw@gmail.com>
* bfd-in2.h: Regenerate.
* elf32-nds32.c (nds32_elf_mkobject): Hook bfd_elf32_mkobject.
(nds32_elf_relax_section): Code refactoring.
(nds32_elf_relax_longcall1, nds32_elf_relax_longcall2,
nds32_elf_relax_longcall3, nds32_elf_relax_longcall4,
nds32_elf_relax_longcall5, nds32_elf_relax_longcall6): Relax call
pattern. The first three is moved from nds32_elf_relax_section,
and the last three is new function.
(nds32_elf_relax_longjump1, nds32_elf_relax_longjump2,
nds32_elf_relax_longjump3, nds32_elf_relax_longjump4,
nds32_elf_relax_longjump5, nds32_elf_relax_longjump6,
nds32_elf_relax_longjump7): Relax condition branch pattern. The first
three is moved from nds32_elf_relax_section, and the last four
is new function.
(nds32_elf_relax_loadstore, nds32_elf_relax_lo12): Relax load-store
pattern and address setting pattern.
(nds32_elf_relax_piclo12, nds32_elf_relax_ptr,
nds32_elf_relax_pltgot_suff, nds32_elf_relax_got_suff,
nds32_elf_relax_gotoff_suff): Relax pic pattern.
(nds32_elf_relax_letlslo12, nds32_elf_relax_letlsadd,
nds32_elf_relax_letlsls): Relax TLS pattern.
(nds32_relax_adjust_label): Adjust alignment and nop.
(nds32_elf_pick_relax): Choose relaxation optimization.
(nds32_elf_get_relocated_section_contents): New hook.
(nds32_elf_order_insn_times, nds32_elf_ex9_build_itable): Release ex9
table 234th entry.
* elf32-nds32.h: Declare.
* libbfd.h: Regenerate.
* reloc.c: Add nds32 new relocations.
gas/ChangeLog
2014-09-16 Kuan-Lin Chen <kuanlinchentw@gmail.com>
* config/tc-nds32.c (nds32_fsrs, nds32_fdrs, nds32_gprs): Remove.
(relax_table): Add new relaxation pattern.
(do_pseudo_la_internal, do_pseudo_ls_bhw): Expand for PIC suffix.
(do_pseudo_move, do_pseudo_neg, do_pseudo_pushpopm): Fix.
(get_range_type, nds32_elf_record_fixup_exp, nds32_get_align,
nds32_elf_build_relax_relation, md_assemble, invalid_prev_frag,
nds32_relax_frag, md_estimate_size_before_relax): Adjust relaxation.
(relocation_table): Remove.
(relax_ls_table): Load-store relaxation pattern.
(hint_map): Define-use chain pattern.
(nds32_find_reloc_table, nds32_match_hint_insn): Analysis
relaxation pattern.
(nds32_parse_name): Parse PIC suffix.
* config/tc-nds32.h: Declare.
include/elf/ChangeLog
2014-09-16 Kuan-Lin Chen <kuanlinchentw@gmail.com>
* nds32.h: Declare new relocations.
ld/ChangeLog
2014-09-16 Kuan-Lin Chen <kuanlinchentw@gmail.com>
* emultempl/nds32elf.em (nds32_elf_after_open): Do not keep
ex9 234th entry.
(nds32_elf_after_allocation): Move all optimizations into
nds32_elf_relax_section.
--
Best regards,
Kuan-Lin Chen.
kuanlinchentw@gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.tar.bz2
Type: application/x-bzip2
Size: 61557 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20140916/a64db999/attachment.bz2>
More information about the Binutils
mailing list