From 871ad0c24f14174868af3ceaeacdb6607dbe88b1 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Fri, 16 Dec 2011 08:13:48 +0200 Subject: [PATCH] added test file (clang-compiled). fixed readelf handling of unknown attributes --- scripts/readelf.py | 6 +++++- tests/testfiles/penalty_64_clang.o.elf | Bin 0 -> 13048 bytes .../{penalty_64.o.elf => penalty_64_gcc.o.elf} | Bin 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 tests/testfiles/penalty_64_clang.o.elf rename tests/testfiles/{penalty_64.o.elf => penalty_64_gcc.o.elf} (100%) 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_clang.o.elf b/tests/testfiles/penalty_64_clang.o.elf new file mode 100644 index 0000000000000000000000000000000000000000..91d207d29e92ffad59b4ddccf55495aba8c19fa6 GIT binary patch literal 13048 zcmbta4RBo5b-r((p1k@oD@)?f3W@OAU;BUOcWf&%tWU$T5P>gmTzjA@8OYbJie#nOWl zcDm&l?@alh=Y2NJaA3L)UQYVwNOE{^&ce+z_8VL${qq8wC(k{HUcogzIG;|=O@FD7 zWO=t|q!#$}uZkJ_5$RsnG`DHWb7(JtuM>y{TXXVw0rmOkHl6ew+KeW&xz&-o!AyUP z1i6IJ{v3g$Iklf$jlP+!xY#NGbn1;%)4P-Yb6{C!MtpuV+g)(iKX1`6DgXS;`imDY zru}o0pPMNIKfMxT@bG#@o`c+^{~fY4JjidJ!xQU`qlRaM<~8#e@8@$?&L64*CPVT? z2VM8hh~~$X;}^nb%1~CGd$}a-MM5n9BC>L?`;})DQRZ8~hxh z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