1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-17 16:09:43 +03:00

Merge pull request #1177 from ishitatsuyuki/icf-workaround

Ignore addrsig sections corrupted by strip
This commit is contained in:
Rui Ueyama 2024-01-20 20:59:56 +09:00 committed by GitHub
commit c36b83fdea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -356,7 +356,12 @@ void ObjectFile<E>::initialize_sections(Context<E> &ctx) {
// Save .llvm_addrsig for --icf=safe.
if (shdr.sh_type == SHT_LLVM_ADDRSIG && !ctx.arg.relocatable) {
llvm_addrsig = std::move(this->sections[i]);
if (shdr.sh_link != 0) {
llvm_addrsig = std::move(this->sections[i]);
} else {
Warn(ctx) << *this << ": Ignoring .llvm_addrsig section without SH_LINK; " <<
"was the file processed by strip or objcopy -r?";
}
continue;
}