  Despite being hard to measure, GRB prompt $\gamma$-ray emission polarization
is a valuable probe of the dominant emission mechanism and the outflow's
composition and angular structure. During the prompt emission the outflow is
ultra-relativistic with Lorentz factors $\Gamma\gg1$. We describe in detail the
linear polarization properties of various emission mechanisms: synchrotron
radiation from different magnetic field structures (ordered: toroidal $B_{\rm
tor}$ or radial $B_\parallel$, and random: normal to the radial direction
$B_\perp$), Compton drag, and photospheric emission. We calculate the
polarization for different GRB jet angular structures (e.g. top-hat, Gaussian,
power-law) and viewing angles $\theta_{\rm obs}$. Synchrotron with $B_\perp$
can produce large polarizations, up to $25\%\lesssim\Pi\lesssim45\%$, for a
top-hat jet but only for lines of sight just outside the jet's sharp edge. The
same also holds for Compton drag, albeit with a slightly higher overall $\Pi$.
Moreover, we demonstrate how $\Gamma$-variations during the GRB or smoother jet
edges would significantly reduce $\Pi$. We construct a semi-analytic model for
non-dissipative photospheric emission from structured jets. Such emission can
produce up to $\Pi\lesssim15\%$ with reasonably high fluences, but this
requires steep gradients in $\Gamma(\theta)$. A polarization of
$50\%\lesssim\Pi\lesssim65\%$ can robustly be produced only by synchrotron
emission from a transverse magnetic field ordered on angles $\gtrsim\!1/\Gamma$
around our line of sight (like a global toroidal field). Therefore, such a
model would be strongly favored even by a single secure measurement within this
range. We find that such a model would also be favored if $\Pi\gtrsim20\%$ is
measured in most GRBs within a large enough sample, by deriving the
polarization distribution for our different emission and jet models.

High Energy Astrophysical Phenomena