On 18 Feb 2002 20:27:02 +0100,
Lionel DARNIS <xfs@xxxxxxxxxxx> wrote:
>
>I try to compile my cvs kernel 2.4.17xfs + freeswan 1.95 and I obtain :
>
>
>drivers/char/char.o(.data+0x46b4): undefined reference to `local symbols
>in discarded section .text.exit'
Old bugs in kernel being caught by new binutils. There are a lot of
patches in 2.4.17-pre3 through 2.4.18-rc1 to remove the kernel bugs.
Since you just added freeswan the bug might be in freeswan rather than
the main kernel. Run this script in the top level of your linux tree
to list the offending objects and report to l-k or freeswan
accordingly, this is not an XFS problem. Search the archives first,
most of the kernel bugs have been fixed.
#!/usr/bin/perl -w
#
# reference_discarded.pl (C) Keith Owens 2001 <kaos@xxxxxxxxxx>
#
# List dangling references to vmlinux discarded sections.
use strict;
die($0 . " takes no arguments\n") if($#ARGV >= 0);
my %object;
my $object;
my $line;
my $ignore;
$| = 1;
printf("Finding objects, ");
open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting
objdump list failed";
while (defined($line = <OBJDUMP_LIST>)) {
chomp($line);
if ($line =~ /:\s+file format/) {
($object = $line) =~ s/:.*//;
$object{$object}->{'module'} = 0;
$object{$object}->{'size'} = 0;
$object{$object}->{'off'} = 0;
}
if ($line =~ /^\s*\d+\s+\.modinfo\s+/) {
$object{$object}->{'module'} = 1;
}
if ($line =~ /^\s*\d+\s+\.comment\s+/) {
($object{$object}->{'size'}, $object{$object}->{'off'}) =
(split(' ', $line))[2,5];
}
}
close(OBJDUMP_LIST);
printf("%d objects, ", scalar keys(%object));
$ignore = 0;
foreach $object (keys(%object)) {
if ($object{$object}->{'module'}) {
++$ignore;
delete($object{$object});
}
}
printf("ignoring %d module(s)\n", $ignore);
# Ignore conglomerate objects, they have been built from multiple objects and we
# only care about the individual objects. If an object has more than one GCC:
# string in the comment section then it is conglomerate. This does not filter
# out conglomerates that consist of exactly one object, can't be helped.
printf("Finding conglomerates, ");
$ignore = 0;
foreach $object (keys(%object)) {
if (exists($object{$object}->{'off'})) {
my ($off, $size, $comment, $l);
$off = hex($object{$object}->{'off'});
$size = hex($object{$object}->{'size'});
open(OBJECT, "<$object") || die "cannot read $object";
seek(OBJECT, $off, 0) || die "seek to $off in $object failed";
$l = read(OBJECT, $comment, $size);
die "read $size bytes from $object .comment failed" if ($l !=
$size);
close(OBJECT);
if ($comment =~ /GCC\:.*GCC\:/m) {
++$ignore;
delete($object{$object});
}
}
}
printf("ignoring %d conglomerate(s)\n", $ignore);
printf("Scanning objects\n");
foreach $object (keys(%object)) {
my $from;
open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object";
while (defined($line = <OBJDUMP>)) {
chomp($line);
if ($line =~ /RELOCATION RECORDS FOR /) {
($from = $line) =~ s/.*\[([^]]*).*/$1/;
}
if (($line =~ /\.text\.exit$/ ||
$line =~ /\.data\.exit$/ ||
$line =~ /\.exitcall\.exit$/) &&
($from !~ /\.text\.exit$/ &&
$from !~ /\.data\.exit$/ &&
$from !~ /\.exitcall\.exit$/)) {
printf("Error: %s %s refers to %s\n", $object, $from,
$line);
}
}
close(OBJDUMP);
}
printf("Done\n");
|