Commit 2bee21e
binutils: Relax from BL to BL_S instruction.
Adds to linker relaxation the possibility of performing linker
relaxation from BL instruction to BL_S, if possible. This relaxation
also requires the object file to be prepared for shrinking by the
assembler. If that operation is not performed, then this linker
relaxation operation will not take place.
bfd/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* bfd-in2.h: Regenerate.
* elf32-arc.c (arc_elf_merge_attributes): Take into account if an
object can be relaxed.
(ICARRY): Define.
(arc_relax_delete_bytes): New function.
(arc_elf_relax_section): Add BL to BL_S relaxation rule.
* libbfd.h: Regenerate.
* reloc.c: Add extra relocs.
binutils/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* readelf.c (display_arc_attribute): Recognize relaxable object.
gas/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* config/tc-arc.c (relaxation_state): Change it from int to
bfd_boolean.
(enum options): Add linker_relax option.
(md_longopts): Likewise.
(md_begin): Initialize linkrelax variable.
(md_apply_fix): Cleanup unused code.
(md_parse_option): Recognize linker_relax option.
(arc_make_nops): New function.
(arc_handle_align): Change it to generate ARC_ALIGN reloc when
needed.
(tc_arc_fix_adjustable): All relocs are using the original symbol.
(arc_cons_fix_new): Generate corresponding relocs when we have
symbol difference.
(arc_set_public_attributes): Set relaxable attribute whenever is
necessary.
(arc_allow_local_substract): New function.
* config/tc-arc.h (TC_LINKRELAX_FIXUP): Define.
(LINKER_RELAXING_SHRINKS_ONLY): Likewise.
(TC_VALIDATE_FIX): Update with known relocs.
(TC_FORCE_RELOCATION_SUB_LOCAL): Delete.
(md_allow_local_subtract): Define.
(TC_VALIDATE_FIX_SUB): Delete.
include/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* elf/arc-reloc.def (ARC_S9H_PCREL): Add new reloc.
(ARC_S7H_PCREL): Likewise.
(ARC_S8H_PCREL): Likewise.
(ARC_S10H_PCREL): Likewise.
(ARC_S13H_PCREL): Likewise.
(ARC_ALIGN): Likewise.
(ARC_ADD8): Likewise.
(ARC_ADD16): Likewise.
(ARC_SUB8): Likewise.
(ARC_SUB16): Likewise.
(ARC_SUB32): Likewise.
* opcode/arc-func.h (replace_bits9): New function.
(replace_bits10): Likewise.
(replace_bits7): Likewise.
(replace_disp8h): Likewise.
(replace_bits13): Likewise.
ld/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* emulparams/arcelf.sh (EXTRA_EM_FILE): Add.
* emulparams/arcv2elf.sh (EXTRA_EM_FILE): Likewise.
* emulparams/arcv2elfx.sh (EXTRA_EM_FILE): Likewise.
* emultempl/arcelf.em: New file.
* testsuite/ld-arc/jli-simple.rd: New file.
* testsuite/ld-arc/relax-call-1.d: Likewise.
* testsuite/ld-arc/relax-call-1.s: Likewise.
* testsuite/ld-arc/relax-call-2.d: Likewise.
* testsuite/ld-arc/relax-call-2.s: Likewise.
* testsuite/ld-arc/relax-call-3.d: Likewise.
* testsuite/ld-arc/relax-call-3.s: Likewise.
opcodes/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* arc-opc.c (SIMM9_A16_8): Use external reloc.
(SIMM10_A16_7_S): Likewise.
(SIMM7_A16_10_S): Likewise.
(SIMM8_A16_9_S): Likewise.
(SIMM13_A16_20): Likewise.
[RLX][FIX] Fix relocations when we don't linkrelax1 parent f356740 commit 2bee21e
File tree
21 files changed
+900
-124
lines changed- bfd
- binutils
- gas
- config
- include
- elf
- opcode
- ld
- emulparams
- emultempl
- testsuite/ld-arc
- opcodes
21 files changed
+900
-124
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3423 | 3423 | | |
3424 | 3424 | | |
3425 | 3425 | | |
| 3426 | + | |
| 3427 | + | |
| 3428 | + | |
| 3429 | + | |
| 3430 | + | |
| 3431 | + | |
| 3432 | + | |
| 3433 | + | |
| 3434 | + | |
| 3435 | + | |
| 3436 | + | |
3426 | 3437 | | |
3427 | 3438 | | |
3428 | 3439 | | |
| |||
0 commit comments