Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
module.c File Reference
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/elf.h>
#include <linux/moduleloader.h>
#include <linux/string.h>
#include <linux/vmalloc.h>
#include <asm/patch.h>
#include <asm/unaligned.h>

Go to the source code of this file.

Data Structures

struct  plt_entry
 

Macros

#define ARCH_MODULE_DEBUG   0
 
#define DEBUGP(fmt, a...)
 
#define USE_BRL   1
 
#define MAX_LTOFF   ((uint64_t) (1 << 22)) /* max. allowable linkage-table offset */
 
#define FORMAT_SHIFT   0
 
#define FORMAT_BITS   3
 
#define FORMAT_MASK   ((1 << FORMAT_BITS) - 1)
 
#define VALUE_SHIFT   3
 
#define VALUE_BITS   5
 
#define VALUE_MASK   ((1 << VALUE_BITS) - 1)
 
#define N(reloc)   [R_IA64_##reloc] = #reloc
 

Enumerations

enum  reloc_target_format {
  RF_NONE = 0, RF_INSN14 = 1, RF_INSN22 = 2, RF_INSN64 = 3,
  RF_32MSB = 4, RF_32LSB = 5, RF_64MSB = 6, RF_64LSB = 7,
  RF_INSN60, RF_INSN21B, RF_INSN21M, RF_INSN21F
}
 
enum  reloc_value_formula {
  RV_DIRECT = 4, RV_GPREL = 5, RV_LTREL = 6, RV_PLTREL = 7,
  RV_FPTR = 8, RV_PCREL = 9, RV_LTREL_FPTR = 10, RV_SEGREL = 11,
  RV_SECREL = 12, RV_BDREL = 13, RV_LTV = 14, RV_PCREL2 = 15,
  RV_SPECIAL = 16, RV_RSVD17 = 17, RV_TPREL = 18, RV_LTREL_TPREL = 19,
  RV_DTPMOD = 20, RV_LTREL_DTPMOD = 21, RV_DTPREL = 22, RV_LTREL_DTPREL = 23,
  RV_RSVD24 = 24, RV_RSVD25 = 25, RV_RSVD26 = 26, RV_RSVD27 = 27
}
 

Functions

unsigned long plt_target (struct plt_entry *plt)
 
void module_free (struct module *mod, void *module_region)
 
int module_frob_arch_sections (Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings, struct module *mod)
 
int apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symindex, unsigned int relsec, struct module *mod)
 
int module_finalize (const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod)
 
void module_arch_cleanup (struct module *mod)
 

Macro Definition Documentation

#define ARCH_MODULE_DEBUG   0

Definition at line 39 of file module.c.

#define DEBUGP (   fmt,
  a... 
)

Definition at line 45 of file module.c.

#define FORMAT_BITS   3

Definition at line 59 of file module.c.

#define FORMAT_MASK   ((1 << FORMAT_BITS) - 1)

Definition at line 60 of file module.c.

#define FORMAT_SHIFT   0

Definition at line 58 of file module.c.

#define MAX_LTOFF   ((uint64_t) (1 << 22)) /* max. allowable linkage-table offset */

Definition at line 54 of file module.c.

#define N (   reloc)    [R_IA64_##reloc] = #reloc

Definition at line 111 of file module.c.

#define USE_BRL   1

Definition at line 51 of file module.c.

#define VALUE_BITS   5

Definition at line 62 of file module.c.

#define VALUE_MASK   ((1 << VALUE_BITS) - 1)

Definition at line 63 of file module.c.

#define VALUE_SHIFT   3

Definition at line 61 of file module.c.

Enumeration Type Documentation

Enumerator:
RF_NONE 
RF_INSN14 
RF_INSN22 
RF_INSN64 
RF_32MSB 
RF_32LSB 
RF_64MSB 
RF_64LSB 
RF_INSN60 
RF_INSN21B 
RF_INSN21M 
RF_INSN21F 

Definition at line 65 of file module.c.

Enumerator:
RV_DIRECT 
RV_GPREL 
RV_LTREL 
RV_PLTREL 
RV_FPTR 
RV_PCREL 
RV_LTREL_FPTR 
RV_SEGREL 
RV_SECREL 
RV_BDREL 
RV_LTV 
RV_PCREL2 
RV_SPECIAL 
RV_RSVD17 
RV_TPREL 
RV_LTREL_TPREL 
RV_DTPMOD 
RV_LTREL_DTPMOD 
RV_DTPREL 
RV_LTREL_DTPREL 
RV_RSVD24 
RV_RSVD25 
RV_RSVD26 
RV_RSVD27 

Definition at line 83 of file module.c.

Function Documentation

int apply_relocate_add ( Elf64_Shdr sechdrs,
const char strtab,
unsigned int  symindex,
unsigned int  relsec,
struct module mod 
)

Definition at line 797 of file module.c.

void module_arch_cleanup ( struct module mod)

Definition at line 947 of file module.c.

int module_finalize ( const Elf_Ehdr hdr,
const Elf_Shdr sechdrs,
struct module mod 
)

Definition at line 914 of file module.c.

void module_free ( struct module mod,
void module_region 
)

Definition at line 308 of file module.c.

int module_frob_arch_sections ( Elf_Ehdr ehdr,
Elf_Shdr sechdrs,
char secstrings,
struct module mod 
)

Definition at line 423 of file module.c.

unsigned long plt_target ( struct plt_entry plt)

Definition at line 243 of file module.c.