/* Specialized bits of code needed to support construction and
destruction of file-scope objects in C++ code.
- Copyright (C) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
- 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1991-2014 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com).
This file is part of GCC.
}
#endif
+#if defined(TARGET_DL_ITERATE_PHDR) && \
+ (defined(__DragonFly__) || defined(__FreeBSD__))
+#define BSD_DL_ITERATE_PHDR_AVAILABLE
+#endif
+
#if defined(OBJECT_FORMAT_ELF) \
&& !defined(OBJECT_FORMAT_FLAT) \
&& defined(HAVE_LD_EH_FRAME_HDR) \
&& !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
- && defined(__FreeBSD__) && __FreeBSD__ >= 7
+ && defined(BSD_DL_ITERATE_PHDR_AVAILABLE)
#include <link.h>
# define USE_PT_GNU_EH_FRAME
#endif
#endif /* USE_EH_FRAME_REGISTRY */
#ifdef JCR_SECTION_NAME
- if (__JCR_LIST__[0])
+ void **jcr_list;
+ __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__));
+ if (__builtin_expect (*jcr_list != NULL, 0))
{
void (*register_classes) (void *) = _Jv_RegisterClasses;
__asm ("" : "+r" (register_classes));
if (register_classes)
- register_classes (__JCR_LIST__);
+ register_classes (jcr_list);
}
#endif /* JCR_SECTION_NAME */
#endif
#ifdef JCR_SECTION_NAME
- if (__JCR_LIST__[0])
+ void **jcr_list
+ __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__));
+ if (__builtin_expect (*jcr_list != NULL, 0))
{
void (*register_classes) (void *) = _Jv_RegisterClasses;
__asm ("" : "+r" (register_classes));
if (register_classes)
- register_classes (__JCR_LIST__);
+ register_classes (jcr_list);
}
#endif