2001-12-23 03:22:37

by Norbert Veber

[permalink] [raw]
Subject: [2.4.17] net/network.o(.text.lock+0x1a88): undefined reference to `local symbols...

Hi,

I read though the archives, and saw another problem with network.o and
gcc 3.x, however I didnt see anything about this yet.

I'm using gcc 2.95.4 and binutils 2.11.92.0.12.3, both from
debian/unstable.

Let me know if you need any more information.

make[1]: Leaving directory `/usr/src/linux/arch/i386/lib'
ld -m elf_i386 -T /usr/src/linux/arch/i386/vmlinux.lds -e stext arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o init/version.o \
--start-group \
arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o \
drivers/acpi/acpi.o drivers/char/char.o drivers/block/block.o drivers/misc/misc.o drivers/net/net.o drivers/media/media.o drivers/char/agp/agp.o drivers/char/drm/drm.o drivers/ide/idedriver.o drivers/cdrom/driver.o drivers/pci/driver.o drivers/pnp/pnp.o drivers/video/video.o \
net/network.o \
/usr/src/linux/arch/i386/lib/lib.a /usr/src/linux/lib/lib.a /usr/src/linux/arch/i386/lib/lib.a \
--end-group \
-o vmlinux
net/network.o(.text.lock+0x1a88): undefined reference to `local symbols in discarded section .text.exit'
make: *** [vmlinux] Error 1

PS. Please CC me any replies.

Thanks,

Norbert


Attachments:
(No filename) (1.19 kB)
(No filename) (232.00 B)
Download all attachments

2001-12-23 05:19:13

by Keith Owens

[permalink] [raw]
Subject: Re: [2.4.17] net/network.o(.text.lock+0x1a88): undefined reference to `local symbols...

On Sat, 22 Dec 2001 22:22:13 -0500,
[email protected] (Norbert Veber) wrote:
>net/network.o(.text.lock+0x1a88): undefined reference to `local symbols in discarded section .text.exit'

Got bored, wrote some Perl (Oh hang on, I've used that before).

net/network.o is not much help, it is a conglomerate object. I need
the individual object that is failing. cd linux and run
reference_discarded.pl below.

Any other patches applied?


#!/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");

2001-12-23 08:26:31

by Norbert Veber

[permalink] [raw]
Subject: Re: [2.4.17] net/network.o(.text.lock+0x1a88): undefined reference to `local symbols...

On Sun, Dec 23, 2001 at 04:18:39PM +1100, Keith Owens wrote:
> Got bored, wrote some Perl (Oh hang on, I've used that before).
>
> net/network.o is not much help, it is a conglomerate object. I need
> the individual object that is failing. cd linux and run
> reference_discarded.pl below.

nveber@pyre[9526:/usr/src/linux]$ ~/reference_discarded.pl
Finding objects, 790 objects, ignoring 132 module(s)
Finding conglomerates, ignoring 57 conglomerate(s)
Scanning objects
Error: ./net/ipv4/netfilter/ip_nat_snmp_basic.o .text.lock refers to 0000003c R_386_PC32 .text.exit
Done

>
> Any other patches applied?

Nope.

Thanks,

Norbert


Attachments:
(No filename) (643.00 B)
(No filename) (232.00 B)
Download all attachments

2001-12-23 10:28:18

by Vasil Kolev

[permalink] [raw]
Subject: Re: [2.4.17] net/network.o(.text.lock+0x1a88): undefined reference to `local symbols...

make[1]: Leaving directory `/usr/src/linux/arch/i386/lib'
ld -m elf_i386 -T /usr/src/linux/arch/i386/vmlinux.lds -e stext
arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o
init/version.o \
--start-group \
arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o
mm/mm.o fs/fs.o ipc/ipc.o \
drivers/char/char.o drivers/block/block.o drivers/misc/misc.o
drivers/net/net.o drivers/media/media.o drivers/char/agp/agp.o
drivers/net/wan/wan.o drivers/ide/idedriver.o drivers/cdrom/driver.o
drivers/sound/sounddrivers.o drivers/pci/driver.o
drivers/net/wireless/wireless_net.o drivers/pnp/pnp.o
drivers/video/video.o \
net/network.o \
/usr/src/linux/arch/i386/lib/lib.a /usr/src/linux/lib/lib.a
/usr/src/linux/arch/i386/lib/lib.a \
--end-group \
-o vmlinux
drivers/net/net.o(.data+0x514): undefined reference to `local symbols in
discarded section .text.exit'
make: *** [vmlinux] Error 1


# ./reference_discarded.pl
Finding objects, 538 objects, ignoring 0 module(s)
Finding conglomerates, ignoring 48 conglomerate(s)
Scanning objects
Error: ./drivers/net/dmfe.o .data refers to 00000514 R_386_32
.text.exit
Done


2001-12-23 11:12:22

by Tobias Ringstrom

[permalink] [raw]
Subject: Re: [2.4.17] net/network.o(.text.lock+0x1a88): undefined reference to `local symbols...

On Sun, 23 Dec 2001, Vasil Kolev wrote:

> # ./reference_discarded.pl
> Finding objects, 538 objects, ignoring 0 module(s)
> Finding conglomerates, ignoring 48 conglomerate(s)
> Scanning objects
> Error: ./drivers/net/dmfe.o .data refers to 00000514 R_386_32
> .text.exit
> Done

Does this patch fix the problem?

/Tobias

--- dmfe.c.orig Fri Nov 23 13:14:17 2001
+++ dmfe.c Sun Dec 23 12:09:25 2001
@@ -527,7 +527,7 @@
}


