diff options
Diffstat (limited to 'symbian')
-rw-r--r-- | symbian/config.pl | 1 | ||||
-rw-r--r-- | symbian/find_writeable_data.pl | 73 | ||||
-rw-r--r-- | symbian/sisify.pl | 1 |
3 files changed, 74 insertions, 1 deletions
diff --git a/symbian/config.pl b/symbian/config.pl index d37a49e875..21e9b2826c 100644 --- a/symbian/config.pl +++ b/symbian/config.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl -w # Copyright (c) 2004-2005 Nokia. All rights reserved. +# This utility is licensed under the same terms as Perl itself. use strict; use lib "symbian"; diff --git a/symbian/find_writeable_data.pl b/symbian/find_writeable_data.pl new file mode 100644 index 0000000000..24bf298713 --- /dev/null +++ b/symbian/find_writeable_data.pl @@ -0,0 +1,73 @@ +#!/usr/bin/perl -w + +# +# find_writeable_data - find non-const data in Symbian object files +# +# Use this when PETRAN tells you "dll has (un)initialised data". +# Expects to find the Symbian (GNU) nm in the executable path. +# +# Copyright (c) 2004-2005 Nokia. All rights reserved. +# +# This utility is licensed under the same terms as Perl itself. +# + +use strict; + +BEGIN { + unless (exists $ENV{EPOCROOT}) { + die "$0: EPOCROOT unset\n"; + } + if (open(my $fh, "nm --version |")) { + unless (<$fh> =~ /^GNU nm .*-psion-.*/) { + die "$0: Cannot find the GNU nm from Symbian\n"; + } + close($fh); + } else { + die "$0: Cannot find any nm in the executable path: $!\n"; + } + unless (@ARGV && $ARGV[0] =~ /\.mmp$/i) { + die "$0: Must specify target mmp as the first argument\n"; + } +} + +use Cwd; +use File::Basename; + +my $dir = lc(getcwd()); +my $tgt = basename(shift @ARGV); + +$dir =~ s!/!\\!g; +$dir =~ s!^c:!c:$ENV{EPOCROOT}epoc32\\build!; +$dir .= "\\$tgt\\thumb\\urel"; + +print $dir, "\n"; + +unless (-d $dir) { + die "$0: No directory $dir\n"; +} + +my @o = glob("$dir\\*.o"); + +unless (@o) { + die "$0: No objects in $dir\n"; +} + +for my $o (@o) { + if (open(my $fh, "nm $o |")) { + my @d; + while (<$fh>) { + next if / [TURtr] /; + push @d, $_; + } + close($fh); + if (@d) { + $o =~ s!^\Q$dir\E\\!!; + print "$o:\n"; + print @d; + } + } else { + warn "$0: nm $o failed: $!\n"; + } +} + +exit(0); diff --git a/symbian/sisify.pl b/symbian/sisify.pl index 6edce4bd93..9a65d85770 100644 --- a/symbian/sisify.pl +++ b/symbian/sisify.pl @@ -4,7 +4,6 @@ # sisify.pl - package Perl scripts or Perl libraries into SIS files # # Copyright (c) 2004-2005 Nokia. All rights reserved. -# # The sisify.pl utility is licensed under the same terms as Perl itself. # |