Gains in the auto and consumer goods sectors, particularly by Adani Enterprises and Maruti Suzuki, helped offset losses in pharmaceuticals and banking stocks.