[patch] binary file endianness

Momchil Velikov velco@fadata.bg
Sun May 21 14:22:00 GMT 2000


Geoff Keating wrote:
> > > Shouldn't it instead check to see whether the endianness is unknown?
> > >
> > > You still don't want to be linking a little-endian COFF with a
> > > big-endian ELF, I think.
> >
> > Indeed. Here's the revised patch.
> >
> > How about removing the inline checks for endianness
> > and calling _bfd_generic_verify_endian_match() instead ?
> 
> Yes, please do this.  Having repeated chunks of code is bad.
> 
> Also, could I ask you to fix the localisation problem in
> _bfd_generic_verify_endian_match?  It should look like the version in
> elf32-ppc.h, where each string is separate.  The reason for this is
> that in some languages, it may be necessary to change more than one
> place in the string to change between 'big' and 'little'.

Done.

Regards,
-velco
2000-05-22  Momchil Velikov  <velco@fadata.bg>

	* libbfd.c (_bfd_generic_verify_endian_match): Compare endianess
        only if it is known for both input and output bfds. Separate
	error message strings as in some languages, it may be necessary
	to change more than one place in the string to change between
	'big' and 'little'. 

	* elf32-ppc.c (ppc_elf_merge_private_bfd_data): Remove inline
	endianess checks, call _bfd_generic_verify_endian_match() instead.  
	
	* elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.  

	* elf32-mcore.c (mcore_elf_merge_private_bfd_data): Likewise.  

	* elf32-arm.h (elf32_arm_merge_private_bfd_data): Likewise. Verify
	endianess before checking bfd flavours.  




More information about the Binutils mailing list