Skip to content

Commit f459527

Browse files
MaskRaykovdan01
authored andcommitted
Simplify a short/long message with just "invalid"
1 parent eb02b6a commit f459527

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

lld/ELF/InputFiles.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -979,16 +979,15 @@ void readGnuProperty(const InputSection &sec, ObjFile<ELFT> &f) {
979979
f.andFeatures |= read32<ELFT::Endianness>(desc.data());
980980
} else if (config->emachine == EM_AARCH64 &&
981981
type == GNU_PROPERTY_AARCH64_FEATURE_PAUTH) {
982-
if (!f.aarch64PauthAbiCoreInfo.empty())
982+
if (!f.aarch64PauthAbiCoreInfo.empty()) {
983983
reportFatal(data.data(),
984984
"multiple GNU_PROPERTY_AARCH64_FEATURE_PAUTH entries are "
985985
"not supported");
986-
if (size != 16)
987-
reportFatal(
988-
data.data(),
989-
Twine("GNU_PROPERTY_AARCH64_FEATURE_PAUTH entry is too ") +
990-
(size < 16 ? "short" : "long") +
991-
": expected 16 bytes, but got " + Twine(size));
986+
} else if (size != 16) {
987+
reportFatal(data.data(), "GNU_PROPERTY_AARCH64_FEATURE_PAUTH entry "
988+
"is invalid: expected 16 bytes, but got " +
989+
Twine(size));
990+
}
992991
f.aarch64PauthAbiCoreInfo = desc;
993992
}
994993

lld/test/ELF/aarch64-feature-pauth.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu abi-tag-short.s -o short.o
2020
# RUN: not ld.lld short.o -o /dev/null 2>&1 | FileCheck --check-prefix ERR2 %s
2121

22-
# ERR2: error: short.o:(.note.gnu.property+0x0): GNU_PROPERTY_AARCH64_FEATURE_PAUTH entry is too short: expected 16 bytes, but got 12
22+
# ERR2: error: short.o:(.note.gnu.property+0x0): GNU_PROPERTY_AARCH64_FEATURE_PAUTH entry is invalid: expected 16 bytes, but got 12
2323

2424
# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu abi-tag-long.s -o long.o
2525
# RUN: not ld.lld long.o -o /dev/null 2>&1 | FileCheck --check-prefix ERR3 %s
2626

27-
# ERR3: error: long.o:(.note.gnu.property+0x0): GNU_PROPERTY_AARCH64_FEATURE_PAUTH entry is too long: expected 16 bytes, but got 24
27+
# ERR3: error: long.o:(.note.gnu.property+0x0): GNU_PROPERTY_AARCH64_FEATURE_PAUTH entry is invalid: expected 16 bytes, but got 24
2828

2929
# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu abi-tag-multiple.s -o multiple.o
3030
# RUN: not ld.lld multiple.o -o /dev/null 2>&1 | FileCheck --check-prefix ERR4 %s

0 commit comments

Comments
 (0)