[gold commit] PR 18847: Fix problem where script specified both address and region for a section

Johan Karlsson Johan.Karlsson@enea.com
Tue Sep 8 10:08:00 GMT 2015


I think I ran into some issues related to this fix.

An assert fails at ld.gold: internal error in set_address, at gold/output.h:197

The callchain of gold is:
gold::Output_section_definition::set_section_addresses   script-sections.cc:2303
gold::Script_sections::set_section_addresses                           script-sections.cc:3517
gold::Layout::set_section_addresses_from_script                 layout.c

I have not been able to identify what it is in my linker script and build that causes this error.

This is the code that calls the failing assert

  // Except for NOLOAD sections, the address of non-SHF_ALLOC sections is
  // forced to zero, regardless of what the linker script wants.
  if (this->output_section_ != NULL
      && ((this->output_section_->flags() & elfcpp::SHF_ALLOC) != 0
	  || this->output_section_->is_noload()))
    this->output_section_->set_address(address);

/Johan
-----Original Message-----
From: binutils-owner@sourceware.org [mailto:binutils-owner@sourceware.org] On Behalf Of Cary Coutant
Sent: den 26 augusti 2015 09:18
To: Binutils <binutils@sourceware.org>
Subject: Re: [gold commit] PR 18847: Fix problem where script specified both address and region for a section

[with the patch]

On Wed, Aug 26, 2015 at 12:04 AM, Cary Coutant <ccoutant@gmail.com> wrote:
> If a script specifies both address and region for an output section 
> declaration, gold ignores the region specification. This can lead to 
> bogus "moves backward" errors. This patch fixes gold so that if a 
> section specifies both address and region, it will place the section 
> at the specified address in the region, and update the location 
> counter within the region.
>
> -cary
>
>
> 2015-08-25  Cary Coutant  <ccoutant@gmail.com>
>
> gold/
>         PR gold/18847
>         * script-sections.cc (Memory_region::set_address): New method.
>         (Script_sections::find_memory_region): Add explicit_only parameter.
>         (Output_section_definition::set_section_addresses): Handle case where
>         script specifies both address and vma region.
>         * script-sections.h (Script_sections::find_memory_region): Add
>         explicit_only parameter.


More information about the Binutils mailing list