From: Jan Kratochvil Date: Mon, 15 Oct 2012 14:15:41 +0000 (+0200) Subject: More patch cleanup. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0bb0c1757222a393ebca514af1bb888be1d2ca5c;p=thirdparty%2Felfutils.git More patch cleanup. --- diff --git a/libdwfl/dwfl_module_getelf.c b/libdwfl/dwfl_module_getelf.c index f88d8d825..f20fb0429 100644 --- a/libdwfl/dwfl_module_getelf.c +++ b/libdwfl/dwfl_module_getelf.c @@ -57,8 +57,7 @@ dwfl_module_getelf (Dwfl_Module *mod, GElf_Addr *loadbase) } } - if (loadbase) - *loadbase = dwfl_adjusted_address (mod, 0); + *loadbase = dwfl_adjusted_address (mod, 0); return mod->main.elf; } diff --git a/libdwfl/libdwfl.h b/libdwfl/libdwfl.h index 6204e3ffa..9985098d3 100644 --- a/libdwfl/libdwfl.h +++ b/libdwfl/libdwfl.h @@ -407,7 +407,8 @@ extern int dwfl_validate_address (Dwfl *dwfl, are found) for use with libelf. If successful, fills in *BIAS with the difference between addresses within the loaded module and those in symbol tables or Dwarf information referring to it. */ -extern Elf *dwfl_module_getelf (Dwfl_Module *, GElf_Addr *bias); +extern Elf *dwfl_module_getelf (Dwfl_Module *, GElf_Addr *bias) + __nonnull_attribute__ (1, 2); /* Return the number of symbols in the module's symbol table, or -1 for errors. */ diff --git a/tests/backtrace.c b/tests/backtrace.c index 6fab87d6c..5a3fcaec8 100644 --- a/tests/backtrace.c +++ b/tests/backtrace.c @@ -141,7 +141,8 @@ report_core (Dwfl *dwfl, const char *corefile) Dwfl_Module *mod = dwfl_report_elf (core_dwfl, "core", corefile, -1, 0 /* base */); assert (mod != NULL); - Elf *core = dwfl_module_getelf (mod, NULL); + GElf_Addr loadbase_ignore; + Elf *core = dwfl_module_getelf (mod, &loadbase_ignore); assert (core != NULL); int result = dwfl_core_file_report (dwfl, core); assert (result >= 0); @@ -503,7 +504,8 @@ is_core (const char *corefile) Dwfl *dwfl = dwfl_offline (); Dwfl_Module *mod = dwfl_report_elf (dwfl, "core", corefile, -1, 0 /* base */); assert (mod != NULL); - Elf *core = dwfl_module_getelf (mod, NULL); + GElf_Addr loadbase_ignore; + Elf *core = dwfl_module_getelf (mod, &loadbase_ignore); assert (core != NULL); GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (core, &ehdr_mem); assert (ehdr != NULL);