diff options
author | Alan Modra <amodra@gmail.com> | 2010-07-22 14:29:15 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2010-07-22 14:29:15 +0000 |
commit | c6a3cf87fb9cd68e3e3e86017f8282a66a4edb09 (patch) | |
tree | 9be93b822a2a6bf5ed092bb67010908d951a66ca /bfd | |
parent | 4c1534c7a2ada64894ab0ef684dfec3bc73beef7 (diff) | |
download | gdb-c6a3cf87fb9cd68e3e3e86017f8282a66a4edb09.zip gdb-c6a3cf87fb9cd68e3e3e86017f8282a66a4edb09.tar.gz gdb-c6a3cf87fb9cd68e3e3e86017f8282a66a4edb09.tar.bz2 |
* ecoff.c: Don't include aout/ranlib.h.
(_bfd_ecoff_slurp_armap): Use correct struct for ardata->symdefs.
(_bfd_ecoff_write_armap): Output ar_date and ar_size using
_bfd_ar_spacepad.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/ecoff.c | 16 |
2 files changed, 15 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5e5efb0..a6ce531 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,12 @@ 2010-07-22 Alan Modra <amodra@gmail.com> + * ecoff.c: Don't include aout/ranlib.h. + (_bfd_ecoff_slurp_armap): Use correct struct for ardata->symdefs. + (_bfd_ecoff_write_armap): Output ar_date and ar_size using + _bfd_ar_spacepad. + +2010-07-22 Alan Modra <amodra@gmail.com> + * aoutx.h (some_aout_object_p): Don't set EXEC_P for files with relocs. diff --git a/bfd/ecoff.c b/bfd/ecoff.c index ecfc34e..af9d7d6 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -27,7 +27,6 @@ #include "bfdlink.h" #include "libbfd.h" #include "aout/ar.h" -#include "aout/ranlib.h" #include "aout/stab_gnu.h" /* FIXME: We need the definitions of N_SET[ADTB], but aout64.h defines @@ -2855,7 +2854,7 @@ _bfd_ecoff_slurp_armap (bfd *abfd) struct artdata *ardata; unsigned int count; char *raw_ptr; - struct symdef *symdef_ptr; + carsym *symdef_ptr; char *stringbase; bfd_size_type amt; @@ -2975,12 +2974,12 @@ _bfd_ecoff_slurp_armap (bfd *abfd) ++ardata->symdef_count; amt = ardata->symdef_count; - amt *= sizeof (struct symdef); - symdef_ptr = (struct symdef *) bfd_alloc (abfd, amt); + amt *= sizeof (carsym); + symdef_ptr = (carsym *) bfd_alloc (abfd, amt); if (!symdef_ptr) return FALSE; - ardata->symdefs = (carsym *) symdef_ptr; + ardata->symdefs = symdef_ptr; raw_ptr = raw_armap + 4; for (i = 0; i < count; i++, raw_ptr += 8) @@ -2991,7 +2990,7 @@ _bfd_ecoff_slurp_armap (bfd *abfd) if (file_offset == 0) continue; name_offset = H_GET_32 (abfd, raw_ptr); - symdef_ptr->s.name = stringbase + name_offset; + symdef_ptr->name = stringbase + name_offset; symdef_ptr->file_offset = file_offset; ++symdef_ptr; } @@ -3063,7 +3062,8 @@ _bfd_ecoff_write_armap (bfd *abfd, linker just checks the archive name; the GNU linker may check the date. */ stat (abfd->filename, &statbuf); - sprintf (hdr.ar_date, "%ld", (long) (statbuf.st_mtime + 60)); + _bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld", + (long) (statbuf.st_mtime + 60)); /* The DECstation uses zeroes for the uid, gid and mode of the armap. */ @@ -3074,7 +3074,7 @@ _bfd_ecoff_write_armap (bfd *abfd, hdr.ar_mode[1] = '4'; hdr.ar_mode[2] = '4'; - sprintf (hdr.ar_size, "%-10d", (int) mapsize); + _bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld", mapsize); hdr.ar_fmag[0] = '`'; hdr.ar_fmag[1] = '\012'; |