scripts - use $OBJDUMP to get correct objdump (cross compile)
PATCH 1/1 scripts - use $OBJDUMP to get correct objdump (cross compile)
The scripts for make buildcheck are executing objdump straight, which is wrong if the system is using make CROSS_COMPILE=.....
Change the scripts to use $OBJDUMP passed from the Makefile's environment, so that the correct objdump is used, and the symbols are printed correctly
scripts/reference_discarded.pl +2 -2
@@ -18,7 +18,7 @@ $| = 1; # printf("Finding objects, "); -open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed"; +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/) {
@@ -74,7 +74,7 @@ $errorcount = 0; foreach $object (keys(%object)) { my $from; - open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object"; + open(OBJDUMP, "\$OBJDUMP -r $object|") || die "cannot objdump -r $object"; while (defined($line = <OBJDUMP>)) { chomp($line); if ($line =~ /RELOCATION RECORDS FOR /) {
scripts/reference_init.pl +2 -2
@@ -26,7 +26,7 @@ $| = 1; printf("Finding objects, "); -open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed"; +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/) {
@@ -81,7 +81,7 @@ printf("Scanning objects\n"); foreach $object (sort(keys(%object))) { my $from; - open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object"; + open(OBJDUMP, "\$OBJDUMP -r $object|") || die "cannot objdump -r $object"; while (defined($line = <OBJDUMP>)) { chomp($line); if ($line =~ /RELOCATION RECORDS FOR /) {
scripts/reference_discarded.pl +2 -2
@@ -18,7 +18,7 @@ $| = 1; # printf("Finding objects, "); -open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed"; +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/) {
@@ -74,7 +74,7 @@ $errorcount = 0; foreach $object (keys(%object)) { my $from; - open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object"; + open(OBJDUMP, "\$OBJDUMP -r $object|") || die "cannot objdump -r $object"; while (defined($line = <OBJDUMP>)) { chomp($line); if ($line =~ /RELOCATION RECORDS FOR /) {
scripts/reference_init.pl +2 -2
@@ -26,7 +26,7 @@ $| = 1; printf("Finding objects, "); -open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed"; +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/) {
@@ -81,7 +81,7 @@ printf("Scanning objects\n"); foreach $object (sort(keys(%object))) { my $from; - open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object"; + open(OBJDUMP, "\$OBJDUMP -r $object|") || die "cannot objdump -r $object"; while (defined($line = <OBJDUMP>)) { chomp($line); if ($line =~ /RELOCATION RECORDS FOR /) {
Quoted 8 lines · Ben Dooks
The scripts for
make buildcheckare executing objdump straight, which is wrong if the system is usingmake CROSS_COMPILE=.....Change the scripts to use $OBJDUMP passed from the Makefile's environment, so that the correct objdump is used, and the symbols are printed correctly
Those scripts are meant to work even when they are invoked by hand, without OBJDUMP being defined in the environment. This is the correct fix.
scripts/namespace.pl +7 -1
@@ -67,11 +67,17 @@ use strict; use File::Find; my $nm = "/usr/bin/nm -p"; -my $objdump = "/usr/bin/objdump -s -j .comment"; my $srctree = ""; my $objtree = ""; $srctree = "$ENV{'srctree'}/" if (exists($ENV{'srctree'})); $objtree = "$ENV{'objtree'}/" if (exists($ENV{'objtree'})); +my $objdump; +if (exists($ENV{'OBJDUMP'})) { + $objdump = $ENV{'OBJDUMP'}; +} else { + $objdump = 'objdump'; +} +$objdump .= ' -s -j .comment'; if ($#ARGV != -1) { print STDERR "usage: $0 takes no parameters\n";
scripts/reference_discarded.pl +8 -2
@@ -14,11 +14,17 @@ my $object; my $line; my $ignore; my $errorcount; +my $objdump; +if (exists($ENV{'OBJDUMP'})) { + $objdump = $ENV{'OBJDUMP'}; +} else { + $objdump = 'objdump'; +} $| = 1; # printf("Finding objects, "); -open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed"; +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/) {
@@ -74,7 +80,7 @@ foreach $object (keys(%object)) { $errorcount = 0; foreach $object (keys(%object)) { my $from; - open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object"; + open(OBJDUMP, "$objdump -r $object|") || die "cannot objdump -r $object"; while (defined($line = <OBJDUMP>)) { chomp($line); if ($line =~ /RELOCATION RECORDS FOR /) {
scripts/reference_init.pl +8 -2
@@ -22,11 +22,17 @@ my %object; my $object; my $line; my $ignore; +my $objdump; +if (exists($ENV{'OBJDUMP'})) { + $objdump = $ENV{'OBJDUMP'}; +} else { + $objdump = 'objdump'; +} $| = 1; printf("Finding objects, "); -open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed"; +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/) {
@@ -81,7 +87,7 @@ printf("ignoring %d conglomerate(s)\n", printf("Scanning objects\n"); foreach $object (sort(keys(%object))) { my $from; - open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object"; + open(OBJDUMP, "$objdump -r $object|") || die "cannot objdump -r $object"; while (defined($line = <OBJDUMP>)) { chomp($line); if ($line =~ /RELOCATION RECORDS FOR /) {
Ben Dooks
Acked-byQuoted 11 lines · Keith Owens
Quoted 8 lines · Ben Dooks
The scripts for
make buildcheckare executing objdump straight, which is wrong if the system is usingmake CROSS_COMPILE=.....Change the scripts to use $OBJDUMP passed from the Makefile's environment, so that the correct objdump is used, and the symbols are printed correctly
Quoted 5 lines
Those scripts are meant to work even when they are invoked by hand, without OBJDUMP being defined in the environment. This is the correct fix.
Signed-off-by Keith Owens <[email protected]>
Ok, that seems to have fixed the problems, thanks.
Signature · 3 lines
Ben ([email protected], http://www.fluff.org/) 'a smiley only costs 4 bytes'