[test] - Remove precomiled openbsd-phdrs.elf-x86-64 objects.

There are 2 similar openbsd-phdrs.elf-x86-64 objects committed and
used in test/Object and test/tools/llvm-objdump test cases.

There is no reason to have them, we can use YAML instead. Patch does that.

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

llvm-svn: 369189
This commit is contained in:
George Rimar 2019-08-17 14:23:30 +00:00
parent 5dafd11de1
commit fd5f9a7c78
5 changed files with 186 additions and 207 deletions

View File

@ -1,20 +0,0 @@
## openbsd-phdrs.elf-x86-64 was generated using GNU ld (GNU Binutils for Ubuntu) 2.26.1.
## llvm-mc -filetype=obj -triple=x86_64-pc-linux test.s -o main.o
## ld -script linker.script main.o -o openbsd-phdrs.elf-x86-64
##
## test.s is an empty file.
## linker.script:
## PHDRS { text PT_LOAD FILEHDR PHDRS; foo 0x65a3dbe6; bar 0x65a3dbe7; zed 0x65a41be6; }
## Where 0x65a3dbe6 is the value of PT_OPENBSD_RANDOMIZE,
## 0x65a3dbe7 is the value of PT_OPENBSD_WXNEEDED,
## 0x65a41be6 is the value of PT_OPENBSD_BOOTDATA
## SECTIONS { . = SIZEOF_HEADERS; .all : { *(.*) } : text }
RUN: llvm-objdump -p %p/Inputs/openbsd-phdrs.elf-x86-64 \
RUN: | FileCheck %s
CHECK: OPENBSD_RANDOMIZE off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
CHECK-NEXT: OPENBSD_WXNEEDED off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
CHECK-NEXT: OPENBSD_BOOTDATA off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---

View File

@ -0,0 +1,22 @@
## Check that llvm-objdump dumps OpenBSD program headers correctly.
# RUN: yaml2obj %s -o %t
# RUN: llvm-objdump -p %t | FileCheck %s
# CHECK: OPENBSD_RANDOMIZE off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**0
# CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
# CHECK-NEXT: OPENBSD_WXNEEDED off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**0
# CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
# CHECK-NEXT: OPENBSD_BOOTDATA off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**0
# CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
ProgramHeaders:
- Type: 0x65a3dbe6 ## PT_OPENBSD_RANDOMIZE
- Type: 0x65a3dbe7 ## PT_OPENBSD_WXNEEDED
- Type: 0x65a41be6 ## PT_OPENBSD_BOOTDATA

View File

