diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-05-21 14:10:26 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-06-12 15:21:15 +0200 |
commit | 5c672e90a659033815b104b2da128037b26a31ef (patch) | |
tree | b3fdf5013bd5753077deada35eb76f762077081c /src/shared/elf-util.c | |
parent | repart: Use CRYPT_ACTIVATE_PRIVATE (diff) | |
download | systemd-5c672e90a659033815b104b2da128037b26a31ef.tar.xz systemd-5c672e90a659033815b104b2da128037b26a31ef.zip |
basic/dlfcn-util: deobfuscate macro definitions
When looking at how dlopen for various libs is implemented, I found that the
macros hide too much. I find it much easier to see what is going on if 'extern'
and '= NULL' are written explicitly. After all, we don't hide those for other
definitions, e.g. our style guide says that static variables should be
initialized with '= NULL'. With that change, it's much more obvious what is
a variable declaration and what is a variable initialization.
Diffstat (limited to 'src/shared/elf-util.c')
-rw-r--r-- | src/shared/elf-util.c | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/src/shared/elf-util.c b/src/shared/elf-util.c index 9d1f494671..e7819a512e 100644 --- a/src/shared/elf-util.c +++ b/src/shared/elf-util.c @@ -38,51 +38,51 @@ static void *dw_dl = NULL; static void *elf_dl = NULL; /* libdw symbols */ -static DLSYM_FUNCTION(dwarf_attr_integrate); -static DLSYM_FUNCTION(dwarf_diename); -static DLSYM_FUNCTION(dwarf_formstring); -static DLSYM_FUNCTION(dwarf_getscopes); -static DLSYM_FUNCTION(dwarf_getscopes_die); -static DLSYM_FUNCTION(dwelf_elf_begin); +static DLSYM_PROTOTYPE(dwarf_attr_integrate) = NULL; +static DLSYM_PROTOTYPE(dwarf_diename) = NULL; +static DLSYM_PROTOTYPE(dwarf_formstring) = NULL; +static DLSYM_PROTOTYPE(dwarf_getscopes) = NULL; +static DLSYM_PROTOTYPE(dwarf_getscopes_die) = NULL; +static DLSYM_PROTOTYPE(dwelf_elf_begin) = NULL; #if HAVE_DWELF_ELF_E_MACHINE_STRING -static DLSYM_FUNCTION(dwelf_elf_e_machine_string); +static DLSYM_PROTOTYPE(dwelf_elf_e_machine_string) = NULL; #endif -static DLSYM_FUNCTION(dwelf_elf_gnu_build_id); -static DLSYM_FUNCTION(dwarf_tag); -static DLSYM_FUNCTION(dwfl_addrmodule); -static DLSYM_FUNCTION(dwfl_begin); -static DLSYM_FUNCTION(dwfl_build_id_find_elf); -static DLSYM_FUNCTION(dwfl_core_file_attach); -static DLSYM_FUNCTION(dwfl_core_file_report); -static DLSYM_FUNCTION(dwfl_end); -static DLSYM_FUNCTION(dwfl_errmsg); -static DLSYM_FUNCTION(dwfl_errno); -static DLSYM_FUNCTION(dwfl_frame_pc); -static DLSYM_FUNCTION(dwfl_getmodules); -static DLSYM_FUNCTION(dwfl_getthreads); -static DLSYM_FUNCTION(dwfl_module_addrdie); -static DLSYM_FUNCTION(dwfl_module_addrname); -static DLSYM_FUNCTION(dwfl_module_build_id); -static DLSYM_FUNCTION(dwfl_module_getelf); -static DLSYM_FUNCTION(dwfl_module_info); -static DLSYM_FUNCTION(dwfl_offline_section_address); -static DLSYM_FUNCTION(dwfl_report_end); -static DLSYM_FUNCTION(dwfl_standard_find_debuginfo); -static DLSYM_FUNCTION(dwfl_thread_getframes); -static DLSYM_FUNCTION(dwfl_thread_tid); +static DLSYM_PROTOTYPE(dwelf_elf_gnu_build_id) = NULL; +static DLSYM_PROTOTYPE(dwarf_tag) = NULL; +static DLSYM_PROTOTYPE(dwfl_addrmodule) = NULL; +static DLSYM_PROTOTYPE(dwfl_begin) = NULL; +static DLSYM_PROTOTYPE(dwfl_build_id_find_elf) = NULL; +static DLSYM_PROTOTYPE(dwfl_core_file_attach) = NULL; +static DLSYM_PROTOTYPE(dwfl_core_file_report) = NULL; +static DLSYM_PROTOTYPE(dwfl_end) = NULL; +static DLSYM_PROTOTYPE(dwfl_errmsg) = NULL; +static DLSYM_PROTOTYPE(dwfl_errno) = NULL; +static DLSYM_PROTOTYPE(dwfl_frame_pc) = NULL; +static DLSYM_PROTOTYPE(dwfl_getmodules) = NULL; +static DLSYM_PROTOTYPE(dwfl_getthreads) = NULL; +static DLSYM_PROTOTYPE(dwfl_module_addrdie) = NULL; +static DLSYM_PROTOTYPE(dwfl_module_addrname) = NULL; +static DLSYM_PROTOTYPE(dwfl_module_build_id) = NULL; +static DLSYM_PROTOTYPE(dwfl_module_getelf) = NULL; +static DLSYM_PROTOTYPE(dwfl_module_info) = NULL; +static DLSYM_PROTOTYPE(dwfl_offline_section_address) = NULL; +static DLSYM_PROTOTYPE(dwfl_report_end) = NULL; +static DLSYM_PROTOTYPE(dwfl_standard_find_debuginfo) = NULL; +static DLSYM_PROTOTYPE(dwfl_thread_getframes) = NULL; +static DLSYM_PROTOTYPE(dwfl_thread_tid) = NULL; /* libelf symbols */ -static DLSYM_FUNCTION(elf_begin); -static DLSYM_FUNCTION(elf_end); -static DLSYM_FUNCTION(elf_getdata_rawchunk); -static DLSYM_FUNCTION(gelf_getehdr); -static DLSYM_FUNCTION(elf_getphdrnum); -static DLSYM_FUNCTION(elf_errmsg); -static DLSYM_FUNCTION(elf_errno); -static DLSYM_FUNCTION(elf_memory); -static DLSYM_FUNCTION(elf_version); -static DLSYM_FUNCTION(gelf_getphdr); -static DLSYM_FUNCTION(gelf_getnote); +static DLSYM_PROTOTYPE(elf_begin) = NULL; +static DLSYM_PROTOTYPE(elf_end) = NULL; +static DLSYM_PROTOTYPE(elf_getdata_rawchunk) = NULL; +static DLSYM_PROTOTYPE(gelf_getehdr) = NULL; +static DLSYM_PROTOTYPE(elf_getphdrnum) = NULL; +static DLSYM_PROTOTYPE(elf_errmsg) = NULL; +static DLSYM_PROTOTYPE(elf_errno) = NULL; +static DLSYM_PROTOTYPE(elf_memory) = NULL; +static DLSYM_PROTOTYPE(elf_version) = NULL; +static DLSYM_PROTOTYPE(gelf_getphdr) = NULL; +static DLSYM_PROTOTYPE(gelf_getnote) = NULL; int dlopen_dw(void) { int r; |