1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-26 18:02:30 +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 {
StringPiece(StringRef data) : data(data) {}
StringPiece(StringRef data, MergeableSection *osec)
: data(data), output_section(osec) {}
StringPiece(const StringPiece &other)
: data(other.data), file(other.file.load()),

View File

@ -249,7 +249,7 @@ void ObjectFile::read_string_pieces(InputSection *isec) {
MergeableSection *osec =
MergeableSection::get_instance(isec->name, isec->shdr.sh_flags,
isec->shdr.sh_type);
isec->shdr.sh_type);
u32 offset = 0;
@ -264,7 +264,7 @@ void ObjectFile::read_string_pieces(InputSection *isec) {
StringRef substr = data.substr(0, end);
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});
offset += substr.size() + 1;