4 # find_writeable_data - find non-const data in Symbian object files
6 # Use this when PETRAN tells you "dll has (un)initialised data".
7 # Expects to find the Symbian (GNU) nm in the executable path.
9 # Copyright (c) 2004-2005 Nokia. All rights reserved.
11 # This utility is licensed under the same terms as Perl itself.
17 unless (exists $ENV{EPOCROOT}) {
18 die "$0: EPOCROOT unset\n";
20 if (open(my $fh, "nm --version |")) {
21 unless (<$fh> =~ /^GNU nm .*-psion-.*/) {
22 die "$0: Cannot find the GNU nm from Symbian\n";
26 die "$0: Cannot find any nm in the executable path: $!\n";
28 unless (@ARGV && $ARGV[0] =~ /\.mmp$/i) {
29 die "$0: Must specify target mmp as the first argument\n";
36 my $dir = lc(getcwd());
37 my $tgt = basename(shift @ARGV);
40 $dir =~ s!^c:!c:$ENV{EPOCROOT}epoc32\\build!;
41 $dir .= "\\$tgt\\thumb\\urel";
46 die "$0: No directory $dir\n";
49 my @o = glob("$dir\\*.o");
52 die "$0: No objects in $dir\n";
56 if (open(my $fh, "nm $o |")) {
64 $o =~ s!^\Q$dir\E\\!!;
69 warn "$0: nm $o failed: $!\n";