Changeset 2003
- Timestamp:
- Jun 6, 2005, 4:43:42 AM (20 years ago)
- Location:
- trunk/src/gcc/gcc/config/i386
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/gcc/gcc/config/i386/emx-libgcc_so_d.def ¶
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r2002 r2003 1 1 ; Auto-generated file, DO NOT EDIT!!! (see libgcc_d.awk) */ 2 LIBRARY libc06b 2INITINSTANCE TERMINSTANCE2 LIBRARY libc06b5 INITINSTANCE TERMINSTANCE 3 3 EXPORTS 4 4 EXPORTS -
Property cvs2svn:cvs-rev
changed from
-
TabularUnified trunk/src/gcc/gcc/config/i386/emx.c ¶
-
Property cvs2svn:cvs-rev
changed from
1.28
to1.29
r2002 r2003 126 126 127 127 int emx_c_set_decl_assembler_name (decl, fclass) 128 tree decl; 128 tree decl; 129 129 int fclass; 130 130 { … … 135 135 tree id, type; 136 136 int rc = 1; 137 137 138 138 /* 139 139 dfprintf((stderr, "emx_c_set_decl_assembler_name\n")); … … 429 429 /* Checks if the function is using either optlink or system calling convention 430 430 and returns 1 in those cases forcing the return value to be in memory. 431 The problem (#631) was that structures less than 8 bytes were returned in 431 The problem (#631) was that structures less than 8 bytes were returned in 432 432 registers. _System and _Optlink requires them to be passed in as a hidden 433 433 parameter. … … 477 477 } 478 478 479 /* Strip the no-underscore prefix. 480 Also strip the stdcall suffix. */ 481 const char * emx_strip_name_encoding_full (str) 479 /* Strip only the leading encoding, leaving the stdcall suffix. */ 480 481 const char * 482 i386_emx_strip_name_encoding (str) 482 483 const char *str; 483 484 { 484 const char *p; 485 if (*str == DLL_IMPORT_EXPORT_PREFIX) 486 str += 3; 485 487 if (*str == '%') /* don't actually know what this is.. */ 486 488 str += 2; 487 489 if (*str == '*') 488 490 str += 1; 489 490 /* stdcall */ 491 p = strchr (str, '@'); 491 return str; 492 } 493 494 /* Also strip the stdcall suffix. */ 495 496 const char * emx_strip_name_encoding_full (str) 497 const char *str; 498 { 499 const char *p; 500 const char *name = i386_emx_strip_name_encoding (str); 501 502 p = strchr (name, '@'); 492 503 if (p) 493 return ggc_alloc_string (str, p - str); 494 495 return str; 496 } 497 504 return ggc_alloc_string (name, p - name); 505 506 return name; 507 } 508 509 510 /* copy&hack from winnt.c */ 511 512 static tree associated_type PARAMS ((tree)); 513 /*static const char * gen_stdcall_suffix PARAMS ((tree));*/ 514 static int i386_emx_dllexport_p PARAMS ((tree)); 515 static int i386_emx_dllimport_p PARAMS ((tree)); 516 static void i386_emx_mark_dllexport PARAMS ((tree)); 517 static void i386_emx_mark_dllimport PARAMS ((tree)); 518 519 /* Handle a "dllimport" or "dllexport" attribute; 520 arguments as in struct attribute_spec.handler. */ 521 tree 522 ix86_handle_dll_attribute (pnode, name, args, flags, no_add_attrs) 523 tree * pnode; 524 tree name; 525 tree args; 526 int flags; 527 bool *no_add_attrs; 528 { 529 tree node = *pnode; 530 531 /* These attributes may apply to structure and union types being created, 532 but otherwise should pass to the declaration involved. */ 533 if (!DECL_P (node)) 534 { 535 if (flags & ((int) ATTR_FLAG_DECL_NEXT | (int) ATTR_FLAG_FUNCTION_NEXT 536 | (int) ATTR_FLAG_ARRAY_NEXT)) 537 { 538 *no_add_attrs = true; 539 return tree_cons (name, args, NULL_TREE); 540 } 541 if (TREE_CODE (node) != RECORD_TYPE && TREE_CODE (node) != UNION_TYPE) 542 { 543 warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); 544 *no_add_attrs = true; 545 } 546 547 return NULL_TREE; 548 } 549 550 /* Report error on dllimport ambiguities seen now before they cause 551 any damage. */ 552 else if (is_attribute_p ("dllimport", name)) 553 { 554 /* Like MS, treat definition of dllimported variables and 555 non-inlined functions on declaration as syntax errors. 556 We allow the attribute for function definitions if declared 557 inline, but just ignore it in i386_emx_dllimport_p. */ 558 if (TREE_CODE (node) == FUNCTION_DECL && DECL_INITIAL (node) 559 && !DECL_INLINE (node)) 560 { 561 error_with_decl (node, "function `%s' definition is marked dllimport."); 562 *no_add_attrs = true; 563 } 564 565 else if (TREE_CODE (node) == VAR_DECL) 566 { 567 if (DECL_INITIAL (node)) 568 { 569 error_with_decl (node,"variable `%s' definition is marked dllimport."); 570 *no_add_attrs = true; 571 } 572 573 /* `extern' needn't be specified with dllimport. 574 Specify `extern' now and hope for the best. Sigh. */ 575 DECL_EXTERNAL (node) = 1; 576 /* Also, implicitly give dllimport'd variables declared within 577 a function global scope, unless declared static. */ 578 if (current_function_decl != NULL_TREE && !TREE_STATIC (node)) 579 TREE_PUBLIC (node) = 1; 580 } 581 } 582 583 /* Report error if symbol is not accessible at global scope. */ 584 if (!TREE_PUBLIC (node) 585 && (TREE_CODE (node) == VAR_DECL 586 || TREE_CODE (node) == FUNCTION_DECL)) 587 { 588 error_with_decl (node, "external linkage required for symbol '%s' because of '%s' attribute.", 589 IDENTIFIER_POINTER (name)); 590 *no_add_attrs = true; 591 } 592 593 return NULL_TREE; 594 } 595 596 /* Handle a "shared" attribute; 597 arguments as in struct attribute_spec.handler. */ 598 tree 599 ix86_handle_shared_attribute (node, name, args, flags, no_add_attrs) 600 tree *node; 601 tree name; 602 tree args ATTRIBUTE_UNUSED; 603 int flags ATTRIBUTE_UNUSED; 604 bool *no_add_attrs; 605 { 606 if (TREE_CODE (*node) != VAR_DECL) 607 { 608 warning ("`%s' attribute only applies to variables", 609 IDENTIFIER_POINTER (name)); 610 *no_add_attrs = true; 611 } 612 613 return NULL_TREE; 614 } 615 616 617 /* Return the type that we should use to determine if DECL is 618 imported or exported. */ 619 620 static tree 621 associated_type (decl) 622 tree decl; 623 { 624 tree t = NULL_TREE; 625 626 /* In the C++ frontend, DECL_CONTEXT for a method doesn't actually refer 627 to the containing class. So we look at the 'this' arg. */ 628 if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE) 629 { 630 /* Artificial methods are not affected by the import/export status of 631 their class unless they are virtual. */ 632 if (! DECL_ARTIFICIAL (decl) || DECL_VINDEX (decl)) 633 t = TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl)))); 634 } 635 else if (DECL_CONTEXT (decl) 636 && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (decl))) == 't') 637 t = DECL_CONTEXT (decl); 638 639 return t; 640 } 641 642 /* Return nonzero if DECL is a dllexport'd object. */ 643 644 static int 645 i386_emx_dllexport_p (decl) 646 tree decl; 647 { 648 tree exp; 649 650 if (TREE_CODE (decl) != VAR_DECL 651 && TREE_CODE (decl) != FUNCTION_DECL) 652 return 0; 653 exp = lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)); 654 if (exp) 655 return 1; 656 657 /* Class members get the dllexport status of their class. */ 658 if (associated_type (decl)) 659 { 660 exp = lookup_attribute ("dllexport", 661 TYPE_ATTRIBUTES (associated_type (decl))); 662 if (exp) 663 return 1; 664 } 665 666 return 0; 667 } 668 669 /* Return nonzero if DECL is a dllimport'd object. */ 670 671 static int 672 i386_emx_dllimport_p (decl) 673 tree decl; 674 { 675 tree imp; 676 int context_imp = 0; 677 678 if (TREE_CODE (decl) == FUNCTION_DECL 679 && TARGET_NOP_FUN_DLLIMPORT) 680 return 0; 681 682 if (TREE_CODE (decl) != VAR_DECL 683 && TREE_CODE (decl) != FUNCTION_DECL) 684 return 0; 685 686 imp = lookup_attribute ("dllimport", DECL_ATTRIBUTES (decl)); 687 688 /* Class members get the dllimport status of their class. */ 689 if (!imp && associated_type (decl)) 690 { 691 imp = lookup_attribute ("dllimport", 692 TYPE_ATTRIBUTES (associated_type (decl))); 693 if (imp) 694 context_imp = 1; 695 } 696 697 if (imp) 698 { 699 /* Don't mark defined functions as dllimport. If the definition 700 itself was marked with dllimport, than ix86_handle_dll_attribute 701 reports an error. This handles the case when the definition 702 overrides an earlier declaration. */ 703 if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl) 704 && !DECL_INLINE (decl)) 705 { 706 /* Don't warn about artificial methods. */ 707 if (!DECL_ARTIFICIAL (decl)) 708 warning_with_decl (decl,"function '%s' is defined after prior declaration as dllimport: attribute ignored."); 709 return 0; 710 } 711 712 /* We ignore the dllimport attribute for inline member functions. 713 This differs from MSVC behaviour which treats it like GNUC 714 'extern inline' extension. */ 715 else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl)) 716 { 717 if (extra_warnings) 718 warning_with_decl (decl, "inline function '%s' is declared as dllimport: attribute ignored."); 719 return 0; 720 } 721 722 /* Don't allow definitions of static data members in dllimport class, 723 Just ignore attribute for vtable data. */ 724 else if (TREE_CODE (decl) == VAR_DECL 725 && TREE_STATIC (decl) && TREE_PUBLIC (decl) 726 && !DECL_EXTERNAL (decl) && context_imp) 727 { 728 if (!DECL_VIRTUAL_P (decl)) 729 error_with_decl (decl, "definition of static data member '%s' of dllimport'd class."); 730 return 0; 731 } 732 733 /* Since we can't treat a pointer to a dllimport'd symbol as a 734 constant address, we turn off the attribute on C++ virtual 735 methods to allow creation of vtables using thunks. */ 736 else if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE 737 && (DECL_VIRTUAL_P (decl))) 738 return 0; 739 740 return 1; 741 } 742 743 return 0; 744 } 745 746 /* Return nonzero if SYMBOL is marked as being dllexport'd. */ 747 748 int 749 i386_emx_dllexport_name_p (symbol) 750 const char *symbol; 751 { 752 return symbol[0] == DLL_IMPORT_EXPORT_PREFIX 753 && symbol[1] == 'e' && symbol[2] == '.'; 754 } 755 756 /* Return nonzero if SYMBOL is marked as being dllimport'd. */ 757 758 int 759 i386_emx_dllimport_name_p (symbol) 760 const char *symbol; 761 { 762 return symbol[0] == DLL_IMPORT_EXPORT_PREFIX 763 && symbol[1] == 'i' && symbol[2] == '.'; 764 } 765 766 /* Mark a DECL as being dllexport'd. 767 Note that we override the previous setting (eg: dllimport). */ 768 769 static void 770 i386_emx_mark_dllexport (decl) 771 tree decl; 772 { 773 const char *oldname; 774 char *newname; 775 rtx rtlname; 776 tree idp; 777 778 rtlname = XEXP (DECL_RTL (decl), 0); 779 if (GET_CODE (rtlname) == SYMBOL_REF) 780 oldname = XSTR (rtlname, 0); 781 else if (GET_CODE (rtlname) == MEM 782 && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) 783 oldname = XSTR (XEXP (rtlname, 0), 0); 784 else 785 abort (); 786 if (i386_emx_dllimport_name_p (oldname)) 787 { 788 warning_with_decl (decl,"inconsistent dll linkage for '%s': dllexport assumed."); 789 /* Remove DLL_IMPORT_PREFIX. */ 790 oldname += 9; 791 DECL_NON_ADDR_CONST_P (decl) = 0; 792 } 793 else if (i386_emx_dllexport_name_p (oldname)) 794 return; /* already done */ 795 796 newname = alloca (strlen (oldname) + 4); 797 sprintf (newname, "%ce.%s", DLL_IMPORT_EXPORT_PREFIX, oldname); 798 799 /* We pass newname through get_identifier to ensure it has a unique 800 address. RTL processing can sometimes peek inside the symbol ref 801 and compare the string's addresses to see if two symbols are 802 identical. */ 803 idp = get_identifier (newname); 804 805 XEXP (DECL_RTL (decl), 0) = 806 gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp)); 807 } 808 809 /* Mark a DECL as being dllimport'd. */ 810 811 static void 812 i386_emx_mark_dllimport (decl) 813 tree decl; 814 { 815 const char *oldname; 816 char *newname; 817 tree idp; 818 rtx rtlname, newrtl; 819 820 rtlname = XEXP (DECL_RTL (decl), 0); 821 if (GET_CODE (rtlname) == SYMBOL_REF) 822 oldname = XSTR (rtlname, 0); 823 else if (GET_CODE (rtlname) == MEM 824 && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) 825 oldname = XSTR (XEXP (rtlname, 0), 0); 826 else 827 abort (); 828 if (i386_emx_dllexport_name_p (oldname)) 829 { 830 error ("`%s' declared as both exported to and imported from a DLL", 831 IDENTIFIER_POINTER (DECL_NAME (decl))); 832 return; 833 } 834 else if (i386_emx_dllimport_name_p (oldname)) 835 { 836 /* Already done, but do a sanity check to prevent assembler errors. */ 837 if (!DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)) 838 { 839 error_with_decl (decl, "failure in redeclaration of '%s': dllimport'd symbol lacks external linkage."); 840 abort(); 841 } 842 return; 843 } 844 845 newname = alloca (strlen (oldname) + 11); 846 sprintf (newname, "%ci._imp__%s", DLL_IMPORT_EXPORT_PREFIX, oldname); 847 848 /* We pass newname through get_identifier to ensure it has a unique 849 address. RTL processing can sometimes peek inside the symbol ref 850 and compare the string's addresses to see if two symbols are 851 identical. */ 852 idp = get_identifier (newname); 853 854 newrtl = gen_rtx (MEM, Pmode, 855 gen_rtx (SYMBOL_REF, Pmode, 856 IDENTIFIER_POINTER (idp))); 857 XEXP (DECL_RTL (decl), 0) = newrtl; 858 859 /* Can't treat a pointer to this as a constant address */ 860 DECL_NON_ADDR_CONST_P (decl) = 1; 861 } 862 863 #if 0 864 /* Return string which is the former assembler name modified with a 865 suffix consisting of an atsign (@) followed by the number of bytes of 866 arguments */ 867 868 static const char * 869 gen_stdcall_suffix (decl) 870 tree decl; 871 { 872 int total = 0; 873 /* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead 874 of DECL_ASSEMBLER_NAME. */ 875 const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); 876 char *newsym; 877 878 if (TYPE_ARG_TYPES (TREE_TYPE (decl))) 879 if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl)))) 880 == void_type_node) 881 { 882 tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl)); 883 884 while (TREE_VALUE (formal_type) != void_type_node) 885 { 886 int parm_size 887 = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type))); 888 /* Must round up to include padding. This is done the same 889 way as in store_one_arg. */ 890 parm_size = ((parm_size + PARM_BOUNDARY - 1) 891 / PARM_BOUNDARY * PARM_BOUNDARY); 892 total += parm_size; 893 formal_type = TREE_CHAIN (formal_type); 894 } 895 } 896 897 newsym = xmalloc (strlen (asmname) + 10); 898 sprintf (newsym, "%s@%d", asmname, total/BITS_PER_UNIT); 899 return IDENTIFIER_POINTER (get_identifier (newsym)); 900 } 901 #endif 902 903 void 904 i386_emx_encode_section_info (decl, first) 905 tree decl; 906 int first ATTRIBUTE_UNUSED; 907 { 908 /* This bit is copied from i386.h. */ 909 if (optimize > 0 && TREE_CONSTANT (decl) 910 && (!flag_writable_strings || TREE_CODE (decl) != STRING_CST)) 911 { 912 rtx rtl = (TREE_CODE_CLASS (TREE_CODE (decl)) != 'd' 913 ? TREE_CST_RTL (decl) : DECL_RTL (decl)); 914 SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1; 915 } 916 917 #if 0 918 if (TREE_CODE (decl) == FUNCTION_DECL) 919 if (lookup_attribute ("stdcall", 920 TYPE_ATTRIBUTES (TREE_TYPE (decl)))) 921 XEXP (DECL_RTL (decl), 0) = 922 gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (decl)); 923 #endif 924 925 /* Mark the decl so we can tell from the rtl whether the object is 926 dllexport'd or dllimport'd. This also handles dllexport/dllimport 927 override semantics. */ 928 929 if (i386_emx_dllexport_p (decl)) 930 i386_emx_mark_dllexport (decl); 931 else if (i386_emx_dllimport_p (decl)) 932 i386_emx_mark_dllimport (decl); 933 /* It might be that DECL has already been marked as dllimport, but a 934 subsequent definition nullified that. The attribute is gone but 935 DECL_RTL still has (DLL_IMPORT_EXPORT_PREFIX)i._imp__foo. We need 936 to remove that. Ditto for the DECL_NON_ADDR_CONST_P flag. */ 937 else if ((TREE_CODE (decl) == FUNCTION_DECL 938 || TREE_CODE (decl) == VAR_DECL) 939 && DECL_RTL (decl) != NULL_RTX 940 && GET_CODE (DECL_RTL (decl)) == MEM 941 && GET_CODE (XEXP (DECL_RTL (decl), 0)) == MEM 942 && GET_CODE (XEXP (XEXP (DECL_RTL (decl), 0), 0)) == SYMBOL_REF 943 && i386_emx_dllimport_name_p (XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0))) 944 { 945 const char *oldname = XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0); 946 tree idp = get_identifier (oldname + 9); 947 rtx newrtl = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp)); 948 949 warning_with_decl (decl, "'%s' %s after being referenced with dllimport linkage.", 950 (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl)) 951 ? "defined locally" : "redeclared without dllimport attribute"); 952 953 XEXP (DECL_RTL (decl), 0) = newrtl; 954 955 DECL_NON_ADDR_CONST_P (decl) = 0; 956 957 /* We previously set TREE_PUBLIC and DECL_EXTERNAL. 958 We leave these alone for now. */ 959 } 960 } 961 962 /* [snip] */ 963 964 #if 0 /* don't think we need this. */ 965 /* Keep a list of external functions. */ 966 967 struct extern_list 968 { 969 struct extern_list *next; 970 const char *name; 971 }; 972 973 static struct extern_list *extern_head; 974 975 /* Assemble an external function reference. We need to keep a list of 976 these, so that we can output the function types at the end of the 977 assembly. We can't output the types now, because we might see a 978 definition of the function later on and emit debugging information 979 for it then. */ 980 981 void 982 i386_emx_record_external_function (name) 983 const char *name; 984 { 985 struct extern_list *p; 986 987 p = (struct extern_list *) xmalloc (sizeof *p); 988 p->next = extern_head; 989 p->name = name; 990 extern_head = p; 991 } 992 #endif 993 994 /* Keep a list of exported symbols. */ 995 996 struct export_list 997 { 998 struct export_list *next; 999 tree decl; 1000 const char *name; 1001 const char *asm_name; 1002 const char *exported_name; 1003 unsigned ordinal; 1004 int is_data; /* used to type tag exported symbols. */ 1005 }; 1006 1007 static struct export_list *export_head; 1008 1009 /* Assemble an export symbol entry. We need to keep a list of 1010 these, so that we can output the export list at the end of the 1011 assembly. We used to output these export symbols in each function, 1012 but that causes problems with GNU ld when the sections are 1013 linkonce. */ 1014 1015 void 1016 i386_emx_record_exported_symbol (decl, name, is_data) 1017 tree decl; 1018 const char *name; 1019 int is_data; 1020 { 1021 struct export_list *p; 1022 DUMP(decl); 1023 1024 p = (struct export_list *) xmalloc (sizeof *p); 1025 p->next = export_head; 1026 p->decl = decl; 1027 p->name = name; 1028 p->asm_name = NULL; 1029 p->exported_name = NULL; 1030 p->ordinal = 0; 1031 p->is_data = is_data; 1032 export_head = p; 1033 } 1034 1035 /* This is called at the end of assembly. For each external function 1036 which has not been defined, we output a declaration now. We also 1037 output the .drectve section. */ 1038 1039 void 1040 i386_emx_asm_file_end (file) 1041 FILE *file; 1042 { 1043 /* struct extern_list *p; */ 1044 1045 ix86_asm_file_end (file); 1046 1047 #if 0 /* don't think we need this */ 1048 for (p = extern_head; p != NULL; p = p->next) 1049 { 1050 tree decl; 1051 1052 decl = get_identifier (p->name); 1053 1054 /* Positively ensure only one declaration for any given symbol. */ 1055 if (! TREE_ASM_WRITTEN (decl) && TREE_SYMBOL_REFERENCED (decl)) 1056 { 1057 TREE_ASM_WRITTEN (decl) = 1; 1058 i386_emx_declare_function_type (file, p->name, TREE_PUBLIC (decl)); 1059 } 1060 } 1061 #endif 1062 if (export_head) 1063 { 1064 struct export_list *q; 1065 fprintf (file, "\t%s Exports: \"<exportname>,<ordinal>=<asmname>,<code|data>\", N_EXP,0,0,-42\n", ASM_COMMENT_START); 1066 for (q = export_head; q != NULL; q = q->next) 1067 { 1068 static const char * const types[2] = {",code", ",data"}; 1069 tree decl = q->decl; 1070 if (decl) 1071 { 1072 DUMP(decl); 1073 if (!TREE_STATIC (decl)) 1074 continue; 1075 if (!q->asm_name) 1076 q->asm_name = q->exported_name ? q->exported_name 1077 : IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); 1078 } 1079 if (!q->asm_name) 1080 q->asm_name = q->exported_name ? q->exported_name : q->name; 1081 if (!q->exported_name && !q->ordinal) 1082 q->exported_name = q->asm_name ? q->asm_name : q->name; 1083 fprintf (file, "\t.stabs\t\""); 1084 ASM_OUTPUT_LABELREF(file, q->exported_name); 1085 fprintf (file, ",%u=", q->ordinal); 1086 ASM_OUTPUT_LABELREF(file, q->asm_name); 1087 fprintf (file, "%s\",0x6c,0,0,-42\t%s %s\n", /* 0x6c == N_EXP */ 1088 types[q->is_data], ASM_COMMENT_START, q->name); 1089 } 1090 } 1091 } 1092 1093 -
Property cvs2svn:cvs-rev
changed from
-
TabularUnified trunk/src/gcc/gcc/config/i386/emx.h ¶
-
Property cvs2svn:cvs-rev
changed from
1.36
to1.37
r2002 r2003 107 107 __register_frame_tableb. */ 108 108 #define TARGET_ASM_EH_FRAME_SECTION emx_eh_frame_section 109 extern void emx_eh_frame_section (void);110 109 111 110 /* Put exception tables into .data section */ … … 123 122 #define WCHAR_TYPE_SIZE 16 124 123 125 /* This function handles both _System and _Optlink attributes */126 extern tree emx_handle_vacpp_attribute PARAMS ((tree *, tree, tree, int, _Bool *));127 128 124 /* We want the _System attribute */ 129 125 #define TARGET_SYSTEM_DECL_ATTRIBUTES … … 135 131 136 132 /* Do our own mangling on some kinds of decls */ 137 extern int emx_c_set_decl_assembler_name PARAMS ((tree, int));138 133 #define TARGET_C_SET_DECL_ASSEMBLER_NAME(decl) \ 139 134 emx_c_set_decl_assembler_name (decl, 0) … … 143 138 /* #631: Hack (temporary, will be fixed properly 3.4.x it seems) for _Optlink and 144 139 _System functions which returns structures. (breaks some tcpip stuff.) */ 145 extern int emx_return_in_memory_with_fntype PARAMS ((tree type, tree fntype));146 140 #define RETURN_IN_MEMORY_WITH_FNTYPE emx_return_in_memory_with_fntype 147 141 … … 191 185 if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0xcc\n", LOG) 192 186 193 /* Output a reference to a label. */ 187 /* Output a reference to a label. 188 We're doing all here since we must get the '*' vs. user_label_prefix 189 bit right. */ 194 190 #undef ASM_OUTPUT_LABELREF 195 #define ASM_OUTPUT_LABELREF(STREAM, NAME) \ 196 fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, NAME) 197 198 /* Write a function name in assembly (bad i386.c forces this here). */ 199 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ 200 ASM_OUTPUT_LABEL (FILE, NAME); 191 #define ASM_OUTPUT_LABELREF(FILE,NAME) \ 192 do { \ 193 const char *xname = (NAME); \ 194 if (*xname == DLL_IMPORT_EXPORT_PREFIX) \ 195 xname += 3; \ 196 if (*xname == '%') \ 197 xname += 2; \ 198 if (*xname == '*') \ 199 xname += 1; \ 200 else \ 201 fputs (user_label_prefix, FILE); \ 202 fputs (xname, FILE); \ 203 } while (0) 204 205 /* Get tree.c to declare a target-specific specialization of 206 merge_decl_attributes. */ 207 #define TARGET_DLLIMPORT_DECL_ATTRIBUTES 208 209 #undef TARGET_ENCODE_SECTION_INFO 210 #define TARGET_ENCODE_SECTION_INFO i386_emx_encode_section_info 211 212 /* Output a common block. */ 213 #undef ASM_OUTPUT_ALIGNED_DECL_COMMON 214 #define ASM_OUTPUT_ALIGNED_DECL_COMMON(STREAM, DECL, NAME, SIZE, ALIGN) \ 215 do { \ 216 if (i386_emx_dllexport_name_p (NAME)) \ 217 i386_emx_record_exported_symbol (DECL, NAME, 1); \ 218 if (! i386_emx_dllimport_name_p (NAME)) \ 219 { \ 220 /* 16 is the best we can do (segment para). */ \ 221 const int xalign = (ALIGN) > 16 ? 16 : (ALIGN); \ 222 fprintf ((STREAM), "\t.comm\t"); \ 223 assemble_name ((STREAM), (NAME)); \ 224 fprintf ((STREAM), ", %d\t%s %d\n", \ 225 (((SIZE) + xalign - 1) / xalign) * xalign, \ 226 ASM_COMMENT_START, (SIZE)); \ 227 } \ 228 } while (0) 229 230 /* Output the label for an initialized variable. */ 231 #undef ASM_DECLARE_OBJECT_NAME 232 #define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \ 233 do { \ 234 if (i386_emx_dllexport_name_p (NAME)) \ 235 i386_emx_record_exported_symbol (DECL, NAME, 1); \ 236 ASM_OUTPUT_LABEL ((STREAM), (NAME)); \ 237 } while (0) 238 239 /* Track exported functions... */ 240 #undef ASM_DECLARE_FUNCTION_NAME 241 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ 242 do \ 243 { \ 244 if (i386_emx_dllexport_name_p (NAME)) \ 245 i386_emx_record_exported_symbol (DECL, NAME, 0); \ 246 ASM_OUTPUT_LABEL (FILE, NAME); \ 247 } \ 248 while (0) 249 250 /* Output function declarations at the end of the file. */ 251 #undef ASM_FILE_END 252 #define ASM_FILE_END(FILE) \ 253 i386_emx_asm_file_end (FILE) 201 254 202 255 /* Use `#' instead of `/' as assembler comments */ … … 214 267 #undef TARGET_STRIP_NAME_ENCODING 215 268 #define TARGET_STRIP_NAME_ENCODING emx_strip_name_encoding_full 216 extern const char * emx_strip_name_encoding_full (const char *); 269 270 271 /* External function declarations. */ 272 273 extern int emx_c_set_decl_assembler_name PARAMS ((tree, int)); 274 extern int emx_return_in_memory_with_fntype PARAMS ((tree type, tree fntype)); 275 const char *i386_emx_strip_name_encoding PARAMS ((const char *str)); 276 extern const char * emx_strip_name_encoding_full PARAMS ((const char *)); 277 extern void emx_eh_frame_section (void); 278 extern void emx_output_function_begin_epilogue (FILE *); 279 280 /* This function handles both _System and _Optlink attributes. */ 281 extern tree emx_handle_vacpp_attribute PARAMS ((tree *, tree, tree, int, _Bool *)); 282 283 /* These functions are for handling dllexport and dllimport. */ 284 extern void i386_emx_record_exported_symbol PARAMS ((tree, const char *, int)); 285 extern void i386_emx_asm_file_end PARAMS ((FILE *)); 286 extern int i386_emx_dllexport_name_p PARAMS ((const char *)); 287 extern int i386_emx_dllimport_name_p PARAMS ((const char *)); 288 extern void i386_emx_encode_section_info PARAMS ((tree, int)); 289 217 290 218 291 … … 224 297 Also define the -m(no-)epilogue switch. */ 225 298 #define MASK_EPILOGUE 0x40000000 /* Use FUNCTION_EPILOGUE */ 299 300 /* Masks for subtarget switches used by other files. */ 301 #define MASK_NOP_FUN_DLLIMPORT 0x08000000 /* Ignore dllimport for functions */ 226 302 227 303 #undef SUBTARGET_SWITCHES … … 230 306 { "no-probe", -MASK_STACK_PROBE, N_("Don't do stack probing") }, \ 231 307 { "epilogue", MASK_EPILOGUE, N_("Generate prologue/epilogue labels") }, \ 232 { "no-epilogue", -MASK_EPILOGUE, N_("Don't generate prologue/epilogue labels") }, 308 { "no-epilogue", -MASK_EPILOGUE, N_("Don't generate prologue/epilogue labels") }, \ 309 { "nop-fun-dllimport", MASK_NOP_FUN_DLLIMPORT, N_("Ignore dllimport for functions") }, \ 310 { "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" }, 233 311 234 312 /* Use FUNCTION_EPILOGUE */ 235 313 #define TARGET_EPILOGUE (target_flags & MASK_EPILOGUE) 236 314 315 /* Used in winnt.c. */ 316 #define TARGET_NOP_FUN_DLLIMPORT (target_flags & MASK_NOP_FUN_DLLIMPORT) 237 317 238 318 /* By default, target has a 80387, uses IEEE compatible arithmetic, … … 247 327 || !strcmp (STR, "Zstack")) 248 328 329 /* Don't allow flag_pic to propagate since gas may produce invalid code 330 otherwise. */ 331 #undef SUBTARGET_OVERRIDE_OPTIONS 332 #define SUBTARGET_OVERRIDE_OPTIONS \ 333 do { \ 334 if (flag_pic) \ 335 { \ 336 warning ("-f%s ignored for target (all code is position independent)",\ 337 (flag_pic > 1) ? "PIC" : "pic"); \ 338 flag_pic = 0; \ 339 } \ 340 } while (0) 341 249 342 /* Add a __POST$xxx label before epilogue if -mepilogue specified */ 250 extern void emx_output_function_begin_epilogue (FILE *);251 343 #undef TARGET_ASM_FUNCTION_BEGIN_EPILOGUE 252 344 #define TARGET_ASM_FUNCTION_BEGIN_EPILOGUE emx_output_function_begin_epilogue … … 287 379 builtin_define ("_Optlink=__attribute__((__optlink__))"); \ 288 380 builtin_define ("_System=__attribute__((__system__))"); \ 381 builtin_define ("_Export=__attribute__((dllexport))"); \ 382 builtin_define ("__declspec(x)=__attribute__((x))"); \ 289 383 if (!flag_iso) \ 290 384 { \ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.