It's not the size of the object that turns it into a gas giant, it's the density. It is quite possible that an immense, rocky planet can form AND have a similar gravitational field as Earth's. And like Magnemoe said, Mercury has a higher density compared to Earth's, and it could easily be the other way around for other planets.