133965Sjdp/* ldctor.h - linker constructor support
2130561Sobrien   Copyright 1991, 1992, 1993, 1994, 1995, 1998, 2000, 2002, 2003
378828Sobrien   Free Software Foundation, Inc.
477298Sobrien
533965SjdpThis file is part of GLD, the Gnu Linker.
633965Sjdp
733965SjdpGLD is free software; you can redistribute it and/or modify
833965Sjdpit under the terms of the GNU General Public License as published by
933965Sjdpthe Free Software Foundation; either version 2, or (at your option)
1033965Sjdpany later version.
1133965Sjdp
1233965SjdpGLD is distributed in the hope that it will be useful,
1333965Sjdpbut WITHOUT ANY WARRANTY; without even the implied warranty of
1433965SjdpMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1533965SjdpGNU General Public License for more details.
1633965Sjdp
1733965SjdpYou should have received a copy of the GNU General Public License
1860484Sobrienalong with GLD; see the file COPYING.  If not, write to the Free
19218822SdimSoftware Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
20218822Sdim02110-1301, USA.  */
2133965Sjdp
2233965Sjdp#ifndef LDCTOR_H
2333965Sjdp#define LDCTOR_H
2433965Sjdp
2533965Sjdp/* List of statements needed to handle constructors */
2633965Sjdpextern lang_statement_list_type constructor_list;
2733965Sjdp
2860484Sobrien/* Whether the constructors should be sorted.  Note that this is
2960484Sobrien   global for the entire link; we assume that there is only a single
3060484Sobrien   CONSTRUCTORS command in the linker script.  */
31130561Sobrienextern bfd_boolean constructors_sorted;
3260484Sobrien
3333965Sjdp/* We keep a list of these structures for each set we build.  */
3433965Sjdp
3577298Sobrienstruct set_info {
3633965Sjdp  struct set_info *next;		/* Next set.  */
3733965Sjdp  struct bfd_link_hash_entry *h;	/* Hash table entry.  */
3833965Sjdp  bfd_reloc_code_real_type reloc;	/* Reloc to use for an entry.  */
3933965Sjdp  size_t count;				/* Number of elements.  */
4033965Sjdp  struct set_element *elements;		/* Elements in set.  */
4133965Sjdp};
4233965Sjdp
4377298Sobrienstruct set_element {
4433965Sjdp  struct set_element *next;		/* Next element.  */
4533965Sjdp  const char *name;			/* Name in set (may be NULL).  */
4633965Sjdp  asection *section;			/* Section of value in set.  */
4733965Sjdp  bfd_vma value;			/* Value in set.  */
4833965Sjdp};
4933965Sjdp
5033965Sjdp/* The sets we have seen.  */
5133965Sjdp
5233965Sjdpextern struct set_info *sets;
5333965Sjdp
54130561Sobrienextern void ldctor_add_set_entry
55130561Sobrien  (struct bfd_link_hash_entry *, bfd_reloc_code_real_type, const char *,
56130561Sobrien   asection *, bfd_vma);
57130561Sobrienextern void ldctor_build_sets
58130561Sobrien  (void);
5933965Sjdp
6033965Sjdp#endif
61