  We present galaxy stellar mass functions (GSMFs) at $z=$ 4-8 from a
rest-frame ultraviolet (UV) selected sample of $\sim$4500 galaxies, found via
photometric redshifts over an area of $\sim$280 arcmin$^2$ in the CANDELS/GOODS
fields and the Hubble Ultra Deep Field. The deepest Spitzer/IRAC data
yet-to-date and the relatively large volume allow us to place a better
constraint at both the low- and high-mass ends of the GSMFs compared to
previous space-based studies from pre-CANDELS observations. Supplemented by a
stacking analysis, we find a linear correlation between the rest-frame UV
absolute magnitude at 1500 \AA\ ($M_{\rm UV}$) and logarithmic stellar mass
($\log M_*$) that holds for galaxies with $\log(M_*/M_{\odot}) \lesssim 10$. We
use simulations to validate our method of measuring the slope of the $\log
M_*$-$M_{\rm UV}$ relation, finding that the bias is minimized with a hybrid
technique combining photometry of individual bright galaxies with stacked
photometry for faint galaxies. The resultant measured slopes do not
significantly evolve over $z=$ 4-8, while the normalization of the trend
exhibits a weak evolution toward lower masses at higher redshift. We combine
the $\log M_*$-$M_{\rm UV}$ distribution with observed rest-frame UV luminosity
functions at each redshift to derive the GSMFs, finding that the low-mass-end
slope becomes steeper with increasing redshift from
$\alpha=-1.55^{+0.08}_{-0.07}$ at $z=4$ to $\alpha=-2.25^{+0.72}_{-0.35}$ at
$z=8$. The inferred stellar mass density, when integrated over
$M_*=10^8$-$10^{13} M_{\odot}$, increases by a factor of $10^{+30}_{-2}$
between $z=7$ and $z=4$ and is in good agreement with the time integral of the
cosmic star formation rate density.
