Estou trabalhando em macOs e tentei o comando size no cc
$ which cc
/usr/bin/cc
não funciona corretamente
$ 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
e o tamanho é a versão mais recente
$ 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.
mas em Centos
[root@iz2ze9wve43n2nyuvmsfx5z ~]# size /usr/bin/cc
text data bss dec hex filename
754853 8488 81856 845197 ce58d /usr/bin/cc
Qual é o problema com o tamanho do comando?
$ 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
isso funciona
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
Parece que você instalou o GNU
size
apesar de ter o pacote Command Line Tools instalado como você observou. Experimente:/Library/Developer/CommandLineTools/usr/bin/size
.Se o seu sistema operacional for El Capitan (10.11) ou posterior, você deve desabilitar o SIP (pelo menos temporariamente) para instalar em diretórios como /bin, /sbin e /usr (mas não /usr/local).