[PATCH] D27303: [ELF] - Implemented R_386_16 and R_386PC16 relocations

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 04:01:36 PST 2016


grimar added inline comments.


================
Comment at: ELF/Target.cpp:463
+  if (Type == R_386_16 || Type == R_386_PC16) {
+    write16le(Loc, Val);
+    return;
----------------
ruiu wrote:
> Don't you need an overflow check?
If you mean some truncation validation, then no.
intel386-psABI-1.1.pdf says:
"The R_386_16, and R_386_8 relocations
truncate the computed value to 16-bits and 8-bits respectively"
It does not say we should do any checks.

I moved the common checkInt<32>(Loc, Val, Type); check above new code though,
it looks reasonable.


https://reviews.llvm.org/D27303





More information about the llvm-commits mailing list