Skip to content

Commit 24a54f7

Browse files
Stephen Hemmingermichal42
authored andcommitted
namespace: add source file location exceptions
Teach namespace checker about some special case files where the source is in unusual location. This fixes many of the source file not found errors (more can be added), and also prevents false positives for functions not being used. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent 532cf29 commit 24a54f7

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎scripts/namespace.pl‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,26 @@
141141
'VDSO32_sigreturn' => 1,
142142
);
143143

144+
# Files with exceptions to source file location
145+
my %sourceloc = (
146+
'net/dccp/dccp_probe.o' => 'probe',
147+
'net/dccp/dccp_ipv4.o' => 'ipv4',
148+
'net/dccp/dccp_ipv6.o' => 'ipv6',
149+
'net/dccp/dccp_diag.o' => 'diag',
150+
'drivers/char/hw_random/rng-core.o' => 'core',
151+
'fs/fat/msdos.o' => 'namei_msdos',
152+
'fs/fat/vfat.o' => 'namei_vfat',
153+
'fs/nfs_common/nfs_acl.o' => 'nfsacl',
154+
'sound/soundcore.o' => 'sound_core',
155+
'drivers/md/dm-mirror.o' => 'dm-raid1',
156+
'drivers/message/i2o/i2o_bus.o' => 'bus-osm',
157+
'arch/x86/kvm/kvm-amd.o' => 'svm',
158+
'arch/x86/kvm/kvm-intel.o' => 'vmx',
159+
'arch/x86/crypto/twofish-x86_64.o' => 'twofish-x86_64-asm_64',
160+
'arch/x86/crypto/aes-x86_64.o' => 'aes-x86_64-asm_64',
161+
'arch/x86/crypto/aesni-intel.o' => 'aesni-intel_asm',
162+
'arch/x86/crypto/salsa20-x86_64.o' => 'salsa20-x86_64-asm_64',
163+
);
144164

145165
&find(\&linux_objects, '.'); # find the objects and do_nm on them
146166
&list_multiply_defined();
@@ -228,11 +248,15 @@ sub do_nm
228248
return;
229249
}
230250
($source = $basename) =~ s/\.o$//;
251+
252+
$source = $sourceloc{$fullname} if ($sourceloc{$fullname});
253+
231254
if (-e "$source.c" || -e "$source.S") {
232255
$source = "$objtree$File::Find::dir/$source";
233256
} else {
234257
$source = "$srctree$File::Find::dir/$source";
235258
}
259+
236260
if (! -e "$source.c" && ! -e "$source.S") {
237261
# No obvious source, exclude the object if it is conglomerate
238262
open(my $objdumpdata, "$objdump $basename|")

0 commit comments

Comments
 (0)