mirror of
https://github.com/rui314/mold.git
synced 2024-12-28 02:44:48 +03:00
temporary
This commit is contained in:
parent
9db8675e74
commit
bf4088b4c3
1
main.cc
1
main.cc
@ -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 Counter counter("merged_strings");
|
||||
|
||||
for (MergedSection *osec : MergedSection::instances)
|
||||
counter.inc(osec->map.size());
|
||||
|
||||
|
5
mold.h
5
mold.h
@ -158,14 +158,12 @@ struct StringPiece {
|
||||
|
||||
StringPiece(const StringPiece &other)
|
||||
: data(other.data), isec(other.isec.load()),
|
||||
output_section(other.output_section),
|
||||
output_offset(other.output_offset) {}
|
||||
|
||||
inline u64 get_addr() const;
|
||||
|
||||
StringRef data;
|
||||
std::atomic<InputSection *> isec;
|
||||
MergedSection *output_section = nullptr;
|
||||
u32 output_offset = 0;
|
||||
};
|
||||
|
||||
@ -515,7 +513,8 @@ inline u64 Symbol::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;
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user