I have a gate mounted to a 6x8 post where the center has rotted out of the post. I am looking to fill the center of the post, rather then replace it if I could. The post itself is still solid, just hollow so the mount bolt have nothing to connect to anymore. I am thinking to try the expanding post foam inside the post, but have not worked with it and I have no reference if it would be stong enough to hold a bolt.
Get longer bolts, go all the way through the post, then a metal plate on the other side. The plate is to distribute the pulling pressure. This is what is done with eg. brick walls.
This is a good idea in general; gate hardware usually attaches by going completely through or around to the back side of the structure. Essentially you do not want the structure to hold the gate hardware with tension, you want the structure to hold the hardware with compression.