]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
More patch cleanup.
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 15 Oct 2012 14:15:41 +0000 (16:15 +0200)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 15 Oct 2012 14:15:41 +0000 (16:15 +0200)
libdwfl/dwfl_module_getelf.c
libdwfl/libdwfl.h
tests/backtrace.c

index f88d8d8255dfc82341425c89b14b34f123309545..f20fb0429f6a68f73e0fa3288375195dc6d8f52a 100644 (file)
@@ -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;
     }
 
index 6204e3ffa66342d808a2d216fc7f0d1d7ec2ba32..9985098d3d2e001760d30b1a80d2db0d40124729 100644 (file)
@@ -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.  */
index 6fab87d6cb18892744b665f3d6a16093b1722553..5a3fcaec841921cc0cc33d6ef95fecc28faddba5 100644 (file)
@@ -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);