Skip to content

Commit d35cb36

Browse files
Mathieu Desnoyerstorvalds
authored andcommitted
markers: fix duplicate modpost entry
When a kernel was rebuilt, the previous Module.markers was not cleared. It caused markers with different format strings to appear as duplicates when a markers was changed. This problem is present since scripts/mod/modpost.c started to generate Module.markers, commit b2e3e65 It therefore applies to 2.6.25, 2.6.26 and linux-next. I merely merged the patches from Roland, Wenji and Takashi here. Credits to Roland McGrath <roland@redhat.com> Wenji Huang <wenji.huang@oracle.com> and Takashi Nishiie <t-nishiie@np.css.fujitsu.com> for providing the individual fixes. - Changelog : - Integrated Takashi's Makefile modification to clear Module.markers upon make clean. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Roland McGrath <roland@redhat.com> Cc: Wenji Huang <wenji.huang@oracle.com> Cc: Takashi Nishiie <t-nishiie@np.css.fujitsu.com> Cc: <stable@kernel.org> [2.6.25.x, 2.6.26.x] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5f17156 commit d35cb36

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,8 @@ clean: archclean $(clean-dirs)
11481148
@find . $(RCS_FIND_IGNORE) \
11491149
\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
11501150
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
1151-
-o -name '*.symtypes' -o -name 'modules.order' \) \
1151+
-o -name '*.symtypes' -o -name 'modules.order' \
1152+
-o -name 'Module.markers' \) \
11521153
-type f -print | xargs rm -f
11531154

11541155
# mrproper - Delete all generated files, including .config

‎scripts/Makefile.modpost‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ quiet_cmd_kernel-mod = MODPOST $@
101101
cmd_kernel-mod = $(modpost) $@
102102

103103
vmlinux.o: FORCE
104+
@rm -fr $(kernelmarkersfile)
104105
$(call cmd,kernel-mod)
105106

106107
# Declare generated files as targets for modpost

‎scripts/mod/modpost.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,8 @@ static void read_markers(const char *fname)
19921992
mod->skip = 1;
19931993
}
19941994

1995-
add_marker(mod, marker, fmt);
1995+
if (!mod->skip)
1996+
add_marker(mod, marker, fmt);
19961997
}
19971998
return;
19981999
fail:

0 commit comments

Comments
 (0)