mirror of
https://github.com/rui314/mold.git
synced 2024-12-29 11:24:36 +03:00
temporary
This commit is contained in:
parent
0c8dbbda0a
commit
9188934590
4
mold.h
4
mold.h
@ -417,12 +417,14 @@ public:
|
|||||||
contents = '\0';
|
contents = '\0';
|
||||||
shdr.sh_flags = 0;
|
shdr.sh_flags = 0;
|
||||||
shdr.sh_type = llvm::ELF::SHT_STRTAB;
|
shdr.sh_type = llvm::ELF::SHT_STRTAB;
|
||||||
|
shdr.sh_size = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 add_string(StringRef s) {
|
u64 add_string(StringRef s) {
|
||||||
u64 ret = contents.size();
|
u64 ret = contents.size();
|
||||||
contents += s.str();
|
contents += s.str();
|
||||||
contents += '\0';
|
contents += '\0';
|
||||||
|
shdr.sh_size = contents.size();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -430,7 +432,7 @@ public:
|
|||||||
memcpy(buf + shdr.sh_offset, &contents[0], contents.size());
|
memcpy(buf + shdr.sh_offset, &contents[0], contents.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 get_size() const override { return contents.size(); }
|
u64 get_size() const override { return shdr.sh_size; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string contents;
|
std::string contents;
|
||||||
|
Loading…
Reference in New Issue
Block a user