[GOLD][PATCH] Remove Output_section::Simple_input_section class.

Ian Lance Taylor iant@google.com
Wed May 19 03:50:00 GMT 2010


"Doug Kwan (關振德)" <dougkwan@google.com> writes:

> 2010-05-14  Doug Kwan  <dougkwan@google.com>
>
>         * arm.cc (Arm_input_section::original_size): New method.
>         (Arm_input_section::do_output_offset): Remove static cast.
>         (Arm_input_section::original_size_): Change type to off_t.
>         (Arm_input_section::set_final_data_size): Do not set address and
>         offset of stub table.
>         (Arm_output_section::fix_exidx_coverage): Change use of of
>         Output_section::Simple_input_section to that of
>         Output_section::Input_section.
>         (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
>         except for the first pass.
>         * output.cc (Output_section::get_input_sections): Change type of
>         input_sections to std::list<Input_section>.
>         (Output_section::add_script_input_section): Rename from
>         Output_section::add_simple_input_section.  Change type of SIS
>         parameter from Simple_input_section to Input_section.
>         * output.h (Output_section::Simple_input_section): Remove class.
>         (Output_section::Input_section): Change class visibility to public.
>         (Output_section::Input_section::addralign): Use stored alignments
>         for special input sections if set.
>         (Output_section::Input_section::set_addralign): New method.
>         (Output_section::get_input_sections): Change parameter type from
>         list of Simple_input_section to list of Input_section.
>         (Output_section::add_script_input_section): Rename from
>         Output_section::add_simple_input_section. Change first parameter's
>         type from Simple_input_section to Input_section and remove the
>         second and third parameters.
>         * script-sections.cc (Input_section::Input_section_list): Change
>         type to list of Output_section::Input_section/
>         (Input_section_info::Input_section_info): Change parameter type of
>         INPUT_SECTION to Output_section::Input_section.
>         (Input_section_info::input_section): Change return type.
>         (Input_section_info::input_section_): Change type to
>         Output_section::Input_section.
>         (Output_section_element_input::set_section_addresses): Adjust code
>         to use Output_section::Input_section instead of
>         Output_section::Simple_input_section.  Adjust code for renaming
>         of Output_section::add_simple_input_section.
>         (Orphan_output_section::set_section_addresses): Ditto.


> @@ -1215,7 +1219,7 @@ class Arm_input_section : public Output_
>    // Address alignment of the original input section.
>    uint64_t original_addralign_;
>    // Section size of the original input section.
> -  uint64_t original_size_;
> +  off_t original_size_;

This change doesn't seem quite right.  Why should the size of a
section be represented by an off_t value?  off_t is for file offsets,
not sizes.  On the other hand, since this is ARM which is known to be
a 32-bit target, it would be fine to use uint32_t here.


> @@ -3104,13 +3100,16 @@ Output_section::get_input_sections(
>    return data_size;
>  }
>  
> -// Add an simple input section.
> +// Add a script input section.  SIS is an Output_section::Input_section,
> +// which can be either a plian input section or a special input section like
> +// a relaxed input section.  For special input section, it's size must be
> +// finalized.

s/plian/plain/
s/it's/its/

This is OK with those changes.

Thanks.

Ian



More information about the Binutils mailing list