Skip to content

Commit

Permalink
* simple-object-xcoff.c (simple_object_xcoff_find_sections): Use
Browse files Browse the repository at this point in the history
	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
  • Loading branch information
ian committed Jan 21, 2018
1 parent 78f044e commit 104faf4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
5 changes: 5 additions & 0 deletions libiberty/ChangeLog
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
19 changes: 14 additions & 5 deletions libiberty/simple-object-xcoff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 104faf4

Please sign in to comment.