Let $L$ be a bounded linear operator acting on a complex Banach space $B$. If there exists a nonzero continuous linear functional $\ell \colon B \to \mathbb{C}$ such that $\ell(Lx)=\ell(x)$ for all $x \in B$, then $1$ is by definition an eigenvalue of the adjoint operator $L^* \colon B^* \to B^*$, and a well-known consequence of this is that $1$ belongs to the spectrum of $L$ (though it is not necessarily an eigenvalue of $L$). My question is: if we have only that $\ell \colon D \to \mathbb{C}$ is a nonzero closed linear functional defined on a dense linear space $D \subset B$, and $\ell(Lx)=\ell(x)$ for all $x \in D$, does it still follow that $1$ belongs to the spectrum of $L$?
I would guess that this implication does not hold in general, but I am having difficulty thinking up a counterexample (not an unusual situation for me in functional analysis!).