File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
test/tools/llvm-objcopy/ELF Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 3
3
4
4
# RUN: yaml2obj %s > %t1
5
5
# RUN: not llvm-objcopy -R .data %t1 2>&1 | FileCheck %s
6
- # CHECK: error: Section .data cannot be removed because of symbol 'foo' used by the relocation patching offset 0x1 from section .rela.text.
6
+ # CHECK: error: Section .data can't be removed: (.text+0x1) has relocation against symbol 'foo'
7
7
8
8
## Check the behavior when we also remove the relocation section.
9
9
## We have no reference in this case and hence no error should be emitted.
Original file line number Diff line number Diff line change @@ -557,12 +557,12 @@ Error RelocationSection::removeSectionReferences(
557
557
for (const Relocation &R : Relocations) {
558
558
if (!R.RelocSymbol ->DefinedIn || !ToRemove (R.RelocSymbol ->DefinedIn ))
559
559
continue ;
560
- return createStringError (
561
- llvm::errc::invalid_argument,
562
- " Section %s cannot be removed because of symbol '%s' "
563
- " used by the relocation patching offset 0x% " PRIx64 " from section %s. " ,
564
- R. RelocSymbol -> DefinedIn -> Name .data (), R.RelocSymbol -> Name . c_str () ,
565
- R. Offset , this ->Name .data ());
560
+ return createStringError (llvm::errc::invalid_argument,
561
+ " Section %s can't be removed: (%s+0x% " PRIx64
562
+ " ) has relocation against symbol '%s'" ,
563
+ R. RelocSymbol -> DefinedIn -> Name . data () ,
564
+ SecToApplyRel-> Name .data (), R.Offset ,
565
+ R. RelocSymbol ->Name .c_str ());
566
566
}
567
567
568
568
return Error::success ();
You can’t perform that action at this time.
0 commit comments