xref: /aosp_15_r20/external/toybox/scripts/probes/findglobals (revision cf5a6c84e2b8763fc1a7db14496fd4742913b199)
1#!/bin/bash
2
3# Quick and dirty check to see if anybody's leaked global variables.
4# We should have this, toy_list, toybuf, libbuf, toys, and toybox_version.
5
6nm --size-sort generated/unstripped/toybox | grep '[0-9A-Fa-f]* [BCDGRS]' | \
7  grep -v GLIBC | while read a b c; do printf '%s %d\t%s\n' $b 0x$a $c; done | \
8  sort -k2,2n
9