diff options
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r-- | scripts/mod/modpost.c | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 936b6f8e46f..161b7846733 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -384,11 +384,19 @@ static int parse_elf(struct elf_info *info, const char *filename) | |||
384 | return 0; | 384 | return 0; |
385 | } | 385 | } |
386 | /* Fix endianness in ELF header */ | 386 | /* Fix endianness in ELF header */ |
387 | hdr->e_shoff = TO_NATIVE(hdr->e_shoff); | 387 | hdr->e_type = TO_NATIVE(hdr->e_type); |
388 | hdr->e_shstrndx = TO_NATIVE(hdr->e_shstrndx); | 388 | hdr->e_machine = TO_NATIVE(hdr->e_machine); |
389 | hdr->e_shnum = TO_NATIVE(hdr->e_shnum); | 389 | hdr->e_version = TO_NATIVE(hdr->e_version); |
390 | hdr->e_machine = TO_NATIVE(hdr->e_machine); | 390 | hdr->e_entry = TO_NATIVE(hdr->e_entry); |
391 | hdr->e_type = TO_NATIVE(hdr->e_type); | 391 | hdr->e_phoff = TO_NATIVE(hdr->e_phoff); |
392 | hdr->e_shoff = TO_NATIVE(hdr->e_shoff); | ||
393 | hdr->e_flags = TO_NATIVE(hdr->e_flags); | ||
394 | hdr->e_ehsize = TO_NATIVE(hdr->e_ehsize); | ||
395 | hdr->e_phentsize = TO_NATIVE(hdr->e_phentsize); | ||
396 | hdr->e_phnum = TO_NATIVE(hdr->e_phnum); | ||
397 | hdr->e_shentsize = TO_NATIVE(hdr->e_shentsize); | ||
398 | hdr->e_shnum = TO_NATIVE(hdr->e_shnum); | ||
399 | hdr->e_shstrndx = TO_NATIVE(hdr->e_shstrndx); | ||
392 | sechdrs = (void *)hdr + hdr->e_shoff; | 400 | sechdrs = (void *)hdr + hdr->e_shoff; |
393 | info->sechdrs = sechdrs; | 401 | info->sechdrs = sechdrs; |
394 | 402 | ||
@@ -402,13 +410,16 @@ static int parse_elf(struct elf_info *info, const char *filename) | |||
402 | 410 | ||
403 | /* Fix endianness in section headers */ | 411 | /* Fix endianness in section headers */ |
404 | for (i = 0; i < hdr->e_shnum; i++) { | 412 | for (i = 0; i < hdr->e_shnum; i++) { |
405 | sechdrs[i].sh_type = TO_NATIVE(sechdrs[i].sh_type); | 413 | sechdrs[i].sh_name = TO_NATIVE(sechdrs[i].sh_name); |
406 | sechdrs[i].sh_offset = TO_NATIVE(sechdrs[i].sh_offset); | 414 | sechdrs[i].sh_type = TO_NATIVE(sechdrs[i].sh_type); |
407 | sechdrs[i].sh_size = TO_NATIVE(sechdrs[i].sh_size); | 415 | sechdrs[i].sh_flags = TO_NATIVE(sechdrs[i].sh_flags); |
408 | sechdrs[i].sh_link = TO_NATIVE(sechdrs[i].sh_link); | 416 | sechdrs[i].sh_addr = TO_NATIVE(sechdrs[i].sh_addr); |
409 | sechdrs[i].sh_name = TO_NATIVE(sechdrs[i].sh_name); | 417 | sechdrs[i].sh_offset = TO_NATIVE(sechdrs[i].sh_offset); |
410 | sechdrs[i].sh_info = TO_NATIVE(sechdrs[i].sh_info); | 418 | sechdrs[i].sh_size = TO_NATIVE(sechdrs[i].sh_size); |
411 | sechdrs[i].sh_addr = TO_NATIVE(sechdrs[i].sh_addr); | 419 | sechdrs[i].sh_link = TO_NATIVE(sechdrs[i].sh_link); |
420 | sechdrs[i].sh_info = TO_NATIVE(sechdrs[i].sh_info); | ||
421 | sechdrs[i].sh_addralign = TO_NATIVE(sechdrs[i].sh_addralign); | ||
422 | sechdrs[i].sh_entsize = TO_NATIVE(sechdrs[i].sh_entsize); | ||
412 | } | 423 | } |
413 | /* Find symbol table. */ | 424 | /* Find symbol table. */ |
414 | for (i = 1; i < hdr->e_shnum; i++) { | 425 | for (i = 1; i < hdr->e_shnum; i++) { |
@@ -716,7 +727,17 @@ int match(const char *sym, const char * const pat[]) | |||
716 | 727 | ||
717 | /* sections that we do not want to do full section mismatch check on */ | 728 | /* sections that we do not want to do full section mismatch check on */ |
718 | static const char *section_white_list[] = | 729 | static const char *section_white_list[] = |
719 | { ".comment", ".debug*", ".stab*", ".note*", ".got*", ".toc*", NULL }; | 730 | { |
731 | ".comment*", | ||
732 | ".debug*", | ||
733 | ".mdebug*", /* alpha, score, mips etc. */ | ||
734 | ".pdr", /* alpha, score, mips etc. */ | ||
735 | ".stab*", | ||
736 | ".note*", | ||
737 | ".got*", | ||
738 | ".toc*", | ||
739 | NULL | ||
740 | }; | ||
720 | 741 | ||
721 | /* | 742 | /* |
722 | * This is used to find sections missing the SHF_ALLOC flag. | 743 | * This is used to find sections missing the SHF_ALLOC flag. |