aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2011-06-23 00:46:14 +0000
committerIan Lance Taylor <ian@airs.com>2011-06-23 00:46:14 +0000
commit5393d7415a71a6f2cf3752e02ef078d7ff6e5f0a (patch)
treea0c89965b041ce2f337110a23e6f7e552984c545 /gold/layout.h
parent1c23ac006028a1d2b12bdfec2fe73751fb7481ec (diff)
downloadgdb-5393d7415a71a6f2cf3752e02ef078d7ff6e5f0a.zip
gdb-5393d7415a71a6f2cf3752e02ef078d7ff6e5f0a.tar.gz
gdb-5393d7415a71a6f2cf3752e02ef078d7ff6e5f0a.tar.bz2
PR gold/12910
* options.h (class General_options): Add --ctors-in-init-array. * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and friends as SHT_PROGBITS for merging sections. (Layout::layout): Remove special handling of .init_array and friends. Don't sort if doing relocatable link. Sort for .ctors and .dtors if ctors_in_init_array. (Layout::make_output_section): Force correct section types for .init_array and friends. Don't sort if doing relocatable link, Don't sort .ctors and .dtors if ctors_in_init_array. (Layout::section_name_mapping): Remove .ctors. and .dtorso. (Layout::output_section_name): Add relobj parameter. Change all callers. Handle .ctors. and .dtors. in code rather than table. Handle .ctors and .dtors if ctors_in_init_array. (Layout::match_file_name): New function, moved from output.cc. * layout.h (class Layout): Update declarations. * output.cc: Include "layout.h". (Input_section_sort_entry::get_priority): New function. (Input_section_sort_entry::match_file_name): Just call Layout::match_file_name. (Output_section::Input_section_sort_init_fini_compare::operator()): Handle .ctors and .dtors. Sort by explicit priority rather than by name. * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional. * testsuite/initpri2.c: New test. * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY. (check_PROGRAMS): Add initpri2. (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables. (initpri2_LDFLAGS, initpri2_LDADD): New variables. * configure, testsuite/Makefile.in: Rebuild.
Diffstat (limited to 'gold/layout.h')
-rw-r--r--gold/layout.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/gold/layout.h b/gold/layout.h
index 1afe913..3eee820 100644
--- a/gold/layout.h
+++ b/gold/layout.h
@@ -645,6 +645,12 @@ class Layout
|| strncmp(name, ".stab", sizeof(".stab") - 1) == 0);
}
+ // Return true if RELOBJ is an input file whose base name matches
+ // FILE_NAME. The base name must have an extension of ".o", and
+ // must be exactly FILE_NAME.o or FILE_NAME, one character, ".o".
+ static bool
+ match_file_name(const Relobj* relobj, const char* file_name);
+
// Check if a comdat group or .gnu.linkonce section with the given
// NAME is selected for the link. If there is already a section,
// *KEPT_SECTION is set to point to the signature and the function
@@ -965,7 +971,7 @@ class Layout
// name. Set *PLEN to the length of the name. *PLEN must be
// initialized to the length of NAME.
static const char*
- output_section_name(const char* name, size_t* plen);
+ output_section_name(const Relobj*, const char* name, size_t* plen);
// Return the number of allocated output sections.
size_t