aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2018-01-21 05:01:31 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2018-01-21 05:01:31 +0000
commit104faf49c60bd282332f1ea940b561f02ed282d2 (patch)
treea7e887fdac05c5c1f138e843dc743f61a507cf11 /libiberty
parent78f044e4a6e5fc257f236ab5b3e9e679e652ddb6 (diff)
* simple-object-xcoff.c (simple_object_xcoff_find_sections): Use
ulong_type to avoid warning about 32-bit shift. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256925 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/simple-object-xcoff.c19
2 files changed, 19 insertions, 5 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 2b834372c9a..63558926ef9 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-20 Eli Zaretskii <eliz@gnu.org>
+
+ * simple-object-xcoff.c (simple_object_xcoff_find_sections): Use
+ ulong_type to avoid warning about 32-bit shift.
+
2018-01-11 Richard Biener <rguenther@suse.de>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
diff --git a/libiberty/simple-object-xcoff.c b/libiberty/simple-object-xcoff.c
index 95887a42ebd..1e3d9e01b04 100644
--- a/libiberty/simple-object-xcoff.c
+++ b/libiberty/simple-object-xcoff.c
@@ -596,15 +596,24 @@ 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
{