D74537 introduced a bug: if `(config->andFeatures & GNU_PROPERTY_AARCH64_FEATURE_1_PAC) != 0`
with -z pac-plt unspecified, we incorrectly use AArch64BtiPac, whose writePlt will make
out-of-bounds write after the .plt section. This is often benign because the
output section after .plt will usually overwrite the content.
This is very difficult to test without
D131247 (Parallelize writes of different OutputSections).
(cherry picked from commit
d7cbfcf36ace575ec90434624279dd3ebce78c47)
}
static TargetInfo *getTargetInfo() {
- if (config->andFeatures & (GNU_PROPERTY_AARCH64_FEATURE_1_BTI |
- GNU_PROPERTY_AARCH64_FEATURE_1_PAC)) {
+ if ((config->andFeatures & GNU_PROPERTY_AARCH64_FEATURE_1_BTI) ||
+ config->zPacPlt) {
static AArch64BtiPac t;
return &t;
}