aboutsummaryrefslogtreecommitdiff
path: root/gold/configure.ac
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-03-28 22:42:34 +0000
committerIan Lance Taylor <ian@airs.com>2008-03-28 22:42:34 +0000
commit2fd322316ec7699c44d24b1c465c80ada336754d (patch)
tree9f4f290c5d9e5efe79544cfaf10a3c62f63b83d3 /gold/configure.ac
parent2460c166aeb65cd1664234dfebbd779c77ee2956 (diff)
downloadfsf-binutils-gdb-2fd322316ec7699c44d24b1c465c80ada336754d.zip
fsf-binutils-gdb-2fd322316ec7699c44d24b1c465c80ada336754d.tar.gz
fsf-binutils-gdb-2fd322316ec7699c44d24b1c465c80ada336754d.tar.bz2
* layout.cc (Layout::layout): If we see an input section with a
name that needs sorting, set the must_sort flag for the output section. (Layout::make_output_section): If the name of the output section indicates that it might require sorting, set the may_sort flag. * output.h (Output_section::may_sort_attached_input_sections): New function. (Output_section::set_may_sort_attached_input_sections): New function. (Output_section::must_sort_attached_input_sections): New function. (Output_section::set_must_sort_attached_input_sections): New function. (class Output_section): Declare Input_section_sort_entry. Define Input_section_sort_compare. Declare sort_attached_input_sections. Add new fields: may_sort_attached_input_sections_, must_sort_attached_input_sections_, attached_input_sections_are_sorted_. * output.cc (Output_section::Output_section): Initialize new fields. (Output_section::add_input_section): Add an entry to input_sections_ if may_sort or must_sort are true. (Output_section::set_final_data_size): Call sort_attached_input_sections if necessary. (Output_section::Input_section_sort_entry): Define new class. (Output_section::Input_section_sort_compare::operator()): New function. (Output_section::sort_attached_input_sections): New function. * configure.ac: Check whether the compiler supports constructor priorities. Define a CONSTRUCTOR_PRIORITY automake conditional. * testsuite/initpri1.c: New file. * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if CONSTRUCTOR_PRIORITY. (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables. (initpri1_LDFLAGS): New variable. * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
Diffstat (limited to 'gold/configure.ac')
-rw-r--r--gold/configure.ac8
1 files changed, 8 insertions, 0 deletions
diff --git a/gold/configure.ac b/gold/configure.ac
index d9d965e..2355e73 100644
--- a/gold/configure.ac
+++ b/gold/configure.ac
@@ -223,6 +223,14 @@ error
AM_CONDITIONAL(STATIC_TLS, test "$gold_cv_lib_glibc24" = "yes")
+dnl Check whether the compiler supports constructor priorities in
+dnl attributes, which were added in gcc 4.3.
+AC_CACHE_CHECK([for constructor priorities], [gold_cv_c_conprio],
+[AC_COMPILE_IFELSE([void f() __attribute__ ((constructor (1)));],
+[gold_cv_c_conprio=yes], [gold_cv_c_conprio=no])])
+
+AM_CONDITIONAL(CONSTRUCTOR_PRIORITY, test "$gold_cv_c_conprio" = "yes")
+
AM_BINUTILS_WARNINGS
WARN_CXXFLAGS=`echo ${WARN_CFLAGS} | sed -e 's/-Wstrict-prototypes//' -e 's/-Wmissing-prototypes//'`