forked from OSchip/llvm-project
parent
638d606f83
commit
95d6ca52ac
|
@ -461,6 +461,15 @@ void X86_64<ELFT>::relaxGot(uint8_t *Loc, uint64_t Val) const {
|
||||||
write32le(Loc - 1, Val + 1);
|
write32le(Loc - 1, Val + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// These nonstandard PLT entries are to migtigate Spectre v2 security
|
||||||
|
// vulnerability. In order to mitigate Spectre v2, we want to avoid indirect
|
||||||
|
// branch instructions such as `jmp *GOTPLT(%rip)`. So, in the following PLT
|
||||||
|
// entries, we use a CALL followed by MOV and RET to do the same thing as an
|
||||||
|
// indirect jump. That instruction sequence is so-called "retpoline".
|
||||||
|
//
|
||||||
|
// We have two types of retpoline PLTs as a size optimization. If `-z now`
|
||||||
|
// is specified, all dynamic symbols are resolved at load-time. Thus, when
|
||||||
|
// that option is given, we can omit code for symbol lazy resolution.
|
||||||
namespace {
|
namespace {
|
||||||
template <class ELFT> class Retpoline : public X86_64<ELFT> {
|
template <class ELFT> class Retpoline : public X86_64<ELFT> {
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue