Here is how i solved this problem:
- Installed gnu binutils version 2.18 using gcc 3.4.3(available in solaris by default).
- cd gcc_source_dir
- mkdir objdir && cd objdir
- ../configure --with-gnu-as --with-as=/binutils_2_18/bin/as --with-gnu-ld --with-ld=/binutils_2_18/bin/ld --prefix=$PREFIX --enable-threads=posix --enable-checking=release --with-system-zlib --enable-shared --disable-symvers --enable-languages=c,c++
- gmake
- gmake install