[PATCH] D88635: [llvm-readobj] Add --coff-tls-directory flag to print TLS Directory & test.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 00:52:49 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/COFF/tls-directory.test:3
+
+## Test that the output of --coff-tls-directory works on x86
+## The binary created from this yaml definition is such that .rdata contains
----------------



================
Comment at: llvm/test/tools/llvm-readobj/COFF/tls-directory.test:7
+## TlsTable.RelativeVirtualAddress == .rdata section VirtualAddress.
+## Also note that .rdata section VirtualSize == sizeof(coff_tls_directory32) == sizeof(IMAGE_TLS_DIRECTORY32) == 24
+
----------------



================
Comment at: llvm/test/tools/llvm-readobj/COFF/tls-directory.test:12-13
+
+## .rdata
+## 004040000840400000204000000000000000000000003000
+
----------------
I'm not sure I understand the purpose of this comment.


================
Comment at: llvm/test/tools/llvm-readobj/COFF/tls-directory.test:75
+## TlsTable.RelativeVirtualAddress == .rdata section VirtualAddress.
+## Also note that .rdata section VirtualSize == sizeof(coff_tls_directory64) == sizeof(IMAGE_TLS_DIRECTORY64) == 40
+
----------------



================
Comment at: llvm/test/tools/llvm-readobj/COFF/tls-directory.test:80-81
+
+## .rdata
+## 00400040010000000840004001000000002000400100000000000000000000000000000000003000
+
----------------
Same comment as above - what is this comment giving us?


================
Comment at: llvm/test/tools/llvm-readobj/COFF/tls-directory.test:107-113
+## Test that --coff-tls-directory doesn't output anything if there's no TLS directory.
+## Note that TlsTable.RelativeVirtualAddress/Size = 0.
+
+# RUN: yaml2obj %s --docnum=2 -o %t.no-tls1.exe -DTLSRVA=0 -DTLSSIZE=0
+# RUN: llvm-readobj --coff-tls-directory %t.no-tls1.exe | FileCheck %s --check-prefix NO-TLS1
+
+# NO-TLS1-NOT: TLSDirectory
----------------
I'd move this to be with the other no-tls case below, so that malformed input cases appear next to each other.


================
Comment at: llvm/test/tools/llvm-readobj/COFF/tls-directory.test:116
+
+## Test that --coff-tls-directory errors on malformed input.
+## This test has a correct TLS Directory size but the RVA is invalid.
----------------
No need to repeast this line - it's just a duplicate of the earlier comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88635/new/

https://reviews.llvm.org/D88635



More information about the llvm-commits mailing list