summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-03-06 07:13:10 +0000
committerSam Clegg <sbc@chromium.org>2018-03-06 07:13:10 +0000
commitfa5a04fb86f424611f707665dd8d66c55eec2aaa (patch)
tree489d32dcf0c86e0f04e8902927bca72a322cf1b0 /llvm/lib/Object
parenta7adc3185bef02576a39f0198b26f584cc8a184d (diff)
downloadbcm5719-llvm-fa5a04fb86f424611f707665dd8d66c55eec2aaa.tar.gz
bcm5719-llvm-fa5a04fb86f424611f707665dd8d66c55eec2aaa.zip
[WebAssebmly] Remove reloc ordering constraint
The MC layer doesn't currently emit relocations in offset order for the entire code section so this check was causing failures on the wasm waterfall. Perhaps we can re-instate this check if we divide the relocations per-function, or add extra ordering the MC object writer. Differential Revision: https://reviews.llvm.org/D44136 llvm-svn: 326765
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r--llvm/lib/Object/WasmObjectFile.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index 044bd76e5f6..3b18e194d02 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -554,7 +554,6 @@ Error WasmObjectFile::parseRelocSection(StringRef Name, const uint8_t *Ptr,
return make_error<GenericBinaryError>("Invalid section code",
object_error::parse_failed);
uint32_t RelocCount = readVaruint32(Ptr);
- uint32_t LastOffset = 0;
uint32_t EndOffset = Section->Content.size();
while (RelocCount--) {
wasm::WasmRelocation Reloc = {};
@@ -600,10 +599,9 @@ Error WasmObjectFile::parseRelocSection(StringRef Name, const uint8_t *Ptr,
if (Reloc.Type == wasm::R_WEBASSEMBLY_TABLE_INDEX_I32 ||
Reloc.Type == wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32)
Size = 4;
- if (Reloc.Offset < LastOffset || Reloc.Offset + Size > EndOffset)
+ if (Reloc.Offset + Size > EndOffset)
return make_error<GenericBinaryError>("Bad relocation offset",
object_error::parse_failed);
- LastOffset = Reloc.Offset;
Section->Relocations.push_back(Reloc);
}
OpenPOWER on IntegriCloud