[PATCH] D58456: [llvm-readelf]Test a couple of corner-cases for --section-mapping
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 20 09:01:08 PST 2019
jhenderson created this revision.
jhenderson added reviewers: grimar, rupprecht, MaskRay, mattd.
Herald added a reviewer: alexshap.
Herald added a project: LLVM.
This patch adds two new tests for edge-case behaviour for --section-mapping, namely when there are no program headers, and when there are no section headers.
Repository:
rL LLVM
https://reviews.llvm.org/D58456
Files:
test/tools/llvm-readobj/gnu-section-mapping-no-phdrs.test
test/tools/llvm-readobj/gnu-section-mapping-no-shdrs.test
Index: test/tools/llvm-readobj/gnu-section-mapping-no-shdrs.test
===================================================================
--- test/tools/llvm-readobj/gnu-section-mapping-no-shdrs.test
+++ test/tools/llvm-readobj/gnu-section-mapping-no-shdrs.test
@@ -0,0 +1,15 @@
+RUN: llvm-objcopy --strip-sections %p/Inputs/phdrs-elf.exe-x86_64 %t.o
+RUN: llvm-readelf --section-mapping %t.o | FileCheck %s
+CHECK: Section to Segment mapping:
+CHECK-NEXT: Segment Sections...
+CHECK-NEXT: 00 {{$}}
+CHECK-NEXT: 01 {{$}}
+CHECK-NEXT: 02 {{$}}
+CHECK-NEXT: 03 {{$}}
+CHECK-NEXT: 04 {{$}}
+CHECK-NEXT: 05 {{$}}
+CHECK-NEXT: 06 {{$}}
+CHECK-NEXT: 07 {{$}}
+CHECK-NEXT: 08 {{$}}
+CHECK-NEXT: 09 {{$}}
+CHECK-NOT: {{.}}
Index: test/tools/llvm-readobj/gnu-section-mapping-no-phdrs.test
===================================================================
--- test/tools/llvm-readobj/gnu-section-mapping-no-phdrs.test
+++ test/tools/llvm-readobj/gnu-section-mapping-no-phdrs.test
@@ -0,0 +1,5 @@
+RUN: llvm-readelf --section-mapping %p/Inputs/trivial.obj.elf-x86-64 | FileCheck %s
+CHECK: Section to Segment mapping:
+CHECK-NEXT: Segment Sections...
+CHECK-NEXT: None .text .rela.text .data .bss .rodata.str1.1 .note.GNU-stack .shstrtab .symtab .strtab {{$}}
+CHECK-NOT: {{.}}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58456.187594.patch
Type: text/x-patch
Size: 1313 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190220/7019570a/attachment.bin>
More information about the llvm-commits
mailing list