From cbffab246997fb5a06211dfb706b54e5ae5bb59f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:58:51 +0200 Subject: Adding upstream version 1.21.22. Signed-off-by: Daniel Baumann --- scripts/t/Dpkg_Shlibs/spacesyms-o-map.pl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/t/Dpkg_Shlibs/spacesyms-o-map.pl (limited to 'scripts/t/Dpkg_Shlibs/spacesyms-o-map.pl') 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; -- cgit v1.2.3