Generate useful error messages.

This commit is contained in:
Murray Stokely 2001-04-13 09:37:25 +00:00
parent dc1e426492
commit a4e6da691f

View File

@ -39,7 +39,7 @@ my $objdump = $ENV{'OBJDUMP'} || 'objdump';
# Run objdump over each object file to find all defined linker sets.
# Linker sets are sections with names starting with `.set.'
foreach my $objfile (@ARGV) {
open(SECTION, "$objdump -h $objfile |") or die;
open(SECTION, "$objdump -h $objfile |") or die "objdump -h $objfile failed : $!";
while (<SECTION>) {
my ($index, $name, $size, $vma, $lma, $offset, $align) = split;
@ -68,12 +68,12 @@ while (my ($name, $size) = each %sets) {
}
# Create setdefs.h
open(SETDEFS_H, "> setdefs.h") or die;
open(SETDEFS_H, "> setdefs.h") or die "Could not write to setdefs.h : $!";
print SETDEFS_H sort @setdefs;
close SETDEFS_H;
# Create setdef0.c
open(SETDEF0_C, "> setdef0.c") or die;
open(SETDEF0_C, "> setdef0.c") or die "Could not write to setdef0.c : $!";
print SETDEF0_C <<END;
/* This file is generated by $0, do not edit. */
@ -91,7 +91,7 @@ END
close SETDEF0_C;
# Create setdef1.c
open(SETDEF1_C, "> setdef1.c") or die;
open(SETDEF1_C, "> setdef1.c") or die "Could not write to setdef1.c : $!";
print SETDEF1_C <<END;
/* This file is generated by $0, do not edit. */