From 5e8a351200c7e62e8a5cf632f1f397ad941e1a29 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 30 Sep 2004 17:19:19 +0000 Subject: [PATCH] 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/ChangeLog | 7 +++++++ ld/emultempl/pe.em | 2 +- ld/pe-dll.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index f9a078054a..4f915c565c 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2004-09-30 Filip Navara + + * 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 * ld.texinfo: Document --target2=abs. diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 9ff5c9c9b8..9f39aa6d9d 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -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; diff --git a/ld/pe-dll.c b/ld/pe-dll.c index 0d0ecda87d..8813de6361 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -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; -- 2.11.0