AR drivers/built-in.a GEN .version CHK include/generated/compile.h AR built-in.a MODPOST vmlinux.o WARNING: modpost: Found 1 section mismatch(es). To see full details build your kernel with: 'make CONFIG_DEBUG_SECTION_MISMATCH=y' FATAL: modpost: Section mismatches detected. Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them. make[2]: *** [../scripts/Makefile.modpost:114: vmlinux.o] Error 1
然后把 CONFIG_DEBUG_SECTION_MISMATCH=y 打开发现:
Logcat
1 2 3 4 5 6 7 8 9 10 11 12 13 14
AR drivers/built-in.a GEN .version CHK include/generated/compile.h AR built-in.a MODPOST vmlinux.o WARNING: vmlinux.o(.text+0x61d27c): Section mismatch in reference from the function bootloader_log_probe() to the function .init.text:of_bootloader_log_platform_data() The function bootloader_log_probe() references the function __init of_bootloader_log_platform_data(). This is often because bootloader_log_probe lacks a __init annotation or the annotation of of_bootloader_log_platform_data is wrong.
FATAL: modpost: Section mismatches detected. Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them. make[2]: *** [../scripts/Makefile.modpost:114: vmlinux.o] Error 1
-static int bootloader_log_probe(struct platform_device *pdev) +static int __init bootloader_log_probe(struct platform_device *pdev) { struct bootloader_log_platform_data *pdata = pdev->dev.platform_data; struct bootloader_log_platform_data of_pdata;
然后编译之后出现了报错:
logcat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
AR drivers/built-in.a GEN .version CHK include/generated/compile.h AR built-in.a MODPOST vmlinux.o WARNING: vmlinux.o(.data+0xa7e10): Section mismatch in reference from the variable bootloader_log_driver to the function .init.text:bootloader_log_probe() The variable bootloader_log_driver references the function __init bootloader_log_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
FATAL: modpost: Section mismatches detected. Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them. make[2]: *** [../scripts/Makefile.modpost:114: vmlinux.o] Error 1
AR drivers/built-in.a GEN .version CHK include/generated/compile.h AR built-in.a MODPOST vmlinux.o kernel/fork.o: In function `copy_process': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../kernel/fork.c:2306: undefined reference to `update_user_tasklist' mm/vmscan.o: In function `shrink_page_list': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../mm/vmscan.c:1186: undefined reference to `is_reclaim_should_cancel' drivers/scsi/oufs/ufshcd.o: In function `ufshcd_comp_scsi_upiu': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:3754: undefined reference to `ufsf_change_read10_debug_lun' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:3755: undefined reference to `ufsf_prep_fn' drivers/scsi/oufs/ufshcd.o: In function `ufshcd_suspend': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:10876: undefined reference to `ufsf_hpb_suspend' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:11018: undefined reference to `ufsf_resume' drivers/scsi/oufs/ufshcd.o: In function `ufshcd_resume': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:11146: undefined reference to `ufsf_resume' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:11430: undefined reference to `ufsf_remove' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:11431: undefined reference to `remove_ufsplus_ctrl_proc' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:11435: undefined reference to `remove_signal_quality_proc' drivers/scsi/oufs/ufshcd.o: In function `ufshcd_init': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:11736: undefined reference to `ufsf_set_init_state' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:11740: undefined reference to `create_signal_quality_proc' drivers/scsi/oufs/ufshcd.o: In function `ufshcd_check_errors': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:7984: undefined reference to `recordUniproErr' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:7978: undefined reference to `recordUniproErr' drivers/scsi/oufs/ufshcd.o: In function `ufshcd_update_uic_error': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:7873: undefined reference to `recordUniproErr' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:7903: undefined reference to `recordUniproErr' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:7928: undefined reference to `recordUniproErr' drivers/scsi/oufs/ufshcd.o:/home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:7939: more undefined references to `recordUniproErr' follow drivers/scsi/oufs/ufshcd.o: In function `ufshcd_host_reset_and_restore': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:8532: undefined reference to `ufsf_reset_host' drivers/scsi/oufs/ufshcd.o: In function `ufshcd_probe_hba': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:9664: undefined reference to `ufsf_reset' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:9634: undefined reference to `ufsf_device_check' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:9635: undefined reference to `ufsf_init' drivers/scsi/oufs/ufshcd.o: In function `ufshcd_transfer_rsp_status': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:6623: undefined reference to `ufsf_hpb_noti_rb' drivers/scsi/oufs/ufshcd.o: In function `__ufshcd_transfer_req_compl': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:6911: undefined reference to `ufsf_on_idle' drivers/scsi/oufs/ufshcd.o: In function `ufshcd_devfreq_scale': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:1879: undefined reference to `ufsf_tw_enable' drivers/scsi/oufs/ufshcd.o: In function `ufshcd_query_ioctl': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:9788: undefined reference to `ufsf_check_query' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:9789: undefined reference to `ufsf_query_ioctl' drivers/scsi/oufs/ufshcd.o: In function `ufshcd_eh_device_reset_handler': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:8307: undefined reference to `ufsf_reset_lu' drivers/scsi/oufs/ufshcd.o: In function `ufshcd_slave_configure': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufshcd.c:6444: undefined reference to `ufsf_slave_configure' drivers/scsi/oufs/ufs-sysfs.o: In function `latency_hist_show': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufs-sysfs.c:255: undefined reference to `io_latency_hist_show' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufs-sysfs.c:257: undefined reference to `io_latency_hist_show' /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../drivers/scsi/oufs/ufs-sysfs.c:259: undefined reference to `io_latency_hist_show' net/ipv4/tcp_ipv4.o: In function `tcp_v4_rcv': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../net/ipv4/tcp_ipv4.c:1748: undefined reference to `oplus_router_boost_handler' /home/runner/aarch64-linux-android-4.9/bin/aarch64-linux-android-ld: net/ipv4/tcp_ipv4.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `oplus_router_boost_handler' can not be used when making a shared object; recompile with -fPIC /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../net/ipv4/tcp_ipv4.c:1748: undefined reference to `oplus_router_boost_handler' net/ipv4/udp.o: In function `udp_queue_rcv_skb': /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../net/ipv4/udp.c:2067: undefined reference to `oplus_router_boost_handler' /home/runner/aarch64-linux-android-4.9/bin/aarch64-linux-android-ld: net/ipv4/udp.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `oplus_router_boost_handler' can not be used when making a shared object; recompile with -fPIC /home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out/../net/ipv4/udp.c:2067: undefined reference to `oplus_router_boost_handler' make[1]: *** [/home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/Makefile:1255: vmlinux] Error 1 make[1]: Leaving directory '/home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19/out' make: *** [Makefile:146: sub-make] Error 2 make: Leaving directory '/home/SekaiMoe/tmpdir/android_kernel_oppo_sm7250/msm-4.19'
static int bootloader_log_probe(struct platform_device *pdev) static int __init* bootloader_log_probe(struct platform_device *pdev) { -struct bootloader_log_platform_data *pdata = pdev->dev.platform_data; +struct bootloader_log_platform_data of_pdata;
改完之后编译发现直接编译报错了:
Logcat
1 2 3 4 5 6 7 8 9 10 11
CC net/sctp/stream_sched_prio.o CC net/sctp/stream_sched_rr.o ../drivers/soc/oplus/system/misc/bootloader_log.c:190:9: warning: incompatible integer to pointer conversion returning 'int' from a function with result type'int *'; take the address with & [-Wint-conversion] return err; ^~~ & ../drivers/soc/oplus/system/misc/bootloader_log.c:205:12: error: incompatible pointer types initializing 'int (*)(struct platform_device *)' with an expression of type'int *(struct platform_device *)' [-Werror,-Wincompatible-pointer-types] .probe = bootloader_log_probe, ^~~~~~~~~~~~~~~~~~~~ 1 warning and 1 error generated. make[5]: *** [../scripts/Makefile.build:339: drivers/soc/oplus/system/misc/bootloader_log.o] Error 1