to take care that we are not generating the new form of archives
on AIX 4.2 or earlier systems. */
-/* XCOFF archives use this as a magic string. Note that both strings
- have the same length. */
-
-/* Set the magic for archive. */
-
-bfd_boolean
-bfd_xcoff_ar_archive_set_magic (bfd *abfd ATTRIBUTE_UNUSED,
- char *magic ATTRIBUTE_UNUSED)
-{
- /* Not supported yet. */
- return FALSE;
- /* bfd_xcoff_archive_set_magic (abfd, magic); */
-}
-
/* PR 21786: The PE/COFF standard does not require NUL termination for any of
the ASCII fields in the archive headers. So in order to be able to extract
numerical values we provide our own versions of strtol and strtoll which
}
/* Macro to read an ASCII value stored in an archive header field. */
-#define GET_VALUE_IN_FIELD(VAR, FIELD) \
- do \
- { \
- (VAR) = sizeof (VAR) > sizeof (long) \
- ? _bfd_strntoll (FIELD, 10, sizeof FIELD) \
- : _bfd_strntol (FIELD, 10, sizeof FIELD); \
- } \
+#define GET_VALUE_IN_FIELD(VAR, FIELD, BASE) \
+ do \
+ { \
+ (VAR) = (sizeof (VAR) > sizeof (long) \
+ ? _bfd_strntoll (FIELD, BASE, sizeof FIELD) \
+ : _bfd_strntol (FIELD, BASE, sizeof FIELD)); \
+ } \
while (0)
-#define EQ_VALUE_IN_FIELD(VAR, FIELD) \
- (sizeof (VAR) > sizeof (long) \
- ? (VAR) ==_bfd_strntoll (FIELD, 10, sizeof FIELD) \
- : (VAR) == _bfd_strntol (FIELD, 10, sizeof FIELD))
+#define EQ_VALUE_IN_FIELD(VAR, FIELD, BASE) \
+ (sizeof (VAR) > sizeof (long) \
+ ? (VAR) == _bfd_strntoll (FIELD, BASE, sizeof FIELD) \
+ : (VAR) == _bfd_strntol (FIELD, BASE, sizeof FIELD))
/* Read in the armap of an XCOFF archive. */
if (xcoff_ardata (abfd) == NULL)
{
- bfd_has_map (abfd) = FALSE;
+ abfd->has_armap = FALSE;
return TRUE;
}
/* This is for the old format. */
struct xcoff_ar_hdr hdr;
- GET_VALUE_IN_FIELD (off, xcoff_ardata (abfd)->symoff);
+ GET_VALUE_IN_FIELD (off, xcoff_ardata (abfd)->symoff, 10);
if (off == 0)
{
- bfd_has_map (abfd) = FALSE;
+ abfd->has_armap = FALSE;
return TRUE;
}
return FALSE;
/* Skip the name (normally empty). */
- GET_VALUE_IN_FIELD (namlen, hdr.namlen);
+ GET_VALUE_IN_FIELD (namlen, hdr.namlen, 10);
off = ((namlen + 1) & ~ (size_t) 1) + SXCOFFARFMAG;
if (bfd_seek (abfd, off, SEEK_CUR) != 0)
return FALSE;
- GET_VALUE_IN_FIELD (sz, hdr.size);
+ GET_VALUE_IN_FIELD (sz, hdr.size, 10);
/* Read in the entire symbol table. */
contents = (bfd_byte *) bfd_alloc (abfd, sz);
/* This is for the new format. */
struct xcoff_ar_hdr_big hdr;
- GET_VALUE_IN_FIELD (off, xcoff_ardata_big (abfd)->symoff);
+ GET_VALUE_IN_FIELD (off, xcoff_ardata_big (abfd)->symoff, 10);
if (off == 0)
{
- bfd_has_map (abfd) = FALSE;
+ abfd->has_armap = FALSE;
return TRUE;
}
return FALSE;
/* Skip the name (normally empty). */
- GET_VALUE_IN_FIELD (namlen, hdr.namlen);
+ GET_VALUE_IN_FIELD (namlen, hdr.namlen, 10);
off = ((namlen + 1) & ~ (size_t) 1) + SXCOFFARFMAG;
if (bfd_seek (abfd, off, SEEK_CUR) != 0)
return FALSE;
- GET_VALUE_IN_FIELD (sz, hdr.size);
+ GET_VALUE_IN_FIELD (sz, hdr.size, 10);
/* Read in the entire symbol table. */
contents = (bfd_byte *) bfd_alloc (abfd, sz);
}
bfd_ardata (abfd)->symdef_count = c;
- bfd_has_map (abfd) = TRUE;
+ abfd->has_armap = TRUE;
return TRUE;
}
}
GET_VALUE_IN_FIELD (bfd_ardata (abfd)->first_file_filepos,
- hdr.firstmemoff);
+ hdr.firstmemoff, 10);
amt = SIZEOF_AR_FILE_HDR;
bfd_ardata (abfd)->tdata = bfd_zalloc (abfd, amt);
return NULL;
}
- GET_VALUE_IN_FIELD (namlen, hdr.namlen);
+ GET_VALUE_IN_FIELD (namlen, hdr.namlen, 10);
amt = SIZEOF_AR_HDR + namlen + 1;
hdrp = (struct xcoff_ar_hdr *) bfd_alloc (abfd, amt);
if (hdrp == NULL)
((char *) hdrp)[SIZEOF_AR_HDR + namlen] = '\0';
ret->arch_header = (char *) hdrp;
- GET_VALUE_IN_FIELD (ret->parsed_size, hdr.size);
+ GET_VALUE_IN_FIELD (ret->parsed_size, hdr.size, 10);
ret->filename = (char *) hdrp + SIZEOF_AR_HDR;
}
else
return NULL;
}
- GET_VALUE_IN_FIELD (namlen, hdr.namlen);
+ GET_VALUE_IN_FIELD (namlen, hdr.namlen, 10);
amt = SIZEOF_AR_HDR_BIG + namlen + 1;
hdrp = (struct xcoff_ar_hdr_big *) bfd_alloc (abfd, amt);
if (hdrp == NULL)
((char *) hdrp)[SIZEOF_AR_HDR_BIG + namlen] = '\0';
ret->arch_header = (char *) hdrp;
- GET_VALUE_IN_FIELD (ret->parsed_size, hdr.size);
+ GET_VALUE_IN_FIELD (ret->parsed_size, hdr.size, 10);
ret->filename = (char *) hdrp + SIZEOF_AR_HDR_BIG;
}
if (last_file == NULL)
filestart = bfd_ardata (archive)->first_file_filepos;
else
- GET_VALUE_IN_FIELD (filestart, arch_xhdr (last_file)->nextoff);
+ GET_VALUE_IN_FIELD (filestart, arch_xhdr (last_file)->nextoff, 10);
if (filestart == 0
- || EQ_VALUE_IN_FIELD (filestart, xcoff_ardata (archive)->memoff)
- || EQ_VALUE_IN_FIELD (filestart, xcoff_ardata (archive)->symoff))
+ || EQ_VALUE_IN_FIELD (filestart, xcoff_ardata (archive)->memoff, 10)
+ || EQ_VALUE_IN_FIELD (filestart, xcoff_ardata (archive)->symoff, 10))
{
bfd_set_error (bfd_error_no_more_archived_files);
return NULL;
if (last_file == NULL)
filestart = bfd_ardata (archive)->first_file_filepos;
else
- GET_VALUE_IN_FIELD (filestart, arch_xhdr_big (last_file)->nextoff);
+ GET_VALUE_IN_FIELD (filestart, arch_xhdr_big (last_file)->nextoff, 10);
if (filestart == 0
- || EQ_VALUE_IN_FIELD (filestart, xcoff_ardata_big (archive)->memoff)
- || EQ_VALUE_IN_FIELD (filestart, xcoff_ardata_big (archive)->symoff))
+ || EQ_VALUE_IN_FIELD (filestart, xcoff_ardata_big (archive)->memoff, 10)
+ || EQ_VALUE_IN_FIELD (filestart, xcoff_ardata_big (archive)->symoff, 10))
{
bfd_set_error (bfd_error_no_more_archived_files);
return NULL;
{
struct xcoff_ar_hdr *hdrp = arch_xhdr (abfd);
- GET_VALUE_IN_FIELD (s->st_mtime, hdrp->date);
- GET_VALUE_IN_FIELD (s->st_uid, hdrp->uid);
- GET_VALUE_IN_FIELD (s->st_gid, hdrp->gid);
- GET_VALUE_IN_FIELD (s->st_mode, hdrp->mode);
+ GET_VALUE_IN_FIELD (s->st_mtime, hdrp->date, 10);
+ GET_VALUE_IN_FIELD (s->st_uid, hdrp->uid, 10);
+ GET_VALUE_IN_FIELD (s->st_gid, hdrp->gid, 10);
+ GET_VALUE_IN_FIELD (s->st_mode, hdrp->mode, 8);
s->st_size = arch_eltdata (abfd)->parsed_size;
}
else
{
struct xcoff_ar_hdr_big *hdrp = arch_xhdr_big (abfd);
- GET_VALUE_IN_FIELD (s->st_mtime, hdrp->date);
- GET_VALUE_IN_FIELD (s->st_uid, hdrp->uid);
- GET_VALUE_IN_FIELD (s->st_gid, hdrp->gid);
- GET_VALUE_IN_FIELD (s->st_mode, hdrp->mode);
+ GET_VALUE_IN_FIELD (s->st_mtime, hdrp->date, 10);
+ GET_VALUE_IN_FIELD (s->st_uid, hdrp->uid, 10);
+ GET_VALUE_IN_FIELD (s->st_gid, hdrp->gid, 10);
+ GET_VALUE_IN_FIELD (s->st_mode, hdrp->mode, 8);
s->st_size = arch_eltdata (abfd)->parsed_size;
}
#define _bfd_xcoff_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define _bfd_xcoff_bfd_merge_sections bfd_generic_merge_sections
#define _bfd_xcoff_bfd_is_group_section bfd_generic_is_group_section
+#define _bfd_xcoff_bfd_group_name bfd_generic_group_name
#define _bfd_xcoff_bfd_discard_group bfd_generic_discard_group
#define _bfd_xcoff_section_already_linked _bfd_generic_section_already_linked
#define _bfd_xcoff_bfd_define_common_symbol _bfd_xcoff_define_common_symbol