LLVM 20.0.0git
Namespaces | Macros | Enumerations | Functions
ARMAsmBackend.cpp File Reference
#include "MCTargetDesc/ARMAsmBackend.h"
#include "MCTargetDesc/ARMAddressingModes.h"
#include "MCTargetDesc/ARMAsmBackendDarwin.h"
#include "MCTargetDesc/ARMAsmBackendELF.h"
#include "MCTargetDesc/ARMAsmBackendWinCOFF.h"
#include "MCTargetDesc/ARMFixupKinds.h"
#include "MCTargetDesc/ARMMCTargetDesc.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDirectives.h"
#include "llvm/MC/MCELFObjectWriter.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCTargetOptions.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/BinaryFormat/ELFRelocs/ARM.def"

Go to the source code of this file.

Namespaces

namespace  CU
 

Macros

#define ELF_RELOC(X, Y)   .Case(#X, Y)
 

Enumerations

enum  CU::CompactUnwindEncodings {
  CU::UNWIND_ARM_MODE_MASK = 0x0F000000 , CU::UNWIND_ARM_MODE_FRAME = 0x01000000 , CU::UNWIND_ARM_MODE_FRAME_D = 0x02000000 , CU::UNWIND_ARM_MODE_DWARF = 0x04000000 ,
  CU::UNWIND_ARM_FRAME_STACK_ADJUST_MASK = 0x00C00000 , CU::UNWIND_ARM_FRAME_FIRST_PUSH_R4 = 0x00000001 , CU::UNWIND_ARM_FRAME_FIRST_PUSH_R5 = 0x00000002 , CU::UNWIND_ARM_FRAME_FIRST_PUSH_R6 = 0x00000004 ,
  CU::UNWIND_ARM_FRAME_SECOND_PUSH_R8 = 0x00000008 , CU::UNWIND_ARM_FRAME_SECOND_PUSH_R9 = 0x00000010 , CU::UNWIND_ARM_FRAME_SECOND_PUSH_R10 = 0x00000020 , CU::UNWIND_ARM_FRAME_SECOND_PUSH_R11 = 0x00000040 ,
  CU::UNWIND_ARM_FRAME_SECOND_PUSH_R12 = 0x00000080 , CU::UNWIND_ARM_FRAME_D_REG_COUNT_MASK = 0x00000F00 , CU::UNWIND_ARM_DWARF_SECTION_OFFSET = 0x00FFFFFF
}
 Compact unwind encoding values. More...
 

Functions

static const charcheckPCRelOffset (uint64_t Value, int64_t Min, int64_t Max)
 
static uint32_t swapHalfWords (uint32_t Value, bool IsLittleEndian)
 
static uint32_t joinHalfWords (uint32_t FirstHalf, uint32_t SecondHalf, bool IsLittleEndian)
 
static unsigned getFixupKindNumBytes (unsigned Kind)
 getFixupKindNumBytes - The number of bytes the fixup may change.
 
static unsigned getFixupKindContainerSizeBytes (unsigned Kind)
 getFixupKindContainerSizeBytes - The number of bytes of the container involved in big endian.
 
static MCAsmBackendcreateARMAsmBackend (const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options, llvm::endianness Endian)
 

Macro Definition Documentation

◆ ELF_RELOC

