[lld] r272120 - [ELF] - Tweak verneed.s test to use new llvm-readobj functionality
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 7 23:54:23 PDT 2016
Author: grimar
Date: Wed Jun 8 01:54:23 2016
New Revision: 272120
URL: http://llvm.org/viewvc/llvm-project?rev=272120&view=rev
Log:
[ELF] - Tweak verneed.s test to use new llvm-readobj functionality
Previously this test performed check of binary data. Since
llvm-readobj currently able to dump all 3 types of version relative
sections, that can be used to make this test more transparent.
Patch do that.
Differential revision: http://reviews.llvm.org/D21024
Modified:
lld/trunk/test/ELF/verneed.s
Modified: lld/trunk/test/ELF/verneed.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/verneed.s?rev=272120&r1=272119&r2=272120&view=diff
==============================================================================
--- lld/trunk/test/ELF/verneed.s (original)
+++ lld/trunk/test/ELF/verneed.s Wed Jun 8 01:54:23 2016
@@ -1,8 +1,7 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: ld.lld %t.o %S/Inputs/verneed1.so %S/Inputs/verneed2.so -o %t
-# RUN: llvm-readobj -sections -dyn-symbols -dynamic-table %t | FileCheck %s
-# RUN: llvm-objdump -s %t | FileCheck --check-prefix=CONTENTS %s
+# RUN: llvm-readobj -V -sections -section-data -dyn-symbols -dynamic-table %t | FileCheck %s
# CHECK: Section {
# CHECK: Index: 1
@@ -18,8 +17,7 @@
# CHECK-NEXT: Info: 1
# CHECK-NEXT: AddressAlignment: 8
# CHECK-NEXT: EntrySize: 24
-# CHECK-NEXT: }
-# CHECK-NEXT: Section {
+# CHECK: Section {
# CHECK-NEXT: Index: 2
# CHECK-NEXT: Name: .gnu.version (9)
# CHECK-NEXT: Type: SHT_GNU_versym (0x6FFFFFFF)
@@ -33,8 +31,7 @@
# CHECK-NEXT: Info: 0
# CHECK-NEXT: AddressAlignment: 2
# CHECK-NEXT: EntrySize: 2
-# CHECK-NEXT: }
-# CHECK-NEXT: Section {
+# CHECK: Section {
# CHECK-NEXT: Index: 3
# CHECK-NEXT: Name: .gnu.version_r (22)
# CHECK-NEXT: Type: SHT_GNU_verneed (0x6FFFFFFE)
@@ -48,6 +45,25 @@
# CHECK-NEXT: Info: 2
# CHECK-NEXT: AddressAlignment: 4
# CHECK-NEXT: EntrySize: 0
+# CHECK: Section {
+# CHECK: Index: 5
+# CHECK-NEXT: Name: .dynstr
+# CHECK-NEXT: Type: SHT_STRTAB
+# CHECK-NEXT: Flags [ (0x2)
+# CHECK-NEXT: SHF_ALLOC (0x2)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Address: 0x102A8
+# CHECK-NEXT: Offset: 0x2A8
+# CHECK-NEXT: Size: 47
+# CHECK-NEXT: Link: 0
+# CHECK-NEXT: Info: 0
+# CHECK-NEXT: AddressAlignment: 1
+# CHECK-NEXT: EntrySize: 0
+# CHECK-NEXT: SectionData (
+# CHECK-NEXT: 0000: 00663100 7665726E 65656431 2E736F2E |.f1.verneed1.so.|
+# CHECK-NEXT: 0010: 30007633 00663200 76320067 31007665 |0.v3.f2.v2.g1.ve|
+# CHECK-NEXT: 0020: 726E6565 64322E73 6F2E3000 763100 |rneed2.so.0.v1.|
+# CHECK-NEXT: )
# CHECK-NEXT: }
# CHECK: DynamicSymbols [
@@ -93,25 +109,62 @@
# CHECK-NEXT: 0x000000006FFFFFFE VERNEED 0x10230
# CHECK-NEXT: 0x000000006FFFFFFF VERNEEDNUM 2
-# CONTENTS: Contents of section .gnu.version:
-# CONTENTS-NEXT: 10228 00000200 03000400
-# CONTENTS-NEXT: Contents of section .gnu.version_r:
-# vn_version
-# vn_cnt
-# vn_file vn_aux vn_next
-# CONTENTS-NEXT: 10230 01000200 04000000 20000000 10000000 ........ .......
-# CONTENTS-NEXT: 10240 01000100 1e000000 30000000 00000000 ........0.......
-# vna_hash vna_flags
-# vna_other
-# vna_name
-# vna_next
-# CONTENTS-NEXT: 10250 92070000 00000300 18000000 10000000 ................
-# CONTENTS-NEXT: 10260 93070000 00000200 12000000 00000000 ................
-# CONTENTS-NEXT: 10270 91070000 00000400 2c000000 00000000 ........,.......
-# CONTENTS: Contents of section .dynstr:
-# CONTENTS-NEXT: 102a8 00663100 7665726e 65656431 2e736f2e .f1.verneed1.so.
-# CONTENTS-NEXT: 102b8 30007633 00663200 76320067 31007665 0.v3.f2.v2.g1.ve
-# CONTENTS-NEXT: 102c8 726e6565 64322e73 6f2e3000 763100 rneed2.so.0.v1.
+# CHECK: Version symbols {
+# CHECK-NEXT: Section Name: .gnu.version
+# CHECK-NEXT: Address: 0x10228
+# CHECK-NEXT: Offset: 0x228
+# CHECK-NEXT: Link: 1
+# CHECK-NEXT: Symbols [
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Version: 0
+# CHECK-NEXT: Name: @
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Version: 2
+# CHECK-NEXT: Name: f1 at v3
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Version: 3
+# CHECK-NEXT: Name: f2 at v2
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Version: 4
+# CHECK-NEXT: Name: g1 at v1
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
+# CHECK-NEXT: }
+# CHECK-NEXT: Version definition {
+# CHECK-NEXT: }
+# CHECK-NEXT: SHT_GNU_verneed {
+# CHECK-NEXT: Dependency {
+# CHECK-NEXT: Version: 1
+# CHECK-NEXT: Count: 2
+# CHECK-NEXT: FileName: verneed1.so.0
+# CHECK-NEXT: Entry {
+# CHECK-NEXT: Hash: 1938
+# CHECK-NEXT: Flags: 0x0
+# CHECK-NEXT: Index: 3
+# CHECK-NEXT: Name: v2
+# CHECK-NEXT: }
+# CHECK-NEXT: Entry {
+# CHECK-NEXT: Hash: 1939
+# CHECK-NEXT: Flags: 0x0
+# CHECK-NEXT: Index: 2
+# CHECK-NEXT: Name: v3
+# CHECK-NEXT: }
+# CHECK-NEXT: }
+# CHECK-NEXT: Dependency {
+# CHECK-NEXT: Version: 1
+# CHECK-NEXT: Count: 1
+# CHECK-NEXT: FileName: verneed2.so.0
+# CHECK-NEXT: Entry {
+# CHECK-NEXT: Hash: 1937
+# CHECK-NEXT: Flags: 0x0
+# CHECK-NEXT: Index: 4
+# CHECK-NEXT: Name: v1
+# CHECK-NEXT: }
+# CHECK-NEXT: }
+# CHECK-NEXT: }
.globl _start
_start:
More information about the llvm-commits
mailing list