[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/23969] New: PowerPC64 ELFv1 --defsym func1=func2 call to func1

From: amodra at gmail dot com
Subject: [Bug gold/23969] New: PowerPC64 ELFv1 --defsym func1=func2 call to func1 errors
Date: Sun, 09 Dec 2018 08:12:24 +0000


            Bug ID: 23969
           Summary: PowerPC64 ELFv1 --defsym func1=func2 call to func1
           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
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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]