From 2f563b5100820d5ca2d8ca0d3dd399e5ba6c798b Mon Sep 17 00:00:00 2001 From: Dave Korn Date: Sat, 14 Mar 2009 03:30:26 +0000 Subject: [PATCH] include/ChangeLog 2009-03-12 Dave Korn * coff/internal.h (struct internal_extra_pe_aouthdr): Correct type of DllCharacteristics flags field to unsigned. * coff/pe.h (IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLLCHARACTERISTICS_NO_ISOLATION, IMAGE_DLLCHARACTERISTICS_NO_SEH, IMAGE_DLLCHARACTERISTICS_NO_BIND, IMAGE_DLLCHARACTERISTICS_WDM_DRIVER, IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE): New macros to define flag bit values for DllCharacteristics field of PEAOUTHDR, PEPAOUTHDR. ld/ChangeLog 2009-03-12 Dave Korn Danny Smith * emultmpl/pe.em (pe_dll_characteristics): New variable. (OPTION_DYNAMIC_BASE, OPTION_FORCE_INTEGRITY, OPTION_NX_COMPAT, OPTION_NO_ISOLATION. OPTION_NO_SEH, OPTION_NO_BIND, OPTION_WDM_DRIVER, OPTION_TERMINAL_SERVER_AWARE): New macros for options to set DllCharacteristics flag bits. (gld${EMULATION_NAME}_add_options): Add dynamicbase, forceinteg, nxcompat, no-isolation, no-seh, no-bind, wdmdriver, tsaware options. (init): Add DllCharacteristics field. (gld_${EMULATION_NAME}_list_options): List new options. (gld${EMULATION_NAME}_handle_option): Handle new options. * emultmpl/pep.em (pe_dll_characteristics): New variable. (OPTION_DYNAMIC_BASE, OPTION_FORCE_INTEGRITY, OPTION_NX_COMPAT, OPTION_NO_ISOLATION. OPTION_NO_SEH, OPTION_NO_BIND, OPTION_WDM_DRIVER, OPTION_TERMINAL_SERVER_AWARE): New macros for options to set DllCharacteristics flags. (gld${EMULATION_NAME}_add_options): Add dynamicbase, forceinteg, nxcompat,no-isolation, no-seh, no-bind, wdmdriver, tsaware options. (init): Add DllCharacteristics field. (gld_${EMULATION_NAME}_list_options): List new options. (gld${EMULATION_NAME}_handle_option): Handle new options. * ldtexinfo : Document dynamicbase, forceinteg, nxcompat, no-isolation, no-seh, no-bind, wdmdriver, tsaware options. --- include/ChangeLog | 15 +++++++++++ include/coff/internal.h | 2 +- include/coff/pe.h | 11 ++++++++ ld/ChangeLog | 26 ++++++++++++++++++ ld/emultempl/pe.em | 58 +++++++++++++++++++++++++++++++++++++++ ld/emultempl/pep.em | 60 +++++++++++++++++++++++++++++++++++++++-- ld/ld.texinfo | 40 +++++++++++++++++++++++++++ 7 files changed, 209 insertions(+), 3 deletions(-) diff --git a/include/ChangeLog b/include/ChangeLog index ccfc77665e1..aef73a3a1cb 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,18 @@ +2009-03-14 Dave Korn + + * coff/internal.h (struct internal_extra_pe_aouthdr): Correct type + of DllCharacteristics flags field to unsigned. + * coff/pe.h (IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, + IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, + IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, + IMAGE_DLLCHARACTERISTICS_NO_ISOLATION, + IMAGE_DLLCHARACTERISTICS_NO_SEH, + IMAGE_DLLCHARACTERISTICS_NO_BIND, + IMAGE_DLLCHARACTERISTICS_WDM_DRIVER, + IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE): New macros to + define flag bit values for DllCharacteristics field of PEAOUTHDR, + PEPAOUTHDR. + 2008-12-01 Cary Coutant * plugin-api.h (LDPS_BAD_HANDLE): New constant. diff --git a/include/coff/internal.h b/include/coff/internal.h index 4c4eab9fda0..2c9ae46c554 100644 --- a/include/coff/internal.h +++ b/include/coff/internal.h @@ -185,7 +185,7 @@ struct internal_extra_pe_aouthdr 3 - WINDOWS_CUI runs in Windows char sub. (console app) 5 - OS2_CUI runs in OS/2 character subsystem 7 - POSIX_CUI runs in Posix character subsystem */ - short DllCharacteristics; /* flags for DLL init, use 0 */ + unsigned short DllCharacteristics; /* flags for DLL init */ bfd_vma SizeOfStackReserve; /* amount of memory to reserve */ bfd_vma SizeOfStackCommit; /* amount of memory initially committed for initial thread's stack, default is 0x1000 */ diff --git a/include/coff/pe.h b/include/coff/pe.h index 734b11ab9c7..a7fdd76a3c7 100644 --- a/include/coff/pe.h +++ b/include/coff/pe.h @@ -38,6 +38,17 @@ #define IMAGE_FILE_UP_SYSTEM_ONLY 0x4000 #define IMAGE_FILE_BYTES_REVERSED_HI 0x8000 +/* DllCharacteristics flag bits. The inconsistent naming may seem + odd, but that is how they are defined in the PE specification. */ +#define IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE 0x0040 +#define IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY 0x0080 +#define IMAGE_DLL_CHARACTERISTICS_NX_COMPAT 0x0100 +#define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200 +#define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400 +#define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800 +#define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000 +#define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000 + /* Additional flags to be set for section headers to allow the NT loader to read and write to the section data (to replace the addresses of data in dlls for one thing); also to execute the section in .text's case. */ diff --git a/ld/ChangeLog b/ld/ChangeLog index 860cb8282ac..86cdeb8bcc8 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,29 @@ +2009-03-14 Dave Korn + Danny Smith + + * emultmpl/pe.em (pe_dll_characteristics): New variable. + (OPTION_DYNAMIC_BASE, OPTION_FORCE_INTEGRITY, OPTION_NX_COMPAT, + OPTION_NO_ISOLATION. OPTION_NO_SEH, OPTION_NO_BIND, + OPTION_WDM_DRIVER, OPTION_TERMINAL_SERVER_AWARE): + New macros for options to set DllCharacteristics flag bits. + (gld${EMULATION_NAME}_add_options): Add dynamicbase, forceinteg, + nxcompat, no-isolation, no-seh, no-bind, wdmdriver, tsaware options. + (init): Add DllCharacteristics field. + (gld_${EMULATION_NAME}_list_options): List new options. + (gld${EMULATION_NAME}_handle_option): Handle new options. + * emultmpl/pep.em (pe_dll_characteristics): New variable. + (OPTION_DYNAMIC_BASE, OPTION_FORCE_INTEGRITY, OPTION_NX_COMPAT, + OPTION_NO_ISOLATION. OPTION_NO_SEH, OPTION_NO_BIND, + OPTION_WDM_DRIVER, OPTION_TERMINAL_SERVER_AWARE): + New macros for options to set DllCharacteristics flags. + (gld${EMULATION_NAME}_add_options): Add dynamicbase, forceinteg, + nxcompat,no-isolation, no-seh, no-bind, wdmdriver, tsaware options. + (init): Add DllCharacteristics field. + (gld_${EMULATION_NAME}_list_options): List new options. + (gld${EMULATION_NAME}_handle_option): Handle new options. + * ldtexinfo : Document dynamicbase, forceinteg, nxcompat, + no-isolation, no-seh, no-bind, wdmdriver, tsaware options. + 2009-03-06 Nick Clifton * po/es.po: Updated Spanish translation. diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 58ec809dfe2..04d72295249 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -126,6 +126,7 @@ static flagword real_flags = 0; static int support_old_code = 0; static char * thumb_entry_symbol = NULL; static lang_assignment_statement_type *image_base_statement = 0; +static unsigned short pe_dll_characteristics = 0; #ifdef DLL_SUPPORT static int pe_enable_stdcall_fixup = -1; /* 0=disable 1=enable. */ @@ -229,6 +230,15 @@ fragment <