On the second ballot (and the rest of them) - you can vote for who you want to. I imagine that Rubio can tell his delegates to vote for xxx, and Kasich can tell his to vote for yyyy and hope that their delegates follow their direction. I doubt if Cruz is close to Trump that he would have his delegates vote for zzzz, but perhaps.
I think it was upthread that someone surmised that Trump could promise Cruz a job so as to get Cruz's delegates.
I'm reminded of Nixon when he didn't fight the recount when he lost in 1960. To spare the country all of the drama. I imagine that something like that may happen if the Republicans see something like that happening. I would like to think so anyway. They will definitely need to come together at the convention to have any chance of beating Hillary.
Beyond the first ballot?
Several states bind delegations through the 2nd ballot.
Florida delegates are bound through the 3rd ballot (thanks Jeb!)
A few other states require 2/3 consensus to support another candidate.