Shares end higher, boosted by large-caps’ gains