* Sound fails to build when non-modular with new binutils
@ 2001-12-28 15:16 André Dahlqvist
2001-12-28 16:23 ` Keith Owens
0 siblings, 1 reply; 5+ messages in thread
From: André Dahlqvist @ 2001-12-28 15:16 UTC (permalink / raw)
To: linux-kernel
Hi everyone,
The new binutils in Debian uncovered a few bugs in the kernel, but I
have not yet seen anyone post a patch for the problem where building
sound with via82cxxx_audio set as non-modular fails with:
drivers/sound/sounddrivers.o(.data+0xb4): undefined reference to `local symbols in discarded section .text.exit'
make: *** [vmlinux] Error 1
Does anyone have a fix for this?
--
André Dahlqvist <andre.dahlqvist@telia.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Sound fails to build when non-modular with new binutils
2001-12-28 15:16 Sound fails to build when non-modular with new binutils André Dahlqvist
@ 2001-12-28 16:23 ` Keith Owens
2001-12-28 17:03 ` André Dahlqvist
0 siblings, 1 reply; 5+ messages in thread
From: Keith Owens @ 2001-12-28 16:23 UTC (permalink / raw)
To: André Dahlqvist; +Cc: linux-kernel
On Fri, 28 Dec 2001 16:16:08 +0100,
=?iso-8859-1?Q?Andr=E9?= Dahlqvist <andre.dahlqvist@telia.com> wrote:
>The new binutils in Debian uncovered a few bugs in the kernel, but I
>have not yet seen anyone post a patch for the problem where building
>sound with via82cxxx_audio set as non-modular fails with:
>
>drivers/sound/sounddrivers.o(.data+0xb4): undefined reference to `local symbols in discarded section .text.exit'
Run this, it will say precisely where the problem lies:
#!/usr/bin/perl -w
#
# reference_discarded.pl (C) Keith Owens 2001 <kaos@ocs.com.au>
#
# 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");
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Sound fails to build when non-modular with new binutils
2001-12-28 16:23 ` Keith Owens
@ 2001-12-28 17:03 ` André Dahlqvist
2001-12-28 18:29 ` Andrew Morton
0 siblings, 1 reply; 5+ messages in thread
From: André Dahlqvist @ 2001-12-28 17:03 UTC (permalink / raw)
To: linux-kernel
Keith Owens <kaos@ocs.com.au> wrote:
> Run this, it will say precisely where the problem lies:
Thanks Keith. Below is the output:
Finding objects, 315 objects, ignoring 0 module(s)
Finding conglomerates, ignoring 29 conglomerate(s)
Scanning objects
Error: ./drivers/sound/via82cxxx_audio.o .data refers to 00000034
R_386_32 .text.exit
Done
--
André Dahlqvist <andre.dahlqvist@telia.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Sound fails to build when non-modular with new binutils
2001-12-28 17:03 ` André Dahlqvist
@ 2001-12-28 18:29 ` Andrew Morton
2001-12-29 0:11 ` André Dahlqvist
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2001-12-28 18:29 UTC (permalink / raw)
To: André Dahlqvist; +Cc: linux-kernel
André Dahlqvist wrote:
>
> Keith Owens <kaos@ocs.com.au> wrote:
>
> > Run this, it will say precisely where the problem lies:
>
> Thanks Keith. Below is the output:
>
> Finding objects, 315 objects, ignoring 0 module(s)
> Finding conglomerates, ignoring 29 conglomerate(s)
> Scanning objects
> Error: ./drivers/sound/via82cxxx_audio.o .data refers to 00000034
> R_386_32 .text.exit
> Done
Could you please check that this works OK?
--- linux-2.4.18-pre1/drivers/sound/via82cxxx_audio.c Fri Dec 21 11:19:13 2001
+++ linux-akpm/drivers/sound/via82cxxx_audio.c Fri Dec 28 10:27:51 2001
@@ -365,7 +365,7 @@ static struct pci_driver via_driver = {
name: VIA_MODULE_NAME,
id_table: via_pci_tbl,
probe: via_init_one,
- remove: via_remove_one,
+ remove: __devexit_p(via_remove_one),
};
@@ -3271,7 +3271,7 @@ err_out:
}
-static void __exit via_remove_one (struct pci_dev *pdev)
+static void __devexit via_remove_one (struct pci_dev *pdev)
{
struct via_info *card;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Sound fails to build when non-modular with new binutils
2001-12-28 18:29 ` Andrew Morton
@ 2001-12-29 0:11 ` André Dahlqvist
0 siblings, 0 replies; 5+ messages in thread
From: André Dahlqvist @ 2001-12-29 0:11 UTC (permalink / raw)
To: linux-kernel
Andrew Morton <akpm@zip.com.au> wrote:
> Could you please check that this works OK?
[patch]
Compiles, bootes and runs on top of 2.4.17.
--
André Dahlqvist <andre.dahlqvist@telia.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-12-29 0:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-28 15:16 Sound fails to build when non-modular with new binutils André Dahlqvist
2001-12-28 16:23 ` Keith Owens
2001-12-28 17:03 ` André Dahlqvist
2001-12-28 18:29 ` Andrew Morton
2001-12-29 0:11 ` André Dahlqvist
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox