1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

[test/Object] - Move/rewrite 2 more test cases.

This patch makes a change for test/Object tests responsible
for relocations.

* 2 tests were moved to llvm-readobj/llvm-objdump folders:
Object/elf-reloc-no-sym.test -> tools/llvm-readobj/elf-reloc-no-sym.test
Object/objdump-reloc-shared.test -> tools/llvm-objdump/relocations-in-nonreloc.test

* A prerecompiled binary was removed and these tests were refactored.

Differential revision: https://reviews.llvm.org/D66291

llvm-svn: 369342
This commit is contained in:
George Rimar 2019-08-20 08:23:57 +00:00
parent 0141652683
commit aac454ba82
5 changed files with 84 additions and 12 deletions

View File

@ -1,7 +0,0 @@
RUN: llvm-readobj -r %p/Inputs/elf-reloc-no-sym.x86_64 | FileCheck %s
CHECK: Relocations [
CHECK-NEXT: Section (1) .rela.plt {
CHECK-NEXT: 0x4011D8 R_X86_64_IRELATIVE - 0x400120
CHECK-NEXT: }
CHECK-NEXT: ]

View File

@ -1,5 +0,0 @@
RUN: llvm-objdump -r %p/Inputs/elf-reloc-no-sym.x86_64 \
RUN: | FileCheck %s
; CHECK: elf-reloc-no-sym.x86_64: file format ELF64-x86-64
; CHECK-NOT: {{.}}

View File

@ -0,0 +1,58 @@
## 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: 0000000000000123 R_X86_64_NONE *ABS*+321
## 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

View File

@ -0,0 +1,26 @@
## Check llvm-readobj is able to dump relocations that
## do not use symbols.
# RUN: yaml2obj %s -o %t
# RUN: llvm-readobj -r %t | FileCheck %s
# CHECK: Relocations [
# CHECK-NEXT: Section (1) .rela.plt {
# CHECK-NEXT: 0x12345678 R_X86_64_IRELATIVE - 0x87654321
# CHECK-NEXT: }
# CHECK-NEXT: ]
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .rela.plt
Type: SHT_RELA
Flags: [ SHF_ALLOC ]
Relocations:
- Offset: 0x12345678
Type: R_X86_64_IRELATIVE
Addend: 0x87654321