Over fifty years ago I was very much into hunting bear and boar. I had a large number of dogs that I bred, trained and sold as bear and boar dogs. Believe it or not, I never gave much thought to which gun would do the better job at that time. I had both a 9mm (a Luger) and a 1911 in .45acp. I used fmj as there were no hollow points in those days. I usually, but not always, scored one shot kills - but since the dogs were always holding the bear or boar's attention, I was able to take head shots almost exclusively. However, I must add that a prospective dog buyer wanted to dispatch a bear on one occasion and emptied the Luger's magazine to no apparent effect other than further irritating an already furious bear.
On another occasion using the .45, a very large boar that the dogs had brought to bay charged the dogs just as I pulled the trigger. Instead of hitting the brain, my shot hit the hog in the heavily muscled neck. Through good luck the bullet clipped the lower side of the vertebra and dropped the boar in mid charge. Interestingly, the .45 penetrated both sides of the neck very cleanly.
In my country we have patches, sometimes covering several acres, that we call laurel hells. These hells are absolutely inpenetrable by man. The hogs are very fond of these dense laurel thickets and will have areas inside the hells where they have rooted out the laurel and made themselves sanctuaries. The hogs have made game trails through out the thickets that are almost like narrow underground tunnels. Light barely penetrates. The only way to go through these trails is to low crawl. But there isn't enough room to crawl with rifle in hand. It is necessary to tie a strap to the butt stock and drag the rifle behind you.
Smart people stay out of these hells. A friend of mine wasn't smart, and he spooked a boar that was young enough not to have fully developed his capacity for sheer meaness. The pig charged, not so much to attack as to escape, and ran over my pal who was already prone. He was cut up rather badly from head to heel. He thereafter purchased a Ruger .44 magnum which had just been introduced. His was the first one I ever saw. He figured that he could crawl with the Ruger in hand. A more rational soul would just have resolved to stay the hell out of the hells.
So if you have the luxury of being able to take a head shot, either a 9mm or a .45 will do. If you intend to crawl through thickets that the bear or boar calls home, get all the gun you can stand, and even then, shot placement matters...a lot.