#define ELF_RELOC (   X,
  Y 
)    .Case(#X, Y)

Function Documentation

◆ checkPCRelOffset()

static const char * checkPCRelOffset ( uint64_t  Value,
int64_t  Min,
int64_t  Max 
)
static

Definition at line 253 of file ARMAsmBackend.cpp.

References llvm::Offset.

Referenced by llvm::ARMAsmBackend::reasonForFixupRelaxation().

◆ createARMAsmBackend()

static MCAsmBackend * createARMAsmBackend ( const Target T,
const MCSubtargetInfo STI,
const MCRegisterInfo MRI,
const MCTargetOptions Options,
llvm::endianness  Endian 
)
static

◆ getFixupKindContainerSizeBytes()

static unsigned getFixupKindContainerSizeBytes ( unsigned  Kind)
static

getFixupKindContainerSizeBytes - The number of bytes of the container involved in big endian.

Definition at line 1046 of file ARMAsmBackend.cpp.

References llvm::ARM::fixup_arm_adr_pcrel_12, llvm::ARM::fixup_arm_blx, llvm::ARM::fixup_arm_condbl, llvm::ARM::fixup_arm_condbranch, llvm::ARM::fixup_arm_ldst_pcrel_12, llvm::ARM::fixup_arm_mod_imm, llvm::ARM::fixup_arm_movt_hi16, llvm::ARM::fixup_arm_movw_lo16, llvm::ARM::fixup_arm_pcrel_10, llvm::ARM::fixup_arm_pcrel_10_unscaled, llvm::ARM::fixup_arm_pcrel_9, llvm::ARM::fixup_arm_thumb_bcc, llvm::ARM::fixup_arm_thumb_bl, llvm::ARM::fixup_arm_thumb_blx, llvm::ARM::fixup_arm_thumb_br, llvm::ARM::fixup_arm_thumb_cb, llvm::ARM::fixup_arm_thumb_cp, llvm::ARM::fixup_arm_thumb_lower_0_7, llvm::ARM::fixup_arm_thumb_lower_8_15, llvm::ARM::fixup_arm_thumb_upper_0_7, llvm::ARM::fixup_arm_thumb_upper_8_15, llvm::ARM::fixup_arm_uncondbl, llvm::ARM::fixup_arm_uncondbranch, llvm::ARM::fixup_bf_branch, llvm::ARM::fixup_bf_target, llvm::ARM::fixup_bfc_target, llvm::ARM::fixup_bfcsel_else_target, llvm::ARM::fixup_bfl_target, llvm::ARM::fixup_le, llvm::ARM::fixup_t2_adr_pcrel_12, llvm::ARM::fixup_t2_condbranch, llvm::ARM::fixup_t2_ldst_pcrel_12, llvm::ARM::fixup_t2_movt_hi16, llvm::ARM::fixup_t2_movw_lo16, llvm::ARM::fixup_t2_pcrel_10, llvm::ARM::fixup_t2_pcrel_9, llvm::ARM::fixup_t2_so_imm, llvm::ARM::fixup_t2_uncondbranch, llvm::ARM::fixup_thumb_adr_pcrel_10, llvm::ARM::fixup_wls, llvm::FK_Data_1, llvm::FK_Data_2, llvm::FK_Data_4, and llvm_unreachable.

Referenced by llvm::ARMAsmBackend::applyFixup().

◆ getFixupKindNumBytes()

static unsigned getFixupKindNumBytes ( unsigned  Kind)
static

getFixupKindNumBytes - The number of bytes the fixup may change.

Definition at line 980 of file ARMAsmBackend.cpp.

References llvm::ARM::fixup_arm_adr_pcrel_12, llvm::ARM::fixup_arm_blx, llvm::ARM::fixup_arm_condbl, llvm::ARM::fixup_arm_condbranch, llvm::ARM::fixup_arm_ldst_abs_12, llvm::ARM::fixup_arm_ldst_pcrel_12, llvm::ARM::fixup_arm_mod_imm, llvm::ARM::fixup_arm_movt_hi16, llvm::ARM::fixup_arm_movw_lo16, llvm::ARM::fixup_arm_pcrel_10, llvm::ARM::fixup_arm_pcrel_10_unscaled, llvm::ARM::fixup_arm_pcrel_9, llvm::ARM::fixup_arm_thumb_bcc, llvm::ARM::fixup_arm_thumb_bl, llvm::ARM::fixup_arm_thumb_blx, llvm::ARM::fixup_arm_thumb_br, llvm::ARM::fixup_arm_thumb_cb, llvm::ARM::fixup_arm_thumb_cp, llvm::ARM::fixup_arm_thumb_lower_0_7, llvm::ARM::fixup_arm_thumb_lower_8_15, llvm::ARM::fixup_arm_thumb_upper_0_7, llvm::ARM::fixup_arm_thumb_upper_8_15, llvm::ARM::fixup_arm_uncondbl, llvm::ARM::fixup_arm_uncondbranch, llvm::ARM::fixup_bf_branch, llvm::ARM::fixup_bf_target, llvm::ARM::fixup_bfc_target, llvm::ARM::fixup_bfcsel_else_target, llvm::ARM::fixup_bfl_target, llvm::ARM::fixup_le, llvm::ARM::fixup_t2_adr_pcrel_12, llvm::ARM::fixup_t2_condbranch, llvm::ARM::fixup_t2_ldst_pcrel_12, llvm::ARM::fixup_t2_movt_hi16, llvm::ARM::fixup_t2_movw_lo16, llvm::ARM::fixup_t2_pcrel_10, llvm::ARM::fixup_t2_pcrel_9, llvm::ARM::fixup_t2_so_imm, llvm::ARM::fixup_t2_uncondbranch, llvm::ARM::fixup_thumb_adr_pcrel_10, llvm::ARM::fixup_wls, llvm::FK_Data_1, llvm::FK_Data_2, llvm::FK_Data_4, llvm::FK_SecRel_2, llvm::FK_SecRel_4, and llvm_unreachable.

◆ joinHalfWords()

static uint32_t joinHalfWords ( uint32_t  FirstHalf,
uint32_t  SecondHalf,
bool  IsLittleEndian 
)
static

Definition at line 427 of file ARMAsmBackend.cpp.

Referenced by llvm::ARMAsmBackend::adjustFixupValue().

◆ swapHalfWords()

static uint32_t swapHalfWords ( uint32_t  Value,
bool  IsLittleEndian 
)
static

Definition at line 416 of file ARMAsmBackend.cpp.

Referenced by llvm::ARMAsmBackend::adjustFixupValue().