create-diff-object: include __ftr_alt_* when regenerating __ftr_fixup - #1523
Open
joe-lawrence wants to merge 1 commit into
Open
create-diff-object: include __ftr_alt_* when regenerating __ftr_fixup#1523joe-lawrence wants to merge 1 commit into
joe-lawrence wants to merge 1 commit into
Conversation
When a changed ppc64le function is referenced by a kept __ftr_fixup group, create-diff-object must also include the corresponding __ftr_alt_* section data. kpatch_regenerate_special_section() currently only sets rela->sym->include = 1, which does not migrate STT_SECTION companions and leaves UND relocs in .rela__ftr_fixup: ld: final link failed: bad value Call kpatch_include_symbol() instead, matching the similar .altinstr_replacement fix in 13b0014 ("kpatch-build: ensure that .altinstr_replacement section is included"). Also exempt __ftr_fixup -> __ftr_alt_* relocations from the out-of-range relocation check. Those addends are linker inputs for fixup-entry offsets, not pointers into the alt section. Closes: 1522 ("ppc64le __ftr_fixup / __ftr_alt_97 sections causing bad final link") Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Contributor
Author
|
@jpoimboe : could you give a sanity check on this ppc64le fix? This currently affects rhel-10 ppc64le kpatch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a changed ppc64le function is referenced by a kept __ftr_fixup group, create-diff-object must also include the corresponding _ftr_alt* section data. kpatch_regenerate_special_section() currently only sets rela->sym->include = 1, which does not migrate STT_SECTION companions and leaves UND relocs in .rela__ftr_fixup:
ld: final link failed: bad value
Call kpatch_include_symbol() instead, matching the similar .altinstr_replacement fix in 13b0014 ("kpatch-build: ensure that .altinstr_replacement section is included").
Also exempt __ftr_fixup -> _ftr_alt* relocations from the out-of-range relocation check. Those addends are linker inputs for fixup-entry offsets, not pointers into the alt section.
Closes: 1522 ("ppc64le __ftr_fixup / __ftr_alt_97 sections causing bad final link")