2010-11-04 01:12:30 +00:00
|
|
|
//===-- ARM/ARMFixupKinds.h - ARM Specific Fixup Entries --------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_ARM_ARMFIXUPKINDS_H
|
|
|
|
#define LLVM_ARM_ARMFIXUPKINDS_H
|
|
|
|
|
|
|
|
#include "llvm/MC/MCFixup.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
namespace ARM {
|
|
|
|
enum Fixups {
|
2010-12-02 00:28:45 +00:00
|
|
|
// fixup_arm_ldst_pcrel_12 - 12-bit PC relative relocation for symbol
|
|
|
|
// addresses
|
|
|
|
fixup_arm_ldst_pcrel_12 = FirstTargetFixupKind,
|
2010-12-14 21:28:29 +00:00
|
|
|
|
2010-12-09 01:51:07 +00:00
|
|
|
// fixup_t2_ldst_pcrel_12 - Equivalent to fixup_arm_ldst_pcrel_12, with
|
|
|
|
// the 16-bit halfwords reordered.
|
|
|
|
fixup_t2_ldst_pcrel_12,
|
2010-12-14 21:28:29 +00:00
|
|
|
|
2010-12-01 19:18:46 +00:00
|
|
|
// fixup_arm_pcrel_10 - 10-bit PC relative relocation for symbol addresses
|
2010-12-08 00:18:36 +00:00
|
|
|
// used in VFP instructions where the lower 2 bits are not encoded
|
2010-12-01 19:18:46 +00:00
|
|
|
// (so it's encoded as an 8-bit immediate).
|
|
|
|
fixup_arm_pcrel_10,
|
2010-12-08 00:18:36 +00:00
|
|
|
// fixup_t2_pcrel_10 - Equivalent to fixup_arm_pcrel_10, accounting for
|
2010-12-09 00:27:41 +00:00
|
|
|
// the short-swapped encoding of Thumb2 instructions.
|
2010-12-08 00:18:36 +00:00
|
|
|
fixup_t2_pcrel_10,
|
2010-12-14 22:28:03 +00:00
|
|
|
// fixup_thumb_adr_pcrel_10 - 10-bit PC relative relocation for symbol
|
|
|
|
// addresses where the lower 2 bits are not encoded (so it's encoded as an
|
|
|
|
// 8-bit immediate).
|
|
|
|
fixup_thumb_adr_pcrel_10,
|
2010-12-02 00:28:45 +00:00
|
|
|
// fixup_arm_adr_pcrel_12 - 12-bit PC relative relocation for the ADR
|
|
|
|
// instruction.
|
|
|
|
fixup_arm_adr_pcrel_12,
|
2010-12-14 00:36:49 +00:00
|
|
|
// fixup_t2_adr_pcrel_12 - 12-bit PC relative relocation for the ADR
|
|
|
|
// instruction.
|
|
|
|
fixup_t2_adr_pcrel_12,
|
2011-02-04 19:47:15 +00:00
|
|
|
// fixup_arm_condbranch - 24-bit PC relative relocation for conditional branch
|
|
|
|
// instructions.
|
|
|
|
fixup_arm_condbranch,
|
|
|
|
// fixup_arm_uncondbranch - 24-bit PC relative relocation for
|
|
|
|
// branch instructions. (unconditional)
|
|
|
|
fixup_arm_uncondbranch,
|
2010-12-14 21:28:29 +00:00
|
|
|
// fixup_t2_condbranch - 20-bit PC relative relocation for Thumb2 direct
|
2010-12-13 19:31:11 +00:00
|
|
|
// uconditional branch instructions.
|
|
|
|
fixup_t2_condbranch,
|
2010-12-14 21:28:29 +00:00
|
|
|
// fixup_t2_uncondbranch - 20-bit PC relative relocation for Thumb2 direct
|
2010-12-13 19:31:11 +00:00
|
|
|
// branch unconditional branch instructions.
|
|
|
|
fixup_t2_uncondbranch,
|
2010-12-08 23:01:43 +00:00
|
|
|
|
2010-12-10 18:21:33 +00:00
|
|
|
// fixup_arm_thumb_br - 12-bit fixup for Thumb B instructions.
|
|
|
|
fixup_arm_thumb_br,
|
|
|
|
|
2010-12-09 00:39:08 +00:00
|
|
|
// fixup_arm_thumb_blx - Fixup for Thumb BL instructions.
|
2010-12-06 23:57:07 +00:00
|
|
|
fixup_arm_thumb_bl,
|
2010-11-11 18:04:49 +00:00
|
|
|
|
2010-12-09 00:39:08 +00:00
|
|
|
// fixup_arm_thumb_blx - Fixup for Thumb BLX instructions.
|
|
|
|
fixup_arm_thumb_blx,
|
|
|
|
|
2010-12-09 19:50:12 +00:00
|
|
|
// fixup_arm_thumb_cb - Fixup for Thumb branch instructions.
|
|
|
|
fixup_arm_thumb_cb,
|
2010-12-08 23:01:43 +00:00
|
|
|
|
2010-12-08 01:57:09 +00:00
|
|
|
// fixup_arm_thumb_cp - Fixup for Thumb load/store from constant pool instrs.
|
|
|
|
fixup_arm_thumb_cp,
|
|
|
|
|
2010-12-14 22:26:49 +00:00
|
|
|
// fixup_arm_thumb_bcc - Fixup for Thumb conditional branching instructions.
|
2010-12-10 17:13:40 +00:00
|
|
|
fixup_arm_thumb_bcc,
|
|
|
|
|
2010-11-18 23:37:15 +00:00
|
|
|
// The next two are for the movt/movw pair
|
|
|
|
// the 16bit imm field are split into imm{15-12} and imm{11-0}
|
|
|
|
fixup_arm_movt_hi16, // :upper16:
|
|
|
|
fixup_arm_movw_lo16, // :lower16:
|
2011-01-14 02:38:49 +00:00
|
|
|
fixup_t2_movt_hi16, // :upper16:
|
|
|
|
fixup_t2_movw_lo16, // :lower16:
|
2010-11-18 23:37:15 +00:00
|
|
|
|
2011-01-12 00:19:25 +00:00
|
|
|
// It is possible to create an "immediate" that happens to be pcrel.
|
2011-01-12 23:25:02 +00:00
|
|
|
// movw r0, :lower16:Foo-(Bar+8) and movt r0, :upper16:Foo-(Bar+8)
|
|
|
|
// result in different reloc tags than the above two.
|
2011-01-12 00:19:25 +00:00
|
|
|
// Needed to support ELF::R_ARM_MOVT_PREL and ELF::R_ARM_MOVW_PREL_NC
|
|
|
|
fixup_arm_movt_hi16_pcrel, // :upper16:
|
|
|
|
fixup_arm_movw_lo16_pcrel, // :lower16:
|
2011-01-14 02:38:49 +00:00
|
|
|
fixup_t2_movt_hi16_pcrel, // :upper16:
|
|
|
|
fixup_t2_movw_lo16_pcrel, // :lower16:
|
2011-01-12 00:19:25 +00:00
|
|
|
|
2010-11-11 18:04:49 +00:00
|
|
|
// Marker
|
|
|
|
LastTargetFixupKind,
|
|
|
|
NumTargetFixupKinds = LastTargetFixupKind - FirstTargetFixupKind
|
2010-11-04 01:12:30 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|