+2014-09-05 Joseph Myers <joseph@codesourcery.com>
+
+ * c-cppbuiltin.c (c_cpp_builtins): Also define
+ __LIBGCC_EH_TABLES_CAN_BE_READ_ONLY__,
+ __LIBGCC_EH_FRAME_SECTION_NAME__, __LIBGCC_JCR_SECTION_NAME__,
+ __LIBGCC_CTORS_SECTION_ASM_OP__, __LIBGCC_DTORS_SECTION_ASM_OP__,
+ __LIBGCC_TEXT_SECTION_ASM_OP__, __LIBGCC_INIT_SECTION_ASM_OP__,
+ __LIBGCC_INIT_ARRAY_SECTION_ASM_OP__,
+ __LIBGCC_STACK_GROWS_DOWNWARD__,
+ __LIBGCC_DONT_USE_BUILTIN_SETJMP__,
+ __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__,
+ __LIBGCC_DWARF_FRAME_REGISTERS__,
+ __LIBGCC_EH_RETURN_STACKADJ_RTX__, __LIBGCC_JMP_BUF_SIZE__,
+ __LIBGCC_STACK_POINTER_REGNUM__ and
+ __LIBGCC_VTABLE_USES_DESCRIPTORS__ for -fbuilding-libgcc.
+ (builtin_define_with_value): Handle backslash-escaping in string
+ macro values.
+
2014-09-05 Richard Biener <rguenther@suse.de>
PR middle-end/63148
/* For libgcc-internal use only. */
if (flag_building_libgcc)
- /* For libgcc enable-execute-stack.c. */
- builtin_define_with_int_value ("__LIBGCC_TRAMPOLINE_SIZE__",
- TRAMPOLINE_SIZE);
+ {
+ /* For libgcc crtstuff.c and libgcc2.c. */
+ builtin_define_with_int_value ("__LIBGCC_EH_TABLES_CAN_BE_READ_ONLY__",
+ EH_TABLES_CAN_BE_READ_ONLY);
+#ifdef EH_FRAME_SECTION_NAME
+ builtin_define_with_value ("__LIBGCC_EH_FRAME_SECTION_NAME__",
+ EH_FRAME_SECTION_NAME, 1);
+#endif
+#ifdef JCR_SECTION_NAME
+ builtin_define_with_value ("__LIBGCC_JCR_SECTION_NAME__",
+ JCR_SECTION_NAME, 1);
+#endif
+#ifdef CTORS_SECTION_ASM_OP
+ builtin_define_with_value ("__LIBGCC_CTORS_SECTION_ASM_OP__",
+ CTORS_SECTION_ASM_OP, 1);
+#endif
+#ifdef DTORS_SECTION_ASM_OP
+ builtin_define_with_value ("__LIBGCC_DTORS_SECTION_ASM_OP__",
+ DTORS_SECTION_ASM_OP, 1);
+#endif
+#ifdef TEXT_SECTION_ASM_OP
+ builtin_define_with_value ("__LIBGCC_TEXT_SECTION_ASM_OP__",
+ TEXT_SECTION_ASM_OP, 1);
+#endif
+#ifdef INIT_SECTION_ASM_OP
+ builtin_define_with_value ("__LIBGCC_INIT_SECTION_ASM_OP__",
+ INIT_SECTION_ASM_OP, 1);
+#endif
+#ifdef INIT_ARRAY_SECTION_ASM_OP
+ /* Despite the name of this target macro, the expansion is not
+ actually used, and may be empty rather than a string
+ constant. */
+ cpp_define (pfile, "__LIBGCC_INIT_ARRAY_SECTION_ASM_OP__");
+#endif
+
+ /* For libgcc enable-execute-stack.c. */
+ builtin_define_with_int_value ("__LIBGCC_TRAMPOLINE_SIZE__",
+ TRAMPOLINE_SIZE);
+
+ /* For libgcc generic-morestack.c and unwinder code. */
+#ifdef STACK_GROWS_DOWNWARD
+ cpp_define (pfile, "__LIBGCC_STACK_GROWS_DOWNWARD__");
+#endif
+
+ /* For libgcc unwinder code. */
+#ifdef DONT_USE_BUILTIN_SETJMP
+ cpp_define (pfile, "__LIBGCC_DONT_USE_BUILTIN_SETJMP__");
+#endif
+#ifdef DWARF_ALT_FRAME_RETURN_COLUMN
+ builtin_define_with_int_value ("__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__",
+ DWARF_ALT_FRAME_RETURN_COLUMN);
+#endif
+ builtin_define_with_int_value ("__LIBGCC_DWARF_FRAME_REGISTERS__",
+ DWARF_FRAME_REGISTERS);
+#ifdef EH_RETURN_STACKADJ_RTX
+ cpp_define (pfile, "__LIBGCC_EH_RETURN_STACKADJ_RTX__");
+#endif
+#ifdef JMP_BUF_SIZE
+ builtin_define_with_int_value ("__LIBGCC_JMP_BUF_SIZE__",
+ JMP_BUF_SIZE);
+#endif
+ builtin_define_with_int_value ("__LIBGCC_STACK_POINTER_REGNUM__",
+ STACK_POINTER_REGNUM);
+
+ /* For libgcov. */
+ builtin_define_with_int_value ("__LIBGCC_VTABLE_USES_DESCRIPTORS__",
+ TARGET_VTABLE_USES_DESCRIPTORS);
+ }
/* For use in assembly language. */
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
size_t extra = 2; /* space for an = and a NUL */
if (is_str)
- extra += 2; /* space for two quote marks */
+ {
+ char *quoted_expansion = (char *) alloca (elen * 4 + 1);
+ const char *p;
+ char *q;
+ extra += 2; /* space for two quote marks */
+ for (p = expansion, q = quoted_expansion; *p; p++)
+ {
+ switch (*p)
+ {
+ case '\n':
+ *q++ = '\\';
+ *q++ = 'n';
+ break;
+
+ case '\t':
+ *q++ = '\\';
+ *q++ = 't';
+ break;
+
+ case '\\':
+ *q++ = '\\';
+ *q++ = '\\';
+ break;
+
+ case '"':
+ *q++ = '\\';
+ *q++ = '"';
+ break;
+
+ default:
+ if (ISPRINT ((unsigned char) *p))
+ *q++ = *p;
+ else
+ {
+ sprintf (q, "\\%03o", (unsigned char) *p);
+ q += 4;
+ }
+ }
+ }
+ *q = '\0';
+ expansion = quoted_expansion;
+ elen = q - expansion;
+ }
buf = (char *) alloca (mlen + elen + extra);
if (is_str)
+2014-09-05 Joseph Myers <joseph@codesourcery.com>
+
+ * Makefile.in (CRTSTUFF_CFLAGS): Add -fbuilding-libgcc.
+ * config/aarch64/linux-unwind.h (STACK_POINTER_REGNUM): Change all
+ uses to __LIBGCC_STACK_POINTER_REGNUM__.
+ (DWARF_ALT_FRAME_RETURN_COLUMN): Change all uses to
+ __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__.
+ * config/alpha/vms-unwind.h (DWARF_ALT_FRAME_RETURN_COLUMN):
+ Change use to __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__.
+ * config/cr16/unwind-cr16.c (STACK_GROWS_DOWNWARD): Change all
+ uses to __LIBGCC_STACK_GROWS_DOWNWARD__.
+ (DWARF_FRAME_REGISTERS): Change all uses to
+ __LIBGCC_DWARF_FRAME_REGISTERS__.
+ (EH_RETURN_STACKADJ_RTX): Change all uses to
+ __LIBGCC_EH_RETURN_STACKADJ_RTX__.
+ * config/cr16/unwind-dw2.h (DWARF_FRAME_REGISTERS): Change use to
+ __LIBGCC_DWARF_FRAME_REGISTERS__. Remove conditional definition.
+ * config/i386/cygming-crtbegin.c (EH_FRAME_SECTION_NAME): Change
+ use to __LIBGCC_EH_FRAME_SECTION_NAME__.
+ (JCR_SECTION_NAME): Change use to __LIBGCC_JCR_SECTION_NAME__.
+ * config/i386/cygming-crtend.c (EH_FRAME_SECTION_NAME): Change use
+ to __LIBGCC_EH_FRAME_SECTION_NAME__.
+ (JCR_SECTION_NAME): Change use to __LIBGCC_JCR_SECTION_NAME__
+ * config/mips/linux-unwind.h (STACK_POINTER_REGNUM): Change use to
+ __LIBGCC_STACK_POINTER_REGNUM__.
+ (DWARF_ALT_FRAME_RETURN_COLUMN): Change all uses to
+ __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__.
+ * config/nios2/linux-unwind.h (STACK_POINTER_REGNUM): Change use
+ to __LIBGCC_STACK_POINTER_REGNUM__.
+ * config/pa/hpux-unwind.h (DWARF_ALT_FRAME_RETURN_COLUMN): Change
+ all uses to __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__.
+ * config/pa/linux-unwind.h (DWARF_ALT_FRAME_RETURN_COLUMN): Change
+ all uses to __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__.
+ * config/rs6000/aix-unwind.h (DWARF_ALT_FRAME_RETURN_COLUMN):
+ Change all uses to __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__.
+ (STACK_POINTER_REGNUM): Change all uses to
+ __LIBGCC_STACK_POINTER_REGNUM__.
+ * config/rs6000/darwin-fallback.c (STACK_POINTER_REGNUM): Change
+ use to __LIBGCC_STACK_POINTER_REGNUM__.
+ * config/rs6000/linux-unwind.h (STACK_POINTER_REGNUM): Change all
+ uses to __LIBGCC_STACK_POINTER_REGNUM__.
+ * config/sparc/linux-unwind.h (DWARF_FRAME_REGISTERS): Change use
+ to __LIBGCC_DWARF_FRAME_REGISTERS__.
+ * config/sparc/sol2-unwind.h (DWARF_FRAME_REGISTERS): Change use
+ to __LIBGCC_DWARF_FRAME_REGISTERS__.
+ * config/tilepro/linux-unwind.h (STACK_POINTER_REGNUM): Change use
+ to __LIBGCC_STACK_POINTER_REGNUM__.
+ * config/xtensa/unwind-dw2-xtensa.h (DWARF_FRAME_REGISTERS):
+ Remove conditional definition.
+ * crtstuff.c (TEXT_SECTION_ASM_OP): Change all uses to
+ __LIBGCC_TEXT_SECTION_ASM_OP__.
+ (EH_FRAME_SECTION_NAME): Change all uses to
+ __LIBGCC_EH_FRAME_SECTION_NAME__.
+ (EH_TABLES_CAN_BE_READ_ONLY): Change all uses to
+ __LIBGCC_EH_TABLES_CAN_BE_READ_ONLY__.
+ (CTORS_SECTION_ASM_OP): Change all uses to
+ __LIBGCC_CTORS_SECTION_ASM_OP__.
+ (DTORS_SECTION_ASM_OP): Change all uses to
+ __LIBGCC_DTORS_SECTION_ASM_OP__.
+ (JCR_SECTION_NAME): Change all uses to
+ __LIBGCC_JCR_SECTION_NAME__.
+ (INIT_SECTION_ASM_OP): Change all uses to
+ __LIBGCC_INIT_SECTION_ASM_OP__.
+ (INIT_ARRAY_SECTION_ASM_OP): Change all uses to
+ __LIBGCC_INIT_ARRAY_SECTION_ASM_OP__.
+ * generic-morestack.c (STACK_GROWS_DOWNWARD): Change all uses to
+ __LIBGCC_STACK_GROWS_DOWNWARD__.
+ * libgcc2.c (INIT_SECTION_ASM_OP): Change all uses to
+ __LIBGCC_INIT_SECTION_ASM_OP__.
+ (INIT_ARRAY_SECTION_ASM_OP): Change all uses to
+ __LIBGCC_INIT_ARRAY_SECTION_ASM_OP__.
+ (EH_FRAME_SECTION_NAME): Change all uses to
+ __LIBGCC_EH_FRAME_SECTION_NAME__.
+ * libgcov-profiler.c (VTABLE_USES_DESCRIPTORS): Remove conditional
+ definitions. Change all uses to
+ __LIBGCC_VTABLE_USES_DESCRIPTORS__.
+ * unwind-dw2.c (STACK_GROWS_DOWNWARD): Change all uses to
+ __LIBGCC_STACK_GROWS_DOWNWARD__.
+ (DWARF_FRAME_REGISTERS): Change all uses to
+ __LIBGCC_DWARF_FRAME_REGISTERS__.
+ (EH_RETURN_STACKADJ_RTX): Change all uses to
+ __LIBGCC_EH_RETURN_STACKADJ_RTX__.
+ * unwind-dw2.h (DWARF_FRAME_REGISTERS): Remove conditional
+ definition. Change use to __LIBGCC_DWARF_FRAME_REGISTERS__.
+ * unwind-sjlj.c (DONT_USE_BUILTIN_SETJMP): Change all uses to
+ __LIBGCC_DONT_USE_BUILTIN_SETJMP__.
+ (JMP_BUF_SIZE): Change use to __LIBGCC_JMP_BUF_SIZE__.
+
2014-09-02 Nathan sidwell <nathan@acm.org>
* libgcov-interface.c (STRONG_ALIAS): New.
CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline -fno-exceptions \
-fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
- -fno-stack-protector \
+ -fbuilding-libgcc -fno-stack-protector \
$(INHIBIT_LIBC_CFLAGS)
# Extra flags to use when compiling crt{begin,end}.o.
new_cfa = (_Unwind_Ptr) sc;
fs->regs.cfa_how = CFA_REG_OFFSET;
- fs->regs.cfa_reg = STACK_POINTER_REGNUM;
+ fs->regs.cfa_reg = __LIBGCC_STACK_POINTER_REGNUM__;
fs->regs.cfa_offset = new_cfa - (_Unwind_Ptr) context->cfa;
for (i = 0; i < AARCH64_DWARF_NUMBER_R; i++)
fs->signal_frame = 1;
- fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].how = REG_SAVED_VAL_OFFSET;
- fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].loc.offset =
+ fs->regs.reg[__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__].how =
+ REG_SAVED_VAL_OFFSET;
+ fs->regs.reg[__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__].loc.offset =
(_Unwind_Ptr) (sc->pc) - new_cfa;
- fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN;
+ fs->retaddr_column = __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__;
return _URC_NO_REASON;
}
{ if ((((STATUS) & 1) != 1)) return _URC_END_OF_STACK; }
#define DENOTES_EXC_DISPATCHER(PV) ((PV) == (ADDR) (REG) SYS$GL_CALL_HANDL)
-#define RA_COLUMN (DWARF_ALT_FRAME_RETURN_COLUMN)
+#define RA_COLUMN (__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__)
static int
alpha_vms_fallback_frame_state (struct _Unwind_Context *context,
#ifndef __USING_SJLJ_EXCEPTIONS__
-#ifndef STACK_GROWS_DOWNWARD
-#define STACK_GROWS_DOWNWARD 0
+#ifndef __LIBGCC_STACK_GROWS_DOWNWARD__
+#define __LIBGCC_STACK_GROWS_DOWNWARD__ 0
#else
-#undef STACK_GROWS_DOWNWARD
-#define STACK_GROWS_DOWNWARD 1
+#undef __LIBGCC_STACK_GROWS_DOWNWARD__
+#define __LIBGCC_STACK_GROWS_DOWNWARD__ 1
#endif
/* Dwarf frame registers used for pre gcc 3.0 compiled glibc. */
#ifndef PRE_GCC3_DWARF_FRAME_REGISTERS
-#define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
+#define PRE_GCC3_DWARF_FRAME_REGISTERS __LIBGCC_DWARF_FRAME_REGISTERS__
#endif
#ifndef DWARF_REG_TO_UNWIND_COLUMN
to its caller. */
struct _Unwind_Context
{
- _Unwind_Context_Reg_Val reg[DWARF_FRAME_REGISTERS+1];
+ _Unwind_Context_Reg_Val reg[__LIBGCC_DWARF_FRAME_REGISTERS__+1];
void *cfa;
void *ra;
void *lsda;
struct _Unwind_Context. */
_Unwind_Word version;
_Unwind_Word args_size;
- char by_value[DWARF_FRAME_REGISTERS+1];
+ char by_value[__LIBGCC_DWARF_FRAME_REGISTERS__+1];
};
/* Byte size of every register managed by these routines. */
-static unsigned char dwarf_reg_size_table[DWARF_FRAME_REGISTERS+1];
+static unsigned char dwarf_reg_size_table[__LIBGCC_DWARF_FRAME_REGISTERS__+1];
\f
/* Read unaligned data from the instruction buffer. */
void *cfa;
long i;
-#ifdef EH_RETURN_STACKADJ_RTX
+#ifdef __LIBGCC_EH_RETURN_STACKADJ_RTX__
/* Special handling here: Many machines do not use a frame pointer,
and track the CFA only through offsets from the stack pointer from
one frame to the next. In this case, the stack pointer is never
context->cfa = cfa;
/* Compute the addresses of all registers saved in this frame. */
- for (i = 0; i < DWARF_FRAME_REGISTERS + 1; ++i)
+ for (i = 0; i < __LIBGCC_DWARF_FRAME_REGISTERS__ + 1; ++i)
switch (fs->regs.reg[i].how)
{
case REG_UNSAVED:
if (!_Unwind_GetGRPtr (target, __builtin_dwarf_sp_column ()))
_Unwind_SetSpColumn (target, target->cfa, &sp_slot);
- for (i = 0; i < DWARF_FRAME_REGISTERS; ++i)
+ for (i = 0; i < __LIBGCC_DWARF_FRAME_REGISTERS__; ++i)
{
void *c = (void *) (_Unwind_Internal_Ptr) current->reg[i];
void *t = (void *) (_Unwind_Internal_Ptr)target->reg[i];
target_cfa = _Unwind_GetPtr (target, __builtin_dwarf_sp_column ());
/* We adjust SP by the difference between CURRENT and TARGET's CFA. */
- if (STACK_GROWS_DOWNWARD)
+ if (__LIBGCC_STACK_GROWS_DOWNWARD__)
return target_cfa - current->cfa + target->args_size;
else
return current->cfa - target_cfa - target->args_size;
/* The CFA is not sufficient to disambiguate the context of a function
interrupted by a signal before establishing its frame and the context
of the signal itself. */
- if (STACK_GROWS_DOWNWARD)
+ if (__LIBGCC_STACK_GROWS_DOWNWARD__)
return _Unwind_GetCFA (context) - _Unwind_IsSignalFrame (context);
else
return _Unwind_GetCFA (context) + _Unwind_IsSignalFrame (context);
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-/* A target can override (perhaps for backward compatibility) how
- many dwarf2 columns are unwound. */
-#ifndef DWARF_FRAME_REGISTERS
-#define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
-#endif
-
/* The result of interpreting the frame unwind info for a frame.
This is all symbolic at this point, as none of the values can
be resolved until the target pc is located. */
REG_SAVED_VAL_EXP,
REG_UNDEFINED
} how;
- } reg[DWARF_FRAME_REGISTERS+1];
+ } reg[__LIBGCC_DWARF_FRAME_REGISTERS__+1];
/* Used to implement DW_CFA_remember_state. */
struct frame_state_reg_info *prev;
register/deregister it with the exception handling library code. */
#if DWARF2_UNWIND_INFO
static EH_FRAME_SECTION_CONST char __EH_FRAME_BEGIN__[]
- __attribute__((used, section(EH_FRAME_SECTION_NAME), aligned(4)))
+ __attribute__((used, section(__LIBGCC_EH_FRAME_SECTION_NAME__), aligned(4)))
= { };
static struct object obj;
#if TARGET_USE_JCR_SECTION
static void *__JCR_LIST__[]
- __attribute__ ((used, section(JCR_SECTION_NAME), aligned(4)))
+ __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__), aligned(4)))
= { };
#endif
this would be the 'length' field in a real FDE. */
static EH_FRAME_SECTION_CONST int __FRAME_END__[]
- __attribute__ ((used, section(EH_FRAME_SECTION_NAME),
+ __attribute__ ((used, section(__LIBGCC_EH_FRAME_SECTION_NAME__),
aligned(4)))
= { 0 };
#endif
#if TARGET_USE_JCR_SECTION
/* Null terminate the .jcr section array. */
static void *__JCR_END__[1]
- __attribute__ ((used, section(JCR_SECTION_NAME),
+ __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__),
aligned(sizeof(void *))))
= { 0 };
#endif
new_cfa = (_Unwind_Ptr) sc;
fs->regs.cfa_how = CFA_REG_OFFSET;
- fs->regs.cfa_reg = STACK_POINTER_REGNUM;
+ fs->regs.cfa_reg = __LIBGCC_STACK_POINTER_REGNUM__;
fs->regs.cfa_offset = new_cfa - (_Unwind_Ptr) context->cfa;
/* On o32 Linux, the register save slots in the sigcontext are
Note that setting fs->signal_frame would not work. As the comment
above MASK_RETURN_ADDR explains, MIPS unwinders must earch for an
odd-valued address. */
- fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].how = REG_SAVED_VAL_OFFSET;
- fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].loc.offset
+ fs->regs.reg[__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__].how
+ = REG_SAVED_VAL_OFFSET;
+ fs->regs.reg[__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__].loc.offset
= (_Unwind_Ptr)(sc->sc_pc) + 2 - new_cfa;
- fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN;
+ fs->retaddr_column = __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__;
return _URC_NO_REASON;
}
/* The CFA is the user's incoming stack pointer value. */
new_cfa = (_Unwind_Ptr)regs->gregs[28];
fs->regs.cfa_how = CFA_REG_OFFSET;
- fs->regs.cfa_reg = STACK_POINTER_REGNUM;
+ fs->regs.cfa_reg = __LIBGCC_STACK_POINTER_REGNUM__;
fs->regs.cfa_offset = new_cfa - (_Unwind_Ptr) context->cfa;
/* The sequential registers. */
UPDATE_FS_FOR_SAR (fs, 88);
}
- fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN;
- UPDATE_FS_FOR_PC (fs, DWARF_ALT_FRAME_RETURN_COLUMN);
+ fs->retaddr_column = __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__;
+ UPDATE_FS_FOR_PC (fs, __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__);
fs->signal_frame = 1;
return _URC_NO_REASON;
}
fs->regs.reg[88].how = REG_SAVED_OFFSET;
fs->regs.reg[88].loc.offset = (long) &sc->sc_sar - new_cfa;
- fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].how = REG_SAVED_OFFSET;
- fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].loc.offset
+ fs->regs.reg[__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__].how
+ = REG_SAVED_OFFSET;
+ fs->regs.reg[__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__].loc.offset
= (long) &sc->sc_iaoq[0] - new_cfa;
- fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN;
+ fs->retaddr_column = __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__;
fs->signal_frame = 1;
return _URC_NO_REASON;
}
/* The fallback proper. */
-#ifdef DWARF_ALT_FRAME_RETURN_COLUMN
-#define RETURN_COLUMN DWARF_ALT_FRAME_RETURN_COLUMN
+#ifdef __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__
+#define RETURN_COLUMN __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__
#else
#define RETURN_COLUMN ARG_POINTER_REGNUM
#endif
/* The "kernel" frame cfa is the stack pointer at the signal occurrence
point. */
- new_cfa = mctx->gpr[STACK_POINTER_REGNUM];
+ new_cfa = mctx->gpr[__LIBGCC_STACK_POINTER_REGNUM__];
fs->regs.cfa_how = CFA_REG_OFFSET;
- fs->regs.cfa_reg = STACK_POINTER_REGNUM;
+ fs->regs.cfa_reg = __LIBGCC_STACK_POINTER_REGNUM__;
fs->regs.cfa_offset = new_cfa - (long) context->cfa;
/* And we state how to find the various registers it has saved with
relative offset rules from there. */
for (i = 0; i < 32; i++)
- if (i != STACK_POINTER_REGNUM)
+ if (i != __LIBGCC_STACK_POINTER_REGNUM__)
REGISTER_CFA_OFFSET_FOR (fs, i, &mctx->gpr[i], new_cfa);
REGISTER_CFA_OFFSET_FOR (fs, CR2_REGNO, &mctx->cr, new_cfa);
}
fs->regs.cfa_how = CFA_REG_OFFSET;
- fs->regs.cfa_reg = STACK_POINTER_REGNUM;
+ fs->regs.cfa_reg = __LIBGCC_STACK_POINTER_REGNUM__;
fs->regs.cfa_offset = new_cfa - old_cfa;;
/* The choice of column for the return address is somewhat tricky.
if (regs == NULL)
return _URC_END_OF_STACK;
- new_cfa = regs->gpr[STACK_POINTER_REGNUM];
+ new_cfa = regs->gpr[__LIBGCC_STACK_POINTER_REGNUM__];
fs->regs.cfa_how = CFA_REG_OFFSET;
- fs->regs.cfa_reg = STACK_POINTER_REGNUM;
+ fs->regs.cfa_reg = __LIBGCC_STACK_POINTER_REGNUM__;
fs->regs.cfa_offset = new_cfa - (long) context->cfa;
#ifdef __powerpc64__
context->cfa -= STACK_BIAS;
- for (i = 0; i < DWARF_FRAME_REGISTERS + 1; ++i)
+ for (i = 0; i < __LIBGCC_DWARF_FRAME_REGISTERS__ + 1; ++i)
if (fs->regs.reg[i].how == REG_SAVED_OFFSET)
_Unwind_SetGRPtr (context, i,
_Unwind_GetGRPtr (context, i) - STACK_BIAS);
context->cfa -= STACK_BIAS;
- for (i = 0; i < DWARF_FRAME_REGISTERS + 1; ++i)
+ for (i = 0; i < __LIBGCC_DWARF_FRAME_REGISTERS__ + 1; ++i)
if (fs->regs.reg[i].how == REG_SAVED_OFFSET)
_Unwind_SetGRPtr (context, i,
_Unwind_GetGRPtr (context, i) - STACK_BIAS);
new_cfa = sc->sp;
fs->regs.cfa_how = CFA_REG_OFFSET;
- fs->regs.cfa_reg = STACK_POINTER_REGNUM;
+ fs->regs.cfa_reg = __LIBGCC_STACK_POINTER_REGNUM__;
fs->regs.cfa_offset = new_cfa - (long) context->cfa;
for (i = 0; i < 56; ++i)
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-/* A target can override (perhaps for backward compatibility) how
- many dwarf2 columns are unwound. */
-#ifndef DWARF_FRAME_REGISTERS
-#define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
-#endif
-
/* Xtensa's variable-size register window save areas can be unwound without
any unwind info. This is a stripped down version of the standard DWARF
_Unwind_FrameState. */
asm (SECTION_OP); \
FUNC (); \
FORCE_CODE_SECTION_ALIGN \
- asm (TEXT_SECTION_ASM_OP); \
+ asm (__LIBGCC_TEXT_SECTION_ASM_OP__); \
}
#endif
# define USE_PT_GNU_EH_FRAME
#endif
-#if defined(EH_FRAME_SECTION_NAME) && !defined(USE_PT_GNU_EH_FRAME)
+#if defined(__LIBGCC_EH_FRAME_SECTION_NAME__) && !defined(USE_PT_GNU_EH_FRAME)
# define USE_EH_FRAME_REGISTRY
#endif
-#if defined(EH_FRAME_SECTION_NAME) && EH_TABLES_CAN_BE_READ_ONLY
+#if defined(__LIBGCC_EH_FRAME_SECTION_NAME__) \
+ && __LIBGCC_EH_TABLES_CAN_BE_READ_ONLY__
# define EH_FRAME_SECTION_CONST const
#else
# define EH_FRAME_SECTION_CONST
does not start with a count of elements. */
#ifdef CTOR_LIST_BEGIN
CTOR_LIST_BEGIN;
-#elif defined(CTORS_SECTION_ASM_OP)
+#elif defined(__LIBGCC_CTORS_SECTION_ASM_OP__)
/* Hack: force cc1 to switch to .data section early, so that assembling
__CTOR_LIST__ does not undo our behind-the-back change to .ctors. */
static func_ptr force_to_data[1] __attribute__ ((__used__)) = { };
-asm (CTORS_SECTION_ASM_OP);
+asm (__LIBGCC_CTORS_SECTION_ASM_OP__);
STATIC func_ptr __CTOR_LIST__[1]
__attribute__ ((__used__, aligned(sizeof(func_ptr))))
= { (func_ptr) (-1) };
#ifdef DTOR_LIST_BEGIN
DTOR_LIST_BEGIN;
-#elif defined(DTORS_SECTION_ASM_OP)
-asm (DTORS_SECTION_ASM_OP);
+#elif defined(__LIBGCC_DTORS_SECTION_ASM_OP__)
+asm (__LIBGCC_DTORS_SECTION_ASM_OP__);
STATIC func_ptr __DTOR_LIST__[1]
__attribute__ ((aligned(sizeof(func_ptr))))
= { (func_ptr) (-1) };
/* Stick a label at the beginning of the frame unwind info so we can register
and deregister it with the exception handling library code. */
STATIC EH_FRAME_SECTION_CONST char __EH_FRAME_BEGIN__[]
- __attribute__((section(EH_FRAME_SECTION_NAME), aligned(4)))
+ __attribute__((section(__LIBGCC_EH_FRAME_SECTION_NAME__), aligned(4)))
= { };
#endif /* USE_EH_FRAME_REGISTRY */
-#ifdef JCR_SECTION_NAME
+#ifdef __LIBGCC_JCR_SECTION_NAME__
/* Stick a label at the beginning of the java class registration info
so we can register them properly. */
STATIC void *__JCR_LIST__[]
- __attribute__ ((used, section(JCR_SECTION_NAME), aligned(sizeof(void*))))
+ __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__),
+ aligned(sizeof(void*))))
= { };
-#endif /* JCR_SECTION_NAME */
+#endif /* __LIBGCC_JCR_SECTION_NAME__ */
#if USE_TM_CLONE_REGISTRY
STATIC func_ptr __TMC_LIST__[]
}
#endif /* USE_TM_CLONE_REGISTRY */
-#if defined(INIT_SECTION_ASM_OP) || defined(INIT_ARRAY_SECTION_ASM_OP)
+#if defined(__LIBGCC_INIT_SECTION_ASM_OP__) \
+ || defined(__LIBGCC_INIT_ARRAY_SECTION_ASM_OP__)
#ifdef OBJECT_FORMAT_ELF
{
atexit (__do_global_dtors_aux);
}
-CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, __do_global_dtors_aux_1)
+CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_SECTION_ASM_OP__,
+ __do_global_dtors_aux_1)
#endif
#if defined(USE_EH_FRAME_REGISTRY) \
- || defined(JCR_SECTION_NAME) \
+ || defined(__LIBGCC_JCR_SECTION_NAME__) \
|| defined(USE_TM_CLONE_REGISTRY)
/* Stick a call to __register_frame_info into the .init section. For some
reason calls with no arguments work more reliably in .init, so stick the
#endif /* CRT_GET_RFIB_DATA */
#endif /* USE_EH_FRAME_REGISTRY */
-#ifdef JCR_SECTION_NAME
+#ifdef __LIBGCC_JCR_SECTION_NAME__
void **jcr_list;
__asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__));
if (__builtin_expect (*jcr_list != NULL, 0))
if (register_classes)
register_classes (jcr_list);
}
-#endif /* JCR_SECTION_NAME */
+#endif /* __LIBGCC_JCR_SECTION_NAME__ */
#if USE_TM_CLONE_REGISTRY
register_tm_clones ();
#endif /* USE_TM_CLONE_REGISTRY */
}
-#ifdef INIT_SECTION_ASM_OP
-CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, frame_dummy)
-#else /* defined(INIT_SECTION_ASM_OP) */
+#ifdef __LIBGCC_INIT_SECTION_ASM_OP__
+CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_SECTION_ASM_OP__, frame_dummy)
+#else /* defined(__LIBGCC_INIT_SECTION_ASM_OP__) */
static func_ptr __frame_dummy_init_array_entry[]
__attribute__ ((__used__, section(".init_array"), aligned(sizeof(func_ptr))))
= { frame_dummy };
-#endif /* !defined(INIT_SECTION_ASM_OP) */
-#endif /* USE_EH_FRAME_REGISTRY || JCR_SECTION_NAME || USE_TM_CLONE_REGISTRY */
+#endif /* !defined(__LIBGCC_INIT_SECTION_ASM_OP__) */
+#endif /* USE_EH_FRAME_REGISTRY || __LIBGCC_JCR_SECTION_NAME__ || USE_TM_CLONE_REGISTRY */
#else /* OBJECT_FORMAT_ELF */
#endif
}
-asm (INIT_SECTION_ASM_OP); /* cc1 doesn't know that we are switching! */
+asm (__LIBGCC_INIT_SECTION_ASM_OP__); /* cc1 doesn't know that we are switching! */
/* A routine to invoke all of the global constructors upon entry to the
program. We put this into the .init section (for systems that have
__do_global_ctors_aux (void) /* prologue goes in .init section */
{
FORCE_CODE_SECTION_ALIGN /* explicit align before switch to .text */
- asm (TEXT_SECTION_ASM_OP); /* don't put epilogue and body in .init */
+ asm (__LIBGCC_TEXT_SECTION_ASM_OP__); /* don't put epilogue and body in .init */
DO_GLOBAL_CTORS_BODY;
atexit (__do_global_dtors);
}
#endif /* OBJECT_FORMAT_ELF */
-#elif defined(HAS_INIT_SECTION) /* ! INIT_SECTION_ASM_OP */
+#elif defined(HAS_INIT_SECTION) /* ! __LIBGCC_INIT_SECTION_ASM_OP__ */
extern void __do_global_dtors (void);
}
#if defined(USE_EH_FRAME_REGISTRY) \
- || defined(JCR_SECTION_NAME) \
+ || defined(__LIBGCC_JCR_SECTION_NAME__) \
|| defined(USE_TM_CLONE_REGISTRY)
/* A helper function for __do_global_ctors, which is in crtend.o. Here
in crtbegin.o, we can reference a couple of symbols not visible there.
__register_frame_info (__EH_FRAME_BEGIN__, &object);
#endif
-#ifdef JCR_SECTION_NAME
+#ifdef __LIBGCC_JCR_SECTION_NAME__
void **jcr_list
__asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__));
if (__builtin_expect (*jcr_list != NULL, 0))
register_tm_clones ();
#endif /* USE_TM_CLONE_REGISTRY */
}
-#endif /* USE_EH_FRAME_REGISTRY || JCR_SECTION_NAME || USE_TM_CLONE_REGISTRY */
+#endif /* USE_EH_FRAME_REGISTRY || __LIBGCC_JCR_SECTION_NAME__ || USE_TM_CLONE_REGISTRY */
-#else /* ! INIT_SECTION_ASM_OP && ! HAS_INIT_SECTION */
+#else /* ! __LIBGCC_INIT_SECTION_ASM_OP__ && ! HAS_INIT_SECTION */
#error "What are you doing with crtstuff.c, then?"
#endif
#ifdef CTOR_LIST_END
CTOR_LIST_END;
-#elif defined(CTORS_SECTION_ASM_OP)
+#elif defined(__LIBGCC_CTORS_SECTION_ASM_OP__)
/* Hack: force cc1 to switch to .data section early, so that assembling
__CTOR_LIST__ does not undo our behind-the-back change to .ctors. */
static func_ptr force_to_data[1] __attribute__ ((__used__)) = { };
-asm (CTORS_SECTION_ASM_OP);
+asm (__LIBGCC_CTORS_SECTION_ASM_OP__);
STATIC func_ptr __CTOR_END__[1]
__attribute__((aligned(sizeof(func_ptr))))
= { (func_ptr) 0 };
#ifdef DTOR_LIST_END
DTOR_LIST_END;
#elif defined(HIDDEN_DTOR_LIST_END)
-#ifdef DTORS_SECTION_ASM_OP
-asm (DTORS_SECTION_ASM_OP);
+#ifdef __LIBGCC_DTORS_SECTION_ASM_OP__
+asm (__LIBGCC_DTORS_SECTION_ASM_OP__);
#endif
func_ptr __DTOR_END__[1]
__attribute__ ((used,
-#ifndef DTORS_SECTION_ASM_OP
+#ifndef __LIBGCC_DTORS_SECTION_ASM_OP__
section(".dtors"),
#endif
aligned(sizeof(func_ptr)), visibility ("hidden")))
= { (func_ptr) 0 };
-#elif defined(DTORS_SECTION_ASM_OP)
-asm (DTORS_SECTION_ASM_OP);
+#elif defined(__LIBGCC_DTORS_SECTION_ASM_OP__)
+asm (__LIBGCC_DTORS_SECTION_ASM_OP__);
STATIC func_ptr __DTOR_END__[1]
__attribute__ ((used, aligned(sizeof(func_ptr))))
= { (func_ptr) 0 };
#endif
#endif /* USE_INITFINI_ARRAY */
-#ifdef EH_FRAME_SECTION_NAME
+#ifdef __LIBGCC_EH_FRAME_SECTION_NAME__
/* Terminate the frame unwind info section with a 4byte 0 as a sentinel;
this would be the 'length' field in a real FDE. */
# if __INT_MAX__ == 2147483647
# error "Missing a 4 byte integer"
# endif
STATIC EH_FRAME_SECTION_CONST int32 __FRAME_END__[]
- __attribute__ ((used, section(EH_FRAME_SECTION_NAME),
+ __attribute__ ((used, section(__LIBGCC_EH_FRAME_SECTION_NAME__),
aligned(sizeof(int32))))
= { 0 };
-#endif /* EH_FRAME_SECTION_NAME */
+#endif /* __LIBGCC_EH_FRAME_SECTION_NAME__ */
-#ifdef JCR_SECTION_NAME
+#ifdef __LIBGCC_JCR_SECTION_NAME__
/* Null terminate the .jcr section array. */
STATIC void *__JCR_END__[1]
- __attribute__ ((used, section(JCR_SECTION_NAME),
+ __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__),
aligned(sizeof(void *))))
= { 0 };
-#endif /* JCR_SECTION_NAME */
+#endif /* __LIBGCC_JCR_SECTION_NAME__ */
#if USE_TM_CLONE_REGISTRY
# ifndef HAVE_GAS_HIDDEN
# endif
#endif /* USE_TM_CLONE_REGISTRY */
-#ifdef INIT_ARRAY_SECTION_ASM_OP
+#ifdef __LIBGCC_INIT_ARRAY_SECTION_ASM_OP__
/* If we are using .init_array, there is nothing to do. */
-#elif defined(INIT_SECTION_ASM_OP)
+#elif defined(__LIBGCC_INIT_SECTION_ASM_OP__)
#ifdef OBJECT_FORMAT_ELF
static void __attribute__((used))
}
/* Stick a call to __do_global_ctors_aux into the .init section. */
-CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, __do_global_ctors_aux)
+CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_SECTION_ASM_OP__, __do_global_ctors_aux)
#else /* OBJECT_FORMAT_ELF */
/* Stick the real initialization code, followed by a normal sort of
static void
__do_global_ctors_aux (void) /* prologue goes in .text section */
{
- asm (INIT_SECTION_ASM_OP);
+ asm (__LIBGCC_INIT_SECTION_ASM_OP__);
DO_GLOBAL_CTORS_BODY;
atexit (__do_global_dtors);
} /* epilogue and body go in .init section */
FORCE_CODE_SECTION_ALIGN
-asm (TEXT_SECTION_ASM_OP);
+asm (__LIBGCC_TEXT_SECTION_ASM_OP__);
#endif /* OBJECT_FORMAT_ELF */
-#elif defined(HAS_INIT_SECTION) /* ! INIT_SECTION_ASM_OP */
+#elif defined(HAS_INIT_SECTION) /* ! __LIBGCC_INIT_SECTION_ASM_OP__ */
extern void __do_global_ctors (void);
{
func_ptr *p;
#if defined(USE_EH_FRAME_REGISTRY) \
- || defined(JCR_SECTION_NAME) \
+ || defined(__LIBGCC_JCR_SECTION_NAME__) \
|| defined(USE_TM_CLONE_REGISTRY)
__do_global_ctors_1();
#endif
(*p) ();
}
-#else /* ! INIT_SECTION_ASM_OP && ! HAS_INIT_SECTION */
+#else /* ! __LIBGCC_INIT_SECTION_ASM_OP__ && ! HAS_INIT_SECTION */
#error "What are you doing with crtstuff.c, then?"
#endif
{
void *guard;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
guard = space;
space = (char *) space + pagesize;
#else
to the nearest 512 byte boundary. It's not essential that we be
precise here; getting it wrong will just leave some stack space
unused. */
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
sp = (void *) ((((__UINTPTR_TYPE__) sp + 511U) / 512U) * 512U);
#else
sp = (void *) ((((__UINTPTR_TYPE__) sp - 511U) / 512U) * 512U);
/* Align the returned stack to a 32-byte boundary. */
aligned = (param_size + 31) & ~ (size_t) 31;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
{
char *bottom = (char *) (current + 1) + current->size;
to = bottom - aligned;
if (current != NULL)
{
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
*pavailable = (char *) old_stack - (char *) (current + 1);
#else
*pavailable = (char *) (current + 1) + current->size - (char *) old_stack;
size_t used;
/* We have popped back to the original stack. */
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
if ((char *) old_stack >= (char *) __morestack_initial_sp.sp)
used = 0;
else
&& (char *) pss + pss->size > (char *) stack)
{
__morestack_current_segment = pss;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
return (char *) stack - (char *) (pss + 1);
#else
return (char *) (pss + 1) + pss->size - (char *) stack;
if (__morestack_initial_sp.sp == NULL)
return 0;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
if ((char *) stack >= (char *) __morestack_initial_sp.sp)
used = 0;
else
*next_segment = (void *) (uintptr_type) 2;
*next_sp = NULL;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
if ((char *) sp >= isp)
return NULL;
*len = (char *) isp - (char *) sp;
*next_sp = (void *) nsp;
}
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
*len = (char *) (segment + 1) + segment->size - (char *) sp;
ret = (void *) sp;
#else
segment = allocate_segment (stack_size);
context[MORESTACK_SEGMENTS] = segment;
context[CURRENT_SEGMENT] = segment;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
initial_sp = (void *) ((char *) (segment + 1) + segment->size);
#else
initial_sp = (void *) (segment + 1);
initial_sp = context[INITIAL_SP];
initial_size = (uintptr_type) context[INITIAL_SP_LEN];
ret = initial_sp;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
ret = (void *) ((char *) ret - initial_size);
#endif
}
else
{
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
initial_sp = (void *) ((char *) (segment + 1) + segment->size);
#else
initial_sp = (void *) (segment + 1);
#define SYMBOL__MAIN __main
#endif
-#if defined (INIT_SECTION_ASM_OP) || defined (INIT_ARRAY_SECTION_ASM_OP)
+#if defined (__LIBGCC_INIT_SECTION_ASM_OP__) \
+ || defined (__LIBGCC_INIT_ARRAY_SECTION_ASM_OP__)
#undef HAS_INIT_SECTION
#define HAS_INIT_SECTION
#endif
/* Some ELF crosses use crtstuff.c to provide __CTOR_LIST__, but use this
code to run constructors. In that case, we need to handle EH here, too. */
-#ifdef EH_FRAME_SECTION_NAME
+#ifdef __LIBGCC_EH_FRAME_SECTION_NAME__
#include "unwind-dw2-fde.h"
extern unsigned char __EH_FRAME_BEGIN__[];
#endif
(*(p-1)) ();
}
#endif
-#if defined (EH_FRAME_SECTION_NAME) && !defined (HAS_INIT_SECTION)
+#if defined (__LIBGCC_EH_FRAME_SECTION_NAME__) && !defined (HAS_INIT_SECTION)
{
static int completed = 0;
if (! completed)
void
__do_global_ctors (void)
{
-#ifdef EH_FRAME_SECTION_NAME
+#ifdef __LIBGCC_EH_FRAME_SECTION_NAME__
{
static struct object object;
__register_frame_info (__EH_FRAME_BEGIN__, &object);
must be in the bss/common section.
Long term no port should use those extensions. But many still do. */
-#if !defined(INIT_SECTION_ASM_OP) && !defined(CTOR_LISTS_DEFINED_EXTERNALLY)
+#if !defined(__LIBGCC_INIT_SECTION_ASM_OP__) \
+ && !defined(CTOR_LISTS_DEFINED_EXTERNALLY)
#if defined (TARGET_ASM_CONSTRUCTOR) || defined (USE_COLLECT2)
func_ptr __CTOR_LIST__[2] = {0, 0};
func_ptr __DTOR_LIST__[2] = {0, 0};
func_ptr __CTOR_LIST__[2];
func_ptr __DTOR_LIST__[2];
#endif
-#endif /* no INIT_SECTION_ASM_OP and not CTOR_LISTS_DEFINED_EXTERNALLY */
+#endif /* no __LIBGCC_INIT_SECTION_ASM_OP__ and not CTOR_LISTS_DEFINED_EXTERNALLY */
#endif /* L_ctors */
#endif /* LIBGCC2_UNITS_PER_WORD <= MIN_UNITS_PER_WORD */
/* By default, the C++ compiler will use function addresses in the
vtable entries. Setting TARGET_VTABLE_USES_DESCRIPTORS to nonzero
tells the compiler to use function descriptors instead. The value
- of this macro says how many words wide the descriptor is (normally 2),
- but it may be dependent on target flags. Since we do not have access
- to the target flags here we just check to see if it is set and use
- that to set VTABLE_USES_DESCRIPTORS to 0 or 1.
+ of this macro says how many words wide the descriptor is (normally 2).
It is assumed that the address of a function descriptor may be treated
as a pointer to a function. */
-#ifdef TARGET_VTABLE_USES_DESCRIPTORS
-#define VTABLE_USES_DESCRIPTORS 1
-#else
-#define VTABLE_USES_DESCRIPTORS 0
-#endif
-
/* Tries to determine the most common value among its inputs. */
void
__gcov_indirect_call_profiler (gcov_type* counter, gcov_type value,
function may have multiple descriptors and we need to dereference
the descriptors to see if they point to the same function. */
if (cur_func == callee_func
- || (VTABLE_USES_DESCRIPTORS && callee_func
+ || (__LIBGCC_VTABLE_USES_DESCRIPTORS__ && callee_func
&& *(void **) cur_func == *(void **) callee_func))
__gcov_one_value_profiler_body (counter, value);
}
/* By default, the C++ compiler will use function addresses in the
vtable entries. Setting TARGET_VTABLE_USES_DESCRIPTORS to nonzero
tells the compiler to use function descriptors instead. The value
- of this macro says how many words wide the descriptor is (normally 2),
- but it may be dependent on target flags. Since we do not have access
- to the target flags here we just check to see if it is set and use
- that to set VTABLE_USES_DESCRIPTORS to 0 or 1.
+ of this macro says how many words wide the descriptor is (normally 2).
It is assumed that the address of a function descriptor may be treated
as a pointer to a function. */
-#ifdef TARGET_VTABLE_USES_DESCRIPTORS
-#define VTABLE_USES_DESCRIPTORS 1
-#else
-#define VTABLE_USES_DESCRIPTORS 0
-#endif
-
/* Tries to determine the most common value among its inputs. */
void
__gcov_indirect_call_profiler_v2 (gcov_type value, void* cur_func)
function may have multiple descriptors and we need to dereference
the descriptors to see if they point to the same function. */
if (cur_func == __gcov_indirect_call_callee
- || (VTABLE_USES_DESCRIPTORS && __gcov_indirect_call_callee
+ || (__LIBGCC_VTABLE_USES_DESCRIPTORS__ && __gcov_indirect_call_callee
&& *(void **) cur_func == *(void **) __gcov_indirect_call_callee))
__gcov_one_value_profiler_body (__gcov_indirect_call_counters, value);
}
#ifndef __USING_SJLJ_EXCEPTIONS__
-#ifndef STACK_GROWS_DOWNWARD
-#define STACK_GROWS_DOWNWARD 0
+#ifndef __LIBGCC_STACK_GROWS_DOWNWARD__
+#define __LIBGCC_STACK_GROWS_DOWNWARD__ 0
#else
-#undef STACK_GROWS_DOWNWARD
-#define STACK_GROWS_DOWNWARD 1
+#undef __LIBGCC_STACK_GROWS_DOWNWARD__
+#define __LIBGCC_STACK_GROWS_DOWNWARD__ 1
#endif
/* Dwarf frame registers used for pre gcc 3.0 compiled glibc. */
#ifndef PRE_GCC3_DWARF_FRAME_REGISTERS
-#define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
+#define PRE_GCC3_DWARF_FRAME_REGISTERS __LIBGCC_DWARF_FRAME_REGISTERS__
#endif
#ifndef DWARF_REG_TO_UNWIND_COLUMN
ignore unwind data for unknown columns. */
#define UNWIND_COLUMN_IN_RANGE(x) \
- __builtin_expect((x) <= DWARF_FRAME_REGISTERS, 1)
+ __builtin_expect((x) <= __LIBGCC_DWARF_FRAME_REGISTERS__, 1)
#ifdef REG_VALUE_IN_UNWIND_CONTEXT
typedef _Unwind_Word _Unwind_Context_Reg_Val;
to its caller. */
struct _Unwind_Context
{
- _Unwind_Context_Reg_Val reg[DWARF_FRAME_REGISTERS+1];
+ _Unwind_Context_Reg_Val reg[__LIBGCC_DWARF_FRAME_REGISTERS__+1];
void *cfa;
void *ra;
void *lsda;
struct _Unwind_Context. */
_Unwind_Word version;
_Unwind_Word args_size;
- char by_value[DWARF_FRAME_REGISTERS+1];
+ char by_value[__LIBGCC_DWARF_FRAME_REGISTERS__+1];
};
/* Byte size of every register managed by these routines. */
-static unsigned char dwarf_reg_size_table[DWARF_FRAME_REGISTERS+1];
+static unsigned char dwarf_reg_size_table[__LIBGCC_DWARF_FRAME_REGISTERS__+1];
\f
/* Read unaligned data from the instruction buffer. */
case DW_CFA_GNU_window_save:
/* ??? Hardcoded for SPARC register window configuration. */
- if (DWARF_FRAME_REGISTERS >= 32)
+ if (__LIBGCC_DWARF_FRAME_REGISTERS__ >= 32)
for (reg = 16; reg < 32; ++reg)
{
fs->regs.reg[reg].how = REG_SAVED_OFFSET;
void *cfa;
long i;
-#ifdef EH_RETURN_STACKADJ_RTX
+#ifdef __LIBGCC_EH_RETURN_STACKADJ_RTX__
/* Special handling here: Many machines do not use a frame pointer,
and track the CFA only through offsets from the stack pointer from
one frame to the next. In this case, the stack pointer is never
context->cfa = cfa;
/* Compute the addresses of all registers saved in this frame. */
- for (i = 0; i < DWARF_FRAME_REGISTERS + 1; ++i)
+ for (i = 0; i < __LIBGCC_DWARF_FRAME_REGISTERS__ + 1; ++i)
switch (fs->regs.reg[i].how)
{
case REG_UNSAVED:
if (!_Unwind_GetGRPtr (target, __builtin_dwarf_sp_column ()))
_Unwind_SetSpColumn (target, target->cfa, &sp_slot);
- for (i = 0; i < DWARF_FRAME_REGISTERS; ++i)
+ for (i = 0; i < __LIBGCC_DWARF_FRAME_REGISTERS__; ++i)
{
void *c = (void *) (_Unwind_Internal_Ptr) current->reg[i];
void *t = (void *) (_Unwind_Internal_Ptr)target->reg[i];
target_cfa = _Unwind_GetPtr (target, __builtin_dwarf_sp_column ());
/* We adjust SP by the difference between CURRENT and TARGET's CFA. */
- if (STACK_GROWS_DOWNWARD)
+ if (__LIBGCC_STACK_GROWS_DOWNWARD__)
return target_cfa - current->cfa + target->args_size;
else
return current->cfa - target_cfa - target->args_size;
/* The CFA is not sufficient to disambiguate the context of a function
interrupted by a signal before establishing its frame and the context
of the signal itself. */
- if (STACK_GROWS_DOWNWARD)
+ if (__LIBGCC_STACK_GROWS_DOWNWARD__)
return _Unwind_GetCFA (context) - _Unwind_IsSignalFrame (context);
else
return _Unwind_GetCFA (context) + _Unwind_IsSignalFrame (context);
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-/* A target can override (perhaps for backward compatibility) how
- many dwarf2 columns are unwound. */
-#ifndef DWARF_FRAME_REGISTERS
-#define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
-#endif
-
/* The result of interpreting the frame unwind info for a frame.
This is all symbolic at this point, as none of the values can
be resolved until the target pc is located. */
REG_SAVED_VAL_EXP,
REG_UNDEFINED
} how;
- } reg[DWARF_FRAME_REGISTERS+1];
+ } reg[__LIBGCC_DWARF_FRAME_REGISTERS__+1];
/* Used to implement DW_CFA_remember_state. */
struct frame_state_reg_info *prev;
#ifdef __USING_SJLJ_EXCEPTIONS__
-#ifdef DONT_USE_BUILTIN_SETJMP
+#ifdef __LIBGCC_DONT_USE_BUILTIN_SETJMP__
#ifndef inhibit_libc
#include <setjmp.h>
#else
-typedef void *jmp_buf[JMP_BUF_SIZE];
+typedef void *jmp_buf[__LIBGCC_JMP_BUF_SIZE__];
extern void longjmp(jmp_buf, int) __attribute__((noreturn));
#endif
#else
_Unwind_Personality_Fn personality;
void *lsda;
-#ifdef DONT_USE_BUILTIN_SETJMP
+#ifdef __LIBGCC_DONT_USE_BUILTIN_SETJMP__
/* We don't know what sort of alignment requirements the system
jmp_buf has. We over estimated in except.c, and now we have
to match that here just in case the system *didn't* have more
{
/* ??? Ideally __builtin_setjmp places the CFA in the jmpbuf. */
-#ifndef DONT_USE_BUILTIN_SETJMP
+#ifndef __LIBGCC_DONT_USE_BUILTIN_SETJMP__
/* This is a crude imitation of the CFA: the saved stack pointer.
This is roughly the CFA of the frame before CONTEXT. When using the
DWARF-2 unwinder _Unwind_GetCFA returns the CFA of the frame described