PR27725, better objcopy -p times

Simon Marchi simon.marchi@polymtl.ca
Thu Apr 15 18:41:04 GMT 2021


On 2021-04-15 4:42 a.m., Alan Modra wrote:
> Nanosecond rather than second resolution.
> 
> There's a good chance this will run foul of some system oddities so I
> won't be backporting this to the branch.
> 
> 	PR 27725
> 	* configure.ac: Check for sys/time.h and utimensat.  Use standard
> 	checks for mkstemp and mkdtemp.  Whitespace.  Check for nanosecond
> 	members of struct stat.
> 	* rename.c: Prefer sys/time.h for utimes over utime.h for utime.
> 	(STAT_TIMESPEC, STAT_TIMESPEC_NS): Define
> 	(get_stat_atime_ns, get_stat_mtime_ns): New inline functions.
> 	(get_stat_atime, get_stat_mtime): Likewise.
> 	(set_times): Choose first available of utimensat, utimes, utime.
> 	Use above inline functions to set timespec and timeval values.
> 	* configure: Regenerate.
> 	* config.in: Regenerate.
> 	* testsuite/binutils-all/objcopy.exp (objcopy_test): Add test of
> 	file timestamp when --preserve-dates is used.

Hi Alan,

Starting with this patch, I get:

libtool: link: ccache gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Werror -I/home/simark/src/binutils-gdb/binutils/../zlib -g3 -O0 -fsanitize=address -fmax-errors=1 -fuse-ld=gold -fsanitize=address -o ar arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o  ../bfd/.libs/libbfd.a -L/home/simark/build/binutils-gdb/zlib -lz ../libiberty/libiberty.a -lfl -ldl
/home/simark/src/binutils-gdb/binutils/rename.c:169: error: undefined reference to 'get_stat_atime'
/home/simark/src/binutils-gdb/binutils/rename.c:170: error: undefined reference to 'get_stat_mtime'

Simon


More information about the Binutils mailing list