It seems uninitialized global variable is treated as weak symbol in Gcc. What is the reason behind this?
Any multiple definition of a global symbol is undefined behavior, so gcc (or rather the GNU binutils linker) is free to do whatever it wants. In practice, it follows the traditional behavior to avoid breaking code that relies on this behavior.