The BFD linker adds the symbol versioning string to the symbol name in symtab.
Skip the versioning part in order to find the registered PLT function.
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Paths
| Differential D122039
[BOLT] Fix plt relocations symbol match ClosedPublic Authored by yota9 on Mar 18 2022, 1:57 PM.
Details
Summary The BFD linker adds the symbol versioning string to the symbol name in symtab. Vladislav Khmelevsky,
Diff Detail
Event TimelineComment Actions Can you please follow the example of compiler-rt to check that bfd is available on the test system and only enable the new test if it is?
Comment Actions Summary: s/linkeradds/linker adds/ and s/symbtab/symtab/
Comment Actions @yota9, regarding the tests - will we be able to detect the change in behavior on non-aarch64 (x86) platform? I.e. will any of the tests fail without the fix? Comment Actions @maksfb I see your point. From the one hand we have a fix. From the other hand the tests are common for x86 and aarch64, i.e. it doesn't check the fix, it checks the overall possibility to work with PLT properly. Ideally we should have aarch64 machine available for testing, we've got this task in the backlog and Elvina should start investigation on aarch64 buildbot soon. As for now I would like these runtime tests to exist, but I will add one more non-runtime aarch64-specific test (that is using BOLT asm dump) so we will be able to check it on non-arm platform Comment Actions @yota9, sorry, AArch64/plt_gnu_ld.test wouldn't build on x86. Could you use YAML and yaml2obj for the test? Comment Actions
Done :) Comment Actions @maksfb I don't see the reason, everything works for me. Do you use this patch with your aarch64 tests changes? The nostdlib flag should be passed from your patch, I don't see any other problem to run the test on x86. Comment Actions @maksfb You were right, after rebase on your patch I've got the problems too. This revision is now accepted and ready to land.Apr 4 2022, 11:38 PM Closed by commit rG4956e0e19763: [BOLT] Fix plt relocations symbol match (authored by yota9). · Explain WhyApr 5 2022, 6:01 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 419824 bolt/CMakeLists.txt
bolt/include/bolt/Core/BinaryContext.h
bolt/lib/Rewrite/RewriteInstance.cpp
bolt/test/AArch64/Inputs/plt-gnu-ld.yaml
bolt/test/AArch64/plt-gnu-ld.test
bolt/test/AArch64/plt-lld.test
bolt/test/Inputs/plt.c
bolt/test/lit.cfg.py
bolt/test/lit.site.cfg.py.in
bolt/test/runtime/AArch64/plt.c
bolt/test/runtime/iplt.c
bolt/test/runtime/plt-gnu-ld.test
bolt/test/runtime/plt-lld.test
|
nit: could you use PLT (all caps) in function names to be consistent with the rest of the code in BOLT?