public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hongjiu.lu@intel.com>
To: binutils@sourceware.org
Cc: Ian Lance Taylor <iant@google.com>
Subject: [gold] PATCH: Add typename on types used in template
Date: Thu, 19 Jan 2012 22:41:00 -0000	[thread overview]
Message-ID: <20120119224058.GA18659@intel.com> (raw)

Hi Ian,

GCC 4.2 failed to compile gold:

/net/gnu-6/export/gnu/import/git/binutils/gold/x86_64.cc: In member
function
‘void<unnamed>::Target_x86_64<size>::gc_process_relocs(gold::Symbol_table*,
gold::Layout*, gold::Sized_relobj_file<size, false>*, unsigned int,
unsigned int, const unsigned char*, size_t, gold::Output_section*, bool,
size_t, const unsigned char*) [with int size = 32]’:
/net/gnu-6/export/gnu/import/git/binutils/gold/x86_64.cc:4175:
instantiated from here
/net/gnu-6/export/gnu/import/git/binutils/gold/x86_64.cc:2811: error:
dependent-name ‘<unnamed>::Target_x86_64<size>::Scan’ is parsed as a
non-type, but instantiation yields a type
/net/gnu-6/export/gnu/import/git/binutils/gold/x86_64.cc:2811: note: say
‘typename <unnamed>::Target_x86_64<size>::Scan’ if a type is meant

This patch adds typename.  OK to install?

Thanks.

H.J.
---
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 62f79f5..649668a 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,11 @@
+2012-01-22  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* x86_64.cc (gc_process_relocs): Add typename on types used in
+	template.
+	(scan_relocs): Likewise.
+	(relocate_section): Likewise.
+	(apply_relocation): Likewise.
+
 2012-01-10  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index 3a2cace..df11441 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -2809,8 +2809,8 @@ Target_x86_64<size>::gc_process_relocs(Symbol_table* symtab,
     }
 
    gold::gc_process_relocs<size, false, Target_x86_64<size>, elfcpp::SHT_RELA,
-                           Target_x86_64<size>::Scan,
-			   Target_x86_64<size>::Relocatable_size_for_reloc>(
+                           typename Target_x86_64<size>::Scan,
+			   typename Target_x86_64<size>::Relocatable_size_for_reloc>(
     symtab,
     layout,
     this,
@@ -2848,7 +2848,7 @@ Target_x86_64<size>::scan_relocs(Symbol_table* symtab,
     }
 
   gold::scan_relocs<size, false, Target_x86_64<size>, elfcpp::SHT_RELA,
-      Target_x86_64<size>::Scan>(
+      typename Target_x86_64<size>::Scan>(
     symtab,
     layout,
     this,
@@ -3780,7 +3780,7 @@ Target_x86_64<size>::relocate_section(
   gold_assert(sh_type == elfcpp::SHT_RELA);
 
   gold::relocate_section<size, false, Target_x86_64<size>, elfcpp::SHT_RELA,
-			 Target_x86_64<size>::Relocate>(
+			 typename Target_x86_64<size>::Relocate>(
     relinfo,
     this,
     prelocs,
@@ -3809,7 +3809,7 @@ Target_x86_64<size>::apply_relocation(
     section_size_type view_size)
 {
   gold::apply_relocation<size, false, Target_x86_64<size>,
-			 Target_x86_64<size>::Relocate>(
+			 typename Target_x86_64<size>::Relocate>(
     relinfo,
     this,
     r_offset,

             reply	other threads:[~2012-01-19 22:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19 22:41 H.J. Lu [this message]
2012-01-20  0:40 ` Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120119224058.GA18659@intel.com \
    --to=hongjiu.lu@intel.com \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=iant@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).