General Motors in taking advantage of a weak US real estate market by buying the downtown Detroit building it currently leases for its headquarters.