Skip to content

Add DEP, ASLR and HE-ASLR support. #612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions config.mak.uname
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,22 @@ else
ifeq ($(shell expr "$(uname_R)" : '2\.'),2)
# MSys2
prefix = /usr/
# Enable DEP
BASIC_LDFLAGS += -Wl,--nxcompat
# Enable ASLR
BASIC_LDFLAGS += -Wl,--dynamicbase
ifeq (MINGW32,$(MSYSTEM))
prefix = /mingw32
BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
endif
ifeq (MINGW64,$(MSYSTEM))
prefix = /mingw64
# Don't let ld strip relocations
BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
# Enable ASLR^2 aka High-Entropy ASLR
BASIC_LDFLAGS += -Wl,--high-entropy-va
# Set image base >4GB for extra entropy with High Entropy ASLR
BASIC_LDFLAGS += -Wl,--image-base,0x140000000
else
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
BASIC_LDFLAGS += -Wl,--large-address-aware
Expand Down