It was requested by Rui to change these tests, because they fail after changing implementation of relocateOne to next:
void X86TargetInfo::relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const { ... switch (Type) { case R_386_8: case R_386_PC8: checkInt<8>(Loc, Val, Type); *Loc = Val; break; case R_386_16: case R_386_PC16: checkInt<16>(Loc, Val, Type); write16le(Loc, Val); break; ... }
Though ABI says "The R_386_16, and R_386_8 relocations truncate the computed value to 16-bits and 8-bits respectively".
ld.bfd errors on such inputs, ld.gold accepts them.
And because of using word "truncate" it is not clear for me what behavior is correct. Seems LLD and gold just follows ABI and
bfd performs additional checks. I have no arguments for doing or not doing that change.