Hi Srikanth,
> ld --gc-sections *.o
Don't do that.
Try this instead: gcc -Wl,--gc-sections *.o
Also note: --gc-sections doesn't work in some environments. (Hmmm, I was under the vague impression that the gc facility was disabled entirely. But don't quote me on that.)
HTH, --Eljay