]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gold/testsuite/gnu_property_test.sh
gold: Properly align the NT_GNU_PROPERTY_TYPE_0 note
[thirdparty/binutils-gdb.git] / gold / testsuite / gnu_property_test.sh
index 4a2d217cbe9a77861f1caad62e7c311ed625966b..1806d3474cca687e00c79619528c8750d038f23a 100755 (executable)
@@ -53,8 +53,28 @@ check_count()
     fi
 }
 
+check_alignment ()
+{
+    if egrep -q "Class:[ \t]+ELF64" "$1"
+    then
+       align=8
+    else
+       align=4
+    fi
+    if ! egrep -q ".note.gnu.property[ \t]+NOTE.*$align$" "$1"
+    then
+       echo "Wrong .note.gnu.property alignment in $1:"
+       egrep ".note.gnu.property[ \t]+NOTE.*$align" "$1"
+       exit 1
+    fi
+}
+
+check_alignment gnu_property_test.stdout
+
 check_count gnu_property_test.stdout "GNU\s*0x[0-9a-f]*\s*NT_GNU_PROPERTY_TYPE_0" 1
 
+check_count gnu_property_test.stdout "^  NOTE" 2
+
 check gnu_property_test.stdout "stack size: 0x111100"
 check gnu_property_test.stdout "no copy on protected"
 check gnu_property_test.stdout "x86 ISA used: i486, SSE2, SSE4_2, AVX512CD"