5. Given the set of integers
$M=\left\{m \mid x^{2}+m x-36=0\right.$ has integer solutions $\}$, set $A$ satisfies the conditions:
(1) $\varnothing \subset A \subseteq M$;
(2) If $a \in A$, then $-a \in A$.
Then the number of all such sets $A$ is ( ).
(A) 15
(B) 16
(C) 31
(D) 32
5. C.

Let $\alpha, \beta$ be the roots of the equation $x^{2}+m x-36=0$. Then $\alpha \beta=-36$. Therefore,
when $|\alpha|=1,|\beta|=36$, $m= \pm 35$;
when $|\alpha|=2,|\beta|=18$, $m= \pm 16$;
when $|\alpha|=3,|\beta|=12$, $m= \pm 9$;
when $|\alpha|=4,|\beta|=9$, $m= \pm 5$;
when $|\alpha|=6,|\beta|=6$, $m=0$.
Thus,
$$
M=\{0\} \cup\{-5,5\} \cup\{-9,9\} \cup
$$
$$
\{-16,16\} \cup\{-35,35\} \text {. }
$$

From condition (1), we know $A \neq \varnothing$.
From condition (2), we know $A$ is a set composed of some pairs of opposite numbers.

Therefore, the 5 pairs of opposite numbers in $M$ can form $2^{5}-1$ different non-empty sets $A$.