Initial patch to enable gold aarch64 backend.
This patch is just a skeleton which almost does nothing.
It does not support ILP32 now.
gold/ChangeLog:
* aarch64.cc: New file
* Makefile.am (TARGETSOURCES): Add aarch64.cc
(ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
* Makefile.in: Regenerate.
* configure.tgt: Add entries for aarch64*.
* configure.ac: Likewise.
* configure: Likewise.
elfcpp/ChangeLog:
* aarch64.h: New file. New enums for aarch64-elf64 relocations.
* elfcpp.h (EM_AARCH64, SHT_AARCH64_ATTRIBUTES, PT_AARCH64_ARCHEXT,
PT_AARCH64_UNWIND): New enum constant.
The goal of this patch is to provide an easy way to make
--disable-werror the default when building binutils, or the parts
of binutils that need to get built when building GDB. In development
mode, we want to continue making -Werror the default with GCC.
But, when making releases, I think we want to make it as easy as
possible for regular users to successfully build from sources.
GDB already has this kind of feature to turn -Werror as well as
the use of the libmcheck library. As GDB Release Manager, I take
advantage of it to turn those off after having cut the branch.
I'd like to be able to do the same for the binutils bits. And
perhaps Tristan will want to do the same for his releases too
(not sure, binutils builders might be a little savvier than GDB
builders).
This patch introduces a new file, called development.sh, which
just sets a variable called $development. In our development branches
(Eg. "master"), it's set to true. But setting it to false would allow
us to change the default behavior of various development-related
features to be turned off; in this case, it turns off the use of
-Werror by default (use --enable-werror to turn it back on).
bfd/ChangeLog:
* development.sh: New file.
* warning.m4 (AM_BINUTILS_WARNINGS): Source bfd/development.sh.
Make -Werror the default with GCC only if DEVELOPMENT is true.
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add
$(srcdir)/development.sh.
* Makefile.in, configure: Regenerate.
binutils/ChangeLog:
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
bfd's development.sh.
* Makefile.in, configure: Regenerate.
gas/ChangeLog:
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
bfd's development.sh.
* Makefile.in, configure: Regenerate.
gold/ChangeLog:
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
* Makefile.in, configure: Regenerate.
gprof/ChangeLog:
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
bfd's development.sh.
* Makefile.in, configure: Regenerate.
ld/ChangeLog:
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
bfd's development.sh.
* Makefile.in, configure: Regenerate.
opcodes/ChangeLog:
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
bfd's development.sh.
* Makefile.in, configure: Regenerate.
gdb/ChangeLog:
* development.sh: Delete.
* Makefile.in (config.status): Adjust dependency on development.sh.
* configure.ac: Adjust development.sh source call.
* configure: Regenerate.
gdb/gdbserver/ChangeLog:
* configure.ac: Adjust development.sh source call.
* Makefile.in (config.status): Adjust dependency on development.sh.
* configure: Regenerate.
Tested on x86_64-linux by building two ways: One with DEVELOPMENT
set to true, and one with DEVELOPMENT set to false. In the first
case, I could see the use of -Werror, while it disappeared in
the second case.
GCC 4.8 now adds linker plugin options by default, which conflict with the
--incremental tests in the testsuite. This patch checks whether the compiler
supports the -fno-use-linker-plugin option, and adds it to all link
commands.
2014-04-02 Cary Coutant <ccoutant@google.com>
* configure.ac (HAVE_PUBNAMES): Use C instead of C++.
(HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
* configure: Regenerate.
* testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
-fno-use-linker-plugin.
(LINK1, CXXLINK1): Add it to the link command.
* testsuite/Makefile.in: Regenerate.
gold/
* configure.ac: Check for <unordered_set> and <unordered_map>.
* config.in: Regenerate.
* configure: Regenerate.
* system.h: Use <unordered_set> and <unordered_map> if available.
PR gold/14897
* configure.ac (--enable-ld): Removed.
(install_as_default): Set to yes only for --enable-gold=default
or --disable-ld.
* configure: Regenerated.
PR gold/14344
* configure.ac: Add check for -gpubnames support.
* configure: Regenerate.
* testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
support; force -gno-pubnames.
(gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
support.
(gdb_index_test_4): New test.
* testsuite/Makefile.in: Regenerate.
* testsuite/gdb_index_test_1.sh: Refactor code into common file.
* testsuite/gdb_index_test_2.sh: Likewise.
* testsuite/gdb_index_test_3.sh: Don't look for space after colon.
* testsuite/gdb_index_test_4.sh: New script.
* testsuite/gdb_index_test_comm.sh: New script with common code;
don't look for space after colon.
NATIVE_LINKER.
* Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
* options.cc (General_options::finalize): Use library search path
from configure script if specified. If not native and no sysroot,
only search TOOLLIBDIR.
* options.h (Search_directory::Search_directory): Change name to
const std::string&.
(General_options::add_to_library_path_with_sysroot): Change arg to
const std::string&.
* configure, Makefile.in, config.in: Rebuild.
* configure.ac: Test whether static linking works, setting
the automake conditional HAVE_STATIC.
* testsuite/Makefile.am: Disable tests using -static if
HAVE_STATIC is not true.
* configure, testsuite/Makefile.in: Rebuild.
* 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.
with MREMAP_MAYMOVE.
* output.h (class Output_file): Add map_is_allocated_ field.
* output.cc: Only #include <sys/mman.h> if it exists. If mmap is
not available, provide stubs. If mremap is not available, #define
it to gold_mremap.
(MREMAP_MAYMOVE): Define if not defined.
(Output_file::Output_file): Initialize map_is_allocated_.
(Output_file::resize): Check map_is_allocated_.
(Output_file::map_anonymous): If mmap fails, use malloc.
(Output_file::unmap): Don't do anything for an anonymous map.
* fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
is not available, provide stubs.
(File_read::View::~View): Use free rather than delete[].
(File_read::make_view): Use malloc rather than new[]. If mmap
fails, use malloc.
(File_read::find_or_make_view): Use malloc rather than new[].
* gold.h: Remove HAVE_REMAP code.
* mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
exists. Rename mremap to gold_mremap. If mmap is not available
don't do anything.
* configure, config.in: Rebuild.
`both*'. New configure option --{en,dis}able-ld.
ld, gold/
* configure.ac: For --enable-gold, handle value `default' instead of
`both*'. Always install ld as ld.gold, install as ld if gold is
the default.
* i386.cc (class Output_data_plt_i386): Update declarations.
Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
local_ifuncs_ fields.
(Target_i386::do_plt_section_for_global): New function.
(Target_i386::do_plt_section_for_local): New function.
(Output_data_plt_i386::Output_data_plt_i386): Add symtab
parameter; change all callers. Initialize global_ifuncs_ and
local_ifuncs_. If doing a static link define __rel_iplt_start and
__rel_iplt_end.
(Output_data_plt_i386::add_entry): Handle IFUNC symbols.
(Output_data_plt_i386::add_local_ifunc_entry): New function.
(Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
symbols.
(Target_i386::make_plt_section): New function, broken out of
make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
(Target_i386::make_plt_entry): Call make_plt_section.
(Target_i386::make_local_ifunc_plt_entry): New function.
(Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
(Target_i386::Scan::local): Handle IFUNC symbols. Add
R_386_IRELATIVE to switch.
(Target_i386::Scan::global): Likewise.
(Target_i386::Relocate::relocate): Likewise.
(Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
switch.
* x86_64.cc (class Output_data_plt_x86_64): Update declarations.
(Target_x86_64::do_plt_section_for_global): New function.
(Target_x86_64::do_plt_section_for_local): New function.
(Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
parameter; change all callers. If doing a static link define
__rela_iplt_start and __rela_iplt_end.
(Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
(Output_data_plt_x86_64::add_local_ifunc_entry): New function.
(Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
to point to .plt.
(Target_x86_64::make_local_ifunc_plt_entry): New function.
(Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
switch.
(Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
(Target_x86_64::Scan::local): Handle IFUNC symbols. Add
R_X86_64_IRELATIVE to switch.
(Target_x86_64::Scan::global): Likewise.
(Target_x86_64::Relocate::relocate): Likewise.
(Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
switch.
* target.h (class Target): Add plt_section_for_global and
plt_section_for_local functions. Add do_plt_section_for_global
and do_plt_section_for_local virtual functions.
* symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
clarifying comments.
(Symbol::use_plt_offset): Handle IFUNC symbol.
* object.cc (Sized_relobj::Sized_relobj): Initialize
local_plt_offsets_.
(Sized_relobj::local_has_plt_offset): New function.
(Sized_relobj::local_plt_offset): New function.
(Sized_relobj::set_local_plt_offset): New function.
(Sized_relobj::do_count): Handle IFUNC symbol.
* object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
a bit away from input_shndx_ field. Add set_is_func_symbol and
is_ifunc_symbol functions.
(class Sized_relobj): Update declarations. Remove Tls_got_entry
and Local_tls_got_offsets. Define Local_plt_offsets. Add
local_plt_offsets_ field.
(Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
* output.h (class Output_section_data): Add non-const
output_section function.
(class Output_data_got): Update declarations.
(class Output_data_got::Got_entry): Add use_plt_offset_ field.
Add use_plt_offset parameter to global and local constructors.
Change all callers. Change local_sym_index_ field to 31 bits.
Change GSYM_CODE and CONSTANT_CODE accordingly.
* output.cc (Output_data_reloc_base::do_adjust_output_section): If
doing a static link don't set sh_link field.
(Output_data_got::Got_entry::write): Use PLT offset if
appropriate.
(Output_data_got::add_global_plt): New function.
(Output_data_got::add_local_plt): New function.
* target-reloc.h (relocate_section): Handle IFUNC symbol.
* defstd.cc (in_section): Remove entries for __rel_iplt_start,
__rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
* configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
* testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
IFUNC conditional.
* testsuite/ifunc-sel.h: New file.
* testsuite/ifuncmain1.c: New file.
* testsuite/ifuncmain1vis.c: New file.
* testsuite/ifuncmod1.c: New file.
* testsuite/ifuncdep2.c: New file.
* testsuite/ifuncmain2.c: New file.
* testsuite/ifuncmain3.c: New file.
* testsuite/ifuncmod3.c: New file.
* testsuite/ifuncmain4.c: New file.
* testsuite/ifuncmain5.c: New file.
* testsuite/ifuncmod5.c: New file.
* testsuite/ifuncmain6pie.c: New file.
* testsuite/ifuncmod6.c: New file.
* testsuite/ifuncmain7.c: New file.
* configure, testsuite/Makefile.in: Rebuild.
* configure.ac (install_as_default): Define and set to false
unless --enable-gold or --enable-gold=both/gold has been
specified.
* configure: Regenerate.
* Makefile.am (install-exec-local): Install the executable as
'ld.gold'. If install_as_default is true then also install it as
'ld'.
* Makefile.in: Regenerated.
ld:
* configure.in (install_as_default): Define and set to true
unless --enable-gold=both/gold has been specified.
* configure: Regenerate.
* Makefile.am (transform): Use ld.bfd as the default name of
the linker.
(install-exec-local): Also install the executable as a binary
named 'ld' if install_as_default is true.
* Makefile.in: Regenerate.
PR 11247
* arm-reloc-property.cc (cstdio): Include.
* configure.ac (targetobjs): Remove duplicates.
* configure: Regenerate.
* resolve.cc (Symbol_table::resolve): Explicit instantiate both
big and little endian version for a given address size.