Skip to contentSkip to conversation

(2.5.5-dj2) still getting .text.exit linker errors

DISCUSSION James Curbo 3 participants 4 messages Feb 27, 2002 – Feb 28, 2002

lore
Share & tools
lore
#0 lore raw

[note: I am not subscribed, please cc: me in replies]

When compiling 2.5.5-dj2, I am still getting a .text.exit linker error:

drivers/net/net.o(.data+0x1274): undefined reference to `local symbols in discarded section .text.exit'

I am using Debian unstable, binutils 2.11.93.0.2:

ii binutils 2.11.93.0.2-2

I can get it to link if I follow the directions that the Debian maintainer has been giving out (deleting the .text.exit line from vmlinux.lds) but that isn't the right solution, and I don't have the abilities to actually fix it. My ver_linux output is appeneded at the end. Thanks in advance.

James

Linux carthage 2.5.5-dj2 #1 Wed Feb 27 01:08:00 CST 2002 i686 unknown

Gnu C                  2.95.4
Gnu make               3.79.1
util-linux             2.11n
mount                  2.11n
modutils               2.4.13
e2fsprogs              1.26
Linux C Library        2.2.5
Dynamic linker (ldd)   2.2.5
Procps                 2.0.7
Net-tools              1.60
Console-tools          0.2.3
Sh-utils               2.0.11
Modules Loaded         emu10k1 ac97_codec sound
Signature · 4 lines
James Curbo <[email protected]> <[email protected]>
Undergraduate Computer Science, Henderson State University
PGP Keys at <http://reddie.henderson.edu/~curboj/>
Public Keys: PGP - 1024/0x76E2061B GNUPG - 1024D/0x3EEA7288
#2 lore raw
In reply to James Curbo
Quoted 6 lines · James Curbo

[note: I am not subscribed, please cc: me in replies]

When compiling 2.5.5-dj2, I am still getting a .text.exit linker error:

drivers/net/net.o(.data+0x1274): undefined reference to `local symbols in discarded section .text.exit'

Run this script to identify the offending object in net.o then contact the object maintainer.

#!/usr/bin/perl -w
#

# reference_discarded.pl (C) Keith Owens 2001 <[email protected]>
#
# 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");

#3 lore raw
In reply to James Curbo

OK, here it is:

Finding objects, 513 objects, ignoring 0 module(s) Finding conglomerates, ignoring 53 conglomerate(s) Scanning objects
Error: ./drivers/net/de2104x.o .data refers to 00000074 R_386_32 .text.exit
Done

Quoted 10 lines · Dave Jones
Quoted 2 lines · James Curbo

drivers/net/net.o(.data+0x1274): undefined reference to `local symbols in discarded section .text.exit'

Can you grab http://kernelnewbies.org/scripts/reference_discarded.pl
and post the output ?

Signature · 2 lines
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs
Signature · 4 lines
James Curbo <[email protected]> <[email protected]>
Undergraduate Computer Science, Henderson State University
PGP Keys at <http://reddie.henderson.edu/~curboj/>
Public Keys: PGP - 1024/0x76E2061B GNUPG - 1024D/0x3EEA7288