This is an archive of the discontinued LLVM Phabricator instance.

Use 32-bit ebp for NaCl64 in a limited case: llvm.frameaddress.
ClosedPublic

Authored by jvoung on Dec 3 2014, 3:35 PM.

Details

Summary

Follow up to [x32] "Use ebp/esp as frame and stack pointer":
http://reviews.llvm.org/D4617

In that earlier patch, NaCl64 was made to always use rbp.
That's needed for most cases because rbp should hold a full
64-bit address within the NaCl sandbox so that load/stores
off of rbp don't require sandbox adjustment (zeroing the top
32-bits, then filling those by adding r15).

However, llvm.frameaddress returns a pointer and pointers
are 32-bit for NaCl64. In this case, use ebp instead, which
will make the register copy type check. A similar mechanism
may be needed for llvm.eh.return, but is not added in this change.

Diff Detail

Event Timeline

jvoung updated this revision to Diff 16893.Dec 3 2014, 3:35 PM
jvoung retitled this revision from to Use 32-bit ebp for NaCl64 in a limited case: llvm.frameaddress..
jvoung updated this object.
jvoung edited the test plan for this revision. (Show Details)
jvoung added reviewers: dschuff, nadav.
jvoung added a subscriber: Unknown Object (MLST).
dschuff accepted this revision.Dec 4 2014, 10:21 AM
dschuff edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 4 2014, 10:21 AM
jvoung closed this revision.Dec 5 2014, 12:56 PM
jvoung updated this revision to Diff 16993.

Closed by commit rL223510 (authored by @jvoung).