X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fmodsign%2Fmod-extract.c;h=b7b5dd1621cdd33dd6817b843daa0aed032af6d8;hb=refs%2Fheads%2Fvserver;hp=cbb77c19bb63920dcc827617f56c4797ac079933;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/scripts/modsign/mod-extract.c b/scripts/modsign/mod-extract.c index cbb77c19b..b7b5dd162 100644 --- a/scripts/modsign/mod-extract.c +++ b/scripts/modsign/mod-extract.c @@ -106,7 +106,6 @@ void usage(void) exit(2); } -/*****************************************************************************/ /* * */ @@ -195,10 +194,8 @@ int main(int argc, char **argv) } return 0; +} -} /* end main() */ - -/*****************************************************************************/ /* * extract a RELA table * - need to canonicalise the entries in case section addition/removal has @@ -266,10 +263,8 @@ void extract_elf64_rela(const void *buffer, int secix, int targetix, } verbose("%02x %4d %s [canon]\n", csum, secix, sh_name); +} -} /* end extract_elf64_rela() */ - -/*****************************************************************************/ /* * extract a REL table * - need to canonicalise the entries in case section addition/removal has @@ -335,10 +330,8 @@ void extract_elf64_rel(const void *buffer, int secix, int targetix, } verbose("%02x %4d %s [canon]\n", csum, secix, sh_name); +} -} /* end extract_elf64_rel() */ - -/*****************************************************************************/ /* * extract the data from a 64-bit module */ @@ -368,6 +361,8 @@ void extract_elf64(void *buffer, size_t len, Elf64_Ehdr *hdr) symbols = NULL; strings = NULL; + nstrings = 0; + nsyms = 0; for (loop = 1; loop < shnum; loop++) { const char *sh_name = secstrings + get32(§ions[loop].sh_name); @@ -543,10 +538,8 @@ void extract_elf64(void *buffer, size_t len, Elf64_Ehdr *hdr) verbose("%08lx (%lu bytes csum 0x%02x)\n", ftell(outfd), ftell(outfd), xcsum); +} -} /* end extract_elf64() */ - -/*****************************************************************************/ /* * extract a RELA table * - need to canonicalise the entries in case section addition/removal has @@ -614,10 +607,8 @@ void extract_elf32_rela(const void *buffer, int secix, int targetix, } verbose("%02x %4d %s [canon]\n", csum, secix, sh_name); +} -} /* end extract_elf32_rela() */ - -/*****************************************************************************/ /* * extract a REL table * - need to canonicalise the entries in case section addition/removal has @@ -672,7 +663,7 @@ void extract_elf32_rel(const void *buffer, int secix, int targetix, /* canonicalise the section used by the symbol */ if (st_shndx > SHN_UNDEF && st_shndx < nsects) set16(&relocation.st_shndx, canonmap[st_shndx]); - + write_out_val(relocation); /* undefined symbols must be named if referenced */ @@ -683,10 +674,8 @@ void extract_elf32_rel(const void *buffer, int secix, int targetix, } verbose("%02x %4d %s [canon]\n", csum, secix, sh_name); +} -} /* end extract_elf32_rel() */ - -/*****************************************************************************/ /* * extract the data from a 32-bit module */ @@ -716,6 +705,8 @@ void extract_elf32(void *buffer, size_t len, Elf32_Ehdr *hdr) symbols = NULL; strings = NULL; + nstrings = 0; + nsyms = 0; for (loop = 1; loop < shnum; loop++) { const char *sh_name = secstrings + get32(§ions[loop].sh_name); @@ -896,5 +887,4 @@ void extract_elf32(void *buffer, size_t len, Elf32_Ehdr *hdr) verbose("%08lx (%lu bytes csum 0x%02x)\n", ftell(outfd), ftell(outfd), xcsum); - -} /* end extract_elf32() */ +}