summaryrefslogtreecommitdiff
path: root/lld/ELF/InputFiles.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2025-01-25 15:28:17 -0800
committerFangrui Song <i@maskray.me>2025-01-25 15:28:17 -0800
commit4f480481716553aa89142131f49e53e7d53c1998 (patch)
treea9a01e13e60d7f7f910307b7e1621a32c387e914 /lld/ELF/InputFiles.cpp
parentd2c7cabe0453d6a6d03c15b7ae1800b53de9e182 (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.cpp11
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;
}