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$.
Edit: I found a similar construction that I would like to generalize: in Brylinski's "Loop Spaces, Characteristic Classes and Geometric Quantization" they discuss the magnetic monopole which is characterized by a line bundle $[L] \in H^2(\mathbb{R}^3\setminus\{0\},\mathbb{Z})$. They then use the canonical isomorphism $$H^2(\mathbb{R}^3\setminus\{0\},\mathbb{Z}) \to H^3(\mathbb{S}^3,\mathbb{Z})$$ to construct a gerbe. I guess my question is the following: is there something like a canonical isomorphism $$H^1(X\setminus D,\mathcal{O}^{\times}) \to H^2(X,\mathcal{O}^{\times})$$ so that the holomorphic line bundle induces a holomorphic gerbe?