]> granicus.if.org Git - llvm/commitdiff
[llvm-readobj/llvm-readelf] - Add checks for GNU-style to "all.test" test case.
authorGeorge Rimar <grimar@accesssoftek.com>
Tue, 8 Oct 2019 08:59:12 +0000 (08:59 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Tue, 8 Oct 2019 08:59:12 +0000 (08:59 +0000)
We do not check the GNU-style output when -all is given.
This patch does that.

Differential revision: https://reviews.llvm.org/D68462

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374028 91177308-0d34-0410-b5e6-96231b3b80d8

test/tools/llvm-readobj/all.test

index ac27f38c3a32767845061843fcdf3725c7bb0037..cc1aa29504a07a98a3f8b4e6836b4f35b6678db7 100644 (file)
@@ -1,22 +1,40 @@
 # RUN: yaml2obj %s -o %t.o
-# RUN: llvm-readobj -a %t.o | FileCheck %s --check-prefix ALL
-# RUN: llvm-readobj --all %t.o | FileCheck %s --check-prefix ALL
+# RUN: llvm-readobj -a %t.o | FileCheck %s --check-prefix LLVM-ALL
+# RUN: llvm-readobj --all %t.o | FileCheck %s --check-prefix LLVM-ALL
 
-# ALL: Format: ELF32-i386
-# ALL: Arch: i386
-# ALL: AddressSize: 32bit
-# ALL: LoadName:
-# ALL: ElfHeader {
-# ALL: Sections [
-# ALL: Relocations [
-# ALL: Symbols [
-# ALL: ProgramHeaders [
-# ALL: Version symbols {
-# ALL: SHT_GNU_verdef {
-# ALL: SHT_GNU_verneed {
-# ALL: Addrsig [
-# ALL: Notes [
-# ALL: StackSizes [
+# LLVM-ALL: Format: ELF32-i386
+# LLVM-ALL: Arch: i386
+# LLVM-ALL: AddressSize: 32bit
+# LLVM-ALL: LoadName:
+# LLVM-ALL: ElfHeader {
+# LLVM-ALL: Sections [
+# LLVM-ALL: Relocations [
+# LLVM-ALL: Symbols [
+# LLVM-ALL: ProgramHeaders [
+# LLVM-ALL: Version symbols {
+# LLVM-ALL: SHT_GNU_verdef {
+# LLVM-ALL: SHT_GNU_verneed {
+# LLVM-ALL: Addrsig [
+# LLVM-ALL: Notes [
+# LLVM-ALL: StackSizes [
+
+# RUN: llvm-readelf -a %t.o | FileCheck %s --check-prefix GNU-ALL
+# RUN: llvm-readelf --all %t.o | FileCheck %s --check-prefix GNU-ALL
+
+# GNU-ALL: ELF Header:
+# GNU-ALL: There are {{.*}} section headers, starting at offset {{.*}}:
+# GNU-ALL: Relocation section '.rela.data' at offset {{.*}} contains {{.*}} entries:
+# GNU-ALL: Symbol table '.symtab' contains {{.*}} entries:
+# GNU-ALL: EH_FRAME Header [
+# GNU-ALL: .eh_frame section at offset {{.*}} address 0x0:
+# GNU-ALL: Dynamic section at offset {{.*}} contains {{.*}} entries:
+# GNU-ALL: Program Headers:
+# GNU-ALL: Version symbols section '.gnu.version' contains {{.*}} entries:
+# GNU-ALL: Version definition section '.gnu.version_d' contains {{.*}} entries:
+# GNU-ALL: Version needs section '.gnu.version_r' contains {{.*}} entries:
+# GNU-ALL: There are no section groups in this file.
+# GNU-ALL: Histogram for bucket list length (total of 1 buckets)
+# GNU-ALL: Displaying notes found at file offset {{.*}} with length {{.*}}:
 
 --- !ELF
 FileHeader:
@@ -24,3 +42,69 @@ FileHeader:
   Data:    ELFDATA2LSB
   Type:    ET_REL
   Machine: EM_386
+Sections:
+  - Name: .data
+    Type: SHT_PROGBITS
+  - Name: .rela.data
+    Type: SHT_REL
+    Relocations:
+  - Name:    .gnu.version
+    Type:    SHT_GNU_versym
+    Entries: [ 0 ]
+  - Name:    .gnu.version_d
+    Type:    SHT_GNU_verdef
+    Info:    0x0
+    Entries: []
+  - Name: .gnu.version_r
+    Type: SHT_GNU_verneed
+    Info: 0x0
+    Dependencies:
+      - Version: 1
+        File:    verneed1.so.0
+        Entries: []
+  - Name:         .dynamic
+    Type:         SHT_DYNAMIC
+    Address:      0x1000
+    AddressAlign: 0x1000
+    Entries:
+      - Tag:   DT_HASH
+        Value: 0x1100
+      - Tag:   DT_NULL
+        Value: 0
+  - Name:         .hash
+    Type:         SHT_HASH
+    Link:         0
+    Bucket:       [ 1 ]
+    Chain:        [ 0, 0 ]
+    Address:      0x1100
+    AddressAlign: 0x100
+  - Name:    .eh_frame_hdr
+    Type:    SHT_PROGBITS
+## An arbitrary linker-generated valid content.
+    Content: 011b033b140000000100000000f0ffff30000000
+  - Name:         .eh_frame
+    Type:         SHT_PROGBITS
+    AddressAlign: 8
+## An arbitrary linker-generated valid content.
+    Content:      1400000000000000017a5200017810011b0c070890010000100000001c000000c8efffff0100000000000000
+  - Name:    .note.gnu.build-id
+    Type:    SHT_NOTE
+    Flags:   [ SHF_ALLOC ]
+    Address: 0x1500
+## An arbitrary linker-generated valid content.
+    Content: 040000001000000003000000474E55004FCB712AA6387724A9F465A32CD8C14B
+ProgramHeaders:
+  - Type:  PT_LOAD
+    VAddr: 0x1000
+    Sections:
+      - Section: .dynamic
+      - Section: .hash
+  - Type: PT_DYNAMIC
+    Sections:
+      - Section: .dynamic
+  - Type: PT_GNU_EH_FRAME
+    Sections:
+      - Section: .eh_frame_hdr
+  - Type: PT_NOTE
+    Sections:
+      - Section: .note.gnu.build-id