From a696306141ebed976e4af092e1954d5f67645faa Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 2 May 2012 21:37:22 +0000 Subject: [PATCH] * configure.ac (ENABLE_GOLD): Consider *-*-nacl* targets ELF. * configure: Regenerate. gold/ * nacl.cc: New file. * nacl.h: New file. * Makefile.am (CCFILES, HFILES): Add them. * Makefile.in: Regenerate. * i386.cc (Output_data_plt_i386_nacl): New class. (Output_data_plt_i386_nacl_exec): New class. (Output_data_plt_i386_nacl_dyn): New class. (Target_i386_nacl): New class. (Target_selector_i386_nacl): New class. (target_selector_i386): Use it instead of Target_selector_i386. * x86_64.cc (Output_data_plt_x86_64_nacl): New class. (Target_x86_64_nacl): New class. (Target_selector_x86_64_nacl): New class. (target_selector_x86_64, target_selector_x32): Use it instead of Target_selector_x86_64. * arm.cc (Output_data_plt_arm_nacl): New class. (Target_arm_nacl): New class. (Target_selector_arm_nacl): New class. (target_selector_arm, target_selector_armbe): Use it instead of Target_selector_arm. * target-select.cc (select_target): Take new Input_file* and off_t arguments, pass them on to recognize method of selector. * object.cc (make_elf_sized_object): Update caller. * parameters.cc (parameters_force_valid_target): Likewise. * incremental.cc (make_sized_incremental_binary): Likewise. * target-select.h: Update decl. (Target_selector::recognize): Take new Input_file* argument, pass it on to do_recognize. (Target_selector::do_recognize): Take new Input_file* argument. * freebsd.h (Target_selector_freebsd::do_recognize): Likewise. * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise. * sparc.cc (Target_selector_sparc::do_recognize): Likewise. * testsuite/testfile.cc (Target_selector::do_recognize): Likewise. * target.h (Target::Target_info): New members isolate_execinstr and rosegment_gap. (Target::isolate_execinstr, Target::rosegment_gap): New methods. * arm.cc (Target_arm::arm_info): Update initializer. * i386.cc (Target_i386::i386_info): Likewise. * powerpc.cc (Target_powerpc::powerpc_info): Likewise. * sparc.cc (Target_sparc::sparc_info): Likewise. * x86_64.cc (Target_x86_64::x86_64_info): Likewise. * testsuite/testfile.cc (Target_test::test_target_info): Likewise. * layout.cc (Layout::attach_allocated_section_to_segment): Take new const Target* argument. If target->isolate_execinstr(), act like --rosegment. (Layout::find_first_load_seg): Take new const Target* argument; if target->isolate_execinstr(), reject PF_X segments. (Layout::relaxation_loop_body): Update caller. (Layout::set_segment_offsets): If target->isolate_execinstr(), reset file offset to zero when we hit LOAD_SEG, and then do a second loop over the segments before LOAD_SEG to reassign offsets after addresses have been determined. Handle target->rosegment_gap(). (Layout::attach_section_to_segment): Take new const Target* argument; pass it to attach_allocated_section_to_segment. (Layout::make_output_section): Update caller. (Layout::attach_sections_to_segments): Take new const Target* argument; pass it to attach_section_to_segment. * gold.cc (queue_middle_tasks): Update caller. * layout.h (Layout): Update method decls with new arguments. * arm.cc (Target_arm::Target_arm): Take optional argument for the Target_info pointer to use. (Target_arm::do_make_data_plt): New virtual method. (Target_arm::make_data_plt): New method that calls it. (Target_arm::make_plt_entry): Use it. (Output_data_plt_arm::Output_data_plt_arm): Take additional argument for the section alignment. (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual method. (Output_data_plt_arm::first_plt_entry_offset): Call it. (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual method. (Output_data_plt_arm::get_plt_entry_size): Call it. (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method. (Output_data_plt_arm::fill_plt_entry): New method that calls it. (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual method. (Output_data_plt_arm::fill_first_plt_entry): New method that calls it. (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size method instead of sizeof(plt_entry). (Output_data_plt_arm::add_entry): Likewise. Use first_plt_entry_offset method instead of sizeof(first_plt_entry). (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather than static method. (Target_arm::plt_entry_size): Likewise. (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry): Move to ... (Output_data_plt_arm_standard): ... here, new class. (Output_data_plt_arm::do_write): Move guts of PLT filling to... (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ... (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here. * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64): Take additional argument for the PLT entry size. (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Use get_plt_entry_size method rather than plt_entry_size variable. (Output_data_plt_x86_64::reserve_slot): Likewise. (Output_data_plt_x86_64::do_adjust_output_section): Likewise. (Output_data_plt_x86_64::add_entry): Likewise. (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise. (Output_data_plt_x86_64::address_for_global): Likewise. (Output_data_plt_x86_64::address_for_local): Likewise. (Output_data_plt_x86_64::set_final_data_size): Likewise. (Output_data_plt_x86_64::first_plt_entry_offset): Likewise. Make method non-static. (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual method. (Output_data_plt_x86_64::get_plt_entry_size): Just call that. (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method. (Output_data_plt_x86_64::add_eh_frame): New method to call it. (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract virtual method. (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it. (Output_data_plt_x86_64::do_fill_plt_entry): New abstract virtual method. (Output_data_plt_x86_64::fill_plt_entry): New method to call it. (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract virtual method. (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it. (Output_data_plt_x86_64::plt_entry_size) (Output_data_plt_x86_64::first_plt_entry) (Output_data_plt_x86_64::plt_entry) (Output_data_plt_x86_64::tlsdesc_plt_entry) (Output_data_plt_x86_64::plt_eh_frame_fde_size) (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ... (Output_data_plt_x86_64_standard): ... here, new class. (Target_x86_64::Target_x86_64): Take optional argument for the Target_info pointer to use. (Target_x86_64::do_make_data_plt): New virtual method. (Target_x86_64::make_data_plt): New method to call it. (Target_x86_64::init_got_plt_for_update): Use that. Call this->plt_->add_eh_frame method here. (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here. (Target_x86_64::first_plt_entry_offset): Call method on this->plt_ rather than static method. (Target_x86_64::plt_entry_size): Likewise. (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method rather than plt_entry_size variable. Move guts of PLT filling to... (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ... (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ... (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here. * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take additional argument for the section alignment. Don't do add_eh_frame_for_plt here. (Output_data_plt_i386::first_plt_entry_offset): Make the method non-static. Use get_plt_entry_size method rather than plt_entry_size variable. (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual method. (Output_data_plt_i386::get_plt_entry_size): Call it. (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method. (Output_data_plt_i386::add_eh_frame): New method to call it. (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual method. (Output_data_plt_i386::fill_first_plt_entry): New method to call it. (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual method. (Output_data_plt_i386::fill_plt_entry): New method to call it. (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size method instead of plt_entry_size. (Output_data_plt_i386::plt_entry_size) (Output_data_plt_i386::plt_eh_frame_fde_size) (Output_data_plt_i386::plt_eh_frame_fde): Move to ... (Output_data_plt_i386_standard): ... here, new class. (Output_data_plt_i386_exec): New class. (Output_data_plt_i386::exec_first_plt_entry): Move to ... (Output_data_plt_i386_exec::first_plt_entry): ... here. (Output_data_plt_i386::exec_plt_entry): Move to ... (Output_data_plt_i386_exec::plt_entry): ... here. (Output_data_plt_i386_dyn): New class. (Output_data_plt_i386::first_plt_entry): Move to ... (Output_data_plt_i386_dyn::first_plt_entry): ... here. (Output_data_plt_i386::dyn_plt_entry): Move to ... (Output_data_plt_i386_dyn::plt_entry): ... here. (Target_i386::Target_i386): Take optional argument for the Target_info pointer to use. (Target_i386::do_make_data_plt): New virtual method. (Target_i386::make_data_plt): New method to call it. (Target_i386::make_plt_section): Use that. Call this->plt_->add_eh_frame method here. (Output_data_plt_i386::add_entry): Use get_plt_entry_size method rather than plt_entry_size variable. (Output_data_plt_i386::add_local_ifunc_entry): Likewise. (Output_data_plt_i386::address_for_local): Likewise. (Output_data_plt_i386::do_write): Likewise. Move guts of PLT filling to... (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ... (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ... (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ... (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here. Change-Id: Id24b95600489835ff5e860a39c147203d4380c2b --- ChangeLog | 7 ++++++- configure | 2 +- configure.ac | 46 +++++++++++++++++++++++----------------------- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4e8d13ed1..0dc7a324a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-05-02 Roland McGrath + + * configure.ac (ENABLE_GOLD): Consider *-*-nacl* targets ELF. + * configure: Regenerate. + 2012-04-25 Joel Brobecker * config.sub: Update to 2012-04-18 version from official repo. @@ -586,7 +591,7 @@ * config.guess: Update to version 2011-02-02 * config.sub: Update to version 2011-02-24 - + 2011-03-03 Sebastian Pop * configure.ac: Adjust test of with_ppl. diff --git a/configure b/configure index 2fee66b16..8554178f8 100755 --- a/configure +++ b/configure @@ -2869,7 +2869,7 @@ case "${ENABLE_GOLD}" in *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \ | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \ - | *-*-solaris2* | *-*-nto*) + | *-*-solaris2* | *-*-nto* | *-*-nacl*) case "${target}" in *-*-linux*aout* | *-*-linux*oldld*) ;; diff --git a/configure.ac b/configure.ac index c2795874c..396c87b95 100644 --- a/configure.ac +++ b/configure.ac @@ -112,11 +112,11 @@ extra_host_args= ### or a host dependent tool. Then put it into the appropriate list ### (library or tools, host or target), doing a dependency sort. -# Subdirs will be configured in the order listed in build_configdirs, +# Subdirs will be configured in the order listed in build_configdirs, # configdirs, or target_configdirs; see the serialization section below. -# Dependency sorting is only needed when *configuration* must be done in -# a particular order. In all cases a dependency should be specified in +# Dependency sorting is only needed when *configuration* must be done in +# a particular order. In all cases a dependency should be specified in # the Makefile, whether or not it's implicitly specified here. # Double entries in build_configdirs, configdirs, or target_configdirs may @@ -209,7 +209,7 @@ if test x"${host}" = x"${target}" ; then is_cross_compiler=no else is_cross_compiler=yes -fi +fi # Find the build and target subdir names. GCC_TOPLEV_SUBDIRS @@ -245,7 +245,7 @@ if test x$with_system_zlib = xyes ; then noconfigdirs="$noconfigdirs zlib" fi -# some tools are so dependent upon X11 that if we're not building with X, +# some tools are so dependent upon X11 that if we're not building with X, # it's not even worth trying to configure, much less build, that tool. case ${with_x} in @@ -253,7 +253,7 @@ case ${with_x} in no) skipdirs="${skipdirs} tk itcl libgui" # We won't be able to build gdbtk without X. - enable_gdbtk=no + enable_gdbtk=no ;; *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;; esac @@ -313,7 +313,7 @@ case "${ENABLE_GOLD}" in *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \ | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \ - | *-*-solaris2* | *-*-nto*) + | *-*-solaris2* | *-*-nto* | *-*-nacl*) case "${target}" in *-*-linux*aout* | *-*-linux*oldld*) ;; @@ -379,7 +379,7 @@ esac # Only spaces may be used in this macro; not newlines or tabs. unsupported_languages= -# Remove more programs from consideration, based on the host or +# Remove more programs from consideration, based on the host or # target this usually means that a port of the program doesn't # exist yet. @@ -689,7 +689,7 @@ case "${target}" in ;; *-*-lynxos*) noconfigdirs="$noconfigdirs ${libgcj}" - ;; + ;; esac # Default libgloss CPU subdirectory. @@ -774,7 +774,7 @@ case "${target}" in ;; *-*-lynxos*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; + ;; *-*-mingw*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; @@ -1078,7 +1078,7 @@ case "${host}" in hppa*-hp-hpux*) host_makefile_frag="config/mh-pa" ;; - hppa*-*) + hppa*-*) host_makefile_frag="config/mh-pa" ;; *-*-darwin*) @@ -1774,7 +1774,7 @@ if test -d ${srcdir}/gcc; then # an apparent bug in bash 1.12 on linux. ${srcdir}/gcc/[[*]]/config-lang.in) ;; *) - # From the config-lang.in, get $language, $target_libs, + # From the config-lang.in, get $language, $target_libs, # $lang_dirs, $boot_language, and $build_by_default language= target_libs= @@ -2019,7 +2019,7 @@ done build_configdirs_all="$build_configdirs" build_configdirs= for i in ${build_configdirs_all} ; do - j=`echo $i | sed -e s/build-//g` + j=`echo $i | sed -e s/build-//g` if test -f ${srcdir}/$j/configure ; then build_configdirs="${build_configdirs} $i" fi @@ -2036,7 +2036,7 @@ done target_configdirs_all="$target_configdirs" target_configdirs= for i in ${target_configdirs_all} ; do - j=`echo $i | sed -e s/target-//g` + j=`echo $i | sed -e s/target-//g` if test -f ${srcdir}/$j/configure ; then target_configdirs="${target_configdirs} $i" fi @@ -2087,7 +2087,7 @@ ACX_TOOL_DIRS copy_dirs= -AC_ARG_WITH([build-sysroot], +AC_ARG_WITH([build-sysroot], [AS_HELP_STRING([--with-build-sysroot=SYSROOT], [use sysroot as the system root during the build])], [if test x"$withval" != x ; then @@ -2178,11 +2178,11 @@ fi # This is done by determining whether or not the appropriate directory # is available, and by checking whether or not specific configurations # have requested that this magic not happen. -# -# The command line options always override the explicit settings in +# +# The command line options always override the explicit settings in # configure.in, and the settings in configure.in override this magic. # -# If the default for a toolchain is to use GNU as and ld, and you don't +# If the default for a toolchain is to use GNU as and ld, and you don't # want to do that, then you should use the --without-gnu-as and # --without-gnu-ld options for the configure script. Similarly, if # the default is to use the included zlib and you don't want to do that, @@ -2283,7 +2283,7 @@ case "${target}" in target_makefile_frag="config/mt-gnu" ;; *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*) - # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm + # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm # commands to handle both 32-bit and 64-bit objects. These flags are # harmless if we're using GNU nm or ar. extra_arflags_for_target=" -X32_64" @@ -2357,7 +2357,7 @@ if test $? = 0 ; then if test -s conftest || test -s conftest.exe ; then we_are_ok=yes fi -fi +fi case $we_are_ok in no) echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed." @@ -2727,7 +2727,7 @@ baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'` # --program-suffix have been applied to it. Autoconf has already # doubled dollar signs and backslashes in program_transform_name; we want # the backslashes un-doubled, and then the entire thing wrapped in single -# quotes, because this will be expanded first by make and then by the shell. +# quotes, because this will be expanded first by make and then by the shell. # Also, because we want to override the logic in subdir configure scripts to # choose program_transform_name, replace any s,x,x, with s,y,y,. sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" < conftestsed.out @@ -3052,7 +3052,7 @@ AC_SUBST(CFLAGS) AC_SUBST(CXXFLAGS) # Target tools. -AC_ARG_WITH([build-time-tools], +AC_ARG_WITH([build-time-tools], [AS_HELP_STRING([--with-build-time-tools=PATH], [use given path to find target tools during the build])], [case x"$withval" in @@ -3157,7 +3157,7 @@ if test "$USE_MAINTAINER_MODE" = yes; then else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= -fi +fi MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl