As I said before, I have read the animal companion rules several times. I already know that bonus HD granted from being a companion does not count towards increasing an animals size. What I did was increase the eagle's size before I befriended it (I'm a player and a DM in a rotation of 3 DMs). It was during my internet surfing that I discovered that the prospective companion cannot be an advanced animal when you acquire it.
Then the obvious answer is to have the animal leave the Ranger/Druid's companionship. I don't buy the argument, "If it doesn't break the game, then allow it." Why? Because it's virtually impossible to "break" a game where the DM can adjust to just about anything. My attitude is that unless there is a compelling reason to change something e.g. The no dex penalty being totally inconsistent with itself, then we tend to leave the rules as is.