[PATCH] D27303: [ELF] - Implemented R_386_16 and R_386PC16 relocations
Ed Maste via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 1 12:43:35 PST 2016
emaste added inline comments.
================
Comment at: ELF/Target.cpp:457-461
+ // 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. Unfortunately R_386_PC16 and R_386_16 are used by some
+ // applications, for example by FreeBSD loaders.
----------------
ruiu wrote:
> emaste wrote:
> > I think this comment ought to be reworded slightly -- the boot loaders indeed do not conform to the latest i386 psABI. I think that will be true for any `.code16` assembly, as BIOS bootloaders must be.
> >
> >
> Yeah. I think R_386_16 is not a nonstandard weird relocation but it's just that it's out of scope of i386 psABI. By i386, it really means 32-bit protected mode of i386, and not 8086 mode. So I wouldn't say it's unfortunate that we need to support that.
Maybe something like `R_386_PC16 and R_386_16 are not part of the current i386 psABI. They are used by 16-bit x86 objects, like boot loaders`?
https://reviews.llvm.org/D27303
More information about the llvm-commits
mailing list