Currently we have to set 'Machine' to something in our YAML descriptions. Usually we use 'EM_X86_64' for 64-bit targets and 'EM_386' for 32-bit targets. At the same time, in fact, in most cases our tests do not need a machine type and we can use 'EM_NONE'. This is cleaner, because avoids the need of using a particular machine. In this patch I've made the 'Machine' key optional (the default value, when it is not specified is `EM_NONE`) and removed it (where possible) from yaml2obj, obj2yaml and llvm-readobj tests. There are few tests left where I decided not to remove it, because I didn't want to touch CHECK lines or doing anything more complex than a removing a "Machine: *" line and formatting lines around. Differential revision: https://reviews.llvm.org/D86202
76 lines
2.3 KiB
ArmAsm
76 lines
2.3 KiB
ArmAsm
# Check we are able to dump the dynamic section without a DT_NULL entry correctly.
|
|
|
|
# RUN: yaml2obj --docnum=1 %s -o %t.o
|
|
# RUN: llvm-readobj --dynamic-table %t.o | FileCheck %s --check-prefix=NONULL-LLVM
|
|
# RUN: llvm-readelf --dynamic-table %t.o | FileCheck %s --check-prefix=NONULL-GNU
|
|
|
|
# NONULL-LLVM: DynamicSection [ (1 entries)
|
|
# NONULL-LLVM-NEXT: Tag Type Name/Value
|
|
# NONULL-LLVM-NEXT: 0x0000000000000015 DEBUG 0x0
|
|
# NONULL-LLVM-NEXT: ]
|
|
|
|
# NONULL-GNU: Dynamic section at offset {{.*}} contains 1 entries:
|
|
# NONULL-GNU-NEXT: Tag Type Name/Value
|
|
# NONULL-GNU-NEXT: 0x0000000000000015 (DEBUG) 0x0
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_EXEC
|
|
Sections:
|
|
- Name: .dynamic
|
|
Type: SHT_DYNAMIC
|
|
Entries:
|
|
- Tag: DT_DEBUG
|
|
Value: 0x0000000000000000
|
|
ProgramHeaders:
|
|
- Type: PT_LOAD
|
|
Sections:
|
|
- Section: .dynamic
|
|
- Type: PT_DYNAMIC
|
|
Sections:
|
|
- Section: .dynamic
|
|
|
|
# Sometimes .dynamic section content length can be greater than the
|
|
# length of its entries. In this case, we should not try to dump anything
|
|
# past the DT_NULL entry, which works as a terminator.
|
|
|
|
# RUN: yaml2obj --docnum=2 %s -o %t.o
|
|
# RUN: llvm-readobj --dynamic-table %t.o | FileCheck %s --check-prefix=LONG-LLVM
|
|
# RUN: llvm-readelf --dynamic-table %t.o | FileCheck %s --check-prefix=LONG-GNU
|
|
|
|
# LONG-LLVM: DynamicSection [ (2 entries)
|
|
# LONG-LLVM-NEXT: Tag Type Name/Value
|
|
# LONG-LLVM-NEXT: 0x0000000000000015 DEBUG 0x0
|
|
# LONG-LLVM-NEXT: 0x0000000000000000 NULL 0x0
|
|
# LONG-LLVM-NEXT: ]
|
|
|
|
# LONG-GNU: Dynamic section at offset {{.*}} contains 2 entries:
|
|
# LONG-GNU-NEXT: Tag Type Name/Value
|
|
# LONG-GNU-NEXT: 0x0000000000000015 (DEBUG) 0x0
|
|
# LONG-GNU-NEXT: 0x0000000000000000 (NULL) 0x0
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_EXEC
|
|
Sections:
|
|
- Name: .dynamic
|
|
Type: SHT_DYNAMIC
|
|
Entries:
|
|
- Tag: DT_DEBUG
|
|
Value: 0x0000000000000000
|
|
- Tag: DT_NULL
|
|
Value: 0x0000000000000000
|
|
- Tag: DT_NULL
|
|
Value: 0x0000000000000000
|
|
ProgramHeaders:
|
|
- Type: PT_LOAD
|
|
Sections:
|
|
- Section: .dynamic
|
|
- Type: PT_DYNAMIC
|
|
Sections:
|
|
- Section: .dynamic
|