old-cross-binutils/gold
Vladimir Radosavljevic 47a9f4fcab Add MIPS-64 support.
gold/
	* mips.cc (enum Special_relocation_symbol): New enum type.
	(is_readonly_section): New function.
	(eh_reloc): Likewise.
	(Mips_got_entry::is_section_symbol_): New member.
	(Mips_got_entry::is_section_symbol): New method.
	(Mips_got_info::record_local_got_symbol): Add is_section_symbol
	argument.
	(Mips_relobj::mips_elf_options_section_name): New method.
	(Mips_output_data_got::record_local_got_symbol): Add
	is_section_symbol argument, and pass it to
	Mips_got_info::record_local_got_symbol.
	(Mips_output_data_got::got_offset): Add addend argument, and pass
	it to Relobj::local_got_offset.
	(struct Mips_output_reloc_writer): New type.
	(class Mips_output_data_reloc): New class.
	(Mips_output_data_plt::Reloc_section): Change type to
	Mips_output_data_reloc.
	(Target_mips::Reloc_section): Likewise.
	(Mips_reloc_types::get_r_addend): Remove unsigned from return type.
	(Mips_classify_reloc::get_r_type2): New method.
	(Mips_classify_reloc::get_r_type3): Likewise.
	(Mips_classify_reloc::get_r_ssym): Likewise.
	(Target_mips::Reloca_section): Remove.
	(Relocate::should_apply_static_reloc): Rename from
	should_apply_r_mips_32_reloc.
	(Target_mips::copy_reloc): Replace Reltype parameter with r_type
	and r_offset.
	(Mips_relocate_functions::Valtype): New type.
	(Mips_relocate_functions::Valtype64): New type.
	(Mips_relocate_functions::check_overflow): New method.
	(Mips_relocate_functions::mips_reloc_unshuffle): Move to public
	interface.
	(Mips_relocate_functions::mips_reloc_shuffle): Likewise.
	(Mips_relocate_functions::rel16): Add support for resolving
	relocations for Mips64.
	(Mips_relocate_functions::rel32): Likewise.
	(Mips_relocate_functions::reljalr): Likewise.
	(Mips_relocate_functions::relpc32): Likewise.
	(Mips_relocate_functions::rel26): Likewise.
	(Mips_relocate_functions::relpc16): Likewise.
	(Mips_relocate_functions::relmicromips_pc7_s1): Likewise.
	(Mips_relocate_functions::relmicromips_pc10_s1): Likewise.
	(Mips_relocate_functions::relmicromips_pc16_s1): Likewise.
	(Mips_relocate_functions::do_relhi16): Likewise.
	(Mips_relocate_functions::do_relgot16_local): Likewise.
	(Mips_relocate_functions::rello16): Likewise.
	(Mips_relocate_functions::relgot): Likewise.
	(Mips_relocate_functions::relgotpage): Likewise.
	(Mips_relocate_functions::relgotofst): Likewise.
	(Mips_relocate_functions::relgot_hi16): Likewise.
	(Mips_relocate_functions::relgot_lo16): Likewise.
	(Mips_relocate_functions::relgprel): Likewise.
	(Mips_relocate_functions::relgprel32): Likewise.
	(Mips_relocate_functions::tlsrelhi16): Likewise.
	(Mips_relocate_functions::tlsrello16): Likewise.
	(Mips_relocate_functions::tlsrel32): Likewise.
	(Mips_relocate_functions::relsub): Likewise.
	(Mips_relocate_functions::releh): New method.
	(Mips_relocate_functions::rel64): Likewise.
	(Mips_got_info::record_local_got_symbol): Add is_section_symbol and
	pass it to Mips_got_entry.
	(Mips_got_info::add_local_entries): Pass addend argument
	to code functions, and for STT_SECTION symbols call
	add_symbolless_local_addend.
	(Mips_got_info::add_tls_entries): Pass addend argument to code
	functions.
	(Mips_relobj::do_read_symbols): Read gp value that was used to
	create object.
	(Mips_output_data_plt::plt_entry): Remove opcode from l[wd]
	instruction. Opcode for instruction will be selected later.
	(Target_mips::gc_process_relocs): Add case for SHT_RELA.
	(Target_mips::scan_relocatable_relocs): Likewise.
	(Target_mips::emit_relocs_scan): Likewise.
	(Target_mips::relocate_relocs): Likewise.
	(Target_mips::do_finalize_sections): Skip objects for merging
	processor specific flags in which all input sections will be
	discarded.
	(mips_get_size_for_reloc): Add case for R_MIPS_EH.
	(Target_mips::Scan::get_reference_flags): Likewise.
	(Target_mips::relocate_special_relocatable): Call rel26 method with
	calculate_only and calculated_value arguments.
	(Target_mips::Scan::local): Add case for R_MIPS_EH. Don't create a
	dynamic relocation against a readonly sections, and pass
	is_section_symbol to Mips_got_info::record_local_got_symbol.
	(Target_mips::Scan::global): Add case for R_MIPS_EH. Don't create a
	dynamic relocation against a readonly sections, and pass r_type
	and r_offset to Target_mips::copy_reloc.
	(Target_mips::Relocate::relocate): Add support for resolving
	relocations for Mips64.
	(Target_mips::mips_info): Add case for Mips64 default dynamic
	linker name.
	(Target_selector_mips): Correct emulation names.
