From c3a543c4062f2c202f7a48979880d0757fd7c161 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?=
 <Bernhard.Rosenkranzer@linaro.org>
Date: Wed, 8 May 2013 13:19:28 +0200
Subject: [PATCH 5/6] gold: Add workaround for some compiler versions

Some versions of gcc can't or won't resolve Address into
elfcpp::Elf_types<size>::Elf_Addr -- so use that
type directly.

Some versions of gcc also warn about firsttype$defined and
firsttype$index being used uninitialized.

Change-Id: I25cb061e9e947843a328b0479fd9a8d6e40b1846
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

Conflicts:
	gold/powerpc.cc
---
 gas/config/tc-arm.c |  2 +-
 gold/powerpc.cc     | 18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index a72b0b0..13f5a40 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -1938,7 +1938,7 @@ parse_neon_el_struct_list (char **str, unsigned *pbase,
   enum arm_reg_type rtype = REG_TYPE_NDQ;
   const char *const incr_error = _("register stride must be 1 or 2");
   const char *const type_error = _("mismatched element/structure types in list");
-  struct neon_typed_alias firsttype;
+  struct neon_typed_alias firsttype = { 0, 0, { 0, 0 } };
 
   if (skip_past_char (&ptr, '{') == SUCCESS)
     leading_brace = 1;
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index 1fd51cf..3b2d607 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -923,7 +923,7 @@ class Target_powerpc : public Sized_target<size, big_endian>
     bool issued_non_pic_error_;
   };
 
-  Address
+  typename elfcpp::Elf_types<size>::Elf_Addr
   symval_for_branch(const Symbol_table* symtab, Address value,
 		    const Sized_symbol<size>* gsym,
 		    Powerpc_relobj<size, big_endian>* object,
@@ -3231,20 +3231,20 @@ class Stub_table : public Output_relaxed_input_section
 		     Address);
 
   // Find a given plt call stub.
-  Address
+  typename elfcpp::Elf_types<size>::Elf_Addr
   find_plt_call_entry(const Symbol*) const;
 
-  Address
+  typename elfcpp::Elf_types<size>::Elf_Addr
   find_plt_call_entry(const Sized_relobj_file<size, big_endian>*,
 		      unsigned int) const;
 
-  Address
+  typename elfcpp::Elf_types<size>::Elf_Addr
   find_plt_call_entry(const Sized_relobj_file<size, big_endian>*,
 		      const Symbol*,
 		      unsigned int,
 		      Address) const;
 
-  Address
+  typename elfcpp::Elf_types<size>::Elf_Addr
   find_plt_call_entry(const Sized_relobj_file<size, big_endian>*,
 		      unsigned int,
 		      unsigned int,
@@ -3254,7 +3254,7 @@ class Stub_table : public Output_relaxed_input_section
   void
   add_long_branch_entry(const Powerpc_relobj<size, big_endian>*, Address);
 
-  Address
+  typename elfcpp::Elf_types<size>::Elf_Addr
   find_long_branch_entry(const Powerpc_relobj<size, big_endian>*,
 			 Address) const;
 
@@ -3267,7 +3267,7 @@ class Stub_table : public Output_relaxed_input_section
     this->branch_size_ = 0;
   }
 
-  Address
+  typename elfcpp::Elf_types<size>::Elf_Addr
   set_address_and_size(const Output_section* os, Address off)
   {
     Address start_off = off;
@@ -3284,14 +3284,14 @@ class Stub_table : public Output_relaxed_input_section
     return my_size;
   }
 
-  Address
+  typename elfcpp::Elf_types<size>::Elf_Addr
   stub_address() const
   {
     return align_address(this->address() + this->orig_data_size_,
 			 this->stub_align());
   }
 
-  Address
+  typename elfcpp::Elf_types<size>::Elf_Addr
   stub_offset() const
   {
     return align_address(this->offset() + this->orig_data_size_,
-- 
1.8.3.2

