From e7c5ea405fd863a9fcf85d49694e0f69fd5511ec Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Fri, 26 Apr 2013 21:38:57 +0000 Subject: 2013-04-26 Geoff Pike gold/ * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks(). * layout.cc (Hash_task): New class. (Layout::queue_build_id_tasks): New function. (Layout::write_build_id): Handle single-thread portion of build ID computation. (In some cases, all of it is single-threaded.) Replace {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same functionality in fewer lines of code. * layout.h (Layout::queue_build_id_tasks): New function declaration. * options.h (General_options): make "--build-id" default to tree rather than sha1. Add two new options related to --build-id=tree: --build-id-chunk-size-for-treehash and --build-id-min-file-size-for-treehash. * Makefile.am: add testing of --build-id=tree and related new options (these tests will be invoked by "make check"). * Makefile.in: Regenerate. --- gold/layout.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gold/layout.h') diff --git a/gold/layout.h b/gold/layout.h index 6da9607..1743869 100644 --- a/gold/layout.h +++ b/gold/layout.h @@ -892,6 +892,13 @@ class Layout const Output_data_reloc_generic* dyn_rel, bool add_debug, bool dynrel_includes_plt); + // If a treehash is necessary to compute the build ID, then queue + // the necessary tasks and return a blocker that will unblock when + // they finish. Otherwise return BUILD_ID_BLOCKER. + Task_token* + queue_build_id_tasks(Workqueue* workqueue, Task_token* build_id_blocker, + Output_file* of); + // Compute and write out the build ID if needed. void write_build_id(Output_file*) const; @@ -1354,6 +1361,12 @@ class Layout Gdb_index* gdb_index_data_; // The space for the build ID checksum if there is one. Output_section_data* build_id_note_; + // Temporary storage for tree hash of build ID. + unsigned char* array_of_hashes_; + // Size of array_of_hashes_ (in bytes). + size_t size_of_array_of_hashes_; + // Input view for computing tree hash of build ID. Freed in write_build_id(). + const unsigned char* input_view_; // The output section containing dwarf abbreviations Output_reduced_debug_abbrev_section* debug_abbrev_; // The output section containing the dwarf debug info tree -- cgit v1.1