2016-03-17 15:07:49 -07:00
..
po Copyright update for binutils 2016-01-01 23:00:01 +10:30
testsuite Workaround a C++ bug in GCC 4.2 in gold test 2016-03-09 08:32:46 -08:00
aarch64-reloc-property.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
aarch64-reloc-property.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
aarch64-reloc.def Copyright update for binutils 2016-01-01 23:00:01 +10:30
aarch64.cc Remove info message for every erratum 843419 found and fixed. 2016-02-11 09:47:49 -08:00
aclocal.m4
archive.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
archive.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
arm-reloc-property.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
arm-reloc-property.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
arm-reloc.def Copyright update for binutils 2016-01-01 23:00:01 +10:30
arm.cc Add unused attribute where necessary to quiet GCC 6 warnings. 2016-03-08 20:34:18 -08:00
attributes.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
attributes.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
binary.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
binary.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
ChangeLog Add MIPS-64 support. 2016-03-17 15:07:49 -07:00
ChangeLog-0815 binutils ChangeLog rotation 2016-01-01 22:59:17 +10:30
common.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
common.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
compressed_output.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
compressed_output.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
config.in
configure Add s390 backend. 2015-10-28 16:47:27 -07:00
configure.ac Copyright update for binutils 2016-01-01 23:00:01 +10:30
configure.tgt Copyright update for binutils 2016-01-01 23:00:01 +10:30
copy-relocs.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
copy-relocs.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
cref.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
cref.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
debug.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
defstd.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
defstd.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
descriptors.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
descriptors.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
dirsearch.cc Add unused attribute where necessary to quiet GCC 6 warnings. 2016-03-08 20:34:18 -08:00
dirsearch.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
dwarf_reader.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
dwarf_reader.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
dwp.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
dwp.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
dynobj.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
dynobj.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
ehframe.cc Discard FDEs for zero-length address ranges. 2016-02-26 07:53:20 -08:00
ehframe.h Discard FDEs for zero-length address ranges. 2016-02-26 07:53:20 -08:00
errors.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
errors.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
expression.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
ffsll.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
fileread.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
fileread.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
freebsd.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
ftruncate.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
gc.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
gc.h Refactor gold to enable support for MIPS-64 relocation format. 2016-01-11 18:51:18 -08:00
gdb-index.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
gdb-index.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
gold-threads.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
gold-threads.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
gold.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
gold.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
i386.cc gold: Add view and view_size parameters to is_call_to_non_split. 2016-02-06 01:52:00 +01:00
icf.cc 2016-02-05 Sriraman Tallam <tmsriram@google.com> 2016-02-05 15:07:45 -08:00
icf.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
incremental-dump.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
incremental.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
incremental.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
int_encoding.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
int_encoding.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
layout.cc Add support for STT_SPARC_REGISTER symbols. 2016-03-03 18:19:53 -08:00
layout.h Add support for STT_SPARC_REGISTER symbols. 2016-03-03 18:19:53 -08:00
main.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
Makefile.am Copyright update for binutils 2016-01-01 23:00:01 +10:30
Makefile.in Copyright update for binutils 2016-01-01 23:00:01 +10:30
mapfile.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
mapfile.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
merge.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
merge.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
mips.cc Add MIPS-64 support. 2016-03-17 15:07:49 -07:00
mremap.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
nacl.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
nacl.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
NEWS Copyright update for binutils 2016-01-01 23:00:01 +10:30
object.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
object.h Refactor gold to enable support for MIPS-64 relocation format. 2016-01-11 18:51:18 -08:00
options.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
options.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
output.cc Refactor Output_data_reloc_base::do_write for MIPS-specific relocs. 2016-03-08 15:06:59 -08:00
output.h Refactor Output_data_reloc_base::do_write for MIPS-specific relocs. 2016-03-08 15:06:59 -08:00
parameters.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
parameters.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
plugin.cc Don't handle every plugin symbol as defined. 2016-03-03 15:16:52 -05:00
plugin.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
powerpc.cc Fix "PowerPC64 ELFv2 entry code" for big-endian 2016-02-04 00:31:14 +10:30
pread.c Copyright update for binutils 2016-01-01 23:00:01 +10:30
README Copyright update for binutils 2016-01-01 23:00:01 +10:30
readsyms.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
readsyms.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
reduced_debug_output.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
reduced_debug_output.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
reloc-types.h Refactor gold to enable support for MIPS-64 relocation format. 2016-01-11 18:51:18 -08:00
reloc.cc gold: Add view and view_size parameters to is_call_to_non_split. 2016-02-06 01:52:00 +01:00
reloc.h Fix compile errors about shift counts too large. 2016-02-06 18:19:13 -08:00
resolve.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
s390.cc gold: Add s390 -fsplit-stack support. 2016-02-15 11:59:25 +01:00
script-c.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
script-sections.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
script-sections.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
script.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
script.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
sparc.cc Add support for STT_SPARC_REGISTER symbols. 2016-03-03 18:19:53 -08:00
stringpool.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
stringpool.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
symtab.cc Fix undefined symbol errors introduced with previous commit. 2016-03-04 08:13:35 -08:00
symtab.h Add support for STT_SPARC_REGISTER symbols. 2016-03-03 18:19:53 -08:00
system.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
target-reloc.h Refactor gold to enable support for MIPS-64 relocation format. 2016-01-11 18:51:18 -08:00
target-select.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
target-select.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
target.cc gold: Add view and view_size parameters to is_call_to_non_split. 2016-02-06 01:52:00 +01:00
target.h Add support for STT_SPARC_REGISTER symbols. 2016-03-03 18:19:53 -08:00
tilegx.cc Refactor gold to enable support for MIPS-64 relocation format. 2016-01-11 18:51:18 -08:00
timer.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
timer.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tls.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
TODO
token.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
version.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
workqueue-internal.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
workqueue-threads.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
workqueue.cc Copyright update for binutils 2016-01-01 23:00:01 +10:30
workqueue.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
x86_64.cc Add additional information to relocation overflow errors. 2016-02-07 10:17:01 -08:00
yyscript.y Copyright update for binutils 2016-01-01 23:00:01 +10:30

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

