#!/usr/bin/perl

@faillines = (	"\\.abicalls",
		"\\.section",
		"\\.type",
		"\\.cpload",
		"\\.cprestore",
		"\\.size"
	     );

open (fHANDLE, $ARGV[0]);
my @data = (<fHANDLE>);
close (fHANDLE);

open (fHANDLE, ">" . $ARGV[0]);
foreach my $data (@data)
{
	if ($data =~ /\.rodata/)
	{
		$data = ".data\n";
	}
	elsif ($data =~  /\.string/)
	{
		$data =~ s/\.string/\.asciiz/g;
	}

	my $failed = 0;
	foreach my $failline (@faillines)
	{
		if ($data =~ /$failline/)
		{
			$failed = 1;
		}
	}

	if (!$failed)
	{
		print fHANDLE $data;
	}
}
close (fHANDLE);
