This is the mail archive of the binutils@sourceware.cygnus.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]

Re: linking binary 'hunks' into images


>>>>> "Ian" == Ian Lance Taylor <ian@zembu.com> writes:
Ian> - Is this the correct fix for the problem?
Ian>
Ian> Yes.
Ian>
Ian> - If so, should this also be applied to elf32-mips.c and
Ian>      elf32-mcore.c?
Ian>
Ian> Yes.

I've enclosed a patch relative to the current binutils repository on
sourceware.  

However, while I was constructing the patch, I started thinking that a
better fix might be changing the *_merge_private_bfd_data() functions
to call common code in _bfd_generic_verify_endian_match().  In addition
to the differences in the conditional, I noticed that not all of the
versions of this code were changed for message catalogs.  

If that is a better fix, I'd be happy to revise my patch accordingly.

        --jtc

1999-10-01  J.T. Conklin  <jtc@redback.com>

	* elf32-mcore.c (mcore_elf_merge_private_bfd_data): Allow linking
 	in objects with unknown (BFD_ENDIAN_UNKNOWN) byte order.
	* elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
	* elf32-ppc.c (ppc_elf_merge_private_bfd_data): Likewise.
	* libbfd.c (_bfd_generic_verify_endian_match): Likewise.

Index: elf32-mcore.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/elf32-mcore.c,v
retrieving revision 1.5
diff -c -r1.5 elf32-mcore.c
*** elf32-mcore.c	1999/07/12 10:29:24	1.5
--- elf32-mcore.c	1999/10/01 21:45:54
***************
*** 323,329 ****
  
    /* Check if we have the same endianess */
    if (   ibfd->xvec->byteorder != obfd->xvec->byteorder
!       && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
      {
        (*_bfd_error_handler)
  	(_("%s: compiled for a %s endian system and target is %s endian.\n"),
--- 323,330 ----
  
    /* Check if we have the same endianess */
    if (   ibfd->xvec->byteorder != obfd->xvec->byteorder
!       && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
!       && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
      {
        (*_bfd_error_handler)
  	(_("%s: compiled for a %s endian system and target is %s endian.\n"),
Index: elf32-mips.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/elf32-mips.c,v
retrieving revision 1.52
diff -c -r1.52 elf32-mips.c
*** elf32-mips.c	1999/09/28 04:11:05	1.52
--- elf32-mips.c	1999/10/01 21:45:58
***************
*** 2351,2358 ****
    boolean ok;
  
    /* Check if we have the same endianess */
!   if (ibfd->xvec->byteorder != obfd->xvec->byteorder
!       && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
      {
        const char *msg;
  
--- 2351,2359 ----
    boolean ok;
  
    /* Check if we have the same endianess */
!   if (   ibfd->xvec->byteorder != obfd->xvec->byteorder
!       && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
!       && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
      {
        const char *msg;
  
Index: elf32-ppc.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/elf32-ppc.c,v
retrieving revision 1.7
diff -c -r1.7 elf32-ppc.c
*** elf32-ppc.c	1999/08/03 16:40:25	1.7
--- elf32-ppc.c	1999/10/01 21:46:01
***************
*** 1399,1406 ****
    boolean error;
  
    /* Check if we have the same endianess */
!   if (ibfd->xvec->byteorder != obfd->xvec->byteorder
!       && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
      {
        const char *msg;
  
--- 1399,1407 ----
    boolean error;
  
    /* Check if we have the same endianess */
!   if (   ibfd->xvec->byteorder != obfd->xvec->byteorder
!       && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
!       && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
      {
        const char *msg;
  
Index: libbfd.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/libbfd.c,v
retrieving revision 1.6
diff -c -r1.6 libbfd.c
*** libbfd.c	1999/09/12 14:27:21	1.6
--- libbfd.c	1999/10/01 21:46:01
***************
*** 1283,1290 ****
       bfd *ibfd;
       bfd *obfd;
  {
!   if (ibfd->xvec->byteorder != obfd->xvec->byteorder
!       && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
      {
        (*_bfd_error_handler)
  	("%s: compiled for a %s endian system and target is %s endian",
--- 1283,1291 ----
       bfd *ibfd;
       bfd *obfd;
  {
!   if (   ibfd->xvec->byteorder != obfd->xvec->byteorder
!       && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
!       && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
      {
        (*_bfd_error_handler)
  	("%s: compiled for a %s endian system and target is %s endian",



-- 
J.T. Conklin
RedBack Networks

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