
Summary: This patch adds the file names to llvm-objcopy error messages. It makes easy to identify which file causes an error. Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=41798 Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich Reviewed By: rupprecht, jhenderson, jakehehrlich Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61993 llvm-svn: 361450
31 lines
1.2 KiB
Plaintext
31 lines
1.2 KiB
Plaintext
# RUN: yaml2obj %s -o %t.o
|
|
# RUN: not llvm-objcopy -R .foo %t.o %t1 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR1 -DINPUT=%t.o
|
|
# RUN: cp %t.o %t2
|
|
# RUN: not llvm-strip --no-strip-all -R .foo %t2 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR2 -DINPUT=%t2
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_X86_64
|
|
Sections:
|
|
- Name: .foo
|
|
Type: SHT_PROGBITS
|
|
- Name: .bar
|
|
Type: SHT_PROGBITS
|
|
Link: .foo
|
|
|
|
# ERR1: error: '[[INPUT]]': section '.foo' cannot be removed because it is referenced by the section '.bar'
|
|
# ERR2: error: '[[INPUT]]': section '.foo' cannot be removed because it is referenced by the section '.bar'
|
|
|
|
# RUN: llvm-objcopy --allow-broken-links -R .foo %t.o %t3
|
|
# RUN: llvm-readobj --sections %t3 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.foo
|
|
# RUN: cp %t.o %t4
|
|
# RUN: llvm-strip --no-strip-all --allow-broken-links -R .foo %t4
|
|
# RUN: llvm-readobj --sections %t4 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.foo
|
|
|
|
# SECTIONS: Name: .bar
|
|
# SECTIONS: Link
|
|
# SECTIONS-SAME: : 0
|