How to dump objcopy output to stdout on macOS?
Peng Yu
pengyu.ut@gmail.com
Wed Apr 28 01:25:37 GMT 2021
The following command does not work on macOS.
$ /usr/local/opt/binutils/bin/objcopy -O binary --only-section=.text
1.o /dev/stdout
/usr/local/opt/binutils/bin/objcopy: /dev/stdout: Bad file descriptor
$ /usr/local/opt/binutils/bin/objcopy --version
GNU objcopy (GNU Binutils) 2.36.1
Copyright (C) 2021 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
But the same command works on Linux. How to dump the output to stdout on macOS?
$ objcopy --version
GNU objcopy (GNU Binutils for Debian) 2.35.2
Copyright (C) 2020 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
$ objcopy -O binary --only-section=.text 1.o /dev/stdout
00000000: 90
--
Regards,
Peng
More information about the Binutils
mailing list