Skip to content

Commit 9ebc378

Browse files
ismailGit for Windows Build Agent
authored andcommitted
Don't let ld strip relocations
This is the first step for enabling ASLR (Address Space Layout Randomization) support. We want to enable ASLR for better protection against exploiting security holes in Git. The problem fixed by this commit is that `ld.exe` seems to be stripping relocations which in turn will break ASLR support. We just make sure it's not stripping the main executable entry. Signed-off-by: İsmail Dönmez <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent a3646e0 commit 9ebc378

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

config.mak.uname

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,12 @@ else
574574
ifeq (MINGW32,$(MSYSTEM))
575575
prefix = /mingw32
576576
HOST_CPU = i686
577+
BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
577578
endif
578579
ifeq (MINGW64,$(MSYSTEM))
579580
prefix = /mingw64
580581
HOST_CPU = x86_64
582+
BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
581583
else
582584
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
583585
BASIC_LDFLAGS += -Wl,--large-address-aware

0 commit comments

Comments
 (0)