History

kbuild: remove obsoleted scripts/reference_* files

The checks performed by scripts/reference_* has been moved to modpost. Remove the files and their reference in top-level Makefile.

Sam Ravnborg committed 20 years ago

Commit eae0f531 parent 6c2133e3 files · +0 −226Browse files

Showing the changes to scripts (2 of 3 files). Show all

Unified · Split

2 files
  1. scripts/reference_discarded.pl +0 −112
  2. scripts/reference_init.pl +0 −108
scripts/reference_discarded.pl+0−112
@@ -1,112 +0,0 @@
1−#!/usr/bin/perl -w
2−#
3−# reference_discarded.pl (C) Keith Owens 2001 <kaos@ocs.com.au>
4−#
5−# Released under GPL V2.
6−#
7−# List dangling references to vmlinux discarded sections.
8−
9−use strict;
10−die($0 . " takes no arguments\n") if($#ARGV >= 0);
11−
12−my %object;
13−my $object;
14−my $line;
15−my $ignore;
16−my $errorcount;
17−
18−$| = 1;
19−
20−# printf("Finding objects, ");
21−open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed";
22−while (defined($line = <OBJDUMP_LIST>)) {
23− chomp($line);
24− if ($line =~ /:\s+file format/) {
25− ($object = $line) =~ s/:.*//;
26− $object{$object}->{'module'} = 0;
27− $object{$object}->{'size'} = 0;
28− $object{$object}->{'off'} = 0;
29− }
30− if ($line =~ /^\s*\d+\s+\.modinfo\s+/) {
31− $object{$object}->{'module'} = 1;
32− }
33− if ($line =~ /^\s*\d+\s+\.comment\s+/) {
34− ($object{$object}->{'size'}, $object{$object}->{'off'}) = (split(' ', $line))[2,5];
35− }
36−}
37−close(OBJDUMP_LIST);
38−# printf("%d objects, ", scalar keys(%object));
39−$ignore = 0;
40−foreach $object (keys(%object)) {
41− if ($object{$object}->{'module'}) {
42− ++$ignore;
43− delete($object{$object});
44− }
45−}
46−# printf("ignoring %d module(s)\n", $ignore);
47−
48−# Ignore conglomerate objects, they have been built from multiple objects and we
49−# only care about the individual objects. If an object has more than one GCC:
50−# string in the comment section then it is conglomerate. This does not filter
51−# out conglomerates that consist of exactly one object, can't be helped.
52−
53−# printf("Finding conglomerates, ");
54−$ignore = 0;
55−foreach $object (keys(%object)) {
56− if (exists($object{$object}->{'off'})) {
57− my ($off, $size, $comment, $l);
58− $off = hex($object{$object}->{'off'});
59− $size = hex($object{$object}->{'size'});
60− open(OBJECT, "<$object") || die "cannot read $object";
61− seek(OBJECT, $off, 0) || die "seek to $off in $object failed";
62− $l = read(OBJECT, $comment, $size);
63− die "read $size bytes from $object .comment failed" if ($l != $size);
64− close(OBJECT);
65− if ($comment =~ /GCC\:.*GCC\:/m || $object =~ /built-in\.o/) {
66− ++$ignore;
67− delete($object{$object});
68− }
69− }
70−}
71−# printf("ignoring %d conglomerate(s)\n", $ignore);
72−
73−# printf("Scanning objects\n");
74−
75−# Keith Ownes <kaos@sgi.com> commented:
76−# For our future {in}sanity, add a comment that this is the ppc .opd
77−# section, not the ia64 .opd section.
78−# ia64 .opd should not point to discarded sections.
79−$errorcount = 0;
80−foreach $object (keys(%object)) {
81− my $from;
82− open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object";
83− while (defined($line = <OBJDUMP>)) {
84− chomp($line);
85− if ($line =~ /RELOCATION RECORDS FOR /) {
86− ($from = $line) =~ s/.*\[([^]]*).*/$1/;
87− }
88− if (($line =~ /\.text\.exit$/ ||
89− $line =~ /\.exit\.text$/ ||
90− $line =~ /\.data\.exit$/ ||
91− $line =~ /\.exit\.data$/ ||
92− $line =~ /\.exitcall\.exit$/) &&
93− ($from !~ /\.text\.exit$/ &&
94− $from !~ /\.exit\.text$/ &&
95− $from !~ /\.data\.exit$/ &&
96− $from !~ /\.opd$/ &&
97− $from !~ /\.exit\.data$/ &&
98− $from !~ /\.altinstructions$/ &&
99− $from !~ /\.pdr$/ &&
100− $from !~ /\.debug_.*$/ &&
101− $from !~ /\.exitcall\.exit$/ &&
102− $from !~ /\.eh_frame$/ &&
103− $from !~ /\.stab$/)) {
104− printf("Error: %s %s refers to %s\n", $object, $from, $line);
105− $errorcount = $errorcount + 1;
106− }
107− }
108− close(OBJDUMP);
109−}
110−# printf("Done\n");
111−
112−exit(0);
scripts/reference_init.pl+0−108
@@ -1,108 +0,0 @@
1−#!/usr/bin/perl -w
2−#
3−# reference_init.pl (C) Keith Owens 2002 <kaos@ocs.com.au>
4−#
5−# List references to vmlinux init sections from non-init sections.
6−
7−# Unfortunately I had to exclude references from read only data to .init
8−# sections, almost all of these are false positives, they are created by
9−# gcc. The downside of excluding rodata is that there really are some
10−# user references from rodata to init code, e.g. drivers/video/vgacon.c
11−#
12−# const struct consw vga_con = {
13−# con_startup: vgacon_startup,
14−#
15−# where vgacon_startup is __init. If you want to wade through the false
16−# positives, take out the check for rodata.
17−
18−use strict;
19−die($0 . " takes no arguments\n") if($#ARGV >= 0);
20−
21−my %object;
22−my $object;
23−my $line;
24−my $ignore;
25−
26−$| = 1;
27−
28−printf("Finding objects, ");
29−open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed";
30−while (defined($line = <OBJDUMP_LIST>)) {
31− chomp($line);
32− if ($line =~ /:\s+file format/) {
33− ($object = $line) =~ s/:.*//;
34− $object{$object}->{'module'} = 0;
35− $object{$object}->{'size'} = 0;
36− $object{$object}->{'off'} = 0;
37− }
38− if ($line =~ /^\s*\d+\s+\.modinfo\s+/) {
39− $object{$object}->{'module'} = 1;
40− }
41− if ($line =~ /^\s*\d+\s+\.comment\s+/) {
42− ($object{$object}->{'size'}, $object{$object}->{'off'}) = (split(' ', $line))[2,5];
43− }
44−}
45−close(OBJDUMP_LIST);
46−printf("%d objects, ", scalar keys(%object));
47−$ignore = 0;
48−foreach $object (keys(%object)) {
49− if ($object{$object}->{'module'}) {
50− ++$ignore;
51− delete($object{$object});
52− }
53−}
54−printf("ignoring %d module(s)\n", $ignore);
55−
56−# Ignore conglomerate objects, they have been built from multiple objects and we
57−# only care about the individual objects. If an object has more than one GCC:
58−# string in the comment section then it is conglomerate. This does not filter
59−# out conglomerates that consist of exactly one object, can't be helped.
60−
61−printf("Finding conglomerates, ");
62−$ignore = 0;
63−foreach $object (keys(%object)) {
64− if (exists($object{$object}->{'off'})) {
65− my ($off, $size, $comment, $l);
66− $off = hex($object{$object}->{'off'});
67− $size = hex($object{$object}->{'size'});
68− open(OBJECT, "<$object") || die "cannot read $object";
69− seek(OBJECT, $off, 0) || die "seek to $off in $object failed";
70− $l = read(OBJECT, $comment, $size);
71− die "read $size bytes from $object .comment failed" if ($l != $size);
72− close(OBJECT);
73− if ($comment =~ /GCC\:.*GCC\:/m || $object =~ /built-in\.o/) {
74− ++$ignore;
75− delete($object{$object});
76− }
77− }
78−}
79−printf("ignoring %d conglomerate(s)\n", $ignore);
80−
81−printf("Scanning objects\n");
82−foreach $object (sort(keys(%object))) {
83− my $from;
84− open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object";
85− while (defined($line = <OBJDUMP>)) {
86− chomp($line);
87− if ($line =~ /RELOCATION RECORDS FOR /) {
88− ($from = $line) =~ s/.*\[([^]]*).*/$1/;
89− }
90− if (($line =~ /\.init$/ || $line =~ /\.init\./) &&
91− ($from !~ /\.init$/ &&
92− $from !~ /\.init\./ &&
93− $from !~ /\.stab$/ &&
94− $from !~ /\.rodata$/ &&
95− $from !~ /\.text\.lock$/ &&
96− $from !~ /\.pci_fixup_header$/ &&
97− $from !~ /\.pci_fixup_final$/ &&
98− $from !~ /\.pdr$/ &&
99− $from !~ /\__param$/ &&
100− $from !~ /\.altinstructions/ &&
101− $from !~ /\.eh_frame/ &&
102− $from !~ /\.debug_/)) {
103− printf("Error: %s %s refers to %s\n", $object, $from, $line);
104− }
105− }
106− close(OBJDUMP);
107−}
108−printf("Done\n");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t