Add TLS and PowerPC to Machine and Program Headers description tables to match binuti...
authorAG <github@mzpqnxow.com>
Sun, 26 Nov 2017 13:50:49 +0000 (08:50 -0500)
committerEli Bendersky <eliben@users.noreply.github.com>
Sun, 26 Nov 2017 13:50:49 +0000 (05:50 -0800)
Before:
...
  Machine:                           <unknown>
...
Program Headers:
...
  <unknown>      0x0bcd0c 0x100ccd0c 0x100ccd0c 0x00000 0x00008 R   0x4
...

After:
...
  Machine:                           PowerPC
Program Headers:
...
  TLS            0x0bcd0c 0x100ccd0c 0x100ccd0c 0x00000 0x00008 R   0x4
...

Reproduced and then tested change against statically linked PPC binary produced by MUSL:

https://github.com/mzpqnxow/embedded-toolkit/blob/master/prebuilt_static_bins/gdbserver/gdbserver-7.12-ppc-sysv

elftools/elf/descriptions.py

index 4d92730ce78bc7d84e5fc57355ff164cb60f82b3..b40f947d72cdda1e8b9ee1b056f0dab2307ad18c 100644 (file)
@@ -262,6 +262,7 @@ _DESCR_E_MACHINE = dict(
     EM_ARM='ARM',
     EM_AARCH64='AArch64',
     EM_BLAFKIN='Analog Devices Blackfin',
+    EM_PPC='PowerPC',
     RESERVED='RESERVED',
 )
 
@@ -281,6 +282,7 @@ _DESCR_P_TYPE = dict(
     PT_ARM_EXIDX='ARM_EXIDX',
     PT_AARCH64_ARCHEXT='AARCH64_ARCHEXT',
     PT_AARCH64_UNWIND='AARCH64_UNWIND',
+    PT_TLS='TLS'
 )