LLVM: lib/Target/AVR/MCTargetDesc/AVRELFObjectWriter.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

12

19

20namespace llvm {

21

22

24public:

26

28

30 bool IsPCRel) const override;

31};

32

35

38 bool IsPCRel) const {

40 switch ((unsigned)Fixup.getKind()) {

42 switch (Spec) {

43 default:

46 return ELF::R_AVR_8;

48 return ELF::R_AVR_DIFF8;

50 return ELF::R_AVR_8_LO8;

52 return ELF::R_AVR_8_HI8;

54 return ELF::R_AVR_8_HLO8;

55 }

57 switch (Spec) {

58 default:

61 return ELF::R_AVR_32;

63 return ELF::R_AVR_DIFF32;

64 }

66 switch (Spec) {

67 default:

70 return ELF::R_AVR_16;

73 return ELF::R_AVR_16_PM;

75 return ELF::R_AVR_DIFF16;

76 }

78 return ELF::R_AVR_32;

80 return ELF::R_AVR_7_PCREL;

82 return ELF::R_AVR_13_PCREL;

84 return ELF::R_AVR_16;

86 return ELF::R_AVR_16_PM;

88 return ELF::R_AVR_LO8_LDI;

90 return ELF::R_AVR_HI8_LDI;

92 return ELF::R_AVR_HH8_LDI;

94 return ELF::R_AVR_LO8_LDI_NEG;

96 return ELF::R_AVR_HI8_LDI_NEG;

98 return ELF::R_AVR_HH8_LDI_NEG;

100 return ELF::R_AVR_LO8_LDI_PM;

102 return ELF::R_AVR_HI8_LDI_PM;

104 return ELF::R_AVR_HH8_LDI_PM;

106 return ELF::R_AVR_LO8_LDI_PM_NEG;

108 return ELF::R_AVR_HI8_LDI_PM_NEG;

110 return ELF::R_AVR_HH8_LDI_PM_NEG;

112 return ELF::R_AVR_CALL;

114 return ELF::R_AVR_LDI;

116 return ELF::R_AVR_6;

118 return ELF::R_AVR_6_ADIW;

120 return ELF::R_AVR_MS8_LDI;

122 return ELF::R_AVR_MS8_LDI_NEG;

124 return ELF::R_AVR_LO8_LDI_GS;

126 return ELF::R_AVR_HI8_LDI_GS;

128 return ELF::R_AVR_8;

130 return ELF::R_AVR_8_LO8;

132 return ELF::R_AVR_8_HI8;

134 return ELF::R_AVR_8_HLO8;

136 return ELF::R_AVR_DIFF8;

138 return ELF::R_AVR_DIFF16;

140 return ELF::R_AVR_DIFF32;

142 return ELF::R_AVR_LDS_STS_16;

144 return ELF::R_AVR_PORT6;

146 return ELF::R_AVR_PORT5;

147 default:

149 }

150}

151

153 return std::make_unique(OSABI);

154}

155

156}

PowerPC TLS Dynamic Call Fixup

AVRELFObjectWriter(uint8_t OSABI)

Definition AVRELFObjectWriter.cpp:33

unsigned getRelocType(const MCFixup &, const MCValue &, bool IsPCRel) const override

Definition AVRELFObjectWriter.cpp:36

~AVRELFObjectWriter() override=default

MCELFObjectTargetWriter(bool Is64Bit_, uint8_t OSABI_, uint16_t EMachine_, bool HasRelocationAddend_, uint8_t ABIVersion_=0)

Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...

Target - Wrapper for Target specific information.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

@ fixup_16_pm

A 16-bit program memory address.

@ fixup_16

A 16-bit address.

@ fixup_call

A 22-bit fixup for the target of a CALL k or JMP k instruction.

@ fixup_hh8_ldi

Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 24-bit value ...

@ fixup_ms8_ldi_neg

Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 32-bi...

@ fixup_32

A 32-bit AVR fixup.

@ fixup_lo8_ldi_neg

Replaces the immediate operand of a 16-bit Rd, K instruction with the lower 8 bits of a negated 16-bi...

@ fixup_6_adiw

A symbol+addr fixup for the `LDD +, " family of instructions.

@ fixup_ms8_ldi

Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 32-bit value ...

@ fixup_7_pcrel

A 7-bit PC-relative fixup for the family of conditional branches which take 7-bit targets (BRNE,...

@ fixup_ldi

Replaces the 8-bit immediate with another value.

@ fixup_lo8_ldi

Replaces the immediate operand of a 16-bit Rd, K instruction with the lower 8 bits of a 16-bit value ...

@ fixup_hi8_ldi_pm_neg

Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 16-bi...

@ fixup_hi8_ldi

Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 16-bit value ...

@ fixup_lo8_ldi_pm

Replaces the immediate operand of a 16-bit Rd, K instruction with the lower 8 bits of a 16-bit progra...

@ fixup_port6

A 6-bit port address.

@ fixup_hh8_ldi_neg

Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 24-bi...

@ fixup_hh8_ldi_pm

Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 24-bit progra...

@ fixup_port5

A 5-bit port address.

@ fixup_lo8_ldi_pm_neg

Replaces the immediate operand of a 16-bit Rd, K instruction with the lower 8 bits of a negated 16-bi...

@ fixup_hi8_ldi_pm

Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 16-bit progra...

@ fixup_hh8_ldi_pm_neg

Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 24-bi...

@ fixup_13_pcrel

A 12-bit PC-relative fixup for the family of branches which take 12-bit targets (RJMP,...

@ fixup_hi8_ldi_neg

Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 16-bi...

@ S_LO8

Corresponds to lo8().

@ S_HH8

Corresponds to hlo8() and hh8().

@ S_PM

Corresponds to pm(), reference to program memory.

@ S_HI8

Corresponds to hi8().

This is an optimization pass for GlobalISel generic memory operations.

std::unique_ptr< MCObjectTargetWriter > createAVRELFObjectWriter(uint8_t OSABI)

Creates an ELF object writer for AVR.

Definition AVRELFObjectWriter.cpp:152

@ FK_Data_1

A one-byte fixup.

@ FK_Data_4

A four-byte fixup.

@ FK_Data_2

A two-byte fixup.