I have never understood why some companies treat talking to other employees about salaries as a firing offense. Seriously? Do they really have that little faith in their employees?
I’ve run a number of companies, and we always treated everyone’s salary as public information (at least internally), so everyone understood everyone’s compensation. It always worked out best that way.