Author: akhaldi
Date: Tue Sep 17 22:39:29 2013
New Revision: 60191
URL:
http://svn.reactos.org/svn/reactos?rev=60191&view=rev
Log:
[RSYM]
* Pad the coff string space. Brought to you by Arty.
Modified:
trunk/reactos/tools/rsym/rsym.c
Modified: trunk/reactos/tools/rsym/rsym.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rsym/rsym.c?rev=6019…
==============================================================================
--- trunk/reactos/tools/rsym/rsym.c [iso-8859-1] (original)
+++ trunk/reactos/tools/rsym/rsym.c [iso-8859-1] Tue Sep 17 22:39:29 2013
@@ -1163,6 +1163,8 @@
if (OutFileHeader->PointerToSymbolTable)
{
+ int PaddingFrom = (OutFileHeader->PointerToSymbolTable + StringTableLength) %
+ OutOptHeader->FileAlignment;
fseek(OutFile, OutFileHeader->PointerToSymbolTable, 0);
/* COFF string section is preceeded by a length */
@@ -1172,6 +1174,15 @@
The string table length technically counts as part of the string table
space itself. */
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)