Bug 19150 - readelf should decode more notes
Summary: readelf should decode more notes
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.26
: P2 enhancement
Target Milestone: ---
Assignee: Paul Pluzhnikov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-18 19:02 UTC by Paul Pluzhnikov
Modified: 2015-10-18 19:02 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Pluzhnikov 2015-10-18 19:02:19 UTC
From https://sourceware.org/ml/binutils/2015-10/msg00145.html

Current trunk readelf produces:

build/binutils/readelf -n /tmp/core.136505

Displaying notes found at file offset 0x00000200 with length 0x000009b8:
  Owner                 Data size Description
  CORE                 0x00000150 NT_PRSTATUS (prstatus structure)
  CORE                 0x00000088 NT_PRPSINFO (prpsinfo structure)
  CORE                 0x00000080 NT_SIGINFO (siginfo_t data)
  CORE                 0x00000130 NT_AUXV (auxiliary vector)
  CORE                 0x00000064 NT_FILE (mapped files)
    Page size: 4096
                 Start                 End         Page Offset
    0x0000000000400000  0x00000000004bf000  0x0000000000000000
        /tmp/a.out.static
    0x00000000006be000  0x00000000006c1000  0x00000000000000be
        /tmp/a.out.static
  CORE                 0x00000200 NT_FPREGSET (floating point registers)
  LINUX                0x00000340 NT_X86_XSTATE (x86 XSAVE extended state)

Compare this to:

eu-readelf -n /tmp/core.136505

Note segment of 2488 bytes at offset 0x200:
  Owner          Data size  Type
  CORE                 336  PRSTATUS
    info.si_signo: 6, info.si_code: 0, info.si_errno: 0, cursig: 6
    sigpend: <>
    sighold: <>
    pid: 136505, ppid: 120345, pgrp: 136505, sid: 120345
    utime: 0.000000, stime: 0.000000, cutime: 0.000000, cstime: 0.000000
    orig_rax: 234, fpvalid: 1
    r15:                       0  r14:                 4200304
    r13:                 4200160  r12:                       0
    rbp:      0x00007ffeb1ec7da0  rbx:                 4194992
    r11:                     582  r10:                       8
    r9:                        4  r8:                       11
    rax:                       0  rcx:                      -1
    rdx:                       6  rsi:                  136505
    rdi:                  136505  rip:      0x0000000000444749
    rflags:   0x0000000000000246  rsp:      0x00007ffeb1ec7c68
    fs.base:   0x0000000001e84880  gs.base:   0x0000000000000000
    cs: 0x0033  ss: 0x002b  ds: 0x0000  es: 0x0000  fs: 0x0063  gs: 0x0000
  CORE                 136  PRPSINFO
    state: 0, sname: R, zomb: 0, nice: 0, flag: 0x0000000000406600
    uid: 74925, gid: 5000, pid: 136505, ppid: 120345, pgrp: 136505
    sid: 120345
    fname: a.out.static, psargs: /tmp/a.out.static
  CORE                 128  SIGINFO
    si_signo: 6, si_errno: 0, si_code: -6
  CORE                 304  AUXV
    SYSINFO_EHDR: 0x7ffeb1fb3000
    HWCAP: 0xbfebfbff  <fpu vme de pse tsc msr pae mce cx8 apic sep
mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht
tm pbe>
    PAGESZ: 4096
    CLKTCK: 100
    PHDR: 0x400040
    PHENT: 56
    PHNUM: 6
    BASE: 0
    FLAGS: 0
    ENTRY: 0x400f4e
    UID: 74925
    EUID: 74925
    GID: 5000
    EGID: 5000
    SECURE: 0
    RANDOM: 0x7ffeb1ec8129
    EXECFN: 0x7ffeb1ec8fe6
    PLATFORM: 0x7ffeb1ec8139
    NULL
  CORE                 100  FILE
    2 files:
      00400000-004bf000 00000000 782336              /tmp/a.out.static
      006be000-006c1000 000be000 12288               /tmp/a.out.static
  CORE                 512  FPREGSET
    xmm0:  0x000000000000ff000000ff0000000000
    xmm1:  0x2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f
    xmm2:  0x00ff0000000000000000000000000000
    xmm3:  0x00000000000000000000000000000000
    xmm4:  0x00000000000000000000000000000000
    xmm5:  0x00ff00000000000000000000ff000000
    xmm6:  0x00000000000000000000000000000000
    xmm7:  0x00000000000000000000000000000000
    xmm8:  0x00000000000000000000000000000000
    xmm9:  0x000000ff000000000000000000000000
    xmm10: 0x0000000000000000ff00000000000000
    xmm11: 0x00000000000000000000000000000000
    xmm12: 0x00000000000000000000000000000000
    xmm13: 0x00000000000000000000000000000000
    xmm14: 0x00000000000000000000000000000000
    xmm15: 0x00000000000000000000000000000000
    st0: 0x00000000000000000000  st1: 0x00000000000000000000
    st2: 0x00000000000000000000  st3: 0x00000000000000000000
    st4: 0x00000000000000000000  st5: 0x00000000000000000000
    st6: 0x00000000000000000000  st7: 0x00000000000000000000
    mxcsr:   0x0000ffff00001f80
    fcw: 0x037f  fsw: 0x0000
  LINUX                832  X86_XSTATE

It seems to me that if readelf -n decodes any notes at all (which it
does for at least NT_FILE, NT_GNU_ABI_TAG, NT_GNU_BUILD_ID and
NT_GNU_GOLD_VERSION), then it should decode the others as well.