diff options
-rw-r--r-- | gcc/ChangeLog | 29 | ||||
-rw-r--r-- | gcc/Makefile.in | 7 | ||||
-rw-r--r-- | gcc/ada/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ada/raise-gcc.c | 2 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 2 | ||||
-rw-r--r-- | gcc/config/i386/t-i386 | 2 | ||||
-rw-r--r-- | gcc/config/mmix/mmix.c | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/darwin-fallback.c | 2 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 2 | ||||
-rw-r--r-- | gcc/config/xtensa/unwind-dw2-xtensa.c | 2 | ||||
-rw-r--r-- | gcc/dwarf2asm.c | 2 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 51 | ||||
-rw-r--r-- | gcc/except.c | 2 | ||||
-rw-r--r-- | gcc/unwind-dw2-fde-darwin.c | 2 | ||||
-rw-r--r-- | gcc/unwind-dw2-fde-glibc.c | 2 | ||||
-rw-r--r-- | gcc/unwind-dw2-fde.c | 2 | ||||
-rw-r--r-- | gcc/unwind-dw2.c | 2 | ||||
-rw-r--r-- | include/ChangeLog | 4 | ||||
-rw-r--r-- | include/elf/dwarf2.h (renamed from gcc/dwarf2.h) | 23 |
19 files changed, 96 insertions, 48 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 52812c89ce7..61ffa34ee73 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,32 @@ +2009-06-29 Tom Tromey <tromey@redhat.com> + + * dwarf2.h: Remove. + * Makefile.in (DWARF2_H): New variable. + (except.o): Use it. + (dwarf2out.o): Likewise. + (dwarf2asm.o): Likewise. + * config/i386/t-i386: Use DWARF2_H. + * except.c: Include elf/dwarf2.h. + * unwind-dw2.c: Include elf/dwarf2.h. + * dwarf2out.c: Include elf/dwarf2.h. + (dw_loc_descr_struct) <dw_loc_opc>: Now a bitfield. + <dtprel>: New field. + (dwarf_stack_op_name): Don't handle INTERNAL_DW_OP_tls_addr. + (size_of_loc_descr): Likewise. + (output_loc_operands_raw): Likewise. + (output_loc_operands): Handle new dtprel field. + (loc_checksum): Update. + (loc_descriptor_from_tree_1) <VAR_DDECL>: Set dtprel field. + * unwind-dw2-fde-glibc.c: Include elf/dwarf2.h. + * unwind-dw2-fde.c: Include elf/dwarf2.h. + * dwarf2asm.c: Include elf/dwarf2.h. + * unwind-dw2-fde-darwin.c: Include elf/dwarf2.h. + * config/mmix/mmix.c: Include elf/dwarf2.h. + * config/rs6000/darwin-fallback.c: Include elf/dwarf2.h. + * config/xtensa/unwind-dw2-xtensa.c: Include elf/dwarf2.h. + * config/sh/sh.c: Include elf/dwarf2.h. + * config/i386/i386.c: Include elf/dwarf2.h. + 2009-06-29 DJ Delorie <dj@redhat.com> * config/mep/mep.h (CPP_SPEC): Remove __cop macro. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index d8bbc681146..8bd09a8565c 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -405,6 +405,7 @@ SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h FIBHEAP_H = $(srcdir)/../include/fibheap.h PARTITION_H = $(srcdir)/../include/partition.h MD5_H = $(srcdir)/../include/md5.h +DWARF2_H = $(srcdir)/../include/elf/dwarf2.h # Default native SYSTEM_HEADER_DIR, to be overridden by targets. NATIVE_SYSTEM_HEADER_DIR = /usr/include @@ -2592,7 +2593,7 @@ except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(FLAGS_H) $(EXCEPT_H) $(FUNCTION_H) $(EXPR_H) libfuncs.h \ langhooks.h insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \ dwarf2asm.h dwarf2out.h $(TOPLEV_H) $(HASHTAB_H) intl.h $(GGC_H) \ - gt-except.h $(CGRAPH_H) $(INTEGRATE_H) $(DIAGNOSTIC_H) dwarf2.h \ + gt-except.h $(CGRAPH_H) $(INTEGRATE_H) $(DIAGNOSTIC_H) $(DWARF2_H) \ $(TARGET_H) $(TM_P_H) $(TREE_PASS_H) $(TIMEVAR_H) $(TREE_FLOW_H) expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) $(EXPR_H) $(OPTABS_H) \ @@ -2635,14 +2636,14 @@ sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.h \ output.h $(TOPLEV_H) $(TM_P_H) gsyms.h langhooks.h $(TARGET_H) sdbout.h \ gt-sdbout.h reload.h $(VARRAY_H) dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) version.h $(RTL_H) dwarf2.h debug.h $(FLAGS_H) insn-config.h \ + $(TREE_H) version.h $(RTL_H) $(DWARF2_H) debug.h $(FLAGS_H) insn-config.h \ output.h $(DIAGNOSTIC_H) $(REAL_H) hard-reg-set.h $(REGS_H) $(EXPR_H) \ libfuncs.h $(TOPLEV_H) dwarf2out.h reload.h $(GGC_H) $(EXCEPT_H) dwarf2asm.h \ $(TM_P_H) langhooks.h $(HASHTAB_H) gt-dwarf2out.h $(TARGET_H) $(CGRAPH_H) \ $(MD5_H) $(INPUT_H) $(FUNCTION_H) $(VARRAY_H) dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(FLAGS_H) $(RTL_H) $(TREE_H) output.h dwarf2asm.h $(TM_P_H) $(GGC_H) \ - gt-dwarf2asm.h dwarf2.h $(SPLAY_TREE_H) $(TARGET_H) + gt-dwarf2asm.h $(DWARF2_H) $(SPLAY_TREE_H) $(TARGET_H) vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) version.h \ $(FLAGS_H) $(RTL_H) output.h vmsdbg.h debug.h langhooks.h $(FUNCTION_H) $(TARGET_H) xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b4c1dc080c6..1374c4cfaf8 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2009-06-29 Tom Tromey <tromey@redhat.com> + + * raise-gcc.c: Include elf/dwarf2.h. + 2009-06-27 Laurent GUERBY <laurent@guerby.net> * tb-gcc.c (trace_callback): Add casts to silence warning. diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c index 1d9efb93b7f..b30145af531 100644 --- a/gcc/ada/raise-gcc.c +++ b/gcc/ada/raise-gcc.c @@ -96,7 +96,7 @@ __gnat_Unwind_ForcedUnwind (_Unwind_Exception *, void *, void *); #ifdef IN_RTS /* For eh personality routine */ -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "unwind-dw2-fde.h" #include "unwind-pe.h" diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index c8c4bbf4670..8bb82f3fb6c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see #include "langhooks.h" #include "cgraph.h" #include "gimple.h" -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "df.h" #include "tm-constrs.h" #include "params.h" diff --git a/gcc/config/i386/t-i386 b/gcc/config/i386/t-i386 index 01e5ce413e4..087c4743d2f 100644 --- a/gcc/config/i386/t-i386 +++ b/gcc/config/i386/t-i386 @@ -22,7 +22,7 @@ i386.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(INSN_ATTR_H) $(FLAGS_H) $(C_COMMON_H) except.h $(FUNCTION_H) \ $(RECOG_H) $(EXPR_H) $(OPTABS_H) toplev.h $(BASIC_BLOCK_H) \ $(GGC_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h $(CGRAPH_H) \ - $(TREE_GIMPLE_H) dwarf2.h $(DF_H) tm-constrs.h $(PARAMS_H) + $(TREE_GIMPLE_H) $(DWARF2_H) $(DF_H) tm-constrs.h $(PARAMS_H) i386-c.o: $(srcdir)/config/i386/i386-c.c \ $(srcdir)/config/i386/i386-protos.h $(CONFIG_H) $(SYSTEM_H) coretypes.h \ diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index 67b1b2323b5..f81512401f6 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -36,7 +36,7 @@ along with GCC; see the file COPYING3. If not see #include "toplev.h" #include "recog.h" #include "ggc.h" -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "debug.h" #include "tm_p.h" #include "integrate.h" diff --git a/gcc/config/rs6000/darwin-fallback.c b/gcc/config/rs6000/darwin-fallback.c index 4591071ea74..e4d5afe50ac 100644 --- a/gcc/config/rs6000/darwin-fallback.c +++ b/gcc/config/rs6000/darwin-fallback.c @@ -28,7 +28,7 @@ #include "tsystem.h" #include "coretypes.h" #include "tm.h" -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "unwind.h" #include "unwind-dw2.h" #include <stdint.h> diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 7c72f0098f1..08cae31b995 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -38,7 +38,7 @@ along with GCC; see the file COPYING3. If not see #include "toplev.h" #include "recog.h" #include "integrate.h" -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "tm_p.h" #include "target.h" #include "target-def.h" diff --git a/gcc/config/xtensa/unwind-dw2-xtensa.c b/gcc/config/xtensa/unwind-dw2-xtensa.c index e7ca86a10fb..235b8a12563 100644 --- a/gcc/config/xtensa/unwind-dw2-xtensa.c +++ b/gcc/config/xtensa/unwind-dw2-xtensa.c @@ -28,7 +28,7 @@ #include "tsystem.h" #include "coretypes.h" #include "tm.h" -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "unwind.h" #ifdef __USING_SJLJ_EXCEPTIONS__ # define NO_SIZE_OF_ENCODED_VALUE diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c index 6f21ff67d52..4e2c9980feb 100644 --- a/gcc/dwarf2asm.c +++ b/gcc/dwarf2asm.c @@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "output.h" #include "target.h" #include "dwarf2asm.h" -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "splay-tree.h" #include "ggc.h" #include "tm_p.h" diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index c57b753e358..f954d6e2ea2 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -74,7 +74,7 @@ along with GCC; see the file COPYING3. If not see #include "expr.h" #include "libfuncs.h" #include "except.h" -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "dwarf2out.h" #include "dwarf2asm.h" #include "toplev.h" @@ -3886,7 +3886,10 @@ dw_val_node; typedef struct GTY(()) dw_loc_descr_struct { dw_loc_descr_ref dw_loc_next; - enum dwarf_location_atom dw_loc_opc; + ENUM_BITFIELD (dwarf_location_atom) dw_loc_opc : 8; + /* Used to distinguish DW_OP_addr with a direct symbol relocation + from DW_OP_addr with a dtp-relative symbol relocation. */ + unsigned int dtprel : 1; int dw_loc_addr; dw_val_node dw_loc_oprnd1; dw_val_node dw_loc_oprnd2; @@ -3918,7 +3921,6 @@ dwarf_stack_op_name (unsigned int op) switch (op) { case DW_OP_addr: - case INTERNAL_DW_OP_tls_addr: return "DW_OP_addr"; case DW_OP_deref: return "DW_OP_deref"; @@ -4333,7 +4335,6 @@ size_of_loc_descr (dw_loc_descr_ref loc) switch (loc->dw_loc_opc) { case DW_OP_addr: - case INTERNAL_DW_OP_tls_addr: size += DWARF2_ADDR_SIZE; break; case DW_OP_const1u: @@ -4474,9 +4475,6 @@ output_loc_operands (dw_loc_descr_ref loc) switch (loc->dw_loc_opc) { #ifdef DWARF2_DEBUGGING_INFO - case DW_OP_addr: - dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE, val1->v.val_addr, NULL); - break; case DW_OP_const2u: case DW_OP_const2s: dw2_asm_output_data (2, val1->v.val_int, NULL); @@ -4502,7 +4500,6 @@ output_loc_operands (dw_loc_descr_ref loc) } break; #else - case DW_OP_addr: case DW_OP_const2u: case DW_OP_const2s: case DW_OP_const4u: @@ -4585,16 +4582,27 @@ output_loc_operands (dw_loc_descr_ref loc) dw2_asm_output_data (1, val1->v.val_int, NULL); break; - case INTERNAL_DW_OP_tls_addr: - if (targetm.asm_out.output_dwarf_dtprel) + case DW_OP_addr: + if (loc->dtprel) { - targetm.asm_out.output_dwarf_dtprel (asm_out_file, - DWARF2_ADDR_SIZE, - val1->v.val_addr); - fputc ('\n', asm_out_file); + if (targetm.asm_out.output_dwarf_dtprel) + { + targetm.asm_out.output_dwarf_dtprel (asm_out_file, + DWARF2_ADDR_SIZE, + val1->v.val_addr); + fputc ('\n', asm_out_file); + } + else + gcc_unreachable (); } else - gcc_unreachable (); + { +#ifdef DWARF2_DEBUGGING_INFO + dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE, val1->v.val_addr, NULL); +#else + gcc_unreachable (); +#endif + } break; default: @@ -4728,9 +4736,6 @@ output_loc_operands_raw (dw_loc_descr_ref loc) dw2_asm_output_data_sleb128_raw (val2->v.val_int); break; - case INTERNAL_DW_OP_tls_addr: - gcc_unreachable (); - default: /* Other codes have no operands. */ break; @@ -7280,7 +7285,10 @@ pop_compile_unit (dw_die_ref old_unit) static inline void loc_checksum (dw_loc_descr_ref loc, struct md5_ctx *ctx) { - CHECKSUM (loc->dw_loc_opc); + int tem; + + tem = (loc->dtprel << 8) | ((unsigned int) loc->dw_loc_opc); + CHECKSUM (tem); CHECKSUM (loc->dw_loc_oprnd1); CHECKSUM (loc->dw_loc_oprnd2); } @@ -10772,6 +10780,7 @@ loc_descriptor_from_tree_1 (tree loc, int want_address) rtx rtl; enum dwarf_location_atom first_op; enum dwarf_location_atom second_op; + bool dtprel = false; if (targetm.have_tls) { @@ -10785,7 +10794,8 @@ loc_descriptor_from_tree_1 (tree loc, int want_address) module. */ if (DECL_EXTERNAL (loc) && !targetm.binds_local_p (loc)) return 0; - first_op = (enum dwarf_location_atom) INTERNAL_DW_OP_tls_addr; + first_op = DW_OP_addr; + dtprel = true; second_op = DW_OP_GNU_push_tls_address; } else @@ -10810,6 +10820,7 @@ loc_descriptor_from_tree_1 (tree loc, int want_address) ret = new_loc_descr (first_op, 0, 0); ret->dw_loc_oprnd1.val_class = dw_val_class_addr; ret->dw_loc_oprnd1.v.val_addr = rtl; + ret->dtprel = dtprel; ret1 = new_loc_descr (second_op, 0, 0); add_loc_descr (&ret, ret1); diff --git a/gcc/except.c b/gcc/except.c index 95163cc356b..4a02fe305b4 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -65,7 +65,7 @@ along with GCC; see the file COPYING3. If not see #include "output.h" #include "dwarf2asm.h" #include "dwarf2out.h" -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "toplev.h" #include "hashtab.h" #include "intl.h" diff --git a/gcc/unwind-dw2-fde-darwin.c b/gcc/unwind-dw2-fde-darwin.c index cd00ea22f4c..c033bbe0cb5 100644 --- a/gcc/unwind-dw2-fde-darwin.c +++ b/gcc/unwind-dw2-fde-darwin.c @@ -27,7 +27,7 @@ #include "tsystem.h" #include <string.h> #include <stdlib.h> -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "unwind.h" #define NO_BASE_OF_ENCODED_VALUE #define DWARF2_OBJECT_END_PTR_EXTENSION diff --git a/gcc/unwind-dw2-fde-glibc.c b/gcc/unwind-dw2-fde-glibc.c index d246ae12497..0e3d0a34bff 100644 --- a/gcc/unwind-dw2-fde-glibc.c +++ b/gcc/unwind-dw2-fde-glibc.c @@ -37,7 +37,7 @@ #endif #include "coretypes.h" #include "tm.h" -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "unwind.h" #define NO_BASE_OF_ENCODED_VALUE #include "unwind-pe.h" diff --git a/gcc/unwind-dw2-fde.c b/gcc/unwind-dw2-fde.c index 4aa9d82af8d..6780700e6af 100644 --- a/gcc/unwind-dw2-fde.c +++ b/gcc/unwind-dw2-fde.c @@ -29,7 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "tsystem.h" #include "coretypes.h" #include "tm.h" -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "unwind.h" #define NO_BASE_OF_ENCODED_VALUE #include "unwind-pe.h" diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c index 68a1a282b34..0ceda12a44b 100644 --- a/gcc/unwind-dw2.c +++ b/gcc/unwind-dw2.c @@ -27,7 +27,7 @@ #include "tsystem.h" #include "coretypes.h" #include "tm.h" -#include "dwarf2.h" +#include "elf/dwarf2.h" #include "unwind.h" #ifdef __USING_SJLJ_EXCEPTIONS__ # define NO_SIZE_OF_ENCODED_VALUE diff --git a/include/ChangeLog b/include/ChangeLog index b680b436b00..148e404957a 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2009-06-29 Tom Tromey <tromey@redhat.com> + + * elf/dwarf2.h: New file. Merged with gdb. + 2009-06-09 Ian Lance Taylor <ian@airs.com> * ansidecl.h (ATTRIBUTE_UNUSED_LABEL): Define for C++. diff --git a/gcc/dwarf2.h b/include/elf/dwarf2.h index d106b670ea5..f0dbfd28f72 100644 --- a/gcc/dwarf2.h +++ b/include/elf/dwarf2.h @@ -37,13 +37,14 @@ by UNIX International. Copies of this specification are available from UNIX International, 20 Waterview Boulevard, Parsippany, NJ, 07054. - This file also now contains definitions from the DWARF 3 specification. */ + This file also now contains definitions from the DWARF 3 specification + published Dec 20, 2005, available from: http://dwarf.freestandards.org. */ /* This file is shared between GCC and GDB, and should not contain prototypes. */ -#ifndef GCC_DWARF2_H -#define GCC_DWARF2_H +#ifndef _ELF_DWARF2_H +#define _ELF_DWARF2_H /* Structure found in the .debug_line section. */ typedef struct @@ -281,7 +282,7 @@ enum dwarf_attribute DW_AT_return_addr = 0x2a, DW_AT_start_scope = 0x2c, DW_AT_bit_stride = 0x2e, - DW_AT_stride_size = DW_AT_bit_stride, +#define DW_AT_stride_size DW_AT_bit_stride /* Note: The use of DW_AT_stride_size is deprecated. */ DW_AT_upper_bound = 0x2f, DW_AT_abstract_origin = 0x31, DW_AT_accessibility = 0x32, @@ -317,7 +318,7 @@ enum dwarf_attribute DW_AT_associated = 0x4f, DW_AT_data_location = 0x50, DW_AT_byte_stride = 0x51, - DW_AT_stride = DW_AT_byte_stride, +#define DW_AT_stride DW_AT_byte_stride /* Note: The use of DW_AT_stride is deprecated. */ DW_AT_entry_pc = 0x52, DW_AT_use_UTF8 = 0x53, DW_AT_extension = 0x54, @@ -563,12 +564,8 @@ enum dwarf_location_atom DW_OP_HP_mod_range = 0xe4, DW_OP_HP_unmod_range = 0xe5, DW_OP_HP_tls = 0xe6, - - /* Used internally in dwarf2out.c to distinguish DW_OP_addr with a - direct symbol relocation from DW_OP_addr with a dtp-relative - symbol relocation. */ - INTERNAL_DW_OP_tls_addr = 0x103 - + /* PGI (STMicroelectronics) extensions. */ + DW_OP_PGI_omp_thread_num = 0xf8 }; /* Type encodings. */ @@ -722,6 +719,7 @@ enum dwarf_line_number_x_ops DW_LNE_end_sequence = 1, DW_LNE_set_address = 2, DW_LNE_define_file = 3, + DW_LNE_set_discriminator = 4, /* HP extensions. */ DW_LNE_HP_negate_is_UV_update = 0x11, DW_LNE_HP_push_context = 0x12, @@ -782,6 +780,7 @@ enum dwarf_call_frame_info #define DW_CIE_ID 0xffffffff #define DW64_CIE_ID 0xffffffffffffffffULL +#define DW_CIE_VERSION 1 #define DW_CFA_extended 0 @@ -856,4 +855,4 @@ enum dwarf_macinfo_record_type #define DW_EH_PE_indirect 0x80 -#endif /* dwarf2.h */ +#endif /* _ELF_DWARF2_H */ |