In this paper, we study ergodic optimization and multifractal behavior of Lyapunov exponents for matrix cocycles. We show the continuity of entropy spectrum at boundary of Lyapunov spectrum in the sense that h top (E(α t )) → h top (E(β(A)) for generic cocycles (in the sense of [BGMV]). We also show that for such cocycles over subshifts of finite type, the Lyapunov spectrum is equal to the closure of the set positive entropy spectrum. Moreover, we prove the restricted variational principle to level sets for such cocycles.We prove the continuity of the lower joint spectral radius for general cocycles under the assumption that the linear cocycles admit a dominated splitting of index 1.We show that the singular value pressure is continuous on Hölder and fiberbunched GL(2, R)-valued cocycles over subshifts of finite type. We also show that the Lyapunov spectrum is a closed and convex set for such cocycles over subshifts of finite type.