projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gas signed overflow fixes
[deliverable/binutils-gdb.git]
/
gas
/
config
/
tc-nios2.c
diff --git
a/gas/config/tc-nios2.c
b/gas/config/tc-nios2.c
index ec572a61ce63c80735d6f8b40d65aa386d167e29..f1a02001f8c59054621ac835ac23c4f0c3612511 100644
(file)
--- a/
gas/config/tc-nios2.c
+++ b/
gas/config/tc-nios2.c
@@
-1384,7
+1384,7
@@
md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
nios2_diagnose_overflow (fixup, howto, fixP, value);
/* Apply the right shift. */
nios2_diagnose_overflow (fixup, howto, fixP, value);
/* Apply the right shift. */
- fixup = (
(signed)fixup)
>> howto->rightshift;
+ fixup = (
offsetT) fixup
>> howto->rightshift;
/* Truncate the fixup to right size. */
switch (fixP->fx_r_type)
/* Truncate the fixup to right size. */
switch (fixP->fx_r_type)
@@
-1396,13
+1396,11
@@
md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
fixup = fixup & 0xFFFF;
break;
case BFD_RELOC_NIOS2_HIADJ16:
fixup = fixup & 0xFFFF;
break;
case BFD_RELOC_NIOS2_HIADJ16:
- fixup = ((((fixup >> 16) & 0xFFFF) + ((fixup >> 15) & 0x01))
- & 0xFFFF);
+ fixup = ((fixup + 0x8000) >> 16) & 0xFFFF;
break;
default:
{
break;
default:
{
- int n = sizeof (fixup) * 8 - howto->bitsize;
- fixup = (fixup << n) >> n;
+ fixup &= ((valueT) 1 << howto->bitsize) - 1;
break;
}
}
break;
}
}
This page took
0.02454 seconds
and
4
git commands to generate.