[BOLT][AArch64] Handle data at the beginning of a function when disassembling and...
authorDenis Revunov <revunov.denis@huawei-partners.com>
Wed, 8 Jun 2022 22:08:31 +0000 (15:08 -0700)
committerRafael Auler <rafaelauler@fb.com>
Thu, 9 Jun 2022 22:26:32 +0000 (15:26 -0700)
commit0b7e8baf83befdb9cd7c282d943492581f2dd17c
tree93690457aa33e3de5fd8e0236402aa9f736b5d7d
parent7bdd3722f20c68ce14d153939bd8aa11d1c0d482
[BOLT][AArch64] Handle data at the beginning of a function when disassembling and building CFG.

This patch adds getFirstInstructionOffset method for BinaryFunction
which is used to properly handle cases where data is at zero offset in
a function. The main change is that we add basic block at first
instruction offset when disassembling, which prevents assertion
failures in buildCFG.

Reviewed By: yota9, rafauler

Differential Revision: https://reviews.llvm.org/D127111
bolt/include/bolt/Core/BinaryFunction.h
bolt/lib/Core/BinaryFunction.cpp
bolt/lib/Core/Exceptions.cpp
bolt/test/AArch64/data-at-0-offset.c [new file with mode: 0644]