1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/test/tools/llvm-objdump/relocations-in-nonreloc.test
Jordan Rupprecht 1a3cc9353e [llvm-objdump] Print file format in lowercase to match GNU output.
Summary:
GNU objdump prints the file format in lowercase, e.g. `elf64-x86-64`. llvm-objdump prints `ELF64-x86-64` right now, even though piping that into llvm-objcopy refuses that as a valid arch to use.

As an example of a problem this causes, see: https://github.com/ClangBuiltLinux/linux/issues/779

Reviewers: MaskRay, jhenderson, alexshap

Reviewed By: MaskRay

Subscribers: tpimh, sbc100, grimar, jvesely, nhaehnle, kerbowa, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D74433
2020-02-12 08:17:01 -08:00

60 lines
1.4 KiB
Plaintext

## Check that objdump doesn't print relocations in non-relocatable object files.
# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: llvm-objdump -r %t1 | FileCheck %s -DFILE=%t1 --check-prefix=FMT --implicit-check-not={{.}}
# RUN: yaml2obj --docnum=2 %s -o %t2
# RUN: llvm-objdump -r %t2 | FileCheck %s -DFILE=%t2 --check-prefix=FMT --implicit-check-not={{.}}
# RUN: yaml2obj --docnum=3 %s -o %t3
# RUN: llvm-objdump -r %t3 | FileCheck %s -DFILE=%t3 --check-prefixes=FMT,REL --implicit-check-not={{.}}
# FMT: [[FILE]]: file format elf64-x86-64
# REL: RELOCATION RECORDS FOR []:
# REL-NEXT: OFFSET TYPE VALUE
# REL-NEXT: 0000000000000123 R_X86_64_NONE *ABS*+0x141
## Executable.
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .rela.plt
Type: SHT_RELA
Relocations:
- Offset: 0x123
Type: R_X86_64_NONE
Addend: 321
## DSO.
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_DYN
Machine: EM_X86_64
Sections:
- Name: .rela.plt
Type: SHT_RELA
Relocations:
- Offset: 0x123
Type: R_X86_64_NONE
Addend: 321
## Relocatable.
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .rela.plt
Type: SHT_RELA
Relocations:
- Offset: 0x123
Type: R_X86_64_NONE
Addend: 321