+2020-03-30 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/pr25662
+ * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
+ field to timestamp and make it an integer.
+ * libcoff.h: Regenerate.
+ * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
+ field in the pe_data structure rather than the insert_timestamp
+ field.
+
2020-03-30 Alan Modra <amodra@gmail.com>
PR 25745
int has_reloc_section;
int dont_strip_reloc;
int dos_message[16];
- bfd_boolean insert_timestamp;
+ /* The timestamp to insert into the output file.
+ If the timestamp is -1 then the current time is used. */
+ int timestamp;
bfd_boolean (*in_reloc_p) (bfd *, reloc_howto_type *);
flagword real_flags;
int has_reloc_section;
int dont_strip_reloc;
int dos_message[16];
- bfd_boolean insert_timestamp;
+ /* The timestamp to insert into the output file.
+ If the timestamp is -1 then the current time is used. */
+ int timestamp;
bfd_boolean (*in_reloc_p) (bfd *, reloc_howto_type *);
flagword real_flags;
/* Use a real timestamp by default, unless the no-insert-timestamp
option was chosen. */
- if ((pe_data (abfd)->insert_timestamp))
+ if ((pe_data (abfd)->timestamp) == -1)
H_PUT_32 (abfd, time (0), filehdr_out->f_timdat);
else
- H_PUT_32 (abfd, 0, filehdr_out->f_timdat);
+ H_PUT_32 (abfd, pe_data (abfd)->timestamp, filehdr_out->f_timdat);
PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr,
filehdr_out->f_symptr);
+2020-03-30 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/25662
+ * objcopy.c (copy_object): When copying PE format files set the
+ timestamp field in the pe_data structure if the preserve_dates
+ flag is set.
+ * testsuite/binutils-all/objcopy.exp (objcopy_test) Use
+ --preserve-dates in place of the -p option, in order to make its
+ effect more obvious.
+
2020-03-28 Alan Modra <amodra@gmail.com>
* testsuite/binutils-all/objcopy.exp (objcopy_test): Only
file_alignment, section_alignment);
}
+
+ if (preserve_dates
+ && bfd_get_flavour (ibfd) == bfd_target_coff_flavour
+ && bfd_pei_p (ibfd))
+ pe->timestamp = pe_data (ibfd)->coff.timestamp;
}
if (isympp)
unresolved "objcopy $type ($testname)"
return
}
- set xflags "-p"
+ set xflags "--preserve-dates"
}
set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS $xflags $t_tempfile $t_copyfile"]
+2020-03-30 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/25662
+ * emultempl/pe.em (after_open): Replace initialisation of the
+ insert_timestamp field in the pe_data structure with an
+ initialisation of the timestamp field.
+ * emultemp/pep.em: Likewise.
+ * pe-dll.c (fill_edata): Use the timestamp field in the pe_data
+ structure instead of the insert_timestamp field.
+
2020-03-28 H.J. Lu <hongjiu.lu@intel.com>
PR 25732
pe_data (link_info.output_bfd)->pe_opthdr = pe;
pe_data (link_info.output_bfd)->dll = init[DLLOFF].value;
pe_data (link_info.output_bfd)->real_flags |= real_flags;
- pe_data (link_info.output_bfd)->insert_timestamp = insert_timestamp;
+ if (insert_timestamp)
+ pe_data (link_info.output_bfd)->timestamp = -1;
+ else
+ pe_data (link_info.output_bfd)->timestamp = 0;
/* At this point we must decide whether to use long section names
in the output or not. If the user hasn't explicitly specified
pe_data (link_info.output_bfd)->pe_opthdr = pep;
pe_data (link_info.output_bfd)->dll = init[DLLOFF].value;
pe_data (link_info.output_bfd)->real_flags |= real_flags;
- pe_data (link_info.output_bfd)->insert_timestamp = insert_timestamp;
+ if (insert_timestamp)
+ pe_data (link_info.output_bfd)->timestamp = -1;
+ else
+ pe_data (link_info.output_bfd)->timestamp = 0;
/* At this point we must decide whether to use long section names
in the output or not. If the user hasn't explicitly specified
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)
{