X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=binutils%2Fresres.c;h=115c983756326f88eee2813978d2f71def1f4300;hb=74375d182e992778ef8701278c02a742db6be77e;hp=ff95cb5bea3aa26e34b3353c25f8e67307bc07f9;hpb=cc643b88f142802bf907b2f28ff47c4d1bf55e8b;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/resres.c b/binutils/resres.c index ff95cb5bea..115c983756 100644 --- a/binutils/resres.c +++ b/binutils/resres.c @@ -1,6 +1,5 @@ /* resres.c: read_res_file and write_res_file implementation for windres. - Copyright 1998, 1999, 2001, 2002, 2005, 2007, 2008, 2011 - Free Software Foundation, Inc. + Copyright (C) 1998-2020 Free Software Foundation, Inc. Written by Anders Norlander . Rewritten by Kai Tietz, Onevision. @@ -32,7 +31,6 @@ #include "windres.h" #include -#include static rc_uint_type write_res_directory (windres_bfd *, rc_uint_type, const rc_res_directory *, const rc_res_id *, @@ -144,7 +142,7 @@ write_res_file (const char *fn,const rc_res_directory *resdir) sec_length = write_res_directory ((windres_bfd *) NULL, 0x20UL, resdir, (const rc_res_id *) NULL, (const rc_res_id *) NULL, &language, 1); - if (! bfd_set_section_size (abfd, sec, (sec_length + 3) & ~3)) + if (!bfd_set_section_size (sec, (sec_length + 3) & ~3)) bfd_fatal ("bfd_set_section_size"); if ((sec_length & 3) != 0) set_windres_bfd_content (&wrbfd, sign, sec_length, 4-(sec_length & 3)); @@ -388,8 +386,7 @@ write_res_bin (windres_bfd *wrbfd, rc_uint_type off, const rc_res_resource *res, /* Get number of bytes needed to store an id in binary format */ static unsigned long -get_id_size (id) - const rc_res_id *id; +get_id_size (const rc_res_id *id) { if (id->named) return sizeof (unichar) * (id->u.n.length + 1); @@ -501,7 +498,7 @@ write_res_info (windres_bfd *wrbfd, rc_uint_type off, const rc_res_res_info *inf if (wrbfd) { struct bin_res_info l; - + windres_put_32 (wrbfd, l.version, info->version); windres_put_16 (wrbfd, l.memflags, info->memflags); windres_put_16 (wrbfd, l.language, info->language); @@ -660,17 +657,13 @@ res_append_resource (rc_res_directory **res_dirs, rc_res_resource *resource, if (*res_dirs == NULL) { - static unsigned long timeval; - - /* Use the same timestamp for every resource created in a - single run. */ - if (timeval == 0) - timeval = time (NULL); - *res_dirs = ((rc_res_directory *) res_alloc (sizeof (rc_res_directory))); + (*res_dirs)->characteristics = 0; - (*res_dirs)->time = timeval; + /* Using a real timestamp only serves to create non-deterministic + results. Use zero instead. */ + (*res_dirs)->time = 0; (*res_dirs)->major = 0; (*res_dirs)->minor = 0; (*res_dirs)->entries = NULL;