forked from Imagelibrary/binutils-gdb
gas signed overflow fixes
* config/tc-aarch64.c (get_aarch64_insn): Avoid signed overflow. * config/tc-metag.c (parse_dalu): Likewise. * config/tc-tic4x.c (md_pcrel_from): Likewise. * config/tc-tic6x.c (tic6x_output_unwinding): Likewise. * config/tc-csky.c (parse_fexp): Use an unsigned char temp buffer. Don't use register keyword. Avoid signed overflow and remove now unneccesary char masks. Formatting. * config/tc-ia64.c (operand_match): Don't use shifts to sign extend. * config/tc-mep.c (mep_apply_fix): Likewise. * config/tc-pru.c (md_apply_fix): Likewise. * config/tc-riscv.c (load_const): Likewise. * config/tc-nios2.c (md_apply_fix): Likewise. Don't potentially truncate fixup before right shift. Tidy BFD_RELOC_NIOS2_HIADJ16 calculation.
This commit is contained in:
@@ -2937,7 +2937,7 @@ md_pcrel_from (fixS *fixP)
|
||||
unsigned int op;
|
||||
|
||||
buf = (unsigned char *) fixP->fx_frag->fr_literal + fixP->fx_where;
|
||||
op = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
|
||||
op = ((unsigned) buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
|
||||
|
||||
return ((fixP->fx_where + fixP->fx_frag->fr_address) >> 2) +
|
||||
tic4x_pc_offset (op);
|
||||
|
||||
Reference in New Issue
Block a user