The Australian sharemarket gained as Commonwealth Bank rallied to a new record closing high, while Computershare soared.