-static void __exit dmfe_remove_one (struct pci_dev *pdev)
+static void __devexit dmfe_remove_one (struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct dmfe_board_info *db = dev->priv;
@@ -2059,7 +2059,7 @@
name: "dmfe",
id_table: dmfe_pci_tbl,
probe: dmfe_init_one,
- remove: dmfe_remove_one,
+ remove: __devexit_p(dmfe_remove_one),
};

MODULE_AUTHOR("Sten Wang, [email protected]");


2001-12-23 11:29:04

by Keith Owens

[permalink] [raw]
Subject: Re: [2.4.17] net/network.o(.text.lock+0x1a88): undefined reference to `local symbols...

On Sun, 23 Dec 2001 12:27:50 +0200 (EET),
Vasil Kolev <[email protected]> wrote:
># ./reference_discarded.pl
>Finding objects, 538 objects, ignoring 0 module(s)
>Finding conglomerates, ignoring 48 conglomerate(s)
>Scanning objects
>Error: ./drivers/net/dmfe.o .data refers to 00000514 R_386_32
>.text.exit
>Done

AFAICT dmfe.c is hotplug aware, it has the required probe and remove
pci_driver functions. But dmfe_remove_one is defined as __exit instead
of __devexit, it should probably be changed to __devexit and change
remove: dmfe_remove_one
to
remove: __devexit_p(dmfe_remove_one)

The dmfe maintainer and/or Jeff Garzik needs to decide.

2001-12-23 11:32:37

by Dave Jones

[permalink] [raw]
Subject: Re: [2.4.17] net/network.o(.text.lock+0x1a88): undefined reference to `local symbols...

On Sun, 23 Dec 2001, Tobias Ringstrom wrote:

> On Sun, 23 Dec 2001, Vasil Kolev wrote:
> > # ./reference_discarded.pl
> > Finding objects, 538 objects, ignoring 0 module(s)
> > Finding conglomerates, ignoring 48 conglomerate(s)
> > Scanning objects
> > Error: ./drivers/net/dmfe.o .data refers to 00000514 R_386_32
> > .text.exit
> > Done
>
> Does this patch fix the problem?
>
> /Tobias
>
> --- dmfe.c.orig Fri Nov 23 13:14:17 2001
> +++ dmfe.c Sun Dec 23 12:09:25 2001
> @@ -527,7 +527,7 @@
> }
>
> -static void __exit dmfe_remove_one (struct pci_dev *pdev)
> +static void __devexit dmfe_remove_one (struct pci_dev *pdev)
> {
> struct net_device *dev = pci_get_drvdata(pdev);
> struct dmfe_board_info *db = dev->priv;
> @@ -2059,7 +2059,7 @@
> name: "dmfe",
> id_table: dmfe_pci_tbl,
> probe: dmfe_init_one,
> - remove: dmfe_remove_one,
> + remove: __devexit_p(dmfe_remove_one),

Note, that this patch was dropped between rc2 & final,
(on Jeff's request iirc).

Dave.

--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs

2001-12-23 11:38:18

by Dan Chen

[permalink] [raw]
Subject: Re: [2.4.17] net/network.o(.text.lock+0x1a88): undefined reference to `local symbols...

On Sun, Dec 23, 2001 at 10:28:19PM +1100, Keith Owens wrote:
> AFAICT dmfe.c is hotplug aware, it has the required probe and remove
> pci_driver functions. But dmfe_remove_one is defined as __exit instead
> of __devexit, it should probably be changed to __devexit and change
> remove: dmfe_remove_one
> to
> remove: __devexit_p(dmfe_remove_one)
>
> The dmfe maintainer and/or Jeff Garzik needs to decide.

This is one of the hunks I submitted and is in .17-rc2 but was
removed (along with a bunch of incorrect ones I did, oops) in
-final.

--
Dan Chen [email protected]
GPG key: http://www.unc.edu/~crimsun/pubkey.gpg.asc


Attachments:
(No filename) (664.00 B)
(No filename) (232.00 B)
Download all attachments