Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: newlib/libc/misc/fini.c

Issue 1533383004: Explicitly enable the use of init/fini array under PNaCl (Closed) Base URL: https://chromium.googlesource.com/native_client/nacl-newlib.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | newlib/libc/misc/init.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 CodeSourcery, Inc. 2 * Copyright (C) 2010 CodeSourcery, Inc.
3 * 3 *
4 * Permission to use, copy, modify, and distribute this file 4 * Permission to use, copy, modify, and distribute this file
5 * for any purpose is hereby granted without fee, provided that 5 * for any purpose is hereby granted without fee, provided that
6 * the above copyright notice and this notice appears in all 6 * the above copyright notice and this notice appears in all
7 * copies. 7 * copies.
8 * 8 *
9 * This file is distributed WITHOUT ANY WARRANTY; without even the implied 9 * This file is distributed WITHOUT ANY WARRANTY; without even the implied
10 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 */ 11 */
12 12
13 /* Handle ELF .{pre_init,init,fini}_array sections. */ 13 /* Handle ELF .{pre_init,init,fini}_array sections. */
14 #include <sys/types.h> 14 #include <sys/types.h>
15 15
16 #ifdef HAVE_INITFINI_ARRAY 16 #if defined(HAVE_INITFINI_ARRAY) || defined(__pnacl__)
17 extern void (*__fini_array_start []) (void) __attribute__((weak)); 17 extern void (*__fini_array_start []) (void) __attribute__((weak));
18 extern void (*__fini_array_end []) (void) __attribute__((weak)); 18 extern void (*__fini_array_end []) (void) __attribute__((weak));
19 19
20 extern void _fini (void); 20 extern void _fini (void);
21 21
22 /* Run all the cleanup routines. */ 22 /* Run all the cleanup routines. */
23 void 23 void
24 __libc_fini_array (void) 24 __libc_fini_array (void)
25 { 25 {
26 size_t count; 26 size_t count;
27 size_t i; 27 size_t i;
28 28
29 count = __fini_array_end - __fini_array_start; 29 count = __fini_array_end - __fini_array_start;
30 for (i = count; i > 0; i--) 30 for (i = count; i > 0; i--)
31 __fini_array_start[i-1] (); 31 __fini_array_start[i-1] ();
32 32
33 _fini (); 33 _fini ();
34 } 34 }
35 #endif 35 #endif
OLDNEW
« no previous file with comments | « no previous file | newlib/libc/misc/init.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698