The Boltzmann formula for entropy, $S_B=k\ln \Omega(E)$ holds in the microcanonical ensemble, where $E$ is fixed. In other ensembles, entropy is given by the Gibbs/Shannon formula: $S_G=-k\sum_i P_i \ln P_i$, where $i$ labels the microstates and $P_i$ is the probability of state $i$. Here energy can fluctuate and the internal energy is given by $U = \sum_i P_i E_i$. In the thermodynamic limit, where the system is infinitely large, the density of microstates around the most probable energy $E^*$ is narrow so $U \approx E^*$ and it doesn't matter whether one uses $S_B(E^*)$ or $S_G$ for the entropy.
From thermodynamics we know that the entropy is a function of the internal energy, $S=S(U)$ which can be seen approximately from the Boltzmann entropy, since $S_B(E^*) \approx S_B(U)$ in the thermodynamic limit.
I believe, however, that $S=S(U)$ should hold even in the case of small systems, well below the thermodynamic limit. One can imagine $n$ identical systems (replicas), isolated from each other but brought into contact with a reservoir (heat/particle bath, for example). In the case of large $n$, the system composed of the $n$ replicas is in the thermodynamic limit. Since the replicas don't interact with each other, their microstates are independent of each other and the entropy of the $n$-replica system is $S_n=n S_0$. The internal energy is $U_n = n U_0$.
Since the $n$-replica system is in the thermodynamic limit, it is true that $S_n=S_n(U_n)$. The $n$ replicas are independent of each other, therefore $S_0=S_0(U_0)$, thus the entropy should be a function of the internal energy even for small systems, regardless of the type of the reservoir (i.e. type of the ensemble). What I fail to see is, how to prove this in an exact manner. Starting from the expression of entropy $S_G=-k\sum_i P_i \ln P_i$ and internal energy $U = \sum_i P_i E_i$ one should be able to reach to an expression $S_G=S_G(U)$, without assuming anything about the narrowness of the density of states.
Edit: I think I was wrong about the fact that any small system can be thought of as being in the thermodynamic limit considering many replicas of the system. This seems to be true for systems composed of non-interacting particles, however, for systems of interacting particles boundary effects are important. At infinitely large systems boundary effects are negligible, but with an infinite number of small systems, they are generally not. Then the energy is not simply the system energy + reservoir energy because interactions with the reservoir are not negligible.