[PATCH] D59780: Support Intel Control-flow Enforcement Technology

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 1 00:55:41 PDT 2019


ruiu added a comment.

In D59780#1449525 <https://reviews.llvm.org/D59780#1449525>, @MaskRay wrote:

> `writePltHeader` should also be changed.
>
>   diff --git i/ELF/Arch/X86_64.cpp w/ELF/Arch/X86_64.cpp
>   index 668b40863..75f780f6b 100644
>   --- i/ELF/Arch/X86_64.cpp
>   +++ w/ELF/Arch/X86_64.cpp
>   @@ -144,7 +144,7 @@ void X86_64::writePltHeader(uint8_t *Buf) const {
>      };
>      memcpy(Buf, PltData, sizeof(PltData));
>      uint64_t GotPlt = In.GotPlt->getVA();
>   -  uint64_t Plt = In.Plt->getVA();
>   +  uint64_t Plt = In.IBTPlt ? In.IBTPlt->getVA() : In.Plt->getVA();
>      write32le(Buf + 2, GotPlt - Plt + 2); // GOTPLT+8
>      write32le(Buf + 8, GotPlt - Plt + 4); // GOTPLT+16
>    }
>
>
> With these changes, I manage to run hello-world with `clang {,-m32} -fuse-ld=lld -fcf-protection=branch a.c -Wl,--require-cet -o a; ./a`


Great! Thank you for verifying!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59780





More information about the llvm-commits mailing list