In the latest result of sagging demand for small cars as cheap gas persuades people to buy more trucks and large tall wagons, General Motors is laying off about 500 workers at the Michigan assembly plant that builds the subcompact Chevrolet Sonic.