Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction) which requires assemble‐ or run‐ time patching.

Synopsis

Declared in <llvm/MC/MCFixup.h>

class MCFixup;

Description

Fixups are used any time the target instruction encoder needs to represent some value in an instruction which is not yet concrete. The encoder will encode the instruction assuming the value is 0, and emit a fixup which communicates to the assembler backend how it should rewrite the encoded value.

During the process of relaxation, the assembler will apply fixups as symbolic values become concrete. When relaxation is complete, any remaining fixups become relocations in the object file (or errors, if the fixup cannot be encoded on the target).

Member Functions

Name

Description

getKind

Return the target‐dependent kind of this fixup.

getLoc

Return the source location associated with this fixup.

getOffset

Return the byte offset of this fixup within its fragment.

getValue

Return the expression whose value should be written at the fixup.

isLinkerRelaxable

Return true if this fixup is linker‐relaxable.

isPCRel

Return true if this is a PC‐relative fixup.

setLinkerRelaxable

Mark this fixup as linker‐relaxable.

setOffset

Set the byte offset of this fixup within its fragment.

setPCRel

Mark this fixup as PC‐relative.

Static Member Functions

Name

Description

create

Create a fixup at Offset for Value with the given Kind.

getDataKindForSize

Return the generic fixup kind for a value with the given size. It is an error to pass an unsupported size.

Created with MrDocs