BOLT expects PC-relative relocations in data sections to reference code
and the relocated data to form a jump table. However, there are cases
where PC-relative addressing is used for data-to-data references
(e.g. clang-15 can generate such code). BOLT should recognize and ignore
such relocations. Otherwise, they will be considered relocations not
claimed by any jump table and cause a failure in the strict mode.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LG. Just to make sure: the primary change is the extra condition to call addPCRelativeDataRelocation (from !IsFromCode to !IsFromCode && IsToCode), right?
Comment Actions
Correct. Before we registered any PC-relative relocations from data, but we are really interested only in data-to-code variants.