@ -1,193 +1,170 @@
RUN: llvm-readobj --program-headers %p/../../Object/Inputs/program-headers.elf-i386 \
RUN: | FileCheck %s -check-prefix ELF-I386
RUN: llvm-readobj -l %p/../../Object/Inputs/program-headers.elf-i386 \
RUN: | FileCheck %s -check-prefix ELF-I386
RUN: llvm-readobj -l %p/../../Object/Inputs/program-headers.elf-x86-64 \
RUN: | FileCheck %s -check-prefix ELF-X86-64
RUN: llvm-readobj -l %p/../../Object/Inputs/program-headers.mips \
RUN: | FileCheck %s -check-prefix ELF-MIPS
RUN: llvm-readobj -l %p/../../Object/Inputs/program-headers.mips64 \
RUN: | FileCheck %s -check-prefix ELF-MIPS64
# RUN: llvm-readobj --program-headers %p/../../Object/Inputs/program-headers.elf-i386 \
# RUN: | FileCheck %s -check-prefix ELF-I386
# RUN: llvm-readobj -l %p/../../Object/Inputs/program-headers.elf-i386 \
# RUN: | FileCheck %s -check-prefix ELF-I386
## openbsd-phdrs.elf-x86-64 was generated using GNU ld (GNU Binutils for Ubuntu) 2.26.1.
## llvm-mc -filetype=obj -triple=x86_64-pc-linux test.s -o main.o
## ld -script linker.script main.o -o openbsd-phdrs.elf-x86-64
##
## test.s is an empty file.
## linker.script:
## PHDRS { text PT_LOAD FILEHDR PHDRS; foo 0x65a3dbe6; bar 0x65a3dbe7; zed 0x65a41be6; }
## Where 0x65a3dbe6 is the value of PT_OPENBSD_RANDOMIZE,
## 0x65a3dbe7 is the value of PT_OPENBSD_WXNEEDED,
## 0x65a41be6 is the value of PT_OPENBSD_BOOTDATA
## SECTIONS { . = SIZEOF_HEADERS; .all : { *(.*) } : text }
RUN: llvm-readobj -l %p/../../Object/Inputs/openbsd-phdrs.elf-x86-64 \
RUN: | FileCheck %s -check-prefix OPENBSD-X86-64
# ELF-I386: ProgramHeaders [
# ELF-I386-NEXT: ProgramHeader {
# ELF-I386-NEXT: Type: PT_LOAD (0x1)
# ELF-I386-NEXT: Offset: 0x0
# ELF-I386-NEXT: VirtualAddress: 0x8048000
# ELF-I386-NEXT: PhysicalAddress: 0x8048000
# ELF-I386-NEXT: FileSize: 308
# ELF-I386-NEXT: MemSize: 308
# ELF-I386-NEXT: Flags [ (0x5)
# ELF-I386-NEXT: PF_R (0x4)
# ELF-I386-NEXT: PF_X (0x1)
# ELF-I386-NEXT: ]
# ELF-I386-NEXT: Alignment: 4096
# ELF-I386-NEXT: }
# ELF-I386-NEXT: ProgramHeader {
# ELF-I386-NEXT: Type: PT_GNU_STACK (0x6474E551)
# ELF-I386-NEXT: Offset: 0x0
# ELF-I386-NEXT: VirtualAddress: 0x0
# ELF-I386-NEXT: PhysicalAddress: 0x0
# ELF-I386-NEXT: FileSize: 0
# ELF-I386-NEXT: MemSize: 0
# ELF-I386-NEXT: Flags [ (0x6)
# ELF-I386-NEXT: PF_R (0x4)
# ELF-I386-NEXT: PF_W (0x2)
# ELF-I386-NEXT: ]
# ELF-I386-NEXT: Alignment: 4
# ELF-I386-NEXT: }
# ELF-I386-NEXT: ]
ELF-I386: ProgramHeaders [
ELF-I386-NEXT: ProgramHeader {
ELF-I386-NEXT: Type: PT_LOAD (0x1)
ELF-I386-NEXT: Offset: 0x0
ELF-I386-NEXT: VirtualAddress: 0x8048000
ELF-I386-NEXT: PhysicalAddress: 0x8048000
ELF-I386-NEXT: FileSize: 308
ELF-I386-NEXT: MemSize: 308
ELF-I386-NEXT: Flags [ (0x5)
ELF-I386-NEXT: PF_R (0x4)
ELF-I386-NEXT: PF_X (0x1)
ELF-I386-NEXT: ]
ELF-I386-NEXT: Alignment: 4096
ELF-I386-NEXT: }
ELF-I386-NEXT: ProgramHeader {
ELF-I386-NEXT: Type: PT_GNU_STACK (0x6474E551)
ELF-I386-NEXT: Offset: 0x0
ELF-I386-NEXT: VirtualAddress: 0x0
ELF-I386-NEXT: PhysicalAddress: 0x0
ELF-I386-NEXT: FileSize: 0
ELF-I386-NEXT: MemSize: 0
ELF-I386-NEXT: Flags [ (0x6)
ELF-I386-NEXT: PF_R (0x4)
ELF-I386-NEXT: PF_W (0x2)
ELF-I386-NEXT: ]
ELF-I386-NEXT: Alignment: 4
ELF-I386-NEXT: }
ELF-I386-NEXT: ]
# RUN: llvm-readobj -l %p/../../Object/Inputs/program-headers.elf-x86-64 \
# RUN: | FileCheck %s -check-prefix ELF-X86-64
ELF-X86-64: ProgramHeaders [
ELF-X86-64-NEXT: ProgramHeader {
ELF-X86-64-NEXT: Type: PT_LOAD (0x1)
ELF-X86-64-NEXT: Offset: 0x0
ELF-X86-64-NEXT: VirtualAddress: 0x400000
ELF-X86-64-NEXT: PhysicalAddress: 0x400000
ELF-X86-64-NEXT: FileSize: 312
ELF-X86-64-NEXT: MemSize: 312
ELF-X86-64-NEXT: Flags [ (0x5)
ELF-X86-64-NEXT: PF_R (0x4)
ELF-X86-64-NEXT: PF_X (0x1)
ELF-X86-64-NEXT: ]
ELF-X86-64-NEXT: Alignment: 2097152
ELF-X86-64-NEXT: }
ELF-X86-64-NEXT: ProgramHeader {
ELF-X86-64-NEXT: Type: PT_GNU_EH_FRAME (0x6474E550)
ELF-X86-64-NEXT: Offset: 0xF4
ELF-X86-64-NEXT: VirtualAddress: 0x4000F4
ELF-X86-64-NEXT: PhysicalAddress: 0x4000F4
ELF-X86-64-NEXT: FileSize: 20
ELF-X86-64-NEXT: MemSize: 20
ELF-X86-64-NEXT: Flags [ (0x4)
ELF-X86-64-NEXT: PF_R (0x4)
ELF-X86-64-NEXT: ]
ELF-X86-64-NEXT: Alignment: 4
ELF-X86-64-NEXT: }
ELF-X86-64-NEXT: ProgramHeader {
ELF-X86-64-NEXT: Type: PT_GNU_STACK (0x6474E551)
ELF-X86-64-NEXT: Offset: 0x0
ELF-X86-64-NEXT: VirtualAddress: 0x0
ELF-X86-64-NEXT: PhysicalAddress: 0x0
ELF-X86-64-NEXT: FileSize: 0
ELF-X86-64-NEXT: MemSize: 0
ELF-X86-64-NEXT: Flags [ (0x6)
ELF-X86-64-NEXT: PF_R (0x4)
ELF-X86-64-NEXT: PF_W (0x2)
ELF-X86-64-NEXT: ]
ELF-X86-64-NEXT: Alignment: 8
ELF-X86-64-NEXT: }
ELF-X86-64-NEXT: ]
# ELF-X86-64: ProgramHeaders [
# ELF-X86-64-NEXT: ProgramHeader {
# ELF-X86-64-NEXT: Type: PT_LOAD (0x1)
# ELF-X86-64-NEXT: Offset: 0x0
# ELF-X86-64-NEXT: VirtualAddress: 0x400000
# ELF-X86-64-NEXT: PhysicalAddress: 0x400000
# ELF-X86-64-NEXT: FileSize: 312
# ELF-X86-64-NEXT: MemSize: 312
# ELF-X86-64-NEXT: Flags [ (0x5)
# ELF-X86-64-NEXT: PF_R (0x4)
# ELF-X86-64-NEXT: PF_X (0x1)
# ELF-X86-64-NEXT: ]
# ELF-X86-64-NEXT: Alignment: 2097152
# ELF-X86-64-NEXT: }
# ELF-X86-64-NEXT: ProgramHeader {
# ELF-X86-64-NEXT: Type: PT_GNU_EH_FRAME (0x6474E550)
# ELF-X86-64-NEXT: Offset: 0xF4
# ELF-X86-64-NEXT: VirtualAddress: 0x4000F4
# ELF-X86-64-NEXT: PhysicalAddress: 0x4000F4
# ELF-X86-64-NEXT: FileSize: 20
# ELF-X86-64-NEXT: MemSize: 20
# ELF-X86-64-NEXT: Flags [ (0x4)
# ELF-X86-64-NEXT: PF_R (0x4)
# ELF-X86-64-NEXT: ]
# ELF-X86-64-NEXT: Alignment: 4
# ELF-X86-64-NEXT: }
# ELF-X86-64-NEXT: ProgramHeader {
# ELF-X86-64-NEXT: Type: PT_GNU_STACK (0x6474E551)
# ELF-X86-64-NEXT: Offset: 0x0
# ELF-X86-64-NEXT: VirtualAddress: 0x0
# ELF-X86-64-NEXT: PhysicalAddress: 0x0
# ELF-X86-64-NEXT: FileSize: 0
# ELF-X86-64-NEXT: MemSize: 0
# ELF-X86-64-NEXT: Flags [ (0x6)
# ELF-X86-64-NEXT: PF_R (0x4)
# ELF-X86-64-NEXT: PF_W (0x2)
# ELF-X86-64-NEXT: ]
# ELF-X86-64-NEXT: Alignment: 8
# ELF-X86-64-NEXT: }
# ELF-X86-64-NEXT: ]
ELF-MIPS: Format: ELF32-mips
ELF-MIPS-NEXT: Arch: mips
ELF-MIPS-NEXT: AddressSize: 32bit
ELF-MIPS-NEXT: LoadName:
ELF-MIPS-NEXT: ProgramHeaders [
ELF-MIPS-NEXT: ProgramHeader {
ELF-MIPS-NEXT: Type: PT_MIPS_ABIFLAGS (0x70000003)
ELF-MIPS-NEXT: Offset: 0x98
ELF-MIPS-NEXT: VirtualAddress: 0x400098
ELF-MIPS-NEXT: PhysicalAddress: 0x400098
ELF-MIPS-NEXT: FileSize: 24
ELF-MIPS-NEXT: MemSize: 24
ELF-MIPS-NEXT: Flags [ (0x4)
ELF-MIPS-NEXT: PF_R (0x4)
ELF-MIPS-NEXT: ]
ELF-MIPS-NEXT: Alignment: 8
ELF-MIPS-NEXT: }
ELF-MIPS-NEXT: ProgramHeader {
ELF-MIPS-NEXT: Type: PT_MIPS_REGINFO (0x70000000)
ELF-MIPS-NEXT: Offset: 0xB0
ELF-MIPS-NEXT: VirtualAddress: 0x4000B0
ELF-MIPS-NEXT: PhysicalAddress: 0x4000B0
ELF-MIPS-NEXT: FileSize: 24
ELF-MIPS-NEXT: MemSize: 24
ELF-MIPS-NEXT: Flags [ (0x4)
ELF-MIPS-NEXT: PF_R (0x4)
ELF-MIPS-NEXT: ]
ELF-MIPS-NEXT: Alignment: 4
ELF-MIPS-NEXT: }
ELF-MIPS-NEXT: ProgramHeader {
ELF-MIPS-NEXT: Type: PT_LOAD (0x1)
ELF-MIPS-NEXT: Offset: 0x0
ELF-MIPS-NEXT: VirtualAddress: 0x400000
ELF-MIPS-NEXT: PhysicalAddress: 0x400000
ELF-MIPS-NEXT: FileSize: 224
ELF-MIPS-NEXT: MemSize: 224
ELF-MIPS-NEXT: Flags [ (0x5)
ELF-MIPS-NEXT: PF_R (0x4)
ELF-MIPS-NEXT: PF_X (0x1)
ELF-MIPS-NEXT: ]
ELF-MIPS-NEXT: Alignment: 65536
ELF-MIPS-NEXT: }
ELF-MIPS-NEXT: ]
# RUN: llvm-readobj -l %p/../../Object/Inputs/program-headers.mips \
# RUN: | FileCheck %s -check-prefix ELF-MIPS
ELF-MIPS64: Format: ELF64-mips
ELF-MIPS64-NEXT: Arch: mips64
ELF-MIPS64-NEXT: AddressSize: 64bit
ELF-MIPS64-NEXT: LoadName:
ELF-MIPS64-NEXT: ProgramHeaders [
ELF-MIPS64-NEXT: ProgramHeader {
ELF-MIPS64-NEXT: Type: PT_LOAD (0x1)
ELF-MIPS64-NEXT: Offset: 0x0
ELF-MIPS64-NEXT: VirtualAddress: 0x120000000
ELF-MIPS64-NEXT: PhysicalAddress: 0x120000000
ELF-MIPS64-NEXT: FileSize: 136
ELF-MIPS64-NEXT: MemSize: 136
ELF-MIPS64-NEXT: Flags [ (0x5)
ELF-MIPS64-NEXT: PF_R (0x4)
ELF-MIPS64-NEXT: PF_X (0x1)
ELF-MIPS64-NEXT: ]
ELF-MIPS64-NEXT: Alignment: 65536
ELF-MIPS64-NEXT: }
ELF-MIPS64-NEXT: ]
# ELF-MIPS: Format: ELF32-mips
# ELF-MIPS-NEXT: Arch: mips
# ELF-MIPS-NEXT: AddressSize: 32bit
# ELF-MIPS-NEXT: LoadName:
# ELF-MIPS-NEXT: ProgramHeaders [
# ELF-MIPS-NEXT: ProgramHeader {
# ELF-MIPS-NEXT: Type: PT_MIPS_ABIFLAGS (0x70000003)
# ELF-MIPS-NEXT: Offset: 0x98
# ELF-MIPS-NEXT: VirtualAddress: 0x400098
# ELF-MIPS-NEXT: PhysicalAddress: 0x400098
# ELF-MIPS-NEXT: FileSize: 24
# ELF-MIPS-NEXT: MemSize: 24
# ELF-MIPS-NEXT: Flags [ (0x4)
# ELF-MIPS-NEXT: PF_R (0x4)
# ELF-MIPS-NEXT: ]
# ELF-MIPS-NEXT: Alignment: 8
# ELF-MIPS-NEXT: }
# ELF-MIPS-NEXT: ProgramHeader {
# ELF-MIPS-NEXT: Type: PT_MIPS_REGINFO (0x70000000)
# ELF-MIPS-NEXT: Offset: 0xB0
# ELF-MIPS-NEXT: VirtualAddress: 0x4000B0
# ELF-MIPS-NEXT: PhysicalAddress: 0x4000B0
# ELF-MIPS-NEXT: FileSize: 24
# ELF-MIPS-NEXT: MemSize: 24
# ELF-MIPS-NEXT: Flags [ (0x4)
# ELF-MIPS-NEXT: PF_R (0x4)
# ELF-MIPS-NEXT: ]
# ELF-MIPS-NEXT: Alignment: 4
# ELF-MIPS-NEXT: }
# ELF-MIPS-NEXT: ProgramHeader {
# ELF-MIPS-NEXT: Type: PT_LOAD (0x1)
# ELF-MIPS-NEXT: Offset: 0x0
# ELF-MIPS-NEXT: VirtualAddress: 0x400000
# ELF-MIPS-NEXT: PhysicalAddress: 0x400000
# ELF-MIPS-NEXT: FileSize: 224
# ELF-MIPS-NEXT: MemSize: 224
# ELF-MIPS-NEXT: Flags [ (0x5)
# ELF-MIPS-NEXT: PF_R (0x4)
# ELF-MIPS-NEXT: PF_X (0x1)
# ELF-MIPS-NEXT: ]
# ELF-MIPS-NEXT: Alignment: 65536
# ELF-MIPS-NEXT: }
# ELF-MIPS-NEXT: ]
OPENBSD-X86-64: ProgramHeaders [
OPENBSD-X86-64: ProgramHeader {
OPENBSD-X86-64: Type: PT_OPENBSD_RANDOMIZE
OPENBSD-X86-64-NEXT: Offset:
OPENBSD-X86-64-NEXT: VirtualAddress:
OPENBSD-X86-64-NEXT: PhysicalAddress:
OPENBSD-X86-64-NEXT: FileSize:
OPENBSD-X86-64-NEXT: MemSize:
OPENBSD-X86-64-NEXT: Flags [
OPENBSD-X86-64-NEXT: ]
OPENBSD-X86-64-NEXT: Alignment:
OPENBSD-X86-64-NEXT: }
OPENBSD-X86-64-NEXT: ProgramHeader {
OPENBSD-X86-64-NEXT: Type: PT_OPENBSD_WXNEEDED
OPENBSD-X86-64-NEXT: Offset:
OPENBSD-X86-64-NEXT: VirtualAddress:
OPENBSD-X86-64-NEXT: PhysicalAddress:
OPENBSD-X86-64-NEXT: FileSize:
OPENBSD-X86-64-NEXT: MemSize:
OPENBSD-X86-64-NEXT: Flags [
OPENBSD-X86-64-NEXT: ]
OPENBSD-X86-64-NEXT: Alignment:
OPENBSD-X86-64-NEXT: }
OPENBSD-X86-64-NEXT: ProgramHeader {
OPENBSD-X86-64-NEXT: Type: PT_OPENBSD_BOOTDATA
OPENBSD-X86-64-NEXT: Offset:
OPENBSD-X86-64-NEXT: VirtualAddress:
OPENBSD-X86-64-NEXT: PhysicalAddress:
OPENBSD-X86-64-NEXT: FileSize:
OPENBSD-X86-64-NEXT: MemSize:
OPENBSD-X86-64-NEXT: Flags [
OPENBSD-X86-64-NEXT: ]
OPENBSD-X86-64-NEXT: Alignment:
OPENBSD-X86-64-NEXT: }
# RUN: llvm-readobj -l %p/../../Object/Inputs/program-headers.mips64 \
# RUN: | FileCheck %s -check-prefix ELF-MIPS64
# ELF-MIPS64: Format: ELF64-mips
# ELF-MIPS64-NEXT: Arch: mips64
# ELF-MIPS64-NEXT: AddressSize: 64bit
# ELF-MIPS64-NEXT: LoadName:
# ELF-MIPS64-NEXT: ProgramHeaders [
# ELF-MIPS64-NEXT: ProgramHeader {
# ELF-MIPS64-NEXT: Type: PT_LOAD (0x1)
# ELF-MIPS64-NEXT: Offset: 0x0
# ELF-MIPS64-NEXT: VirtualAddress: 0x120000000
# ELF-MIPS64-NEXT: PhysicalAddress: 0x120000000
# ELF-MIPS64-NEXT: FileSize: 136
# ELF-MIPS64-NEXT: MemSize: 136
# ELF-MIPS64-NEXT: Flags [ (0x5)
# ELF-MIPS64-NEXT: PF_R (0x4)
# ELF-MIPS64-NEXT: PF_X (0x1)
# ELF-MIPS64-NEXT: ]
# ELF-MIPS64-NEXT: Alignment: 65536
# ELF-MIPS64-NEXT: }
# ELF-MIPS64-NEXT: ]
## Test that llvm-readobj dumps OpenBSD specific program headers.
# RUN: yaml2obj %s -o %t
# RUN: llvm-readobj -l %t | FileCheck %s --check-prefix=OPENBSD-X86-64
# OPENBSD-X86-64: ProgramHeader {
# OPENBSD-X86-64-NEXT: Type: PT_OPENBSD_RANDOMIZE
# OPENBSD-X86-64: ProgramHeader {
# OPENBSD-X86-64-NEXT: Type: PT_OPENBSD_WXNEEDED
# OPENBSD-X86-64: ProgramHeader {
# OPENBSD-X86-64-NEXT: Type: PT_OPENBSD_BOOTDATA
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
ProgramHeaders:
- Type: 0x65a3dbe6 ## PT_OPENBSD_RANDOMIZE
- Type: 0x65a3dbe7 ## PT_OPENBSD_WXNEEDED
- Type: 0x65a41be6 ## PT_OPENBSD_BOOTDATA