From: Eli Bendersky Date: Fri, 16 Dec 2011 06:13:48 +0000 (+0200) Subject: added test file (clang-compiled). fixed readelf handling of unknown attributes X-Git-Tag: v0.10~30 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=871ad0c24f14174868af3ceaeacdb6607dbe88b1;p=pyelftools.git added test file (clang-compiled). fixed readelf handling of unknown attributes --- diff --git a/scripts/readelf.py b/scripts/readelf.py index a7296f5..051a21a 100755 --- a/scripts/readelf.py +++ b/scripts/readelf.py @@ -543,9 +543,13 @@ class ReadElf(object): die.tag)) for attr in die.attributes.itervalues(): + name = attr.name + # Unknown attribute values are passed-through as integers + if isinstance(name, int): + name = 'Unknown AT value: %x' % name self._emitline(' <%2x> %-18s: %s' % ( attr.offset, - attr.name, + name, describe_attr_value( attr, die, section_offset))) diff --git a/tests/testfiles/penalty_64.o.elf b/tests/testfiles/penalty_64.o.elf deleted file mode 100644 index aca100b..0000000 Binary files a/tests/testfiles/penalty_64.o.elf and /dev/null differ diff --git a/tests/testfiles/penalty_64_clang.o.elf b/tests/testfiles/penalty_64_clang.o.elf new file mode 100644 index 0000000..91d207d Binary files /dev/null and b/tests/testfiles/penalty_64_clang.o.elf differ diff --git a/tests/testfiles/penalty_64_gcc.o.elf b/tests/testfiles/penalty_64_gcc.o.elf new file mode 100644 index 0000000..aca100b Binary files /dev/null and b/tests/testfiles/penalty_64_gcc.o.elf differ