check-static-inits: Filter out zero-length sections
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 1 Oct 2014 15:56:07 +0000 (11:56 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 1 Oct 2014 15:56:07 +0000 (11:56 -0400)
When compiling with -O0, zero-sized constructors were showing up
and confusing the test.

src/check-static-inits.sh

index 6b03dd2..1446fa7 100755 (executable)
@@ -22,7 +22,7 @@ fi
 
 echo "Checking that no object file has static initializers"
 for obj in $OBJS; do
-       if objdump -t "$obj" | grep '[.][cd]tors'; then
+       if objdump -t "$obj" | grep '[.][cd]tors' | grep -v '\<00*\>'; then
                echo "Ouch, $obj has static initializers/finalizers"
                stat=1
        fi