Skip to content

Commit 6a23792

Browse files
committed
Don't let ld strip relocations
This is the first step for enabling ASLR (Address Space Layout Randomization) support. The problem is ld.exe seems to be stripping relocations which in turn will break ASLR support. We just make sure its not stripping the main executable entry. Signed-off-by: İsmail Dönmez <ismail@i10z.com>
1 parent 78ce6bc commit 6a23792

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
@@ -544,9 +544,11 @@ else
544544
prefix = /usr/
545545
ifeq (MINGW32,$(MSYSTEM))
546546
prefix = /mingw32
547+
BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
547548
endif
548549
ifeq (MINGW64,$(MSYSTEM))
549550
prefix = /mingw64
551+
BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
550552
else
551553
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
552554
BASIC_LDFLAGS += -Wl,--large-address-aware

0 commit comments

Comments
 (0)