From 9188934590550898c720c274514db6d67d74a183 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 3 Nov 2020 19:59:05 +0900 Subject: [PATCH] temporary --- mold.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mold.h b/mold.h index d72698ab..3d9d346d 100644 --- a/mold.h +++ b/mold.h @@ -417,12 +417,14 @@ public: contents = '\0'; shdr.sh_flags = 0; shdr.sh_type = llvm::ELF::SHT_STRTAB; + shdr.sh_size = 1; } u64 add_string(StringRef s) { u64 ret = contents.size(); contents += s.str(); contents += '\0'; + shdr.sh_size = contents.size(); return ret; } @@ -430,7 +432,7 @@ public: 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: std::string contents;