aboutsummaryrefslogtreecommitdiff
path: root/modutils/insmod.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-05-15 21:30:45 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-05-15 21:30:45 +0000
commit6b06cb80be64fcf207bee734cc678c25434ed1a4 (patch)
treeaebc37ae3a2658fba3f57003102fa0dfb1a10ac8 /modutils/insmod.c
parent43d5d429fd7a80ca02eb8388f058fd9654cc118d (diff)
downloadbusybox-w32-6b06cb80be64fcf207bee734cc678c25434ed1a4.tar.gz
busybox-w32-6b06cb80be64fcf207bee734cc678c25434ed1a4.tar.bz2
busybox-w32-6b06cb80be64fcf207bee734cc678c25434ed1a4.zip
more of -Wall fixes from Cristian Ionescu-Idbohrn.
Some are fixing real bugs. function old new delta syslogd_main 938 958 +20 get_signum 136 143 +7 obj_load 777 782 +5 recv_from_to 210 214 +4 get_next_block 1795 1799 +4 display_topmem_process_list 1117 1121 +4 logread_main 484 487 +3 buffer_fill_and_print 73 76 +3 kill_main 687 689 +2 ll_remember_index 240 241 +1 do_stats 452 453 +1 if_readconf 166 165 -1 display_process_list 1192 1191 -1 run_applet_and_exit 507 505 -2 print_signames 33 31 -2 parse_one_line 1092 1090 -2 find_out_spec 57 55 -2 add_ksymoops_symbols 421 419 -2 ash_main 1407 1402 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 11/8 up/down: 54/-17) Total: 37 bytes
Diffstat (limited to 'modutils/insmod.c')
-rw-r--r--modutils/insmod.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c
index f6dcbe8a8..0a74ba0e5 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -2041,7 +2041,7 @@ obj_add_symbol(struct obj_file *f, const char *name,
2041 int n_type = ELF_ST_TYPE(info); 2041 int n_type = ELF_ST_TYPE(info);
2042 int n_binding = ELF_ST_BIND(info); 2042 int n_binding = ELF_ST_BIND(info);
2043 2043
2044 for (sym = f->symtab[hash]; sym; sym = sym->next) 2044 for (sym = f->symtab[hash]; sym; sym = sym->next) {
2045 if (f->symbol_cmp(sym->name, name) == 0) { 2045 if (f->symbol_cmp(sym->name, name) == 0) {
2046 int o_secidx = sym->secidx; 2046 int o_secidx = sym->secidx;
2047 int o_info = sym->info; 2047 int o_info = sym->info;
@@ -2100,14 +2100,14 @@ obj_add_symbol(struct obj_file *f, const char *name,
2100 return sym; 2100 return sym;
2101 } 2101 }
2102 } 2102 }
2103 }
2103 2104
2104 /* Completely new symbol. */ 2105 /* Completely new symbol. */
2105 sym = arch_new_symbol(); 2106 sym = arch_new_symbol();
2106 sym->next = f->symtab[hash]; 2107 sym->next = f->symtab[hash];
2107 f->symtab[hash] = sym; 2108 f->symtab[hash] = sym;
2108 sym->ksymidx = -1; 2109 sym->ksymidx = -1;
2109 2110 if (ELF_ST_BIND(info) == STB_LOCAL && symidx != (unsigned long)(-1)) {
2110 if (ELF_ST_BIND(info) == STB_LOCAL && symidx != -1) {
2111 if (symidx >= f->local_symtab_size) 2111 if (symidx >= f->local_symtab_size)
2112 bb_error_msg("local symbol %s with index %ld exceeds local_symtab_size %ld", 2112 bb_error_msg("local symbol %s with index %ld exceeds local_symtab_size %ld",
2113 name, (long) symidx, (long) f->local_symtab_size); 2113 name, (long) symidx, (long) f->local_symtab_size);
@@ -3313,7 +3313,7 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits ATTRIBUTE_UNUSED)
3313{ 3313{
3314 struct obj_file *f; 3314 struct obj_file *f;
3315 ElfW(Shdr) * section_headers; 3315 ElfW(Shdr) * section_headers;
3316 int shnum, i; 3316 size_t shnum, i;
3317 char *shstrtab; 3317 char *shstrtab;
3318 3318
3319 /* Read the file header. */ 3319 /* Read the file header. */
@@ -3585,7 +3585,7 @@ static int obj_gpl_license(struct obj_file *f, const char **license)
3585 while (ptr < endptr) { 3585 while (ptr < endptr) {
3586 value = strchr(ptr, '='); 3586 value = strchr(ptr, '=');
3587 if (value && strncmp(ptr, "license", value-ptr) == 0) { 3587 if (value && strncmp(ptr, "license", value-ptr) == 0) {
3588 int i; 3588 unsigned i;
3589 if (license) 3589 if (license)
3590 *license = value+1; 3590 *license = value+1;
3591 for (i = 0; i < ARRAY_SIZE(gpl_licenses); ++i) { 3591 for (i = 0; i < ARRAY_SIZE(gpl_licenses); ++i) {
@@ -3724,7 +3724,8 @@ add_ksymoops_symbols(struct obj_file *f, const char *filename,
3724 struct obj_symbol *sym; 3724 struct obj_symbol *sym;
3725 char *name, *absolute_filename; 3725 char *name, *absolute_filename;
3726 char str[STRVERSIONLEN]; 3726 char str[STRVERSIONLEN];
3727 int i, l, lm_name, lfilename, use_ksymtab, version; 3727 unsigned i;
3728 int l, lm_name, lfilename, use_ksymtab, version;
3728 struct stat statbuf; 3729 struct stat statbuf;
3729 3730
3730 /* WARNING: was using realpath, but replaced by readlink to stop using 3731 /* WARNING: was using realpath, but replaced by readlink to stop using
@@ -4127,7 +4128,7 @@ int insmod_main(int argc, char **argv)
4127 m_size = obj_load_size(f); 4128 m_size = obj_load_size(f);
4128 4129
4129 m_addr = create_module(m_name, m_size); 4130 m_addr = create_module(m_name, m_size);
4130 if (m_addr == -1) switch (errno) { 4131 if (m_addr == (ElfW(Addr))(-1)) switch (errno) {
4131 case EEXIST: 4132 case EEXIST:
4132 bb_error_msg_and_die("a module named %s already exists", m_name); 4133 bb_error_msg_and_die("a module named %s already exists", m_name);
4133 case ENOMEM: 4134 case ENOMEM: