
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
59 lines
1.8 KiB
Plaintext
59 lines
1.8 KiB
Plaintext
# Show that llvm-readobj can print symbol bindings correctly for both LLVM and
|
|
# GNU styles, including for symbol bindings that are not recognised.
|
|
|
|
# RUN: yaml2obj %s -o %t
|
|
# RUN: llvm-readobj --symbols --dyn-symbols %t | FileCheck %s --check-prefix=LLVM
|
|
# RUN: llvm-readelf --symbols --dyn-symbols %t | FileCheck %s --check-prefix=GNU
|
|
|
|
# LLVM: Name: local
|
|
# LLVM: Binding: Local
|
|
# LLVM: Name: global
|
|
# LLVM: Binding: Global
|
|
# LLVM: Name: weak
|
|
# LLVM: Binding: Weak
|
|
# LLVM: Name: unknown
|
|
# LLVM: Binding: 0x3
|
|
# LLVM: Name: unique
|
|
# LLVM: Binding: Unique (0xA)
|
|
# LLVM: Name: os
|
|
# LLVM: Binding: 0xB
|
|
# LLVM: Name: proc
|
|
# LLVM: Binding: 0xF
|
|
|
|
# GNU: 3 {{.*}} unknown
|
|
# GNU-NEXT: UNIQUE {{.*}} unique
|
|
# GNU-NEXT: b {{.*}} os
|
|
# GNU-NEXT: f {{.*}} proc
|
|
# GNU: LOCAL {{.*}} local
|
|
# GNU-NEXT: GLOBAL {{.*}} global
|
|
# GNU-NEXT: WEAK {{.*}} weak
|
|
|
|
# yaml2obj doesn't have a way of specifying static symbols with custom bindings,
|
|
# so use a custom dynamic symbol table section instead.
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Sections:
|
|
- Name: .dynstr
|
|
Type: SHT_STRTAB
|
|
#\0unknown\0unique\0os\0proc\0
|
|
Content: "00756e6b6e6f776e00756e69717565006f730070726f6300"
|
|
- Name: .dynsym
|
|
Type: SHT_DYNSYM
|
|
Link: .dynstr
|
|
EntSize: 16
|
|
# Null symbol
|
|
# Symbol with st_name = 1, binding = 0x3
|
|
# Symbol with st_name = 9, binding = 0xa
|
|
# Symbol with st_name = 16, binding = 0xb
|
|
# Symbol with st_name = 19, binding = 0xf
|
|
Content: "0000000000000000000000000000000001000000000000000000000030000000090000000000000000000000a0000000100000000000000000000000b0000000130000000000000000000000f0000000"
|
|
Symbols:
|
|
- Name: local
|
|
- Name: global
|
|
Binding: STB_GLOBAL
|
|
- Name: weak
|
|
Binding: STB_WEAK
|