Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
modpost.c File Reference
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "modpost.h"
#include "../../include/generated/autoconf.h"
#include "../../include/linux/license.h"

Go to the source code of this file.

Data Structures

struct  symbol
 
struct  sectioncheck
 
struct  ext_sym_list
 

Macros

#define _GNU_SOURCE
 
#define MODULE_SYMBOL_PREFIX   ""
 
#define PRINTF   __attribute__ ((format (printf, 1, 2)))
 
#define SYMBOL_HASH_SIZE   1024
 
#define strstarts(str, prefix)   (strncmp(str, prefix, strlen(prefix)) == 0)
 
#define CRC_PFX   MODULE_SYMBOL_PREFIX "__crc_"
 
#define KSYMTAB_PFX   MODULE_SYMBOL_PREFIX "__ksymtab_"
 
#define ALL_INIT_DATA_SECTIONS
 
#define ALL_EXIT_DATA_SECTIONS   ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$"
 
#define ALL_INIT_TEXT_SECTIONS   ".init.text$", ".devinit.text$", ".cpuinit.text$", ".meminit.text$"
 
#define ALL_EXIT_TEXT_SECTIONS   ".exit.text$", ".devexit.text$", ".cpuexit.text$", ".memexit.text$"
 
#define ALL_PCI_INIT_SECTIONS
 
#define ALL_XXXINIT_SECTIONS
 
#define ALL_XXXEXIT_SECTIONS
 
#define ALL_INIT_SECTIONS   INIT_SECTIONS, ALL_XXXINIT_SECTIONS
 
#define ALL_EXIT_SECTIONS   EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS
 
#define DATA_SECTIONS   ".data$", ".data.rel$"
 
#define TEXT_SECTIONS   ".text$"
 
#define INIT_SECTIONS   ".init.*"
 
#define DEV_INIT_SECTIONS   ".devinit.*"
 
#define CPU_INIT_SECTIONS   ".cpuinit.*"
 
#define MEM_INIT_SECTIONS   ".meminit.*"
 
#define EXIT_SECTIONS   ".exit.*"
 
#define DEV_EXIT_SECTIONS   ".devexit.*"
 
#define CPU_EXIT_SECTIONS   ".cpuexit.*"
 
#define MEM_EXIT_SECTIONS   ".memexit.*"
 
#define DEFAULT_SYMBOL_WHITE_LIST
 
#define R_ARM_CALL   28
 
#define R_ARM_JUMP24   29
 
#define SZ   500
 

Enumerations

enum  export {
  export_plain, export_unused, export_gpl, export_unused_gpl,
  export_gpl_future, export_unknown
}
 
enum  mismatch {
  TEXT_TO_ANY_INIT, DATA_TO_ANY_INIT, TEXT_TO_ANY_EXIT, DATA_TO_ANY_EXIT,
  XXXINIT_TO_SOME_INIT, XXXEXIT_TO_SOME_EXIT, ANY_INIT_TO_ANY_EXIT, ANY_EXIT_TO_ANY_INIT,
  EXPORT_TO_INIT_EXIT
}
 

Functions

PRINTF void fatal (const char *fmt,...)
 
PRINTF void warn (const char *fmt,...)
 
PRINTF void merror (const char *fmt,...)
 
voiddo_nofail (void *ptr, const char *expr)
 
voidgrab_file (const char *filename, unsigned long *size)
 
charget_next_line (unsigned long *pos, void *file, unsigned long size)
 
void release_file (void *file, unsigned long size)
 
void __attribute__ ((format(printf, 2, 3)))
 
void buf_write (struct buffer *buf, const char *s, int len)
 
int main (int argc, char **argv)
 

Variables

int modversions = 0
 
int have_vmlinux = 0
 
struct sectioncheck sectioncheck []
 

Macro Definition Documentation

#define _GNU_SOURCE

Definition at line 14 of file modpost.c.

#define ALL_EXIT_DATA_SECTIONS   ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$"

Definition at line 863 of file modpost.c.

#define ALL_EXIT_SECTIONS   EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS

Definition at line 882 of file modpost.c.

#define ALL_EXIT_TEXT_SECTIONS   ".exit.text$", ".devexit.text$", ".cpuexit.text$", ".memexit.text$"

Definition at line 868 of file modpost.c.

#define ALL_INIT_DATA_SECTIONS
Value:
".init.setup$", ".init.rodata$", \
".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$", \
".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$"

Definition at line 859 of file modpost.c.

#define ALL_INIT_SECTIONS   INIT_SECTIONS, ALL_XXXINIT_SECTIONS

Definition at line 881 of file modpost.c.

#define ALL_INIT_TEXT_SECTIONS   ".init.text$", ".devinit.text$", ".cpuinit.text$", ".meminit.text$"

Definition at line 866 of file modpost.c.

#define ALL_PCI_INIT_SECTIONS
Value:
".pci_fixup_early$", ".pci_fixup_header$", ".pci_fixup_final$", \
".pci_fixup_enable$", ".pci_fixup_resume$", \
".pci_fixup_resume_early$", ".pci_fixup_suspend$"

