cmd/ld: fix bad merge CL 7504044 accidentally reverted part of CL 7891044 and 7552045, this CL bring those part back.
cmd/ld: fix bad merge
CL 7504044 accidentally reverted part of CL 7891044 and 7552045, this CL
bring those part back.

R=golang-dev
TBR=rsc
CC=golang-dev
https://codereview.appspot.com/7950045
abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go