diff options
author | Ian Lance Taylor <ian@airs.com> | 2008-03-25 05:11:41 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2008-03-25 05:11:41 +0000 |
commit | 8ed814a99c1393f82d754fba230c6187eecc2e2e (patch) | |
tree | c13bb1cf83fb27336aae697f94e8a1fb69ec9380 /gold/layout.h | |
parent | baf4901374130b96e5d3792794b29b8dfb46dd32 (diff) | |
download | binutils-8ed814a99c1393f82d754fba230c6187eecc2e2e.zip binutils-8ed814a99c1393f82d754fba230c6187eecc2e2e.tar.gz binutils-8ed814a99c1393f82d754fba230c6187eecc2e2e.tar.bz2 |
* options.h (class General_options): Define build_id option.
* layout.h (class Layout): Declare write_build_id, create_note,
create_build_id. Add build_id_note_ member.
* layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
"libiberty.h", "md5.h", "sha1.h".
(Layout::Layout): Initialize eh_frame_data_,
eh_frame_hdr_section_, and build_id_note_.
(Layout::finalize): Call create_build_id.
(Layout::create_note): New function, broken out of
Layout::create_gold_note.
(Layout::create_gold_note): Call create_note.
(Layout::create_build_id): New function.
(Layout::write_build_id): New function.
(Close_task_runner::run): Call write_build_id.
Diffstat (limited to 'gold/layout.h')
-rw-r--r-- | gold/layout.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gold/layout.h b/gold/layout.h index 714c374..fe888c7 100644 --- a/gold/layout.h +++ b/gold/layout.h @@ -294,6 +294,10 @@ class Layout script_options() const { return this->script_options_; } + // Compute and write out the build ID if needed. + void + write_build_id(Output_file*) const; + // Rewrite output file in binary format. void write_binary(Output_file* in) const; @@ -370,6 +374,11 @@ class Layout }; typedef std::vector<Group_signature> Group_signatures; + // Create a .note section, filling in the header. + Output_section* + create_note(const char* name, int note_type, size_t descsz, + bool allocate, size_t* trailing_padding); + // Create a .note section for gold. void create_gold_note(); @@ -378,6 +387,10 @@ class Layout void create_executable_stack_info(const Target*); + // Create a build ID note if needed. + void + create_build_id(); + // Find the first read-only PT_LOAD segment, creating one if // necessary. Output_segment* @@ -586,6 +599,8 @@ class Layout Eh_frame* eh_frame_data_; // The exception frame header output section if there is one. Output_section* eh_frame_hdr_section_; + // The space for the build ID checksum if there is one. + Output_section_data* build_id_note_; // A list of group sections and their signatures. Group_signatures group_signatures_; // The size of the output file. |