  The hull of linear codes plays an important role in quantum information and
coding theory. In the present paper, by investigating the Galois hulls of
generalized Reed-Solomon (GRS) codes and extended GRS codes over the finite
field Fq, we give several new families of MDS codes with Galois hulls of
arbitrary dimensions that are not obtained before. Some of them generalize the
ones in the literature [13]. As a consequence, using these MDS codes with
Galois hulls of arbitrary dimensions, we construct nine new families of MDS
entanglement-assisted quantum error-correcting codes (EAQECCs) with flexible
parameters.
