diff options
Diffstat (limited to 'llvm/test/tools')
-rw-r--r-- | llvm/test/tools/llvm-readobj/gnu-notes.test | 62 | ||||
-rw-r--r-- | llvm/test/tools/llvm-readobj/note-gnu-property.s | 62 | ||||
-rw-r--r-- | llvm/test/tools/llvm-readobj/note-gnu-property2.s | 26 |
3 files changed, 119 insertions, 31 deletions
diff --git a/llvm/test/tools/llvm-readobj/gnu-notes.test b/llvm/test/tools/llvm-readobj/gnu-notes.test index 1a9c7e304b1..21078231f19 100644 --- a/llvm/test/tools/llvm-readobj/gnu-notes.test +++ b/llvm/test/tools/llvm-readobj/gnu-notes.test @@ -1,15 +1,55 @@ # RUN: yaml2obj %s > %t.so -# RUN: llvm-readobj -elf-output-style GNU --notes %t.so | FileCheck %s +# RUN: llvm-readobj -elf-output-style GNU --notes %t.so | FileCheck %s --check-prefix=GNU +# RUN: llvm-readobj -elf-output-style LLVM --notes %t.so | FileCheck %s --check-prefix=LLVM -# CHECK: Displaying notes found at file offset 0x00000300 with length 0x00000020: -# CHECK: Owner Data size Description -# CHECK: GNU 0x00000010 NT_GNU_BUILD_ID (unique build ID bitstring) -# CHECK: Build ID: 4fcb712aa6387724a9f465a32cd8c14b +# GNU: Displaying notes found at file offset 0x00000340 with length 0x00000020: +# GNU-NEXT: Owner Data size Description +# GNU-NEXT: GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag) +# GNU-NEXT: OS: Linux, ABI: 2.6.32 -# CHECK: Displaying notes found at file offset 0x0000036c with length 0x0000001c: -# CHECK: Owner Data size Description -# CHECK: GNU 0x00000009 NT_GNU_GOLD_VERSION (gold version) -# CHECK: Version: gold 1.11 +# GNU: Displaying notes found at file offset 0x00000360 with length 0x00000020: +# GNU-NEXT: Owner Data size Description +# GNU-NEXT: GNU 0x00000010 NT_GNU_BUILD_ID (unique build ID bitstring) +# GNU-NEXT: Build ID: 4fcb712aa6387724a9f465a32cd8c14b + +# GNU: Displaying notes found at file offset 0x000003cc with length 0x0000001c: +# GNU-NEXT: Owner Data size Description +# GNU-NEXT: GNU 0x00000009 NT_GNU_GOLD_VERSION (gold version) +# GNU-NEXT: Version: gold 1.11 + +# LLVM: Notes [ +# LLVM-NEXT: NoteSection { +# LLVM-NEXT: Offset: 0x340 +# LLVM-NEXT: Size: 0x20 +# LLVM-NEXT: Note { +# LLVM-NEXT: Owner: GNU +# LLVM-NEXT: Data size: 0x10 +# LLVM-NEXT: Type: NT_GNU_ABI_TAG (ABI version tag) +# LLVM-NEXT: OS: Linux +# LLVM-NEXT: ABI: 2.6.32 +# LLVM-NEXT: } +# LLVM-NEXT: } +# LLVM-NEXT: NoteSection { +# LLVM-NEXT: Offset: 0x360 +# LLVM-NEXT: Size: 0x20 +# LLVM-NEXT: Note { +# LLVM-NEXT: Owner: GNU +# LLVM-NEXT: Data size: 0x10 +# LLVM-NEXT: Type: NT_GNU_BUILD_ID (unique build ID bitstring) +# LLVM-NEXT: Build ID: 4fcb712aa6387724a9f465a32cd8c14b +# LLVM-NEXT: } +# LLVM-NEXT: } +# LLVM-NEXT: NoteSection { +# LLVM-NEXT: Offset: 0x3CC +# LLVM-NEXT: Size: 0x1C +# LLVM-NEXT: Note { +# LLVM-NEXT: Owner: GNU +# LLVM-NEXT: Data size: 0x9 +# LLVM-NEXT: Type: NT_GNU_GOLD_VERSION (gold version) +# LLVM-NEXT: Version: gold 1.11 +# LLVM-NEXT: } +# LLVM-NEXT: } +# LLVM-NEXT: ] --- !ELF FileHeader: @@ -18,6 +58,10 @@ FileHeader: Type: ET_EXEC Machine: EM_X86_64 Sections: + - Name: .note.ABI-tag + Type: SHT_NOTE + AddressAlign: 0x0000000000000004 + Content: 040000001000000001000000474E550000000000020000000600000020000000 - Name: .note.gnu.build-id Type: SHT_NOTE Flags: [ SHF_ALLOC ] diff --git a/llvm/test/tools/llvm-readobj/note-gnu-property.s b/llvm/test/tools/llvm-readobj/note-gnu-property.s index f0a9b131ed5..d513a3e460c 100644 --- a/llvm/test/tools/llvm-readobj/note-gnu-property.s +++ b/llvm/test/tools/llvm-readobj/note-gnu-property.s @@ -1,23 +1,51 @@ // REQUIRES: x86-registered-target // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t -// RUN: llvm-readobj -elf-output-style GNU --notes %t | FileCheck %s +// RUN: llvm-readobj -elf-output-style GNU --notes %t | FileCheck %s --check-prefix=GNU +// RUN: llvm-readobj -elf-output-style LLVM --notes %t | FileCheck %s --check-prefix=LLVM -// CHECK: Displaying notes found at file offset 0x00000040 with length 0x000000b8: -// CHECK-NEXT: Owner Data size Description -// CHECK-NEXT: GNU 0x000000a8 NT_GNU_PROPERTY_TYPE_0 (property note) -// CHECK-NEXT: Properties: stack size: 0x100 -// CHECK-NEXT: stack size: 0x100 -// CHECK-NEXT: no copy on protected -// CHECK-NEXT: X86 features: SHSTK -// CHECK-NEXT: X86 features: IBT, SHSTK -// CHECK-NEXT: X86 features: none -// CHECK-NEXT: <application-specific type 0xfefefefe> -// CHECK-NEXT: stack size: <corrupt length: 0x0> -// CHECK-NEXT: stack size: <corrupt length: 0x4> -// CHECK-NEXT: no copy on protected <corrupt length: 0x1> -// CHECK-NEXT: X86 features: <corrupt length: 0x0> -// CHECK-NEXT: X86 features: IBT, <unknown flags: 0xf000f000f000f000> -// CHECK-NEXT: <corrupt type (0x2) datasz: 0x1> +// GNU: Displaying notes found at file offset 0x00000040 with length 0x000000b8: +// GNU-NEXT: Owner Data size Description +// GNU-NEXT: GNU 0x000000a8 NT_GNU_PROPERTY_TYPE_0 (property note) +// GNU-NEXT: Properties: stack size: 0x100 +// GNU-NEXT: stack size: 0x100 +// GNU-NEXT: no copy on protected +// GNU-NEXT: X86 features: SHSTK +// GNU-NEXT: X86 features: IBT, SHSTK +// GNU-NEXT: X86 features: none +// GNU-NEXT: <application-specific type 0xfefefefe> +// GNU-NEXT: stack size: <corrupt length: 0x0> +// GNU-NEXT: stack size: <corrupt length: 0x4> +// GNU-NEXT: no copy on protected <corrupt length: 0x1> +// GNU-NEXT: X86 features: <corrupt length: 0x0> +// GNU-NEXT: X86 features: IBT, <unknown flags: 0xf000f000f000f000> +// GNU-NEXT: <corrupt type (0x2) datasz: 0x1> + +// LLVM: Notes [ +// LLVM-NEXT: NoteSection { +// LLVM-NEXT: Offset: 0x40 +// LLVM-NEXT: Size: 0xB8 +// LLVM-NEXT: Note { +// LLVM-NEXT: Owner: GNU +// LLVM-NEXT: Data size: 0xA8 +// LLVM-NEXT: Type: NT_GNU_PROPERTY_TYPE_0 (property note) +// LLVM-NEXT: Property [ +// LLVM-NEXT: stack size: 0x100 +// LLVM-NEXT: stack size: 0x100 +// LLVM-NEXT: no copy on protected +// LLVM-NEXT: X86 features: SHSTK +// LLVM-NEXT: X86 features: IBT, SHSTK +// LLVM-NEXT: X86 features: none +// LLVM-NEXT: <application-specific type 0xfefefefe> +// LLVM-NEXT: stack size: <corrupt length: 0x0> +// LLVM-NEXT: stack size: <corrupt length: 0x4> +// LLVM-NEXT: no copy on protected <corrupt length: 0x1> +// LLVM-NEXT: X86 features: <corrupt length: 0x0> +// LLVM-NEXT: X86 features: IBT, <unknown flags: 0xf000f000f000f000> +// LLVM-NEXT: <corrupt type (0x2) datasz: 0x1> +// LLVM-NEXT: ] +// LLVM-NEXT: } +// LLVM-NEXT: } +// LLVM-NEXT: ] .section ".note.gnu.property", "a" .align 4 diff --git a/llvm/test/tools/llvm-readobj/note-gnu-property2.s b/llvm/test/tools/llvm-readobj/note-gnu-property2.s index a7eca87eb3c..473e0a24a7e 100644 --- a/llvm/test/tools/llvm-readobj/note-gnu-property2.s +++ b/llvm/test/tools/llvm-readobj/note-gnu-property2.s @@ -1,11 +1,27 @@ // REQUIRES: x86-registered-target // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t -// RUN: llvm-readobj -elf-output-style GNU --notes %t | FileCheck %s +// RUN: llvm-readobj -elf-output-style GNU --notes %t | FileCheck %s --check-prefix=GNU +// RUN: llvm-readobj -elf-output-style LLVM --notes %t | FileCheck %s --check-prefix=LLVM -// CHECK: Displaying notes found at file offset 0x00000040 with length 0x00000014: -// CHECK-NEXT: Owner Data size Description -// CHECK-NEXT: GNU 0x00000004 NT_GNU_PROPERTY_TYPE_0 (property note) -// CHECK-NEXT: Properties: <corrupted GNU_PROPERTY_TYPE_0> +// GNU: Displaying notes found at file offset 0x00000040 with length 0x00000014: +// GNU-NEXT: Owner Data size Description +// GNU-NEXT: GNU 0x00000004 NT_GNU_PROPERTY_TYPE_0 (property note) +// GNU-NEXT: Properties: <corrupted GNU_PROPERTY_TYPE_0> + +// LLVM: Notes [ +// LLVM-NEXT: NoteSection { +// LLVM-NEXT: Offset: 0x40 +// LLVM-NEXT: Size: 0x14 +// LLVM-NEXT: Note { +// LLVM-NEXT: Owner: GNU +// LLVM-NEXT: Data size: 0x4 +// LLVM-NEXT: Type: NT_GNU_PROPERTY_TYPE_0 (property note) +// LLVM-NEXT: Property [ +// LLVM-NEXT: <corrupted GNU_PROPERTY_TYPE_0> +// LLVM-NEXT: ] +// LLVM-NEXT: } +// LLVM-NEXT: } +// LLVM-NEXT: ] // Section below is broken, check we report that. |