| @@ -308,7 +308,8 @@ static const char *sec_name(struct elf_info *elf, int secindex) · 307 unmodified lines |
| 308 | | 308 | |
| 309 | static void *sym_get_data(const struct elf_info *info, const Elf_Sym *sym) | 309 | static void *sym_get_data(const struct elf_info *info, const Elf_Sym *sym) |
| 310 | { | 310 | { |
| 311 | Elf_Shdr *sechdr = &info->sechdrs[sym->st_shndx]; | 311 | unsigned int secindex = get_secindex(info, sym); |
| | 312 | Elf_Shdr *sechdr = &info->sechdrs[secindex]; |
| 312 | unsigned long offset; | 313 | unsigned long offset; |
| 313 | | 314 | |
| 314 | offset = sym->st_value; | 315 | offset = sym->st_value; |
| @@ -2427,7 +2428,7 @@ static void write_if_changed(struct buffer *b, const char *fname) · 2112 unmodified lines |
| 2427 | } | 2428 | } |
| 2428 | | 2429 | |
| 2429 | /* parse Module.symvers file. line format: | 2430 | /* parse Module.symvers file. line format: |
| 2430 | * 0x12345678<tab>symbol<tab>module[[<tab>export]<tab>something] | 2431 | * 0x12345678<tab>symbol<tab>module<tab>export<tab>namespace |
| 2431 | **/ | 2432 | **/ |
| 2432 | static void read_dump(const char *fname, unsigned int kernel) | 2433 | static void read_dump(const char *fname, unsigned int kernel) |
| 2433 | { | 2434 | { |
| @@ -2440,7 +2441,7 @@ static void read_dump(const char *fname, unsigned int kernel) · 6 unmodified lines |
| 2440 | return; | 2441 | return; |
| 2441 | | 2442 | |
| 2442 | while ((line = get_next_line(&pos, file, size))) { | 2443 | while ((line = get_next_line(&pos, file, size))) { |
| 2443 | char *symname, *namespace, *modname, *d, *export, *end; | 2444 | char *symname, *namespace, *modname, *d, *export; |
| 2444 | unsigned int crc; | 2445 | unsigned int crc; |
| 2445 | struct module *mod; | 2446 | struct module *mod; |
| 2446 | struct symbol *s; | 2447 | struct symbol *s; |
| @@ -2448,16 +2449,16 @@ static void read_dump(const char *fname, unsigned int kernel) · 1 unmodified line |
| 2448 | if (!(symname = strchr(line, '\t'))) | 2449 | if (!(symname = strchr(line, '\t'))) |
| 2449 | goto fail; | 2450 | goto fail; |
| 2450 | *symname++ = '\0'; | 2451 | *symname++ = '\0'; |
| 2451 | if (!(namespace = strchr(symname, '\t'))) | 2452 | if (!(modname = strchr(symname, '\t'))) |
| 2452 | goto fail; | | |
| 2453 | *namespace++ = '\0'; | | |
| 2454 | if (!(modname = strchr(namespace, '\t'))) | | |
| 2455 | goto fail; | 2453 | goto fail; |
| 2456 | *modname++ = '\0'; | 2454 | *modname++ = '\0'; |
| 2457 | if ((export = strchr(modname, '\t')) != NULL) | 2455 | if (!(export = strchr(modname, '\t'))) |
| 2458 | *export++ = '\0'; | 2456 | goto fail; |
| 2459 | if (export && ((end = strchr(export, '\t')) != NULL)) | 2457 | *export++ = '\0'; |
| 2460 | *end = '\0'; | 2458 | if (!(namespace = strchr(export, '\t'))) |
| | 2459 | goto fail; |
| | 2460 | *namespace++ = '\0'; |
| | 2461 | |
| 2461 | crc = strtoul(line, &d, 16); | 2462 | crc = strtoul(line, &d, 16); |
| 2462 | if (*symname == '\0' || *modname == '\0' || *d != '\0') | 2463 | if (*symname == '\0' || *modname == '\0' || *d != '\0') |
| 2463 | goto fail; | 2464 | goto fail; |
| @@ -2508,9 +2509,9 @@ static void write_dump(const char *fname) · 44 unmodified lines |
| 2508 | namespace = symbol->namespace; | 2509 | namespace = symbol->namespace; |
| 2509 | buf_printf(&buf, "0x%08x\t%s\t%s\t%s\t%s\n", | 2510 | buf_printf(&buf, "0x%08x\t%s\t%s\t%s\t%s\n", |
| 2510 | symbol->crc, symbol->name, | 2511 | symbol->crc, symbol->name, |
| 2511 | namespace ? namespace : "", | | |
| 2512 | symbol->module->name, | 2512 | symbol->module->name, |
| 2513 | export_str(symbol->export)); | 2513 | export_str(symbol->export), |
| | 2514 | namespace ? namespace : ""); |
| 2514 | } | 2515 | } |
| 2515 | symbol = symbol->next; | 2516 | symbol = symbol->next; |
| 2516 | } | 2517 | } |