compress: split compress_blob() and friends to minimize dlopen dependencies
Previously, even though sd-journal does not support bzip2 and gzip compression, the dlopen ELF notes for those libraries were still being attached to libsystemd.so and various journal-handling executables. This occurred because the unified compression/decompression interfaces handled all formats unconditionally, causing the compiler and linker to pull in all associated dlopen notes across the board. To resolve this, split these functions into generic and journal-specific variants (e.g., introducing compress_blob_journal() and decompress_blob_journal()). The journal-specific variants only handle formats actually supported by the journal (LZ4, XZ, and ZSTD). By updating sd-journal, journald, journalctl, and related utilities to use these new `_journal` interfaces and switching them to the narrower COMPRESS_JOURNAL_NOTE macro, we ensure that unnecessary dlopen notes (for bzip2 and gzip) are no longer embedded into these binaries.
This commit is contained in:
@@ -2635,7 +2635,7 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_strv_free_ char **args = NULL;
|
||||
int r;
|
||||
|
||||
COMPRESS_DEFAULT_NOTE;
|
||||
COMPRESS_JOURNAL_NOTE;
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
Reference in New Issue
Block a user