mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-01 01:45:51 +08:00
COFF/PE: don't leave zero timestamp after objcopy / strip
Fill the timestamp field suitably for _bfd_XXi_only_swap_filehdr_out(). Instead of re-arranging the present if(), fold this logic with that of copying the optional header.
This commit is contained in:
@ -2747,8 +2747,15 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
|
|||||||
/* Copy PE parameters before changing them. */
|
/* Copy PE parameters before changing them. */
|
||||||
if (bfd_get_flavour (ibfd) == bfd_target_coff_flavour
|
if (bfd_get_flavour (ibfd) == bfd_target_coff_flavour
|
||||||
&& bfd_pei_p (ibfd))
|
&& bfd_pei_p (ibfd))
|
||||||
|
{
|
||||||
pe->pe_opthdr = pe_data (ibfd)->pe_opthdr;
|
pe->pe_opthdr = pe_data (ibfd)->pe_opthdr;
|
||||||
|
|
||||||
|
if (preserve_dates)
|
||||||
|
pe->timestamp = pe_data (ibfd)->coff.timestamp;
|
||||||
|
else
|
||||||
|
pe->timestamp = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (pe_file_alignment != (bfd_vma) -1)
|
if (pe_file_alignment != (bfd_vma) -1)
|
||||||
pe->pe_opthdr.FileAlignment = pe_file_alignment;
|
pe->pe_opthdr.FileAlignment = pe_file_alignment;
|
||||||
else
|
else
|
||||||
@ -2793,11 +2800,6 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
|
|||||||
|
|
||||||
file_alignment, section_alignment);
|
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free (isympp);
|
free (isympp);
|
||||||
|
Reference in New Issue
Block a user