X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ld%2Fldlang.h;h=a23a04dbb07f7f83c921c6e3796928b2f6d84da6;hb=b753922c0bfbe3828b1495122875de8dad473475;hp=0b56c276c38180f048968936ed30179dd613fd13;hpb=0841712ea90a7633d54bbc1f00fa82e068815b66;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/ldlang.h b/ld/ldlang.h index 0b56c276c3..a23a04dbb0 100644 --- a/ld/ldlang.h +++ b/ld/ldlang.h @@ -1,6 +1,6 @@ /* ldlang.h - linker command language support Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #ifndef LDLANG_H #define LDLANG_H @@ -131,7 +131,7 @@ typedef struct lang_output_section_statement_struct union etree_union *addr_tree; lang_statement_list_type children; const char *memspec; - union lang_statement_union *next; + struct lang_output_section_statement_struct *next; const char *name; int processed; @@ -147,7 +147,8 @@ typedef struct lang_output_section_statement_struct int subsection_alignment; /* Alignment of components. */ int section_alignment; /* Alignment of start of section. */ int constraint; - bfd_boolean all_input_readonly; + unsigned int all_input_readonly : 1; + unsigned int ignored : 1; union etree_union *load_base; @@ -266,6 +267,10 @@ typedef struct lang_input_statement_struct /* Whether to search for this entry as a dynamic archive. */ bfd_boolean dynamic; + /* Whether DT_NEEDED tags should be added for dynamic libraries in + DT_NEEDED tags from this entry. */ + bfd_boolean add_needed; + /* Whether this entry should cause a DT_NEEDED tag only when satisfying references from regular files, or always. */ bfd_boolean as_needed; @@ -275,9 +280,6 @@ typedef struct lang_input_statement_struct bfd_boolean loaded; -#if 0 - unsigned int globals_in_this_file; -#endif const char *target; bfd_boolean real; } lang_input_statement_type; @@ -297,7 +299,17 @@ typedef struct union lang_statement_union *file; } lang_afile_asection_pair_statement_type; -typedef struct lang_wild_statement_struct +typedef struct lang_wild_statement_struct lang_wild_statement_type; + +typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *, + asection *, lang_input_statement_type *, void *); + +typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *, + lang_input_statement_type *, + callback_t callback, + void *data); + +struct lang_wild_statement_struct { lang_statement_header_type header; const char *filename; @@ -305,13 +317,17 @@ typedef struct lang_wild_statement_struct struct wildcard_list *section_list; bfd_boolean keep_sections; lang_statement_list_type children; -} lang_wild_statement_type; + + walk_wild_section_handler_t walk_wild_section_handler; + struct wildcard_list *handler_data[4]; +}; typedef struct lang_address_statement_struct { lang_statement_header_type header; const char *section_name; union etree_union *address; + const segment_type *segment; } lang_address_statement_type; typedef struct @@ -406,7 +422,16 @@ struct lang_definedness_hash_entry int iteration; }; -extern struct unique_sections *unique_section_list; +/* Used by place_orphan to keep track of orphan sections and statements. */ + +struct orphan_save { + const char *name; + flagword flags; + lang_output_section_statement_type *os; + asection **section; + lang_statement_union_type **stmt; + lang_output_section_statement_type **os_tail; +}; extern lang_output_section_statement_type *abs_output_section; extern lang_statement_list_type lang_output_section_statement; @@ -446,9 +471,11 @@ extern void lang_final extern void lang_process (void); extern void lang_section_start - (const char *, union etree_union *); + (const char *, union etree_union *, const segment_type *); extern void lang_add_entry (const char *, bfd_boolean); +extern void lang_default_entry + (const char *); extern void lang_add_target (const char *); extern void lang_add_wild @@ -482,8 +509,7 @@ extern void lang_for_each_file extern void lang_reset_memory_regions (void); extern void lang_do_assignments - (lang_statement_union_type *, lang_output_section_statement_type *, - fill_type *, bfd_vma); + (void); #define LANG_FOR_EACH_INPUT_STATEMENT(statement) \ lang_input_statement_type *statement; \ @@ -497,6 +523,12 @@ extern void ldlang_add_file (lang_input_statement_type *); extern lang_output_section_statement_type *lang_output_section_find (const char * const); +extern lang_output_section_statement_type *lang_output_section_find_by_flags + (const asection *, lang_output_section_statement_type **exact); +extern lang_output_section_statement_type *lang_insert_orphan + (lang_input_statement_type *, asection *, const char *, + lang_output_section_statement_type *, struct orphan_save *, + etree_type *, lang_statement_list_type *); extern lang_input_statement_type *lang_add_input_file (const char *, lang_input_file_enum_type, const char *); extern void lang_add_keepsyms_file @@ -519,12 +551,14 @@ extern void lang_for_each_statement (void (*) (lang_statement_union_type *)); extern void *stat_alloc (size_t); +extern void strip_excluded_output_sections + (void); extern void dprint_statement (lang_statement_union_type *, int); -extern bfd_vma lang_size_sections - (lang_statement_union_type *, lang_output_section_statement_type *, - lang_statement_union_type **, fill_type *, bfd_vma, bfd_boolean *, - bfd_boolean); +extern void lang_size_sections + (bfd_boolean *, bfd_boolean); +extern void one_lang_size_sections_pass + (bfd_boolean *, bfd_boolean); extern void lang_enter_group (void); extern void lang_leave_group @@ -568,4 +602,6 @@ extern int lang_symbol_definition_iteration (const char *); extern void lang_update_definedness (const char *, struct bfd_link_hash_entry *); +extern void add_excluded_libs (const char *); + #endif