~ubuntu-branches/ubuntu/lucid/enigmail/lucid-security

« back to all changes in this revision

Viewing changes to build/unix/elfhack/test-ctors.c

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-11-12 16:36:01 UTC
  • mfrom: (0.11.6)
  • Revision ID: package-import@ubuntu.com-20121112163601-8c5yisdr8sxei4rv
Tags: 2:1.4.6-0ubuntu0.10.04.1
* New upstream release v1.4.6
  - see LP: #1080212 for USN information
* Drop unneeded patches
  - remove debian/patches/correct-version-number.diff
  - remove debian/patches/dont_register_cids_multiple_times.diff
  - update debian/patches/series
* Support building in an objdir
  - update debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This Source Code Form is subject to the terms of the Mozilla Public
 
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
4
 
 
5
#include "test.c"
 
6
 
 
7
/* Recent binutils would put .ctors content into a .init_array section */
 
8
__attribute__((section(".manual_ctors"), used))
 
9
static void (*ctors[])() = { (void (*)())-1, end_test, test, NULL };
 
10
 
 
11
__attribute__((section(".init")))
 
12
void _init() {
 
13
    void (**func)() = &ctors[sizeof(ctors) / sizeof(void (*)()) - 1];
 
14
    while (*(--func) != (void (*)())-1) {
 
15
        (*func)();
 
16
    }
 
17
}