[PATCH] Gold: Add a target hook to allow overriding output section name.
Doug Kwan (關振德)
dougkwan@google.com
Wed Jun 3 22:00:00 GMT 2009
I forgot to mention in the previous e-mail that this also fixes two
wrong asserts in my previous check-in.
-Doug
2009/6/3 Doug Kwan (關振德) <dougkwan@google.com>:
> Hi,
>
> This patch adds a hook allowing a target to override the output
> section name used by Layout::choose_output_section(). Without this
> hook, all input sections with names of the form foo.bar will go to
> output section foo. That does not work for ARM, which has special
> output sections like .ARM.attributes and .ARM.exidx. The patch was
> tested by linking a test program for arm-eabi and checking that
> .ARM.attributes was present. In addition, I also ran the gold
> test-suite on the host.
>
> -Doug
>
> 2009-06-03 Doug Kwan <dougkwan@google.com>
>
> * arm.cc (utils::sign_extend): Reverse test in gold_assert.
> (utils::has_overflow): Same.
> (class Target_arm): Declare new method do_output_section_name.
> (Target_arm::arm_info): Add initializer for has_output_section_name.
> (Target_arm::do_output_section_name) Define new.
> * layout.cc (Layout::choose_output_section): Call
> target's output_section_name first if target has one.
> * i386.cc (Target_i386::i386_info) Add initializer for
> has_output_section_name.
> * powerpc.cc (Target_powerpc::powerpc_info): Same.
> * sparc.cc (Target_sparc::sparc_info): Same.
> * x86_64.cc (Target_x86_64::x86_64_info): Same.
> * testsuite/testfile.cc (Target_test::test_target_info): Same.
> * target.h (class Target): Define new methods has_output_section_name,
> output_section_name and do_output_section_name.
> (struct Target::Target_info): Add new field has_output_section_name.
>
More information about the Binutils
mailing list