Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
crtbegin.c File Reference
#include "__dso_handle.h"
#include <stddef.h>
Include dependency graph for crtbegin.c:

Go to the source code of this file.

Functions

 __attribute__ ((visibility("hidden")))
 We don't have shared libraries, so dso_handle is just NULL. More...
 
static void __attribute__ ((used))
 
static fp __DTOR_LIST__ [] __attribute__ ((section(".dtors"), aligned(sizeof(fp)), used))
 

Variables

fp __CTOR_LIST_END__ []
 
fp __DTOR_LIST_END__ []
 

Function Documentation

◆ __attribute__() [1/3]

__attribute__ ( (visibility("hidden"))  )

We don't have shared libraries, so dso_handle is just NULL.

Definition at line 7 of file crtbegin.c.

20  {(fp)-1};
void(* fp)(void)
Definition: crtend.c:8

◆ __attribute__() [2/3]

static void __attribute__ ( (used)  )
static

Definition at line 24 of file crtbegin.c.

25 {
26  static _Bool __initialized;
27  if(__builtin_expect(__initialized, 0))
28  {
29  return;
30  }
31  __initialized = 1;
32 
33  static struct
34  {
35  void* p[8];
36  } __object;
37  if(__register_frame_info)
38  {
39  __register_frame_info(__EH_FRAME_LIST__, &__object);
40  }
41 
42 #ifndef CRT_HAS_INITFINI_ARRAY
43  const size_t n = (size_t)__CTOR_LIST_END__ - (size_t)__CTOR_LIST__ - (size_t)1;
44  for(size_t i = n; i >= 1; i--)
45  {
46  __CTOR_LIST__[i]();
47  }
48 #endif
49 }
fp __CTOR_LIST_END__[]

References __CTOR_LIST_END__.

◆ __attribute__() [3/3]

static fp __DTOR_LIST__ [] __attribute__ ( (section(".dtors"), aligned(sizeof(fp)), used)  )
static

Variable Documentation

◆ __CTOR_LIST_END__

fp __CTOR_LIST_END__[]

Referenced by __attribute__().

◆ __DTOR_LIST_END__

fp __DTOR_LIST_END__[]