Re: binutils-2.17.50 snapshot fails: bfd/ieee.c

2007-04-21 Thread Nick Clifton

Hi Arto,

  I have applied the attached patch to fix this problem, and the 
problems in ecoff.c and coff-m68k.c that you reported.  I think that in 
these cases it is sufficient to just initialise the relevant variables.


Cheers
  Nick

bfd/ChangeLog
2007-04-21  Nick Clifton  <[EMAIL PROTECTED]>

* ecoff.c (_bfd_ecoff_write_armap): Initialise rehash.
(ecoff_link_add_archive_symbols): Likewise.
* coff-m68k.c (m68kcoff_common_addend_rtype_to_howto): Initialise
relent.howto.
* ieee.c (parse_int): Initialise x.
(must_parse_int): Initialise result.
(ieee_slurp_external_symbols): Initialise value.

Index: bfd/ecoff.c
===
RCS file: /cvs/src/src/bfd/ecoff.c,v
retrieving revision 1.53
diff -c -3 -p -r1.53 ecoff.c
*** bfd/ecoff.c 16 Sep 2006 18:12:13 -  1.53
--- bfd/ecoff.c 21 Apr 2007 07:45:07 -
*** _bfd_ecoff_write_armap (bfd *abfd,
*** 3087,3093 
last_elt = current;
for (i = 0; i < orl_count; i++)
  {
!   unsigned int hash, rehash;
  
/* Advance firstreal to the file position of this archive
 element.  */
--- 3087,3093 
last_elt = current;
for (i = 0; i < orl_count; i++)
  {
!   unsigned int hash, rehash = 0;
  
/* Advance firstreal to the file position of this archive
 element.  */
*** ecoff_link_add_archive_symbols (bfd *abf
*** 3757,3763 
while (*pundef != NULL)
  {
struct bfd_link_hash_entry *h;
!   unsigned int hash, rehash;
unsigned int file_offset;
const char *name;
bfd *element;
--- 3757,3763 
while (*pundef != NULL)
  {
struct bfd_link_hash_entry *h;
!   unsigned int hash, rehash = 0;
unsigned int file_offset;
const char *name;
bfd *element;
Index: bfd/coff-m68k.c
===
RCS file: /cvs/src/src/bfd/coff-m68k.c,v
retrieving revision 1.17
diff -c -3 -p -r1.17 coff-m68k.c
*** bfd/coff-m68k.c 26 Mar 2007 12:22:59 -  1.17
--- bfd/coff-m68k.c 21 Apr 2007 07:45:07 -
*** m68kcoff_common_addend_rtype_to_howto (a
*** 411,416 
--- 411,417 
arelent relent;
reloc_howto_type *howto;
  
+   relent.howto = NULL;
RTYPE2HOWTO (&relent, rel);
  
howto = relent.howto;
Index: bfd/ieee.c
===
RCS file: /cvs/src/src/bfd/ieee.c,v
retrieving revision 1.58
diff -c -3 -p -r1.58 ieee.c
*** bfd/ieee.c  26 Mar 2007 12:23:03 -  1.58
--- bfd/ieee.c  21 Apr 2007 07:45:08 -
*** parse_int (common_header_type *ieee, bfd
*** 370,376 
  static int
  parse_i (common_header_type *ieee, bfd_boolean *ok)
  {
!   bfd_vma x;
*ok = parse_int (ieee, &x);
return x;
  }
--- 370,376 
  static int
  parse_i (common_header_type *ieee, bfd_boolean *ok)
  {
!   bfd_vma x = 0;
*ok = parse_int (ieee, &x);
return x;
  }
*** parse_i (common_header_type *ieee, bfd_b
*** 378,384 
  static bfd_vma
  must_parse_int (common_header_type *ieee)
  {
!   bfd_vma result;
BFD_ASSERT (parse_int (ieee, &result));
return result;
  }
--- 378,384 
  static bfd_vma
  must_parse_int (common_header_type *ieee)
  {
!   bfd_vma result = 0;
BFD_ASSERT (parse_int (ieee, &result));
return result;
  }
*** ieee_slurp_external_symbols (bfd *abfd)
*** 767,773 
unsigned int symbol_name_index;
unsigned int symbol_type_index;
unsigned int symbol_attribute_def;
!   bfd_vma value;
  
switch (read_2bytes (&ieee->h))
  {
--- 767,773 
unsigned int symbol_name_index;
unsigned int symbol_type_index;
unsigned int symbol_attribute_def;
!   bfd_vma value = 0;
  
switch (read_2bytes (&ieee->h))
  {
___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


SUCCESS: after all workarounds, binutils-2.17.50 builds & works

2007-04-21 Thread anirkko

Just for feedback:
Today's CVS snapshot "binutils-2.17.50", after applying all the workarounds
reported today applied, builds fine with the configure options below
on sparc-sun-solaris2.6, installs fine, and the resulting gas and gld
seem to start off well in bootstrapping gcc...

Thanks, and greetings
Arto


% gas --version
GNU assembler (GNU Binutils) 2.17.50.20070420
Copyright 2007 Free Software Foundation, Inc.

% gld --version
GNU ld (GNU Binutils) 2.17.50.20070420
Copyright 2007 Free Software Foundation, Inc.


   System = sun-sparc-solaris2.6
   CC = gcc-4.1.2
   CFLAGS = -O2 -mcpu=supersparc

  .configure \
  --prefix=/usr/local/gnu/binutils-2.17.50 \
  --disable-nls \
  --program-prefix=g \
  --enable-targets=all \
  --enable-64-bit-bfd \
  --enable-libada \
  --enable-libssp \
  --enable-libgcc-math \
  --with-libiconv-prefix=/usr/local/gnu/libiconv \
  --with-gmp=/usr/local/gcc/gmp \
  --with-mpfr=/usr/local/gcc/mpfr



___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Error: can't resolve `.hcu.uncommon_code' {.hcu.uncommon_code section} - `.LFB17' {.text section}

2007-04-21 Thread Jim Wilson
On Fri, 2007-04-20 at 18:55 -0700, Kristis Makris wrote:
> /tmp/ccAyM42z.s: Assembler messages:
> /tmp/ccAyM42z.s:787: Error: can't resolve
> `.hcu.uncommon_code' {.hcu.uncommon_code section} - `.LFB17' {.text
> section}

You are subtracting symbols in different ELF object file sections.  This
is not an assemble time constant since we don't know where the sections
will end up in the output.  Since this value is used in a context that
requires a constant, the assembler is forced to give an error.

787 is the line number.  Look at this line and we see
.long   .LFE17-.LFB17
Then look above for the definitions of these labels, and we see LFB17 is
at the start of main, which is in the text section, and LFE17 is at the
end of main, which is in the .hcu.uncommon_code section, which clearly
won't work.  You can't start a function in one section and end it in
another section.

It looks like you are trying to do some complicated (and probably
fragile) section switching stuff in a C function using gcc extended
asms, and that there is an unbalanced section switch somewhere.  Or
maybe gcc optimization is breaking your code.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com




___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils