Revert "[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`"

This reverts commit 94a0cffe25 (r356764).

This change was originally committed in r356764, but then partially
reverted in r356777 due to "bad changes". This caused test failures
because the test changes committed along with the original change
were not reverted, so this change reverts the rest of the changes.

llvm-svn: 356811
This commit is contained in:
Douglas Yung 2019-03-22 21:07:57 +00:00
parent 94e8f152c1
commit 8316ea4299
4 changed files with 102 additions and 114 deletions

View File

@ -1,118 +1,106 @@
// Test that llvm-readobj dumps version info tags correctly. // Test that llvm-readobj dumps version info tags correctly.
RUN: llvm-readobj -dynamic-table -V %p/Inputs/verdef.elf-x86-64 | FileCheck %s --check-prefix=LLVM-VERDEF RUN: llvm-readobj -dynamic-table -V %p/Inputs/verdef.elf-x86-64 | FileCheck %s
RUN: llvm-readelf -dynamic-table -V %p/Inputs/verdef.elf-x86-64 | FileCheck %s --check-prefix=GNU-VERDEF
LLVM-VERDEF: 0x000000006FFFFFF0 VERSYM 0x24C CHECK: 0x000000006FFFFFF0 VERSYM 0x24C
LLVM-VERDEF: 0x000000006FFFFFFC VERDEF 0x25C CHECK: 0x000000006FFFFFFC VERDEF 0x25C
LLVM-VERDEF: 0x000000006FFFFFFD VERDEFNUM 3 CHECK: 0x000000006FFFFFFD VERDEFNUM 3
LLVM-VERDEF: Version symbols { CHECK: Version symbols {
LLVM-VERDEF-NEXT: Section Name: .gnu.version (20) CHECK-NEXT: Section Name: .gnu.version (20)
LLVM-VERDEF-NEXT: Address: 0x24C CHECK-NEXT: Address: 0x24C
LLVM-VERDEF-NEXT: Offset: 0x24C CHECK-NEXT: Offset: 0x24C
LLVM-VERDEF-NEXT: Link: 1 CHECK-NEXT: Link: 1
LLVM-VERDEF-NEXT: Symbols [ CHECK-NEXT: Symbols [
LLVM-VERDEF-NEXT: Symbol { CHECK-NEXT: Symbol {
LLVM-VERDEF-NEXT: Version: 0 CHECK-NEXT: Version: 0
LLVM-VERDEF-NEXT: Name: {{$}} CHECK-NEXT: Name: {{$}}
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
LLVM-VERDEF-NEXT: Symbol { CHECK-NEXT: Symbol {
LLVM-VERDEF-NEXT: Version: 1 CHECK-NEXT: Version: 1
LLVM-VERDEF-NEXT: Name: _end{{$}} CHECK-NEXT: Name: _end{{$}}
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
LLVM-VERDEF-NEXT: Symbol { CHECK-NEXT: Symbol {
LLVM-VERDEF-NEXT: Version: 1 CHECK-NEXT: Version: 1
LLVM-VERDEF-NEXT: Name: _edata{{$}} CHECK-NEXT: Name: _edata{{$}}
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
LLVM-VERDEF-NEXT: Symbol { CHECK-NEXT: Symbol {
LLVM-VERDEF-NEXT: Version: 3 CHECK-NEXT: Version: 3
LLVM-VERDEF-NEXT: Name: goo@@VERSION2 CHECK-NEXT: Name: goo@@VERSION2
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
LLVM-VERDEF-NEXT: Symbol { CHECK-NEXT: Symbol {
LLVM-VERDEF-NEXT: Version: 1 CHECK-NEXT: Version: 1
LLVM-VERDEF-NEXT: Name: __bss_start{{$}} CHECK-NEXT: Name: __bss_start{{$}}
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
LLVM-VERDEF-NEXT: Symbol { CHECK-NEXT: Symbol {
LLVM-VERDEF-NEXT: Version: 2 CHECK-NEXT: Version: 2
LLVM-VERDEF-NEXT: Name: foo@@VERSION1 CHECK-NEXT: Name: foo@@VERSION1
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
LLVM-VERDEF-NEXT: Symbol { CHECK-NEXT: Symbol {
LLVM-VERDEF-NEXT: Version: 2 CHECK-NEXT: Version: 2
LLVM-VERDEF-NEXT: Name: VERSION1@@VERSION1 CHECK-NEXT: Name: VERSION1@@VERSION1
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
LLVM-VERDEF-NEXT: Symbol { CHECK-NEXT: Symbol {
LLVM-VERDEF-NEXT: Version: 3 CHECK-NEXT: Version: 3
LLVM-VERDEF-NEXT: Name: VERSION2@@VERSION2 CHECK-NEXT: Name: VERSION2@@VERSION2
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
LLVM-VERDEF-NEXT: ] CHECK-NEXT: ]
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
LLVM-VERDEF: SHT_GNU_verdef { CHECK: SHT_GNU_verdef {
LLVM-VERDEF-NEXT: Definition { CHECK-NEXT: Definition {
LLVM-VERDEF-NEXT: Version: 1 CHECK-NEXT: Version: 1
LLVM-VERDEF-NEXT: Flags: Base (0x1) CHECK-NEXT: Flags: Base (0x1)
LLVM-VERDEF-NEXT: Index: 1 CHECK-NEXT: Index: 1
LLVM-VERDEF-NEXT: Hash: 430712 CHECK-NEXT: Hash: 430712
LLVM-VERDEF-NEXT: Name: blah CHECK-NEXT: Name: blah
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
LLVM-VERDEF-NEXT: Definition { CHECK-NEXT: Definition {
LLVM-VERDEF-NEXT: Version: 1 CHECK-NEXT: Version: 1
LLVM-VERDEF-NEXT: Flags: 0x0 CHECK-NEXT: Flags: 0x0
LLVM-VERDEF-NEXT: Index: 2 CHECK-NEXT: Index: 2
LLVM-VERDEF-NEXT: Hash: 175630257 CHECK-NEXT: Hash: 175630257
LLVM-VERDEF-NEXT: Name: VERSION1 CHECK-NEXT: Name: VERSION1
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
LLVM-VERDEF-NEXT: Definition { CHECK-NEXT: Definition {
LLVM-VERDEF-NEXT: Version: 1 CHECK-NEXT: Version: 1
LLVM-VERDEF-NEXT: Flags: 0x0 CHECK-NEXT: Flags: 0x0
LLVM-VERDEF-NEXT: Index: 3 CHECK-NEXT: Index: 3
LLVM-VERDEF-NEXT: Hash: 175630258 CHECK-NEXT: Hash: 175630258
LLVM-VERDEF-NEXT: Name: VERSION2 CHECK-NEXT: Name: VERSION2
LLVM-VERDEF-NEXT: Predecessor: VERSION1 CHECK-NEXT: Predecessor: VERSION1
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
LLVM-VERDEF-NEXT: } CHECK-NEXT: }
GNU-VERDEF: 0x000000006ffffff0 VERSYM 0x24c RUN: llvm-readobj -V %p/Inputs/verneed.elf-x86-64 | FileCheck %s --check-prefix=VERNEED
GNU-VERDEF: 0x000000006ffffffc VERDEF 0x25c
GNU-VERDEF: 0x000000006ffffffd VERDEFNUM 3
GNU-VERDEF: Dumper for .gnu.version is not implemented VERNEED: SHT_GNU_verneed {
GNU-VERDEF: Dumper for .gnu.version_d is not implemented VERNEED-NEXT: Dependency {
VERNEED-NEXT: Version: 1
RUN: llvm-readobj -V %p/Inputs/verneed.elf-x86-64 | FileCheck %s --check-prefix=LLVM-VERNEED VERNEED-NEXT: Count: 2
RUN: llvm-readelf -V %p/Inputs/verneed.elf-x86-64 | FileCheck %s --check-prefix=GNU-VERNEED VERNEED-NEXT: FileName: verneed1.so.0
VERNEED-NEXT: Entry {
LLVM-VERNEED: SHT_GNU_verneed { VERNEED-NEXT: Hash: 1938
LLVM-VERNEED-NEXT: Dependency { VERNEED-NEXT: Flags: 0x0
LLVM-VERNEED-NEXT: Version: 1 VERNEED-NEXT: Index: 3
LLVM-VERNEED-NEXT: Count: 2 VERNEED-NEXT: Name: v2
LLVM-VERNEED-NEXT: FileName: verneed1.so.0 VERNEED-NEXT: }
LLVM-VERNEED-NEXT: Entry { VERNEED-NEXT: Entry {
LLVM-VERNEED-NEXT: Hash: 1938 VERNEED-NEXT: Hash: 1939
LLVM-VERNEED-NEXT: Flags: 0x0 VERNEED-NEXT: Flags: 0x0
LLVM-VERNEED-NEXT: Index: 3 VERNEED-NEXT: Index: 2
LLVM-VERNEED-NEXT: Name: v2 VERNEED-NEXT: Name: v3
LLVM-VERNEED-NEXT: } VERNEED-NEXT: }
LLVM-VERNEED-NEXT: Entry { VERNEED-NEXT: }
LLVM-VERNEED-NEXT: Hash: 1939 VERNEED-NEXT: Dependency {
LLVM-VERNEED-NEXT: Flags: 0x0 VERNEED-NEXT: Version: 1
LLVM-VERNEED-NEXT: Index: 2 VERNEED-NEXT: Count: 1
LLVM-VERNEED-NEXT: Name: v3 VERNEED-NEXT: FileName: verneed2.so.0
LLVM-VERNEED-NEXT: } VERNEED-NEXT: Entry {
LLVM-VERNEED-NEXT: } VERNEED-NEXT: Hash: 1937
LLVM-VERNEED-NEXT: Dependency { VERNEED-NEXT: Flags: 0x0
LLVM-VERNEED-NEXT: Version: 1 VERNEED-NEXT: Index: 4
LLVM-VERNEED-NEXT: Count: 1 VERNEED-NEXT: Name: v1
LLVM-VERNEED-NEXT: FileName: verneed2.so.0 VERNEED-NEXT: }
LLVM-VERNEED-NEXT: Entry { VERNEED-NEXT: }
LLVM-VERNEED-NEXT: Hash: 1937 VERNEED-NEXT: }
LLVM-VERNEED-NEXT: Flags: 0x0
LLVM-VERNEED-NEXT: Index: 4
LLVM-VERNEED-NEXT: Name: v1
LLVM-VERNEED-NEXT: }
LLVM-VERNEED-NEXT: }
LLVM-VERNEED-NEXT: }
GNU-VERNEED: Dumper for .gnu.version is not implemented
GNU-VERNEED: Dumper for .gnu.version_r is not implemented

View File

@ -1,5 +1,5 @@
# RUN: yaml2obj %s -o %t # RUN: yaml2obj %s -o %t
# RUN: llvm-readobj -V %t | FileCheck %s # RUN: llvm-readelf -V %t | FileCheck %s
# Check we are able to handle the SHT_GNU_verdef sections. # Check we are able to handle the SHT_GNU_verdef sections.

View File

@ -1,5 +1,5 @@
# RUN: yaml2obj %s -o %t # RUN: yaml2obj %s -o %t
# RUN: llvm-readobj -V %t | FileCheck %s # RUN: llvm-readelf -V %t | FileCheck %s
# Check we are able to handle the SHT_GNU_verneed sections. # Check we are able to handle the SHT_GNU_verneed sections.

View File

@ -1,5 +1,5 @@
# RUN: yaml2obj %s -o %t # RUN: yaml2obj %s -o %t
# RUN: llvm-readobj -V %t | FileCheck %s # RUN: llvm-readelf -V %t | FileCheck %s
## Check we are able to produce a valid SHT_GNU_versym ## Check we are able to produce a valid SHT_GNU_versym
## section from its description. ## section from its description.