mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 09:38:57 +00:00
PR28391, strip/objcopy --preserve-dates *.a: cannot set time
After commit 985e026451 copy_archive function began to pass invalid
values to the utimensat(2) function when it tries to preserve
timestamps in ar archives. This happens because the bfd_stat_arch_elt
implementation for ar archives fills only the st_mtim.tv_sec part of
the st_mtim timespec structure, but leaves the st_mtim.tv_nsec part
and the whole st_atim timespec untouched leaving them uninitialized
PR 28391
* ar.c (extract_file): Clear buf for preserve_dates.
* objcopy.c (copy_archive): Likewise.
This commit is contained in:
committed by
Alan Modra
parent
cee4c731af
commit
0d62064867
@@ -3600,6 +3600,7 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target,
|
||||
|
||||
if (preserve_dates)
|
||||
{
|
||||
memset (&buf, 0, sizeof (buf));
|
||||
stat_status = bfd_stat_arch_elt (this_element, &buf);
|
||||
|
||||
if (stat_status != 0)
|
||||
|
||||
Reference in New Issue
Block a user