diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2002-01-27 12:00:11 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2002-01-27 12:00:11 +0000 |
commit | dbbf32dd39b128be2abe8393933bc942be4c0925 (patch) | |
tree | 5c493199a70976c54e1b9c6a7804a3de85b43e84 /contrib/binutils/bfd/coff-ia64.c | |
parent | 855ee8c509184df8c31758b8f2ca9e9d31440489 (diff) |
Enlist the FreeBSD-CURRENT users as testers of what is to become Binutils
version 2.12.0. These bits are taken from the FSF anoncvs repo on
27-January-2002 03:41 PST.
Notes
Notes:
svn path=/vendor/binutils/dist/; revision=89857
Diffstat (limited to 'contrib/binutils/bfd/coff-ia64.c')
-rw-r--r-- | contrib/binutils/bfd/coff-ia64.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/contrib/binutils/bfd/coff-ia64.c b/contrib/binutils/bfd/coff-ia64.c index 776d3fac5960..76d1bf6cc5e5 100644 --- a/contrib/binutils/bfd/coff-ia64.c +++ b/contrib/binutils/bfd/coff-ia64.c @@ -52,6 +52,8 @@ static reloc_howto_type howto_table[] = /* Return true if this relocation should appear in the output .reloc section. */ +static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); + static boolean in_reloc_p(abfd, howto) bfd * abfd ATTRIBUTE_UNUSED; @@ -63,6 +65,8 @@ in_reloc_p(abfd, howto) #include "coffcode.h" +static const bfd_target *ia64coff_object_p PARAMS ((bfd *)); + static const bfd_target * ia64coff_object_p (abfd) bfd *abfd; @@ -73,9 +77,9 @@ ia64coff_object_p (abfd) struct external_PEI_IMAGE_hdr image_hdr; file_ptr offset; - if (bfd_seek (abfd, 0x00, SEEK_SET) != 0 - || bfd_read (&dos_hdr, 1, sizeof (dos_hdr), abfd) - != sizeof (dos_hdr)) + if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 + || (bfd_bread (&dos_hdr, (bfd_size_type) sizeof (dos_hdr), abfd) + != sizeof (dos_hdr))) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -92,23 +96,23 @@ ia64coff_object_p (abfd) this routine can only be called correctly for a PEI file, check the e_magic number here, and, if it doesn't match, clobber the f_magic number so that we don't get a false match. */ - if (bfd_h_get_16 (abfd, (bfd_byte *) dos_hdr.e_magic) != DOSMAGIC) + if (H_GET_16 (abfd, dos_hdr.e_magic) != DOSMAGIC) { bfd_set_error (bfd_error_wrong_format); return NULL; } - offset = bfd_h_get_32 (abfd, (bfd_byte *) dos_hdr.e_lfanew); - if (bfd_seek (abfd, (file_ptr) offset, SEEK_SET) != 0 - || bfd_read (&image_hdr, 1, sizeof (image_hdr), abfd) - != sizeof (image_hdr)) + offset = H_GET_32 (abfd, dos_hdr.e_lfanew); + if (bfd_seek (abfd, offset, SEEK_SET) != 0 + || (bfd_bread (&image_hdr, (bfd_size_type) sizeof (image_hdr), abfd) + != sizeof (image_hdr))) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); return NULL; } - if (bfd_h_get_32 (abfd, (bfd_byte *) image_hdr.nt_signature) + if (H_GET_32 (abfd, image_hdr.nt_signature) != 0x4550) { bfd_set_error (bfd_error_wrong_format); @@ -118,10 +122,7 @@ ia64coff_object_p (abfd) /* Here is the hack. coff_object_p wants to read filhsz bytes to pick up the COFF header for PE, see "struct external_PEI_filehdr" in include/coff/pe.h. We adjust so that that will work. */ - if (bfd_seek (abfd, - (file_ptr) (offset - sizeof (dos_hdr)), - SEEK_SET) - != 0) + if (bfd_seek (abfd, offset - sizeof (dos_hdr), SEEK_SET) != 0) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); |