Let $\mathcal{M} = \text{GL}(n, \mathbb{R})$ denote the set of $n \times n$ invertible matrices over $\mathbb{R}$. We know that $\text{GL}(n, \mathbb{R})$ has exactly 2 connected components. I have recently been faced with the question of how many connected components are there when some of the entries of the invertible matrix are predetermined (assume that the entries that are fixed are such that there is at least 1 invertible matrix of this form). Does anybody know if the answer to this problem is known in general?

For example, suppose we are dealing with invertible matrices which are block diagonal with $k$ blocks. Then the set of invertible matrices whose entries are fixed to be zero, except at these $k$ diagonal blocks, is $2^k$.

I think in the complex setting ($\mathbb{R}$ replaced by $\mathbb{C}$) there is only 1 connected component because of an abstract theorem about analytic functions, which says that the zero set of a non-constant analytic function defined on a connected open subset $\mathcal{U}$ of $\mathbb{C}^m$ does not disconnect $\mathcal{U}$.

EDIT: If it helps at all or makes things simpler, I'm interested in the particular case when the entries of the matrix that are fixed form a block submatrix, and moreover this fixed block is zero.