This is the mail archive of the binutils@sources.redhat.com 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]

PATCH, Re: AIX 4.1 broken (was: Re: Branching for 2.12)


This is problem I caused by making the big archive format <bigaf> the default.

The included patch enables the old behavior of creating new archives with the small archive
format <aiaff> for pre AIX 4.3.

I do not have ready access to an AIX 4.1 box so it has not been tested natively.   I did test
it on a cross built binutils.   I did see the assertion errors.   This patch cleared them
up.   Sanity check on magic #'s seems ok.

I will run this through AIX 4.3.3 tomorrow.

Could someone with an AIX 4.1 box please validate this patch for that target?

Thanks
Tom

Alexandre Oliva wrote:

> On Jan 30, 2002, Alexandre Oliva <aoliva@redhat.com> wrote:
>
> > collect2: stage1/libgcc.a: not a COFF file
>
> > Interestingly, `ar t' from binutils 2.11 shows the archive members
> > just fine, but that from CVS mainline gives:
>
> > BFD: BFD 2.11.93 20020129 assertion fail /home/lsd/oliva/src/tool/egcs/bfd/libbfd.c:1110
>
> > before proceeding to list all archive members correctly.
>
> > I'll try to look further into it tomorrow.
>
> The reason it fails is that _bfd_xcoff_slurp_armap() calls H_GET_64(),
> but this macro calls bfd_getb64() that BFD_FAIL()s ifndef BFD64.  AIX
> 4.1 is not a 64-bit architecture, so it's reasonable that BFD64 is not
> defined, but where is the error: should _bfd_xcoff_slurp_armap() be
> fixed so as to not call H_GET_64() ifndef BFD64 or should bfd_getb64
> do its job regardless of the macro?
>
> --
> Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist                Professional serial bug killer

--
Tom Rix
GCC Engineer
trix@redhat.com


2002-01-31  Tom Rix  <trix@redhat.com>

	* config.bfd: Conditionally support <aiaff> for pre AIX 4.3.

	* xcoff.h: Conditionally support <aiaff> for pre AIX 4.3.

diff -rcp src-old/bfd/config.bfd src/bfd/config.bfd
*** src-old/bfd/config.bfd	Wed Jan 30 22:32:46 2002
--- src/bfd/config.bfd	Wed Jan 30 23:08:57 2002
*************** case "${targ}" in
*** 780,785 ****
--- 780,788 ----
      case "${targ}" in
        *-*-aix4.[3456789]* | *-*-aix[56789]*)
  	want64=true;;
+ 	
+ 	*)
+ 	targ_cflags=-DSMALL_ARCHIVE;;
      esac
      ;;
  #ifdef BFD64

diff -rcp src-old/include/coff/xcoff.h src/include/coff/xcoff.h
*** src-old/include/coff/xcoff.h	Wed Jan 30 22:32:52 2002
--- src/include/coff/xcoff.h	Thu Jan 31 00:40:44 2002
*************** struct xcoff_ar_hdr_big
*** 606,623 ****
     `hdr' member has the same size and position in both formats.  
     <bigaf> is the default format, return true even when xcoff_ardata is 
     NULL. */
  #define xcoff_big_format_p(abfd) \
    ((NULL != bfd_ardata (abfd) && NULL == xcoff_ardata (abfd)) || \
     ((NULL != bfd_ardata (abfd)) && \
      (NULL != xcoff_ardata (abfd)) && \
      (xcoff_ardata (abfd)->magic[1] == 'b')))
! 
! /* For testing old format * /
! #undef xcoff_big_format_p
  #define xcoff_big_format_p(abfd) \
    (((NULL != bfd_ardata (abfd)) && \
      (NULL != xcoff_ardata (abfd)) && \
!     (xcoff_ardata (abfd)->magic[1] == 'b'))) / **/
  
  /* We store a copy of the xcoff_ar_file_hdr in the tdata field of the
     artdata structure.  Similar for the big archive.  */
--- 606,625 ----
     `hdr' member has the same size and position in both formats.  
     <bigaf> is the default format, return true even when xcoff_ardata is 
     NULL. */
+ #ifndef SMALL_ARCHIVE
+ /* Creates big archives by default */
  #define xcoff_big_format_p(abfd) \
    ((NULL != bfd_ardata (abfd) && NULL == xcoff_ardata (abfd)) || \
     ((NULL != bfd_ardata (abfd)) && \
      (NULL != xcoff_ardata (abfd)) && \
      (xcoff_ardata (abfd)->magic[1] == 'b')))
! #else
! /* Creates small archives by default. */
  #define xcoff_big_format_p(abfd) \
    (((NULL != bfd_ardata (abfd)) && \
      (NULL != xcoff_ardata (abfd)) && \
!     (xcoff_ardata (abfd)->magic[1] == 'b')))
! #endif
  
  /* We store a copy of the xcoff_ar_file_hdr in the tdata field of the
     artdata structure.  Similar for the big archive.  */


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