This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold patch] Fix PR gold/12220 where linker script causes internal error with compressed debug sections
- From: Ian Lance Taylor <iant at google dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 15 Nov 2010 16:00:39 -0800
- Subject: Re: [gold patch] Fix PR gold/12220 where linker script causes internal error with compressed debug sections
- References: <AANLkTimRok4hqzEWzF0q0HfKBjFwV5bQJ1mc9iKf_keu@mail.gmail.com>
Cary Coutant <ccoutant@google.com> writes:
> PR 12220 is about an internal error in gold when compressed debug
> sections are used with a linker script. There were two problems here:
> the presence of a SECTIONS clause in the script prevented the linker
> from remapping the .zdebug section names properly, and also caused the
> linker to calculate the output section size based on the compressed
> sizes of the input sections instead of the uncompressed size. This
> patch should fix both problems.
>
> Tested on x86_64. OK?
>
> -cary
>
> PR gold/12220
> * layout.cc (Layout::choose_output_section): Call output_section_name
> even when using a script with a SECTIONS clause.
> (Layout::output_section_name): Don't use standard mappings if a
> SECTIONS clause has been seen.
> * layout.h (Layout::output_section_name): Add parameter.
> * output.cc (Output_section::add_input_section): Use uncompressed
> section size when tracking input sections.
Rather than add a parameter to Layout::output_section_name, I would
prefer to pull the is_compressed_debug_section handling into its only
caller.
The change to output.cc is certainly OK.
Ian