Skip to content

Commit 995d865

Browse files
ismaildscho
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 8c8ee87 commit 995d865

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
@@ -577,10 +577,12 @@ else
577577
ifeq (MINGW32,$(MSYSTEM))
578578
prefix = /mingw32
579579
HOST_CPU = i686
580+
BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
580581
endif
581582
ifeq (MINGW64,$(MSYSTEM))
582583
prefix = /mingw64
583584
HOST_CPU = x86_64
585+
BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
584586
else
585587
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
586588
BASIC_LDFLAGS += -Wl,--large-address-aware

0 commit comments

Comments
 (0)