} elsif ($section eq "none") {
if (/^\s*\S+:\s*file\s+format\s+(\S+)\s*$/) {
$self->{format} = $1;
- } elsif (/^architecture:\s*\S+,\s*flags:\s*\S+\s*$/) {
+ } elsif (/^architecture:\s*\S+,\s*flags\s*\S+:\s*$/) {
# Parse 2 lines of "-f"
# architecture: i386, flags 0x00000112:
# EXEC_P, HAS_SYMS, D_PAGED
# start address 0x08049b50
- $self->{flags}{$_} = 1 foreach (split(/,\s*/, <$fh>));
+ $_ = <$fh>;
+ chomp;
+ $self->{flags}{$_} = 1 foreach (split(/,\s*/));
}
}
}
# -*- mode: cperl;-*-
-use Test::More tests => 26;
+use Test::More tests => 27;
use strict;
use warnings;
is($obj->{HASH}, '0x13d99c', 'HASH');
is($obj->{GNU_HASH}, '0x194', 'GNU_HASH');
is($obj->{format}, 'elf32-i386', 'format');
+is_deeply($obj->{flags}, { DYNAMIC => 1, HAS_SYMS => 1, D_PAGED => 1 }, 'flags');
is_deeply($obj->{NEEDED}, [ 'ld-linux.so.2' ], 'NEEDED');
is_deeply([ $obj->get_needed_libraries ], [ 'ld-linux.so.2' ], 'NEEDED');