Skip to content

create-diff-object: include __ftr_alt_* when regenerating __ftr_fixup - #1523

Open
joe-lawrence wants to merge 1 commit into
dynup:masterfrom
joe-lawrence:kpatch-1522
Open

create-diff-object: include __ftr_alt_* when regenerating __ftr_fixup#1523
joe-lawrence wants to merge 1 commit into
dynup:masterfrom
joe-lawrence:kpatch-1522

Conversation

@joe-lawrence

Copy link
Copy Markdown
Contributor

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")

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>
@joe-lawrence

Copy link
Copy Markdown
Contributor Author

@jpoimboe : could you give a sanity check on this ppc64le fix? This currently affects rhel-10 ppc64le kpatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant