X-Git-Url: http://drtracing.org/?a=blobdiff_plain;ds=sidebyside;f=ld%2Fpe-dll.c;h=0addde231863a50e7111e2ce23cd00699dcfb98c;hb=39a7b38fac0e6e90baa3d661a271377db3ba1765;hp=7f45546aaf5ea54713346bdee7c13b868d11d184;hpb=599956cfe164ca2f4f7d04b90aee1db98930a023;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/pe-dll.c b/ld/pe-dll.c index 7f45546aaf..0addde2318 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -1,5 +1,5 @@ /* Routines to help build PEI-format DLLs (Win32 etc) - Copyright (C) 1998-2019 Free Software Foundation, Inc. + Copyright (C) 1998-2020 Free Software Foundation, Inc. Written by DJ Delorie This file is part of the GNU Binutils. @@ -160,6 +160,7 @@ int pe_dll_extra_pe_debug = 0; int pe_use_nul_prefixed_import_tables = 0; int pe_use_coff_long_section_names = -1; int pe_leading_underscore = -1; +int pe_dll_enable_reloc_section = 0; /* Static variables and types. */ @@ -1210,8 +1211,10 @@ fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED) memset (edata_d, 0, edata_sz); - if (pe_data (abfd)->insert_timestamp) + if (pe_data (abfd)->timestamp == -1) H_PUT_32 (abfd, time (0), edata_d + 4); + else + H_PUT_32 (abfd, pe_data (abfd)->timestamp, edata_d + 4); if (pe_def_file->version_major != -1) { @@ -3554,7 +3557,14 @@ pe_dll_build_sections (bfd *abfd, struct bfd_link_info *info) process_def_file_and_drectve (abfd, info); if (pe_def_file->num_exports == 0 && !bfd_link_pic (info)) - return; + { + if (pe_dll_enable_reloc_section) + { + build_filler_bfd (0); + pe_output_file_set_long_section_names (filler_bfd); + } + return; + } generate_edata (abfd, info); build_filler_bfd (1); @@ -3573,33 +3583,16 @@ pe_exe_build_sections (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED) void pe_dll_fill_sections (bfd *abfd, struct bfd_link_info *info) { - pe_dll_id_target (bfd_get_target (abfd)); - pe_output_file_set_long_section_names (abfd); - image_base = pe_data (abfd)->pe_opthdr.ImageBase; + pe_exe_fill_sections (abfd, info); - generate_reloc (abfd, info); - if (reloc_sz > 0) + if (edata_s) { - bfd_set_section_size (reloc_s, reloc_sz); - - /* Resize the sections. */ - lang_reset_memory_regions (); - lang_size_sections (NULL, TRUE); - - /* Redo special stuff. */ - ldemul_after_allocation (); - - /* Do the assignments again. */ - lang_do_assignments (lang_final_phase_enum); + fill_edata (abfd, info); + edata_s->contents = edata_d; } - fill_edata (abfd, info); - if (bfd_link_dll (info)) pe_data (abfd)->dll = 1; - - edata_s->contents = edata_d; - reloc_s->contents = reloc_d; } void