shared: Clean up includes

Split out of #37344.
This commit is contained in:
Daan De Meyer
2025-05-24 14:00:44 +02:00
parent 9d75fb9647
commit 69a283c5f2
394 changed files with 1181 additions and 1903 deletions
+12 -8
View File
@@ -1,16 +1,16 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#if HAVE_ELFUTILS
#include <dwarf.h>
#include <elfutils/libdwelf.h>
#include <elfutils/libdwfl.h>
#include <libelf.h>
#endif
#include <sys/prctl.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <unistd.h>
#include "sd-json.h"
#include "alloc-util.h"
#include "dlfcn-util.h"
#include "elf-util.h"
@@ -19,14 +19,12 @@
#include "fd-util.h"
#include "fileio.h"
#include "format-util.h"
#include "hexdecoct.h"
#include "io-util.h"
#include "log.h"
#include "macro.h"
#include "memstream-util.h"
#include "path-util.h"
#include "process-util.h"
#include "rlimit-util.h"
#include "set.h"
#include "string-util.h"
#define FRAMES_MAX 64
@@ -36,6 +34,8 @@
/* The amount of data we're willing to write to each of the output pipes. */
#define COREDUMP_PIPE_MAX (1024*1024U)
#if HAVE_ELFUTILS
static void *dw_dl = NULL;
static void *elf_dl = NULL;
@@ -761,7 +761,10 @@ static int parse_elf(int fd, const char *executable, const char *root, char **re
return 0;
}
#endif
int parse_elf_object(int fd, const char *executable, const char *root, bool fork_disable_dump, char **ret, sd_json_variant **ret_package_metadata) {
#if HAVE_ELFUTILS
_cleanup_close_pair_ int error_pipe[2] = EBADF_PAIR,
return_pipe[2] = EBADF_PAIR,
json_pipe[2] = EBADF_PAIR;
@@ -912,6 +915,7 @@ int parse_elf_object(int fd, const char *executable, const char *root, bool fork
*ret_package_metadata = TAKE_PTR(package_metadata);
return 0;
}
#else
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "elfutils disabled, parsing ELF objects not supported");
#endif
}