Trac Trac #15338 is yet another example where -Bsymbolic breaks
semantics of a C program: global variable duplication happens
and unsafePerformIO creates two stdout copies.
When -Bsymbolic is not used both C compiler and linker agree
on how global variables are handled. In case of sh4 it consists
on a few assertions:
- global variable is exported from shared library
- code is referred to this variable via GOT-like mechanism to allow interposition
- global variable is present .bss section on an executable (as an R_*_COPY relocation: symbol contents is copied at executable startup time)
- and symbol in executable interposes symbol in shared library.
This way both code in shared library and code in executable refer
to a copy of global variable in .bss section of an executable.
Unfortunately -Bsymbolic option breaks assumption [2.] and generates
direct references to the symbol. This causes mismatch between
values seen from executable and values seen from shared library code.
This change disables '-Bsymbolic' for unregisterised targets.
Signed-off-by: Sergei Trofimovich <email@example.com>