@@ -38,15 +38,17 @@ $objdump[2] = mkobjcommand($tobjdump, $tmachine);
# Zero-initialize current dumping state.
my $mem = "";
my $inobjd = 0;
+my $vma = "";
-sub objcommand {
+sub objcommand ($) {
+ my ($vma) = @_;
my $ret = $objdump[$inobjd];
if (!$ret) {
die "Host machine type not specified" if $inobjd == 1;
die "Target machine type not specified" if $inobjd == 2;
die "Internal error";
}
- return $ret;
+ return $ret . " --adjust-vma=" . $vma;
}
while (<>) {
@@ -69,7 +71,8 @@ while (<>) {
syswrite $outh, $mem;
# Pipe from objdump...
- open IN, "-|", objcommand();
+ $vma =~ s/:.*//;
+ open IN, "-|", objcommand($vma);
# ... copying all but the first 7 lines of boilerplate to our stdout.
my $i = 0;
@@ -82,6 +85,7 @@ while (<>) {
$mem = "";
$inobjd = 0;
} else {
+ $vma = $_;
print;
}
}