3 # spacesyms-o-map.pl INPUT OUTPUT
5 # Copy the object file INPUT to OUTPUT, redefining any symbol in INPUT that
6 # contains "SPACE" in its name to contain "SPA CE" instead.
11 my ($input, $output) = @ARGV;
12 my @cmds = ('objcopy');
14 open my $nm, '-|', 'nm', $input or die "cannot run nm: $!";
18 my $x = (split / /, $_, 3)[2];
19 my $y = $x =~ s/SPACE/SPA CE/r;
20 push @cmds, "--redefine-sym=$x=$y";
24 push @cmds, $input, $output;