According to Seder Hadoros, when Rashi was born, his father Yitzchak named him Shlomo after his father. I am not sure exactly how Shlomo turned into "Sharma", and regarding Rashi's grandfather Elyakim, according to the luach in Mishpachas Luria, Rashi's great grandfather was Elyakim.