General Motors and Coca-Cola posted earnings that topped expectations.