// TargetObjectWriter wrappers.
bool is64Bit() const { return TargetObjectWriter->is64Bit(); }
- unsigned getRelocType(const MCValue &Target, const MCFixup &Fixup) const {
- return TargetObjectWriter->getRelocType(Target, Fixup);
- }
void startSection(SectionBookkeeping &Section, unsigned SectionId);
void startCustomSection(SectionBookkeeping &Section, StringRef Name);
// be negative and don't wrap.
FixedValue = 0;
- unsigned Type = getRelocType(Target, Fixup);
+ unsigned Type = TargetObjectWriter->getRelocType(Target, Fixup);
assert(!IsPCRel);
assert(SymA);
// WebAssemblyFixupKinds.h.
//
// Name Offset (bits) Size (bits) Flags
- {"fixup_code_sleb128_i32", 0, 5 * 8, 0},
- {"fixup_code_sleb128_i64", 0, 10 * 8, 0},
- {"fixup_code_uleb128_i32", 0, 5 * 8, 0},
+ {"fixup_sleb128_i32", 0, 5 * 8, 0},
+ {"fixup_sleb128_i64", 0, 10 * 8, 0},
+ {"fixup_uleb128_i32", 0, 5 * 8, 0},
};
if (Kind < FirstTargetFixupKind)
namespace llvm {
namespace WebAssembly {
enum Fixups {
- fixup_code_sleb128_i32 = FirstTargetFixupKind, // 32-bit signed
- fixup_code_sleb128_i64, // 64-bit signed
- fixup_code_uleb128_i32, // 32-bit unsigned
+ fixup_sleb128_i32 = FirstTargetFixupKind, // 32-bit signed
+ fixup_sleb128_i64, // 64-bit signed
+ fixup_uleb128_i32, // 32-bit unsigned
// Marker
LastTargetFixupKind,
size_t PaddedSize = 5;
switch (Info.OperandType) {
case WebAssembly::OPERAND_I32IMM:
- FixupKind = MCFixupKind(WebAssembly::fixup_code_sleb128_i32);
+ FixupKind = MCFixupKind(WebAssembly::fixup_sleb128_i32);
break;
case WebAssembly::OPERAND_I64IMM:
- FixupKind = MCFixupKind(WebAssembly::fixup_code_sleb128_i64);
+ FixupKind = MCFixupKind(WebAssembly::fixup_sleb128_i64);
PaddedSize = 10;
break;
case WebAssembly::OPERAND_FUNCTION32:
case WebAssembly::OPERAND_TYPEINDEX:
case WebAssembly::OPERAND_GLOBAL:
case WebAssembly::OPERAND_EVENT:
- FixupKind = MCFixupKind(WebAssembly::fixup_code_uleb128_i32);
+ FixupKind = MCFixupKind(WebAssembly::fixup_uleb128_i32);
break;
default:
llvm_unreachable("unexpected symbolic operand kind");
auto& SymA = cast<MCSymbolWasm>(RefA->getSymbol());
switch (unsigned(Fixup.getKind())) {
- case WebAssembly::fixup_code_sleb128_i32:
+ case WebAssembly::fixup_sleb128_i32:
if (SymA.isFunction())
return wasm::R_WASM_TABLE_INDEX_SLEB;
return wasm::R_WASM_MEMORY_ADDR_SLEB;
- case WebAssembly::fixup_code_sleb128_i64:
+ case WebAssembly::fixup_sleb128_i64:
llvm_unreachable("fixup_sleb128_i64 not implemented yet");
- case WebAssembly::fixup_code_uleb128_i32:
+ case WebAssembly::fixup_uleb128_i32:
if (SymA.isGlobal() || isGOTRef(RefA))
return wasm::R_WASM_GLOBAL_INDEX_LEB;
if (SymA.isFunction()) {
return wasm::R_WASM_SECTION_OFFSET_I32;
}
return wasm::R_WASM_MEMORY_ADDR_I32;
- case FK_Data_8:
- llvm_unreachable("FK_Data_8 not implemented yet");
default:
llvm_unreachable("unimplemented fixup kind");
}