summaryrefslogtreecommitdiff
path: root/gold/output.cc
Commit message (Collapse)AuthorAgeFilesLines
* * output.cc (Output_reloc<SHT_REL>::local_section_offset): AddIan Lance Taylor2008-04-071-6/+15
| | | | | | | | | | | | | | addend parameter. Change caller. Handle merge sections. (Output_reloc<SHT_REL>::symbol_value): Change parameter type from Address to Addend. Don't add in the result of local_section_offset, pass down the addend and use the returned value. * output.h (class Output_reloc<SHT_REL>): Add Addend typedef. Update declarations of local_section_offset and symbol_value. * testsuite/two_file_test_1.cc (t18): New function. * testsuite/two_file_test_2.cc (f18): New function. * testsuite/two_file_test_main.cc (main): Call t18. * testsuite/two_file_test.h (t18, f18): Declare.
* * output.ccIan Lance Taylor2008-03-291-61/+34
| | | | | | | | | | | | | | | | | | | | (Output_section::Input_section_sort_entry::has_priority): New function. (Output_section::Input_section_sort_entry::match_file_name): New function. (Output_section::Input_section_sort_entry::match_section_name): Remove. (Output_section::Input_section_sort_entry::match_section_name_prefix): Remove. (Output_section::Input_section_sort_entry::match_section_file): Remove. (Output_section::Input_section_sort_compare::operator()): Rewrite using new Input_section_sort_entry functions. Sort crtbegin and crtend first. Sort sections with no priority before sections with a priority. * testsuite/initpri1.c (d3): Check j != 4. (cd5): New constructor/destructor function. (main): Check j != 2.
* * layout.cc (Layout::layout): If we see an input section with aIan Lance Taylor2008-03-281-2/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* PR gold/5986Ian Lance Taylor2008-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Fix problems building gold with gcc 4.3.0. * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define. (gold_error_at_location, gold_warning_at_location): Use it. * configure.ac: Check whether we can compile and use a template function with a printf attribute. * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value when jumping over bytes. * object.cc: Instantiate Object::read_section_data. * debug.h: Include <cstring> * dwarf_reader.cc: Include <algorithm> * main.cc: Include <cstring>. * options.cc: Include <cstring>. * output.cc: Include <cstring>. * script.cc: Include <cstring>. * script.h: Include <string>. * symtab.cc: Include <cstring> and <algorithm>. * target-select.cc: Include <cstring>. * version.cc: Include <string>. * testsuite/testmain.cc: Include <cstdlib>. * configure, config.in: Rebuild.
* * i386.cc (Target_i386::Got_type): New enum declaration.Cary Coutant2008-03-251-162/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Target_i386::Scan::local): Updated callers of Output_data_got member functions. (Target_i386::Scan::global): Likewise. (Target_i386::Relocate::relocate): Likewise. (Target_i386::Relocate::relocate_tls): Likewise. * object.h (Got_offset_list): New class. (Sized_relobj::local_has_got_offset): Added got_type parameter. (Sized_relobj::local_got_offset): Likewise. (Sized_relobj::set_local_got_offset): Likewise. (Sized_relobj::local_has_tls_got_offset): Removed. (Sized_relobj::local_tls_got_offset): Removed. (Sized_relobj::set_local_tls_got_offset): Removed. (Sized_relobj::Local_got_offsets): Changed to store a list of offsets. * output.cc (Output_data_got::add_global): Added got_type parameter. (Output_data_got::add_global_with_rel): Likewise. (Output_data_got::add_global_with_rela): Likewise. (Output_data_got::add_global_pair_with_rel): New function. (Output_data_got::add_global_pair_with_rela): New function. (Output_data_got::add_local): Added got_type parameter. (Output_data_got::add_local_with_rel): Likewise. (Output_data_got::add_local_with_rela): Likewise. (Output_data_got::add_local_pair_with_rel): New function. (Output_data_got::add_local_pair_with_rela): New function. (Output_data_got::add_global_tls): Removed. (Output_data_got::add_global_tls_with_rel): Removed. (Output_data_got::add_global_tls_with_rela): Removed. (Output_data_got::add_local_tls): Removed. (Output_data_got::add_local_tls_with_rel): Removed. (Output_data_got::add_local_tls_with_rela): Removed. * output.h (Output_data_got::add_global): Added got_type parameter. (Output_data_got::add_global_with_rel): Likewise. (Output_data_got::add_global_with_rela): Likewise. (Output_data_got::add_global_pair_with_rel): New function. (Output_data_got::add_global_pair_with_rela): New function. (Output_data_got::add_local): Added got_type parameter. (Output_data_got::add_local_with_rel): Likewise. (Output_data_got::add_local_with_rela): Likewise. (Output_data_got::add_local_pair_with_rel): New function. (Output_data_got::add_local_pair_with_rela): New function. (Output_data_got::add_global_tls): Removed. (Output_data_got::add_global_tls_with_rel): Removed. (Output_data_got::add_global_tls_with_rela): Removed. (Output_data_got::add_local_tls): Removed. (Output_data_got::add_local_tls_with_rel): Removed. (Output_data_got::add_local_tls_with_rela): Removed. * resolve.cc (Symbol::override_base_with_special): Removed reference to has_got_offset_ field. * symtab.cc (Symbol::init_fields): Replaced initialization of got_offset_ with got_offsets_. Removed initialization of has_got_offset_ *symtab.h (Symbol::has_got_offset): Aded got_type parameter. (Symbol::got_offset): Likewise. (Symbol::set_got_offset): Likewise. (Symbol::has_tls_got_offset): Removed. (Symbol::tls_got_offset): Removed. (Symbol::set_tls_got_offset): Removed. (Symbol::got_offset_): Removed. (Symbol::tls_mod_got_offset_): Removed. (Symbol::tls_pair_got_offset_): Removed. (Symbol::got_offsets_): New field. (Symbol::has_got_offset): Removed. (Symbol::has_tls_mod_got_offset): Removed. (Symbol::has_tls_pair_got_offset): Removed. * x86_64.cc (Target_x86_64::Got_type): New enum declaration. (Target_x86_64::Scan::local): Updated callers of Output_data_got member functions. (Target_x86_64::Scan::global): Likewise. (Target_x86_64::Relocate::relocate): Likewise. (Target_x86_64::Relocate::relocate_tls): Likewise.
* Make sure the start and size of the TLS segment are aligned.Ian Lance Taylor2008-03-191-13/+74
|
* Fix handling of RELA relative relocs against local symbols in mergeIan Lance Taylor2008-03-161-9/+16
| | | | sections.
* Update copyright years. Update language files.Ian Lance Taylor2008-03-131-1/+1
|
* Combine read-only .eh_frame sections with read-write .eh_frameIan Lance Taylor2008-03-121-0/+21
| | | | sections.
* Remove gcc 3.2 compatibility hacks.Ian Lance Taylor2008-02-291-16/+10
|
* From Craig Silverstein: Have Parameters point to General_options.Ian Lance Taylor2008-02-281-150/+91
|
* Support dynamic relocations against local section symbols.Ian Lance Taylor2008-02-121-24/+119
|
* Support --oformat binary.Ian Lance Taylor2008-02-071-16/+23
|
* Fix group signature handling for relocatable link, add bootstrapIan Lance Taylor2008-02-061-4/+14
| | | | relocatable test.
* Initial -r support.Ian Lance Taylor2008-02-061-17/+216
|
* Implement PHDRS.Ian Lance Taylor2008-02-041-0/+49
|
* Implement SIZEOF_HEADERS, section constraints, other minor linkerIan Lance Taylor2008-02-041-5/+6
| | | | script items.
* Fully implement the SECTIONS clause.Ian Lance Taylor2008-02-041-43/+226
|
* Don't include options.h in fileread.h. Remove General_optionsIan Lance Taylor2008-01-181-5/+3
| | | | reference from Output_file class.
* Add support for -e and for ENTRY in linker scripts.Ian Lance Taylor2008-01-061-15/+48
|
* Don't create the postprocessing buffer if it already exists.Ian Lance Taylor2008-01-041-1/+3
|
* Correct handling of non-section symbol in merged section. Avoid someIan Lance Taylor2007-12-211-2/+0
| | | | 64-bit signed/unsigned warnings.
* Speed up relocations against local symbols in merged sections.Ian Lance Taylor2007-12-211-0/+40
|
* Update comments about output offsets and merged input sections.Ian Lance Taylor2007-12-201-8/+6
|
* Make functions on hot path inline. Remove a mistaken virtualIan Lance Taylor2007-12-201-1/+1
| | | | declaration.
* Print statistics about merge sections with --stats.Ian Lance Taylor2007-12-181-0/+12
|
* Add section_size_type and section_offset_type, use them to replace aIan Lance Taylor2007-12-181-13/+14
| | | | lot of instances of off_t.
* From Cary Coutant: Fix handling of RELATIVE RELA relocs.Ian Lance Taylor2007-12-071-34/+51
|
* From Cary Coutant: More support for generating shared libraries.Ian Lance Taylor2007-12-061-9/+354
|
* From Craig Silverstein: Support -o -.Ian Lance Taylor2007-12-051-12/+21
|
* From Craig Silverstein: Support irregular output files.Ian Lance Taylor2007-12-041-18/+77
|
* Compress all debug sections.Ian Lance Taylor2007-12-011-72/+92
|
* From Craig Silverstein: Add support for compressing .debug_str section.Ian Lance Taylor2007-11-301-21/+91
|
* Clean up setting address and section offset.Ian Lance Taylor2007-11-291-28/+50
|
* From Craig Silverstein: Also set entsize for .debug_str sections.Ian Lance Taylor2007-11-201-3/+6
|
* From Craig Silverstein: Force .debug_str sections to be SHF_MERGE andIan Lance Taylor2007-11-191-3/+10
| | | | SHF_STRINGS.
* From Cary Coutant: Count textrel with output sections rather thanIan Lance Taylor2007-11-151-0/+22
| | | | setting a flag as we add each reloc in the target code.
* From Cary Coutant: Improve i386 shared library TLS support.Ian Lance Taylor2007-11-141-2/+53
|
* From Cary Coutant: More shared library support, some refactorization.Ian Lance Taylor2007-11-091-2/+5
|
* Generate a complete exception frame header. Discard duplicateIan Lance Taylor2007-11-091-34/+119
| | | | exception frame information.
* Check that we don't set the output section index twice.Ian Lance Taylor2007-11-071-1/+1
|
* Correctly handle alignment in merge sections.Ian Lance Taylor2007-10-181-9/+10
|
* From Cary Coutant: preliminary shared library support.Ian Lance Taylor2007-10-161-1/+7
|
* From Craig Silverstein: call unlink_if_ordinary.Ian Lance Taylor2007-10-151-4/+3
|
* Remove extraneous newlines.Ian Lance Taylor2007-10-141-1/+1
|
* Run all error handling through an Errors object. Delete output fileIan Lance Taylor2007-10-141-34/+9
| | | | on error.
* From Craig Silverstein: delete the output file first if it exists andIan Lance Taylor2007-10-101-0/+20
| | | | is non-empty.
* Add support for local GOT offsets.Ian Lance Taylor2007-10-081-1/+20
|
* Put size and endianness in parameters.Ian Lance Taylor2007-09-261-49/+138
|
* Check section index as well as object when looking for input section.Ian Lance Taylor2007-09-231-1/+2
|