| 1 |
282 |
jeremybenn |
/* crtend object for windows32 targets.
|
| 2 |
|
|
Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
|
| 3 |
|
|
|
| 4 |
|
|
Contributed by Danny Smith <dannysmith@users.sourceforge.net>
|
| 5 |
|
|
|
| 6 |
|
|
This file is part of GCC.
|
| 7 |
|
|
|
| 8 |
|
|
GCC is free software; you can redistribute it and/or modify it under
|
| 9 |
|
|
the terms of the GNU General Public License as published by the Free
|
| 10 |
|
|
Software Foundation; either version 3, or (at your option) any later
|
| 11 |
|
|
version.
|
| 12 |
|
|
|
| 13 |
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
| 14 |
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
| 15 |
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
| 16 |
|
|
for more details.
|
| 17 |
|
|
|
| 18 |
|
|
Under Section 7 of GPL version 3, you are granted additional
|
| 19 |
|
|
permissions described in the GCC Runtime Library Exception, version
|
| 20 |
|
|
3.1, as published by the Free Software Foundation.
|
| 21 |
|
|
|
| 22 |
|
|
You should have received a copy of the GNU General Public License and
|
| 23 |
|
|
a copy of the GCC Runtime Library Exception along with this program;
|
| 24 |
|
|
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
| 25 |
|
|
<http://www.gnu.org/licenses/>. */
|
| 26 |
|
|
|
| 27 |
|
|
/* Target machine header files require this define. */
|
| 28 |
|
|
#define IN_LIBGCC2
|
| 29 |
|
|
|
| 30 |
|
|
/* auto-host.h is needed by cygming.h for HAVE_GAS_WEAK and here
|
| 31 |
|
|
for HAVE_LD_RO_RW_SECTION_MIXING. */
|
| 32 |
|
|
#include "auto-host.h"
|
| 33 |
|
|
#include "tconfig.h"
|
| 34 |
|
|
#include "tsystem.h"
|
| 35 |
|
|
#include "coretypes.h"
|
| 36 |
|
|
#include "tm.h"
|
| 37 |
|
|
#include "unwind-dw2-fde.h"
|
| 38 |
|
|
|
| 39 |
|
|
#if defined(HAVE_LD_RO_RW_SECTION_MIXING)
|
| 40 |
|
|
# define EH_FRAME_SECTION_CONST const
|
| 41 |
|
|
#else
|
| 42 |
|
|
# define EH_FRAME_SECTION_CONST
|
| 43 |
|
|
#endif
|
| 44 |
|
|
|
| 45 |
|
|
#if DWARF2_UNWIND_INFO
|
| 46 |
|
|
/* Terminate the frame unwind info section with a 0 as a sentinel;
|
| 47 |
|
|
this would be the 'length' field in a real FDE. */
|
| 48 |
|
|
|
| 49 |
|
|
static EH_FRAME_SECTION_CONST int __FRAME_END__[]
|
| 50 |
|
|
__attribute__ ((unused, section(EH_FRAME_SECTION_NAME),
|
| 51 |
|
|
aligned(4)))
|
| 52 |
|
|
= { 0 };
|
| 53 |
|
|
#endif
|
| 54 |
|
|
|
| 55 |
|
|
#if TARGET_USE_JCR_SECTION
|
| 56 |
|
|
/* Null terminate the .jcr section array. */
|
| 57 |
|
|
static void *__JCR_END__[1]
|
| 58 |
|
|
__attribute__ ((unused, section(JCR_SECTION_NAME),
|
| 59 |
|
|
aligned(sizeof(void *))))
|
| 60 |
|
|
= { 0 };
|
| 61 |
|
|
#endif
|
| 62 |
|
|
|
| 63 |
|
|
extern void __gcc_register_frame (void);
|
| 64 |
|
|
extern void __gcc_deregister_frame (void);
|
| 65 |
|
|
|
| 66 |
|
|
static void register_frame_ctor (void) __attribute__ ((constructor (0)));
|
| 67 |
|
|
|
| 68 |
|
|
static void
|
| 69 |
|
|
register_frame_ctor (void)
|
| 70 |
|
|
{
|
| 71 |
|
|
__gcc_register_frame ();
|
| 72 |
|
|
#if DEFAULT_USE_CXA_ATEXIT
|
| 73 |
|
|
/* If we use the __cxa_atexit method to register C++ dtors
|
| 74 |
|
|
at object construction, also use atexit to register eh frame
|
| 75 |
|
|
info cleanup. */
|
| 76 |
|
|
atexit (__gcc_deregister_frame);
|
| 77 |
|
|
#endif
|
| 78 |
|
|
}
|
| 79 |
|
|
|
| 80 |
|
|
#if !DEFAULT_USE_CXA_ATEXIT
|
| 81 |
|
|
static void deregister_frame_dtor (void) __attribute__ ((destructor (0)));
|
| 82 |
|
|
|
| 83 |
|
|
static void
|
| 84 |
|
|
deregister_frame_dtor (void)
|
| 85 |
|
|
{
|
| 86 |
|
|
__gcc_deregister_frame ();
|
| 87 |
|
|
}
|
| 88 |
|
|
#endif
|