Fix addend handling and other cleanups for s390#1269
Merged
jpoimboe merged 17 commits intodynup:masterfrom May 19, 2022
Merged
Conversation
With '--debug', most of the xtrace output shows the reading of the .config and Module.symvers files, which isn't very useful and floods the rest of the xtrace output. Temporarily disable xtrace before reading the files. Signed-off-by: Josh Poimboeuf <[email protected]>
These functions are only called locally, convert them to static. Signed-off-by: Josh Poimboeuf <[email protected]>
Several functions expect to take a ".rela" section as an argument. Make such cases more clear by renaming "sec" -> "relasec". Signed-off-by: Josh Poimboeuf <[email protected]>
Several functions have a boolean semantic, but don't actually return bool, which is confusing. Fix that. Signed-off-by: Josh Poimboeuf <[email protected]>
It doesn't make sense to disassemble a data section. That just happened to work by accident. PC-relative offsets only need adjusting when associated with an instruction. Signed-off-by: Josh Poimboeuf <[email protected]>
…syms() Add support for R_X86_64_NONE. With an upstream kernel, it's quite rare, only used for a few jump labels. With older kernels it was used for fentry hooks. Either way, it should be treated like a PC-relative relocation. Signed-off-by: Josh Poimboeuf <[email protected]>
Error out if an unsupported rela is encountered. This is more robust than just ignoring it. Signed-off-by: Josh Poimboeuf <[email protected]>
rela_insn() only cares about the base section. Convert it to take a non-rela section as its argument instead of a relasec. Signed-off-by: Josh Poimboeuf <[email protected]>
Error out if the insn can't be found. Signed-off-by: Josh Poimboeuf <[email protected]>
Split out the addend offset math into a separate function so it can be used elsewhere. Signed-off-by: Josh Poimboeuf <[email protected]>
This issue was only seen in in a text section. Explicitly check for that. Signed-off-by: Josh Poimboeuf <[email protected]>
Empty (zero-length) symbols are possible, allow kpatch_replace_sections_syms() to work on them. Signed-off-by: Josh Poimboeuf <[email protected]>
…bols These sections don't have symbols. Don't even try to replace references to them with symbols. Signed-off-by: Josh Poimboeuf <[email protected]>
Contributor
|
Hi @jpoimboe , Check out the internal automated integration test failure emails, there are various complaints like these: |
Member
Author
|
Going to squash in this change to fix the integration failures: |
If a section reference can't be converted to a symbol reference, error out to try to prevent unexpected behavior later on. There are a few sections for which a symbol is optional: .rodata and string literal sections. Don't warn about those. Signed-off-by: Josh Poimboeuf <[email protected]>
The current string extraction is broken for non-section symbols. Fix that. Signed-off-by: Josh Poimboeuf <[email protected]>
Use rela_target_offset() to make the relocation bounds checking more precise. Signed-off-by: Josh Poimboeuf <[email protected]>
Otherwise it fails the unit tests on an s390 host. Signed-off-by: Josh Poimboeuf <[email protected]>
Member
Author
|
v2:
|
joe-lawrence
approved these changes
May 18, 2022
Merged
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.
Several improvements for issues discovered in the review for #1203 .Mostly related to addend handling, but also some other cleanups and an endianness fix.