This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Support for -pie flag on PE executables


ChangeLog:

2004-09-18 Filip Navara <navaraf@reactos.com>

   * emultempl/pe.em (gld_${EMULATION_NAME}_set_symbols):
   Generate correct base address for position independant executables.
   * pe-dll.c (pe_dll_fill_sections):
   Don't mark position independant executables as DLLs.

ChangeLog:

2004-09-18  Filip Navara  <navaraf@reactos.com>

	* emultempl/pe.em (gld_${EMULATION_NAME}_set_symbols):
	Generate correct base address for position independant executables.
	* pe-dll.c (pe_dll_fill_sections):
	Don't mark position independant executables as DLLs.

--- ld/emultempl/pe.em	Tue Jul 13 20:56:38 2004
+++ ld/emultempl/pe.em	Sat Sep 18 13:45:56 2004
@@ -665,7 +665,7 @@
     {
       if (link_info.relocatable)
 	init[IMAGEBASEOFF].value = 0;
-      else if (init[DLLOFF].value || link_info.shared)
+      else if (init[DLLOFF].value || (link_info.shared && !link_info.pie))
 #ifdef DLL_SUPPORT
 	init[IMAGEBASEOFF].value = (pe_enable_auto_image_base) ?
 	  compute_dll_image_base (output_filename) : NT_DLL_IMAGE_BASE;
--- ld/pe-dll.c	Tue Jul 13 10:55:53 2004
+++ ld/pe-dll.c	Sat Sep 18 13:36:31 2004
@@ -2665,7 +2665,7 @@
 
   fill_edata (abfd, info);
 
-  if (info->shared)
+  if (info->shared && !info->pie)
     pe_data (abfd)->dll = 1;
 
   edata_s->contents = edata_d;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]