On the cohomology of locally symmetric spaces