On least squares methods for linear two-point boundary value problems