CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX was selected by BLACKFIN, METAG. They were removed by commit 4ba66a976072 ("arch: remove blackfin port"), commit bb6fb6dfcc17 ("metag: Remove arch/metag/"), respectively. No more architecture enables CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX, hence VMLINUX_SYMBOL_STR(foo) can be simplify replaced with "foo".
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -19,9 +19,7 @@ · 18 unmodified lines | ||
| 19 | 19 | #include <stdbool.h> |
| 20 | 20 | #include <errno.h> |
| 21 | 21 | #include "modpost.h" |
| 22 | −#include "../../include/generated/autoconf.h" | |
| 23 | 22 | #include "../../include/linux/license.h" |
| 24 | −#include "../../include/linux/export.h" | |
| 25 | 23 | |
| 26 | 24 | /* Are we using CONFIG_MODVERSIONS? */ |
| 27 | 25 | static int modversions = 0; |
| @@ -591,7 +589,7 @@ static void parse_elf_finish(struct elf_info *info) · 563 unmodified lines | ||
| 591 | 589 | static int ignore_undef_symbol(struct elf_info *info, const char *symname) |
| 592 | 590 | { |
| 593 | 591 | /* ignore __this_module, it will be resolved shortly */ |
| 594 | − if (strcmp(symname, VMLINUX_SYMBOL_STR(__this_module)) == 0) | |
| 592 | + if (strcmp(symname, "__this_module") == 0) | |
| 595 | 593 | return 1; |
| 596 | 594 | /* ignore global offset table */ |
| 597 | 595 | if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0) |
| @@ -617,9 +615,6 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname) · 19 unmodified lines | ||
| 617 | 615 | return 0; |
| 618 | 616 | } |
| 619 | 617 | |
| 620 | −#define CRC_PFX VMLINUX_SYMBOL_STR(__crc_) | |
| 621 | −#define KSYMTAB_PFX VMLINUX_SYMBOL_STR(__ksymtab_) | |
| 622 | − | |
| 623 | 618 | static void handle_modversions(struct module *mod, struct elf_info *info, |
| 624 | 619 | Elf_Sym *sym, const char *symname) |
| 625 | 620 | { |
| @@ -634,7 +629,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info, · 8 unmodified lines | ||
| 634 | 629 | export = export_from_sec(info, get_secindex(info, sym)); |
| 635 | 630 | |
| 636 | 631 | /* CRC'd symbol */ |
| 637 | − if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) { | |
| 632 | + if (strncmp(symname, "__crc_", strlen("__crc_")) == 0) { | |
| 638 | 633 | is_crc = true; |
| 639 | 634 | crc = (unsigned int) sym->st_value; |
| 640 | 635 | if (sym->st_shndx != SHN_UNDEF && sym->st_shndx != SHN_ABS) { |
| @@ -647,7 +642,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info, · 6 unmodified lines | ||
| 647 | 642 | info->sechdrs[sym->st_shndx].sh_addr : 0); |
| 648 | 643 | crc = *crcp; |
| 649 | 644 | } |
| 650 | − sym_update_crc(symname + strlen(CRC_PFX), mod, crc, | |
| 645 | + sym_update_crc(symname + strlen("__crc_"), mod, crc, | |
| 651 | 646 | export); |
| 652 | 647 | } |
| 653 | 648 | |
| @@ -685,15 +680,10 @@ static void handle_modversions(struct module *mod, struct elf_info *info, · 31 unmodified lines | ||
| 685 | 680 | } |
| 686 | 681 | #endif |
| 687 | 682 | |
| 688 | −#ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX | |
| 689 | − if (symname[0] != '_') | |
| 690 | − break; | |
| 691 | − else | |
| 692 | − symname++; | |
| 693 | −#endif | |
| 694 | 683 | if (is_crc) { |
| 695 | 684 | const char *e = is_vmlinux(mod->name) ?"":".ko"; |
| 696 | − warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol will not be versioned.\n", symname + strlen(CRC_PFX), mod->name, e); | |
| 685 | + warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol will not be versioned.\n", | |
| 686 | + symname + strlen("__crc_"), mod->name, e); | |
| 697 | 687 | } |
| 698 | 688 | mod->unres = alloc_symbol(symname, |
| 699 | 689 | ELF_ST_BIND(sym->st_info) == STB_WEAK, |
| @@ -701,13 +691,13 @@ static void handle_modversions(struct module *mod, struct elf_info *info, · 1 unmodified line | ||
| 701 | 691 | break; |
| 702 | 692 | default: |
| 703 | 693 | /* All exported symbols */ |
| 704 | − if (strncmp(symname, KSYMTAB_PFX, strlen(KSYMTAB_PFX)) == 0) { | |
| 705 | − sym_add_exported(symname + strlen(KSYMTAB_PFX), mod, | |
| 694 | + if (strncmp(symname, "__ksymtab_", strlen("__ksymtab_")) == 0) { | |
| 695 | + sym_add_exported(symname + strlen("__ksymtab_"), mod, | |
| 706 | 696 | export); |
| 707 | 697 | } |
| 708 | − if (strcmp(symname, VMLINUX_SYMBOL_STR(init_module)) == 0) | |
| 698 | + if (strcmp(symname, "init_module") == 0) | |
| 709 | 699 | mod->has_init = 1; |
| 710 | − if (strcmp(symname, VMLINUX_SYMBOL_STR(cleanup_module)) == 0) | |
| 700 | + if (strcmp(symname, "cleanup_module") == 0) | |
| 711 | 701 | mod->has_cleanup = 1; |
| 712 | 702 | break; |
| 713 | 703 | } |
| @@ -2230,7 +2220,7 @@ static int add_versions(struct buffer *b, struct module *mod) · 1516 unmodified lines | ||
| 2230 | 2220 | err = 1; |
| 2231 | 2221 | break; |
| 2232 | 2222 | } |
| 2233 | − buf_printf(b, "\t{ %#8x, __VMLINUX_SYMBOL_STR(%s) },\n", | |
| 2223 | + buf_printf(b, "\t{ %#8x, \"%s\" },\n", | |
| 2234 | 2224 | s->crc, s->name); |
| 2235 | 2225 | } |
| 2236 | 2226 | |