The borders are all open, so driving from Spain to Portugal is a non-event. I rented in Lisbon, drove all over southern Spain, and then back into Portugal at Faro and Vilamoura. My rental car company did charge me extra for some kind of official documentation to prove I had a legal right to cross the border with it. I never used it. But I suppose it was good to have in case of a traffic stop or something.
Most rental car companies require that you drop the car off in the same country that you rented, though. Some will allow trans-national dropoffs with an extra drop fee.
-Bob