Skip to content
Snippets Groups Projects
Select Git revision
  • 247a52d0cdeb6d5db0aabada368e1a6db0b8b716
  • openEuler-1.0-LTS default protected
  • openEuler-22.09
  • OLK-5.10
  • openEuler-22.03-LTS
  • openEuler-22.03-LTS-Ascend
  • master
  • openEuler-22.03-LTS-LoongArch-NW
  • openEuler-22.09-HCK
  • openEuler-20.03-LTS-SP3
  • openEuler-21.09
  • openEuler-21.03
  • openEuler-20.09
  • 4.19.90-2210.5.0
  • 5.10.0-123.0.0
  • 5.10.0-60.63.0
  • 5.10.0-60.62.0
  • 4.19.90-2210.4.0
  • 5.10.0-121.0.0
  • 5.10.0-60.61.0
  • 4.19.90-2210.3.0
  • 5.10.0-60.60.0
  • 5.10.0-120.0.0
  • 5.10.0-60.59.0
  • 5.10.0-119.0.0
  • 4.19.90-2210.2.0
  • 4.19.90-2210.1.0
  • 5.10.0-118.0.0
  • 5.10.0-106.19.0
  • 5.10.0-60.58.0
  • 4.19.90-2209.6.0
  • 5.10.0-106.18.0
  • 5.10.0-106.17.0
33 results

modpost.c

Blame
  • modpost.c 66.86 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 <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;
    /* Warn about section mismatch in vmlinux if set to 1 */
    static int vmlinux_section_warnings = 1;
    /* 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_verbose = 1;
    static int sec_mismatch_fatal = 0;
    /* ignore missing files */
    static int ignore_missing_files;
    
    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))
    
    #define PRINTF __attribute__ ((format (printf, 1, 2)))
    
    PRINTF void fatal(const char *fmt, ...)
    {
    	va_list arglist;
    
    	fprintf(stderr, "FATAL: ");
    
    	va_start(arglist, fmt);
    	vfprintf(stderr, fmt, arglist);
    	va_end(arglist);
    
    	exit(1);
    }
    
    PRINTF void warn(const char *fmt, ...)
    {