summaryrefslogtreecommitdiff
path: root/lld/ELF/InputFiles.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-11-16 20:26:33 -0800
committerFangrui Song <i@maskray.me>2024-11-16 20:26:34 -0800
commitc1a6defd9ff1540638d660888c5f32ea5cf4fa7d (patch)
tree54922ff6fb3097be9818b984c291afbf6f92d49f /lld/ELF/InputFiles.cpp
parente57331ec6344fd0a5cd04e2f2da38d139cbf2417 (diff)
[ELF] Make RelType a struct type
otherwise operator<<(const ELFSyncStream &s, RelType type) applies to non-reloc-type uint32_t, which can be confusing.
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
-rw-r--r--lld/ELF/InputFiles.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 5a446f3544ad..011ad7e26985 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -1042,8 +1042,8 @@ InputSectionBase *ObjFile<ELFT>::getRelocTarget(uint32_t idx, uint32_t info) {
return target;
}
- ErrAlways(ctx) << this << Twine(": relocation section (index ") << Twine(idx)
- << ") has invalid sh_info (" << Twine(info) << ")";
+ ErrAlways(ctx) << this << Twine(": relocation section (index ") << idx
+ << ") has invalid sh_info (" << info << ')';
return nullptr;
}
@@ -1211,9 +1211,8 @@ void ObjFile<ELFT>::initSectionsAndLocalSyms(bool ignoreComdats) {
if (LLVM_UNLIKELY(secIdx >= sections.size()))
Fatal(ctx) << this << ": invalid section index: " << Twine(secIdx);
if (LLVM_UNLIKELY(eSym.getBinding() != STB_LOCAL))
- ErrAlways(ctx) << this << ": non-local symbol (" << Twine(i)
- << ") found at index < .symtab's sh_info (" << Twine(end)
- << ")";
+ ErrAlways(ctx) << this << ": non-local symbol (" << i
+ << ") found at index < .symtab's sh_info (" << end << ")";
InputSectionBase *sec = sections[secIdx];
uint8_t type = eSym.getType();
@@ -1247,8 +1246,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))
- Err(ctx) << this << ": symbol (" << Twine(i)
- << ") has invalid binding: " << Twine((int)binding);
+ Err(ctx) << this << ": symbol (" << i
+ << ") has invalid binding: " << (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