Definition at line 871 of file modpost.c.

#define ALL_XXXEXIT_SECTIONS
Value:
MEM_EXIT_SECTIONS

Definition at line 878 of file modpost.c.

#define ALL_XXXINIT_SECTIONS
Value:
MEM_INIT_SECTIONS

Definition at line 876 of file modpost.c.

#define CPU_EXIT_SECTIONS   ".cpuexit.*"

Definition at line 894 of file modpost.c.

#define CPU_INIT_SECTIONS   ".cpuinit.*"

Definition at line 889 of file modpost.c.

#define CRC_PFX   MODULE_SYMBOL_PREFIX "__crc_"

Definition at line 586 of file modpost.c.

#define DATA_SECTIONS   ".data$", ".data.rel$"

Definition at line 884 of file modpost.c.

#define DEFAULT_SYMBOL_WHITE_LIST
Value:
"*driver", \
"*_template", /* scsi uses *_template a lot */ \
"*_timer", /* arm uses ops structures named _timer a lot */ \
"*_sht", /* scsi also used *_sht to some extent */ \
"*_ops", \
"*_probe", \
"*_probe_one", \
"*_console"

Definition at line 912 of file modpost.c.

#define DEV_EXIT_SECTIONS   ".devexit.*"

Definition at line 893 of file modpost.c.

#define DEV_INIT_SECTIONS   ".devinit.*"

Definition at line 888 of file modpost.c.

#define EXIT_SECTIONS   ".exit.*"

Definition at line 892 of file modpost.c.

#define INIT_SECTIONS   ".init.*"

Definition at line 887 of file modpost.c.

#define KSYMTAB_PFX   MODULE_SYMBOL_PREFIX "__ksymtab_"

Definition at line 587 of file modpost.c.

#define MEM_EXIT_SECTIONS   ".memexit.*"

Definition at line 895 of file modpost.c.

#define MEM_INIT_SECTIONS   ".meminit.*"

Definition at line 890 of file modpost.c.

#define MODULE_SYMBOL_PREFIX   ""

Definition at line 26 of file modpost.c.

#define PRINTF   __attribute__ ((format (printf, 1, 2)))

Definition at line 51 of file modpost.c.

#define R_ARM_CALL   28

Definition at line 1518 of file modpost.c.

#define R_ARM_JUMP24   29

Definition at line 1521 of file modpost.c.

#define strstarts (   str,
  prefix 
)    (strncmp(str, prefix, strlen(prefix)) == 0)

Definition at line 261 of file modpost.c.

#define SYMBOL_HASH_SIZE   1024

Definition at line 152 of file modpost.c.

#define SZ   500

Definition at line 1767 of file modpost.c.

#define TEXT_SECTIONS   ".text$"

Definition at line 885 of file modpost.c.

Enumeration Type Documentation

enum export
Enumerator:
export_plain 
export_unused 
export_gpl 
export_unused_gpl 
export_gpl_future 
export_unknown 

Definition at line 46 of file modpost.c.

enum mismatch
Enumerator:
TEXT_TO_ANY_INIT 
DATA_TO_ANY_INIT 
TEXT_TO_ANY_EXIT 
DATA_TO_ANY_EXIT 
XXXINIT_TO_SOME_INIT 
XXXEXIT_TO_SOME_EXIT 
ANY_INIT_TO_ANY_EXIT 
ANY_EXIT_TO_ANY_INIT 
EXPORT_TO_INIT_EXIT 

Definition at line 926 of file modpost.c.

Function Documentation

void __attribute__ ( (format(printf, 2, 3))  )

Definition at line 1773 of file modpost.c.

void buf_write ( struct buffer buf,
const char s,
int  len 
)

Definition at line 1786 of file modpost.c.

void* do_nofail ( void ptr,
const char expr 
)

Definition at line 102 of file modpost.c.

PRINTF void fatal ( const char fmt,
  ... 
)

Definition at line 53 of file modpost.c.

char* get_next_line ( unsigned long pos,
void file,
unsigned long  size 
)

Return a copy of the next line in a mmap'ed file. spaces in the beginning of the line is trimmed away. Return a pointer to a static buffer.

Definition at line 364 of file modpost.c.

void* grab_file ( const char filename,
unsigned long size 
)

Definition at line 337 of file modpost.c.

int main ( int  argc,
char **  argv 
)

Definition at line 2122 of file modpost.c.

PRINTF void merror ( const char fmt,
  ... 
)

Definition at line 77 of file modpost.c.

void release_file ( void file,
unsigned long  size 
)

Definition at line 393 of file modpost.c.

PRINTF void warn ( const char fmt,
  ... 
)

Definition at line 66 of file modpost.c.

Variable Documentation

enum export export

Definition at line 230 of file modpost.c.

int have_vmlinux = 0

Definition at line 33 of file modpost.c.

int modversions = 0

Definition at line 31 of file modpost.c.

Definition at line 945 of file modpost.c.

const char* str

Definition at line 229 of file modpost.c.