-
Notifications
You must be signed in to change notification settings - Fork 336
three fix of elf file creation #1312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1544,6 +1544,10 @@ static void kpatch_replace_sections_syms(struct kpatch_elf *kelf) | |
|
|
||
| target_off = rela_target_offset(kelf, relasec, rela); | ||
|
|
||
| if (target_off >= (long)rela->sym->sec->sh.sh_size) | ||
| continue; | ||
|
|
||
| found = false; | ||
| /* | ||
| * Attempt to replace references to unbundled sections | ||
| * with their symbols. | ||
|
|
@@ -1558,9 +1562,9 @@ static void kpatch_replace_sections_syms(struct kpatch_elf *kelf) | |
| start = sym->sym.st_value; | ||
| end = sym->sym.st_value + sym->sym.st_size; | ||
|
|
||
| if (is_text_section(relasec->base) && | ||
| if (rela->type == R_X86_64_32S && | ||
| is_text_section(relasec->base) && | ||
| !is_text_section(sym->sec) && | ||
| rela->type == R_X86_64_32S && | ||
| rela->addend == (long)sym->sec->sh.sh_size && | ||
| end == (long)sym->sec->sh.sh_size) { | ||
|
|
||
|
|
@@ -2705,8 +2709,9 @@ static void kpatch_include_debug_sections(struct kpatch_elf *kelf) | |
| if (!is_rela_section(sec) || !is_debug_section(sec)) | ||
| continue; | ||
| list_for_each_entry_safe(rela, saferela, &sec->relas, list) | ||
| if (!rela->sym->sec->include) | ||
| if (!rela->sym->include || !rela->sym->sec->include) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, why haven't we seen this problem on x86?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I checked the compiled c file fs/aio.c of x86_64.It reference to __dyndbg using the __dyndbg + offset,it did not use the symbols in the __dyndbg section ,so it has no problem. |
||
| list_del(&rela->list); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this a separate commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK