aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/modpost.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r--scripts/mod/modpost.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 508c5895c680..418cd7dbbc93 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -467,6 +467,25 @@ static void parse_elf_finish(struct elf_info *info)
467 release_file(info->hdr, info->size); 467 release_file(info->hdr, info->size);
468} 468}
469 469
470static int ignore_undef_symbol(struct elf_info *info, const char *symname)
471{
472 /* ignore __this_module, it will be resolved shortly */
473 if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0)
474 return 1;
475 /* ignore global offset table */
476 if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0)
477 return 1;
478 if (info->hdr->e_machine == EM_PPC)
479 /* Special register function linked on all modules during final link of .ko */
480 if (strncmp(symname, "_restgpr_", sizeof("_restgpr_") - 1) == 0 ||
481 strncmp(symname, "_savegpr_", sizeof("_savegpr_") - 1) == 0 ||
482 strncmp(symname, "_rest32gpr_", sizeof("_rest32gpr_") - 1) == 0 ||
483 strncmp(symname, "_save32gpr_", sizeof("_save32gpr_") - 1) == 0)
484 return 1;
485 /* Do not ignore this symbol */
486 return 0;
487}
488
470#define CRC_PFX MODULE_SYMBOL_PREFIX "__crc_" 489#define CRC_PFX MODULE_SYMBOL_PREFIX "__crc_"
471#define KSYMTAB_PFX MODULE_SYMBOL_PREFIX "__ksymtab_" 490#define KSYMTAB_PFX MODULE_SYMBOL_PREFIX "__ksymtab_"
472 491
@@ -493,11 +512,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
493 if (ELF_ST_BIND(sym->st_info) != STB_GLOBAL && 512 if (ELF_ST_BIND(sym->st_info) != STB_GLOBAL &&
494 ELF_ST_BIND(sym->st_info) != STB_WEAK) 513 ELF_ST_BIND(sym->st_info) != STB_WEAK)
495 break; 514 break;
496 /* ignore global offset table */ 515 if (ignore_undef_symbol(info, symname))
497 if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0)
498 break;
499 /* ignore __this_module, it will be resolved shortly */
500 if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0)
501 break; 516 break;
502/* cope with newer glibc (2.3.4 or higher) STT_ definition in elf.h */ 517/* cope with newer glibc (2.3.4 or higher) STT_ definition in elf.h */
503#if defined(STT_REGISTER) || defined(STT_SPARC_REGISTER) 518#if defined(STT_REGISTER) || defined(STT_SPARC_REGISTER)
@@ -1453,7 +1468,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
1453 * marked __initdata will be discarded when the module has been intialized. 1468 * marked __initdata will be discarded when the module has been intialized.
1454 * Likewise for modules used built-in the sections marked __exit 1469 * Likewise for modules used built-in the sections marked __exit
1455 * are discarded because __exit marked function are supposed to be called 1470 * are discarded because __exit marked function are supposed to be called
1456 * only when a moduel is unloaded which never happes for built-in modules. 1471 * only when a module is unloaded which never happens for built-in modules.
1457 * The check_sec_ref() function traverses all relocation records 1472 * The check_sec_ref() function traverses all relocation records
1458 * to find all references to a section that reference a section that will 1473 * to find all references to a section that reference a section that will
1459 * be discarded and warns about it. 1474 * be discarded and warns about it.
@@ -1977,7 +1992,8 @@ static void read_markers(const char *fname)
1977 mod->skip = 1; 1992 mod->skip = 1;
1978 } 1993 }
1979 1994
1980 add_marker(mod, marker, fmt); 1995 if (!mod->skip)
1996 add_marker(mod, marker, fmt);
1981 } 1997 }
1982 return; 1998 return;
1983fail: 1999fail: