diff options
author | Fangrui Song <i@maskray.me> | 2022-09-09 10:30:18 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-09-09 10:30:18 -0700 |
commit | 449f2ca146dde0ef14c9837f71d4a0be92ca4843 (patch) | |
tree | 7fd4ec694ffabe904ad3e013587c430e5d995582 /lld/docs | |
parent | ddc0465369a373f2022283905fdc7677eeaf9525 (diff) | |
download | llvm-449f2ca146dde0ef14c9837f71d4a0be92ca4843.tar.gz |
[ELF] Add --compress-debug-sections=zstd
`clang -gz=zstd a.o` passes this option to the linker. This option compresses output
debug sections with zstd and sets ch_type to ELFCOMPRESS_ZSTD. As of today, very
few DWARF consumers recognize ELFCOMPRESS_ZSTD.
Use the llvm::zstd::compress API with level llvm::zstd::DefaultCompression (5),
which we may tune after we have more experience with zstd output.
zstd has built-in parallel compression support (so we don't need to do D117853
for zlib), which is not leveraged yet.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D133548
Diffstat (limited to 'lld/docs')
-rw-r--r-- | lld/docs/ReleaseNotes.rst | 3 | ||||
-rw-r--r-- | lld/docs/ld.lld.1 | 16 |
2 files changed, 14 insertions, 5 deletions
diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst index af8b55578f81..2aad9b8644f3 100644 --- a/lld/docs/ReleaseNotes.rst +++ b/lld/docs/ReleaseNotes.rst @@ -28,6 +28,9 @@ ELF Improvements * ``ELFCOMPRESS_ZSTD`` compressed input sections are now supported. (`D129406 <https://reviews.llvm.org/D129406>`_) +* ``--compress-debug-sections=zstd`` is now available to compress debug + sections with zstd (``ELFCOMPRESS_ZSTD``). + (`D133548 <https://reviews.llvm.org/D133548>`_) Breaking changes ---------------- diff --git a/lld/docs/ld.lld.1 b/lld/docs/ld.lld.1 index b81eeb2232a2..7a4aa219187b 100644 --- a/lld/docs/ld.lld.1 +++ b/lld/docs/ld.lld.1 @@ -130,16 +130,22 @@ Alias for .Fl -color-diagnostics Ns = Ns Cm auto . .It Fl -compress-debug-sections Ns = Ns Ar value Compress DWARF debug sections. -.Ar value +.Cm value may be -.Cm none -or -.Cm zlib . +.Pp +.Bl -tag -width 2n -compact +.It Cm none +No compression. +.It Cm zlib The default compression level is 1 (fastest) as the debug info usually -compresses well at that level, but if you want to compress it more, +compresses well at that level. If you want to compress it more, you can specify .Fl O2 to set the compression level to 6. +.It Cm zstd +The compression level is 5. +.El +.Pp .It Fl -cref Output cross reference table. If .Fl Map |