[PATCH] D58102: Support X86 Control-flow Enforcement Technology (CET) in LLD

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 12 00:01:50 PST 2019


MaskRay added a comment.

`ELF/Arch/{X86,X86_64}.cpp` implement another nonstandard PLT called retpoline PLT.
Can the security enhancement charactersitics of CET be used along with `-z retpolineplt`?
If not (for now and for the future), have you considered making a class like `Retpoline` which derives from `X86_64<ELFT>` and overrides the relevant GOT/PLT methods (does SPLT have a mnemonic name? Secure PLT?)

  template <class ELFT> class Retpoline : public X86_64<ELFT> {
  public:
    Retpoline();
    void writeGotPlt(uint8_t *Buf, const Symbol &S) const override;
    void writePltHeader(uint8_t *Buf) const override;
    void writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, uint64_t PltEntryAddr,
                  int32_t Index, unsigned RelOff) const override;
  };

Another question: is there any concurrent work planned on ld.bfd or gold? I find that gold merges `GNU_PROPERTY_X86_*` bits for `.note.gnu.property` but it doesn't have the SPLT feature yet.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58102/new/

https://reviews.llvm.org/D58102





More information about the llvm-commits mailing list