summaryrefslogtreecommitdiff
path: root/gold/options.cc
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2022-11-10 22:09:09 -0800
committerFangrui Song <i@maskray.me>2022-11-10 22:09:09 -0800
commit8b2d02cbb924f1f3718dc5a20f7a9dcf07739d23 (patch)
treea36e40d97c9024e70eb396345c524d3777e1b6b0 /gold/options.cc
parent332a4eeaea69034b8ee6f50b931ce6734b55bf08 (diff)
downloadbinutils-gdb-8b2d02cbb924f1f3718dc5a20f7a9dcf07739d23.tar.gz
gold: add --compress-debug-sections=zstd [PR 29641]
This option compresses output debug sections with zstd and sets ch_type to ELFCOMPRESS_ZSTD. Latest gdb and lldb support ELFCOMPRESS_ZSTD. There will be an error if zstd is not enabled at configure time. error: --compress-debug-sections=zstd: gold is not built with zstd support
Diffstat (limited to 'gold/options.cc')
-rw-r--r--gold/options.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/gold/options.cc b/gold/options.cc
index 04be98a3e39..fbd727199f1 100644
--- a/gold/options.cc
+++ b/gold/options.cc
@@ -1433,6 +1433,15 @@ General_options::finalize()
}
}
+#ifndef HAVE_ZSTD
+ if (strcmp(this->compress_debug_sections(), "zstd") == 0)
+ {
+ gold_error(_("--compress-debug-sections=zstd: gold is not built with "
+ "zstd support"));
+ this->set_compress_debug_sections("none");
+ }
+#endif
+
// --rosegment-gap implies --rosegment.
if (this->user_set_rosegment_gap())
this->set_rosegment(true);