[llvm] 1cc78fd - [llvm-readobj/llvm-readelf] - Improve dumping of versioning sections.
Georgii Rymar via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 20 00:56:13 PST 2019
Author: Georgii Rymar
Date: 2019-11-20T11:55:55+03:00
New Revision: 1cc78fdb6f7d81d58cdafa44b0966708dc8575bf
URL: https://github.com/llvm/llvm-project/commit/1cc78fdb6f7d81d58cdafa44b0966708dc8575bf
DIFF: https://github.com/llvm/llvm-project/commit/1cc78fdb6f7d81d58cdafa44b0966708dc8575bf.diff
LOG: [llvm-readobj/llvm-readelf] - Improve dumping of versioning sections.
Our elf-versioninfo.test is not perfect. It does not properly test how
flags are dumped and also we have a bug: they are dumped as enums in
LLVM style now, i.e not dumped properly.
GNU style uses a `versionFlagToString` method to build a string from flags
which seems is consistent with GNU readelf.
In this patch I fixed the issues mentioned.
Differential revision: https://reviews.llvm.org/D70399
Added:
Modified:
lld/test/ELF/verdef-defaultver.s
lld/test/ELF/verdef-dependency.s
lld/test/ELF/verdef.s
lld/test/ELF/verneed.s
llvm/test/tools/llvm-readobj/elf-invalid-versioning.test
llvm/test/tools/llvm-readobj/elf-versioninfo.test
llvm/test/tools/yaml2obj/ELF/verdef-section.yaml
llvm/test/tools/yaml2obj/ELF/verneed-section.yaml
llvm/test/tools/yaml2obj/ELF/versym-section.yaml
llvm/tools/llvm-readobj/ELFDumper.cpp
Removed:
################################################################################
diff --git a/lld/test/ELF/verdef-defaultver.s b/lld/test/ELF/verdef-defaultver.s
index 379d92720c7c..3c10f2dcfe26 100644
--- a/lld/test/ELF/verdef-defaultver.s
+++ b/lld/test/ELF/verdef-defaultver.s
@@ -78,21 +78,25 @@
# DSO-NEXT: VersionDefinitions [
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
-# DSO-NEXT: Flags: Base
+# DSO-NEXT: Flags [ (0x1)
+# DSO-NEXT: Base (0x1)
+# DSO-NEXT: ]
# DSO-NEXT: Index: 1
# DSO-NEXT: Hash: 127830196
# DSO-NEXT: Name: shared
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
-# DSO-NEXT: Flags: 0x0
+# DSO-NEXT: Flags [ (0x0)
+# DSO-NEXT: ]
# DSO-NEXT: Index: 2
# DSO-NEXT: Hash: 1425
# DSO-NEXT: Name: V1
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
-# DSO-NEXT: Flags: 0x0
+# DSO-NEXT: Flags [ (0x0)
+# DSO-NEXT: ]
# DSO-NEXT: Index: 3
# DSO-NEXT: Hash: 1426
# DSO-NEXT: Name: V2
@@ -170,13 +174,15 @@
# EXE-NEXT: Entries [
# EXE-NEXT: Entry {
# EXE-NEXT: Hash: 1425
-# EXE-NEXT: Flags: 0x0
+# EXE-NEXT: Flags [ (0x0)
+# EXE-NEXT: ]
# EXE-NEXT: Index: 2
# EXE-NEXT: Name: V1
# EXE-NEXT: }
# EXE-NEXT: Entry {
# EXE-NEXT: Hash: 1426
-# EXE-NEXT: Flags: 0x0
+# EXE-NEXT: Flags [ (0x0)
+# EXE-NEXT: ]
# EXE-NEXT: Index: 3
# EXE-NEXT: Name: V2
# EXE-NEXT: }
diff --git a/lld/test/ELF/verdef-dependency.s b/lld/test/ELF/verdef-dependency.s
index 2ff9dc811263..479f332d4930 100644
--- a/lld/test/ELF/verdef-dependency.s
+++ b/lld/test/ELF/verdef-dependency.s
@@ -9,28 +9,33 @@
# DSO: VersionDefinitions [
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
-# DSO-NEXT: Flags: Base
+# DSO-NEXT: Flags [ (0x1)
+# DSO-NEXT: Base (0x1)
+# DSO-NEXT: ]
# DSO-NEXT: Index: 1
# DSO-NEXT: Hash: 127830196
# DSO-NEXT: Name: shared
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
-# DSO-NEXT: Flags: 0x0
+# DSO-NEXT: Flags [ (0x0)
+# DSO-NEXT: ]
# DSO-NEXT: Index: 2
# DSO-NEXT: Hash: 98457184
# DSO-NEXT: Name: LIBSAMPLE_1.0
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
-# DSO-NEXT: Flags: 0x0
+# DSO-NEXT: Flags [ (0x0)
+# DSO-NEXT: ]
# DSO-NEXT: Index: 3
# DSO-NEXT: Hash: 98456416
# DSO-NEXT: Name: LIBSAMPLE_2.0
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
-# DSO-NEXT: Flags: 0x0
+# DSO-NEXT: Flags [ (0x0)
+# DSO-NEXT: ]
# DSO-NEXT: Index: 4
# DSO-NEXT: Hash: 98456672
# DSO-NEXT: Name: LIBSAMPLE_3.0
diff --git a/lld/test/ELF/verdef.s b/lld/test/ELF/verdef.s
index 117b2b8c8ca8..d2aa924782f8 100644
--- a/lld/test/ELF/verdef.s
+++ b/lld/test/ELF/verdef.s
@@ -27,28 +27,33 @@
# DSO-NEXT: VersionDefinitions [
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
-# DSO-NEXT: Flags: Base
+# DSO-NEXT: Flags [ (0x1)
+# DSO-NEXT: Base (0x1)
+# DSO-NEXT: ]
# DSO-NEXT: Index: 1
# DSO-NEXT: Hash: 127830196
# DSO-NEXT: Name: shared
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
-# DSO-NEXT: Flags: 0x0
+# DSO-NEXT: Flags [ (0x0)
+# DSO-NEXT: ]
# DSO-NEXT: Index: 2
# DSO-NEXT: Hash: 98457184
# DSO-NEXT: Name: LIBSAMPLE_1.0
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
-# DSO-NEXT: Flags: 0x0
+# DSO-NEXT: Flags [ (0x0)
+# DSO-NEXT: ]
# DSO-NEXT: Index: 3
# DSO-NEXT: Hash: 98456416
# DSO-NEXT: Name: LIBSAMPLE_2.0
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
-# DSO-NEXT: Flags: 0x0
+# DSO-NEXT: Flags [ (0x0)
+# DSO-NEXT: ]
# DSO-NEXT: Index: 4
# DSO-NEXT: Hash: 98456672
# DSO-NEXT: Name: LIBSAMPLE_3.0
diff --git a/lld/test/ELF/verneed.s b/lld/test/ELF/verneed.s
index 3a0935f50c28..2da2683e1b2b 100644
--- a/lld/test/ELF/verneed.s
+++ b/lld/test/ELF/verneed.s
@@ -145,13 +145,15 @@
# CHECK-NEXT: Entries [
# CHECK-NEXT: Entry {
# CHECK-NEXT: Hash: 1938
-# CHECK-NEXT: Flags: 0x0
+# CHECK-NEXT: Flags [ (0x0)
+# CHECK-NEXT: ]
# CHECK-NEXT: Index: 3
# CHECK-NEXT: Name: v2
# CHECK-NEXT: }
# CHECK-NEXT: Entry {
# CHECK-NEXT: Hash: 1939
-# CHECK-NEXT: Flags: 0x0
+# CHECK-NEXT: Flags [ (0x0)
+# CHECK-NEXT: ]
# CHECK-NEXT: Index: 2
# CHECK-NEXT: Name: v3
# CHECK-NEXT: }
@@ -164,7 +166,8 @@
# CHECK-NEXT: Entries [
# CHECK-NEXT: Entry {
# CHECK-NEXT: Hash: 1937
-# CHECK-NEXT: Flags: 0x0
+# CHECK-NEXT: Flags [ (0x0)
+# CHECK-NEXT: ]
# CHECK-NEXT: Index: 4
# CHECK-NEXT: Name: v1
# CHECK-NEXT: }
diff --git a/llvm/test/tools/llvm-readobj/elf-invalid-versioning.test b/llvm/test/tools/llvm-readobj/elf-invalid-versioning.test
index c7107daf200e..d7a5198df100 100644
--- a/llvm/test/tools/llvm-readobj/elf-invalid-versioning.test
+++ b/llvm/test/tools/llvm-readobj/elf-invalid-versioning.test
@@ -37,7 +37,8 @@
# LLVM-VERNEED-NAME-NEXT: Entries [
# LLVM-VERNEED-NAME-NEXT: Entry {
# LLVM-VERNEED-NAME-NEXT: Hash: 0
-# LLVM-VERNEED-NAME-NEXT: Flags: 0x0
+# LLVM-VERNEED-NAME-NEXT: Flags [ (0x0)
+# LLVM-VERNEED-NAME-NEXT: ]
# LLVM-VERNEED-NAME-NEXT: Index: 2
# LLVM-VERNEED-NAME-NEXT: Name: {{$}}
# LLVM-VERNEED-NAME-NEXT: }
@@ -111,7 +112,8 @@ DynamicSymbols:
# LLVM-NOLINK-NEXT: Entries [
# LLVM-NOLINK-NEXT: Entry {
# LLVM-NOLINK-NEXT: Hash: 0
-# LLVM-NOLINK-NEXT: Flags: 0
+# LLVM-NOLINK-NEXT: Flags [ (0x0)
+# LLVM-NOLINK-NEXT: ]
# LLVM-NOLINK-NEXT: Index: 2
# LLVM-NOLINK-NEXT: Name: <invalid>
# LLVM-NOLINK-NEXT: }
@@ -215,7 +217,8 @@ DynamicSymbols:
# LLVM-OFFSET-EQ-NEXT: Entries [
# LLVM-OFFSET-EQ-NEXT: Entry {
# LLVM-OFFSET-EQ-NEXT: Hash: 0
-# LLVM-OFFSET-EQ-NEXT: Flags: 0x0
+# LLVM-OFFSET-EQ-NEXT: Flags [ (0x0)
+# LLVM-OFFSET-EQ-NEXT: ]
# LLVM-OFFSET-EQ-NEXT: Index: 0
# LLVM-OFFSET-EQ-NEXT: Name: <invalid>
# LLVM-OFFSET-EQ-NEXT: }
@@ -270,7 +273,8 @@ DynamicSymbols:
# LLVM-OFFSET-GR-NEXT: Entries [
# LLVM-OFFSET-GR-NEXT: Entry {
# LLVM-OFFSET-GR-NEXT: Hash: 0
-# LLVM-OFFSET-GR-NEXT: Flags: 0x0
+# LLVM-OFFSET-GR-NEXT: Flags [ (0x0)
+# LLVM-OFFSET-GR-NEXT: ]
# LLVM-OFFSET-GR-NEXT: Index: 0
# LLVM-OFFSET-GR-NEXT: Name: <invalid>
# LLVM-OFFSET-GR-NEXT: }
diff --git a/llvm/test/tools/llvm-readobj/elf-versioninfo.test b/llvm/test/tools/llvm-readobj/elf-versioninfo.test
index 393889c772a5..27bf302edf9c 100644
--- a/llvm/test/tools/llvm-readobj/elf-versioninfo.test
+++ b/llvm/test/tools/llvm-readobj/elf-versioninfo.test
@@ -1,4 +1,4 @@
-## Test that llvm-readobj dumps version info tags correctly.
+## Test how llvm-readobj/llvm-readelf tools dump versioning sections.
# RUN: yaml2obj %s --docnum=1 -o %t1
# RUN: llvm-readobj -V %t1 | FileCheck %s --check-prefix=LLVM
@@ -24,16 +24,40 @@ Sections:
Flags: [ SHF_ALLOC ]
Link: .dynstr
AddressAlign: 0x0000000000000004
- Info: 0x0000000000000003
+ Info: 0x0000000000000006
Entries:
- Version: 1
Flags: 0
+ VersionNdx: 0
+ Hash: 0
+ Names:
+ - VERSION1
+ - Version: 1
+ Flags: 1
+ VersionNdx: 0
+ Hash: 0
+ Names:
+ - VERSION1
+ - Version: 1
+ Flags: 2
+ VersionNdx: 0
+ Hash: 0
+ Names:
+ - VERSION1
+ - Version: 1
+ Flags: 4
+ VersionNdx: 0
+ Hash: 0
+ Names:
+ - VERSION1
+ - Version: 1
+ Flags: 7
VersionNdx: 2
Hash: 175630257
Names:
- VERSION1
- Version: 1
- Flags: 0
+ Flags: 8
VersionNdx: 3
Hash: 175630258
Names:
@@ -49,13 +73,25 @@ Sections:
- Version: 1
File: verneed1.so.0
Entries:
+ - Name: v1
+ Hash: 0
+ Flags: 1
+ Other: 0
+ - Name: v1
+ Hash: 0
+ Flags: 2
+ Other: 0
+ - Name: v1
+ Hash: 0
+ Flags: 4
+ Other: 0
- Name: v1
Hash: 1938
- Flags: 0
+ Flags: 7
Other: 4
- Name: v2
Hash: 1939
- Flags: 0
+ Flags: 8
Other: 5
- Version: 1
File: verneed2.so.0
@@ -106,22 +142,54 @@ DynamicSymbols:
# LLVM-NEXT: VersionDefinitions [
# LLVM-NEXT: Definition {
# LLVM-NEXT: Version: 1
-# LLVM-NEXT: Flags: 0x0
-# LLVM-NEXT: Index: 2
-# LLVM-NEXT: Hash: 175630257
+# LLVM-NEXT: Flags [ (0x0)
+# LLVM-NEXT: ]
+# LLVM-NEXT: Index: 0
+# LLVM-NEXT: Hash: 0
# LLVM-NEXT: Name: VERSION1
# LLVM-NEXT: }
# LLVM-NEXT: Definition {
# LLVM-NEXT: Version: 1
-# LLVM-NEXT: Flags: 0x0
-# LLVM-NEXT: Index: 3
-# LLVM-NEXT: Hash: 175630258
-# LLVM-NEXT: Name: VERSION2
-# LLVM-NEXT: Predecessor: VERSION1
+# LLVM-NEXT: Flags [ (0x1)
+# LLVM-NEXT: Base (0x1)
+# LLVM-NEXT: ]
+# LLVM-NEXT: Index: 0
+# LLVM-NEXT: Hash: 0
+# LLVM-NEXT: Name: VERSION1
# LLVM-NEXT: }
# LLVM-NEXT: Definition {
# LLVM-NEXT: Version: 1
-# LLVM-NEXT: Flags: 0x0
+# LLVM-NEXT: Flags [ (0x2)
+# LLVM-NEXT: Weak (0x2)
+# LLVM-NEXT: ]
+# LLVM-NEXT: Index: 0
+# LLVM-NEXT: Hash: 0
+# LLVM-NEXT: Name: VERSION1
+# LLVM-NEXT: }
+# LLVM-NEXT: Definition {
+# LLVM-NEXT: Version: 1
+# LLVM-NEXT: Flags [ (0x4)
+# LLVM-NEXT: Info (0x4)
+# LLVM-NEXT: ]
+# LLVM-NEXT: Index: 0
+# LLVM-NEXT: Hash: 0
+# LLVM-NEXT: Name: VERSION1
+# LLVM-NEXT: }
+# LLVM-NEXT: Definition {
+# LLVM-NEXT: Version: 1
+# LLVM-NEXT: Flags [ (0x7)
+# LLVM-NEXT: Base (0x1)
+# LLVM-NEXT: Info (0x4)
+# LLVM-NEXT: Weak (0x2)
+# LLVM-NEXT: ]
+# LLVM-NEXT: Index: 2
+# LLVM-NEXT: Hash: 175630257
+# LLVM-NEXT: Name: VERSION1
+# LLVM-NEXT: }
+# LLVM-NEXT: Definition {
+# LLVM-NEXT: Version: 1
+# LLVM-NEXT: Flags [ (0x8)
+# LLVM-NEXT: ]
# LLVM-NEXT: Index: 3
# LLVM-NEXT: Hash: 175630258
# LLVM-NEXT: Name: VERSION2
@@ -131,18 +199,47 @@ DynamicSymbols:
# LLVM-NEXT: VersionRequirements [
# LLVM-NEXT: Dependency {
# LLVM-NEXT: Version: 1
-# LLVM-NEXT: Count: 2
+# LLVM-NEXT: Count: 5
# LLVM-NEXT: FileName: verneed1.so.0
# LLVM-NEXT: Entries [
# LLVM-NEXT: Entry {
+# LLVM-NEXT: Hash: 0
+# LLVM-NEXT: Flags [ (0x1)
+# LLVM-NEXT: Base (0x1)
+# LLVM-NEXT: ]
+# LLVM-NEXT: Index: 0
+# LLVM-NEXT: Name: v1
+# LLVM-NEXT: }
+# LLVM-NEXT: Entry {
+# LLVM-NEXT: Hash: 0
+# LLVM-NEXT: Flags [ (0x2)
+# LLVM-NEXT: Weak (0x2)
+# LLVM-NEXT: ]
+# LLVM-NEXT: Index: 0
+# LLVM-NEXT: Name: v1
+# LLVM-NEXT: }
+# LLVM-NEXT: Entry {
+# LLVM-NEXT: Hash: 0
+# LLVM-NEXT: Flags [ (0x4)
+# LLVM-NEXT: Info (0x4)
+# LLVM-NEXT: ]
+# LLVM-NEXT: Index: 0
+# LLVM-NEXT: Name: v1
+# LLVM-NEXT: }
+# LLVM-NEXT: Entry {
# LLVM-NEXT: Hash: 1938
-# LLVM-NEXT: Flags: 0x0
+# LLVM-NEXT: Flags [ (0x7)
+# LLVM-NEXT: Base (0x1)
+# LLVM-NEXT: Info (0x4)
+# LLVM-NEXT: Weak (0x2)
+# LLVM-NEXT: ]
# LLVM-NEXT: Index: 4
# LLVM-NEXT: Name: v1
# LLVM-NEXT: }
# LLVM-NEXT: Entry {
# LLVM-NEXT: Hash: 1939
-# LLVM-NEXT: Flags: 0x0
+# LLVM-NEXT: Flags [ (0x8)
+# LLVM-NEXT: ]
# LLVM-NEXT: Index: 5
# LLVM-NEXT: Name: v2
# LLVM-NEXT: }
@@ -155,7 +252,8 @@ DynamicSymbols:
# LLVM-NEXT: Entries [
# LLVM-NEXT: Entry {
# LLVM-NEXT: Hash: 1937
-# LLVM-NEXT: Flags: 0x0
+# LLVM-NEXT: Flags [ (0x0)
+# LLVM-NEXT: ]
# LLVM-NEXT: Index: 6
# LLVM-NEXT: Name: v3
# LLVM-NEXT: }
@@ -168,18 +266,23 @@ DynamicSymbols:
# GNU-NEXT: 000: 0 (*local*) 2 (VERSION1) 3 (VERSION2) 4 (v1)
# GNU-NEXT: 004: 5 (v2) 6 (v3)
# GNU-EMPTY:
-# GNU-NEXT: Version definition section '.gnu.version_d' contains 3 entries:
-# GNU-NEXT: Addr: 0000000000000000 Offset: 0x00004c Link: 7 (.dynstr)
-# GNU-NEXT: 0x0000: Rev: 1 Flags: none Index: 2 Cnt: 1 Name: VERSION1
-# GNU-NEXT: 0x001c: Rev: 1 Flags: none Index: 3 Cnt: 2 Name: VERSION2
-# GNU-NEXT: 0x0038: Parent 1: VERSION1
-# GNU-NEXT: 0x001c: Rev: 1 Flags: none Index: 3 Cnt: 2 Name: VERSION2
-# GNU-NEXT: 0x0038: Parent 1: VERSION1
+# GNU-NEXT: Version definition section '.gnu.version_d' contains 6 entries:
+# GNU-NEXT: Addr: 0000000000000000 Offset: 0x00004c Link: 7 (.dynstr)
+# GNU-NEXT: 0x0000: Rev: 1 Flags: none Index: 0 Cnt: 1 Name: VERSION1
+# GNU-NEXT: 0x001c: Rev: 1 Flags: BASE Index: 0 Cnt: 1 Name: VERSION1
+# GNU-NEXT: 0x0038: Rev: 1 Flags: WEAK Index: 0 Cnt: 1 Name: VERSION1
+# GNU-NEXT: 0x0054: Rev: 1 Flags: INFO Index: 0 Cnt: 1 Name: VERSION1
+# GNU-NEXT: 0x0070: Rev: 1 Flags: BASE | WEAK | INFO Index: 2 Cnt: 1 Name: VERSION1
+# GNU-NEXT: 0x008c: Rev: 1 Flags: <unknown> Index: 3 Cnt: 2 Name: VERSION2
+# GNU-NEXT: 0x00a8: Parent 1: VERSION1
# GNU-EMPTY:
-# GNU-NEXT: Version needs section '.gnu.version_r' contains 2 entries:
-# GNU-NEXT: Addr: 0000000000000000 Offset: 0x00008c Link: 7 (.dynstr)
-# GNU-NEXT: 0x0000: Version: 1 File: verneed1.so.0 Cnt: 2
-# GNU-NEXT: 0x0010: Name: v1 Flags: none Version: 4
-# GNU-NEXT: 0x0020: Name: v2 Flags: none Version: 5
-# GNU-NEXT: 0x0030: Version: 1 File: verneed2.so.0 Cnt: 1
-# GNU-NEXT: 0x0040: Name: v3 Flags: none Version: 6
+# GNU-NEXT: Version needs section '.gnu.version_r' contains 2 entries:
+# GNU-NEXT: Addr: 0000000000000000 Offset: 0x0000fc Link: 7 (.dynstr)
+# GNU-NEXT: 0x0000: Version: 1 File: verneed1.so.0 Cnt: 5
+# GNU-NEXT: 0x0010: Name: v1 Flags: BASE Version: 0
+# GNU-NEXT: 0x0020: Name: v1 Flags: WEAK Version: 0
+# GNU-NEXT: 0x0030: Name: v1 Flags: INFO Version: 0
+# GNU-NEXT: 0x0040: Name: v1 Flags: BASE | WEAK | INFO Version: 4
+# GNU-NEXT: 0x0050: Name: v2 Flags: <unknown> Version: 5
+# GNU-NEXT: 0x0060: Version: 1 File: verneed2.so.0 Cnt: 1
+# GNU-NEXT: 0x0070: Name: v3 Flags: none Version: 6
diff --git a/llvm/test/tools/yaml2obj/ELF/verdef-section.yaml b/llvm/test/tools/yaml2obj/ELF/verdef-section.yaml
index f6ddbf3d25d6..439c428c1934 100644
--- a/llvm/test/tools/yaml2obj/ELF/verdef-section.yaml
+++ b/llvm/test/tools/yaml2obj/ELF/verdef-section.yaml
@@ -6,21 +6,28 @@
# CHECK: VersionDefinitions [
# CHECK-NEXT: Definition {
# CHECK-NEXT: Version: 1
-# CHECK-NEXT: Flags: Base
+# CHECK-NEXT: Flags [ (0x1)
+# CHECK-NEXT: Base (0x1)
+# CHECK-NEXT: ]
# CHECK-NEXT: Index: 1
# CHECK-NEXT: Hash: 170240160
# CHECK-NEXT: Name: dso.so.0
# CHECK-NEXT: }
# CHECK-NEXT: Definition {
# CHECK-NEXT: Version: 1
-# CHECK-NEXT: Flags: Weak
+# CHECK-NEXT: Flags [ (0x2)
+# CHECK-NEXT: Weak (0x2)
+# CHECK-NEXT: ]
# CHECK-NEXT: Index: 2
# CHECK-NEXT: Hash: 108387921
# CHECK-NEXT: Name: VERSION_1
# CHECK-NEXT: }
# CHECK-NEXT: Definition {
# CHECK-NEXT: Version: 1
-# CHECK-NEXT: Flags: 0x3
+# CHECK-NEXT: Flags [ (0x3)
+# CHECK-NEXT: Base (0x1)
+# CHECK-NEXT: Weak (0x2)
+# CHECK-NEXT: ]
# CHECK-NEXT: Index: 3
# CHECK-NEXT: Hash: 108387922
# CHECK-NEXT: Name: VERSION_2
diff --git a/llvm/test/tools/yaml2obj/ELF/verneed-section.yaml b/llvm/test/tools/yaml2obj/ELF/verneed-section.yaml
index e9dbe1c65fde..1a1dc34985a2 100644
--- a/llvm/test/tools/yaml2obj/ELF/verneed-section.yaml
+++ b/llvm/test/tools/yaml2obj/ELF/verneed-section.yaml
@@ -11,13 +11,18 @@
# CHECK-NEXT: Entries [
# CHECK-NEXT: Entry {
# CHECK-NEXT: Hash: 1937
-# CHECK-NEXT: Flags: 0xA
+# CHECK-NEXT: Flags [ (0xA)
+# CHECK-NEXT: Weak (0x2)
+# CHECK-NEXT: ]
# CHECK-NEXT: Index: 3
# CHECK-NEXT: Name: v1
# CHECK-NEXT: }
# CHECK-NEXT: Entry {
# CHECK-NEXT: Hash: 1938
-# CHECK-NEXT: Flags: 0xB
+# CHECK-NEXT: Flags [ (0xB)
+# CHECK-NEXT: Base (0x1)
+# CHECK-NEXT: Weak (0x2)
+# CHECK-NEXT: ]
# CHECK-NEXT: Index: 4
# CHECK-NEXT: Name: v2
# CHECK-NEXT: }
@@ -30,7 +35,9 @@
# CHECK-NEXT: Entries [
# CHECK-NEXT: Entry {
# CHECK-NEXT: Hash: 1939
-# CHECK-NEXT: Flags: 0xC
+# CHECK-NEXT: Flags [ (0xC)
+# CHECK-NEXT: Info (0x4)
+# CHECK-NEXT: ]
# CHECK-NEXT: Index: 2
# CHECK-NEXT: Name: v3
# CHECK-NEXT: }
diff --git a/llvm/test/tools/yaml2obj/ELF/versym-section.yaml b/llvm/test/tools/yaml2obj/ELF/versym-section.yaml
index fa5f5c9a8b3f..a45edae1ff2c 100644
--- a/llvm/test/tools/yaml2obj/ELF/versym-section.yaml
+++ b/llvm/test/tools/yaml2obj/ELF/versym-section.yaml
@@ -28,13 +28,15 @@
# CHECK-NEXT: Entries [
# CHECK-NEXT: Entry {
# CHECK-NEXT: Hash: 1937
-# CHECK-NEXT: Flags: 0x0
+# CHECK-NEXT: Flags [ (0x0)
+# CHECK-NEXT: ]
# CHECK-NEXT: Index: 3
# CHECK-NEXT: Name: v1
# CHECK-NEXT: }
# CHECK-NEXT: Entry {
# CHECK-NEXT: Hash: 1938
-# CHECK-NEXT: Flags: 0x0
+# CHECK-NEXT: Flags [ (0x0)
+# CHECK-NEXT: ]
# CHECK-NEXT: Index: 4
# CHECK-NEXT: Name: v2
# CHECK-NEXT: }
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index f83331dbb965..b8078ff7db64 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -5730,7 +5730,7 @@ void LLVMStyle<ELFT>::printVersionDefinitionSection(const ELFFile<ELFT> *Obj,
const Elf_Verdef *Verdef = reinterpret_cast<const Elf_Verdef *>(VerdefBuf);
DictScope Def(W, "Definition");
W.printNumber("Version", Verdef->vd_version);
- W.printEnum("Flags", Verdef->vd_flags, makeArrayRef(SymVersionFlags));
+ W.printFlags("Flags", Verdef->vd_flags, makeArrayRef(SymVersionFlags));
W.printNumber("Index", Verdef->vd_ndx);
W.printNumber("Hash", Verdef->vd_hash);
W.printString("Name", StringRef(reinterpret_cast<const char *>(
@@ -5790,7 +5790,7 @@ void LLVMStyle<ELFT>::printVersionDependencySection(const ELFFile<ELFT> *Obj,
reinterpret_cast<const Elf_Vernaux *>(VernauxBuf);
DictScope Entry(W, "Entry");
W.printNumber("Hash", Vernaux->vna_hash);
- W.printEnum("Flags", Vernaux->vna_flags, makeArrayRef(SymVersionFlags));
+ W.printFlags("Flags", Vernaux->vna_flags, makeArrayRef(SymVersionFlags));
W.printNumber("Index", Vernaux->vna_other);
StringRef Name = StringTable.size() > Vernaux->vna_name
More information about the llvm-commits
mailing list