if (howto->rightshift
&& (val & ((((bfd_signed_vma) 1) << howto->rightshift) - 1)))
{
- (*_bfd_error_handler) (_("%pB: relocation %s right shift %d error 0x%lx"),
- abfd, howto->name, howto->rightshift, (long) val);
- bfd_set_error (bfd_error_bad_value);
+ /* The as passes NULL casued internal error, so it can not use _bfd_error_handler
+ output details, ld is not affected. */
+ if (abfd != NULL)
+ {
+ (*_bfd_error_handler) (_("%pB: relocation %s right shift %d error 0x%lx"),
+ abfd, howto->name, howto->rightshift, (long) val);
+ bfd_set_error (bfd_error_bad_value);
+ }
return false;
}
high part: from sign bit to highest bit. */
if ((val & ~mask) && ((val & ~mask) != ~mask))
{
- (*_bfd_error_handler) (_("%pB: relocation %s overflow 0x%lx"),
- abfd, howto->name, (long) val);
- bfd_set_error (bfd_error_bad_value);
+ /* The as passes NULL casued internal error, so it can not use _bfd_error_handler
+ output details, ld is not affected. */
+ if (abfd != NULL)
+ {
+ (*_bfd_error_handler) (_("%pB: relocation %s overflow 0x%lx"),
+ abfd, howto->name, (long) val);
+ bfd_set_error (bfd_error_bad_value);
+ }
return false;
}
insn = bfd_getl32 (buf);
if (!loongarch_adjust_reloc_bitsfield (NULL, howto, &reloc_val))
- as_warn_where (fixP->fx_file, fixP->fx_line, "Reloc overflow");
+ as_bad_where (fixP->fx_file, fixP->fx_line, "Reloc overflow");
insn = (insn & (insn_t)howto->src_mask)
| ((insn & (~(insn_t)howto->dst_mask)) | reloc_val);