@@ -772,32 +772,10 @@ static const char *sech_name(struct elf_info *elf, Elf_Shdr *sechdr)
772
772
sechdr -> sh_name ;
773
773
}
774
774
775
- /* if sym is empty or point to a string
776
- * like ".[0-9]+" then return 1.
777
- * This is the optional prefix added by ld to some sections
778
- */
779
- static int number_prefix (const char * sym )
780
- {
781
- if (* sym ++ == '\0' )
782
- return 1 ;
783
- if (* sym != '.' )
784
- return 0 ;
785
- do {
786
- char c = * sym ++ ;
787
- if (c < '0' || c > '9' )
788
- return 0 ;
789
- } while (* sym );
790
- return 1 ;
791
- }
792
-
793
775
/* The pattern is an array of simple patterns.
794
776
* "foo" will match an exact string equal to "foo"
795
777
* "*foo" will match a string that ends with "foo"
796
778
* "foo*" will match a string that begins with "foo"
797
- * "foo$" will match a string equal to "foo" or "foo.1"
798
- * where the '1' can be any number including several digits.
799
- * The $ syntax is for sections where ld append a dot number
800
- * to make section name unique.
801
779
*/
802
780
static int match (const char * sym , const char * const pat [])
803
781
{
@@ -816,13 +794,6 @@ static int match(const char *sym, const char * const pat[])
816
794
if (strncmp (sym , p , strlen (p ) - 1 ) == 0 )
817
795
return 1 ;
818
796
}
819
- /* "foo$" */
820
- else if (* endp == '$' ) {
821
- if (strncmp (sym , p , strlen (p ) - 1 ) == 0 ) {
822
- if (number_prefix (sym + strlen (p ) - 1 ))
823
- return 1 ;
824
- }
825
- }
826
797
/* no wildcards */
827
798
else {
828
799
if (strcmp (p , sym ) == 0 )
@@ -880,29 +851,29 @@ static void check_section(const char *modname, struct elf_info *elf,
880
851
881
852
882
853
#define ALL_INIT_DATA_SECTIONS \
883
- ".init.setup$ ", ".init.rodata$ ", ".meminit.rodata$ ", \
884
- ".init.data$ ", ".meminit.data$ "
854
+ ".init.setup", ".init.rodata", ".meminit.rodata", \
855
+ ".init.data", ".meminit.data"
885
856
#define ALL_EXIT_DATA_SECTIONS \
886
- ".exit.data$ ", ".memexit.data$ "
857
+ ".exit.data", ".memexit.data"
887
858
888
859
#define ALL_INIT_TEXT_SECTIONS \
889
- ".init.text$ ", ".meminit.text$ "
860
+ ".init.text", ".meminit.text"
890
861
#define ALL_EXIT_TEXT_SECTIONS \
891
- ".exit.text$ ", ".memexit.text$ "
862
+ ".exit.text", ".memexit.text"
892
863
893
864
#define ALL_PCI_INIT_SECTIONS \
894
- ".pci_fixup_early$ ", ".pci_fixup_header$ ", ".pci_fixup_final$ ", \
895
- ".pci_fixup_enable$ ", ".pci_fixup_resume$ ", \
896
- ".pci_fixup_resume_early$ ", ".pci_fixup_suspend$ "
865
+ ".pci_fixup_early", ".pci_fixup_header", ".pci_fixup_final", \
866
+ ".pci_fixup_enable", ".pci_fixup_resume", \
867
+ ".pci_fixup_resume_early", ".pci_fixup_suspend"
897
868
898
869
#define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS
899
870
#define ALL_XXXEXIT_SECTIONS MEM_EXIT_SECTIONS
900
871
901
872
#define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS
902
873
#define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS
903
874
904
- #define DATA_SECTIONS ".data$ ", ".data.rel$ "
905
- #define TEXT_SECTIONS ".text$ ", ".text.unlikely$ "
875
+ #define DATA_SECTIONS ".data", ".data.rel"
876
+ #define TEXT_SECTIONS ".text", ".text.unlikely"
906
877
907
878
#define INIT_SECTIONS ".init.*"
908
879
#define MEM_INIT_SECTIONS ".meminit.*"
0 commit comments