File:  [DVB] / dietlibc / dyn_stop.c
Revision 1.4: download - view: text, annotated - select for diffs
Mon Feb 25 16:00:49 2002 UTC (22 years, 3 months ago) by olaf
Branches: MAIN
CVS tags: finnland_test_200301, branch_rc14_fieldtest_finnland, branch_rc13_fieldtest_finnland, branch_rc12_fieldtest_finnland, branch_rc10_fieldtest_finnland, RELEASE_finnland_200301_1, RC12_FIELDTEST_FINNLAND, RC10_FIELDTEST_FINNLAND, HEAD
Assembler and PIC code the source of all evel in the dynamic-section....
Added a helper for x86 and modified the assembler sources (now the
libdietc.so is NON textrel again....). S390 fixed a typo.
Fixed diet so dynamic binaries uses the "correct" dynamic-linker...

#include "dietfeatures.h"

#ifdef WANT_DYNAMIC
typedef void(*structor)(void);

__attribute__((section(".ctors")))
static structor __CTOR_END__[1]={((structor)0)};

__attribute__((section(".dtors")))
static structor __DTOR_END__[1]={((structor)0)};

static void __do_global_ctors_aux(void)
{
  structor *cf=__DTOR_END__;	/* ugly trick to prevent warning */
  for(cf=((__CTOR_END__)-1); (*cf) != (structor)-1; cf--) (*cf)();
}

void _init() __attribute__((section(".init")));
__attribute__((section(".init"))) void _init()
{
  __do_global_ctors_aux();
}
#endif

LinuxTV legacy CVS <linuxtv.org/cvs>