aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2004-10-14 12:54:47 +0000
committerAlan Modra <amodra@gmail.com>2004-10-14 12:54:47 +0000
commitafd7a018c9e949ee9f1126ae4517567bd9d2dcb1 (patch)
tree5d15c82c78d6d590e11d9b519e7ac7c8a8bd127f /ld/ldlang.h
parentad4c72d28343c31f9d4036beb90d18e2efa390ea (diff)
downloadgdb-afd7a018c9e949ee9f1126ae4517567bd9d2dcb1.zip
gdb-afd7a018c9e949ee9f1126ae4517567bd9d2dcb1.tar.gz
gdb-afd7a018c9e949ee9f1126ae4517567bd9d2dcb1.tar.bz2
ld/
PR 63 * ldlang.h (lang_output_section_statement_type): Make "next" a struct lang_output_section_statement_struct *. (struct orphan_save): Move from elf32.em. Add "name" and "flags". (lang_output_section_find_by_flags, lang_insert_orphan): Declare. * ldlang.c (lang_output_section_find_1): Adjust for changed output_section_statement "next". (strip_excluded_output_sections): Likewise. (lang_record_phdrs): Likewise. (lang_output_section_find_by_flags): New function. (output_prev_sec_find): Move from pe.em. Adjust iterator. (lang_insert_orphan): New function. Tail end of elf32.em's place_orphan merged with that from pe.em. Allow bfd_section to be placed first. New heuristic for placing new output section statement in existing script, and accompanying split of __start symbol alignment into a separate assignment to dot. (lang_add_section): Consistently use output->bfd_section rather than an alias, section->output_section. (map_input_to_output_sections): Rename overly long arg. Move initialization of data_statement output section to here.. (lang_check_section_addresses): ..from here. (print_assignment): Correct printing of etree_assert. (print_all_symbols): Don't bomb if userdata is NULL. (IGNORE_SECTION): Rearrange. * emultempl/elf32.em (output_rel_find): Adjust interator. (output_prev_sec_find): Delete. (struct orphan_save): Delete. (gld${EMULATION_NAME}_place_orphan): Cater for zero bfd_section flags without creating a duplicate output section statement. Revise code holding history of various orphan section placements. Allow orphan sections to place before script specified output sections. Call lang_output_section_find_by_flags when placement by name fails. Use lang_insert_orphan. * emultempl/mmo.em (output_prev_sec_find): Delete. (struct orphan_save): Delete. (mmo_place_orphan): Revise code holding history of orphan placement. Allow orphans to place before existing output sections. Use lang_insert_orphan. * emultempl/pe.em (output_prev_sec_find): Delete. (struct orphan_save): Delete. (gld_${EMULATION_NAME}_place_orphan): Revise to suit use of lang_insert_orphan. ld/testsuite/ * ld-scripts/overlay-size.d: Update for changed orphan section placement. * ld-mmix/bpo-18.d: Likewise.
Diffstat (limited to 'ld/ldlang.h')
-rw-r--r--ld/ldlang.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/ld/ldlang.h b/ld/ldlang.h
index f7e2fa6..9b0f9ef 100644
--- a/ld/ldlang.h
+++ b/ld/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;
@@ -410,6 +410,17 @@ struct lang_definedness_hash_entry
int iteration;
};
+/* 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 struct unique_sections *unique_section_list;
extern lang_output_section_statement_type *abs_output_section;
@@ -501,6 +512,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