ld.bfd showed error on previous inputs, result values were larger than 8/16 bits,
though ld.gold accepted them.
ABI says "The R_386_16, and R_386_8 relocations truncate the computed
value to 16-bits and 8-bits respectively".
Patch changes inputs to have result calculated values of relocations to fit 8 and 16 bits.
That can be used for implementation of more strict checks, like bfd do.
Differential revision: https://reviews.llvm.org/D29270
llvm-svn: 293479
A program or object file using R_386_8, R_386_16, R_386_PC16 or R_386_PC8
relocations is not conformant to latest ABI. The R_386_16, and R_386_8
relocations truncate the computed value to 16 - bits and 8 - bits
respectively. R_386_PC16 and R_386_16 are used by some
applications, for example by FreeBSD loaders.
Previously we did not take addend in account for these relocation,
counting it as 0, what is wrong and was a reason of hangs.
This patch needed for example for FreeBSD pmbr (protective mbr).
Differential revision: https://reviews.llvm.org/D27303
llvm-svn: 288581