For any positive integer m and an odd prime p; let Fq+uFq, where q=pm, be a ring extension of the ring Fp+uFp.In this paper, we construct linear codes over Fp+uFp by using trace function defined on Fq+uFq and determine their Hamming weight distributions by employing symplectic-weight distributions of their Gray images.