[BOLT] Properly set _end symbol
authorMaksim Panchenko <maks@fb.com>
Mon, 3 Oct 2022 23:01:01 +0000 (16:01 -0700)
committerMaksim Panchenko <maks@fb.com>
Fri, 7 Oct 2022 18:19:14 +0000 (11:19 -0700)
commitc683e281cdc99b04497d5102c28be0d2e991c9f6
tree0690c2be5bfbbaf3964a451a163e0deea2240f72
parent3e097fab5a557a573c8982d1bbb48ddde4f02ac4
[BOLT] Properly set _end symbol

To properly set the "_end" symbol, we need to track the last allocatable
address. Simply emitting "_end" at the end of some section is not
sufficient since the order of section allocation is unknown during the
emission step.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D135121
bolt/lib/Core/BinaryEmitter.cpp
bolt/lib/Rewrite/RewriteInstance.cpp
bolt/test/X86/end-symbol.test [new file with mode: 0644]