HomePhabricator

ObjectFileELF: Add support for arbitrarily named code sections

Authored by labath on Apr 30 2018, 6:23 AM.

Description

ObjectFileELF: Add support for arbitrarily named code sections

ObjectFileELF assumes that code section has ".text" name. There is an
exception for kalimba toolchain that can use arbitrary names, but other
toolchains also could use arbitrary names for code sections. For
example, corert uses separate section for compiled managed code. As lldb
doesn't recognize such section it leads to problem with breakpoints on
arm, because debugger cannot determine instruction set (arm/thumb) and
uses incorrect breakpoint opcode that breaks program execution.

This change allows debugger to correctly handle such code sections. We
assume that section is a code section if it has SHF_EXECINSTR flag set
and has SHT_PROGBITS type.

Patch by Konstantin Baladurin <k.baladurin@partner.samsung.com>.
Differential Revision: https://reviews.llvm.org/D44998

llvm-svn: 331173

Details

Committed
labathApr 30 2018, 6:23 AM
Differential Revision
D44998: ObjectFileELF: Add support for arbitrarily named code sections
Parents
rG410c5acf2716: Fixup r331049 (FileSpec auto-normalization)
Branches
Unknown
Tags
Unknown