Skip to content
Snippets Groups Projects
Select Git revision
  • 3b09efc4f0c94669a928c0453d2dcb54c59543f2
  • add-vdpu381-and-383-to-rkvdec-v3
  • arm-dts-add-rkvdec-v2
  • add-vdpu381-and-383-to-rkvdec-v2
  • add-v4l2-st-lt-ref-set-support-v3
  • add-vdpu381-and-383-to-rkvdec
  • prepare-add-vdpu381-and-383-to-rkvdec
  • add-rkvdec2-driver-vdpu383-hevc
  • add-rkvdec2-driver-vdpu383
  • add-rkvdec2-driver-hevc
  • rkvdec-mov-to-structs
  • av1-fix-postproc-leak
  • add-rkvdec2-driver-iommu-422-10bits
  • patch-queue/jamba/trixie
  • hdmi-fix-1080p-rock4d-6.11
  • upstreaming/rk3576-rock4d-spi-v1
  • upstreaming/rk3576-rock4d-support-v5
  • upstreaming/rk3588-hdmi-audio-6
  • upstreaming/rk3576-rock4d-support-v3
  • upstreaming/rk3576-rock4d-support-v1
  • upstreaming/rk3576-rock4d-support
  • v6.3
  • v6.3-rc1
  • v6.2-rc1
  • v6.0-rc1
  • v5.19-rc3
  • v5.19-rc2
  • v5.19-rc1
  • v5.18
  • v5.18-rc7
  • v5.18-rc6
  • v5.18-rc5
  • v5.18-rc4
  • v5.18-rc3
  • v5.18-rc2
  • v5.18-rc1
  • v5.17
  • v5.17-rc8
  • v5.17-rc7
  • v5.17-rc6
  • v5.17-rc5
41 results

modpost.c

Blame
  • Forked from hardware-enablement / Rockchip upstream enablement efforts / linux
    Source project has a limited visibility.
    modpost.c 68.26 KiB
    /* Postprocess module symbol versions
     *
     * Copyright 2003       Kai Germaschewski
     * Copyright 2002-2004  Rusty Russell, IBM Corporation
     * Copyright 2006-2008  Sam Ravnborg
     * Based in part on module-init-tools/depmod.c,file2alias
     *
     * This software may be used and distributed according to the terms
     * of the GNU General Public License, incorporated herein by reference.
     *
     * Usage: modpost vmlinux module1.o module2.o ...
     */
    
    #define _GNU_SOURCE
    #include <elf.h>
    #include <stdio.h>
    #include <ctype.h>
    #include <string.h>
    #include <limits.h>
    #include <stdbool.h>
    #include <errno.h>
    #include "modpost.h"
    #include "../../include/linux/license.h"
    
    /* Are we using CONFIG_MODVERSIONS? */
    static int modversions = 0;
    /* Warn about undefined symbols? (do so if we have vmlinux) */
    static int have_vmlinux = 0;
    /* Is CONFIG_MODULE_SRCVERSION_ALL set? */
    static int all_versions = 0;
    /* If we are modposting external module set to 1 */
    static int external_module = 0;
    /* Only warn about unresolved symbols */
    static int warn_unresolved = 0;
    /* How a symbol is exported */
    static int sec_mismatch_count = 0;
    static int sec_mismatch_fatal = 0;
    /* ignore missing files */
    static int ignore_missing_files;
    /* If set to 1, only warn (instead of error) about missing ns imports */
    static int allow_missing_ns_imports;
    
    enum export {
    	export_plain,      export_unused,     export_gpl,
    	export_unused_gpl, export_gpl_future, export_unknown
    };
    
    /* In kernel, this size is defined in linux/module.h;
     * here we use Elf_Addr instead of long for covering cross-compile
     */
    
    #define MODULE_NAME_LEN (64 - sizeof(Elf_Addr))
    
    void __attribute__((format(printf, 2, 3)))
    modpost_log(enum loglevel loglevel, const char *fmt, ...)
    {
    	va_list arglist;
    
    	switch (loglevel) {
    	case LOG_WARN:
    		fprintf(stderr, "WARNING: ");
    		break;
    	case LOG_ERROR:
    		fprintf(stderr, "ERROR: ");
    		break;
    	case LOG_FATAL:
    		fprintf(stderr, "FATAL: ");
    		break;
    	default: /* invalid loglevel, ignore */
    		break;