forked from OSchip/llvm-project
parent
0805ec5f7b
commit
a9958fc30d
|
@ -22,7 +22,7 @@ using namespace llvm::support::endian;
|
||||||
using namespace lld;
|
using namespace lld;
|
||||||
using namespace lld::wasm;
|
using namespace lld::wasm;
|
||||||
|
|
||||||
StringRef lld::reloctTypeToString(uint8_t RelocType) {
|
StringRef lld::relocTypeToString(uint8_t RelocType) {
|
||||||
switch (RelocType) {
|
switch (RelocType) {
|
||||||
#define WASM_RELOC(NAME, REL) \
|
#define WASM_RELOC(NAME, REL) \
|
||||||
case REL: \
|
case REL: \
|
||||||
|
@ -78,7 +78,7 @@ void InputChunk::verifyRelocTargets() const {
|
||||||
if (Rel.Type != R_WASM_GLOBAL_INDEX_LEB) {
|
if (Rel.Type != R_WASM_GLOBAL_INDEX_LEB) {
|
||||||
uint32_t ExpectedValue = File->calcExpectedValue(Rel);
|
uint32_t ExpectedValue = File->calcExpectedValue(Rel);
|
||||||
if (ExpectedValue != ExistingValue)
|
if (ExpectedValue != ExistingValue)
|
||||||
warn("unexpected existing value for " + reloctTypeToString(Rel.Type) +
|
warn("unexpected existing value for " + relocTypeToString(Rel.Type) +
|
||||||
": existing=" + Twine(ExistingValue) +
|
": existing=" + Twine(ExistingValue) +
|
||||||
" expected=" + Twine(ExpectedValue));
|
" expected=" + Twine(ExpectedValue));
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ void InputChunk::writeTo(uint8_t *Buf) const {
|
||||||
for (const WasmRelocation &Rel : Relocations) {
|
for (const WasmRelocation &Rel : Relocations) {
|
||||||
uint8_t *Loc = Buf + Rel.Offset + Off;
|
uint8_t *Loc = Buf + Rel.Offset + Off;
|
||||||
uint32_t Value = File->calcNewValue(Rel);
|
uint32_t Value = File->calcNewValue(Rel);
|
||||||
LLVM_DEBUG(dbgs() << "apply reloc: type=" << reloctTypeToString(Rel.Type)
|
LLVM_DEBUG(dbgs() << "apply reloc: type=" << relocTypeToString(Rel.Type)
|
||||||
<< " addend=" << Rel.Addend << " index=" << Rel.Index
|
<< " addend=" << Rel.Addend << " index=" << Rel.Index
|
||||||
<< " value=" << Value << " offset=" << Rel.Offset
|
<< " value=" << Value << " offset=" << Rel.Offset
|
||||||
<< "\n");
|
<< "\n");
|
||||||
|
|
|
@ -218,7 +218,7 @@ protected:
|
||||||
} // namespace wasm
|
} // namespace wasm
|
||||||
|
|
||||||
std::string toString(const wasm::InputChunk *);
|
std::string toString(const wasm::InputChunk *);
|
||||||
StringRef reloctTypeToString(uint8_t RelocType);
|
StringRef relocTypeToString(uint8_t RelocType);
|
||||||
|
|
||||||
} // namespace lld
|
} // namespace lld
|
||||||
|
|
||||||
|
|
|
@ -1160,7 +1160,7 @@ void Writer::processRelocations(InputChunk *Chunk) {
|
||||||
auto *Sym = File->getSymbols()[Reloc.Index];
|
auto *Sym = File->getSymbols()[Reloc.Index];
|
||||||
if (Sym->isUndefined() && !Sym->isWeak())
|
if (Sym->isUndefined() && !Sym->isWeak())
|
||||||
error(File->getName() + ": relocation " +
|
error(File->getName() + ": relocation " +
|
||||||
reloctTypeToString(Reloc.Type) +
|
relocTypeToString(Reloc.Type) +
|
||||||
" cannot be used againt symbol " + Sym->getName() +
|
" cannot be used againt symbol " + Sym->getName() +
|
||||||
"; recompile with -fPIC");
|
"; recompile with -fPIC");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue