Running the gold testsuite plugin_test_defsym results in a segfault, due to the call to "bar" branching to the opd entry for "foo". This isn't something specific to the plugin, just compiling the testcase with
powerpc64-linux-gcc -Bgcctestdir/ -g -O2 -o test_defsym -Wl,--defsym,bar=foo ~/src/binutils-gdb/gold/testsuite/plugin_test_defsym.c
results in a test_defsym binary with the error.
The problem is caused by gold defining --defsym symbols as constants. Target_powerpc::symval_for_branch fails to detect such function symbols as being defined in a .opd section (only FROM_OBJECT symbols are supported), and therefore does not look up the code entry point in the function descriptor during relocation. Even worse, --defsym symbols have value zero at the time Target::relax is called, so calls to symval_for_branch at that point cannot look up descriptors even if some other mechanism was devised for detecting symbols within .opd sections. (Target::relax is where powerpc64 adds stubs for long branches and plt calls.)