| test -z "$srcdir" && srcdir=. |
| test -z "$libs" && libs=.libs |
| if which objdump 2>/dev/null >/dev/null; then |
| echo "check-static-inits.sh: 'objdump' not found; skipping test" |
| if test "x`echo $OBJS`" = "x$OBJS" 2>/dev/null >/dev/null; then |
| echo "check-static-inits.sh: object files not found; skipping test" |
| echo "Checking that no object file has static initializers" |
| if objdump -t "$obj" | grep '[.][cd]tors' | grep -v '\<00*\>'; then |
| echo "Ouch, $obj has static initializers/finalizers" |
| echo "Checking that no object file has lazy static C++ constructors/destructors or other such stuff" |
| if objdump -t "$obj" | grep -q '__cxa_' && ! objdump -t "$obj" | grep -q __ubsan_handle; then |
| objdump -t "$obj" | grep '__cxa_' |
| echo "Ouch, $obj has lazy static C++ constructors/destructors or other such stuff" |