summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2015-10-12 23:16:53 +0000
committerHal Finkel <hfinkel@anl.gov>2015-10-12 23:16:53 +0000
commitdaedc1217297315437a4e26e236e7c2069156f51 (patch)
tree9c50cc2042006676061a8cc28efdca2ba3f0bf5c /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
parentaa0ec7f45ce4b15097f20f0c5c3ead4448a7db3d (diff)
downloadbcm5719-llvm-daedc1217297315437a4e26e236e7c2069156f51.tar.gz
bcm5719-llvm-daedc1217297315437a4e26e236e7c2069156f51.zip
[ELF2/PPC64] Resolve local-call relocations using the correct function-descriptor values
Under PPC64 ELF v1 ABI, the symbols associated with each function name don't point directly to the code in the .text section (or similar), but rather to a function descriptor structure in a special data section named .opd. The elements in the .opd structure include a pointer to the actual code, and a the relevant TOC base value. Both of these are themselves set by relocations. When we have a local call, we need the relevant relocation to refer directly to the target code, not to the function-descriptor in the .opd section. Only when we have a .plt stub do we care about the address of the .opd function descriptor itself. So we make a few changes here: 1. Always write .opd first, so that its relocated data values are available for later use when writing the text sections. Record a pointer to the .opd structure, and its corresponding buffer. 2. When processing a relative branch relocation under ppc64, if the destination points into the .opd section, read the code pointer out of the function descriptor structure and use that instead. This this, I can link, and run, a dynamically-compiled "hello world" application on big-Endian PPC64/Linux (ELF v1 ABI) using lld. llvm-svn: 250122
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud