Please check before submitting an issue | 在提交 Issue 前请检查
Version requirements | 版本要求
Bug description | 描述 Bug
I worked with an AI and it gave me this output here.
Summary
kptools -p fails at analyze_kallsym_info. Relocation entry application is
aborted by a bounds check, and every subsequent kallsyms lookup fails as a
result.
Device / build
|
|
| Device |
jackpotlte (Samsung Galaxy A8 2018, SM-A530F) |
| SoC |
Exynos 7885 |
| ROM |
XROM V161 (Android 16 base) |
| Kernel |
4.4.302-p6-Eureka_R25U |
| Toolchain |
Neutron clang 18.0.0git |
| Build date |
Wed Jun 17 06:27:23 KST 2026 |
Note: this kernel has a non-standard arm64 header (magic at 0x30). A second
magic was written into the unused NOP slot at 0x38 so kptools could get past
header validation. The failure below happens after that.
Full output
+ ./kptools -p -i kernel.ori -S su -k kpimg -o kernel
[-] tools/patch.c:634/patch_update_img(); analyze_kallsym_info error
[+] kernel image_size: 0x016b7350
[+] kernel uefi header: false
[+] kernel load_offset: 0x00080000
[+] kernel kernel_size: 0x01d12000
[+] kernel page_shift: 12
[+] new kernel image ...
[+] is_gki: false
[+] linux_banner 1: Linux version 4.4.302-p6-Eureka_R25U (Furina@Love) (Neutron clang version 18.0.0git ) #1 SMP PREEMPT Wed Jun 17 06:27:23 KST 2026
[+] linux_banner offset: 0xf178bd
[+] kernel version major: 4, minor: 4, patch: 255
[+] kallsyms_token_table offset: 0x00d95ec8
[+] endian: little
[+] kallsyms_token_index offset: 0x00d96210
[+] arm64 relocation kernel_va: 0xffffff8010000000
[+] arm64 relocation table range: [0x0122f3e0, 0x015554f8), count: 0x00021961
[?] bad rela offset: 0xffffff80116b93f0
[?] find kallsyms_markers error
[+] kallsyms_markers range: [0x00d95bd8, 0x00d95ec4), count: 0x000000ba
[+] try kallsyms_offsets first for 64-bit relative-base kernel
[?] find approximate kallsyms_offsets error
[-] tools/kallsym.c:375/find_approx_addresses(); find approximate kallsyms_addresses error
[+] kallsyms_markers range: [0x00d95bd8, 0x00d95ec4), count: 0x000000ba
[+] try kallsyms_offsets first for 64-bit relative-base kernel
[?] find approximate kallsyms_offsets error
[-] tools/kallsym.c:375/find_approx_addresses(); find approximate kallsyms_addresses error
+ patch_rc=1
Analysis
The offending relocation target is 0xffffff80116b93f0. Against the reported
relocation base kernel_va = 0xffffff8010000000 this is file offset
0x016b93f0. Reported image_size is 0x016b7350, so the target sits 0x20A0
bytes past the end of the parsed image, and the bounds check rejects it.
The header's image_size field at 0x10 is 0x01D12000, which is the in-memory
size including BSS. If the check compares against the on-disk size rather than
the in-memory size, relocation targets that legitimately land in BSS would be
rejected. That would explain why the apply <N> relocation entries line, present
in working runs, never appears here. Relocations are never applied, so the
kallsyms walk operates on unrelocated data and every lookup after
kallsyms_token_index fails.
Possibly related
All are clang-built relocatable kernels failing in find_approx_addresses.
Reproduce method | 复现方法
- Click Install
- Select a boot image to patch
- Pointing to the kernel image (boot.img fails from the start, then used a patched version of boot image, which is boot-kfix.img boot-kfix.txt)
- Patching fails while giving an output.
Expected behavior | 预期行为
I expected to get a patched version of kernel image.
Actual behavior | 实际行为
Failure with the mentioned output.
Screenshots | 截图
No response
Logs | 日志
No response
Device name | 设备名称
jackpotlte (Samsung Galaxy A8 2018, SM-A530F)
OS version | 系统版本
16
APatch version | FolkPatch 版本
5.0 (115003)
Kernel version | 内核版本
4.4.302-p6-Eureka_R25U
KernelPatch version | KernelPatch 版本
0.13.3
Other information | 其他信息
FolkPatch_bugreport_2026-07-31_21_21.tar.gz
Original kernel file: kernel.txt
Kallsyms info: kallsyms.txt
zcat /proc/config.gz | grep KALLSYMS
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
Please check before submitting an issue | 在提交 Issue 前请检查
Version requirements | 版本要求
Bug description | 描述 Bug
I worked with an AI and it gave me this output here.
Summary
kptools -pfails atanalyze_kallsym_info. Relocation entry application isaborted by a bounds check, and every subsequent kallsyms lookup fails as a
result.
Device / build
4.4.302-p6-Eureka_R25UNote: this kernel has a non-standard arm64 header (magic at
0x30). A secondmagic was written into the unused NOP slot at
0x38sokptoolscould get pastheader validation. The failure below happens after that.
Full output
Analysis
The offending relocation target is
0xffffff80116b93f0. Against the reportedrelocation base
kernel_va = 0xffffff8010000000this is file offset0x016b93f0. Reportedimage_sizeis0x016b7350, so the target sits0x20A0bytes past the end of the parsed image, and the bounds check rejects it.
The header's
image_sizefield at0x10is0x01D12000, which is the in-memorysize including BSS. If the check compares against the on-disk size rather than
the in-memory size, relocation targets that legitimately land in BSS would be
rejected. That would explain why the
apply <N> relocation entriesline, presentin working runs, never appears here. Relocations are never applied, so the
kallsyms walk operates on unrelocated data and every lookup after
kallsyms_token_indexfails.Possibly related
All are clang-built relocatable kernels failing in
find_approx_addresses.Reproduce method | 复现方法
Expected behavior | 预期行为
I expected to get a patched version of kernel image.
Actual behavior | 实际行为
Failure with the mentioned output.
Screenshots | 截图
No response
Logs | 日志
No response
Device name | 设备名称
jackpotlte (Samsung Galaxy A8 2018, SM-A530F)
OS version | 系统版本
16
APatch version | FolkPatch 版本
5.0 (115003)
Kernel version | 内核版本
4.4.302-p6-Eureka_R25U
KernelPatch version | KernelPatch 版本
0.13.3
Other information | 其他信息
FolkPatch_bugreport_2026-07-31_21_21.tar.gz
Original kernel file: kernel.txt
Kallsyms info: kallsyms.txt
zcat /proc/config.gz | grep KALLSYMSCONFIG_KALLSYMS=y# CONFIG_KALLSYMS_ALL is not set