mirror of
https://github.com/rui314/mold.git
synced 2024-11-11 16:58:12 +03:00
temporary
This commit is contained in:
parent
399a109d65
commit
73c987829e
3
mold.h
3
mold.h
@ -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()),
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user