X-Git-Url: http://drtracing.org/?a=blobdiff_plain;ds=sidebyside;f=gold%2Flayout.h;h=fd5878da18bc7d97e2c763f7263bac209d66e83a;hb=d768f160a99558a07a2463899c8bfeec0f0a67a7;hp=806f6e53b01ac28650e6bdddb5b5d371e21873d8;hpb=bce5a025d2ed7eda2c5bbb85bd9b33333ca5d556;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/layout.h b/gold/layout.h index 806f6e53b0..fd5878da18 100644 --- a/gold/layout.h +++ b/gold/layout.h @@ -1,6 +1,6 @@ // layout.h -- lay out output file sections for gold -*- C++ -*- -// Copyright (C) 2006-2018 Free Software Foundation, Inc. +// Copyright (C) 2006-2020 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -593,6 +593,14 @@ class Layout set_unique_segment_for_sections_specified() { this->unique_segment_for_sections_specified_ = true; } + bool + is_lto_slim_object () const + { return this->lto_slim_object_; } + + void + set_lto_slim_object () + { this->lto_slim_object_ = true; } + // For incremental updates, allocate a block of memory from the // free list. Find a block starting at or after MINOFF. off_t @@ -666,12 +674,10 @@ class Layout size_t cie_length, const unsigned char* fde_data, size_t fde_length); - // Remove .eh_frame information for a PLT. FDEs using the CIE must - // be removed in reverse order to the order they were added. + // Remove all post-map .eh_frame information for a PLT. void remove_eh_frame_for_plt(Output_data* plt, const unsigned char* cie_data, - size_t cie_length, const unsigned char* fde_data, - size_t fde_length); + size_t cie_length); // Scan a .debug_info or .debug_types section, and add summary // information to the .gdb_index section. @@ -693,6 +699,25 @@ class Layout layout_gnu_stack(bool seen_gnu_stack, uint64_t gnu_stack_flags, const Object*); + // Layout a .note.gnu.property section. + void + layout_gnu_property(unsigned int note_type, + unsigned int pr_type, + size_t pr_datasz, + const unsigned char* pr_data, + const Object* object); + + // Merge per-object properties with program properties. + void + merge_gnu_properties(const Object* object); + + // Add a target-specific property for the output .note.gnu.property section. + void + add_gnu_property(unsigned int note_type, + unsigned int pr_type, + size_t pr_datasz, + const unsigned char* pr_data); + // Add an Output_section_data to the layout. This is used for // special sections like the GOT section. ORDER is where the // section should wind up in the output segment. IS_RELRO is true @@ -1061,6 +1086,10 @@ class Layout create_note(const char* name, int note_type, const char* section_name, size_t descsz, bool allocate, size_t* trailing_padding); + // Create a note section for gnu program properties. + void + create_gnu_properties_note(); + // Create a note section for gold version. void create_gold_note(); @@ -1347,6 +1376,14 @@ class Layout std::vector section_infos_; }; + // Program properties from .note.gnu.property sections. + struct Gnu_property + { + size_t pr_datasz; + unsigned char* pr_data; + }; + typedef std::map Gnu_properties; + // The number of input files, for sizing tables. int number_of_input_files_; // Information set by scripts or by command line options. @@ -1451,6 +1488,8 @@ class Layout Incremental_inputs* incremental_inputs_; // Whether we record output section data created in script bool record_output_section_data_from_script_; + // Set if this is a slim LTO object not loaded with a compiler plugin + bool lto_slim_object_; // List of output data that needs to be removed at relaxation clean up. Output_section_data_list script_output_section_data_list_; // Structure to save segment states before entering the relaxation loop. @@ -1473,6 +1512,8 @@ class Layout Incremental_binary* incremental_base_; // For incremental links, a list of free space within the file. Free_list free_list_; + // Program properties. + Gnu_properties gnu_properties_; }; // This task handles writing out data in output sections which is not