Skip to content

Commit

Permalink
Merge pull request rui314#1177 from ishitatsuyuki/icf-workaround
Browse files Browse the repository at this point in the history
Ignore addrsig sections corrupted by strip
  • Loading branch information
rui314 authored Jan 20, 2024
2 parents 29c0baa + fede4a8 commit c36b83f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion elf/input-files.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c36b83f

Please sign in to comment.