scripts/namespace.pl: some bug fixes

1. Teach namespace.pl to understand "V" and "v"
2. cond_syscalls are moved into kernel/sys_ni.c

Signed-off-by: Amerigo Wang <amwang@redhat.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
This commit is contained in:
Amerigo Wang 2010-10-27 12:42:01 -07:00 committed by Michal Marek
parent 43f683c9e4
commit e8cf981346

View file

@ -266,6 +266,7 @@ sub do_nm
# T global label/procedure # T global label/procedure
# U external reference # U external reference
# W weak external reference to text that has been resolved # W weak external reference to text that has been resolved
# V similar to W, but the value of the weak symbol becomes zero with no error.
# a assembler equate # a assembler equate
# b static variable, uninitialised # b static variable, uninitialised
# d static variable, initialised # d static variable, initialised
@ -274,8 +275,9 @@ sub do_nm
# s static variable, uninitialised, small bss # s static variable, uninitialised, small bss
# t static label/procedures # t static label/procedures
# w weak external reference to text that has not been resolved # w weak external reference to text that has not been resolved
# v similar to w
# ? undefined type, used a lot by modules # ? undefined type, used a lot by modules
if ($type !~ /^[ABCDGRSTUWabdgrstw?]$/) { if ($type !~ /^[ABCDGRSTUWVabdgrstwv?]$/) {
printf STDERR "nm output for $fullname contains unknown type '$_'\n"; printf STDERR "nm output for $fullname contains unknown type '$_'\n";
} }
elsif ($name =~ /\./) { elsif ($name =~ /\./) {
@ -286,7 +288,7 @@ sub do_nm
# binutils keeps changing the type for exported symbols, force it to R # binutils keeps changing the type for exported symbols, force it to R
$type = 'R' if ($name =~ /^__ksymtab/ || $name =~ /^__kstrtab/); $type = 'R' if ($name =~ /^__ksymtab/ || $name =~ /^__kstrtab/);
$name =~ s/_R[a-f0-9]{8}$//; # module versions adds this $name =~ s/_R[a-f0-9]{8}$//; # module versions adds this
if ($type =~ /[ABCDGRSTW]/ && if ($type =~ /[ABCDGRSTWV]/ &&
$name ne 'init_module' && $name ne 'init_module' &&
$name ne 'cleanup_module' && $name ne 'cleanup_module' &&
$name ne 'Using_Versions' && $name ne 'Using_Versions' &&
@ -353,11 +355,12 @@ sub list_multiply_defined
foreach my $name (keys(%def)) { foreach my $name (keys(%def)) {
if ($#{$def{$name}} > 0) { if ($#{$def{$name}} > 0) {
# Special case for cond_syscall # Special case for cond_syscall
if ($#{$def{$name}} == 1 && $name =~ /^sys_/ && if ($#{$def{$name}} == 1 && $name =~ /^sys_/) {
($def{$name}[0] eq "kernel/sys.o" || if($def{$name}[0] eq "kernel/sys_ni.o" ||
$def{$name}[1] eq "kernel/sys.o")) { $def{$name}[1] eq "kernel/sys_ni.o") {
&drop_def("kernel/sys.o", $name); &drop_def("kernel/sys_ni.o", $name);
next; next;
}
} }
# Special case for i386 entry code # Special case for i386 entry code
if ($#{$def{$name}} == 1 && $name =~ /^__kernel_/ && if ($#{$def{$name}} == 1 && $name =~ /^__kernel_/ &&