gold is an ELF linker.  It is intended to have complete support for
ELF and to run as fast as possible on modern systems.  For normal use
it is a drop-in replacement for the older GNU linker.

gold is part of the GNU binutils.  See ../binutils/README for more
general notes, including where to send bug reports.

gold was originally developed at Google, and was contributed to the
Free Software Foundation in March 2008.  At Google it was designed by
Ian Lance Taylor, with major contributions by Cary Coutant, Craig
Silverstein, and Andrew Chatham.

The existing GNU linker manual is intended to be accurate
documentation for features which gold supports.  gold supports most of
the features of the GNU linker for ELF targets.  Notable
omissions--features of the GNU linker not currently supported in
gold--are:
  * MRI compatible linker scripts
  * cross-reference reports (--cref)
  * various other minor options


Notes on the code
=================

These are some notes which may be helpful to people working on the
source code of gold itself.

gold is written in C++.  It is a GNU program, and therefore follows
the GNU formatting standards as modified for C++.  Source documents in
order of decreasing precedence:
    http://www.gnu.org/prep/standards/
    http://gcc.gnu.org/onlinedocs/libstdc++/manual/source_code_style.html
    http://www.zembu.com/eng/procs/c++style.html

The linker is intended to have complete support for cross-compilation,
while still supporting the normal case of native linking as fast as
possible.  In order to do this, many classes are actually templates
whose parameter is the ELF file class (e.g., 32 bits or 64 bits).  The
C++ code is the same, but we don't pay the execution time cost of
always using 64-bit integers if the target is 32 bits.  Many of these
class templates also have an endianness parameter: true for
big-endian, false for little-endian.

The linker is multi-threaded.  The Task class represents a single unit
of work.  Task objects are stored on a single Workqueue object.  Tasks
communicate via Task_token objects.  Task_token objects are only
manipulated while holding the master Workqueue lock.  Relatively few
mutexes are used.


Build requirements
==================

The gold source code uses templates heavily.  Building it requires a
recent version of g++.  g++ 4.0.3 and 4.1.3 are known to work.  g++
3.2, 3.4.3, and 4.1.2 are known to fail.

The linker script parser uses features which are only in newer
versions of bison.  bison 2.3 is known to work.  bison 1.26 is known
to fail.  If you are building gold from an official binutils release,
the bison output should already be included.


Copyright (C) 2012-2016 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.