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: PATCH v2: add mach-o handling in is32bit



On Nov 14, 2008, at 10:40 AM, Nick Clifton wrote:


Hi Tristan,

I was about to commit this patch but had a thought just before it:
why not use bfd_arch_bits_per_address instead ?

Actually that is a good point. If you can confirm that it works for both types of mach-o binary then please go ahead and apply that variant of the patch instead.

I will commit the following patch within a few days.
I prefer to keep the ELF specific code as ELF32 can be at least used by ia64.


Tristan.

bfd/
2008-11-14  Tristan Gingold  <gingold@adacore.com>

	* bfd.c (is32bit): Use architecture information for non-ELF
	targets.

*** bfd.c	12 Nov 2008 10:27:57 -0000	1.105
--- bfd.c	14 Nov 2008 10:47:13 -0000
***************
*** 1475,1483 ****
        return bed->s->elfclass == ELFCLASS32;
      }

!   /* For non-ELF, make a guess based on the target name.  */
!   return (strstr (bfd_get_target (abfd), "64") == NULL
! 	  && strcmp (bfd_get_target (abfd), "mmo") != 0);
  }
  #endif

--- 1475,1482 ----
        return bed->s->elfclass == ELFCLASS32;
      }

!   /* For non-ELF targets, use architecture information.  */
!   return bfd_arch_bits_per_address (abfd) <= 32;
  }
  #endif



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