TL;DR: KernelSU hook failures on Linux 3.x usually come from missing, renamed or inlined kernel functions. GCC folding is unlikely with GCC 4.9 because its relevant compiler pass arrived in GCC 5. Check the exact source, configuration, symbols and linker flags before changing hooks or flashing a new kernel.

By the PrivacyPortal team
Last updated November 2026
On an old Linux 3.x kernel, a failed KernelSU hook does not prove that GCC merged two functions. The stronger causes are vendor source changes, compiler inlining, disabled features or a mismatched kernel image. Limited kprobe support can also cause kernelsu hook failures. Confirm the running build before editing hook code. Then inspect its symbols and build flags. Linux 3.x is not an officially supported KernelSU target, so any port is a security-sensitive backport. Back up every important file first. Unlocking the bootloader wipes user data. A bad image can also cause a boot loop or leave the phone unable to start.
Why KernelSU hook failures occur on Linux 3.x
KernelSU needs reliable entry points into the kernel. Legacy ports often hook functions involved in process execution, credentials or system calls. Those entry points vary across vendor kernels.
A Linux version alone cannot identify the correct hook. Phone makers routinely modify Android kernels. They may rename a function, mark it static or replace part of its call path. The build configuration can remove code too.
These common causes should be checked first:
- The running boot image does not match the source tree being inspected.
- The required function was renamed or removed by the vendor.
- The compiler inlined the function into its callers.
- A configuration option excluded the relevant code.
- The port expects kprobe features that this kernel lacks.
- The image was stripped, hiding useful symbols from simple checks.
- Link-time optimisation or a separate linker feature changed the layout.
In practice, source mismatch is especially common. Vendors sometimes publish an incomplete tree or the source for a nearby release. A successful build can still differ from the kernel installed on the phone.
Image caption: A hook can disappear at several stages between vendor source code and the final boot image.
GCC folding is often the wrong diagnosis
The phrase kernelsu gcc function folding is often used for several distinct optimisations. That can send debugging in the wrong direction.
GCC’s interprocedural identical code folding pass is controlled by -fipa-icf. It can merge functions or read-only variables when their behaviour is equivalent. However, the pass first appeared in GCC 5. It cannot explain a GCC 4.9 build by itself.
GCC’s -fipa-icf optimisation first appeared in GCC 5, so it is not a valid explanation for a plain GCC 4.9 compilation.
A separate linker may still fold equivalent sections. GNU gold supports identical code folding through options such as --icf. This is a linker action, not GCC 4.9 performing its later IPA pass. Inspect the final link command and build logs before drawing a conclusion.
The official GCC optimisation options documentation explains the compiler passes. For an old Android toolchain, use the documentation matching the actual compiler release.
Inlining looks similar but has a different cause
A function may exist in source but have no standalone symbol in the image. The compiler may have inlined its body into one or more callers. Static functions are especially likely to disappear.
Check the function declaration, optimisation flags and disassembly. Search for its behaviour as well as its name. A missing symbol is evidence about the output, not proof of folding.
How to investigate KernelSU hook failures safely
Use this workflow on your own device before changing any hook or flashing an image.
- Back up user data and app recovery codes. Export anything that cannot be restored from normal Android backup.
- Record the device model, build number, Android version and current kernel string. Run adb shell uname -a and save the result.
- Obtain the exact stock boot image for the installed build. Keep an untouched copy outside the working folder.
- Match the vendor kernel source and configuration to that build. Do not rely on a tree for a similar model or update.
- Record the full compiler and linker versions. Search the build output for -fipa-icf, --icf and link-time optimisation flags.
- Inspect System.map, vmlinux and the disassembly for the intended function. Check its callers when no symbol remains.
- Compare the port’s hook assumptions with the matching source path. Confirm the function signature and enabled configuration options.
- Build one diagnostic change at a time. Preserve the complete log and resulting image hash for each build.
- Use temporary booting only if the device officially supports it. Otherwise follow the device’s documented recovery and flashing process.
- Verify boot, root access and kernel logs. Restore the stock image immediately if errors, crashes or unexplained security changes appear.
Prerequisites and files
You need ADB and Fastboot platform tools, the matching vendor kernel source, its exact configuration and a suitable cross-compiler. Keep the stock boot.img or init_boot.img required by that specific device. They are not interchangeable.
You may also need an unstripped vmlinux, System.map, build log and KernelSU Manager APK. Use only the matching modules, apps and images in the appended “Modules, apps & files to try” section. Never flash a generic image merely because its kernel version looks similar.
Verification and recovery
Successful booting is only the first check. Confirm that Android reaches the lock screen, ADB works and the kernel version matches the test build. Review dmesg for hook, kprobe, SELinux and panic messages.
Check that root is denied to ordinary apps by default. Grant it only to a trusted test shell. Keep another route to the bootloader or recovery available until testing is complete.
A boot loop means the image did not pass verification. Reflash the untouched stock image for the same build. Do not keep testing modules against a kernel that already shows memory faults or security errors.
Choosing the right hook strategy
No hook method is universally safe on a legacy kernel. Use the least invasive method supported by the exact source and architecture.
| Method | Useful when | Main failure signs | Key risk |
|---|---|---|---|
| Named function hook | The symbol and signature are stable | Missing symbol or wrong address | Vendor changes break assumptions |
| Kprobe hook | The kernel exposes working probe support | Registration errors or no callback | Older vendor implementations may be incomplete |
| ARM64 branch-link patch | The target call site can be verified | Range, instruction or pattern mismatch | A wrong patch can corrupt execution |
| System-call table hook | The table is found and safely writable | Wrong table type or immediate crash | Broad, fragile and security-sensitive |
| Source integration | The full matching kernel can be rebuilt | Build errors or changed call paths | Requires careful long-term maintenance |
A referenced ARM64 implementation in the backslashxx KernelSU fork can fall back from branch-link patching to system-call table hooking. Its source is visible in the KernelSU branch-link hook implementation.
The referenced ARM64 KernelSU code falls back to system-call table hooking when branch-link hook installation fails.
A kernelsu branch link failure does not make that fallback safe on every kernel. Validate table layout, function types and write protection first.
Image caption: The safest hook choice depends on verified symbols, architecture and kernel support.
Understanding do_execve_common KernelSU problems
The search phrase do execve common kernelsu usually points to execution hooks. do_execve_common has changed across kernel branches and vendor trees. Its name, parameters and visibility cannot be assumed from another device.
A port may fail because the function is static, renamed or optimised away. It may also use a different structure type than the hook expects. Treat signature mismatches as serious defects. Calling a kernel function through the wrong type can corrupt registers or memory.
Start from the source used for the running image. Trace the execution path from the architecture’s system-call entry. Confirm which function performs credential and binary-loading work. Then compare the generated machine code.
Do not restore a symbol by disabling broad security features. Do not make executable kernel memory writable for convenience. A working root prompt does not prove that the resulting kernel remains safe.
Limits of KernelSU legacy kernel hooks
KernelSU legacy kernel hooks are backports into kernels outside the project’s normal support path. Linux 3.x predates Android’s modern Generic Kernel Image model. It also lacks many later security and maintenance improvements.
As of 15 November 2026, a Linux 3.x KernelSU port remains an unsupported and security-sensitive backport.
The official KernelSU non-GKI integration guide is the right starting point. It does not make every legacy vendor kernel compatible. A maintained device-specific patch set is still required.
Do not transplant a hook from KernelSU Next, SukiSU Ultra or another fork without reviewing its surrounding code. Forks may use different hook layers, daemon expectations and SUSFS integrations.
If the device cannot build a stable kernel from matching source, keeping stock firmware may be safer. A newer supported device is often a better root platform than an unmaintained Linux 3.x handset.
Security, updates and app compatibility
Bootloader unlocking normally wipes the phone. Back up first and confirm that account recovery details work. Some manufacturers may also restrict warranty support.
Root changes Android’s trust model. A faulty hook can expose kernel memory or grant access too widely. An unlocked bootloader can weaken physical security. Relocking with a modified or mismatched image may brick the device.
Official over-the-air updates may fail after boot changes. An update can also replace the patched kernel. Restore the correct stock images before using a vendor update process unless the device guide says otherwise.
Banking, wallet, media and work apps may use Play Integrity or their own checks. Results vary by app, release and device. No KernelSU hook method can promise access to a specific bank or service. Root hiding can also introduce fresh security risks.
For wider preparation, read our Android bootloader unlocking guide and practical Android rooting guide.
Image caption: Keep a verified stock image and recovery route before changing the phone’s kernel.
A practical diagnosis framework
Classify kernelsu hook failures by evidence rather than by the first missing symbol.
- Source failure: the expected function is absent from the matching tree.
- Configuration failure: a required option is disabled in the real build configuration.
- Compiler failure: inlining or another pass removed the standalone entry point.
- Linker failure: section handling or explicit identical-code folding changed the output.
- Runtime failure: the address exists, but registration or patching fails on the phone.
- Compatibility failure: the hook runs with the wrong signature or kernel assumptions.
This order prevents wasted work. If GCC 4.9 built the file and no --icf option appears, compiler IPA folding is not the leading explanation. Check inlining and source mismatch next.
Stop testing if the kernel reports memory corruption, repeated panics or unexpected privilege grants. Restore stock and review the patch away from the device.
Frequently asked questions
Can GCC 4.9 cause KernelSU hook failures through -fipa-icf?
No. GCC’s -fipa-icf pass first appeared in GCC 5. GCC 4.9 can still inline or remove code. A separate linker such as GNU gold may also perform identical code folding when explicitly configured.
Why is do_execve_common missing from System.map?
The function may be static, inlined, renamed, stripped or excluded by configuration. The source may also differ from the running kernel. Inspect the matching vmlinux, disassembly, callers and build log before selecting another hook.
Can I flash a KernelSU boot image built for the same kernel version?
No. The version string is not enough. The image must match the device, installed firmware, configuration, partition layout and vendor changes. Flashing the wrong image can cause a boot loop or brick the phone.
Is syscall-table hooking a safe fallback?
It is a possible fallback in some implementations, but it is broad and fragile. The table type, address, permissions and calling convention must match. A successful patch does not prove the kernel remains secure.
Will fixing the hook make banking apps work?
Not necessarily. Apps can check boot state, Play Integrity, root artefacts and their own risk signals. Behaviour can change without notice. Never rely on a root method to defeat a specific bank’s checks.
Should I keep using KernelSU on a Linux 3.x phone?
Only if you can maintain and audit the device-specific port. Linux 3.x lacks years of later security fixes. Stock firmware or a supported newer device may offer a safer daily-use option.
PrivacyPortal sells ready-to-use, de-Googled GrapheneOS Pixels — hardened, kept updated, and shipped with our encrypted Graphite messenger. Browse privacy phones →
