summaryrefslogtreecommitdiff
path: root/lld/ELF/InputFiles.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-11-06 22:33:51 -0800
committerFangrui Song <i@maskray.me>2024-11-06 22:33:51 -0800
commit9b058bb42d49afb61b07a7eeeea1ad3d1407f1c9 (patch)
tree9fb05c8cb538f24ecdb387b48e6a0c2dbd1808c0 /lld/ELF/InputFiles.cpp
parentf8bae3af74e7c60d996f0d331cad04f2eace7f8f (diff)
[ELF] Replace errorOrWarn(...) with Err
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
-rw-r--r--lld/ELF/InputFiles.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 6e6d7bfa5160..3b63e46edd09 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -863,8 +863,8 @@ void ObjFile<ELFT>::initializeSections(bool ignoreComdats,
ctx.hasSympart.store(true, std::memory_order_relaxed);
else if (ctx.arg.rejectMismatch &&
!isKnownSpecificSectionType(type, sec.sh_flags))
- errorOrWarn(toString(this->sections[i]) + ": unknown section type 0x" +
- Twine::utohexstr(type));
+ Err(ctx) << this->sections[i] << ": unknown section type 0x"
+ << Twine::utohexstr(type);
break;
}
}
@@ -1247,8 +1247,8 @@ template <class ELFT> void ObjFile<ELFT>::postParse() {
uint8_t binding = eSym.getBinding();
if (LLVM_UNLIKELY(binding != STB_GLOBAL && binding != STB_WEAK &&
binding != STB_GNU_UNIQUE))
- errorOrWarn(toString(this) + ": symbol (" + Twine(i) +
- ") has invalid binding: " + Twine((int)binding));
+ Err(ctx) << this << ": symbol (" << Twine(i)
+ << ") has invalid binding: " << Twine((int)binding);
// st_value of STT_TLS represents the assigned offset, not the actual
// address which is used by STT_FUNC and STT_OBJECT. STT_TLS symbols can
@@ -1256,8 +1256,8 @@ template <class ELFT> void ObjFile<ELFT>::postParse() {
// a STT_TLS symbol is replaced by a non-STT_TLS symbol, vice versa.
if (LLVM_UNLIKELY(sym.isTls()) && eSym.getType() != STT_TLS &&
eSym.getType() != STT_NOTYPE)
- errorOrWarn("TLS attribute mismatch: " + toString(sym) + "\n>>> in " +
- toString(sym.file) + "\n>>> in " + toString(this));
+ Err(ctx) << "TLS attribute mismatch: " << &sym << "\n>>> in " << sym.file
+ << "\n>>> in " << this;
// Handle non-COMMON defined symbol below. !sym.file allows a symbol
// assignment to redefine a symbol without an error.
@@ -1563,8 +1563,8 @@ template <class ELFT> void SharedFile::parse() {
// symbol, that's a violation of the spec.
StringRef name = CHECK(sym.getName(stringTable), this);
if (sym.getBinding() == STB_LOCAL) {
- errorOrWarn(toString(this) + ": invalid local symbol '" + name +
- "' in global part of symbol table");
+ Err(ctx) << this << ": invalid local symbol '" << name
+ << "' in global part of symbol table";
continue;
}