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-12-23 16:04:24 +09:00
parent c47d549f53
commit 9d41800b20
2 changed files with 3 additions and 3 deletions

4
mold.h
View File

@ -121,8 +121,8 @@ public:
return const_cast<ValueT *>(&acc->second);
}
void for_each_value(std::function<void(ValueT &)> fn) {
for (typename MapT::iterator it = map.begin(); it != map.end(); ++it)
void for_each_value(std::function<void(const ValueT &)> fn) {
for (typename MapT::const_iterator it = map.begin(); it != map.end(); ++it)
fn(it->second);
}

View File

@ -663,7 +663,7 @@ MergedSection::get_instance(std::string_view name, u32 type, u64 flags) {
void MergedSection::copy_buf() {
u8 *base = out::buf + shdr.sh_offset;
map.for_each_value([&](StringPiece &piece) {
map.for_each_value([&](const StringPiece &piece) {
if (MergeableSection *m = piece.isec)
memcpy(base + m->offset + piece.output_offset, piece.data, piece.size);
});