facebookarchive / BOLT

Binary Optimization and Layout Tool - A linux command-line utility used for optimizing performance of binaries
2.51k stars 176 forks source link

Handle relocations in constant islands #221

Closed yota9 closed 2 years ago

yota9 commented 2 years ago

In non-PIC binaries compiler could save absolute addresses in constant isalnd which we should handle properly. This patch adds relocations handling in constant islands (for AArch64).

Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei

rafaelauler commented 2 years ago

Thanks for fixing this!

yota9 commented 2 years ago

@rafaelauler Thank you for reviewing this! I've updated the tests a bit. Currently I'm testing the ARM tests on X86 using cross-compiler (just a bit later I will have ARM CI and it won't be a problem anymore), it turned out the the llvm-mc doesn't know about dword directive, so I've changed it to xword. Sorry for that.