1 /* Special .init and .fini section support.
2 Copyright (C) 1997, 2001 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 In addition to the permissions in the GNU Lesser General Public
11 License, the Free Software Foundation gives you unlimited
12 permission to link the compiled version of this file with other
13 programs, and to distribute those programs without any restriction
14 coming from the use of this file. (The Lesser General Public
15 License restrictions do apply in other respects; for example, they
16 cover modification of the file, and distribution when not linked
17 into another program.)
19 The GNU C Library is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 Lesser General Public License for more details.
24 You should have received a copy of the GNU Lesser General Public
25 License along with the GNU C Library; if not, write to the Free
26 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
29 /* Define an ELF note identifying the operating-system ABI that the
30 executable was created for. The ELF note information identifies a
31 particular OS or coordinated development effort within which the
32 ELF header's e_machine value plus (for dynamically linked programs)
33 the PT_INTERP dynamic linker name and DT_NEEDED shared library
34 names fully identify the runtime environment required by an
37 The general format of ELF notes is as follows.
38 Offsets and lengths are bytes or (parenthetical references) to the
39 values in other fields.
41 offset length contents
46 - null-terminated ASCII string, padded to 4-byte alignment
49 The GNU project and cooperating development efforts (including the
50 Linux community) use note type 1 and a vendor name string of "GNU"
51 for a note descriptor that indicates ABI requirements. The note data
52 is four 32-bit words. The first of these is an operating system
53 number (0=Linux, 1=Hurd, 2=Solaris, ...) and the remaining three
54 identify the earliest release of that OS that supports this ABI.
55 See abi-tags (top level) for details. */
58 #include <abi-tag.h> /* OS-specific ABI tag value */
60 /* The linker (GNU ld 2.8 and later) recognizes an allocated section whose
61 name begins with `.note' and creates a PT_NOTE program header entry
64 .section ".note.ABI-tag", "a"
66 .long 1f - 0f /* name length */
67 .long 3f - 2f /* data length */
68 .long 1 /* note type */
69 0: .asciz "GNU" /* vendor name */
71 2: .long __ABI_TAG_OS /* note data: the ABI tag */
72 .long __ABI_TAG_VERSION
73 3: .align 4 /* pad out section */