1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-29 11:24:36 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-11-07 22:16:07 +09:00
parent 9db8675e74
commit bf4088b4c3
2 changed files with 2 additions and 4 deletions

View File

@ -124,7 +124,6 @@ static std::vector<ArrayRef<T>> split(const std::vector<T> &input, int unit) {
static void handle_mergeable_strings(std::vector<ObjectFile *> &files) { static void handle_mergeable_strings(std::vector<ObjectFile *> &files) {
static Counter counter("merged_strings"); static Counter counter("merged_strings");
for (MergedSection *osec : MergedSection::instances) for (MergedSection *osec : MergedSection::instances)
counter.inc(osec->map.size()); counter.inc(osec->map.size());

5
mold.h
View File

@ -158,14 +158,12 @@ struct StringPiece {
StringPiece(const StringPiece &other) StringPiece(const StringPiece &other)
: data(other.data), isec(other.isec.load()), : data(other.data), isec(other.isec.load()),
output_section(other.output_section),
output_offset(other.output_offset) {} output_offset(other.output_offset) {}
inline u64 get_addr() const; inline u64 get_addr() const;
StringRef data; StringRef data;
std::atomic<InputSection *> isec; std::atomic<InputSection *> isec;
MergedSection *output_section = nullptr;
u32 output_offset = 0; u32 output_offset = 0;
}; };
@ -515,7 +513,8 @@ inline u64 Symbol::get_addr() const {
} }
inline u64 StringPiece::get_addr() const { inline u64 StringPiece::get_addr() const {
return output_section->shdr.sh_addr + output_offset; InputSection *is = isec;
return is->merged_section->shdr.sh_addr + is->merged_offset + output_offset;
} }
// //