Index: test/tools/llvm-readobj/note-gnu-property.s =================================================================== --- test/tools/llvm-readobj/note-gnu-property.s +++ test/tools/llvm-readobj/note-gnu-property.s @@ -17,7 +17,7 @@ // GNU-NEXT: stack size: // GNU-NEXT: no copy on protected // GNU-NEXT: X86 features: -// GNU-NEXT: X86 features: IBT, +// GNU-NEXT: X86 features: IBT, // GNU-NEXT: // LLVM: Notes [ @@ -40,7 +40,7 @@ // LLVM-NEXT: stack size: // LLVM-NEXT: no copy on protected // LLVM-NEXT: X86 features: -// LLVM-NEXT: X86 features: IBT, +// LLVM-NEXT: X86 features: IBT, // LLVM-NEXT: // LLVM-NEXT: ] // LLVM-NEXT: } @@ -72,8 +72,8 @@ /* CET property note */ .long 0xc0000002 /* Type: GNU_PROPERTY_X86_FEATURE_1_AND */ - .long 8 /* Data size */ - .quad 2 /* GNU_PROPERTY_X86_FEATURE_1_SHSTK */ + .long 4 /* Data size */ + .long 2 /* GNU_PROPERTY_X86_FEATURE_1_SHSTK */ .p2align 3 /* Align to 8 byte for 64 bit */ /* CET property note with padding */ @@ -83,8 +83,8 @@ .p2align 3 /* Align to 8 byte for 64 bit */ .long 0xc0000002 /* Type: GNU_PROPERTY_X86_FEATURE_1_AND */ - .long 8 /* Data size */ - .quad 0 /* Empty flags, not an error */ + .long 4 /* Data size */ + .long 0 /* Empty flags, not an error */ .p2align 3 /* Align to 8 byte for 64 bit */ /* All notes below are broken. Test we are able to report them. */ @@ -118,8 +118,8 @@ /* CET note with bad flags */ .long 0xc0000002 /* Type: GNU_PROPERTY_X86_FEATURE_1_AND */ - .long 8 /* Data size */ - .quad 0xf000f000f000f001 /* GNU_PROPERTY_X86_FEATURE_1_IBT and bad bits */ + .long 4 /* Data size */ + .long 0xf000f001 /* GNU_PROPERTY_X86_FEATURE_1_IBT and bad bits */ .p2align 3 /* Align to 8 byte for 64 bit */ /* GNU_PROPERTY_NO_COPY_ON_PROTECTED with pr_datasz and without data */ Index: tools/llvm-readobj/ELFDumper.cpp =================================================================== --- tools/llvm-readobj/ELFDumper.cpp +++ tools/llvm-readobj/ELFDumper.cpp @@ -3677,14 +3677,12 @@ return OS.str(); case GNU_PROPERTY_X86_FEATURE_1_AND: OS << "X86 features: "; - if (DataSize != 4 && DataSize != 8) { + if (DataSize != 4) { OS << format("", DataSize); return OS.str(); } - uint64_t CFProtection = - (DataSize == 4) - ? support::endian::read32(Data.data()) - : support::endian::read64(Data.data()); + uint32_t CFProtection = + support::endian::read32(Data.data()); if (CFProtection == 0) { OS << "none"; return OS.str(); @@ -3702,7 +3700,7 @@ OS << ", "; } if (CFProtection) - OS << format("", CFProtection); + OS << format("", CFProtection); return OS.str(); } }