Goldman has the shares. Probably from buying stock in the general market for their own account and perhaps from 1 or 2 holders who want out. They know GILD has a buyback in place, which means the door is opened to show the company blocks of stock. That is what happened. Goldman showed GILD 500,000 shares with price tag that fits within the rules of stock buy-backs. (I could go on about the rules), but suffice it to say Goldman knows them, and they benefit the broker in this situation.) GILD says they'll buy the stock and the transaction is going to the tape. None of this happens if GILD is trading down, but now that it is trading up, the numbers really make sense for one party in particular. Goldman.
I'm long GILD, and I love the stock. But, I view this as a moderate negative for the near-term. GILD burns a chunk of their buy-back money at some-what run up prices, and Goldman runs off with the dough. In this case GILD's management got played.