d873f77f3270fe73fcc8ed22aa4fd12dcd02c7b4
[platform/upstream/binutils.git] / ld / ldctor.h
1 /* ldctor.h - linker constructor support
2    Copyright 1991, 92, 93, 94, 95, 1998 Free Software Foundation, Inc.
3    
4 This file is part of GLD, the Gnu Linker.
5
6 GLD is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GLD is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GLD; see the file COPYING.  If not, write to the Free
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19 02111-1307, USA.  */
20
21 #ifndef LDCTOR_H
22 #define LDCTOR_H
23
24 /* List of statements needed to handle constructors */
25 extern lang_statement_list_type constructor_list;
26
27 /* Whether the constructors should be sorted.  Note that this is
28    global for the entire link; we assume that there is only a single
29    CONSTRUCTORS command in the linker script.  */
30 extern boolean constructors_sorted;
31
32 /* We keep a list of these structures for each set we build.  */
33
34 struct set_info
35 {
36   struct set_info *next;                /* Next set.  */
37   struct bfd_link_hash_entry *h;        /* Hash table entry.  */
38   bfd_reloc_code_real_type reloc;       /* Reloc to use for an entry.  */
39   size_t count;                         /* Number of elements.  */
40   struct set_element *elements;         /* Elements in set.  */
41 };
42
43 struct set_element
44 {
45   struct set_element *next;             /* Next element.  */
46   const char *name;                     /* Name in set (may be NULL).  */
47   asection *section;                    /* Section of value in set.  */
48   bfd_vma value;                        /* Value in set.  */
49 };
50
51 /* The sets we have seen.  */
52
53 extern struct set_info *sets;
54
55 extern void ldctor_add_set_entry PARAMS ((struct bfd_link_hash_entry *,
56                                           bfd_reloc_code_real_type,
57                                           const char *, asection *, bfd_vma));
58 extern void ldctor_build_sets PARAMS ((void));
59
60 #endif