diff options
author | Michael Brown <mcb30@etherboot.org> | 2005-04-27 10:54:33 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2005-04-27 10:54:33 +0000 |
commit | d6930e6e405f5a4a0a96e374e10e86b4bcd863d8 (patch) | |
tree | 9e473eef427bc7d401a8d355943ebecf5765b2b0 /src/util/sortobjdump.pl | |
parent | ac01cf4997a306badc1c5d0f502645492d379106 (diff) | |
download | ipxe-d6930e6e405f5a4a0a96e374e10e86b4bcd863d8.zip ipxe-d6930e6e405f5a4a0a96e374e10e86b4bcd863d8.tar.gz ipxe-d6930e6e405f5a4a0a96e374e10e86b4bcd863d8.tar.bz2 |
Use symbol size as a third index, mainly so that zero-length symbols
(e.g. section start indicators) show up before the symbols they're
indicating the start of.
Diffstat (limited to 'src/util/sortobjdump.pl')
-rwxr-xr-x | src/util/sortobjdump.pl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/util/sortobjdump.pl b/src/util/sortobjdump.pl index 99d793b..7257161 100755 --- a/src/util/sortobjdump.pl +++ b/src/util/sortobjdump.pl @@ -4,9 +4,9 @@ use strict; use warnings; # Sort the symbol table portion of the output of objdump -ht by -# section, then by symbol value. Used to enhance the linker maps -# produced by "make bin/%.map" by also showing the values of all -# non-global symbols. +# section, then by symbol value, then by size. Used to enhance the +# linker maps produced by "make bin/%.map" by also showing the values +# of all non-global symbols. my %section_idx = ( "*ABS*" => "." ); my %lines; @@ -17,14 +17,16 @@ while ( <> ) { print; ( my $index, my $section ) = ( $1, $2 ); $section_idx{$section} = sprintf ( "%02d", $index ); - } elsif ( /^([0-9a-fA-F]+)\s.*?\s([\.\*]\S+)\s/ ) { + } elsif ( /^([0-9a-fA-F]+)\s.*?\s([\.\*]\S+)\s+([0-9a-fA-F]+)\s/ ) { # It's a symbol line - store it in the hash, indexed by - # "<section index>.<value>" - ( my $value, my $section ) = ( $1, $2 ); + # "<section index>:<value>:<size>" + ( my $value, my $section, my $size ) = ( $1, $2, $3 ); die "Unrecognised section \"$section\"\n" unless exists $section_idx{$section}; my $section_idx = $section_idx{$section}; - $lines{${section_idx}.":".${value}} = $_; + my $key = $section_idx.":".$value.":".$size; + $lines{$key} ||= ''; + $lines{$key} .= $_; } else { # It's a generic header line: just print it. print; |