From 2fcaa16c13eda34307ccceea2263e474c54ee075 Mon Sep 17 00:00:00 2001
From: Mattiwatti <mattiwatti@gmail.com>
Date: Tue, 21 Jan 2020 16:03:40 +0100
Subject: [PATCH] Make PE load config directory address dword aligned
---
src/pefile.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pefile.cpp b/src/pefile.cpp
index 7bf66cbe..d957886f 100644
--- a/src/pefile.cpp
+++ b/src/pefile.cpp
@@ -2427,7 +2427,7 @@ void PeFile::pack0(OutputFile *fo, ht &ih, ht &oh,
processTls(&rel,&tlsiv,ic);
ODADDR(PEDIR_TLS) = sotls ? ic : 0;
ODSIZE(PEDIR_TLS) = sotls ? (sizeof(LEXX) == 4 ? 0x18 : 0x28) : 0;
- ic += sotls;
+ ic = ALIGN_UP(ic + sotls, 4u);
processLoadConf(&rel, &loadconfiv, ic);
ODADDR(PEDIR_LOADCONF) = soloadconf ? ic : 0;