aboutsummaryrefslogtreecommitdiff
path: root/bfd/libbfd.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2012-01-20 14:42:57 +0000
committerNick Clifton <nickc@redhat.com>2012-01-20 14:42:57 +0000
commitf1bb16f888ae3230ecac7530db7b2dab3dcddfe2 (patch)
treec1353b3060a29ffcbedd7823afbc2412b1b98183 /bfd/libbfd.h
parent2128eb399e7c8ad74793352fa88fdee4a5767fe8 (diff)
downloadgdb-f1bb16f888ae3230ecac7530db7b2dab3dcddfe2.zip
gdb-f1bb16f888ae3230ecac7530db7b2dab3dcddfe2.tar.gz
gdb-f1bb16f888ae3230ecac7530db7b2dab3dcddfe2.tar.bz2
PR binutils/13534
* archive.c (_bfd_ar_sizepad): New function. Correctly install and pad the size field in an archive header. (_bfd_generic_read_ar_hdr_mag): Use the correct type and scan function for the archive size field. (bfd_generic_openr_next_archived_file): Likewise. (do_slurp_coff_armap): Likewise. (_bfd_write_archive_contents): Likewise. (_bfd_bsd44_write_ar_hdr): Use the new function. (bfd_ar_hdr_from_filesystem): Likewise. (_bfd_write_archive_contents): Likewise. (bsd_write_armap): Likewise. (coff_write_armap): Likewise. * archive64.c (bfd_elf64_archive_write_armap): Likewise. * bfdio.c (bfd_bread): Use correct type for archive element sizes. * ar.c (open_inarch): Likewise. (extract_file): Likewise. * libbfd-in.h (struct areltdata): Use correct types for parsed_size and extra_size fields. Prototype _bfd_ar_sizepad function. * libbfd.h: Regenerate.
Diffstat (limited to 'bfd/libbfd.h')
-rw-r--r--bfd/libbfd.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index a10a651..5e1cfe0 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -8,7 +8,7 @@
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011
+ 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -69,16 +69,17 @@ struct section_hash_entry
/* tdata for an archive. For an input archive, cache
needs to be free()'d. For an output archive, symdefs do. */
-struct artdata {
+struct artdata
+{
file_ptr first_file_filepos;
/* Speed up searching the armap */
htab_t cache;
- bfd *archive_head; /* Only interesting in output routines */
- carsym *symdefs; /* the symdef entries */
- symindex symdef_count; /* how many there are */
- char *extended_names; /* clever intel extension */
- bfd_size_type extended_names_size; /* Size of extended names */
- /* when more compilers are standard C, this can be a time_t */
+ bfd *archive_head; /* Only interesting in output routines. */
+ carsym *symdefs; /* The symdef entries. */
+ symindex symdef_count; /* How many there are. */
+ char *extended_names; /* Clever intel extension. */
+ bfd_size_type extended_names_size; /* Size of extended names. */
+ /* When more compilers are standard C, this can be a time_t. */
long armap_timestamp; /* Timestamp value written into armap.
This is used for BSD archives to check
that the timestamp is recent enough
@@ -93,12 +94,13 @@ struct artdata {
#define bfd_ardata(bfd) ((bfd)->tdata.aout_ar_data)
/* Goes in bfd's arelt_data slot */
-struct areltdata {
- char * arch_header; /* it's actually a string */
- unsigned int parsed_size; /* octets of filesize not including ar_hdr */
- unsigned int extra_size; /* BSD4.4: extra bytes after the header. */
- char *filename; /* null-terminated */
- file_ptr origin; /* for element of a thin archive */
+struct areltdata
+{
+ char * arch_header; /* It's actually a string. */
+ bfd_size_type parsed_size; /* Octets of filesize not including ar_hdr. */
+ bfd_size_type extra_size; /* BSD4.4: extra bytes after the header. */
+ char *filename; /* Null-terminated. */
+ file_ptr origin; /* For element of a thin archive. */
};
#define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size)
@@ -208,6 +210,8 @@ extern void *_bfd_generic_read_ar_hdr
(bfd *);
extern void _bfd_ar_spacepad
(char *, size_t, const char *, long);
+extern bfd_boolean _bfd_ar_sizepad
+ (char *, size_t, bfd_size_type);
extern void *_bfd_generic_read_ar_hdr_mag
(bfd *, const char *);