Commit 6a28a05f authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
  kbuild: fix modpost warnings for xtensa
  kbuild: be more foregiving on init section naming
  kbuild: rearrange a few function in modpost
  kbuild: use LDFLAGS_MODULE only for .ko links
  kconfig: remove unused members from struct symbol
  kconfig: attach help text to menus
  kbuild: fix up printing of Linux C Library version in scripts/ver_linux
  kbuild: do not do section mismatch checks on vmlinux in 2nd pass
parents 4bf3b0bc cb7e51d8
...@@ -299,7 +299,7 @@ CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(C ...@@ -299,7 +299,7 @@ CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(C
MODFLAGS = -DMODULE MODFLAGS = -DMODULE
CFLAGS_MODULE = $(MODFLAGS) CFLAGS_MODULE = $(MODFLAGS)
AFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS)
LDFLAGS_MODULE = -r LDFLAGS_MODULE =
CFLAGS_KERNEL = CFLAGS_KERNEL =
AFLAGS_KERNEL = AFLAGS_KERNEL =
......
...@@ -315,7 +315,7 @@ quiet_cmd_link_multi-y = LD $@ ...@@ -315,7 +315,7 @@ quiet_cmd_link_multi-y = LD $@
cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps)
quiet_cmd_link_multi-m = LD [M] $@ quiet_cmd_link_multi-m = LD [M] $@
cmd_link_multi-m = $(LD) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps) cmd_link_multi-m = $(cmd_link_multi-y)
# We would rather have a list of rules like # We would rather have a list of rules like
# foo.o: $(foo-objs) # foo.o: $(foo-objs)
......
...@@ -56,8 +56,7 @@ _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules)) ...@@ -56,8 +56,7 @@ _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))
# Step 2), invoke modpost # Step 2), invoke modpost
# Includes step 3,4 # Includes step 3,4
quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules modpost = scripts/mod/modpost \
cmd_modpost = scripts/mod/modpost \
$(if $(CONFIG_MODVERSIONS),-m) \ $(if $(CONFIG_MODVERSIONS),-m) \
$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \ $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \
$(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
...@@ -65,14 +64,16 @@ quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules ...@@ -65,14 +64,16 @@ quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
$(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
cmd_modpost = $(modpost) -s
PHONY += __modpost PHONY += __modpost
__modpost: $(modules:.ko=.o) FORCE __modpost: $(modules:.ko=.o) FORCE
$(call cmd,modpost) $(wildcard vmlinux) $(filter-out FORCE,$^) $(call cmd,modpost) $(wildcard vmlinux) $(filter-out FORCE,$^)
quiet_cmd_kernel-mod = MODPOST $@ quiet_cmd_kernel-mod = MODPOST $@
cmd_kernel-mod = $(cmd_modpost) $@ cmd_kernel-mod = $(modpost) $@
PHONY += vmlinux
vmlinux.o: FORCE vmlinux.o: FORCE
$(call cmd,kernel-mod) $(call cmd,kernel-mod)
...@@ -97,7 +98,7 @@ targets += $(modules:.ko=.mod.o) ...@@ -97,7 +98,7 @@ targets += $(modules:.ko=.mod.o)
# Step 6), final link of the modules # Step 6), final link of the modules
quiet_cmd_ld_ko_o = LD [M] $@ quiet_cmd_ld_ko_o = LD [M] $@
cmd_ld_ko_o = $(LD) $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \ cmd_ld_ko_o = $(LD) -r $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \
$(filter-out FORCE,$^) $(filter-out FORCE,$^)
$(modules): %.ko :%.o %.mod.o FORCE $(modules): %.ko :%.o %.mod.o FORCE
......
...@@ -37,6 +37,14 @@ static struct menu *rootEntry; ...@@ -37,6 +37,14 @@ static struct menu *rootEntry;
static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n");
static const char *get_help(struct menu *menu)
{
if (menu_has_help(menu))
return menu_get_help(menu);
else
return nohelp_text;
}
static void strip(char *str) static void strip(char *str)
{ {
char *p = str; char *p = str;
...@@ -171,7 +179,7 @@ static void conf_askvalue(struct symbol *sym, const char *def) ...@@ -171,7 +179,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
int conf_string(struct menu *menu) int conf_string(struct menu *menu)
{ {
struct symbol *sym = menu->sym; struct symbol *sym = menu->sym;
const char *def, *help; const char *def;
while (1) { while (1) {
printf("%*s%s ", indent - 1, "", menu->prompt->text); printf("%*s%s ", indent - 1, "", menu->prompt->text);
...@@ -186,10 +194,7 @@ int conf_string(struct menu *menu) ...@@ -186,10 +194,7 @@ int conf_string(struct menu *menu)
case '?': case '?':
/* print help */ /* print help */
if (line[1] == '\n') { if (line[1] == '\n') {
help = nohelp_text; printf("\n%s\n", get_help(menu));
if (menu->sym->help)
help = menu->sym->help;
printf("\n%s\n", menu->sym->help);
def = NULL; def = NULL;
break; break;
} }
...@@ -207,7 +212,6 @@ static int conf_sym(struct menu *menu) ...@@ -207,7 +212,6 @@ static int conf_sym(struct menu *menu)
struct symbol *sym = menu->sym; struct symbol *sym = menu->sym;
int type; int type;
tristate oldval, newval; tristate oldval, newval;
const char *help;
while (1) { while (1) {
printf("%*s%s ", indent - 1, "", menu->prompt->text); printf("%*s%s ", indent - 1, "", menu->prompt->text);
...@@ -233,7 +237,7 @@ static int conf_sym(struct menu *menu) ...@@ -233,7 +237,7 @@ static int conf_sym(struct menu *menu)
printf("/m"); printf("/m");
if (oldval != yes && sym_tristate_within_range(sym, yes)) if (oldval != yes && sym_tristate_within_range(sym, yes))
printf("/y"); printf("/y");
if (sym->help) if (menu_has_help(menu))
printf("/?"); printf("/?");
printf("] "); printf("] ");
conf_askvalue(sym, sym_get_string_value(sym)); conf_askvalue(sym, sym_get_string_value(sym));
...@@ -269,10 +273,7 @@ static int conf_sym(struct menu *menu) ...@@ -269,10 +273,7 @@ static int conf_sym(struct menu *menu)
if (sym_set_tristate_value(sym, newval)) if (sym_set_tristate_value(sym, newval))
return 0; return 0;
help: help:
help = nohelp_text; printf("\n%s\n", get_help(menu));
if (sym->help)
help = sym->help;
printf("\n%s\n", help);
} }
} }
...@@ -342,7 +343,7 @@ static int conf_choice(struct menu *menu) ...@@ -342,7 +343,7 @@ static int conf_choice(struct menu *menu)
goto conf_childs; goto conf_childs;
} }
printf("[1-%d", cnt); printf("[1-%d", cnt);
if (sym->help) if (menu_has_help(menu))
printf("?"); printf("?");
printf("]: "); printf("]: ");
switch (input_mode) { switch (input_mode) {
...@@ -359,8 +360,7 @@ static int conf_choice(struct menu *menu) ...@@ -359,8 +360,7 @@ static int conf_choice(struct menu *menu)
fgets(line, 128, stdin); fgets(line, 128, stdin);
strip(line); strip(line);
if (line[0] == '?') { if (line[0] == '?') {
printf("\n%s\n", menu->sym->help ? printf("\n%s\n", get_help(menu));
menu->sym->help : nohelp_text);
continue; continue;
} }
if (!line[0]) if (!line[0])
...@@ -391,8 +391,7 @@ static int conf_choice(struct menu *menu) ...@@ -391,8 +391,7 @@ static int conf_choice(struct menu *menu)
if (!child) if (!child)
continue; continue;
if (line[strlen(line) - 1] == '?') { if (line[strlen(line) - 1] == '?') {
printf("\n%s\n", child->sym->help ? printf("\n%s\n", get_help(child));
child->sym->help : nohelp_text);
continue; continue;
} }
sym_set_choice_value(sym, child->sym); sym_set_choice_value(sym, child->sym);
......
...@@ -71,14 +71,12 @@ enum { ...@@ -71,14 +71,12 @@ enum {
struct symbol { struct symbol {
struct symbol *next; struct symbol *next;
char *name; char *name;
char *help;
enum symbol_type type; enum symbol_type type;
struct symbol_value curr; struct symbol_value curr;
struct symbol_value def[4]; struct symbol_value def[4];
tristate visible; tristate visible;
int flags; int flags;
struct property *prop; struct property *prop;
struct expr *dep, *dep2;
struct expr_value rev_dep; struct expr_value rev_dep;
}; };
...@@ -139,7 +137,7 @@ struct menu { ...@@ -139,7 +137,7 @@ struct menu {
struct property *prompt; struct property *prompt;
struct expr *dep; struct expr *dep;
unsigned int flags; unsigned int flags;
//char *help; char *help;
struct file *file; struct file *file;
int lineno; int lineno;
void *data; void *data;
......
...@@ -38,9 +38,6 @@ static gboolean show_all = FALSE; ...@@ -38,9 +38,6 @@ static gboolean show_all = FALSE;
static gboolean show_debug = FALSE; static gboolean show_debug = FALSE;
static gboolean resizeable = FALSE; static gboolean resizeable = FALSE;
static char nohelp_text[] =
N_("Sorry, no help available for this option yet.\n");
GtkWidget *main_wnd = NULL; GtkWidget *main_wnd = NULL;
GtkWidget *tree1_w = NULL; // left frame GtkWidget *tree1_w = NULL; // left frame
GtkWidget *tree2_w = NULL; // right frame GtkWidget *tree2_w = NULL; // right frame
...@@ -462,12 +459,9 @@ static void text_insert_help(struct menu *menu) ...@@ -462,12 +459,9 @@ static void text_insert_help(struct menu *menu)
GtkTextIter start, end; GtkTextIter start, end;
const char *prompt = menu_get_prompt(menu); const char *prompt = menu_get_prompt(menu);
gchar *name; gchar *name;
const char *help = _(nohelp_text); const char *help;
if (!menu->sym) help = _(menu_get_help(menu));
help = "";
else if (menu->sym->help)
help = _(menu->sym->help);
if (menu->sym && menu->sym->name) if (menu->sym && menu->sym->name)
name = g_strdup_printf(_(menu->sym->name)); name = g_strdup_printf(_(menu->sym->name));
......
...@@ -170,8 +170,8 @@ void menu_build_message_list(struct menu *menu) ...@@ -170,8 +170,8 @@ void menu_build_message_list(struct menu *menu)
menu->file == NULL ? "Root Menu" : menu->file->name, menu->file == NULL ? "Root Menu" : menu->file->name,
menu->lineno); menu->lineno);
if (menu->sym != NULL && menu->sym->help != NULL) if (menu->sym != NULL && menu_has_help(menu))
message__add(menu->sym->help, menu->sym->name, message__add(menu_get_help(menu), menu->sym->name,
menu->file == NULL ? "Root Menu" : menu->file->name, menu->file == NULL ? "Root Menu" : menu->file->name,
menu->lineno); menu->lineno);
......
...@@ -15,6 +15,8 @@ P(menu_is_visible,bool,(struct menu *menu)); ...@@ -15,6 +15,8 @@ P(menu_is_visible,bool,(struct menu *menu));
P(menu_get_prompt,const char *,(struct menu *menu)); P(menu_get_prompt,const char *,(struct menu *menu));
P(menu_get_root_menu,struct menu *,(struct menu *menu)); P(menu_get_root_menu,struct menu *,(struct menu *menu));
P(menu_get_parent_menu,struct menu *,(struct menu *menu)); P(menu_get_parent_menu,struct menu *,(struct menu *menu));
P(menu_has_help,bool,(struct menu *menu));
P(menu_get_help,const char *,(struct menu *menu));
/* symbol.c */ /* symbol.c */
P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
......
...@@ -725,11 +725,11 @@ static void show_help(struct menu *menu) ...@@ -725,11 +725,11 @@ static void show_help(struct menu *menu)
struct gstr help = str_new(); struct gstr help = str_new();
struct symbol *sym = menu->sym; struct symbol *sym = menu->sym;
if (sym->help) if (menu_has_help(menu))
{ {
if (sym->name) { if (sym->name) {
str_printf(&help, "CONFIG_%s:\n\n", sym->name); str_printf(&help, "CONFIG_%s:\n\n", sym->name);
str_append(&help, _(sym->help)); str_append(&help, _(menu_get_help(menu)));
str_append(&help, "\n"); str_append(&help, "\n");
} }
} else { } else {
......
...@@ -417,3 +417,15 @@ struct menu *menu_get_parent_menu(struct menu *menu) ...@@ -417,3 +417,15 @@ struct menu *menu_get_parent_menu(struct menu *menu)
return menu; return menu;
} }
bool menu_has_help(struct menu *menu)
{
return menu->help != NULL;
}
const char *menu_get_help(struct menu *menu)
{
if (menu->help)
return menu->help;
else
return "";
}
...@@ -1041,7 +1041,7 @@ void ConfigInfoView::menuInfo(void) ...@@ -1041,7 +1041,7 @@ void ConfigInfoView::menuInfo(void)
if (showDebug()) if (showDebug())
debug = debug_info(sym); debug = debug_info(sym);
help = print_filter(_(sym->help)); help = print_filter(_(menu_get_help(menu)));
} else if (menu->prompt) { } else if (menu->prompt) {
head += "<big><b>"; head += "<big><b>";
head += print_filter(_(menu->prompt->text)); head += print_filter(_(menu->prompt->text));
......
...@@ -1722,7 +1722,7 @@ yyreduce: ...@@ -1722,7 +1722,7 @@ yyreduce:
case 83: case 83:
{ {
current_entry->sym->help = (yyvsp[0].string); current_entry->help = (yyvsp[0].string);
;} ;}
break; break;
...@@ -2280,11 +2280,11 @@ void print_symbol(FILE *out, struct menu *menu) ...@@ -2280,11 +2280,11 @@ void print_symbol(FILE *out, struct menu *menu)
break; break;
} }
} }
if (sym->help) { if (menu->help) {
int len = strlen(sym->help); int len = strlen(menu->help);
while (sym->help[--len] == '\n') while (menu->help[--len] == '\n')
sym->help[len] = 0; menu->help[len] = 0;
fprintf(out, " help\n%s\n", sym->help); fprintf(out, " help\n%s\n", menu->help);
} }
fputc('\n', out); fputc('\n', out);
} }
......
...@@ -402,7 +402,7 @@ help_start: T_HELP T_EOL ...@@ -402,7 +402,7 @@ help_start: T_HELP T_EOL
help: help_start T_HELPTEXT help: help_start T_HELPTEXT
{ {
current_entry->sym->help = $2; current_entry->help = $2;
}; };
/* depends option */ /* depends option */
...@@ -649,11 +649,11 @@ void print_symbol(FILE *out, struct menu *menu) ...@@ -649,11 +649,11 @@ void print_symbol(FILE *out, struct menu *menu)
break; break;
} }
} }
if (sym->help) { if (menu->help) {
int len = strlen(sym->help); int len = strlen(menu->help);
while (sym->help[--len] == '\n') while (menu->help[--len] == '\n')
sym->help[len] = 0; menu->help[len] = 0;
fprintf(out, " help\n%s\n", sym->help); fprintf(out, " help\n%s\n", menu->help);
} }
fputc('\n', out); fputc('\n', out);
} }
......
...@@ -23,6 +23,8 @@ int have_vmlinux = 0; ...@@ -23,6 +23,8 @@ int have_vmlinux = 0;
static int all_versions = 0; static int all_versions = 0;
/* If we are modposting external module set to 1 */ /* If we are modposting external module set to 1 */
static int external_module = 0; 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 */ /* Only warn about unresolved symbols */
static int warn_unresolved = 0; static int warn_unresolved = 0;
/* How a symbol is exported */ /* How a symbol is exported */
...@@ -584,13 +586,61 @@ static int strrcmp(const char *s, const char *sub) ...@@ -584,13 +586,61 @@ static int strrcmp(const char *s, const char *sub)
return memcmp(s + slen - sublen, sub, sublen); return memcmp(s + slen - sublen, sub, sublen);
} }
/*
* Functions used only during module init is marked __init and is stored in
* a .init.text section. Likewise data is marked __initdata and stored in
* a .init.data section.
* If this section is one of these sections return 1
* See include/linux/init.h for the details
*/
static int init_section(const char *name)
{
if (strcmp(name, ".init") == 0)
return 1;
if (strncmp(name, ".init.", strlen(".init.")) == 0)
return 1;
return 0;
}
/*
* Functions used only during module exit is marked __exit and is stored in
* a .exit.text section. Likewise data is marked __exitdata and stored in
* a .exit.data section.
* If this section is one of these sections return 1
* See include/linux/init.h for the details
**/
static int exit_section(const char *name)
{
if (strcmp(name, ".exit.text") == 0)
return 1;
if (strcmp(name, ".exit.data") == 0)
return 1;
return 0;
}
/*
* Data sections are named like this:
* .data | .data.rel | .data.rel.*
* Return 1 if the specified section is a data section
*/
static int data_section(const char *name)
{
if ((strcmp(name, ".data") == 0) ||
(strcmp(name, ".data.rel") == 0) ||
(strncmp(name, ".data.rel.", strlen(".data.rel.")) == 0))
return 1;
else
return 0;
}
/** /**
* Whitelist to allow certain references to pass with no warning. * Whitelist to allow certain references to pass with no warning.
* *
* Pattern 0: * Pattern 0:
* Do not warn if funtion/data are marked with __init_refok/__initdata_refok. * Do not warn if funtion/data are marked with __init_refok/__initdata_refok.
* The pattern is identified by: * The pattern is identified by:
* fromsec = .text.init.refok | .data.init.refok * fromsec = .text.init.refok* | .data.init.refok*
* *
* Pattern 1: * Pattern 1:
* If a module parameter is declared __initdata and permissions=0 * If a module parameter is declared __initdata and permissions=0
...@@ -608,8 +658,8 @@ static int strrcmp(const char *s, const char *sub) ...@@ -608,8 +658,8 @@ static int strrcmp(const char *s, const char *sub)
* These functions may often be marked __init and we do not want to * These functions may often be marked __init and we do not want to
* warn here. * warn here.
* the pattern is identified by: * the pattern is identified by:
* tosec = .init.text | .exit.text | .init.data * tosec = init or exit section
* fromsec = .data | .data.rel | .data.rel.* * fromsec = data section
* atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console, *_timer * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console, *_timer
* *
* Pattern 3: * Pattern 3:
...@@ -625,12 +675,18 @@ static int strrcmp(const char *s, const char *sub) ...@@ -625,12 +675,18 @@ static int strrcmp(const char *s, const char *sub)
* This pattern is identified by * This pattern is identified by
* refsymname = __init_begin, _sinittext, _einittext * refsymname = __init_begin, _sinittext, _einittext
* *
* Pattern 5:
* Xtensa uses literal sections for constants that are accessed PC-relative.
* Literal sections may safely reference their text sections.
* (Note that the name for the literal section omits any trailing '.text')
* tosec = <section>[.text]
* fromsec = <section>.literal
**/ **/
static int secref_whitelist(const char *modname, const char *tosec, static int secref_whitelist(const char *modname, const char *tosec,
const char *fromsec, const char *atsym, const char *fromsec, const char *atsym,
const char *refsymname) const char *refsymname)
{ {
int f1 = 1, f2 = 1; int len;
const char **s; const char **s;
const char *pat2sym[] = { const char *pat2sym[] = {
"driver", "driver",
...@@ -652,35 +708,20 @@ static int secref_whitelist(const char *modname, const char *tosec, ...@@ -652,35 +708,20 @@ static int secref_whitelist(const char *modname, const char *tosec,
}; };
/* Check for pattern 0 */ /* Check for pattern 0 */
if ((strcmp(fromsec, ".text.init.refok") == 0) || if ((strncmp(fromsec, ".text.init.refok", strlen(".text.init.refok")) == 0) ||
(strcmp(fromsec, ".data.init.refok") == 0)) (strncmp(fromsec, ".data.init.refok", strlen(".data.init.refok")) == 0))
return 1; return 1;
/* Check for pattern 1 */ /* Check for pattern 1 */
if (strcmp(tosec, ".init.data") != 0) if ((strcmp(tosec, ".init.data") == 0) &&
f1 = 0; (strncmp(fromsec, ".data", strlen(".data")) == 0) &&
if (strncmp(fromsec, ".data", strlen(".data")) != 0) (strncmp(atsym, "__param", strlen("__param")) == 0))
f1 = 0; return 1;
if (strncmp(atsym, "__param", strlen("__param")) != 0)
f1 = 0;
if (f1)
return f1;
/* Check for pattern 2 */ /* Check for pattern 2 */
if ((strcmp(tosec, ".init.text") != 0) && if ((init_section(tosec) || exit_section(tosec)) && data_section(fromsec))
(strcmp(tosec, ".exit.text") != 0) &&
(strcmp(tosec, ".init.data") != 0))
f2 = 0;
if ((strcmp(fromsec, ".data") != 0) &&
(strcmp(fromsec, ".data.rel") != 0) &&
(strncmp(fromsec, ".data.rel.", strlen(".data.rel.")) != 0))
f2 = 0;
for (s = pat2sym; *s; s++) for (s = pat2sym; *s; s++)
if (strrcmp(atsym, *s) == 0) if (strrcmp(atsym, *s) == 0)
f1 = 1;
if (f1 && f2)
return 1; return 1;
/* Check for pattern 3 */ /* Check for pattern 3 */
...@@ -694,6 +735,15 @@ static int secref_whitelist(const char *modname, const char *tosec, ...@@ -694,6 +735,15 @@ static int secref_whitelist(const char *modname, const char *tosec,
if (strcmp(refsymname, *s) == 0) if (strcmp(refsymname, *s) == 0)
return 1; return 1;
/* Check for pattern 5 */
if (strrcmp(tosec, ".text") == 0)
len = strlen(tosec) - strlen(".text");
else
len = strlen(tosec);
if ((strncmp(tosec, fromsec, len) == 0) && (strlen(fromsec) > len) &&
(strcmp(fromsec + len, ".literal") == 0))
return 1;
return 0; return 0;
} }
...@@ -822,9 +872,9 @@ static void warn_sec_mismatch(const char *modname, const char *fromsec, ...@@ -822,9 +872,9 @@ static void warn_sec_mismatch(const char *modname, const char *fromsec,
refsymname = elf->strtab + refsym->st_name; refsymname = elf->strtab + refsym->st_name;
/* check whitelist - we may ignore it */ /* check whitelist - we may ignore it */
if (before && if (secref_whitelist(modname, secname, fromsec,
secref_whitelist(modname, secname, fromsec, before ? elf->strtab + before->st_name : "",
elf->strtab + before->st_name, refsymname)) refsymname))
return; return;
if (before && after) { if (before && after) {
...@@ -1077,6 +1127,8 @@ static int initexit_section_ref_ok(const char *name) ...@@ -1077,6 +1127,8 @@ static int initexit_section_ref_ok(const char *name)
".smp_locks", ".smp_locks",
".stab", ".stab",
".m68k_fixup", ".m68k_fixup",
".xt.prop", /* xtensa informational section */
".xt.lit", /* xtensa informational section */
NULL NULL
}; };
/* Start of section names */ /* Start of section names */
...@@ -1106,21 +1158,6 @@ static int initexit_section_ref_ok(const char *name) ...@@ -1106,21 +1158,6 @@ static int initexit_section_ref_ok(const char *name)
return 0; return 0;
} }
/**
* Functions used only during module init is marked __init and is stored in
* a .init.text section. Likewise data is marked __initdata and stored in
* a .init.data section.
* If this section is one of these sections return 1
* See include/linux/init.h for the details
**/
static int init_section(const char *name)
{
if (strcmp(name, ".init") == 0)
return 1;
if (strncmp(name, ".init.", strlen(".init.")) == 0)
return 1;
return 0;
}
/* /*
* Identify sections from which references to a .init section is OK. * Identify sections from which references to a .init section is OK.
...@@ -1177,23 +1214,6 @@ static int init_section_ref_ok(const char *name) ...@@ -1177,23 +1214,6 @@ static int init_section_ref_ok(const char *name)
return 0; return 0;
} }
/*
* Functions used only during module exit is marked __exit and is stored in
* a .exit.text section. Likewise data is marked __exitdata and stored in
* a .exit.data section.
* If this section is one of these sections return 1
* See include/linux/init.h for the details
**/
static int exit_section(const char *name)
{
if (strcmp(name, ".exit.text") == 0)
return 1;
if (strcmp(name, ".exit.data") == 0)
return 1;
return 0;
}
/* /*
* Identify sections from which references to a .exit section is OK. * Identify sections from which references to a .exit section is OK.
*/ */
...@@ -1257,8 +1277,10 @@ static void read_symbols(char *modname) ...@@ -1257,8 +1277,10 @@ static void read_symbols(char *modname)
handle_modversions(mod, &info, sym, symname); handle_modversions(mod, &info, sym, symname);
handle_moddevtable(mod, &info, sym, symname); handle_moddevtable(mod, &info, sym, symname);
} }
if (is_vmlinux(modname) && vmlinux_section_warnings) {
check_sec_ref(mod, modname, &info, init_section, init_section_ref_ok); check_sec_ref(mod, modname, &info, init_section, init_section_ref_ok);
check_sec_ref(mod, modname, &info, exit_section, exit_section_ref_ok); check_sec_ref(mod, modname, &info, exit_section, exit_section_ref_ok);
}
version = get_modinfo(info.modinfo, info.modinfo_len, "version"); version = get_modinfo(info.modinfo, info.modinfo_len, "version");
if (version) if (version)
...@@ -1626,7 +1648,7 @@ int main(int argc, char **argv) ...@@ -1626,7 +1648,7 @@ int main(int argc, char **argv)
int opt; int opt;
int err; int err;
while ((opt = getopt(argc, argv, "i:I:mo:aw")) != -1) { while ((opt = getopt(argc, argv, "i:I:mso:aw")) != -1) {
switch(opt) { switch(opt) {
case 'i': case 'i':
kernel_read = optarg; kernel_read = optarg;
...@@ -1644,6 +1666,9 @@ int main(int argc, char **argv) ...@@ -1644,6 +1666,9 @@ int main(int argc, char **argv)
case 'a': case 'a':
all_versions = 1; all_versions = 1;
break; break;
case 's':
vmlinux_section_warnings = 0;
break;
case 'w': case 'w':
warn_unresolved = 1; warn_unresolved = 1;
break; break;
......
...@@ -66,8 +66,8 @@ showmount --version 2>&1 | grep nfs-utils | awk \ ...@@ -66,8 +66,8 @@ showmount --version 2>&1 | grep nfs-utils | awk \
'NR==1{print "nfs-utils ", $NF}' 'NR==1{print "nfs-utils ", $NF}'
ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \ ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \
-e 's/\.so$//' | awk -F'[.-]' '{print "Linux C Library " \ -e 's/\.so$//' | sed -e 's/>//' | \
$(NF-2)"."$(NF-1)"."$NF}' awk -F'[.-]' '{print "Linux C Library "$(NF-1)"."$NF}'
ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \ ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \
'NR==1{print "Dynamic linker (ldd) ", $NF}' 'NR==1{print "Dynamic linker (ldd) ", $NF}'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment