diff options
author | Cory Fields <cory@coryfields.com> | 2013-11-22 14:54:33 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2013-11-22 14:55:56 +0000 |
commit | 0cb112f7400187275da81a05a9ad0534f1430139 (patch) | |
tree | d5f66a797c7e83233320057c2ea9809266c3cffc /ld/emultempl/pep.em | |
parent | 194cca41192efa65f710967e3149bbc813c12b22 (diff) | |
download | gdb-0cb112f7400187275da81a05a9ad0534f1430139.zip gdb-0cb112f7400187275da81a05a9ad0534f1430139.tar.gz gdb-0cb112f7400187275da81a05a9ad0534f1430139.tar.bz2 |
* windres.c (define_resource): Use zero for timestamp, making
output deterministic. time.h include is no longer needed.
* resres.c (res_append_resource): Likewise.
* pe-dll.c (fill_edata): Only use a real timestamp if
--insert-timestamp was used.
* emultempl/pe.em: Add the --insert-timestamp option.
* emultempl/pep.em: Likewise for 64bit.
* ld.texinfo: Document the --insert-timestamp option.
* libcoff-in.h: Add insert_timestamp flag to the pe_data struct.
* libcoff.h: Regenerate.
* peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Only use a real
timestamp if --insert-timestamp was used.
Diffstat (limited to 'ld/emultempl/pep.em')
-rw-r--r-- | ld/emultempl/pep.em | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index 3e8b65e..b738800 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -18,8 +18,7 @@ esac rm -f e${EMULATION_NAME}.c (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-) fragment <<EOF -/* Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 - Free Software Foundation, Inc. +/* Copyright 2006-2013 Free Software Foundation, Inc. Written by Kai Tietz, OneVision Software GmbH&CoKg. This file is part of the GNU Binutils. @@ -146,6 +145,7 @@ static flagword real_flags = IMAGE_FILE_LARGE_ADDRESS_AWARE; static int support_old_code = 0; static lang_assignment_statement_type *image_base_statement = 0; static unsigned short pe_dll_characteristics = 0; +static bfd_boolean insert_timestamp = FALSE; #ifdef DLL_SUPPORT static int pep_enable_stdcall_fixup = 1; /* 0=disable 1=enable (default). */ @@ -241,6 +241,7 @@ enum options OPTION_NO_SEH, OPTION_NO_BIND, OPTION_WDM_DRIVER, + OPTION_INSERT_TIMESTAMP, OPTION_TERMINAL_SERVER_AWARE }; @@ -316,6 +317,7 @@ gld${EMULATION_NAME}_add_options {"no-bind", no_argument, NULL, OPTION_NO_BIND}, {"wdmdriver", no_argument, NULL, OPTION_WDM_DRIVER}, {"tsaware", no_argument, NULL, OPTION_TERMINAL_SERVER_AWARE}, + {"insert-timestamp", no_argument, NULL, OPTION_INSERT_TIMESTAMP}, {NULL, no_argument, NULL, 0} }; @@ -402,6 +404,8 @@ gld_${EMULATION_NAME}_list_options (FILE *file) fprintf (file, _(" --subsystem <name>[:<version>] Set required OS subsystem [& version]\n")); fprintf (file, _(" --support-old-code Support interworking with old code\n")); fprintf (file, _(" --[no-]leading-underscore Set explicit symbol underscore prefix mode\n")); + fprintf (file, _(" --insert-timestamp Use a real timestamp rather than zero.\n")); + fprintf (file, _(" This makes binaries non-deterministic\n")); #ifdef DLL_SUPPORT fprintf (file, _(" --add-stdcall-alias Export symbols with and without @nn\n")); fprintf (file, _(" --disable-stdcall-fixup Don't link _sym to _sym@nn\n")); @@ -707,6 +711,9 @@ gld${EMULATION_NAME}_handle_option (int optc) case OPTION_LEADING_UNDERSCORE: pep_leading_underscore = 1; break; + case OPTION_INSERT_TIMESTAMP: + insert_timestamp = TRUE; + break; #ifdef DLL_SUPPORT case OPTION_OUT_DEF: pep_out_def_filename = xstrdup (optarg); @@ -1219,6 +1226,7 @@ gld_${EMULATION_NAME}_after_open (void) 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; /* At this point we must decide whether to use long section names in the output or not. If the user hasn't explicitly specified |