mirror of
https://github.com/reactos/reactos.git
synced 2025-06-07 10:20:26 +00:00
[RSYM]
* Pad the coff string space. Brought to you by Arty. svn path=/trunk/; revision=60191
This commit is contained in:
parent
61fde33ba7
commit
a85caee119
1 changed files with 11 additions and 0 deletions
|
@ -1163,6 +1163,8 @@ CreateOutputFile(FILE *OutFile, void *InData,
|
||||||
|
|
||||||
if (OutFileHeader->PointerToSymbolTable)
|
if (OutFileHeader->PointerToSymbolTable)
|
||||||
{
|
{
|
||||||
|
int PaddingFrom = (OutFileHeader->PointerToSymbolTable + StringTableLength) %
|
||||||
|
OutOptHeader->FileAlignment;
|
||||||
fseek(OutFile, OutFileHeader->PointerToSymbolTable, 0);
|
fseek(OutFile, OutFileHeader->PointerToSymbolTable, 0);
|
||||||
|
|
||||||
/* COFF string section is preceeded by a length */
|
/* COFF string section is preceeded by a length */
|
||||||
|
@ -1172,6 +1174,15 @@ CreateOutputFile(FILE *OutFile, void *InData,
|
||||||
The string table length technically counts as part of the string table
|
The string table length technically counts as part of the string table
|
||||||
space itself. */
|
space itself. */
|
||||||
fwrite(StringTable + 4, 1, StringTableLength - 4, OutFile);
|
fwrite(StringTable + 4, 1, StringTableLength - 4, OutFile);
|
||||||
|
|
||||||
|
if (PaddingFrom)
|
||||||
|
{
|
||||||
|
int PaddingSize = OutOptHeader->FileAlignment - PaddingFrom;
|
||||||
|
char *Padding = (char *)malloc(PaddingSize);
|
||||||
|
memset(Padding, 0, PaddingFrom);
|
||||||
|
fwrite(Padding, 1, PaddingSize, OutFile);
|
||||||
|
free(Padding);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PaddedRosSym)
|
if (PaddedRosSym)
|
||||||
|
|
Loading…
Reference in a new issue