summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2019-02-19 10:36:58 +0000
committerSimon Atanasyan <simon@atanasyan.com>2019-02-19 10:36:58 +0000
commitfae2a509fa5a103c6d1d87aeaa1c8a4decea2936 (patch)
tree7d64ab1c39dfc58f049a3e3afdaa87c9bab47c89 /lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
parent19dbc6245fd922ee6d1b1eaa8d9c589d97610eb6 (diff)
downloadbcm5719-llvm-fae2a509fa5a103c6d1d87aeaa1c8a4decea2936.tar.gz
bcm5719-llvm-fae2a509fa5a103c6d1d87aeaa1c8a4decea2936.zip
[MIPS] Handle cross-mode (regular <-> microMIPS) jumps
The patch solves two tasks: 1. MIPS ABI allows to mix regular and microMIPS code and perform cross-mode jumps. Linker needs to detect such cases and replace jump/branch instructions by their cross-mode equivalents. 2. Other tools like dunamic linkers need to recognize cases when dynamic table entries, e_entry field of an ELF header etc point to microMIPS symbol. Linker should provide such information. The first task is implemented in the `MIPS<ELFT>::relocateOne()` method. New routine `fixupCrossModeJump` detects ISA mode change, checks and replaces an instruction. The main problem is how to recognize that relocation target is microMIPS symbol. For absolute and section symbols compiler or assembler set the less-significant bit of the symbol's value or sum of the symbol's value and addend. And this bit signals to linker about microMIPS code. For global symbols compiler cannot do the same trick because other tools like, for example, disassembler wants to know an actual position of the symbol. So compiler sets STO_MIPS_MICROMIPS flag in the `st_other` field. In `MIPS<ELFT>::relocateOne()` method we have a symbol's value only and cannot access any symbol's attributes. To pass type of the symbol (regular/microMIPS) to that routine as well as other places where we write a symbol value as-is (.dynamic section, `Elf_Ehdr::e_entry` field etc) we set when necessary a less-significant bit in the `getSymVA` function. Differential revision: https://reviews.llvm.org/D40147 llvm-svn: 354311
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud