diff options
| author | Fangrui Song <i@maskray.me> | 2025-01-25 15:28:17 -0800 |
|---|---|---|
| committer | Fangrui Song <i@maskray.me> | 2025-01-25 15:28:17 -0800 |
| commit | 4f480481716553aa89142131f49e53e7d53c1998 (patch) | |
| tree | a9a01e13e60d7f7f910307b7e1621a32c387e914 /lld/ELF/InputFiles.cpp | |
| parent | d2c7cabe0453d6a6d03c15b7ae1800b53de9e182 (diff) | |
[ELF] SHF_MERGE: avoid Fatal
In LLD_IN_TEST=2 mode, when a thread calls Fatal, there will be no
output even if the process exits with code 1.
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index c3c6812c2620..b29c7db879fa 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -700,13 +700,12 @@ bool ObjFile<ELFT>::shouldMerge(const Elf_Shdr &sec, StringRef name) { if (entSize == 0) return false; if (sec.sh_size % entSize) - Fatal(ctx) << this << ":(" << name << "): SHF_MERGE section size (" - << uint64_t(sec.sh_size) - << ") must be a multiple of sh_entsize (" << entSize << ")"; - + ErrAlways(ctx) << this << ":(" << name << "): SHF_MERGE section size (" + << uint64_t(sec.sh_size) + << ") must be a multiple of sh_entsize (" << entSize << ")"; if (sec.sh_flags & SHF_WRITE) - Fatal(ctx) << this << ":(" << name - << "): writable SHF_MERGE section is not supported"; + Err(ctx) << this << ":(" << name + << "): writable SHF_MERGE section is not supported"; return true; } |
