Skip to content

[llvm-readobj][COFF] Improve extended DLL characteristics test #151978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--- !COFF
OptionalHeader:
AddressOfEntryPoint: 0
ImageBase: 0x180000000
SectionAlignment: 4096
FileAlignment: 512
MajorOperatingSystemVersion: 6
MinorOperatingSystemVersion: 0
MajorImageVersion: 0
MinorImageVersion: 0
MajorSubsystemVersion: 6
MinorSubsystemVersion: 0
Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI
DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
SizeOfStackReserve: 1048576
SizeOfStackCommit: 4096
SizeOfHeapReserve: 1048576
SizeOfHeapCommit: 4096
Debug:
RelativeVirtualAddress: 8192
Size: 56
header:
Machine: IMAGE_FILE_MACHINE_AMD64
Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_DLL, IMAGE_FILE_LARGE_ADDRESS_AWARE ]
sections:
- Name: .rdata
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
VirtualAddress: 8192
VirtualSize: 180
SectionData: 0000000091BE906800000000020000005500000058200000580400000000000091BE9068000000001400000004000000B0200000B0040000180000000380038000000000000000005020000008000000101000000300000052534453867E6BCADB53244591DEC582FAB540DB10000000433A5C55736572735C73756E675C446F63756D656E74735C636F64655C636574657865635C7836345C52656C656173655C636574657865632E706462000000008F000000
SizeOfRawData: 512
symbols: []
...
7 changes: 3 additions & 4 deletions llvm/test/tools/llvm-readobj/COFF/exdllcharacteristics.test
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# To regenerate has-exdllcharacteristics.exe
# $ echo int main() { return 0; } > has-exdllcharacteristics.c
# To make minimum possible stub file (to decrease the binary size)
# $ echo -n '4D5A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' | xxd -r -p > stub
# $ cl has-exdllcharacteristics.c /link /entry:main /STUB:stub /NOCOFFGRPINFO /EMITTOOLVERSIONINFO:NO /EMITPOGOPHASEINFO /NOVCFEATURE /MANIFEST:NO /cetcompat /cetcompatstrict /cetdynamicapisinproc /cetipvalidationrelaxed /hotpatchcompatible /functionpadmin:6
RUN: llvm-readobj --coff-debug-directory %p/Inputs/has-exdllcharacteristics.exe | FileCheck %s
# $ cl has-exdllcharacteristics.c /link /entry:main /cetcompat /cetcompatstrict /cetdynamicapisinproc /cetipvalidationrelaxed /hotpatchcompatible /functionpadmin:6
RUN: yaml2obj %p/Inputs/has-exdllcharacteristics.yaml > %t.exe
RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck %s

CHECK: DebugEntry {
CHECK: Characteristics: 0x0
Expand Down