How is the elastic restoring force defined exactly for a spring? We know by Hooke's law that
$$F_\text{restoring} = -kx$$
but what does $F_\text{restoring}$ really mean? I thought up till now that it was the force the spring pulled with at both ends if you stretched it by a distance $x$. This definition worked pretty well until I encountered some problems when I was doing problems a little above my usual level.
I have stripped down the problem I encountered to its core (where I think my confusion arises from):
Consider a spring attached to a wall (massless, ideal) in its relaxed. If we pull it with a force $F$, clearly the spring exerts a pulls with a force $F$. However, initially the spring is unstretched. The definition fails in this case.
What is the precise definition of a restoring force in a spring in the most general case?