Relaxed Dirichlet problem and shape optimization within the linear elasticity framework