comparison gcc/dwarf2asm.c @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 84e7813d76e9
children 1830386684a0
comparison
equal deleted inserted replaced
130:e108057fa461 132:d34655255c78
1 /* Dwarf2 assembler output helper routines. 1 /* Dwarf2 assembler output helper routines.
2 Copyright (C) 2001-2017 Free Software Foundation, Inc. 2 Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify it under 6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free 7 the terms of the GNU General Public License as published by the Free
31 #include "output.h" 31 #include "output.h"
32 #include "dwarf2asm.h" 32 #include "dwarf2asm.h"
33 #include "dwarf2.h" 33 #include "dwarf2.h"
34 #include "function.h" 34 #include "function.h"
35 #include "emit-rtl.h" 35 #include "emit-rtl.h"
36 #include "fold-const.h"
36 37
37 #ifndef XCOFF_DEBUGGING_INFO 38 #ifndef XCOFF_DEBUGGING_INFO
38 #define XCOFF_DEBUGGING_INFO 0 39 #define XCOFF_DEBUGGING_INFO 0
39 #endif 40 #endif
40 41
765 fputc ('\n', asm_out_file); 766 fputc ('\n', asm_out_file);
766 767
767 va_end (ap); 768 va_end (ap);
768 } 769 }
769 770
771 /* Output symbol LAB1 as an unsigned LEB128 quantity. LAB1 should be
772 an assembler-computed constant, e.g. a view number, because we
773 can't have relocations in LEB128 quantities. */
774
775 void
776 dw2_asm_output_symname_uleb128 (const char *lab1 ATTRIBUTE_UNUSED,
777 const char *comment, ...)
778 {
779 va_list ap;
780
781 va_start (ap, comment);
782
783 #ifdef HAVE_AS_LEB128
784 fputs ("\t.uleb128 ", asm_out_file);
785 assemble_name (asm_out_file, lab1);
786 #else
787 gcc_unreachable ();
788 #endif
789
790 if (flag_debug_asm && comment)
791 {
792 fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
793 vfprintf (asm_out_file, comment, ap);
794 }
795 fputc ('\n', asm_out_file);
796
797 va_end (ap);
798 }
799
770 void 800 void
771 dw2_asm_output_delta_uleb128 (const char *lab1 ATTRIBUTE_UNUSED, 801 dw2_asm_output_delta_uleb128 (const char *lab1 ATTRIBUTE_UNUSED,
772 const char *lab2 ATTRIBUTE_UNUSED, 802 const char *lab2 ATTRIBUTE_UNUSED,
773 const char *comment, ...) 803 const char *comment, ...)
774 { 804 {
779 gcc_assert (HAVE_AS_LEB128); 809 gcc_assert (HAVE_AS_LEB128);
780 810
781 fputs ("\t.uleb128 ", asm_out_file); 811 fputs ("\t.uleb128 ", asm_out_file);
782 assemble_name (asm_out_file, lab1); 812 assemble_name (asm_out_file, lab1);
783 putc ('-', asm_out_file); 813 putc ('-', asm_out_file);
784 assemble_name (asm_out_file, lab2); 814 /* dwarf2out.c might give us a label expression (e.g. .LVL548-1)
815 as second argument. If so, make it a subexpression, to make
816 sure the substraction is done in the right order. */
817 if (strchr (lab2, '-') != NULL)
818 {
819 putc ('(', asm_out_file);
820 assemble_name (asm_out_file, lab2);
821 putc (')', asm_out_file);
822 }
823 else
824 assemble_name (asm_out_file, lab2);
785 825
786 if (flag_debug_asm && comment) 826 if (flag_debug_asm && comment)
787 { 827 {
788 fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START); 828 fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
789 vfprintf (asm_out_file, comment, ap); 829 vfprintf (asm_out_file, comment, ap);
923 963
924 decl = build_decl (UNKNOWN_LOCATION, VAR_DECL, id, ptr_type_node); 964 decl = build_decl (UNKNOWN_LOCATION, VAR_DECL, id, ptr_type_node);
925 SET_DECL_ASSEMBLER_NAME (decl, id); 965 SET_DECL_ASSEMBLER_NAME (decl, id);
926 DECL_ARTIFICIAL (decl) = 1; 966 DECL_ARTIFICIAL (decl) = 1;
927 DECL_IGNORED_P (decl) = 1; 967 DECL_IGNORED_P (decl) = 1;
928 DECL_INITIAL (decl) = decl; 968 DECL_INITIAL (decl) = build_fold_addr_expr (decl);
929 TREE_READONLY (decl) = 1; 969 TREE_READONLY (decl) = 1;
930 TREE_STATIC (decl) = 1; 970 TREE_STATIC (decl) = 1;
931 971
932 if (TREE_PUBLIC (id)) 972 if (TREE_PUBLIC (id))
933 { 973 {
936 if (USE_LINKONCE_INDIRECT) 976 if (USE_LINKONCE_INDIRECT)
937 DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; 977 DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
938 } 978 }
939 979
940 sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym); 980 sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym);
981 /* Disable ASan for decl because redzones cause ABI breakage between GCC and
982 libstdc++ for `.LDFCM*' variables. See PR 78651 for details. */
983 unsigned int save_flag_sanitize = flag_sanitize;
984 flag_sanitize &= ~(SANITIZE_ADDRESS | SANITIZE_USER_ADDRESS
985 | SANITIZE_KERNEL_ADDRESS);
986 /* And also temporarily disable -fsection-anchors. These indirect constants
987 are never referenced from code, so it doesn't make any sense to aggregate
988 them in blocks. */
989 int save_flag_section_anchors = flag_section_anchors;
990 flag_section_anchors = 0;
941 assemble_variable (decl, 1, 1, 1); 991 assemble_variable (decl, 1, 1, 1);
992 flag_section_anchors = save_flag_section_anchors;
993 flag_sanitize = save_flag_sanitize;
942 assemble_integer (sym_ref, POINTER_SIZE_UNITS, POINTER_SIZE, 1); 994 assemble_integer (sym_ref, POINTER_SIZE_UNITS, POINTER_SIZE, 1);
995 /* The following is a hack recognized by use_blocks_for_decl_p to disable
996 section anchor handling of the decl. */
997 DECL_INITIAL (decl) = decl;
943 998
944 return 0; 999 return 0;
945 } 1000 }
946 1001
947 /* Emit the constants queued through dw2_force_const_mem. */ 1002 /* Emit the constants queued through dw2_force_const_mem. */