aboutsummaryrefslogtreecommitdiff
path: root/bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp
diff options
context:
space:
mode:
authorMaksim Panchenko <maks@fb.com>2022-09-15 13:31:52 -0700
committerMaksim Panchenko <maks@fb.com>2022-09-16 13:38:32 -0700
commit9742c25b9894d4805e05369c50cc8e0562a3cb92 (patch)
tree0d75ada1c6854cb9677812f43f37f2fede02ed8f /bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp
parent1076b31da8da8854e1dfca8f1a9a03de9fd4f8f5 (diff)
downloadllvm-9742c25b9894d4805e05369c50cc8e0562a3cb92.zip
llvm-9742c25b9894d4805e05369c50cc8e0562a3cb92.tar.gz
llvm-9742c25b9894d4805e05369c50cc8e0562a3cb92.tar.bz2
[BOLT] Fix empty function emission in non-relocation mode
In non-relocation mode, every function is emitted in its own section. If a function is empty, RuntimeDyld will still allocate 1-byte section for the function and initialize it with zero. As a result, we will overwrite the first byte of the original function contents with zero. Such scenario can happen when the input function had only NOP instructions which BOLT removes by default. Even though such functions likely cause undefined behavior, it's better to preserve their contents. Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D133978
Diffstat (limited to 'bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp')
0 files changed, 0 insertions, 0 deletions