Skip to content

Commit 8948673

Browse files
committed
Switch RPATH from single string to vector of strings
1 parent c5119b0 commit 8948673

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

llvm/include/llvm/BinaryFormat/Wasm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ struct WasmDylinkInfo {
295295
std::vector<StringRef> Needed; // Shared library dependencies
296296
std::vector<WasmDylinkImportInfo> ImportInfo;
297297
std::vector<WasmDylinkExportInfo> ExportInfo;
298-
StringRef RuntimePath;
298+
std::vector<StringRef> RuntimePath;
299299
};
300300

301301
struct WasmProducerInfo {

llvm/include/llvm/ObjectYAML/WasmYAML.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ struct DylinkSection : CustomSection {
230230
std::vector<StringRef> Needed;
231231
std::vector<DylinkImportInfo> ImportInfo;
232232
std::vector<DylinkExportInfo> ExportInfo;
233-
StringRef RuntimePath;
233+
std::vector<StringRef> RuntimePath;
234234
};
235235

236236
struct NameSection : CustomSection {

llvm/lib/Object/WasmObjectFile.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,10 @@ Error WasmObjectFile::parseDylink0Section(ReadContext &Ctx) {
485485
break;
486486
}
487487
case wasm::WASM_DYLINK_RUNTIME_PATH: {
488-
DylinkInfo.RuntimePath = readString(Ctx);
488+
Count = readVaruint32(Ctx);
489+
while (Count--) {
490+
DylinkInfo.RuntimePath.push_back(readString(Ctx));
491+
}
489492
break;
490493
}
491494
default:

llvm/lib/ObjectYAML/WasmEmitter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ void WasmWriter::writeSectionContent(raw_ostream &OS,
183183
if (Section.RuntimePath.size()) {
184184
writeUint8(OS, wasm::WASM_DYLINK_RUNTIME_PATH);
185185
raw_ostream &SubOS = SubSection.getStream();
186-
writeStringRef(Section.RuntimePath, SubOS);
186+
encodeULEB128(Section.RuntimePath.size(), SubOS);
187+
for (StringRef Path : Section.RuntimePath)
188+
writeStringRef(Path, SubOS);
187189
SubSection.done();
188190
}
189191
}

llvm/test/ObjectYAML/wasm/dylink_section.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Sections:
1111
TableSize: 1
1212
TableAlignment: 0
1313
Needed: [ libfoo.so, libbar.so ]
14-
RuntimePath: $ORIGIN/../lib:$ORIGIN/../../.libs
14+
RuntimePath: [ $ORIGIN/../lib, $ORIGIN/../../.libs]
1515
...
1616
# CHECK: --- !WASM
1717
# CHECK: FileHeader:
@@ -26,5 +26,7 @@ Sections:
2626
# CHECK: Needed:
2727
# CHECK: - libfoo.so
2828
# CHECK: - libbar.so
29-
# CHECK: RuntimePath: '$ORIGIN/../lib:$ORIGIN/../../.libs'
29+
# CHECK: RuntimePath:
30+
# CHECK: - '$ORIGIN/../lib'
31+
# CHECK: - '$ORIGIN/../../.libs'
3032
# CHECK: ...

0 commit comments

Comments
 (0)