aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2018-01-27 18:25:06 +0200
committerEli Zaretskii <eliz@gnu.org>2018-01-27 18:25:06 +0200
commitde54ee813f35cdeee51729c6d50b82935dc88634 (patch)
tree6032ab065f04b8bb3f7a179cdf87c8cf8fee0647
parent7d73b4c8dfc8ae59dc1334e67c7ae2ea493dd121 (diff)
downloadgdb-de54ee813f35cdeee51729c6d50b82935dc88634.zip
gdb-de54ee813f35cdeee51729c6d50b82935dc88634.tar.gz
gdb-de54ee813f35cdeee51729c6d50b82935dc88634.tar.bz2
Avoid compilation warning in libiberty/simple-object-xcoff.c
gdb/ChangeLog: 2018-01-27 Eli Zaretskii <eliz@gnu.org> * simple-object-xcoff.c (simple_object_xcoff_find_sections): Avoid compilation warning in 32-bit builds not supported by AC_SYS_LARGEFILE.
-rw-r--r--libiberty/ChangeLog6
-rw-r--r--libiberty/simple-object-xcoff.c16
2 files changed, 17 insertions, 5 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index f1f6d8d..5e96b8b 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,9 @@
+2018-01-27 Eli Zaretskii <eliz@gnu.org>
+
+ * simple-object-xcoff.c (simple_object_xcoff_find_sections): Avoid
+ compilation warning in 32-bit builds not supported by
+ AC_SYS_LARGEFILE.
+
2018-01-03 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
diff --git a/libiberty/simple-object-xcoff.c b/libiberty/simple-object-xcoff.c
index 95887a4..0ef2a46 100644
--- a/libiberty/simple-object-xcoff.c
+++ b/libiberty/simple-object-xcoff.c
@@ -596,15 +596,21 @@ simple_object_xcoff_find_sections (simple_object_read *sobj,
aux = (unsigned char *) auxent;
if (u64)
{
+ /* Use an intermediate 64-bit type to avoid
+ compilation warning about 32-bit shift below on
+ hosts with 32-bit off_t which aren't supported by
+ AC_SYS_LARGEFILE. */
+ ulong_type x_scnlen64;
+
if ((auxent->u.xcoff64.x_csect.x_smtyp & 0x7) != XTY_SD
|| auxent->u.xcoff64.x_csect.x_smclas != XMC_XO)
continue;
- x_scnlen = fetch_32 (aux + offsetof (union external_auxent,
- u.xcoff64.x_csect.x_scnlen_hi));
- x_scnlen = x_scnlen << 32
- | fetch_32 (aux + offsetof (union external_auxent,
- u.xcoff64.x_csect.x_scnlen_lo));
+ x_scnlen64 = fetch_32 (aux + offsetof (union external_auxent,
+ u.xcoff64.x_csect.x_scnlen_hi));
+ x_scnlen = x_scnlen64 << 32
+ | fetch_32 (aux + offsetof (union external_auxent,
+ u.xcoff64.x_csect.x_scnlen_lo));
}
else
{