macOS에서 작업 중이고 cc에서 크기 명령을 시도했습니다.
$ which cc
/usr/bin/cc
제대로 작동하지 않아요
$ size /usr/bin/cc
size: /usr/bin/cc: unknown load command 0x32
size: /usr/bin/cc: unknown load command 0x32
size: /usr/bin/cc: unknown load command 0x32
size: /usr/bin/cc: file format not recognized
$ size /bin/ls
size: /bin/ls: unknown load command 0x32
size: /bin/ls: unknown load command 0x32
size: /bin/ls: unknown load command 0x32
size: /bin/ls: file format not recognized
그리고 사이즈는 최신버전이에요
$ size --version
GNU size (GNU Binutils) 2.31.1
Copyright (C) 2018 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.
하지만 센토스에서는
[root@iz2ze9wve43n2nyuvmsfx5z ~]# size /usr/bin/cc
text data bss dec hex filename
754853 8488 81856 845197 ce58d /usr/bin/cc
명령 크기에 어떤 문제가 있나요?
$ file /usr/bin/cc
/usr/bin/cc: Mach-O 64-bit executable x86_64
$ size --help
Usage: size [option(s)] [file(s)]
Displays the sizes of sections inside binary files
If no input file(s) are specified, a.out is assumed
The options are:
-A|-B --format={sysv|berkeley} Select output style (default is berkeley)
-o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex
-t --totals Display the total sizes (Berkeley only)
--common Display total size for *COM* syms
--target=<bfdname> Set the binary file format
@<file> Read options from <file>
-h --help Display this information
-v --version Display the program's version
이게 효과가 있어
me at Max-2018 in ~/desktop
$ /Library/Developer/CommandLineTools/usr/bin/size /usr/bin/cc
__TEXT __DATA __OBJC others dec hex
4096 4096 0 4294979584 4294987776 100005000
$ ls /Library/Developer/CommandLineTools/usr/bin | grep size
llvm-size
size
size-classic
답변1
size
명령줄 도구 키트를 설치하기 위한 지침을 따랐음에도 불구하고 GNU를 설치한 것으로 보입니다. 노력하다: /Library/Developer/CommandLineTools/usr/bin/size
.
운영 체제가 El Capitan(10.11) 이상인 경우 비활성화해야 합니다.한모금(적어도 일시적으로) /bin, /sbin 및 /usr(그러나 /usr/local은 아님)과 같은 디렉토리에 설치합니다.