LLVM 24.0.0git
HexagonRelocation.h File Reference
#include "llvm/Support/Compiler.h"
#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  LLVMHexagonRelocInfo
 ABI properties of a Hexagon ELF relocation type, as listed in the Hexagon ABI document. More...

Typedefs

typedef struct LLVMHexagonRelocInfo LLVMHexagonRelocInfo
 ABI properties of a Hexagon ELF relocation type, as listed in the Hexagon ABI document.

Functions

LLVM_ABI bool LLVMHexagonGetRelocationInfo (uint32_t RelocType, LLVMHexagonRelocInfo *Info)
 Fill Info with the properties of RelocType.
LLVM_ABI bool LLVMHexagonVerifyRange (uint32_t RelocType, uint32_t Value)
 Return true if Value fits the range the ABI specifies for RelocType.
LLVM_ABI bool LLVMHexagonVerifyAlignment (uint32_t RelocType, uint32_t Value)
 Return true if Value satisfies the alignment required by RelocType.
LLVM_ABI bool LLVMHexagonIsTruncated (uint32_t RelocType, uint32_t Value)
 Return true if applying the unsigned relocation RelocType to Value would lose set bits.
LLVM_ABI uint32_t LLVMHexagonApplyRelocation (uint32_t RelocType, uint32_t Instruction, uint32_t Value)
 Apply the ELF relocation RelocType with value Value to Instruction.

Typedef Documentation

◆ LLVMHexagonRelocInfo

typedef struct LLVMHexagonRelocInfo LLVMHexagonRelocInfo

ABI properties of a Hexagon ELF relocation type, as listed in the Hexagon ABI document.

Function Documentation

◆ LLVMHexagonApplyRelocation()

LLVM_ABI uint32_t LLVMHexagonApplyRelocation ( uint32_t RelocType,
uint32_t Instruction,
uint32_t Value )

Apply the ELF relocation RelocType with value Value to Instruction.

Hexagon instruction operands may be stored in non-contiguous bit positions. This function locates the operand field for relocations whose mask depends on the instruction encoding, then inserts the relocated value into that field. Value is the raw, unshifted relocation value; the shift specified by LLVMHexagonRelocInfo::Shift is applied internally. The caller is responsible for validating the relocation value (see LLVMHexagonVerifyRange and friends; note VerifyRange and IsTruncated expect a shifted value) and for computing any PC-relative adjustment before calling this function. Instruction is returned unchanged if RelocType is unknown.

Definition at line 128 of file HexagonFindMask.cpp.

References doRelocHelper(), getRelocInfo(), and LLVM_ABI.

◆ LLVMHexagonGetRelocationInfo()

LLVM_ABI bool LLVMHexagonGetRelocationInfo ( uint32_t RelocType,
LLVMHexagonRelocInfo * Info )

Fill Info with the properties of RelocType.

Returns false, leaving Info untouched, if RelocType is not a known Hexagon relocation.

Definition at line 139 of file HexagonFindMask.cpp.

References getRelocInfo(), and LLVM_ABI.

Referenced by llvm::RuntimeDyldELF::processRelocationRef().

◆ LLVMHexagonIsTruncated()

LLVM_ABI bool LLVMHexagonIsTruncated ( uint32_t RelocType,
uint32_t Value )

Return true if applying the unsigned relocation RelocType to Value would lose set bits.

Value must already be shifted right by LLVMHexagonRelocInfo::Shift, as for LLVMHexagonVerifyRange. Returns false for signed or unknown relocations.

Definition at line 170 of file HexagonFindMask.cpp.

References getRelocInfo(), and LLVM_ABI.

◆ LLVMHexagonVerifyAlignment()

LLVM_ABI bool LLVMHexagonVerifyAlignment ( uint32_t RelocType,
uint32_t Value )

Return true if Value satisfies the alignment required by RelocType.

Value is the raw, unshifted relocation value. Returns false for an unknown RelocType. The result is meaningful only for relocations whose LLVMHexagonRelocInfo::VerifyAlignment is set.

Definition at line 165 of file HexagonFindMask.cpp.

References getRelocInfo(), and LLVM_ABI.

◆ LLVMHexagonVerifyRange()

LLVM_ABI bool LLVMHexagonVerifyRange ( uint32_t RelocType,
uint32_t Value )

Return true if Value fits the range the ABI specifies for RelocType.

Value must already be shifted right by LLVMHexagonRelocInfo::Shift. Returns false for an unknown RelocType. The result is meaningful only for relocations whose LLVMHexagonRelocInfo::VerifyRange is set.

Definition at line 156 of file HexagonFindMask.cpp.

References getRelocInfo(), llvm::isIntN(), llvm::isUIntN(), and LLVM_ABI.