#987109 readelf --dyn-syms truncates symbol names

Package:
binutils-x86-64-linux-gnu
Source:
binutils
Description:
GNU binary utilities, for x86-64-linux-gnu target
Submitter:
Josh Triplett
Date:
2021-04-17 19:33:02 UTC
Severity:
normal
#987109#3
Date:
2021-04-17 19:30:16 UTC
From:
To:
Since version 2.35, readelf truncates symbol names to attempt to make
the output fit in 80 characters, by default, even if output is not going
to a terminal.

$ readelf --dyn-syms /usr/bin/readelf | fgrep ... | head
     2: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND [...]@GLIBC_2.2.5 (2)
     4: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND c[...]@LIBCTF_1.0 (3)
     5: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND [...]@GLIBC_2.2.5 (2)
     6: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND [...]@GLIBC_2.2.5 (2)
     7: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND [...]@GLIBC_2.2.5 (2)
     8: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND _ITM_deregisterT[...]
     9: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  UND [...]@GLIBC_2.2.5 (2)
    10: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND [...]@GLIBC_2.2.5 (2)
    11: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __[...]@GLIBC_2.7 (4)
    12: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND c[...]@LIBCTF_1.0 (3)


This breaks tools that parse the output of readelf. (I discovered this
while trying to build the a recent version of syslinux from git.)

Please consider dropping the default truncation (ideally always, but at
a minimum if output is not going to a terminal), and making the --wide
option a no-op for compatibility.

I can confirm that this issue still exists in the latest version from
experimental (2.36.1-6).