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: [gold commit] PR 21040: Fix compile errors with GCC 4.2


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.


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