LLVM-STRINGS(1)

✨ LLVM-STRINGS ✨

okay so bestie, this is a page from the LLVM manual set, and honestly? it's a little cutie. let's get into it πŸ’…


🌸 NAME 🌸

llvm-strings β€” it prints strings. that's it. that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

llvm-strings [options] [input...]

πŸ’– DESCRIPTION πŸ’–

so llvm-strings is a tool that's intended as a drop-in replacement for GNU's strings. what it does is go hunting for printable strings inside files and then writes them out to the standard output stream. lowkey iconic. ✨

now, what even is a printable string? it's any sequence of four (by default β€” you can change that, we'll get there) or more printable ASCII characters. that's the whole definition. and the sequence ends the moment you hit the end of the file, or literally any other byte. any other byte = buzzkill, sequence over. 😭

llvm-strings looks for strings in each input file you give it. but here's the plot twist: unlike GNU strings, it looks in the entire input file, regardless of file format β€” it does not restrict the search to certain sections of object files. main character energy fr fr, it's reading the whole thing. πŸ‘‘

and if you specify - as an input, or you just don't specify any input at all, the program reads from the standard input stream. no input? no problem. 🫢


πŸ“ EXAMPLE πŸ“

$ cat input.txt
bars
foo
wibble blob
$ llvm-strings input.txt
bars
wibble blob

see how foo didn't make the cut? three characters, bestie. it needed four. the way that rules is so real. πŸ’€


πŸ‘‘ OPTIONS πŸ‘‘

  • --all, -a β€” this one is silently ignored. it does literally nothing. it's just here so GNU strings compatibility works. a decorative queen, no cap. πŸ’…
  • --bytes=<length>, -n β€” sets the minimum number of printable ASCII characters required for a sequence of bytes to be considered a string. the default value is 4.
  • --help, -h β€” displays a summary of the command line options. classic. 🌈
  • --print-file-name, -f β€” displays the name of the containing file before each string. so you always know which file a string came from. obsessed. πŸ¦‹

Example:

$ llvm-strings --print-file-name test.o test.elf
test.o: _Z5hellov
test.o: some_bss
test.o: test.cpp
test.o: main
test.elf: test.cpp
test.elf: test2.cpp
test.elf: _Z5hellov
test.elf: main
test.elf: some_bss
  • --radix=<radix>, -t β€” displays the offset within the file of each string, before the string, and using the radix you specify. valid <radix> values are o, d and x for octal, decimal and hexadecimal respectively. numbers girlies rise up πŸ”₯

Example:

$ llvm-strings --radix=o test.o
    1054 _Z5hellov
    1066 .rela.text
    1101 .comment
    1112 some_bss
    1123 .bss
    1130 test.cpp
    1141 main
$ llvm-strings --radix=d test.o
    556 _Z5hellov
    566 .rela.text
    577 .comment
    586 some_bss
    595 .bss
    600 test.cpp
    609 main
$ llvm-strings -t x test.o
    22c _Z5hellov
    236 .rela.text
    241 .comment
    24a some_bss
    253 .bss
    258 test.cpp
    261 main
  • --version β€” displays the version of the llvm-strings executable. know your queen's era. ⭐
  • @<FILE> β€” read command-line options from response file <FILE>. iykyk. 🧚

πŸ’œ EXIT STATUS πŸ’œ

llvm-strings exits with a non-zero exit code if there is an error. otherwise? it exits with code 0. slay and clean. ✨


πŸ™ˆ BUGS πŸ™ˆ

to report bugs, please visit:

https://github.com/llvm/llvm-project/labels/tools:llvm-strings/

go off, be a good citizen, file that bug. 🫢


🌺 AUTHOR 🌺

maintained by the LLVM Team (https://llvm.org/). πŸ’–


2003-2025, LLVM Project


ngl bestie, four characters minimum by default, -t for offsets in o/d/x, -f for the filename β€” and -a is just there being pretty. periodt. πŸ’…

okay that's the page!! this one's LLVM-branded, page 19, dated 2025-01-17, and it goes out to the LLVM-STRINGS(1) girlies everywhere. bye bestie, see u in the group chat πŸŒΈπŸ¦‹πŸ’–

πŸ“¦ where this page comes from