aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/pep.em
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-08-20 16:10:29 +0100
committerNick Clifton <nickc@redhat.com>2014-08-20 16:10:29 +0100
commit2d5c3743a3a223dc6467ff022124b4f2f1844c91 (patch)
treec8d626b5afab0f3a57911c01e6c5194ed7247310 /ld/emultempl/pep.em
parentd36430db79dc8eccb9cb188e1234f7ff044f79b4 (diff)
downloadgdb-2d5c3743a3a223dc6467ff022124b4f2f1844c91.zip
gdb-2d5c3743a3a223dc6467ff022124b4f2f1844c91.tar.gz
gdb-2d5c3743a3a223dc6467ff022124b4f2f1844c91.tar.bz2
Enabling the HIGH_ENTROPY_VA flag allows the operating system to use
addresses outside of the 32-bit range before memory exhaustion. This results in a higher entropy implementation of ASLR when used with the DYNAMIC_BASE flag. * include/coff/pe.h: Add HIGH_ENTROPY_VA flag * ld/emultempl/pep.em: Add --high-entropy-va switch * ld/ld.texinfo: Document the --high-entropy-va switch
Diffstat (limited to 'ld/emultempl/pep.em')
-rw-r--r--ld/emultempl/pep.em7
1 files changed, 7 insertions, 0 deletions
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index 916a786..6d56bc3 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -237,6 +237,7 @@ enum options
OPTION_LEADING_UNDERSCORE,
OPTION_ENABLE_LONG_SECTION_NAMES,
OPTION_DISABLE_LONG_SECTION_NAMES,
+ OPTION_HIGH_ENTROPY_VA,
OPTION_DYNAMIC_BASE,
OPTION_FORCE_INTEGRITY,
OPTION_NX_COMPAT,
@@ -314,6 +315,7 @@ gld${EMULATION_NAME}_add_options
#endif
{"enable-long-section-names", no_argument, NULL, OPTION_ENABLE_LONG_SECTION_NAMES},
{"disable-long-section-names", no_argument, NULL, OPTION_DISABLE_LONG_SECTION_NAMES},
+ {"high-entropy-va", no_argument, NULL, OPTION_HIGH_ENTROPY_VA},
{"dynamicbase",no_argument, NULL, OPTION_DYNAMIC_BASE},
{"forceinteg", no_argument, NULL, OPTION_FORCE_INTEGRITY},
{"nxcompat", no_argument, NULL, OPTION_NX_COMPAT},
@@ -450,6 +452,8 @@ gld_${EMULATION_NAME}_list_options (FILE *file)
executable image files\n"));
fprintf (file, _(" --disable-long-section-names Never use long COFF section names, even\n\
in object files\n"));
+ fprintf (file, _(" --high-entropy-va Image is compatible with 64-bit address space\n\
+ layout randomization (ASLR)\n"));
fprintf (file, _(" --dynamicbase Image base address may be relocated using\n\
address space layout randomization (ASLR)\n"));
fprintf (file, _(" --forceinteg Code integrity checks are enforced\n"));
@@ -804,6 +808,9 @@ gld${EMULATION_NAME}_handle_option (int optc)
pep_use_coff_long_section_names = 0;
break;
/* Get DLLCharacteristics bits */
+ case OPTION_HIGH_ENTROPY_VA:
+ pe_dll_characteristics |= IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA;
+ break;
case OPTION_DYNAMIC_BASE:
pe_dll_characteristics |= IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE;
break;