diff options
author | Alan Modra <amodra@gmail.com> | 2023-04-28 11:11:09 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-04-28 15:19:59 +0930 |
commit | 143a12bd5a5402231bde748cbbdc22bb3984a522 (patch) | |
tree | c01adab6f7c00166fadbcd1f211173715c4ddb0b /include/coff | |
parent | 4cb2aab8ab9e18d9dfdd8fa362715d70cc2d1109 (diff) | |
download | gdb-143a12bd5a5402231bde748cbbdc22bb3984a522.zip gdb-143a12bd5a5402231bde748cbbdc22bb3984a522.tar.gz gdb-143a12bd5a5402231bde748cbbdc22bb3984a522.tar.bz2 |
Re: Keeping track of rs6000-coff archive element pointers
Commit de7b90610e9e left a hole in the element checking, explained by
the comment added to _bfd_xcoff_openr_next_archived_file. While
fixing this, tidy some types used to hold unsigned values so that
casts are not needed to avoid signed/unsigned comparison warnings.
Also tidy a few things in xcoff.h.
bfd/
* coff-rs6000.c (_bfd_xcoff_openr_next_archived_file): Check
that we aren't pointing back at the last element. Make
filestart a ufile_ptr. Update for xcoff_artdata change.
(_bfd_strntol, _bfd_strntoll): Return unsigned values.
(_bfd_xcoff_slurp_armap): Make off a ufile_ptr.
(add_ranges): Update for xcoff_artdata change.
* libbfd-in.h (struct artdata): Make first_file_filepos a
ufile_ptr.
* libbfd.h: Regenerate.
include/
* coff/xcoff.h (struct xcoff_artdata): Replace min_elt with
ar_hdr_size.
(xcoff_big_format_p): In the !SMALL_ARCHIVE case return true
for anything but a small archive.
Diffstat (limited to 'include/coff')
-rw-r--r-- | include/coff/xcoff.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/coff/xcoff.h b/include/coff/xcoff.h index 08afc00..7e86cc3 100644 --- a/include/coff/xcoff.h +++ b/include/coff/xcoff.h @@ -653,7 +653,7 @@ struct xcoff_artdata } u; struct ar_ranges ranges; /* Anything less than this size can't hold an archive element. */ - unsigned int min_elt; + unsigned int ar_hdr_size; }; #define x_artdata(abfd) ((struct xcoff_artdata *) bfd_ardata (abfd)->tdata) @@ -663,13 +663,13 @@ struct xcoff_artdata #ifndef SMALL_ARCHIVE /* Creates big archives by default */ #define xcoff_big_format_p(abfd) \ - (bfd_ardata (abfd) != NULL \ - && (x_artdata (abfd) == NULL \ - || x_artdata (abfd)->u.hdr.magic[1] == 'b')) + (bfd_ardata (abfd) == NULL \ + || x_artdata (abfd) == NULL \ + || x_artdata (abfd)->u.hdr.magic[1] != 'a') #else /* Creates small archives by default. */ #define xcoff_big_format_p(abfd) \ - (bfd_ardata (abfd) != NULL \ + (bfd_ardata (abfd) != NULL \ && x_artdata (abfd) != NULL \ && x_artdata (abfd)->u.hdr.magic[1] == 'b') #endif |