I have the following situation: let $X$ be a projective complex manifold and let $f \in H^1(X,\mathcal{M}^{\times})$. So $f$ defines something like a line bundle with meromorphic transition functions. 

We can identify the poles of $f$ which is a divisor $D \subset X$. Then the restriction of $f$ to $X \setminus D$ gives an element
$$f\rvert_{X \setminus D} \in H^1(X\setminus D,\mathcal{O}^{\times}) = \mathrm{Pic}(X\setminus D)$$
which defines a line bundle $L$ on $X \setminus D$.

My question is the following: if $s$ is a section of the line bundle $L$ on $X \setminus D$, does there exist a geometric object $W$ (a line bundle, gerbe, ...) on the whole of $X$ which extends $L$ in a nice way, i.e. the section $s$ extends to a section on $W$, and if yes, what are the requirements for $f$ and $s$?

I know that this is not a very precise question, but maybe there is some known theory that handles such situations.

Remark: In my situation, the cocycle $f$ comes from a group 1-cocycle $e \in H^1(\pi_1(X),H^0(\tilde{X},\mathcal{M}^{\times}))$ where $\tilde{X}$ is the universal covering of $X$.