public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [gold] Fix function declarations
@ 2013-01-17  9:37 Serge Pavlov
  2013-01-17 23:31 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Serge Pavlov @ 2013-01-17  9:37 UTC (permalink / raw)
  To: binutils; +Cc: amodra

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

Hi All,

Trunk cannot be compiled with GCC 4.5, due to inconsistency in
declarations and definitions of some functions in powerpc.cc.
The attached patch fixes this problem.

Alan, could you please check this patch in, if it is OK?

Thanks,
--Serge

[-- Attachment #2: 0001-Changed-declarations-to-make-compilable-with-GCC-4.5.patch --]
[-- Type: application/octet-stream, Size: 3467 bytes --]

From e25e5347841ca8cc52c6eb04e1dc7e9b186d2519 Mon Sep 17 00:00:00 2001
From: Serge Pavlov <serge.v.pavlov@gmail.com>
Date: Thu, 17 Jan 2013 14:26:45 +0600
Subject: [PATCH] Changed declarations to make compilable with GCC 4.5

    * powerpc.cc (Stub_table::find_plt_call_entry): Make types
    used in declaration and definition consistent.
    (Target_powerpc::symval_for_branch): Ditto.
---
 gold/ChangeLog  |    6 ++++++
 gold/powerpc.cc |   14 +++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/gold/ChangeLog b/gold/ChangeLog
index 46726d0..01058c1 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-17  Serge Pavlov  <serge.v.pavlov@gmail.com>
+
+	* powerpc.cc (Stub_table::find_plt_call_entry): Make types
+	used in declaration and definition consistent.
+	(Target_powerpc::symval_for_branch): Ditto.
+
 2013-01-16  Sriraman Tallam  <tmsriram@google.com>
 
 	* testsuite/plugin_final_layout.cc: Fix comment.
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index 26ae337..1c7e901 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -3171,12 +3171,12 @@ Stub_table<size, big_endian>::add_plt_call_entry(
 // Find a plt call stub.
 
 template<int size, bool big_endian>
-typename elfcpp::Elf_types<size>::Elf_Addr
+typename Stub_table<size, big_endian>::Address
 Stub_table<size, big_endian>::find_plt_call_entry(
     const Sized_relobj_file<size, big_endian>* object,
     const Symbol* gsym,
     unsigned int r_type,
-    Address addend) const
+    typename Stub_table<size, big_endian>::Address addend) const
 {
   Plt_stub_ent ent(object, gsym, r_type, addend);
   typename Plt_stub_entries::const_iterator p = this->plt_call_stubs_.find(ent);
@@ -3184,7 +3184,7 @@ Stub_table<size, big_endian>::find_plt_call_entry(
 }
 
 template<int size, bool big_endian>
-typename elfcpp::Elf_types<size>::Elf_Addr
+typename Stub_table<size, big_endian>::Address
 Stub_table<size, big_endian>::find_plt_call_entry(const Symbol* gsym) const
 {
   Plt_stub_ent ent(gsym);
@@ -3193,7 +3193,7 @@ Stub_table<size, big_endian>::find_plt_call_entry(const Symbol* gsym) const
 }
 
 template<int size, bool big_endian>
-typename elfcpp::Elf_types<size>::Elf_Addr
+typename Stub_table<size, big_endian>::Address
 Stub_table<size, big_endian>::find_plt_call_entry(
     const Sized_relobj_file<size, big_endian>* object,
     unsigned int locsym_index,
@@ -3206,7 +3206,7 @@ Stub_table<size, big_endian>::find_plt_call_entry(
 }
 
 template<int size, bool big_endian>
-typename elfcpp::Elf_types<size>::Elf_Addr
+typename Stub_table<size, big_endian>::Address
 Stub_table<size, big_endian>::find_plt_call_entry(
     const Sized_relobj_file<size, big_endian>* object,
     unsigned int locsym_index) const
@@ -3239,7 +3239,7 @@ Stub_table<size, big_endian>::add_long_branch_entry(
 // Find long branch stub.
 
 template<int size, bool big_endian>
-typename elfcpp::Elf_types<size>::Elf_Addr
+typename Stub_table<size, big_endian>::Address
 Stub_table<size, big_endian>::find_long_branch_entry(
     const Powerpc_relobj<size, big_endian>* object,
     Address to)
@@ -5661,7 +5661,7 @@ ok_lo_toc_insn(uint32_t insn)
 // Return the value to use for a branch relocation.
 
 template<int size, bool big_endian>
-typename elfcpp::Elf_types<size>::Elf_Addr
+typename Target_powerpc<size, big_endian>::Address
 Target_powerpc<size, big_endian>::symval_for_branch(
     Address value,
     const Sized_symbol<size>* gsym,
-- 
1.7.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [gold] Fix function declarations
  2013-01-17  9:37 [gold] Fix function declarations Serge Pavlov
@ 2013-01-17 23:31 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2013-01-17 23:31 UTC (permalink / raw)
  To: Serge Pavlov; +Cc: binutils

On Thu, Jan 17, 2013 at 04:37:36PM +0700, Serge Pavlov wrote:
> Trunk cannot be compiled with GCC 4.5, due to inconsistency in
> declarations and definitions of some functions in powerpc.cc.
> The attached patch fixes this problem.

Committed without the change to one of the find_plt_call_entry
parameters.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-17 23:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-17  9:37 [gold] Fix function declarations Serge Pavlov
2013-01-17 23:31 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).