[v2,0/3] binutils: read from stdin if input file is -

Message ID 20180225012308.47820-1-ahmad@a3f.at
Headers show
Series
  • binutils: read from stdin if input file is -
Related show

Message

Ahmad Fatoum Feb. 25, 2018, 1:23 a.m.
Changes behavior of dlltool, nlmconv, nm, objcopy, objdump and size
to allow niftiness like:

   printf "\xCC" | objdump -D -bbinary -mi386 -

Copyright assignment is in place. Tests have been added for nm,
objcopy, objdump and size.

--

Changes since v1:
 * Documented new behavior in NEWS and man pages
 * Added tests for nm, objcopy, objdump and size
 * Replaced XDELETEVEC() with free()

bfd/
   * bfd.c (struct bfd): Add optional temp_filename field that points
     at file to be removed when closing bfd.
   * bfd-in2.h: Regenerate.
   * opencls.c (bfd_open): read stdin if filename == NULL
binutils/
   * nm.c:      const-qualify read-only string parameters
   * nm.c:      read from stdin if input file is -
   * dlltool.c: Likewise
   * nlmconv.c: Likewise
   * objcopy.c: Likewise
   * objdump.c: Likewise
   * size.c:    Likewise
binutils/testsuite/config/
   * default.exp (binutils_run): Allow passing extra arguments to
     remote_exec
binutils/testsuite/lib/
   * lib/utils-lib.exp (default_binutils_run): Likewise
binutils/testsuite/binutils-all/
   * nm.exp:      Add test for reading from stdin
   * objcopy.exp: Likewise
   * objdump.exp: Likewise
   * size.exp:    Likewise

Ahmad Fatoum (3):
  bfd_fopen: read from stdin if filename == NULL
  nm: const-qualify read-only string parameters
  binutils: read from stdin if input file is -

 bfd/bfd-in2.h                               |  3 ++
 bfd/bfd.c                                   |  3 ++
 bfd/opncls.c                                | 66 ++++++++++++++++++++++++++---
 binutils/NEWS                               |  3 ++
 binutils/dlltool.c                          |  9 +++-
 binutils/doc/binutils.texi                  | 36 ++++++++++------
 binutils/nlmconv.c                          |  5 ++-
 binutils/nm.c                               | 56 +++++++++++++-----------
 binutils/objcopy.c                          | 38 +++++++++++++----
 binutils/objdump.c                          | 10 ++++-
 binutils/size.c                             | 10 ++++-
 binutils/testsuite/binutils-all/nm.exp      | 57 ++++++++++++++-----------
 binutils/testsuite/binutils-all/objcopy.exp | 13 +++++-
 binutils/testsuite/binutils-all/objdump.exp |  8 +++-
 binutils/testsuite/binutils-all/size.exp    | 45 ++++++++++++--------
 binutils/testsuite/config/default.exp       |  4 +-
 binutils/testsuite/lib/utils-lib.exp        |  5 ++-
 17 files changed, 262 insertions(+), 109 deletions(-)

-- 
2.16.1

Comments

Nick Clifton Feb. 27, 2018, 1:51 p.m. | #1
Hi Ahmad,

> Changes behavior of dlltool, nlmconv, nm, objcopy, objdump and size

> to allow niftiness like:

> 

>    printf "\xCC" | objdump -D -bbinary -mi386 -

> 

> Copyright assignment is in place. Tests have been added for nm,

> objcopy, objdump and size.


Unfortunately the patch introduces some new testsuite failures for
certain targets:

Checking Binutils in: avr-elf ... 
  GAS REGRESSION: AVR '.avr.prop' test 1 
Checking Binutils in: alpha-linuxecoff ...  
  BIN REGRESSION: nm (no arguments) tmpdir/bintest.o 
  BIN REGRESSION: nm (no arguments) - 
  BIN REGRESSION: objcopy (simple copy from stdin)
Checking Binutils in: alpha-dec-vms ... 
  BIN REGRESSION: nm (no arguments) tmpdir/bintest.o 
  BIN REGRESSION: nm (no arguments) - 
  BIN REGRESSION: objcopy (simple copy from stdin)
  BIN REGRESSION: objdump -f (-, <stdin>) 
Checking Binutils in: alpha-unknown-osf4.0 ... 
  BIN REGRESSION: nm (no arguments) tmpdir/bintest.o 
  BIN REGRESSION: nm (no arguments) - 
Checking Binutils in: ft32-elf ... 
  BIN REGRESSION: objcopy (simple copy from stdin)
Checking Binutils in: powerpc-ibm-aix5.2.0 ... 
  BIN REGRESSION: nm (no arguments) tmpdir/bintest.o 
  BIN REGRESSION: nm (no arguments) - 
Checking Binutils in: rs6000-aix4.3.3 ...
  BIN REGRESSION: nm (no arguments) tmpdir/bintest.o 
  BIN REGRESSION: nm (no arguments) - 
 
Would you mind having a look at these please ?

Cheers
  Nick