Fix ImageCharacteristics of PEHeaderBuilder when initialized by CreateLibraryHeader
authorOsman Turan <osman@osmanturan.com>
Wed, 6 Mar 2019 11:03:30 +0000 (14:03 +0300)
committerTomáš Matoušek <tmat@users.noreply.github.com>
Tue, 12 Mar 2019 17:11:55 +0000 (10:11 -0700)
Fixes: dotnet/corefx#35758

Commit migrated from https://github.com/dotnet/corefx/commit/a04be5028544df36b11cabd4081896ba8037b71e

src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEHeaderBuilder.cs

index 1dfdf0f..e9abb62 100644 (file)
@@ -103,7 +103,7 @@ namespace System.Reflection.PortableExecutable
 
         public static PEHeaderBuilder CreateLibraryHeader()
         {
-            return new PEHeaderBuilder(imageCharacteristics: Characteristics.Dll);
+            return new PEHeaderBuilder(imageCharacteristics: Characteristics.ExecutableImage | Characteristics.Dll);
         }
 
         internal bool Is32Bit => Machine != Machine.Amd64 && Machine != Machine.IA64 && Machine != Machine.Arm64;