diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -592,8 +592,12 @@ if (sec.sh_link != 0) this->addrsigSec = &sec; else if (config->icf == ICFLevel::Safe) - warn(toString(this) + ": --icf=safe is incompatible with object " - "files created using objcopy or ld -r"); + warn(toString(this) + + ": --icf=safe conservatively ignores " + "SHT_LLVM_ADDRSIG [index " + + Twine(i) + + "] with sh_link=0 " + "(likely created using objcopy or ld -r)"); } this->sections[i] = &InputSection::discarded; continue; diff --git a/lld/test/ELF/icf-safe.s b/lld/test/ELF/icf-safe.s --- a/lld/test/ELF/icf-safe.s +++ b/lld/test/ELF/icf-safe.s @@ -89,7 +89,7 @@ # ALL-EXPORT: removing identical section {{.*}}:(.text.non_addrsig2) # ALL-EXPORT-NOT: selected section -# OBJCOPY: --icf=safe is incompatible with object files created using objcopy or ld -r +# OBJCOPY: --icf=safe conservatively ignores SHT_LLVM_ADDRSIG [index [[#]]] with sh_link=0 (likely created using objcopy or ld -r) .section .text.f1,"ax",@progbits .globl f1