This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: trunk gold not building unoptimized, powerpc.cc refs to invalid_address and pltresolve_size


On Thu, Dec 06, 2012 at 03:45:22PM -0800, Ian Lance Taylor wrote:
> Alan needs to add a definition for the constant.  In C++98, all
> constants declared in classes, even those declared in template
> classes, require an explicit definition.
> 
> template<int size, bool big_endian>
> const Address Target_powerpc::invalid_address;

How is it that this

template<int size, bool big_endian>
class Target_powerpc : public Sized_target<size, big_endian>
{
 public:
  typedef
    Output_data_reloc<elfcpp::SHT_RELA, true, size, big_endian> Reloc_section;
  typedef typename elfcpp::Elf_types<size>::Elf_Addr Address;
  typedef typename elfcpp::Elf_types<size>::Elf_Swxword Signed_address;
  static const Address invalid_address = static_cast<Address>(0) - 1;

gives no errors about "invalid_address" being undefined, while this

template<int size, bool big_endian>
class Stub_table : public Output_relaxed_input_section
{
 public:
  typedef typename elfcpp::Elf_types<size>::Elf_Addr Address;
  static const Address invalid_address = static_cast<Address>(0) - 1;

does?  As far as I can see, all of the references to
Stub_table::invalid_address occur after the class definition.
I see I also have a complaint about Output_data_glink::pltresolve_size.

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]