aboutsummaryrefslogtreecommitdiff
path: root/src/util/sortobjdump.pl
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2005-04-27 12:08:13 +0000
committerMichael Brown <mcb30@etherboot.org>2005-04-27 12:08:13 +0000
commitc8fc1218908e690351e5690646a11450428c6223 (patch)
tree075f4d2a3b9b652231de6cd39c83eb3ce7b2e3b7 /src/util/sortobjdump.pl
parent1ddcdb0524fe524aaafd7bbcd51f255a2087cd97 (diff)
downloadipxe-c8fc1218908e690351e5690646a11450428c6223.zip
ipxe-c8fc1218908e690351e5690646a11450428c6223.tar.gz
ipxe-c8fc1218908e690351e5690646a11450428c6223.tar.bz2
Special handling for symbols of the form "xxx_end", to make table end
markers appear before the symbols that immediately follow the table.
Diffstat (limited to 'src/util/sortobjdump.pl')
-rwxr-xr-xsrc/util/sortobjdump.pl12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/util/sortobjdump.pl b/src/util/sortobjdump.pl
index 7257161..8ad7314 100755
--- a/src/util/sortobjdump.pl
+++ b/src/util/sortobjdump.pl
@@ -17,14 +17,18 @@ while ( <> ) {
print;
( my $index, my $section ) = ( $1, $2 );
$section_idx{$section} = sprintf ( "%02d", $index );
- } elsif ( /^([0-9a-fA-F]+)\s.*?\s([\.\*]\S+)\s+([0-9a-fA-F]+)\s/ ) {
+ } elsif ( /^([0-9a-fA-F]+)\s.*?\s([\.\*]\S+)\s+([0-9a-fA-F]+)\s+(\S+)/ ) {
# It's a symbol line - store it in the hash, indexed by
- # "<section index>:<value>:<size>"
- ( my $value, my $section, my $size ) = ( $1, $2, $3 );
+ # "<section_index>:<value>:<size>:<end_tag>". <end_tag> is "0" if
+ # the symbol name is of the form xxx_end, "1" otherwise; this is
+ # done so that table end markers show up before any other symbols
+ # with the same value.
+ ( my $value, my $section, my $size, my $name ) = ( $1, $2, $3, $4 );
die "Unrecognised section \"$section\"\n"
unless exists $section_idx{$section};
my $section_idx = $section_idx{$section};
- my $key = $section_idx.":".$value.":".$size;
+ my $end = ( $name =~ /_end$/ ) ? "0" : "1";
+ my $key = $section_idx.":".$value.":".$size.":".$end;
$lines{$key} ||= '';
$lines{$key} .= $_;
} else {