PATCH: Fix two more ARFMAG typos
Cary Coutant
ccoutant@google.com
Tue Apr 22 01:26:00 GMT 2008
More information about the Binutils mailing list
Tue Apr 22 01:26:00 GMT 2008
- Previous message (by thread): [rfc] declaring new object format "FDPIC ELF"
- Next message (by thread): RFC: Unify overflow checking
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
As part of some source cleanup unrelated to but part of the thin
archive patch to bfd/archive.c, several literal newlines were replaced
by mistake with ARFMAG[0] instead of ARFMAG[1]. These were fixed in a
subsequent patch. I just discovered two more instances of the original
typo in slightly different form (the following diff is excerpted from
the original patch):
@@ -1707,7 +1982,7 @@ _bfd_write_archive_contents (bfd *arch)
return FALSE;
if ((elength % 2) == 1)
{
- if (bfd_bwrite ("\012", 1, arch) != 1)
+ if (bfd_bwrite (ARFMAG, 1, arch) != 1)
return FALSE;
}
}
@@ -1742,9 +2021,10 @@ _bfd_write_archive_contents (bfd *arch)
return FALSE;
remaining -= amt;
}
+
if ((arelt_size (current) % 2) == 1)
{
- if (bfd_bwrite ("\012", 1, arch) != 1)
+ if (bfd_bwrite (ARFMAG, 1, arch) != 1)
return FALSE;
}
}
These will cause archives to be written with a backquote as the
padding character instead of a newline.
I'm committing the following patch as a trivial and obvious fix (I did
build and test):
* archive.c (_bfd_write_archive_contents): Fix incorrect use of
ARFMAG.
-cary
Index: archive.c
===================================================================
RCS file: /cvs/src/src/bfd/archive.c,v
retrieving revision 1.53
diff -u -p -r1.53 archive.c
--- archive.c 31 Mar 2008 23:44:47 -0000 1.53
+++ archive.c 22 Apr 2008 00:01:16 -0000
@@ -1982,7 +1982,7 @@ _bfd_write_archive_contents (bfd *arch)
return FALSE;
if ((elength % 2) == 1)
{
- if (bfd_bwrite (ARFMAG, 1, arch) != 1)
+ if (bfd_bwrite (&ARFMAG[1], 1, arch) != 1)
return FALSE;
}
}
@@ -2024,7 +2024,7 @@ _bfd_write_archive_contents (bfd *arch)
if ((arelt_size (current) % 2) == 1)
{
- if (bfd_bwrite (ARFMAG, 1, arch) != 1)
+ if (bfd_bwrite (&ARFMAG[1], 1, arch) != 1)
return FALSE;
}
}
- Previous message (by thread): [rfc] declaring new object format "FDPIC ELF"
- Next message (by thread): RFC: Unify overflow checking
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list