Set NumberOfSymbols to zero

Acoording to what the spec says about the number of sybols [1]:

"This value should be zero for an image because COFF debugging
information is deprecated."

Changing as if not zero it causes problems to llvm-objcopy. This
affects only the architectures where COFF is not supported by objcopy
and where we build the PE header via assembly code.

[1] https://docs.microsoft.com/en-us/windows/win32/debug/pe-format
This commit is contained in:
Alfonso Sánchez-Beato 2021-07-28 13:50:39 +02:00
parent 269ef9dbc7
commit 31a6aab44c
4 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ coff_header:
.short 2 // nr_sections
.long 0 // TimeDateStamp
.long 0 // PointerToSymbolTable
.long 1 // NumberOfSymbols
.long 0 // NumberOfSymbols
.short section_table - optional_header // SizeOfOptionalHeader
.short 0x206 // Characteristics.
// IMAGE_FILE_DEBUG_STRIPPED |

View File

@ -34,7 +34,7 @@ coff_header:
.short 2 // nr_sections
.long 0 // TimeDateStamp
.long 0 // PointerToSymbolTable
.long 1 // NumberOfSymbols
.long 0 // NumberOfSymbols
.short section_table - optional_header // SizeOfOptionalHeader
.short 0x306 // Characteristics.
// IMAGE_FILE_32BIT_MACHINE |

View File

@ -35,7 +35,7 @@ coff_header:
.short 2 // nr_sections
.long 0 // TimeDateStamp
.long 0 // PointerToSymbolTable
.long 1 // NumberOfSymbols
.long 0 // NumberOfSymbols
.short section_table - optional_header // SizeOfOptionalHeader
.short 0x206 // Characteristics.
// IMAGE_FILE_DEBUG_STRIPPED |

View File

@ -38,7 +38,7 @@ coff_header:
.short 2 // nr_sections
.long 0 // TimeDateStamp
.long 0 // PointerToSymbolTable
.long 1 // NumberOfSymbols
.long 0 // NumberOfSymbols
.short section_table - optional_header // SizeOfOptionalHeader
.short 0x206 // Characteristics.
// IMAGE_FILE_DEBUG_STRIPPED |