diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 00:45:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 00:45:20 +0000 |
commit | 9a08cbfcc1ef900a04580f35afe2a4592d7d6030 (patch) | |
tree | 004cc7027bca2f2c0bcb5806527c8e0c48df2d6e /scripts/t/Dpkg_Shlibs/spacesyms-o-map.pl | |
parent | Initial commit. (diff) | |
download | dpkg-56b3e277e23b0b6313500e1e330e80b5ab6e6522.tar.xz dpkg-56b3e277e23b0b6313500e1e330e80b5ab6e6522.zip |
Adding upstream version 1.19.8.upstream/1.19.8upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/t/Dpkg_Shlibs/spacesyms-o-map.pl')
-rwxr-xr-x | scripts/t/Dpkg_Shlibs/spacesyms-o-map.pl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/t/Dpkg_Shlibs/spacesyms-o-map.pl b/scripts/t/Dpkg_Shlibs/spacesyms-o-map.pl new file mode 100755 index 0000000..89a1caf --- /dev/null +++ b/scripts/t/Dpkg_Shlibs/spacesyms-o-map.pl @@ -0,0 +1,25 @@ +#!/usr/bin/perl +# +# spacesyms-o-map.pl INPUT OUTPUT +# +# Copy the object file INPUT to OUTPUT, redefining any symbol in INPUT that +# contains "SPACE" in its name to contain "SPA CE" instead. + +use strict; +use warnings; + +my ($input, $output) = @ARGV; +my @cmds = ('objcopy'); + +open my $nm, '-|', 'nm', $input or die "cannot run nm: $!"; +while (<$nm>) { + next if not m/SPACE/; + chomp; + my $x = (split / /, $_, 3)[2]; + my $y = $x =~ s/SPACE/SPA CE/r; + push @cmds, "--redefine-sym=$x=$y"; +} +close $nm; + +push @cmds, $input, $output; +exec @cmds; |