Executables may not contain a load config, and clients should be able to
test for nullability. Previously we'd return uninitialized memory. Now
getLoadConfig32/64 return valid pointers or null.
Fixes PR34108
llvm-svn: 310308
const debug_directory *DebugDirectoryBegin;
const debug_directory *DebugDirectoryEnd;
// Either coff_load_configuration32 or coff_load_configuration64.
- const void *LoadConfig;
+ const void *LoadConfig = nullptr;
std::error_code getString(uint32_t offset, StringRef &Res) const;
RUN: llvm-readobj -coff-load-config %S/Inputs/coff-load-config-data-end.exe | FileCheck %s --check-prefix=DATAEND
+RUN: llvm-readobj -coff-load-config %S/Inputs/coff-no-load-config.exe | FileCheck %s --check-prefix=NOCONFIG
+
X86: LoadConfig [
X86: Size: 0x5C
X86: TimeDateStamp: 1970-01-01 00:00:00 (0x0)
DATAEND: SEHTable [
DATAEND-NEXT: 0x402006
DATAEND-NEXT: ]
+
+NOCONFIG: Format: COFF-x86-64
+NOCONFIG-NOT: LoadConfig