1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-28 02:44:48 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-11-07 20:35:28 +09:00
parent 399a109d65
commit 73c987829e
2 changed files with 4 additions and 3 deletions

3
mold.h
View File

@ -151,7 +151,8 @@ private:
// //
struct StringPiece { struct StringPiece {
StringPiece(StringRef data) : data(data) {} StringPiece(StringRef data, MergeableSection *osec)
: data(data), output_section(osec) {}
StringPiece(const StringPiece &other) StringPiece(const StringPiece &other)
: data(other.data), file(other.file.load()), : data(other.data), file(other.file.load()),

View File

@ -264,7 +264,7 @@ void ObjectFile::read_string_pieces(InputSection *isec) {
StringRef substr = data.substr(0, end); StringRef substr = data.substr(0, end);
data = data.substr(end + 1); data = data.substr(end + 1);
StringPiece *piece = osec->map.insert(substr, StringPiece(substr)); StringPiece *piece = osec->map.insert(substr, StringPiece(substr, osec));
isec->pieces.push_back({piece, offset}); isec->pieces.push_back({piece, offset});
offset += substr.size() + 1; offset += substr.size() + 1;