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: --enable-targets=all compilation error


On Thu, Nov 13, 2014 at 12:17 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Nov 13, 2014 at 11:41 AM, Jan Kratochvil
> <jan.kratochvil@redhat.com> wrote:
>> Hi Nick,
>>
>> commit a5c71af8d3c7c535f27614947f72883233658706
>> Author: Nick Clifton <nickc@redhat.com>
>> Date:   Thu Nov 13 17:46:11 2014 +0000
>>     More fixes for memory access violations whilst scanning corrupt binaries.
>>         PR binutils/17512
>>
>> coffcode.h: In function âcoff_pointerize_aux_hookâ:
>> coffcode.h:2543:7: error: âsymbbolâ undeclared (first use in this function)
>> coffcode.h:2543:7: note: each undeclared identifier is reported only once for each function it appears in
>> coffcode.h:2547:1: error: control reaches end of non-void function [-Werror=return-type]
>> cc1: all warnings being treated as errors
>>
>
> I checked in this as an obvious fix.
>
> --
> H.J.
> ---
> diff --git a/bfd/ChangeLog b/bfd/ChangeLog
> index 3cf91d1..f1f0077 100644
> --- a/bfd/ChangeLog
> +++ b/bfd/ChangeLog
> @@ -1,5 +1,9 @@
>  2014-11-13  H.J. Lu  <hongjiu.lu@intel.com>
>
> + * coffcode.h (coff_pointerize_aux_hook): Fix a typo.
> +
> +2014-11-13  H.J. Lu  <hongjiu.lu@intel.com>
> +
>   PR gas/17598
>   * elf64-x86-64.c (elf_x86_64_check_relocs): Treat
>   R_X86_64_GOTPLT64 the same as R_X86_64_GOT64.
> diff --git a/bfd/coffcode.h b/bfd/coffcode.h
> index c32b20d..69992db 100644
> --- a/bfd/coffcode.h
> +++ b/bfd/coffcode.h
> @@ -2540,7 +2540,7 @@ coff_pointerize_aux_hook (bfd *abfd ATTRIBUTE_UNUSED,
>    /* Return TRUE if we don't want to pointerize this aux entry, which
>       is the case for the lastfirst aux entry for a C_LEAFPROC symbol.  */
>    return (indaux == 1
> -  && symbbol->is_sym
> +  && symbol->is_sym
>    && (symbol->u.syment.n_sclass == C_LEAFPROC
>        || symbol->u.syment.n_sclass == C_LEAFSTAT
>        || symbol->u.syment.n_sclass == C_LEAFEXT));

I checked in this to fix build on 32-bit hosts:

In file included from
/export/gnu/import/git/sources/binutils-gdb/bfd/pei-x86_64.c:67:0:
/export/gnu/import/git/sources/binutils-gdb/bfd/coffcode.h: In
function âcoff_slurp_line_tableâ:
/export/gnu/import/git/sources/binutils-gdb/bfd/coffcode.h:4650:33:
error: comparison between signed and unsigned integer expressions
[-Werror=sign-compare]
    BFD_ASSERT ((p - func_table) == nbr_func);
                                 ^
/export/gnu/import/git/sources/binutils-gdb/bfd/libbfd.h:756:14: note:
in definition of macro âBFD_ASSERTâ
   do { if (!(x)) bfd_assert(__FILE__,__LINE__); } while (0)
              ^
cc1: all warnings being treated as errors
make[6]: *** [pei-x86_64.lo] Error 1

-- 
H.J.
---
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f1f0077..e29390c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,9 @@
 2014-11-13  H.J. Lu  <hongjiu.lu@intel.com>

+ * coffcode.h (coff_slurp_line_table): Add cast to unsigned int.
+
+2014-11-13  H.J. Lu  <hongjiu.lu@intel.com>
+
  * coffcode.h (coff_pointerize_aux_hook): Fix a typo.

 2014-11-13  H.J. Lu  <hongjiu.lu@intel.com>
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 69992db..9990b16 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -4647,7 +4647,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
     if (lineno_cache[i].line_number == 0)
       *p++ = &lineno_cache[i];

-  BFD_ASSERT ((p - func_table) == nbr_func);
+  BFD_ASSERT ((unsigned int) (p - func_table) == nbr_func);

   /* Sort by functions.  */
   qsort (func_table, nbr_func, sizeof (alent *), coff_sort_func_alent);


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