emultempl/pe.em (gld_${EMULATION_NAME}_set_symbols): Generate correct base
authorNick Clifton <nickc@redhat.com>
Thu, 30 Sep 2004 17:19:19 +0000 (17:19 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 30 Sep 2004 17:19:19 +0000 (17:19 +0000)
  address for position independant executables.
pe-dll.c (pe_dll_fill_sections): Don't mark position independant executables
  as DLLs.

ld/ChangeLog
ld/emultempl/pe.em
ld/pe-dll.c

index f9a078054a60d9d2126d41a05f577edc214e80d9..4f915c565c89e17744571efcf80657398a419038 100644 (file)
@@ -1,3 +1,10 @@
+2004-09-30  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.
+
 2004-09-30  Paul Brook  <paul@codesourcery.com>
 
        * ld.texinfo: Document --target2=abs.
index 9ff5c9c9b82461034e1f5cde13d83db6d720a05e..9f39aa6d9d48fee09d036e35a22b21ae682f0f30 100644 (file)
@@ -665,7 +665,7 @@ gld_${EMULATION_NAME}_set_symbols (void)
     {
       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;
index 0d0ecda87db72da523a49660ab4401a40a123f4d..8813de6361fcc672907282ab387d0eaf004f0c17 100644 (file)
@@ -2665,7 +2665,7 @@ pe_dll_fill_sections (bfd *abfd, struct bfd_link_info *info)
 
   fill_edata (abfd, info);
 
-  if (info->shared)
+  if (info->shared && !info->pie)
     pe_data (abfd)->dll = 1;
 
   edata_s->contents = edata_d;