Update cheatsheets

This commit is contained in:
ivuorinen
2025-04-20 00:20:58 +00:00
parent 846fc1563d
commit a360d4dc45
153 changed files with 493 additions and 434 deletions

View File

@@ -10,12 +10,12 @@ source: https://github.com/tldr-pages/tldr.git
- Link a specific object file with no dependencies into an executable:
`ld {{path/to/file.o}} --output {{path/to/output_executable}}`
`ld {{path/to/file.o}} {{[-o|--output]}} {{path/to/output_executable}}`
- Link two object files together:
`ld {{path/to/file1.o}} {{path/to/file2.o}} --output {{path/to/output_executable}}`
`ld {{path/to/file1.o}} {{path/to/file2.o}} {{[-o|--output]}} {{path/to/output_executable}}`
- Dynamically link an x86_64 program to glibc (file paths change depending on the system):
`ld --output {{path/to/output_executable}} --dynamic-linker /lib/ld-linux-x86-64.so.2 /lib/crt1.o /lib/crti.o -lc {{path/to/file.o}} /lib/crtn.o`
`ld {{[-o|--output]}} {{path/to/output_executable}} {{[-I|--dynamic-linker]}} /lib/ld-linux-x86-64.so.2 /lib/crt1.o /lib/crti.o -lc {{path/to/file.o}} /lib/crtn.o`