summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-02-27 23:57:37 +0000
committerSam Clegg <sbc@chromium.org>2018-02-27 23:57:37 +0000
commit86b4a09a99b689f9717bd17cabd850857a53388d (patch)
tree260b68ecf7adf33be82da0880e0aa8109820296f /llvm/lib
parent48a533d005d1de74e680896be8124b950b12f6fc (diff)
downloadbcm5719-llvm-86b4a09a99b689f9717bd17cabd850857a53388d.tar.gz
bcm5719-llvm-86b4a09a99b689f9717bd17cabd850857a53388d.zip
[WebAssembly] Remove DataSize from linking metadata section
Neither the linker nor the runtime need this information anymore. We were originally using this to model BSS size but the plan is now to use the segment metadata to allow for BSS segments. Differential Revision: https://reviews.llvm.org/D41366 llvm-svn: 326267
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp12
-rw-r--r--llvm/lib/Object/WasmObjectFile.cpp5
-rw-r--r--llvm/lib/ObjectYAML/WasmYAML.cpp1
3 files changed, 3 insertions, 15 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index 8b32cc4c7b5..b1ce2c3c8f0 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -274,7 +274,7 @@ private:
void writeCodeRelocSection();
void writeDataRelocSection();
void writeLinkingMetaDataSection(
- uint32_t DataSize, ArrayRef<wasm::WasmSymbolInfo> SymbolInfos,
+ ArrayRef<wasm::WasmSymbolInfo> SymbolInfos,
ArrayRef<std::pair<uint16_t, uint32_t>> InitFuncs,
const std::map<StringRef, std::vector<WasmComdatEntry>> &Comdats);
@@ -862,7 +862,7 @@ void WasmObjectWriter::writeDataRelocSection() {
}
void WasmObjectWriter::writeLinkingMetaDataSection(
- uint32_t DataSize, ArrayRef<wasm::WasmSymbolInfo> SymbolInfos,
+ ArrayRef<wasm::WasmSymbolInfo> SymbolInfos,
ArrayRef<std::pair<uint16_t, uint32_t>> InitFuncs,
const std::map<StringRef, std::vector<WasmComdatEntry>> &Comdats) {
SectionBookkeeping Section;
@@ -897,12 +897,6 @@ void WasmObjectWriter::writeLinkingMetaDataSection(
endSection(SubSection);
}
- if (DataSize > 0) {
- startSection(SubSection, wasm::WASM_DATA_SIZE);
- encodeULEB128(DataSize, getStream());
- endSection(SubSection);
- }
-
if (DataSegments.size()) {
startSection(SubSection, wasm::WASM_SEGMENT_INFO);
encodeULEB128(DataSegments.size(), getStream());
@@ -1316,7 +1310,7 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
writeDataSection();
writeCodeRelocSection();
writeDataRelocSection();
- writeLinkingMetaDataSection(DataSize, SymbolInfos, InitFuncs, Comdats);
+ writeLinkingMetaDataSection(SymbolInfos, InitFuncs, Comdats);
// TODO: Translate the .comment section to the output.
// TODO: Translate debug sections to the output.
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index 4483dae809d..4ae2d3bcaf6 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -197,8 +197,6 @@ static Error readSection(WasmSection &Section, const uint8_t *&Ptr,
WasmObjectFile::WasmObjectFile(MemoryBufferRef Buffer, Error &Err)
: ObjectFile(Binary::ID_Wasm, Buffer) {
- LinkingData.DataSize = 0;
-
ErrorAsOutParameter ErrAsOutParam(&Err);
Header.Magic = getData().substr(0, 4);
if (Header.Magic != StringRef("\0asm", 4)) {
@@ -334,9 +332,6 @@ Error WasmObjectFile::parseLinkingSection(const uint8_t *Ptr,
if (Error Err = parseLinkingSectionSymtab(Ptr, SubSectionEnd))
return Err;
break;
- case wasm::WASM_DATA_SIZE:
- LinkingData.DataSize = readVaruint32(Ptr);
- break;
case wasm::WASM_SEGMENT_INFO: {
uint32_t Count = readVaruint32(Ptr);
if (Count > DataSegments.size())
diff --git a/llvm/lib/ObjectYAML/WasmYAML.cpp b/llvm/lib/ObjectYAML/WasmYAML.cpp
index 9433cf6a783..72df93b876a 100644
--- a/llvm/lib/ObjectYAML/WasmYAML.cpp
+++ b/llvm/lib/ObjectYAML/WasmYAML.cpp
@@ -57,7 +57,6 @@ static void sectionMapping(IO &IO, WasmYAML::NameSection &Section) {
static void sectionMapping(IO &IO, WasmYAML::LinkingSection &Section) {
commonSectionMapping(IO, Section);
IO.mapRequired("Name", Section.Name);
- IO.mapRequired("DataSize", Section.DataSize);
IO.mapOptional("SymbolTable", Section.SymbolTable);
IO.mapOptional("SegmentInfo", Section.SegmentInfos);
IO.mapOptional("InitFunctions", Section.InitFunctions);
OpenPOWER on IntegriCloud