From: Eli Zaretskii Date: Sat, 27 Jan 2018 16:25:06 +0000 (+0200) Subject: Avoid compilation warning in libiberty/simple-object-xcoff.c X-Git-Tag: gdb-8.1-release~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d721be4ac8c6c8452c25aa382d09bd487dcded3;p=thirdparty%2Fbinutils-gdb.git Avoid compilation warning in libiberty/simple-object-xcoff.c gdb/ChangeLog: 2018-01-27 Eli Zaretskii * simple-object-xcoff.c (simple_object_xcoff_find_sections): Avoid compilation warning in 32-bit builds not supported by AC_SYS_LARGEFILE. (cherry picked from commit de54ee813f35cdeee51729c6d50b82935dc88634) --- diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 7a49a6a1397..b7521e367aa 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2018-01-27 Eli Zaretskii + + * simple-object-xcoff.c (simple_object_xcoff_find_sections): Avoid + compilation warning in 32-bit builds not supported by + AC_SYS_LARGEFILE. + 2017-09-15 Nathan Sidwell PR demangler/82195 diff --git a/libiberty/simple-object-xcoff.c b/libiberty/simple-object-xcoff.c index 9a8f581563f..9c83db36e2f 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 {