Skip to content

Commit bd0dba8

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 2508810 commit bd0dba8

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
@@ -548,9 +548,11 @@ else
548548
prefix = /usr/
549549
ifeq (MINGW32,$(MSYSTEM))
550550
prefix = /mingw32
551+
BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
551552
endif
552553
ifeq (MINGW64,$(MSYSTEM))
553554
prefix = /mingw64
555+
BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
554556
else
555557
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
556558
BASIC_LDFLAGS += -Wl,--large-address-aware

0 commit comments

Comments
 (0)