summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/strip-section-err.test2
-rw-r--r--llvm/tools/llvm-objcopy/ELF/Object.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/llvm/test/tools/llvm-objcopy/ELF/strip-section-err.test b/llvm/test/tools/llvm-objcopy/ELF/strip-section-err.test
index f95185aba62..9bcea100bb9 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/strip-section-err.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/strip-section-err.test
@@ -3,7 +3,7 @@
# RUN: yaml2obj %s > %t1
# RUN: not llvm-objcopy -R .data %t1 2>&1 | FileCheck %s
-# CHECK: error: Section .data cannot be removed because of symbol 'foo' used by the relocation patching offset 0x1 from section .rela.text.
+# CHECK: error: Section .data can't be removed: (.text+0x1) has relocation against symbol 'foo'
## Check the behavior when we also remove the relocation section.
## We have no reference in this case and hence no error should be emitted.
diff --git a/llvm/tools/llvm-objcopy/ELF/Object.cpp b/llvm/tools/llvm-objcopy/ELF/Object.cpp
index a3ddfbec35d..e2944ae3e24 100644
--- a/llvm/tools/llvm-objcopy/ELF/Object.cpp
+++ b/llvm/tools/llvm-objcopy/ELF/Object.cpp
@@ -557,12 +557,12 @@ Error RelocationSection::removeSectionReferences(
for (const Relocation &R : Relocations) {
if (!R.RelocSymbol->DefinedIn || !ToRemove(R.RelocSymbol->DefinedIn))
continue;
- return createStringError(
- llvm::errc::invalid_argument,
- "Section %s cannot be removed because of symbol '%s' "
- "used by the relocation patching offset 0x%" PRIx64 " from section %s.",
- R.RelocSymbol->DefinedIn->Name.data(), R.RelocSymbol->Name.c_str(),
- R.Offset, this->Name.data());
+ return createStringError(llvm::errc::invalid_argument,
+ "Section %s can't be removed: (%s+0x%" PRIx64
+ ") has relocation against symbol '%s'",
+ R.RelocSymbol->DefinedIn->Name.data(),
+ SecToApplyRel->Name.data(), R.Offset,
+ R.RelocSymbol->Name.c_str());
}
return Error::success();
OpenPOWER on IntegriCloud