cmd/ld: fix operator precedence
cmd/ld: fix operator precedence

Fixes issue 8480.

This CL reapplies CL 114420043. This attempt doesn't blow up when encountering hidden symbols.

LGTM=minux
R=minux
CC=golang-codereviews
https://codereview.appspot.com/128310043

wesolows/golang,wesolows/golang-old,wesolows/golang,firebitsbr/golang-old,firebitsbr/golang-old,firebitsbr/golang-old,wesolows/golang,wesolows/golang,wesolows/golang-old,wesolows/golang-old,firebitsbr/golang-old,firebitsbr/golang-old,wesolows/golang,firebitsbr/golang-old,firebitsbr/golang-old,wesolows/golang,firebitsbr/golang-old,wesolows/golang-old,wesolows/golang-old,wesolows/golang-old,wesolows/golang-old,wesolows/golang