In Silence in the Library and Forest of the Dead the Doctor sees River has a screwdriver.
RIVER: We can increase the mesh density. Dial it up four hundred percent. Make it a tougher meal.
(The Doctor uses his screwdriver to adjust Dave's suit.)
DOCTOR: Eight hundred percent. Pass it on.
(River holds up a sonic screwdriver of her own.)
DOCTOR: What's that?
RIVER: It's a screwdriver.
DOCTOR: It's sonic.
RIVER: Yeah, I know. Snap.
Then later they have conversations about it:
DOCTOR: Your screwdriver looks exactly like mine.
RIVER: Yeah. You gave it to me.
DOCTOR: I don't give my screwdriver to anyone.
RIVER: I'm not anyone.
DOCTOR: Who are you?
then later RIVER: What's wrong with it?
DOCTOR: There's a signal coming from somewhere, interfering with it.
RIVER: Then use the red settings.
DOCTOR: It doesn't have a red setting.
RIVER: Well, use the dampers.
DOCTOR: It doesn't have dampers.
RIVER: It will do one day. (The Doctor takes River's sonic screwdriver.)
DOCTOR: So, some time in the future, I just give you my screwdriver.
DOCTOR: Why would I do that?
RIVER: I didn't pluck it from your cold dead hands, if that's what you're worried about.
DOCTOR: And I know that because?
Then later he thinks
DOCTOR: Why? Why would I give her my screwdriver? Why would I do that? Thing is, future me had years to think about it, all those years to think of a way to save her, and what he did was give her a screwdriver. Why would I do that?
Then in the 2015 Christmas special the 12th Doctor gives River a screwdriver as a present.
DOCTOR: Happy Christmas.
RIVER: Really? I don't think you've ever given me a present before. (She opens the box to reveal the sonic screwdriver she had in the Library.)
RIVER: Oh, it's a sonic screwdriver! How lovely!
DOCTOR: When I saw the sonic trowel, I thought it was just embarrassing, but, look.
I'm confused why did the Doctor give River his screwdriver?