4962c51a67
to R_ARM_LDC_SB_G{0,1,2} respectively. bfd/ * bfd-in2.h: Regenerate. * elf32-arm.c (R_ARM_ALU_PC_G0_NC, R_ARM_ALU_PC_G0, R_ARM_ALU_PC_G1_NC, R_ARM_ALU_PC_G1, R_ARM_ALU_PC_G2, R_ARM_LDR_PC_G1, R_ARM_LDR_PC_G2, R_ARM_LDRS_PC_G0, R_ARM_LDRS_PC_G1, R_ARM_LDRS_PC_G2, R_ARM_LDC_PC_G0, R_ARM_LDC_PC_G1, R_ARM_LDC_PC_G2, R_ARM_ALU_SB_G0_NC, R_ARM_ALU_SB_G0, R_ARM_ALU_SB_G1_NC, R_ARM_ALU_SB_G1, R_ARM_ALU_SB_G2, R_ARM_LDR_SB_G0, R_ARM_LDR_SB_G1, R_ARM_LDR_SB_G2, R_ARM_LDRS_SB_G0, R_ARM_LDRS_SB_G1, R_ARM_LDRS_SB_G2, R_ARM_LDC_SB_G0, R_ARM_LDC_SB_G1, R_ARM_LDC_SB_G2): New relocation types. (R_ARM_PC13): Rename to AAELF name R_ARM_LDR_PC_G0 and adjust HOWTO entry to be consistent with R_ARM_LDR_PC_G1 and friends. (elf32_arm_howto_table_3): Delete; contents merged into elf32_arm_howto_table_2. (elf32_arm_howto_from_type): Adjust correspondingly. (elf32_arm_reloc_map): Extend with the above relocations. (calculate_group_reloc_mask): New function. (identify_add_or_sub): New function. (elf32_arm_final_link_relocate): Support for the above relocations. * reloc.c: Add enumeration entries for BFD_RELOC_ARM_... codes to correspond to the above relocations. gas/ * config/tc-arm.c (enum parse_operand_result): New. (struct group_reloc_table_entry): New. (enum group_reloc_type): New. (group_reloc_table): New array. (find_group_reloc_table_entry): New function. (parse_shifter_operand_group_reloc): New function. (parse_address_main): New function, incorporating code from the old parse_address function. To be used via... (parse_address): wrapper for parse_address_main; and (parse_address_group_reloc): new function, likewise. (enum operand_parse_code): New codes OP_SHG, OP_ADDRGLDR, OP_ADDRGLDRS, OP_ADDRGLDC. (parse_operands): Support for these new operand codes. New macro po_misc_or_fail_no_backtrack. (encode_arm_cp_address): Preserve group relocations. (insns): Modify to use the above operand codes where group relocations are permitted. (md_apply_fix): Handle the group relocations ALU_PC_G0_NC through LDC_SB_G2. (tc_gen_reloc): Likewise. (arm_force_relocation): Leave group relocations for the linker. (arm_fix_adjustable): Likewise. gas/testsuite/ * gas/arm/group-reloc-alu.d: New test. * gas/arm/group-reloc-alu-encoding-bad.d: New test. * gas/arm/group-reloc-alu-encoding-bad.l: New test. * gas/arm/group-reloc-alu-encoding-bad.s: New test. * gas/arm/group-reloc-alu-parsing-bad.d: New test. * gas/arm/group-reloc-alu-parsing-bad.l: New test. * gas/arm/group-reloc-alu-parsing-bad.s: New test. * gas/arm/group-reloc-alu.s: New test. * gas/arm/group-reloc-ldc.d: New test. * gas/arm/group-reloc-ldc-encoding-bad.d: New test. * gas/arm/group-reloc-ldc-encoding-bad.l: New test. * gas/arm/group-reloc-ldc-encoding-bad.s: New test. * gas/arm/group-reloc-ldc-parsing-bad.d: New test. * gas/arm/group-reloc-ldc-parsing-bad.l: New test. * gas/arm/group-reloc-ldc-parsing-bad.s: New test. * gas/arm/group-reloc-ldc.s: New test. * gas/arm/group-reloc-ldr.d: New test. * gas/arm/group-reloc-ldr-encoding-bad.d: New test. * gas/arm/group-reloc-ldr-encoding-bad.l: New test. * gas/arm/group-reloc-ldr-encoding-bad.s: New test. * gas/arm/group-reloc-ldr-parsing-bad.d: New test. * gas/arm/group-reloc-ldr-parsing-bad.l: New test. * gas/arm/group-reloc-ldr-parsing-bad.s: New test. * gas/arm/group-reloc-ldr.s: New test. * gas/arm/group-reloc-ldrs.d: New test. * gas/arm/group-reloc-ldrs-encoding-bad.d: New test. * gas/arm/group-reloc-ldrs-encoding-bad.l: New test. * gas/arm/group-reloc-ldrs-encoding-bad.s: New test. * gas/arm/group-reloc-ldrs-parsing-bad.d: New test. * gas/arm/group-reloc-ldrs-parsing-bad.l: New test. * gas/arm/group-reloc-ldrs-parsing-bad.s: New test. * gas/arm/group-reloc-ldrs.s: New test. ld/testsuite/ * ld-arm/group-relocs-alu-bad.d: New test. * ld-arm/group-relocs-alu-bad.s: New test. * ld-arm/group-relocs.d: New test. * ld-arm/group-relocs-ldc-bad.d: New test. * ld-arm/group-relocs-ldc-bad.s: New test. * ld-arm/group-relocs-ldr-bad.d: New test. * ld-arm/group-relocs-ldr-bad.s: New test. * ld-arm/group-relocs-ldrs-bad.d: New test. * ld-arm/group-relocs-ldrs-bad.s: New test. * ld-arm/group-relocs.s: New test. * ld-arm/arm-elf.exp: Wire in new tests.
67 lines
1.1 KiB
ArmAsm
67 lines
1.1 KiB
ArmAsm
@ Tests for LDC group relocations that are meant to fail during parsing.
|
|
|
|
.macro ldctest insn reg
|
|
|
|
\insn 0, \reg, [r0, #:pc_g0_nc:(sym)]
|
|
\insn 0, \reg, [r0, #:pc_g1_nc:(sym)]
|
|
\insn 0, \reg, [r0, #:sb_g0_nc:(sym)]
|
|
\insn 0, \reg, [r0, #:sb_g1_nc:(sym)]
|
|
|
|
\insn 0, \reg, [r0, #:foo:(sym)]
|
|
|
|
.endm
|
|
|
|
.macro ldctest2 insn reg
|
|
|
|
\insn \reg, [r0, #:pc_g0_nc:(sym)]
|
|
\insn \reg, [r0, #:pc_g1_nc:(sym)]
|
|
\insn \reg, [r0, #:sb_g0_nc:(sym)]
|
|
\insn \reg, [r0, #:sb_g1_nc:(sym)]
|
|
|
|
\insn \reg, [r0, #:foo:(sym)]
|
|
|
|
.endm
|
|
|
|
ldctest ldc c0
|
|
ldctest ldcl c0
|
|
ldctest ldc2 c0
|
|
ldctest ldc2l c0
|
|
|
|
ldctest stc c0
|
|
ldctest stcl c0
|
|
ldctest stc2 c0
|
|
ldctest stc2l c0
|
|
|
|
.fpu fpa
|
|
|
|
ldctest2 ldfs f0
|
|
ldctest2 stfs f0
|
|
ldctest2 ldfd f0
|
|
ldctest2 stfd f0
|
|
ldctest2 ldfe f0
|
|
ldctest2 stfe f0
|
|
ldctest2 ldfp f0
|
|
ldctest2 stfp f0
|
|
|
|
.fpu vfp
|
|
|
|
ldctest2 flds s0
|
|
ldctest2 fsts s0
|
|
|
|
ldctest2 fldd d0
|
|
ldctest2 fstd d0
|
|
|
|
ldctest2 vldr d0 FIXME
|
|
ldctest2 vstr d0
|
|
|
|
.cpu ep9312
|
|
|
|
ldctest2 cfldrs mvf0
|
|
ldctest2 cfstrs mvf0
|
|
ldctest2 cfldrd mvd0
|
|
ldctest2 cfstrd mvd0
|
|
ldctest2 cfldr32 mvfx0
|
|
ldctest2 cfstr32 mvfx0
|
|
ldctest2 cfldr64 mvdx0
|
|
ldctest2 cfstr64 mvdx0
|
|
|