HomePhabricator

Stack unwinding emulation: handle adjustment of FP

Authored by tberghammer on Feb 19 2016, 2:59 AM.

Description

Stack unwinding emulation: handle adjustment of FP

This change is improving the instruction emulation based unwinding to
handle when the frame pointer is adjusted (increment/decrement) after
it has been initialized. The situation can occur in the prologue of
some function where FP is adjusted before it is copied back to SP.

Example code (thumb, generated by gcc 4.8):
< +0>: push {r4, r7, lr}
< +2>: sub sp, #0x14
< +4>: add r7, sp, #0x0
...
<+50>: adds r7, #0x14 ; The CL fixes the handling of this instruction
<+52>: mov sp, r7 ; Previously unwinding from here was broken
<+54>: pop {r4, r7, pc}

Differential revision: http://reviews.llvm.org/D17295

llvm-svn: 261318

Details

Committed
tberghammerFeb 19 2016, 2:59 AM
Differential Revision
D17295: Stack unwinding emulation: handle adjustment of FP
Parents
rGf23b23200d70: [ELF] - Minor refactor of LinkerScript file
Branches
Unknown
Tags
Unknown