Skip to content

Commit

Permalink
adding readelf -S in non-regression
Browse files Browse the repository at this point in the history
  • Loading branch information
LRGH committed Oct 10, 2024
1 parent 69ed3d2 commit e29675f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion elfesteem/elf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Shdr(CStructWithStrTable):
strtab = property(lambda _: _.parent.shstrtab)
format = property(lambda _: {
32: " [%(idx)2d] %(name17)-17s %(type_txt)-15s %(addr)08x %(offset)06x %(size)06x %(entsize)02x %(flags_txt)3s %(link)2d %(info)3d %(addralign)2d",
64: " [%(idx)2d] %(name17)-17s %(type_txt)-15s %(addr)016x %(offset)08x %(size)016x %(entsize)016x %(flags_txt)3s %(link)2d %(info)2d %(addralign)2d",
64: " [%(idx)2d] %(name17)-17s %(type_txt)-15s %(addr)016x %(offset)08x\n %(size)016x %(entsize)016x %(flags_txt)3s %(link)2d %(info)2d %(addralign)d",
}[_.wsize])
name17 = property(lambda _: _.name[:17])
idx = property(lambda _: _.parent.parent.shlist.index(_.parent))
Expand Down
4 changes: 2 additions & 2 deletions elfesteem/elf_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,11 +739,11 @@ def readelf_display(self):
if self.wsize == 32:
rep.append( " [Nr] Name Type Addr Off Size ES Flg Lk Inf Al" )
elif self.wsize == 64:
rep.extend([" [Nr] Name Type Address Offset Size EntSize Flags Link Info Align"])
rep.extend([" [Nr] Name Type Address Offset"," Size EntSize Flags Link Info Align"])
rep.extend([ _.sh.readelf_display() for _ in self ])
rep.extend([ # Footer
"Key to Flags:",
" W (write), A (alloc), X (execute), M (merge), S (strings)",
" W (write), A (alloc), X (execute), M (merge), S (strings), l (large)",
" I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)",
" O (extra OS processing required) o (OS specific), p (processor specific)",
])
Expand Down
2 changes: 1 addition & 1 deletion tests/examples_linux.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/bash

options="-h -S -r -s --dyn-syms -d -l -g"
options="-h"
options="-h -S"
for option in $options; do
for file in /bin/sh; do
echo "=== readelf $option $file ==="
Expand Down

0 comments on commit e29675f

Please sign in to comment.