As it grapples with a massive global smartphone recall that is estimated to cost more than $1 billion, Samsung Electronics Co. is moving swiftly to sell stakes in other technology companies to raise cash.

The world’s biggest smartphone maker said Sunday it has sold shares in computer-drive maker Seagate Technology PLC, chip maker Rambus Inc., Dutch semiconductor-equipment maker ASML Holding NV and Japanese electronics maker Sharp Corp.

The...