SIZE(1)

πŸ“¦ version 12.2.0, in nixpkgs unstable

πŸ’… size(1) β€” GNU Development Tools ✨

okay so bestie, welcome to size β€” the man page, the myth, the legend. this is from the GNU Development Tools crew and it's about to be your new fave little utility. no cap. 🫢


🌸 NAME 🌸

size β€” lists section sizes and total size. that's it, that's the whole vibe. she's simple, she's iconic, she ate. πŸ‘‘


✨ SYNOPSIS ✨

size [-A|-B|--format=compatibility]
     [--help]
     [-d|-o|-x|--radix=number]
     [--common]
     [-t|--totals]
     [--target=bfdname] [-V|--version]
     [objfile...]

πŸ¦‹ DESCRIPTION πŸ¦‹

so the GNU size utility lists the section sizes β€” and the total size β€” for each of the object or archive files objfile in its argument list. literally each one. πŸ’–

by default, one line of output is generated for each object file or each module in an archive. one file, one line, clean and cute, we love a consistent queen. ✨

objfile... are the object files to be examined. and if you don't specify any at all? the file "a.out" will be used. (yes, queen, she's got a default. she's prepared. she doesn't need you to tell her what to do. main character energy fr fr. πŸ’…)


πŸŽ€ OPTIONS πŸŽ€

the command line options have the following meanings β€” buckle up bestie, there's a bunch and they're all kinda great:

  • -A, -B, --format=compatibility β€” using one of these options, you can choose whether the output from GNU size resembles output from System V size (using -A, or --format=sysv), or Berkeley size (using -B, or --format=berkeley). the default is the one-line format similar to Berkeley's. 🧚

here's an example of the Berkeley (default) format of output from size:

$ size --format=Berkeley ranlib size
text    data    bss     dec     hex     filename
294880  81920   11592   388392  5ed28   ranlib
294880  81920   11888   388688  5ee50   size

and this is the same data, but displayed closer to System V conventions:

$ size --format=SysV ranlib size
ranlib  :
section         size         addr
.text         294880         8192
.data          81920       303104
.bss           11592       385024
Total         388392

size  :
section         size         addr
.text         294880         8192
.data          81920       303104
.bss           11888       385024
Total         388688

same numbers, two totally different outfits. it's giving versatility. πŸ’œ

  • --help β€” show a summary of acceptable arguments and options. your little cheat sheet, your pocket bestie. 🫢
  • -d, -o, -x, --radix=number β€” using one of these options, you can control whether the size of each section is given in decimal (-d, or --radix=10); octal (-o, or --radix=8); or hexadecimal (-x, or --radix=16). in --radix=number, only the three values (8, 10, 16) are supported. the total size is always given in two radices; decimal and hexadecimal for -d or -x output, or octal and hexadecimal if you're using -o. two radices at once?? she's doing the most and we're obsessed. πŸ”₯
  • --common β€” print total size of common symbols in each file. when using Berkeley format these are included in the bss size. noted. πŸ“
  • -t, --totals β€” show totals of all objects listed (Berkeley format listing mode only). important caveat bestie: Berkeley format listing mode only, so don't come for her if it doesn't show up elsewhere. πŸ™ˆ
  • --target=bfdname β€” specify that the object-code format for objfile is bfdname. this option may not be necessary; size can automatically recognize many formats. she's smart like that, she just knows. 🧠✨
  • -V, --version β€” display the version number of size. cute little flex. πŸ’…
  • @file β€” read command-line options from file. the options read are inserted in place of the original @file option. if file does not exist, or cannot be read, then the option will be treated literally, and not removed. πŸ’€ (yes, seriously, it just stays there being literal, iconic behaviour ngl)

options in file are separated by whitespace. a whitespace character may be included in an option by surrounding the entire option in either single or double quotes. any character (including a backslash) may be included by prefixing the character to be included with a backslash. the file may itself contain additional @file options; any such options will be processed recursively. it's giving inception, it's giving turtles all the way down, and honestly? we love that for her. πŸŒ€


🌈 SEE ALSO 🌈

ar(1), objdump(1), readelf(1), and the Info entries for binutils. go read those next, bestie, you know you want to. ⭐


Copyright (c) 1991-2018 Free Software Foundation, Inc.

permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. a copy of the license is included in the section entitled "GNU Free Documentation License". πŸŽ€


okayyy that's the whole page, you made it to the end, so proud of you πŸ₯ΉπŸ«Ά this absolute classic is binutils-2.30, dated 2018-01-27, and yes β€” it's a SIZE(1) moment. slay, periodt, go measure some sections. πŸ’œβœ¨πŸŒΈ

πŸ“¦ where this page comes from