This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold commit] PR 21040: Fix compile errors with GCC 4.2
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Cary Coutant <ccoutant at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 12 Jan 2017 08:27:37 -0800
- Subject: Re: [gold commit] PR 21040: Fix compile errors with GCC 4.2
- Authentication-results: sourceware.org; auth=none
- References: <CAJimCsGJ5pPsLOzK9Vcbyr=Rw45=c72G=RZ_RWyq2jUHTomimQ@mail.gmail.com> <CAMe9rOpLyFkR24tGLxjsBks77CYz1oydmsTydWFUH=APSuHagw@mail.gmail.com> <CAJimCsGte0kRvM=vMx5KbDUzM2K6q4bwp_MpbGG=J-UmHjXmTg@mail.gmail.com>
On Wed, Jan 11, 2017 at 1:44 PM, Cary Coutant <ccoutant@gmail.com> wrote:
>> I still got
>>
>> /net/gnu-6/export/gnu/import/git/sources/binutils-gdb/gold/x86_64.cc:1873:
>> error: using ‘typename’ outside of template
>> ...
>
> Fix more compile errors with GCC 4.2.
>
> 2017-01-11 Cary Coutant <ccoutant@gmail.com>
>
> gold/
> PR gold/21040
> * x86_64.cc (Output_data_plt_x86_64_bnd::do_fill_first_plt_entry):
> Remove unnecessary 'typename' keyword.
> (Output_data_plt_x86_64_bnd::do_fill_plt_entry): Likewise.
> (Output_data_plt_x86_64_bnd::fill_aplt_entry): Likewise.
> (Output_data_plt_x86_64_bnd::do_fill_tlsdesc_entry): Likewise.
> (Output_data_plt_x86_64_bnd::do_write): Likewise.
>
> -cary
I still got
/export/gnu/import/git/sources/binutils-gdb/gold/powerpc.cc:8783:
instantiated from ‘void<unnamed>::Target_powerpc<size,
big_endian>::relocate_section(const gold::Relocate_info<size,
big_endian>*, unsigned int, const unsigned char*, size_t,
gold::Output_section*, bool, unsigned char*, typename
elfcpp::Elf_types<size>::Elf_Addr, gold::section_size_type, const
gold::Reloc_symbol_changes*) [with int size = 32, bool big_endian =
true]’
/export/gnu/import/git/sources/binutils-gdb/gold/powerpc.cc:9411:
instantiated from here
/export/gnu/import/git/sources/binutils-gdb/gold/powerpc.cc:2013:
warning: comparison is always false due to limited range of data type
make: *** [powerpc.o] Error 1
This patch:
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index 3e4e08b..a67c336 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -2010,7 +2010,7 @@ Powerpc_relobj<size, big_endian>::make_toc_relative(
Address got_base = (target->got_section()->output_section()->address()
+ this->toc_base_offset());
addr -= got_base;
- if (addr + 0x80008000 >= (uint64_t) 1 << 32)
+ if (addr + (uint64_t) 0x80008000 >= (uint64_t) 1 << 32)
return false;
*value = addr;
works for me.
--
H.J.