diff options
| author | Fangrui Song <i@maskray.me> | 2025-01-25 18:13:42 -0800 |
|---|---|---|
| committer | Fangrui Song <i@maskray.me> | 2025-01-25 18:13:42 -0800 |
| commit | c1f10ef0a5c15f1dccf87ff07699055297c715a5 (patch) | |
| tree | 06e5b72f97166742eb397694b7d459a0c282fbc8 /lld/ELF/InputFiles.cpp | |
| parent | 18335f4800ae5491a11e74a574969d716acddce7 (diff) | |
[ELF] SHF_LINK_ORDER: replace Fatal with ErrAlways
In LLD_IN_TEST=2 mode, when a thread calls Fatal, there will be no
output even if the process exits with code 1. Change the Fatal to
ErrAlways (not-recoverable) as subsequent code assumes SHF_LINK_ORDER
sh_link is correct.
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index e236057a0d6d..eba4c234d3f1 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -890,9 +890,11 @@ void ObjFile<ELFT>::initializeSections(bool ignoreComdats, InputSectionBase *linkSec = nullptr; if (sec.sh_link < size) linkSec = this->sections[sec.sh_link]; - if (!linkSec) - Fatal(ctx) << this - << ": invalid sh_link index: " << uint32_t(sec.sh_link); + if (!linkSec) { + ErrAlways(ctx) << this + << ": invalid sh_link index: " << uint32_t(sec.sh_link); + continue; + } // A SHF_LINK_ORDER section is discarded if its linked-to section is // discarded. |
