X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=libiberty%2Fsimple-object-xcoff.c;h=d874de258f5ed7c455f79a0768077e447eca7004;hb=0fc2a808cbf5302016535367191bb8cd0900f332;hp=9a8f581563f0e9c83828c3ec1742e4773c37a2a0;hpb=f8ad2513754f5a53fecb407cf64fcb586836b60c;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/simple-object-xcoff.c b/libiberty/simple-object-xcoff.c index 9a8f581563..d874de258f 100644 --- a/libiberty/simple-object-xcoff.c +++ b/libiberty/simple-object-xcoff.c @@ -1,5 +1,5 @@ /* simple-object-coff.c -- routines to manipulate XCOFF object files. - Copyright (C) 2013-2017 Free Software Foundation, Inc. + Copyright (C) 2013-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google and David Edelsohn, IBM. This program is free software; you can redistribute it and/or modify it @@ -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 {