https://sourceware.org/bugzilla/show_bug.cgi?id=23969
Bug ID: 23969 Summary: PowerPC64 ELFv1 --defsym func1=func2 call to func1 errors Product: binutils Version: 2.32 (HEAD) Status: NEW Severity: normal Priority: P2 Component: gold Assignee: ccoutant at gmail dot com Reporter: amodra at gmail dot com CC: ian at airs dot com Target Milestone: --- 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.) -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils