bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/18307] gold/dwo fails compiling with LTO (output.h: 'addr' may


From: ccoutant at gmail dot com
Subject: [Bug gold/18307] gold/dwo fails compiling with LTO (output.h: 'addr' may be used unintialized)
Date: Thu, 04 Jun 2015 20:13:58 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=18307

Cary Coutant <ccoutant at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Cary Coutant <ccoutant at gmail dot com> ---
This looks like a bogus complaint to me.

The error is flagged in Output_segment::set_addresses, called from
Layout::attach_allocated_section_to_segment, here:

  // Check for --section-start.
  uint64_t addr;
  bool is_address_set = parameters->options().section_start(os->name(), &addr);
  ...
      if (is_address_set)
        oseg->set_addresses(addr, addr);

General_options::section_start looks like this:

bool
General_options::section_start(const char* secname, uint64_t* paddr) const
{
  if (this->section_starts_.empty())
    return false;
  std::map<std::string, uint64_t>::const_iterator p =
    this->section_starts_.find(secname);
  if (p == this->section_starts_.end())
    return false;
  *paddr = p->second;
  return true;
}

So we only use addr if section_start returns true, in which case, it will have
initialized addr. GCC's flow analysis ought to be good enough to deal with
this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]