In some older Loongson3 processors there is a LL/SC errata that can cause the CPU to deadlock occasionally. The details are very complicated. We find a way to work around this errata by a) adding a sync before ll/lld instruction, b) adding a sync before branch target that between ll and sc. The assembler do the jobs 'a', gcc do the jobs 'b'. This patch also add a configure options --with-mips-fix-loongson3-llsc=[yes|no] to enable fix-loongson3-llsc by config.