[PATCH] D143085: [BOLT] Search section based on relocation symbol
Vladislav Khmelevsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 1 08:28:14 PST 2023
yota9 created this revision.
yota9 added reviewers: maksfb, rafauler, Amir.
Herald added subscribers: treapster, ayermolo.
Herald added a project: All.
yota9 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
We need to search referenced section based on relocations symbol section
to properly match end section symbols. For example on some binaries we
can observe that init_array_end/fini_array_end might be "placed" in to
the gap and since no section could be found for address the relocation
would be skipped resulting in wrong ADRP imm after emitting new text
resulting in binary sigsegv.
Credits for the fix to Alexey Moksyakov aka yavtuk.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D143085
Files:
bolt/lib/Rewrite/RewriteInstance.cpp
bolt/test/AArch64/Inputs/array_end.ld_script
bolt/test/AArch64/array_end.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143085.493965.patch
Type: text/x-patch
Size: 11426 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230201/50e58307/attachment-0001.bin>
More information about the llvm-commits
mailing list