aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff64-rs6000.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-01-04 12:18:36 +1030
committerAlan Modra <amodra@gmail.com>2019-01-04 12:23:56 +1030
commit677bd4c69d0eda4f2ae635d793f23c0b1413a9e9 (patch)
tree71a89df9551df3978e49e34c705a2c011efb0226 /bfd/coff64-rs6000.c
parent8261e52d1b8381252ede6754ea6cd1ba18810f1d (diff)
downloadgdb-677bd4c69d0eda4f2ae635d793f23c0b1413a9e9.zip
gdb-677bd4c69d0eda4f2ae635d793f23c0b1413a9e9.tar.gz
gdb-677bd4c69d0eda4f2ae635d793f23c0b1413a9e9.tar.bz2
PR24061, powerpc-ibm-aix-ar sets bogus file permissions when extracting
Mode field should be read in octal, all the rest in decimal. Do so. PR 24061 PR 21786 * coff-rs6000.c (GET_VALUE_IN_FIELD): Add base parameter and adjust all callers. (EQ_VALUE_IN_FIELD): Likewise. * coff64-rs6000.c (GET_VALUE_IN_FIELD): Likewise.
Diffstat (limited to 'bfd/coff64-rs6000.c')
-rw-r--r--bfd/coff64-rs6000.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c
index f78afd1..6f0e358 100644
--- a/bfd/coff64-rs6000.c
+++ b/bfd/coff64-rs6000.c
@@ -1878,13 +1878,13 @@ _bfd_strntoll (const char * nptr, int base, unsigned int maxlen)
}
/* 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)
/* Read in the armap of an XCOFF archive. */
@@ -1927,7 +1927,7 @@ xcoff64_slurp_armap (bfd *abfd)
return FALSE;
/* Skip the name (normally empty). */
- GET_VALUE_IN_FIELD (namlen, hdr.namlen);
+ GET_VALUE_IN_FIELD (namlen, hdr.namlen, 10);
pos = ((namlen + 1) & ~(size_t) 1) + SXCOFFARFMAG;
if (bfd_seek (abfd, pos, SEEK_CUR) != 0)
return FALSE;