diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-06-15 17:22:41 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-06-15 17:22:41 +0000 |
commit | aeef32f01c2b884781485becb37ddf46091fa1fa (patch) | |
tree | 9022d58ca836075c03942f2cfed54291c1a429ca /bfd/archive.c | |
parent | f7d2fa445537d69b604398d526f6eb1819e2ed8a (diff) | |
download | gdb-aeef32f01c2b884781485becb37ddf46091fa1fa.zip gdb-aeef32f01c2b884781485becb37ddf46091fa1fa.tar.gz gdb-aeef32f01c2b884781485becb37ddf46091fa1fa.tar.bz2 |
* archive.c (bfd_slurp_armap): Recognize __.SYMDEF/ as well as
__.SYMDEF; the former was used in old Linux archives. From
jrs@world.std.com (Rick Sladkey).
Diffstat (limited to 'bfd/archive.c')
-rw-r--r-- | bfd/archive.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bfd/archive.c b/bfd/archive.c index d945ceb..ce79af4 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -904,7 +904,8 @@ bfd_slurp_armap (abfd) if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) != 0) return false; - if (!strncmp (nextname, "__.SYMDEF ", 16)) + if (!strncmp (nextname, "__.SYMDEF ", 16) + || !strncmp (nextname, "__.SYMDEF/ ", 16)) /* old Linux archives */ return do_slurp_bsd_armap (abfd); else if (!strncmp (nextname, "/ ", 16)) return do_slurp_coff_armap (abfd); @@ -943,7 +944,8 @@ bfd_slurp_bsd_armap_f2 (abfd) if (bfd_seek (abfd, -16L, SEEK_CUR) != 0) return false; - if (!strncmp (nextname, "__.SYMDEF ", 16)) + if (!strncmp (nextname, "__.SYMDEF ", 16) + || !strncmp (nextname, "__.SYMDEF/ ", 16)) /* old Linux archives */ return do_slurp_bsd_armap (abfd); if (strncmp (nextname, "/ ", 16)) @@ -1528,8 +1530,7 @@ _bfd_write_archive_contents (arch) else sprintf (&(hdr.ar_name[0]), "ARFILENAMES/"); sprintf (&(hdr.ar_size[0]), "%-10d", (int) elength); - hdr.ar_fmag[0] = '`'; - hdr.ar_fmag[1] = '\012'; + strncpy (hdr.ar_fmag, ARFMAG, 2); for (i = 0; i < sizeof (struct ar_hdr); i++) if (((char *) (&hdr))[i] == '\0') (((char *) (&hdr))[i]) = ' '; @@ -1798,8 +1799,7 @@ bsd_write_armap (arch, elength, map, orl_count, stridx) sprintf (hdr.ar_uid, "%d", getuid ()); sprintf (hdr.ar_gid, "%d", getgid ()); sprintf (hdr.ar_size, "%-10d", (int) mapsize); - hdr.ar_fmag[0] = '`'; - hdr.ar_fmag[1] = '\012'; + strncpy (hdr.ar_fmag, ARFMAG, 2); for (i = 0; i < sizeof (struct ar_hdr); i++) if (((char *) (&hdr))[i] == '\0') (((char *) (&hdr))[i]) = ' '; @@ -1955,8 +1955,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) sprintf ((hdr.ar_uid), "%d", 0); sprintf ((hdr.ar_gid), "%d", 0); sprintf ((hdr.ar_mode), "%-7o", (unsigned) 0); - hdr.ar_fmag[0] = '`'; - hdr.ar_fmag[1] = '\012'; + strncpy (hdr.ar_fmag, ARFMAG, 2); for (i = 0; i < sizeof (struct ar_hdr); i++) if (((char *) (&hdr))[i] == '\0') |