repoline PLT entries that were changed to include the necessary endbr64
instructions. But with -Wl,-znoretpolineplt we would still emit non-BIT
PLT entries under certain circumstances. Fix this.
ok deraadt@, guenther@
return &t;
}
+#ifdef __OpenBSD__
+ static IntelIBT t;
+ return &t;
+#else
if (config->andFeatures & GNU_PROPERTY_X86_FEATURE_1_IBT) {
static IntelIBT t;
return &t;
static X86_64 t;
return &t;
+#endif
}
TargetInfo *elf::getX86_64TargetInfo() { return getTargetInfo(); }
if ((config->emachine == EM_386 || config->emachine == EM_X86_64) &&
(config->andFeatures & GNU_PROPERTY_X86_FEATURE_1_IBT))
name = ".plt.sec";
+#ifdef __OpenBSD__
+ else if (config->emachine == EM_X86_64)
+ name = ".plt.sec";
+#endif
// The PLT needs to be writable on SPARC as the dynamic linker will
// modify the instructions in the PLT entries.
in.ibtPlt = std::make_unique<IBTPltSection>();
add(*in.ibtPlt);
}
+#ifdef __OpenBSD__
+ else if (config->emachine == EM_X86_64) {
+ in.ibtPlt = std::make_unique<IBTPltSection>();
+ add(*in.ibtPlt);
+ }
+#endif
if (config->emachine == EM_PPC)
in.plt = std::make_unique<PPC32GlinkSection>();