Let $k$ be a field (algebraically closed if necessary) and let $X$ be an elliptic curve over $k$. Let $D$ be a divisor of degree zero on $X$. How can I tell when $\mathcal{O}_X(D)$ has global sections? When $D$ has positive or negative degree, I understand what's going on: if $D$ has negative degree, then it has no global sections, and when $D$ has positive degree we have $l(D)=\deg D$ by Riemann-Roch. But the case of $\deg D=0$ is unclear to me. I bet it probably depends on the configuration of points, but I don't really know how or why.
Context: I'm working my way through chapter IV of Hartshorne and realized I don't understand this. It originally came up in an attempt to work on this previous question of mine (which I'm still stuck on).
If there is a nonzero $f \in L(D)$, then the sum of $D$ and the divisor of $f$ has nonnegative entries and degree $0$, so it must be zero. Thus $D$ is principal (it’s the divisor of $1/f$). The reverse implication is easy.