aboutsummaryrefslogtreecommitdiff
path: root/gold/output.h
AgeCommit message (Collapse)AuthorFilesLines
2008-04-112008-04-11 Cary Coutant <ccoutant@google.com>Cary Coutant1-15/+30
Add support for TLS descriptors for i386 and x86_64. * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function. (Target_i386::Relocate::tls_desc_gd_to_le): New function. (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and GOT_TYPE_TLS_DESC. (Target_i386::got_mod_index_entry): Remove unnecessary code. (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec relocations. (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation. Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations; Fix problem with initial-exec relocations. (Target_i386::Relocate::relocate_tls): Likewise. (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE relaxation. * output.cc (Output_data_dynamic::Dynamic_entry::write): Add support for section-plus-offset dynamic table entries. * output.h (Output_data_dynamic::add_section_plus_offset): New function. (Output_data_dynamic::Dynamic_entry): Add support for section-plus-offset dynamic table entries. (Output_data_dynamic::Classification): Likewise. (Output_data_dynamic::classification_): Renamed offset_. * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function. (Target_x86_64::Relocate::tls_desc_gd_to_le): New function. (Target_x86_64::make_plt_section): New function. (Target_x86_64::reserve_tlsdesc_entries): New function. (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter. (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function. (Output_data_plt_x86_64::has_tlsdesc_entry): New function. (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function. (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function. (Output_data_plt_x86_64::tlsdesc_plt_entry): New field. (Output_data_plt_x86_64::set_final_data_size): Move out of line; add extra PLT entry for TLS descriptors. (Output_data_plt_x86_64::got_): New field. (Output_data_plt_x86_64::tlsdesc_got_offset_): New field. (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new fields. (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS descriptors. (Target_x86_64::make_plt_entry): Factor out make_plt_section. (Target_x86_64::got_mod_index_entry): Remove unnecessary code. (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations. (Target_x86_64::Scan::global): Likewise. (Target_x86_64::do_finalize_sections): Add dynamic table entries for TLS descriptors. (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation. Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations. (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE relaxation. * configure.ac: Export new conditional variables TLS_GNU2_DIALECT and TLS_DESCRIPTORS. * Makefile.in: Rebuild. * configure: Rebuild. * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target. (tls_test_shared2.so): New target. (tls_shared_gd_to_ie_test_SOURCES): New variable. (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable. (tls_shared_gd_to_ie_test_LDFLAGS): New variable. (tls_shared_gd_to_ie_test_LDADD): New variable. (tls_shared_gnu2_gd_to_ie_test): New target. (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so): New targets. (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable. (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable. (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable. (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable. (tls_shared_gnu2_test): New target. (tls_test_gnu2_shared.so): New target. (tls_shared_gnu2_test_SOURCES): New variable. (tls_shared_gnu2_test_DEPENDENCIES): New variable. (tls_shared_gnu2_test_LDFLAGS): New variable. (tls_shared_gnu2_test_LDADD): New variable. * testsuite/Makefile.in: Rebuild. * testsuite/Makefile.
2008-04-07 * output.cc (Output_reloc<SHT_REL>::local_section_offset): AddIan Lance Taylor1-3/+5
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.
2008-03-28 * layout.cc (Layout::layout): If we see an input section with aIan Lance Taylor1-0/+50
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.
2008-03-25 * i386.cc (Target_i386::Got_type): New enum declaration.Cary Coutant1-57/+34
(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.
2008-03-19Make sure the start and size of the TLS segment are aligned.Ian Lance Taylor1-3/+4
2008-03-16Fix handling of RELA relative relocs against local symbols in mergeIan Lance Taylor1-3/+3
sections.
2008-03-13Update copyright years. Update language files.Ian Lance Taylor1-1/+1
2008-03-12Combine read-only .eh_frame sections with read-write .eh_frameIan Lance Taylor1-0/+12
sections.
2008-02-29Remove gcc 3.2 compatibility hacks.Ian Lance Taylor1-3/+3
2008-02-13Implement -Tdata and -Tbss.Ian Lance Taylor1-0/+6
2008-02-12Support dynamic relocations against local section symbols.Ian Lance Taylor1-41/+132
2008-02-09Track sections for expressions.Ian Lance Taylor1-1/+21
2008-02-07Support --oformat binary.Ian Lance Taylor1-0/+13
2008-02-06Fix group signature handling for relocatable link, add bootstrapIan Lance Taylor1-18/+47
relocatable test.
2008-02-06Initial -r support.Ian Lance Taylor1-3/+66
2008-02-04Implement PHDRS.Ian Lance Taylor1-0/+19
2008-02-04Fully implement the SECTIONS clause.Ian Lance Taylor1-41/+202
2008-01-18Don't include options.h in fileread.h. Remove General_optionsIan Lance Taylor1-11/+1
reference from Output_file class.
2008-01-06Add support for -e and for ENTRY in linker scripts.Ian Lance Taylor1-1/+8
2007-12-21Correct handling of non-section symbol in merged section. Avoid someIan Lance Taylor1-1/+2
64-bit signed/unsigned warnings.
2007-12-21Speed up relocations against local symbols in merged sections.Ian Lance Taylor1-15/+39
2007-12-20Convert more instances of off_t to be 32-bit types.Ian Lance Taylor1-8/+8
2007-12-20Update comments about output offsets and merged input sections.Ian Lance Taylor1-2/+4
2007-12-20Make functions on hot path inline. Remove a mistaken virtualIan Lance Taylor1-1/+1
declaration.
2007-12-18Print statistics about merge sections with --stats.Ian Lance Taylor1-0/+24
2007-12-18Add section_size_type and section_offset_type, use them to replace aIan Lance Taylor1-7/+11
lot of instances of off_t.
2007-12-07From Cary Coutant: Fix handling of RELATIVE RELA relocs.Ian Lance Taylor1-27/+108
2007-12-06From Cary Coutant: More support for generating shared libraries.Ian Lance Taylor1-55/+108
2007-12-04From Craig Silverstein: Support irregular output files.Ian Lance Taylor1-2/+10
2007-12-01Compress all debug sections.Ian Lance Taylor1-49/+93
2007-11-30From Craig Silverstein: Add support for compressing .debug_str section.Ian Lance Taylor1-3/+42
2007-11-29Clean up setting address and section offset.Ian Lance Taylor1-98/+241
2007-11-15From Cary Coutant: Count textrel with output sections rather thanIan Lance Taylor1-23/+52
setting a flag as we add each reloc in the target code.
2007-11-14From Cary Coutant: Improve i386 shared library TLS support.Ian Lance Taylor1-0/+13
2007-11-09Generate a complete exception frame header. Discard duplicateIan Lance Taylor1-32/+87
exception frame information.
2007-11-07Check that we don't set the output section index twice.Ian Lance Taylor1-2/+8
2007-10-18Correctly handle alignment in merge sections.Ian Lance Taylor1-2/+4
2007-10-12Add an option for Stringpools to not copy strings.Ian Lance Taylor1-1/+1
2007-10-08Add support for local GOT offsets.Ian Lance Taylor1-11/+8
2007-09-26Put size and endianness in parameters.Ian Lance Taylor1-22/+11
2007-09-22Add licensing text to every source file.Ian Lance Taylor1-0/+20
2007-09-21Add global parameters.Ian Lance Taylor1-8/+3
2007-09-21Use nops when doing alignment padding between code sections.Ian Lance Taylor1-1/+43
2007-08-21Force PT_LOAD segments to be aligned to the page size.Ian Lance Taylor1-2/+13
2007-08-21Add support for -rpath.Ian Lance Taylor1-0/+4
2007-05-16Add support for SHF_MERGE sections.Ian Lance Taylor1-23/+162
2006-12-06Generate version information.Ian Lance Taylor1-4/+4
2006-12-01Can now dynamically link hello, world.Ian Lance Taylor1-34/+115
2006-12-01gcc 3.2.2 portability hacks.Ian Lance Taylor1-1/+1
2006-11-30Added a testsuite. More support for COPY relocations.Ian Lance Taylor1-22/+155