summaryrefslogtreecommitdiffstats
path: root/lldb/test/Shell/ObjectFile/PECOFF
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2019-10-25 21:44:46 +0000
committerPavel Labath <labath@google.com>2019-10-25 22:11:53 +0000
commit73a7a55c0ec976fecadd7a872d24d850f8cd793a (patch)
tree26449ff00265f540b6ac31cc4f83f18138e245da /lldb/test/Shell/ObjectFile/PECOFF
parent4c0251da149c99f49550d6c938e6e7f45075194d (diff)
downloadbcm5719-llvm-73a7a55c0ec976fecadd7a872d24d850f8cd793a.tar.gz
bcm5719-llvm-73a7a55c0ec976fecadd7a872d24d850f8cd793a.zip
lldb/COFF: Create a separate "section" for the file header
In an attempt to ensure that every part of the module's memory image is accounted for, D56537 created a special "container section" spanning the entire image. While that seemed reasonable at the time (and it still mostly does), it did create a problem of what to put as the "file size" of the section, because the image is not continuous on disk, as we generally assume (which is why I put zero there). Additionally, this arrangement makes it unclear what kind of permissions should be assigned to that section (which is what my next patch does). To get around these, this patch partially reverts D56537, and goes back to top-level sections. Instead, what I do is create a new "section" for the object file header, which is also being loaded into memory, though its not considered to be a section in the strictest sense. This makes it possible to correctly assign file size section, and we can later assign permissions to it as well. Reviewers: amccarth, mstorsjo Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D69100
Diffstat (limited to 'lldb/test/Shell/ObjectFile/PECOFF')
-rw-r--r--lldb/test/Shell/ObjectFile/PECOFF/export-dllfunc.yaml10
-rw-r--r--lldb/test/Shell/ObjectFile/PECOFF/sections.yaml (renamed from lldb/test/Shell/ObjectFile/PECOFF/subsections.yaml)48
2 files changed, 31 insertions, 27 deletions
diff --git a/lldb/test/Shell/ObjectFile/PECOFF/export-dllfunc.yaml b/lldb/test/Shell/ObjectFile/PECOFF/export-dllfunc.yaml
index 1f858d735ec..c1ada73046d 100644
--- a/lldb/test/Shell/ObjectFile/PECOFF/export-dllfunc.yaml
+++ b/lldb/test/Shell/ObjectFile/PECOFF/export-dllfunc.yaml
@@ -11,20 +11,24 @@
# UUID should not be empty if the module is built with debug info.
# BASIC-CHECK-DAG: UUID: {{[0-9A-F]{7,}[0-9A-F]}}-{{.*}}
-# BASIC-CHECK: Showing 3 subsections
+# BASIC-CHECK: Showing 4 sections
+#
# BASIC-CHECK: Index: 0
+# BASIC-CHECK: Name: PECOFF header
+#
+# BASIC-CHECK: Index: 1
# BASIC-CHECK: Name: .text
# BASIC-CHECK: Type: code
# BASIC-CHECK: VM size: 22
# BASIC-CHECK: File size: 512
#
-# BASIC-CHECK: Index: 1
+# BASIC-CHECK: Index: 2
# BASIC-CHECK: Name: .rdata
# BASIC-CHECK: Type: data
# BASIC-CHECK: VM size: {{.}}
# BASIC-CHECK: File size: 512
#
-# BASIC-CHECK: Index: 2
+# BASIC-CHECK: Index: 3
# BASIC-CHECK: Name: .pdata
# BASIC-CHECK: Type: data
# BASIC-CHECK: VM size: 12
diff --git a/lldb/test/Shell/ObjectFile/PECOFF/subsections.yaml b/lldb/test/Shell/ObjectFile/PECOFF/sections.yaml
index d7ecf68e84a..715ef523c13 100644
--- a/lldb/test/Shell/ObjectFile/PECOFF/subsections.yaml
+++ b/lldb/test/Shell/ObjectFile/PECOFF/sections.yaml
@@ -2,36 +2,36 @@
# RUN: lldb-test object-file %t | FileCheck %s
-# CHECK: Showing 1 sections
+# CHECK: Showing 3 sections
# CHECK-NEXT: Index: 0
# CHECK-NEXT: ID: 0xffffffffffffffff
-# CHECK-NEXT: Name:
-# CHECK-NEXT: Type: container
+# CHECK-NEXT: Name: PECOFF header
+# CHECK-NEXT: Type: regular
# CHECK-NEXT: Permissions: ---
# CHECK-NEXT: Thread specific: no
# CHECK-NEXT: VM address: 0x40000000
-# CHECK-NEXT: VM size: 12288
-# CHECK-NEXT: File size: 0
-# CHECK-NEXT: Showing 2 subsections
-# CHECK-NEXT: Index: 0
-# CHECK-NEXT: ID: 0x1
-# CHECK-NEXT: Name: .text
-# CHECK-NEXT: Type: code
-# CHECK-NEXT: Permissions: ---
-# CHECK-NEXT: Thread specific: no
-# CHECK-NEXT: VM address: 0x40001000
-# CHECK-NEXT: VM size: 64
-# CHECK-NEXT: File size: 512
+# CHECK-NEXT: VM size: 512
+# CHECK-NEXT: File size: 512
# CHECK-EMPTY:
-# CHECK-NEXT: Index: 1
-# CHECK-NEXT: ID: 0x2
-# CHECK-NEXT: Name: .data
-# CHECK-NEXT: Type: data
-# CHECK-NEXT: Permissions: ---
-# CHECK-NEXT: Thread specific: no
-# CHECK-NEXT: VM address: 0x40002000
-# CHECK-NEXT: VM size: 64
-# CHECK-NEXT: File size: 512
+# CHECK-NEXT: Index: 1
+# CHECK-NEXT: ID: 0x1
+# CHECK-NEXT: Name: .text
+# CHECK-NEXT: Type: code
+# CHECK-NEXT: Permissions: ---
+# CHECK-NEXT: Thread specific: no
+# CHECK-NEXT: VM address: 0x40001000
+# CHECK-NEXT: VM size: 64
+# CHECK-NEXT: File size: 512
+# CHECK-EMPTY:
+# CHECK-NEXT: Index: 2
+# CHECK-NEXT: ID: 0x2
+# CHECK-NEXT: Name: .data
+# CHECK-NEXT: Type: data
+# CHECK-NEXT: Permissions: ---
+# CHECK-NEXT: Thread specific: no
+# CHECK-NEXT: VM address: 0x40002000
+# CHECK-NEXT: VM size: 64
+# CHECK-NEXT: File size: 512
--- !COFF
OpenPOWER on IntegriCloud