Ian Lance Taylor
7bc3e21a1e
* testsuite/Makefile.am (many_sections_r_test): New target.
...
(many_sections_r_test_SOURCES): Remove.
(many_sections_r_test_DEPENDENCIES): Remove.
(many_sections_r_test_LDFLAGS): Remove.
(many_sections_r_test_LDADD): Remove.
2008-04-19 19:43:13 +00:00
Ian Lance Taylor
7fcd3aa988
* object.cc (Sized_relobj::do_add_symbols): Always pass
...
local_symbol_count_ to add_from_relobj.
2008-04-19 19:34:41 +00:00
Ian Lance Taylor
4c94d6ae7b
* testsuite/Makefile.am (many_sections_check.h): Only check one in
...
every thousand variables.
* testsuite/Makefile.in: Rebuild.
2008-04-19 19:15:36 +00:00
Ian Lance Taylor
d491d34e93
* object.cc (Xindex::initialize_symtab_xindex): New function.
...
(Xindex::read_symtab_xindex): New function.
(Xindex::sym_xindex_to_shndx): New function.
(Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
available.
(Sized_relobj::do_initialize_xindex): New function.
(Sized_relobj::do_read_symbols): Adjust section links.
(Sized_relobj::symbol_section_and_value): Add is_ordinary
parameter. Change all callers.
(Sized_relobj::include_section_group): Adjust section links and
symbol section indexes.
(Sized_relobj::do_layout): Adjust section links.
(Sized_relobj::do_count_local_symbols): Adjust section links and
symbol section indexes.
(Sized_relobj::do_finalize_local_symbols): Distinguish between
ordinary and special symbols.
(Sized_relobj::write_local_symbols): Add symtab_xindex and
dynsym_xindex parameters. Change all callers. Adjust section
links. Use SHN_XINDEX when needed.
(Sized_relobj::get_symbol_location_info): Adjust section links.
Don't get fooled by special symbols.
* object.h (class Xindex): Define.
(class Object): Add xindex_ parameter. Declare virtual functoin
do_initialize_xindex.
(Object::adjust_sym_shndx): New function.
(Object::set_xindex): New protected function.
(class Symbol_value): Add is_ordinary_shndx_ field.
(Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
(Symbol_value::value): Assert ordinary section.
(Symbol_value::initialize_input_to_output_map): Likewise.
(Symbol_value::set_input_shndx): Add is_ordinary parameter.
Change all callers.
(Symbol_value::input_shndx): Add is_ordinary parameter. Change
all callers.
(class Sized_relobj): Update declarations.
(Sized_relobj::local_symbol_input_shndx): Add is_ordinary
parameter. Change all callers.
(Sized_relobj::adjust_shndx): New function.
* dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
field.
(Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
(Sized_dynobj::read_dynsym_section): Adjust section links.
(Sized_dynobj::read_dynamic): Likewise.
(Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
section links.
(Sized_dynobj::do_initialize_xindex): New function.
* dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
do_initialize_xindex.
(Sized_dynobj::adjust_shndx): New function.
* layout.cc (Layout::Layout): Initialize symtab_xindex_ and
dynsym_xindex_ fields.
(Layout::finalize): Add a call to set_section_indexes before
creating the symtab sections.
(Layout::set_section_indexes): Don't do anything if the section
already has a section index.
(Layout::create_symtab_sections): Add shnum parameter. Change
caller. Create .symtab_shndx section if needed.
(Layout::create_shdrs): Add shstrtab_section parameter. Change
caller.
(Layout::allocated_output_section_count): New function.
(Layout::create_dynamic_symtab): Create .dynsym_shndx section if
needed.
* layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
fields. Update declarations.
(Layout::symtab_xindex): New function.
(Layout::dynsym_xindex): New function.
(class Write_symbols_task): Add layout_ field.
(Write_symbols_task::Write_symbols_task): Add layout parameter.
Change caller.
* output.cc (Output_section_headers::Output_section_headers): Add
shstrtab_section parameter. Change all callers.
(Output_section_headers::do_sized_write): Store overflow values
for section count and section string table section index in
section header zero.
(Output_file_header::do_sized_write): Check for overflow of
section count and section string table section index.
(Output_symtab_xindex::do_write): New function.
(Output_symtab_xindex::endian_do_write): New function.
* output.h (class Output_section_headers): Add shstrtab_section_.
Update declarations.
(class Output_symtab_xindex): Define.
(Output_section::has_out_shndx): New function.
* symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
field.
(Symbol::init_base): Add st_shndx and is_ordinary parameters.
Change all callers.
(Sized_symbol::init): Likewise.
(Symbol::output_section): Check for ordinary symbol.
(Symbol_table::add_from_object): Remove orig_sym parameter. Add
st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
callers.
(Symbol_table::add_from_relobj): Add symndx_offset parameter.
Change all callers. Simplify handling of symbols from sections
not included in the link.
(Symbol_table::add_from_dynobj): Handle ordinary symbol
distinction.
(Weak_alias_sorter::operator()): Assert that symbols are
ordinary.
(Symbol_table::sized_finalize_symbol): Handle ordinary symbol
distinction.
(Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
parameters. Change all callers.
(Symbol_table::sized_write_globals): Likewise. Handle ordinary
symbol distinction. Use SHN_XINDEX when needed.
(Symbol_table::write_section_symbol): Add symtab_xindex
parameter. Change all callers.
(Symbol_table::sized_write_section_symbol): Likewise. Use
SHN_XINDEX when needed.
* symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
declarations.
(Symbol::shndx): Add is_ordinary parameter. Change all callers.
(Symbol::is_defined): Check is_ordinary.
(Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
(Symbol::is_absolute, Symbol::is_common): Likewise.
(class Sized_symbol): Update declarations.
(class Symbol_table): Update declarations.
* resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
parameters. Change all callers.
(Sized_symbol::override): Likewise.
(Symbol_table::override): Likewise.
(symbol_to_bits): Add is_ordinary parameter. Change all callers.
(Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
is_ordinary, and orig_st_shndx parameters. Change all callers.
* copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
to be in an ordinary section.
* dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
object and is_ordinary parameters. Change all callers.
(Sized_dwarf_line_info::read_relocs): Add object parameter.
Change all callers. Don't add undefined or non-ordinary symbols
to reloc_map_.
(Sized_dwarf_line_info::read_line_mappings): Add object parameter.
Change all callers.
* dwarf_reader.h (class Sized_dwarf_line_info): Update
declarations.
* ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
* reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
(Sized_relobj::relocate_sections): Likewise.
* target-reloc.h (scan_relocs): Adjust section symbol index.
(scan_relocatable_relocs): Likewise.
* i386.cc (Scan::local): Check for ordinary symbols.
* sparc.cc (Scan::local): Likewise.
* x86_64.cc (Scan::local): Likewise.
* testsuite/binary_unittest.cc (Sized_binary_test): Update calls
to symbol_section_and_value.
* testsuite/many_sections_test.cc: New file.
* testsuite/Makefile.am (BUILT_SOURCES): Define.
(check_PROGRAMS): Add many_sections_test.
(many_sections_test_SOURCES): Define.
(many_sections_test_DEPENDENCIES): Define.
(many_sections_test_LDFLAGS): Define.
(BUILT_SOURCES): Add many_sections_define.h.
(many_sections_define.h): New target.
(BUILT_SOURCES): Add many_sections_check.h.
(many_sections_check.h): New target.
(check_PROGRAMS): Add many_sections_r_test.
(many_sections_r_test_SOURCES): Define.
(many_sections_r_test_DEPENDENCIES): Define.
(many_sections_r_test_LDFLAGS): Define.
(many_sections_r_test_LDADD): Define.
(many_sections_r_test.o): New target.
* testsuite/Makefile.in: Rebuild.
2008-04-19 18:30:58 +00:00
Cary Coutant
c5818ff112
* errors.cc (Errors::info): New function.
...
(gold_info): New function.
* errors.h (Errors::info): New function.
* gold.h (gold_info): New function.
* object.cc (Input_objects::add_object): Print trace output.
* options.cc (options::parse_set): New function.
(General_options::parse_wrap): Deleted.
(General_options::General_options): Deleted initializer.
* options.h (options::String_set): New typedef.
(options::parse_set): New function.
(DEFINE_set): New macro.
(General_options::wrap): Changed to use DEFINE_set. Changed
callers of any_wrap_symbols and is_wrap_symbol.
(General_options::trace, General_options::trace_symbol):
New options.
(General_options::any_wrap_symbols, General_options::is_wrap_symbol)
(General_options::wrap_symbols_): Deleted.
* symtab.cc (Symbol_table::add_from_object): Print trace output.
2008-04-17 22:45:47 +00:00
David S. Miller
b5be4a7c8c
* options.cc (General_options::parse_V): New function.
...
* options.h: Add entries for -V and -Qy.
2008-04-17 20:23:59 +00:00
Ian Lance Taylor
155a0dd763
* common.cc (Symbol_table::allocate_commons): Remove options
...
parameter. Change caller.
(Symbol_table::do_allocate_commons): Remove options parameter.
Change caller. Just call do_allocate_commons_list twice.
(Symbol_table::do_allocate_commons_list): New function, broken out
of do_allocate_commons.
* common.h (class Allocate_commons_task): Remove options_ field.
Update constructor.
* symtab.cc (Symbol_table::Symbol_table): Initialize
tls_commons_.
(Symbol_table::add_from_object): Put TLS common symbols on
tls_commons_ list.
(Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
which are IN_OUTPUT_DATA.
* symtab.h (class Symbol_table): Add tls_commons_ field. Update
allocate_commons and do_allocate_commons declarations. Declare
do_allocate_commons_list.
* gold.cc (queue_middle_tasks): Update creation of
Allocate_commons_task to not pass options.
* testsuite/Makefile.am (INCLUDES): Add -I.. .
(TLS_TEST_C_FLAGS): New variable.
(tls_test_c_pic.o): New target.
(tls_test_shared.so): Link in tls_test_c_pic.o.
(tls_test_c_pic_ie.o): New target.
(tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
(tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
(tls_test_c.o): New target.
(tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
(tls_pic_test_LDADD): Likewise.
(tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
(tls_shared_gd_to_ie_test_LDADD): Likewise.
(tls_test_c_gnu2.o): New target.
(tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
tls_test_c_gnu2.o.
(tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
(tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
(tls_test_shared_nonpic.so): Link in tls_test_c.o.
* testsuite/tls_test.cc: Include "config.h".
(t_last): Call t11_last.
* testsuite/tls_test.h (t11, t11_last): Declare.
* testsuite/tls_test_c.c: New file.
* testsuite/tls_test_main.cc (thread_routine): Call t11.
* configure.ac: Check for OpenMP support.
* configure, config.in, Makefile.in: Rebuild.
* testsuite/Makefile.in: Rebuild.
2008-04-17 07:12:00 +00:00
David S. Miller
32b769e114
* sparc.cc (Target_sparc::Scan): Change from struct to class.
...
Add issued_non_pic_error_ field. Declare check_non_pic.
(Target_sparc::Scan::check_non_pic): New function.
(Target_sparc::Scan::local): Call check_non_pic as appropriate.
(Target_sparc::Scan::global): Likewise.
2008-04-17 07:07:37 +00:00
David S. Miller
11936fb178
* configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
...
* configure: Rebuild.
2008-04-17 05:52:32 +00:00
Cary Coutant
edfbb02953
* i386.cc (Target_i386::define_tls_base_symbol): New function.
...
(Target_i386::tls_base_symbol_defined_): New field.
(Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
(Target_i386::Scan::global): Likewise.
* symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
* x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
(Target_x86_64::tls_base_symbol_defined_): New field.
(Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
(Target_x86_64::Scan::global): Likewise.
2008-04-17 02:00:54 +00:00
Cary Coutant
f3c69fcab1
* symtab.h (Symbol::is_strong_undefined): Removed unused function.
...
(Symbol::needs_plt_entry): Allow weak undefined symbols.
(Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
building shared libraries.
* testsuite/Makefile.am (weak_undef_nonpic_test): New target.
(weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
(weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
* testsuite/Makefile.in: Rebuild.
* testsuite/weak_undef.h: New file.
* testsuite/weak_undef_file1.cc: Add extra test cases.
* testsuite/weak_undef_file2.cc: Likewise.
* testsuite/weak_undef_test.cc: Likewise.
2008-04-17 00:14:36 +00:00
David S. Miller
7c41443585
elfcpp/
...
* elfcpp.h (DF_1_NOW, DF_1_GLOBAL, DF_1_GROUP,
DF_1_NODELETE, DF_1_LOADFLTR, DF_1_INITFIRST,
DF_1_NOOPEN, DF_1_ORIGIN, DF_1_DIRECT, DF_1_TRANS,
DF_1_INTERPOSE, DF_1_NODEFLIB, DF_1_NODUMP,
DF_1_CONLFAT): New enum constants.
gold/
* options.h (DEFINE_enable): New macro.
(new_dtags): New enable option.
(initfirst, interpose, loadfltr, nodefaultlib,
nodelete, nodlopen, nodump): New -z options.
* layout.cc (Layout:finish_dynamic_section): If new
dtags enabled, emit DT_RUNPATH. Also, emit a
DT_FLAGS_1 containing any specified -z flags.
2008-04-16 23:21:01 +00:00
Ian Lance Taylor
12c0daef5f
* copy-relocs.cc: New file.
...
* copy-relocs.h: New file.
* reloc.cc: Remove Copy_relocs code.
* reloc.h: Likewise.
* reloc-types.h (struct Reloc_types) [both versions]: Add
get_reloc_addend_noerror.
* output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
variants of add_global which take an addend which must be zero.
* i386.cc: Include "copy-relocs.h".
(class Target_i386): Change type of copy_relocs_ to variable,
update initializer.
(Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
Change all callers.
(Target_i386::do_finalize_sections): Change handling of
copy_relocs_.
* sparc.cc: Include "copy-relocs.h".
(class Target_sparc): Change type of copy_relocs_ to variable,
update initializer.
(Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
Change all callers.
(Target_sparc::do_finalize_sections): Change handling of
copy_relocs_.
* x86_64.cc: Include "copy-relocs.h".
(class Target_x86_64): Change type of copy_relocs_ to variable,
update initializer.
(Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
class. Change all callers.
(Target_x86_64::do_finalize_sections): Change handling of
copy_relocs_.
* Makefile.am (CCFILES): Add copy-relocs.cc.
(HFILES): Add copy-relocs.h.
2008-04-16 22:54:29 +00:00
Ian Lance Taylor
4f4995b628
* Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
2008-04-16 18:55:15 +00:00
Ian Lance Taylor
85c7bf8b11
* testsuite/script_test_4.sh: Permit leading zeroes.
2008-04-16 17:43:38 +00:00
Ian Lance Taylor
e6188289b9
* script-sections.cc (Script_sections::create_segments): Use
...
header_size_adjustment even when there is enough room for the
headers.
* testsuite/script_test_4.sh: New file.
* testsuite/script_test_4.t: New file.
* testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
(check_DATA): Add script_test_4.stdout.
(MOSTLYCLEANFILES): Likewise.
(script_test_4): New target.
(script_test_4.stdout): New target.
* testsuite/Makefile.in: Rebuild.
2008-04-15 22:50:37 +00:00
Ian Lance Taylor
4f2a9edd9c
* sparc.cc: Add definitions for Output_data_plt_sparc class
...
constants.
2008-04-15 21:41:29 +00:00
David S. Miller
f5314dd53d
toplevel/
...
* configure.ac: Add sparc*-*-* to gold supported targets.
* configure: Regenerate.
gold/
* sparc.cc: New file.
* Makefile.am (TARGETSOURCES): Add sparc.cc
(ALL_TARGETOBJS): Add sparc.$(OBJEXT)
* configure.tgt: Document targ_extra_size and
targ_extra_big_endian. Add entries for sparc-* and
sparc64-*.
* configure.ac: Handle targ_extra_size and
targ_extra_big_endian.
* Makefile.in: Rebuild.
* configure: Likewise.
* po/POTFILES.in: Likewise.
* po/gold.pot: Likewise.
2008-04-15 05:16:51 +00:00
Ian Lance Taylor
154e0e9aa7
* layout.cc (Layout::Layout): Initialize sections_are_attached_.
...
(Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
in the name/type/flags to section mapping. Don't call
allocate_output_section.
(Layout::choose_output_section): Change parameter from adjust_name
to is_input_section. Don't permit input sections after sections
are attached to segments. Don't call allocate_output_section.
(Layout::layout_eh_frame): Call update_flags_for_input_section,
not write_enable_output_section.
(Layout::make_output_section): Don't push to
unattached_section_list_ nor call attach_to_segment. Call
attach_section_to_segment if sections are attached.
(Layout::attach_sections_to_segments): New function.
(Layout::attach_section_to_segment): New function.
(Layout::attach_allocated_section_to_segment): Rename from
attach_to_segment. Remove flags parameter.
(Layout::allocate_output_section): Remove function.
(Layout::write_enable_output_section): Remove function.
* layout.h (class Layout): Update for above changes. Add new
field sections_are_attached_.
* output.h (Output_section::update_flags_for_input_section): New
function.
* output.cc (Output_section::add_input_section): Call
update_flags_for_input_section.
* gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
2008-04-15 04:06:41 +00:00
Cary Coutant
009a67a28f
* i386.cc (Target_i386::got_mod_index_entry): Restore code previously
...
thought unnecessary.
* x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
2008-04-11 23:37:24 +00:00
Ian Lance Taylor
759b1a245d
* output.h (class Output_section_data): Remove inline definition
...
of set_addralign.
* output.cc (Output_section_data::set_addralign): New function.
2008-04-11 22:55:13 +00:00
Cary Coutant
c2b45e22d5
2008-04-11 Cary Coutant <ccoutant@google.com>
...
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-11 21:24:30 +00:00
Ian Lance Taylor
83bfb6b776
* testsuite/Makefile.am (justsyms_2r.o): Add dependency on
...
justsyms.t.
* testsuite/Makefile.in: Rebuild.
* testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
long.
* testsuite/script_test_2.cc (main): Adjust test.
2008-04-11 20:44:52 +00:00
Ian Lance Taylor
706e1f5e80
* options.h (General_options): Add entries for '-Y' and
...
'-relax'.
* options.cc (General_options:finalize): If -Y was used, add those
entries to the library path instead of the default "/lib" and
"/usr/lib".
2008-04-11 20:28:34 +00:00
David S. Miller
7c98e6bbc9
* testsuite/justsyms.t: Start at 0x100.
...
* testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
* script_test_2b.cc (script_test_string_b): Make 8 bytes long.
* script_test_2.cc: Adjust string and section length checks.
2008-04-11 18:49:40 +00:00
Ian Lance Taylor
2cefc35727
PR gold/5996
...
* script-sections.cc (Sections_element::allocate_to_segment): Add
orphan parameter.
(Output_section_definition::allocate_to_segment): Likewise.
(Orphan_output_section::allocate_to_segment): Likewise.
(Script_sections::attach_sections_using_phdrs_clause): Don't
propagate non-PT_LOAD segments to orphan sections.
* testsuite/Makefile.am (script_test_3.stdout): Generate using
readelf rather than objdump.
* testsuite/script_test_3.sh: Adjust accordingly. Test that
.interp section and PT_INTERP segment are the same size.
* testsuite/Makefile.in: Rebuild.
2008-04-10 01:02:46 +00:00
Ian Lance Taylor
a4bb589a17
Fix typo in comment in last commit.
2008-04-10 00:58:58 +00:00
Ian Lance Taylor
99a37bfda0
* symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
...
aliases for symbols defined in the same object.
* testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
(weak_alias_test_SOURCES): New variable.
(weak_alias_test_DEPENDENCIES): New variable.
(weak_alias_test_LDFLAGS): New variable.
(weak_alias_test_LDADD): New variable.
(weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
(weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
(weak_alias_test_3.o): New target.
(weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
* testsuite/weak_alias_test_main.cc: New file.
* testsuite/weak_alias_test_1.cc: New file.
* testsuite/weak_alias_test_2.cc: New file.
* testsuite/weak_alias_test_3.cc: New file.
2008-04-09 22:45:08 +00:00
Ian Lance Taylor
cdb0b8f565
* options.h (class General_options): Add --noinhibit-exec option.
...
* main.cc (main): Check --noinhibit-exec.
2008-04-09 01:19:09 +00:00
Ian Lance Taylor
0864d55193
* options.h (class General_options): Define --wrap as a special
...
option. Add wrap_symbols_ field.
(General_options::any_wrap_symbols): New function.
(General_options::is_wrap_symbol): New function.
* options.cc (General_options::parse_wrap): New function.
(General_options::General_options): Initialize wrap_symbols_.
* symtab.cc (Symbol_table::wrap_symbol): New function.
(Symbol_table::add_from_object): Handle --wrap.
* symtab.h (class Symbol_table): Declare wrap_symbol.
* target.h (Target::wrap_char): New function.
(Target::Target_info): Add wrap_char field.
* i386.cc (Target_i386::i386_info): Initialize wrap_char.
* x86_64.cc (Target_x86_64::x86_64_info): Likewise.
* testsuite/testfile.cc (Target_test::test_target_info):
Likewise.
2008-04-09 00:48:13 +00:00
Ian Lance Taylor
789aa6de31
* errors.cc (Errors::undefined_symbol): Mention symbol version if
...
there is one.
2008-04-09 00:33:48 +00:00
Ian Lance Taylor
2c38906f72
* layout.h (class Layout): Add added_eh_frame_data_ field.
...
* layout.cc (Layout::Layout): Initialize new field.
(Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
output section until we find a section we merged successfully.
* object.cc (Sized_relobj::check_eh_frame_flags): Don't require
that the size be non-zero.
2008-04-09 00:26:48 +00:00
Ian Lance Taylor
780e49c563
* merge.cc (Object_merge_map::get_output_offset): Remove inline
...
qualifier.
2008-04-08 18:46:43 +00:00
Ian Lance Taylor
7fcd025698
* configure.ac: Export new conditional variable HAVE_ZLIB.
...
* testsuite/Makefile.am (flagstest_o_specialfile): Condition
on HAVE_ZLIB.
(flagstest_o_specialfile_and_compress_debug_sections): Likewise.
* configure, Makefile.in, testsuite/Makefile.in: Rebuild.
2008-04-08 14:33:35 +00:00
Ian Lance Taylor
e24f324cc6
* version.cc (version_string): Set to "1.5".
2008-04-08 14:29:55 +00:00
Ian Lance Taylor
a036edd8bd
* x86_64.cc (Target_x86_64::Scan): Change from struct to class.
...
Add issued_non_pic_error_ field. Declare check_non_pic.
(Target_x86_64::Scan::check_non_pic): New function.
(Target_x86_64::Scan::local): Call check_non_pic as appropriate.
(Target_x86_64::Scan::global): Likewise.
2008-04-08 04:09:59 +00:00
Ian Lance Taylor
624f881062
* output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
...
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-04-07 22:46:17 +00:00
Ian Lance Taylor
6835af537e
* configure.ac: Don't test for objdump, c++filt, or readelf.
...
* testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
conditionals.
(TEST_READELF): New variable.
(TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
(check_PROGRAMS): Add two_file_strip_test.
(two_file_strip_test): New target.
(check_PROGRAMS): Add two_file_same_shared_strip_test.
(two_file_same_shared_strip_test_SOURCES): New variable.
(two_file_same_shared_strip_test_DEPENDENCIES): New variable.
(two_file_same_shared_strip_test_LDFLAGS): New variable.
(two_file_same_shared_strip_test_LDADD): New variable.
(two_file_shared_strip.so): New target.
(ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
(ver_test_5.syms, ver_test_7.syms): Likewise.
(ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
(strip_test_3.stdout): Use TEST_OBJDUMP.
* configure, Makefile.in, testsuite/Makefile.in: Rebuild.
2008-04-07 22:16:03 +00:00
Cary Coutant
86925eef33
2008-04-04 Cary Coutant <ccoutant@google.com>
...
* symtab.h (Symbol::is_weak_undefined): New function.
(Symbol::is_strong_undefined): New function.
(Symbol::is_absolute): New function.
(Symbol::needs_plt_entry): Exclude weak undefined symbols.
(Symbol::needs_dynamic_reloc): Exclude weak undefined and
absolute symbols.
* testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
(weak_undef_test): New target.
* testsuite/Makefile.in: Rebuild.
* testsuite/weak_undef_file1.cc: New file.
* testsuite/weak_undef_file2.cc: New file.
* testsuite/weak_undef_test.cc: New file.
2008-04-04 17:24:47 +00:00
Ian Lance Taylor
126f3ece27
* compressed_output.h (class Output_compressed_section): Use
...
unsigned buffer.
* compressed_output.cc (zlib_compress): Use unsigned buffers,
add zlib header.
(zlib_compressed_suffix): Removed.
(Output_compressed_section::set_final_data_size): Use unsigned
buffers.
* testsuite/Makefile.am (flagstest_compress_debug_sections):
Fix linker invocation.
(flagstest_o_specialfile_and_compress_debug_sections):
Likewise.
* testsuite/Makefile.in: Regenerated.
2008-04-03 14:18:37 +00:00
David S. Miller
deae2a14a0
* dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
...
Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
2008-04-03 04:18:53 +00:00
Ian Lance Taylor
70752818b0
* TODO: New file.
2008-04-03 00:33:37 +00:00
Ian Lance Taylor
39d0cb0e83
* fileread.cc (File_read::find_view): Add byteshift and vshifted
...
parameters. Update for new key type to views_. Change all
callers.
(File_read::read): Adjust for byteshift in returned view.
(File_read::add_view): New function, broken out of
find_and_make_view.
(File_read::make_view): New function, broken out of
find_and_make_view.
(File_read::find_or_make_view): Add offset and aligned
parameters. Rewrite accordingly. Change all callers.
(File_read::get_view): Add offset and aligned parameters. Adjust
for byteshift in return value.
(File_read::get_lasting_view): Likewise.
* fileread.h (class File_read): Update declarations.
(class File_read::View): Add byteshift_ field. Add byteshift to
constructor. Add byteshift method.
* archive.h (Archive::clear_uncached_views): New function.
(Archive::get_view): Add aligned parameter. Change all callers.
* object.h (Object::get_view): Add aligned parameter. Change all
callers.
(Object::get_lasting_view): Likewise.
* fileread.cc (File_read::release): Don't call clear_views if
there are multiple objects.
* fileread.h (File_read::clear_uncached_views): New function.
* archive.cc (Add_archive_symbols::run): Call clear_uncached_views
on the archive.
2008-04-02 20:58:21 +00:00
Cary Coutant
a12074662b
2008-03-31 Cary Coutant <ccoutant@google.com>
...
Add thin archive support.
* archive.cc (Archive::armagt): New const.
(Archive::setup): Remove task parameter and calls to unlock.
(Archive::unlock_nested_archives): New function.
(Archive::read_header): Add nested_off parameter. Change
all callers.
(Archive::interpret_header): Likewise.
(Archive::include_all_members): Change to handle thin
archives.
(Archive::include_member): Likewise.
* archive.h (Archive::Archive): Add new parameters and
initializers.
(Archive::armagt): New const.
(Archive::setup): Remove task parameter.
(Archive::unlock_nested_archives): New function.
(Archive::read_header): Add nested_off parameter.
(Archive::interpret_header): Likewise.
(Archive::Nested_archive_table): New typedef.
(Archive::is_thin_archive_): New field.
(Archive::nested_archives_): New field.
(Archive::options_): New field.
(Archive::dirpath_): New field.
(Archive::task_): New field.
* readsyms.cc (Read_symbols::do_read_symbols): Add check
for thin archives. Pass additional parameters to
Archive::Archive. Unlock the archive file after calling
Archive::setup.
2008-04-01 20:57:36 +00:00
Ian Lance Taylor
686c8caf41
* symtab.cc (Symbol_table::do_define_as_constant): Don't force a
...
version symbol to be local.
* testsuite/ver_test_4.sh: New file.
* testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
(check_DATA): Add ver_test_4.syms.
(ver_test_4.syms): New target.
* testsuite/Makefile.in: Rebuild.
2008-03-29 08:39:26 +00:00
Ian Lance Taylor
ab794b6bda
* output.cc
...
(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.
2008-03-29 08:09:55 +00:00
Ian Lance Taylor
479f65031f
* symtab.cc (Symbol_table::add_from_object): If we don't use the
...
new symbol when resolving, don't call set_is_default.
* testsuite/ver_test_7.cc: New file.
* testsuite/ver_test_7.sh: New file.
* testsuite/Makefile.am (ver_test_7.so): New target.
(ver_test_7.o): New target.
(check_SCRIPTS): Add ver_test_7.sh.
(check_DATA): Add ver_test_7.syms.
(ver_test_7.syms): New target.
2008-03-29 07:19:02 +00:00
Ian Lance Taylor
2fd322316e
* layout.cc (Layout::layout): If we see an input section with a
...
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-28 22:42:34 +00:00
Ian Lance Taylor
49bdd526ab
* common.cc (Sort_commons::operator): Correct sorting algorithm.
...
* testsuite/common_test_1.c: New file.
* testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
(common_test_1_SOURCES): New variable.
(common_test_1_DEPENDENCIES): New variable.
(common_test_1_LDFLAGS): New variable.
2008-03-27 19:57:41 +00:00
Ian Lance Taylor
18e6b24e63
* symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
...
and commons_ correctly when NAME/VERSION does not override
NAME/NULL.
* testsuite/ver_test_6.c: New file.
* testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
(ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
(ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
2008-03-27 18:19:09 +00:00
Ian Lance Taylor
5871526fc2
* symtab.cc (Symbol_table::add_from_relobj): Don't set the version
...
of an undefined symbol from a version script.
* testsuite/Makefile.am (ver_test_5.so): New target.
(ver_test_5.o): New target.
(check_SCRIPTS): Add ver_test_5.sh.
(check_DATA): Add ver_test_5.syms.
(ver_test_5.syms): New target.
* testsuite/ver_test_5.cc: New file.
* testsuite/ver_test_5.script: New file.
* testsuite/ver_test_5.sh: New file.
* Makefile.in, testsuite/Makefile.in: Rebuild.
2008-03-27 06:11:57 +00:00
Ian Lance Taylor
04bf70729d
PR gold/5986
...
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.
2008-03-26 23:36:46 +00:00
Ben Elliston
53fcba31ae
Fix a ChangeLog formatting problem.
2008-03-26 02:00:39 +00:00
Ian Lance Taylor
819d6c3aea
* options.cc: Include "../bfd/bfdver.h".
...
(options::help): Print bug reporting address.
2008-03-25 23:48:25 +00:00
Ian Lance Taylor
f4b2c6f5d1
* version.cc (print_version): Adjust output for current value of
...
BFD_VERSION_STRING.
2008-03-25 23:30:48 +00:00
Ian Lance Taylor
4e740ec80c
* NEWS: New file.
2008-03-25 21:55:29 +00:00
Ian Lance Taylor
e96caa7910
* options.cc (options::help): Print list of supported targets.
...
* target-select.h: Include <vector>.
(class Target_selector): Make machine_, size_, and is_big_endian_
fields const. Add bfd_name_ and instantiated_target_ fields.
(Target_selector::Target_selector): Add bfd_name parameter.
(Target_selector::recognize): Make non-virtual, call
do_recognize.
(Target_selector::recognize_by_name): Make non-virtual, call
do_recognize_by_name.
(Target_selector::supported_names): New function.
(Target_selector::bfd_name): New function.
(Target_selector::do_instantiate_target): New pure virtual
function.
(Target_selector::do_recognize): New virtual function.
(Target_selector::do_recognize_by_name): New virtual function.
(Target_selector::instantiate_target): New private function.
(supported_target_names): Declare.
* target-select.cc (Target_selector::Target_selector): Update for
new parameter and fields.
(select_target_by_name): Check that the name matches before
calling recognize_by_name.
(supported_target_names): New function.
* i386.cc (class Target_selector_i386): Update Target_selector
constructor call. Remove recognize and recognize_by_name. Add
do_instantiate_target.
* x86_64.cc (class Target_selector_x86_64): Likewise.
* testsuite/testfile.cc (class Target_selector_test): Update for
changes to Target_selector.
2008-03-25 21:39:01 +00:00
Ian Lance Taylor
874c5b289f
* README: Rewrite, with some notes on unsupported features.
2008-03-25 21:14:45 +00:00
Cary Coutant
0a65a3a740
* i386.cc (Target_i386::Got_type): New enum declaration.
...
(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-25 18:37:16 +00:00
Ben Elliston
bd52eafbd6
* yyscript.y: Fix spelling error in comment.
2008-03-25 07:50:21 +00:00
Ian Lance Taylor
8ed814a99c
* options.h (class General_options): Define build_id option.
...
* layout.h (class Layout): Declare write_build_id, create_note,
create_build_id. Add build_id_note_ member.
* layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
"libiberty.h", "md5.h", "sha1.h".
(Layout::Layout): Initialize eh_frame_data_,
eh_frame_hdr_section_, and build_id_note_.
(Layout::finalize): Call create_build_id.
(Layout::create_note): New function, broken out of
Layout::create_gold_note.
(Layout::create_gold_note): Call create_note.
(Layout::create_build_id): New function.
(Layout::write_build_id): New function.
(Close_task_runner::run): Call write_build_id.
2008-03-25 05:11:41 +00:00
Ian Lance Taylor
8b105e34ed
* x86_64.cc: Correct license to GPLv3.
2008-03-24 21:42:22 +00:00
Ian Lance Taylor
086a18414a
* options.cc: Include "demangle.h".
...
(parse_optional_string): New function.
(parse_long_option): Handle takes_optional_argument.
(parse_short_option): Update dash_z initializer. Handle
takes_optional_argument.
(General_options::General_options): Initialize do_demangle_.
(General_options::finalize): Set do_demangle_. Handle demangling
style.
* options.h (parse_optional_string): Declare.
(struct One_option): Add optional_arg field. Update constructor.
Update call constructor calls. Add takes_optional_argument
function.
(DEFINE_var): Add optional_arg__ parameter. Change all callers.
(DEFINE_optional_string): Define.
(General_options::demangle): Change from DEFINE_bool to
DEFINE_optional_string.
(General_options::no_demangle): New function.
(General_options::do_demangle): New function.
(General_options::set_do_demangle): New function.
(General_options::execstack_status_): Move definition to end of
class definition.
(General_options::static_): Likewise.
(General_options::do_demangle_): New field.
* object.cc (big_endian>::get_symbol_location_info): Call
Options::do_demangle, not Options::demangle.
* symtab.cc (demangle): Likewise.
2008-03-24 03:48:29 +00:00
Ian Lance Taylor
cbb93e6310
* gold.h: Include <cstddef> and <sys/types.h>
...
* options.h: Include <cstring>.
2008-03-22 18:51:35 +00:00
Ian Lance Taylor
ec531623a8
Add ChangeLog file now that the sources are part of the GNU binutils.
2008-03-21 23:25:13 +00:00
Ian Lance Taylor
f5921069ec
Bump version for general release.
2008-03-21 17:48:18 +00:00
Ian Lance Taylor
eb42429a93
From Craig Silverstein: implement -z defs.
2008-03-20 05:22:37 +00:00
Ian Lance Taylor
96a2b4e4bf
Make sure the start and size of the TLS segment are aligned.
2008-03-19 21:41:38 +00:00
Craig Silverstein
5d96d68f64
Up the version number to 1.3, which was just pushed to devtools.
2008-03-17 17:56:52 +00:00
Ian Lance Taylor
d1f003c610
Fix handling of RELA relative relocs against local symbols in merge
...
sections.
2008-03-16 23:51:19 +00:00
Ian Lance Taylor
be3e620119
Don't get confused about whether a symbol is the default version if we
...
see a later reference to it. Add tests for this case.
2008-03-14 05:57:19 +00:00
Ian Lance Taylor
ebdbb4583d
Update copyright years. Update language files.
2008-03-13 21:04:21 +00:00
Ian Lance Taylor
1d6531cfad
Don't crash if we change the address of the .eh_frame section after we
...
find its size.
2008-03-13 20:58:11 +00:00
Ian Lance Taylor
2285a61069
From Craig Silverstein: Implement --debug=files to track file opens,
...
and implement --verbose as a synonym.
2008-03-13 01:46:17 +00:00
Ian Lance Taylor
1650c4ff50
Combine read-only .eh_frame sections with read-write .eh_frame
...
sections.
2008-03-12 04:38:42 +00:00
Craig Silverstein
5340de5bee
Up version to 1.2, as the 1.2 binary was pushed to users today.
2008-03-11 20:06:31 +00:00
Ian Lance Taylor
4e2b16973e
If we a section with no flags followed by a section with the same name
...
with flags, put them in the same output section.
2008-03-11 16:50:08 +00:00
Ian Lance Taylor
fee2edb1e4
From Craig Silverstein: sort options into alphabetical order.
2008-03-07 18:50:04 +00:00
Ian Lance Taylor
9531704395
Increase maximum bucket size for dynamic hash tables.
2008-03-07 16:30:59 +00:00
Ian Lance Taylor
a8627968fb
From Craig Silverstein: implement --hash-bucket-empty-fraction for real.
2008-03-07 16:27:33 +00:00
Ian Lance Taylor
c18476e7f1
Recognize --hash-bucket-empty-fraction.
2008-03-07 07:00:48 +00:00
Ian Lance Taylor
6be6f3bdcd
Use absolute address for relocations when not doing a relocatable
...
link.
2008-03-06 06:10:44 +00:00
Ian Lance Taylor
a4d4b13f68
Use N_ for option help strings, and call gettext when printing them.
2008-03-06 05:51:42 +00:00
Ian Lance Taylor
09ffbbe0d4
From Craig Silverstein: accept any string for input format, warn if
...
thread options when not supported.
2008-03-06 00:53:37 +00:00
Ian Lance Taylor
7dfac99ff1
Don't use the user-specified output format unless the user actually
...
specified one.
2008-03-06 00:17:43 +00:00
Ian Lance Taylor
13670ee669
Support --hash-style=gnu.
2008-03-06 00:15:04 +00:00
Ian Lance Taylor
ee1fe73e11
From Craig Silverstein: rework option handling to make it easier to
...
add a new option.
2008-03-04 23:10:38 +00:00
Ian Lance Taylor
7cc619c3b1
From Craig Silverstein: rename some option functions in preparation
...
for reworking option handling.
2008-03-04 18:21:43 +00:00
Ian Lance Taylor
021777a2ec
Remove partial implementation that was never completed. This was
...
replaced by the Stringpool<> class.
2008-03-03 23:47:14 +00:00
Ian Lance Taylor
7d1a9ebbf2
Remove gcc 3.2 compatibility hacks.
2008-02-29 19:19:17 +00:00
Ian Lance Taylor
8f2eb564dd
Permit scripts to refer to the addresses of output sections which were
...
not created.
2008-02-29 00:04:06 +00:00
Ian Lance Taylor
878405a889
Don't warn about redefinitions from a --just-symbols object.
2008-02-28 22:39:29 +00:00
Ian Lance Taylor
0dfbdef4c4
Support -d/--define-common.
2008-02-28 20:35:39 +00:00
Ian Lance Taylor
da769d5629
Read input scripts which look like input objects with proper
...
serialization.
2008-02-28 19:46:06 +00:00
Ian Lance Taylor
919ed24cbc
Don't check assertions until symbols are finalized. Create an output
...
section if the script uses a data statement with no input sections.
Don't create a loadable segment for the headers if there is no room.
2008-02-28 04:45:47 +00:00
Ian Lance Taylor
15cf077ef4
Put input sections with no flags in output sections with the same name.
2008-02-28 00:51:07 +00:00
Ian Lance Taylor
8851eccaec
From Craig Silverstein: Have Parameters point to General_options.
2008-02-28 00:18:24 +00:00
Ian Lance Taylor
7019cd2565
Implement -q/--emit-relocs.
2008-02-27 22:38:18 +00:00
Ian Lance Taylor
1890b46591
Fix handling of ENTRY in linker script.
2008-02-27 15:09:16 +00:00
Ian Lance Taylor
a5dc070655
From Craig Silverstein: rework handling of Script_options.
2008-02-26 22:48:08 +00:00
Ian Lance Taylor
cd72c29180
From Craig Silverstein: implement -z max-page-size and -z
...
common-page-size.
2008-02-26 22:10:32 +00:00
Ian Lance Taylor
45aa233bdc
From Craig Silverstein: rename option functions for future option
...
handling rewrite.
2008-02-26 21:45:30 +00:00
Ian Lance Taylor
935e887746
Align FDE and CIE lengths as needed.
2008-02-14 02:40:15 +00:00
Ian Lance Taylor
fd247bfe68
Set load address for orphan sections.
2008-02-14 02:34:22 +00:00
Ian Lance Taylor
756ac4a80d
Implement -Tdata and -Tbss.
2008-02-13 22:47:28 +00:00
Ian Lance Taylor
3edc73f245
Implement remaining linker script functions.
2008-02-13 22:44:50 +00:00
Ian Lance Taylor
0daa6f62c8
Support selecting target by name.
2008-02-13 02:44:50 +00:00
Ian Lance Taylor
caa9d5d919
Assignments in linker scripts override definitions from object files.
2008-02-13 01:20:38 +00:00
Ian Lance Taylor
7508a0934e
Implement LOADADDR and SIZEOF.
2008-02-13 01:18:53 +00:00
Craig Silverstein
9d37b37d37
Up version to 1.1, as the 1.1 binary was pushed to users today.
2008-02-12 02:01:32 +00:00
Ian Lance Taylor
dceae3c154
Support dynamic relocations against local section symbols.
2008-02-12 00:28:48 +00:00
Ian Lance Taylor
4e8fe71f6c
Set TEXTREL correctly when using a SECTIONS clause.
2008-02-12 00:24:00 +00:00
Ian Lance Taylor
0e43bb4edd
Pass down alignment when adding input section to orphan section.
2008-02-12 00:17:35 +00:00
Ian Lance Taylor
33a3a15316
Force different sections to different pages for better results on
...
x86_64 Linux.
2008-02-12 00:15:40 +00:00
Ian Lance Taylor
03df6b3280
Fix precedence error, avoid signed/unsignd warning.
2008-02-12 00:13:39 +00:00
Ian Lance Taylor
77e655378d
Track sections for expressions.
2008-02-09 01:22:17 +00:00
Ian Lance Taylor
8fc19601e8
From Cary Coutant: fix handling of undefined symbols in shared
...
libraries.
2008-02-08 22:49:22 +00:00
Ian Lance Taylor
b0d8593d63
Don't read linker scripts in binary mode.
2008-02-08 07:31:09 +00:00
Ian Lance Taylor
bc644c6cfc
Add support for --format binary for input files.
2008-02-08 07:06:58 +00:00
Ian Lance Taylor
516cb3d01e
Support --oformat binary.
2008-02-07 07:33:46 +00:00
Ian Lance Taylor
1ef1f3d387
Ignore version scripts for relocatable links.
2008-02-07 05:45:07 +00:00
Ian Lance Taylor
5fe2a0f55b
Even when stripping all symbols, we need to write out the dynamic
...
symbol table.
2008-02-07 04:35:41 +00:00
Ian Lance Taylor
88dd47ac00
Implement --just-symbols, including -R FILE. Fix symbol values when
...
doing a relocatable link.
2008-02-07 01:51:25 +00:00
Ian Lance Taylor
fbfba50887
Support creating empty output when there are no input objects.
2008-02-06 20:32:10 +00:00
Ian Lance Taylor
755ab8af10
Fix group signature handling for relocatable link, add bootstrap
...
relocatable test.
2008-02-06 19:32:32 +00:00
Ian Lance Taylor
6a74a71947
Initial -r support.
2008-02-06 08:13:50 +00:00
Ian Lance Taylor
56fd6e75db
From Ollie Wild: add missing backquote to install-exec-local.
2008-02-05 22:22:09 +00:00
Ian Lance Taylor
7d26c6cc60
Print PHDRS clause for debugging.
2008-02-04 23:53:15 +00:00
Ian Lance Taylor
1c4f3631bd
Implement PHDRS.
2008-02-04 22:54:31 +00:00
Ian Lance Taylor
15893b88b0
Treat an empty directory argument as the current directory.
2008-02-04 22:44:35 +00:00
Ian Lance Taylor
fc955173bb
From Craig Silverstein: support @file expansion.
2008-02-04 17:26:12 +00:00
Ian Lance Taylor
3802b2dd6b
Implement SIZEOF_HEADERS, section constraints, other minor linker
...
script items.
2008-02-04 06:45:50 +00:00
Ian Lance Taylor
7cc77b5a09
Fully implement SECTIONS clause.
2008-02-04 05:46:12 +00:00
Ian Lance Taylor
a445fddf82
Fully implement the SECTIONS clause.
2008-02-04 05:43:05 +00:00
Ian Lance Taylor
1cac254c18
Don't record file offset for CIEs.
2008-02-02 06:50:45 +00:00
Ian Lance Taylor
65778909ad
From Cary Coutant: Ignore hidden symbols in a dynamic object.
2008-02-01 00:42:24 +00:00
Ian Lance Taylor
03e8f2b225
From Cary Coutant: Fix a case in which code takes the address of a
...
function and also calls it directly.
2008-02-01 00:39:10 +00:00
Ian Lance Taylor
8bc7a1c115
Permit ordinary object files in groups.
2008-01-26 01:35:10 +00:00
Ian Lance Taylor
9b07f471e3
Don't pass around the target in order to define symbols; get it from
...
the parameters instead.
2008-01-26 01:17:45 +00:00
Ian Lance Taylor
1dd940af63
From Craig Silverstein: Simplify Version_script_info::symbol_is_local
...
interface.
2008-01-24 22:35:39 +00:00
Ian Lance Taylor
5240d12aa0
From Cary Coutant: Fix last patch.
2008-01-24 00:51:57 +00:00
Ian Lance Taylor
55a934330a
Originally from Craig Silverstein, with changes: support using a
...
version script to force symbols to be local.
2008-01-24 00:15:00 +00:00
Ian Lance Taylor
e4967d85cb
Use string instead of STRING, so that we handled QUOTED_STRING.
2008-01-23 19:31:56 +00:00
Ian Lance Taylor
0700cf329e
From Cary Coutant: Fix mixing PIC and non-PIC relocs in the same
...
shared library.
2008-01-23 07:15:59 +00:00
Ian Lance Taylor
7d32031390
Add explicit dependencies on yyscript.h to make sure that it is
...
built.
2008-01-23 02:13:38 +00:00
Ian Lance Taylor
494e05f440
Parse a SECTIONS clause in a linker script.
2008-01-23 01:31:13 +00:00
Ian Lance Taylor
0c0a741125
Include <vector>.
2008-01-22 22:50:31 +00:00
Ian Lance Taylor
cbcc4140e2
From Craig Silverstein: Optionally print command line for easier
...
debugging.
2008-01-18 23:41:31 +00:00
Ian Lance Taylor
106002249a
From Craig Silverstein: Handle quoted strings differently in version
...
scripts, and handle extern "C++" in the middle of a block.
2008-01-18 23:35:09 +00:00
Ian Lance Taylor
14144f39e4
Don't include options.h in fileread.h. Remove General_options
...
reference from Output_file class.
2008-01-18 23:26:48 +00:00
Ian Lance Taylor
091244672e
From Andrew Chatham and Craig Silverstein: Add support for version
...
scripts.
2008-01-15 23:41:28 +00:00
Ian Lance Taylor
e5756efb6d
Support assignments and expressions in linker scripts.
2008-01-09 19:57:45 +00:00
Ian Lance Taylor
2dd3e587bd
Report linker script errors with line numbers. Ignore OUTPUT_FORMAT
...
with three arguments, and ignore OUTPUT_ARCH.
2008-01-07 05:19:02 +00:00
Ian Lance Taylor
d391083d3c
Add support for -e and for ENTRY in linker scripts.
2008-01-06 00:47:10 +00:00
Ian Lance Taylor
fced7afdce
Add -h/-soname option.
2008-01-04 05:35:24 +00:00
Ian Lance Taylor
1bedcac52a
Don't create the postprocessing buffer if it already exists.
2008-01-04 05:04:56 +00:00
Ian Lance Taylor
be2f3dec43
Add cast to avoid signed/unsigned warning.
2008-01-02 23:55:37 +00:00
Ian Lance Taylor
cb29561284
Reduce the number of system calls. Use readv instead of pread. Do
...
better handling of cached views.
2008-01-02 23:48:49 +00:00
Ian Lance Taylor
cf88803ada
Use a simpler hash function.
2007-12-22 01:53:39 +00:00
Ian Lance Taylor
06a9731e8a
Correct contributor name on new tests, remove #if 0 code.
2007-12-22 00:50:43 +00:00
Ian Lance Taylor
99f8facac9
From Cary Coutant: Fix handling of versioned symbols, add some tests.
2007-12-21 23:31:19 +00:00
Ian Lance Taylor
8d32f93595
Correct handling of non-section symbol in merged section. Avoid some
...
64-bit signed/unsigned warnings.
2007-12-21 23:08:25 +00:00
Ian Lance Taylor
a9a60db689
Speed up relocations against local symbols in merged sections.
2007-12-21 21:19:45 +00:00
Ian Lance Taylor
8cce671843
Fix buglet in last patch.
2007-12-20 21:26:17 +00:00
Ian Lance Taylor
fe8718a463
Convert more instances of off_t to be 32-bit types.
2007-12-20 21:21:24 +00:00
Ian Lance Taylor
1e9836570f
Update comments about output offsets and merged input sections.
2007-12-20 16:27:34 +00:00
Ian Lance Taylor
4106a0814a
Remove one inline.
2007-12-20 01:32:10 +00:00
Ian Lance Taylor
8f00aeb8a6
Make functions on hot path inline. Remove a mistaken virtual
...
declaration.
2007-12-20 01:29:04 +00:00
Ian Lance Taylor
2030fba084
Move Stringpool offsets into a chunked_vector indexed by keys.
2007-12-19 01:23:46 +00:00
Ian Lance Taylor
9bb53bf8b8
Avoid some warnings which showed up in 64-bit mode.
2007-12-19 01:18:41 +00:00
Ian Lance Taylor
c0873094f5
Use string length when available when calling Stringpool. Compare
...
pointers first when looking up Stringpool entries.
2007-12-19 00:29:28 +00:00
Ian Lance Taylor
0205c1752c
Don't write unattached after_input sections twice.
2007-12-18 21:45:28 +00:00
Ian Lance Taylor
38c5e8b493
Print statistics about merge sections with --stats.
2007-12-18 21:24:10 +00:00
Ian Lance Taylor
8383303e0a
Add section_size_type and section_offset_type, use them to replace a
...
lot of instances of off_t.
2007-12-18 00:48:04 +00:00
Ian Lance Taylor
281b8327ae
Minor speedup to Output_merge_string::do_add_input_section.
2007-12-15 01:01:48 +00:00
Ian Lance Taylor
17a1d0a9b2
Rewrite workqueue. This version eliminates the master thread, and
...
reduces the amount of locking required to find a new thread to run.
2007-12-14 19:00:21 +00:00
Ian Lance Taylor
7004837e8d
Add const to Object::read and Object::sized_target.
2007-12-14 18:50:01 +00:00
Ian Lance Taylor
c71c6f566c
Make some File_read methods const.
2007-12-14 18:22:06 +00:00
Ian Lance Taylor
0e470e5c90
Add some missing dependencies for the new linker.
2007-12-14 05:27:45 +00:00
Ian Lance Taylor
6d01333390
From Craig Silverstein: size hash tables to avoid resizing.
2007-12-14 05:24:17 +00:00
Ian Lance Taylor
460c00b558
Fix --thread-count-middle and --thread-count-final.
2007-12-14 04:53:22 +00:00
Ian Lance Taylor
c03c769248
From Cary Coutant: Test TLS initial-exec model.
2007-12-11 23:33:11 +00:00
Ian Lance Taylor
535890bb64
From Cary Coutant: Set DF_STATIC_TLS as appropriate.
2007-12-11 23:30:52 +00:00
Ian Lance Taylor
31d6048054
From Cary Coutant: Fix x86_64 TLS problem.
2007-12-11 21:21:14 +00:00
Ian Lance Taylor
9430daf83a
From Craig Silverstein: Speed up ODR violation reporting.
2007-12-11 18:17:31 +00:00
Ian Lance Taylor
94c4710f80
From Cary Coutant: Handle TLS entry for TLS module index.
2007-12-11 04:23:05 +00:00
Ian Lance Taylor
fcf29b2415
Keep views on views_ list so that they can be found again.
2007-12-10 22:55:31 +00:00
Craig Silverstein
53765ea3d7
Released gold-alpha 0.9.
2007-12-08 03:17:25 +00:00
Ian Lance Taylor
bc2c67ffde
From Craig Silverstein: Fix error message, add this->.
2007-12-08 03:05:27 +00:00
Ian Lance Taylor
6a41d30bc2
From Cary Coutant: Fix x86_64 TLS. Also set DT_TEXTREL as well as
...
DF_TEXTREL.
2007-12-07 23:26:51 +00:00
Ian Lance Taylor
e8c846c359
From Cary Coutant: Fix handling of RELATIVE RELA relocs.
2007-12-07 19:32:59 +00:00
Ian Lance Taylor
4117d76827
Fix ehframe header handling for shared libraries.
2007-12-07 06:44:01 +00:00
Ian Lance Taylor
78d911fd3e
From Cary Coutant: Some x86_64 shared library fixes.
2007-12-07 00:59:31 +00:00
Ian Lance Taylor
ac1f0c21ae
From Cary Coutant: Remove commented out assert. Also add comment for
...
bitfield check.
2007-12-07 00:54:28 +00:00
Ian Lance Taylor
351a80002a
From Craig Silverstein: Reorganize testsuite Makefile.am.
2007-12-06 17:07:24 +00:00
Ian Lance Taylor
f2619d6c3b
Initialize variable to avoid warning.
2007-12-06 06:03:00 +00:00
Ian Lance Taylor
7bf1f8020f
From Cary Coutant: More support for generating shared libraries.
2007-12-06 05:55:50 +00:00
Ian Lance Taylor
fd6940ea27
Fix comment.
2007-12-06 05:27:24 +00:00
Ian Lance Taylor
116724f39d
Don't write out the symbol table when stripping.
2007-12-06 05:00:00 +00:00
Ian Lance Taylor
987cc25110
Rework Stringpool to not compute the hash code twice when adding a new
...
string.
2007-12-05 22:56:51 +00:00
Ian Lance Taylor
42a1b6860d
From Craig Silverstein: Support -o -.
2007-12-05 01:13:28 +00:00
Ian Lance Taylor
43771f7638
From Craig Silverstein: Test some flags.
2007-12-05 01:10:16 +00:00
Ian Lance Taylor
ad8f37d1ba
Stringpool stats. Also make Symbol_table support functions inline.
2007-12-05 00:48:49 +00:00
Ian Lance Taylor
c420411fe8
From Craig Silverstein: Support irregular output files.
2007-12-04 23:42:28 +00:00
Ian Lance Taylor
abaa399568
Print symbol table statistics with --stats.
2007-12-04 23:11:35 +00:00
Ian Lance Taylor
3ae7da37eb
From Craig Silverstein: Use gold_fatal in options.h, beef up value checks.
2007-12-04 01:30:46 +00:00
Ian Lance Taylor
be00d4e7ff
More -fPIC options.
2007-12-01 06:53:32 +00:00
Ian Lance Taylor
763277c3c4
Add missing space.
2007-12-01 06:51:45 +00:00
Ian Lance Taylor
c92003e082
Compile shared library code with -fPIC. Also, alphabetize.
2007-12-01 06:50:09 +00:00
Ian Lance Taylor
ae3e2ab146
Add casts to avoid warnings.
2007-12-01 06:45:21 +00:00
Ian Lance Taylor
96803768f1
Compress all debug sections.
2007-12-01 06:34:12 +00:00
Ian Lance Taylor
b589a5bc29
From Cary Coutant: Avoid compilation warnings if no zlib.h.
2007-11-30 22:38:01 +00:00
Ian Lance Taylor
9a0910c33e
From Craig Silverstein: Add support for compressing .debug_str section.
2007-11-30 00:35:27 +00:00
Ian Lance Taylor
27bc2bce09
Clean up setting address and section offset.
2007-11-29 20:10:17 +00:00
Ian Lance Taylor
2d6840917d
Don't try to delete the output file if we don't know its name yet.
2007-11-28 19:39:40 +00:00
Ian Lance Taylor
ef04e3921e
From Craig Silverstein: Fix up comments.
2007-11-28 19:38:35 +00:00
Ian Lance Taylor
79e052eafd
From Craig Silverstein: Better handling of ODR violations which are
...
not in a function.
2007-11-28 18:01:06 +00:00
Ian Lance Taylor
4625f782a5
Rework merge_map for speed.
2007-11-27 06:13:33 +00:00
Ian Lance Taylor
d8a8897678
Make Merge_key_less operator() inline.
2007-11-22 00:45:46 +00:00
Ian Lance Taylor
c79126688f
Add threading support.
2007-11-22 00:05:51 +00:00
Ian Lance Taylor
4f833eee90
From Craig Silverstein: Also set entsize for .debug_str sections.
2007-11-20 04:26:15 +00:00
Ian Lance Taylor
44a43cf96f
From Craig Silverstein: Force .debug_str sections to be SHF_MERGE and
...
SHF_STRINGS.
2007-11-19 22:49:38 +00:00
Ian Lance Taylor
dd8670e56c
From Craig Silverstein: Quote the symbol name in the ODR violation
...
message to avoid a gcc collect2 demangling bug.
2007-11-17 02:49:22 +00:00
Craig Silverstein
c282462d03
Released gold 0.8
2007-11-16 21:18:22 +00:00
Ian Lance Taylor
3e95a404c8
Ignore empty archives.
2007-11-16 18:44:20 +00:00
Ian Lance Taylor
ff541f308a
When looking for ODR violations, only check the file base name. Also,
...
never demangle if --no-demangle was used.
2007-11-16 16:54:19 +00:00
Ian Lance Taylor
124dfc8994
DW_LNE_end_sequence indicates that the address points to the byte
...
*after* the current target sequence.
2007-11-16 06:47:53 +00:00
Ian Lance Taylor
4f4c5f80c7
From Cary Coutant: Count textrel with output sections rather than
...
setting a flag as we add each reloc in the target code.
2007-11-15 23:46:46 +00:00
Ian Lance Taylor
02d2ba7402
From Craig Silverstein: Add --strip-debug-gdb.
2007-11-15 23:03:45 +00:00
Ian Lance Taylor
b01c0a4adb
Workaround bug in gcc 4.0.3 STL.
2007-11-15 20:41:19 +00:00
Ian Lance Taylor
a2b1aa12f7
From Craig Silverstein: Add support for --demangle.
2007-11-15 01:12:55 +00:00
Ian Lance Taylor
07f397aba3
From Cary Coutant: Improve i386 shared library TLS support.
2007-11-14 22:31:02 +00:00
Ian Lance Taylor
78f156961e
From Craig Silverstein: Report output file name with ODR violation
...
warning message.
2007-11-14 18:44:58 +00:00
Ian Lance Taylor
eb01e199fd
If generating a .err file fails, remove it.
2007-11-14 18:37:00 +00:00
Ian Lance Taylor
a18f2bd699
From Craig Silverstein: Clean up DWARF line reader code.
2007-11-14 18:33:47 +00:00
Ian Lance Taylor
9a2d698415
Add heuristics for undefined symbol warnings.
2007-11-14 16:53:25 +00:00
Ian Lance Taylor
3e6fe5ae73
Comment out undef_symbol.err for now.
2007-11-14 15:24:08 +00:00
Ian Lance Taylor
1ce71f59c7
Default to --allow-shlib-undefined for now.
2007-11-14 09:39:13 +00:00
Ian Lance Taylor
601e4987b8
Revert last patch.
2007-11-14 08:03:41 +00:00
Ian Lance Taylor
3728821ffc
Support special always-defined symbols for targets.
2007-11-14 07:52:21 +00:00
Ian Lance Taylor
e2827e5f52
Warn about undefined references in shared libraries if we have seen
...
all the DT_NEEDED entries for that library.
2007-11-14 07:34:53 +00:00
Ian Lance Taylor
a55ce7febf
From Craig Silverstein: Rework debug info code a bit, add option for
...
ODR violations, add test case.
2007-11-14 01:03:01 +00:00
Ian Lance Taylor
70e654ba48
From Craig Silverstein: First cut at detecting ODR violations.
2007-11-13 20:02:32 +00:00
Ian Lance Taylor
af674d1d6c
From Craig Silverstein: Support debug info for shared libraries.
2007-11-13 01:26:27 +00:00
Ian Lance Taylor
c261a0be88
From Craig Silverstein: Dwarf_line_info can work with Object rather
...
than Sized_relobj.
2007-11-12 20:55:53 +00:00
Ian Lance Taylor
b696e6d46c
From Craig Silverstein: Track_relocs doesn't need to hold onto the
...
object.
2007-11-12 20:35:21 +00:00
Ian Lance Taylor
24badc6562
From Craig Silverstein: rework DWARF reader code a bit.
2007-11-12 19:56:20 +00:00
Ian Lance Taylor
386c048c7a
Correct handling of GOT references in a regular object.
2007-11-12 17:51:55 +00:00
Ian Lance Taylor
aed38d0694
From Craig Silverstein: Initialize got_relocs.
2007-11-09 23:56:32 +00:00
Ian Lance Taylor
d12348b848
From Craig Silverstein: Clean up make rules for debug_msg.
2007-11-09 23:35:19 +00:00
Ian Lance Taylor
f0323c2f68
From Craig Silverstein: Add test for debug messages.
2007-11-09 23:19:11 +00:00
Ian Lance Taylor
4c50553d98
From Craig Silverstein: Use relocations in reporting error message
...
locations.
2007-11-09 23:16:54 +00:00
Ian Lance Taylor
d61c6bd41c
From Cary Coutant: More shared library support, some refactorization.
2007-11-09 19:45:08 +00:00
Ian Lance Taylor
338f2eba1a
From Cary Coutant: mark negative constant as unsigned.
2007-11-09 07:03:14 +00:00
Ian Lance Taylor
730cdc88f7
Generate a complete exception frame header. Discard duplicate
...
exception frame information.
2007-11-09 07:00:15 +00:00
Ian Lance Taylor
868870607e
From Craig Silverstein and Cary Coutant: fix assignment of section
...
indexes to sections which are not associated with segments.
2007-11-07 22:33:30 +00:00
Ian Lance Taylor
91ea499d4a
Check that we don't set the output section index twice.
2007-11-07 18:29:34 +00:00
Ian Lance Taylor
e43872e995
From Craig Silverstein: Templatize the Dwarf reader.
2007-11-07 00:49:56 +00:00
Ian Lance Taylor
a7a81c1d9d
From Craig Silverstein: Handle a .so file in a .a file.
2007-11-07 00:45:05 +00:00
Ian Lance Taylor
019cdb1a59
From Craig Silverstein: Don't crash if we see a file we don't recognize.
2007-11-07 00:31:32 +00:00
Ian Lance Taylor
5c2c6c957b
From Craig Silverstein: Add first version of generating error messages
...
with file name and line number.
2007-11-02 23:02:44 +00:00
Ian Lance Taylor
86849f1fac
From Cary Coutant: Correct generation of RELATIVE relocs.
2007-11-02 04:08:52 +00:00
Ian Lance Taylor
f7e2ee4820
Reworked from Andrew Chatham: report error locations.
2007-11-02 03:28:52 +00:00
Ian Lance Taylor
96f2030e25
From Cary Coutant: More support for -shared, including fixes to GOT
...
handling.
2007-11-01 00:19:30 +00:00
Ian Lance Taylor
a0451b389c
From Craig Silverstein: Implement OPTION in linker scripts.
2007-10-30 06:27:03 +00:00
Ian Lance Taylor
c1866bd5e3
Adjust PLTOFF64 calculation.
2007-10-30 04:23:19 +00:00
Ian Lance Taylor
ee9e9e8644
From Craig Silverstein: Implement GOTPLT64 and PLTOFF64.
2007-10-30 01:21:51 +00:00
Ian Lance Taylor
fdc2f80f7e
From Craig Silverstein: Clean up some unnecessary TODO markers.
2007-10-29 23:36:39 +00:00
Ian Lance Taylor
5662214762
From Craig Silverstein: better organization for TLS code.
2007-10-29 20:09:35 +00:00
Ian Lance Taylor
41e92bc528
From Craig Silverstein: Remove extraneous comment.
2007-10-29 17:12:11 +00:00
Ian Lance Taylor
dba5a01fdc
From Cary Coutant: Set offsets of sections with data before finalizing
...
local symbols.
2007-10-27 00:36:52 +00:00
Ian Lance Taylor
3c2fafa531
From Craig Silverstein and Ian Lance Taylor: Process --script option.
2007-10-27 00:29:34 +00:00
Ian Lance Taylor
e536689126
Simplify some code to avoid extra tests of number of objects.
2007-10-26 22:27:52 +00:00
Ian Lance Taylor
195e7dc6c1
From Craig Silverstein: preliminary support for OPTION in linker script.
2007-10-26 22:16:06 +00:00
Ian Lance Taylor
2c0aeda459
Exit if we couldn't open any input files.
2007-10-26 22:12:03 +00:00
Ian Lance Taylor
5d57def3b3
From Craig Silverstein: Minimal --script implementation.
2007-10-26 18:03:24 +00:00
Ian Lance Taylor
fa99aa0984
Use AC_GNU_SOURCE.
2007-10-24 18:11:23 +00:00
Ian Lance Taylor
35cdfc9a87
Add support for PT_GNU_STACK.
2007-10-23 05:05:48 +00:00
Ian Lance Taylor
46fe162319
Fix versions of copied symbols.
2007-10-22 23:08:22 +00:00
Ian Lance Taylor
6161122258
Implement -Bstatic/-Bdynamic.
2007-10-22 18:04:43 +00:00
Ian Lance Taylor
ee6d2efee9
Correct locking if a file could not be opened.
2007-10-22 18:02:36 +00:00
Ian Lance Taylor
291eaac6ab
From Craig Silverstein: add cast to avoid warning.
2007-10-20 04:35:43 +00:00
Ian Lance Taylor
f389a824b8
From Craig Silverstein: handle PLT32 relocs against local symbols for
...
x86_64.
2007-10-20 04:33:21 +00:00
Ian Lance Taylor
df2efe713a
Handle PLT32 against local symbols.
2007-10-20 00:33:31 +00:00
Ian Lance Taylor
28ef317915
Add wide string constant test.
2007-10-19 23:38:40 +00:00
Ian Lance Taylor
fa1bd4fb25
Fix handling of wide string merge sections.
2007-10-19 23:33:37 +00:00
Ian Lance Taylor
51b08ebe94
Add support for -Bsymbolic.
2007-10-18 23:20:53 +00:00
Ian Lance Taylor
af4a8a833e
Rework section mapping algorithm to handle .data.rel.ro sections.
2007-10-18 19:56:12 +00:00
Ian Lance Taylor
87f9577614
Correctly handle alignment in merge sections.
2007-10-18 17:46:23 +00:00
Ian Lance Taylor
fe9a4c1201
Add infrastructure for threading support.
2007-10-17 06:24:50 +00:00
Ian Lance Taylor
436ca963fd
From Cary Coutant: preliminary shared library support.
2007-10-16 23:23:08 +00:00
Ian Lance Taylor
a360aedd0f
From Craig Silverstein: check that we get environ right.
2007-10-16 23:09:45 +00:00
Ian Lance Taylor
0c5e9c22aa
From Craig Silverstein: implement -Ttext.
2007-10-16 22:38:36 +00:00
Ian Lance Taylor
1b64748bed
From Craig Silverstein: support local GOT relocs for i386.
2007-10-16 00:42:36 +00:00
Ian Lance Taylor
72ec287661
From Craig Silverstein: add LD to LE TLS optimizations.
2007-10-15 03:39:16 +00:00
Ian Lance Taylor
5ffcaa866f
From Craig Silverstein: call unlink_if_ordinary.
2007-10-15 03:35:35 +00:00
Ian Lance Taylor
cd4662c7e4
Fix exit status.
2007-10-15 03:33:03 +00:00
Ian Lance Taylor
aeddab66fe
Keep track of weak aliases, so that overriding environ works.
2007-10-14 15:35:27 +00:00
Ian Lance Taylor
ad435a2465
Adjust linkonce symbol name algorithm to work for
...
.gnu.linkonce.t.__i686.get_pc_thunk.bx.
2007-10-14 07:27:10 +00:00
Ian Lance Taylor
d20222a1e7
Better multiple definition errors.
2007-10-14 07:10:20 +00:00
Ian Lance Taylor
a0c4fb0ac6
Remove extraneous newlines.
2007-10-14 06:57:58 +00:00
Ian Lance Taylor
ac2d295e92
Remove extraneous newline.
2007-10-14 06:54:56 +00:00
Ian Lance Taylor
75f2446ec3
Run all error handling through an Errors object. Delete output file
...
on error.
2007-10-14 06:49:14 +00:00
Ian Lance Taylor
eb4dfdd470
Fix typo in comment.
2007-10-14 04:10:25 +00:00
Ian Lance Taylor
27b7985a73
From Craig Silverstein: add some internationalization calls.
2007-10-14 04:06:18 +00:00
Ian Lance Taylor
097ec620e1
Only run static TLS tests on glibc 2.4 or later.
2007-10-14 03:57:22 +00:00
Ian Lance Taylor
8261e3bfa5
From Craig Silverstein: TLS test cleanups.
2007-10-14 03:23:38 +00:00
Ian Lance Taylor
e2305dc04c
From Craig Silverstein: always use 32-bit format for gold note.
2007-10-14 03:12:53 +00:00
Ian Lance Taylor
4eff2974c2
From Craig Silverstein: error if we see a dynamic object when the
...
-static option was given.
2007-10-14 02:52:13 +00:00
Ian Lance Taylor
e041f13d5a
From Craig Silverstein: use tls.h in x86_64.cc.
2007-10-13 00:15:07 +00:00
Ian Lance Taylor
e03748586c
From Craig Silverstein: expand the TLS test to a second file, to test
...
IE to LE conversion.
2007-10-12 17:32:20 +00:00
Ian Lance Taylor
cfd73a4e26
Add an option for Stringpools to not copy strings.
2007-10-12 06:06:34 +00:00
Ian Lance Taylor
0ffd9845f2
From Craig Silverstein: improve x86_64 TLS support.
2007-10-12 06:00:55 +00:00
Ian Lance Taylor
e44fcf3bcf
Add --stats option to print runtime and memory usage statistics.
2007-10-12 05:51:25 +00:00
Ian Lance Taylor
7d00dcbd9c
From Andrew Chatham: exit on relocation error.
2007-10-11 19:13:02 +00:00
Ian Lance Taylor
46738c9aeb
From Craig Silverstein: don't permit -s and -r.
2007-10-10 19:30:39 +00:00
Ian Lance Taylor
9e2dcb779c
Implement -s and -S options which strip symbols.
2007-10-10 19:02:56 +00:00
Ian Lance Taylor
cec9d2f362
From Craig Silverstein: don't get confused if the same file name
...
occurs in an archive.
2007-10-10 06:33:56 +00:00
Ian Lance Taylor
4e9d858638
From Craig Silverstein: delete the output file first if it exists and
...
is non-empty.
2007-10-10 06:29:10 +00:00
Ian Lance Taylor
4f211c8bff
Create a note section with the version of gold.
2007-10-09 21:37:55 +00:00
Ian Lance Taylor
e2aacd2c75
Fix soname for library found in search path.
2007-10-09 17:46:15 +00:00
Ian Lance Taylor
e982104129
Make TLS test fail more reliably.
2007-10-08 07:24:21 +00:00
Ian Lance Taylor
e727fa71af
Add support for local GOT offsets.
2007-10-08 07:22:21 +00:00
Ian Lance Taylor
af6359d59d
From Craig Silverstein: add tls.h, use it in i386.cc.
2007-10-08 05:12:59 +00:00
Ian Lance Taylor
8486ee48e8
Add --version option.
2007-10-07 18:06:27 +00:00
Ian Lance Taylor
f958d5fc53
Test merging of string constants.
2007-10-07 17:20:18 +00:00
Ian Lance Taylor
6eee141ff6
Add a TLS test case.
2007-10-07 17:10:10 +00:00
Ian Lance Taylor
46cf9fa27e
Add support for local dynamic relocations.
2007-10-07 17:05:07 +00:00
Ian Lance Taylor
063f12a825
Correct handling of addends in merged sections.
2007-10-06 05:40:44 +00:00
Ian Lance Taylor
2fb69fac7a
From Andrew Chatham: fix bug in 64-bit hash.
2007-10-05 17:36:31 +00:00
Ian Lance Taylor
d61c17ea24
From Craig Silverstein: x86_64 TLS support.
2007-10-04 22:28:36 +00:00
Ian Lance Taylor
ad2d6943a4
Full support for --sysroot.
2007-10-04 05:49:04 +00:00
Ian Lance Taylor
ff0065209a
From Craig Silverstein: get all x86_64 tests passing.
2007-10-03 20:50:53 +00:00
Ian Lance Taylor
4fb6c25d50
From Craig Silverstein: set symbol value for function pointer
...
equality across shared library boundaries.
2007-10-03 05:40:11 +00:00
Ian Lance Taylor
6340166c8b
Parameterize object_unittest to work for whatever target types are
...
supported.
2007-10-03 00:34:49 +00:00
Ian Lance Taylor
63402fe413
From Craig Silverstein: don't run function pointer non-PIC tests when
...
they won't work.
2007-10-02 22:45:07 +00:00
Ian Lance Taylor
e84992bbac
From Craig Silverstein: correct x86_64 dynamic tags.
2007-10-02 22:10:10 +00:00
Ian Lance Taylor
51dee2fec3
From Craig Silverstein: add support for searching for input files
...
named in linker scripts.
2007-10-02 21:24:41 +00:00
Ian Lance Taylor
f5c3f2256f
From Craig Silverstein: avoid some signed/unsigned warnings from gcc 4.2.
2007-10-02 20:52:18 +00:00
Ian Lance Taylor
7bb3655e07
Cleanups from Craig Silverstein.
2007-10-01 23:42:58 +00:00
Ian Lance Taylor
e822f2b19a
From Craig Silverstein: New version of x86_64.cc.
2007-10-01 22:21:58 +00:00
Ian Lance Taylor
2e30d253b7
From Craig Silverstein: x86_64 support.
2007-10-01 21:30:59 +00:00
Ian Lance Taylor
5b3463d9ee
Add Signed_valtype and use it for sign extension. Fix names of rela8.
2007-10-01 21:25:23 +00:00
Ian Lance Taylor
d830e0e0c9
Add RELA versions of the relocation routines. Original patch from
...
Craig Silverstein, with Symbol_value<> versions added.
2007-10-01 00:05:08 +00:00
Ian Lance Taylor
6df6da4a61
Clean up target handling--only build required files, warn about
...
unsupported targets.
2007-09-30 23:41:32 +00:00
Ian Lance Taylor
b3b74ddc6e
Use parameters to track whether we are doing a static link. Fix up
...
final_value_is_known for weak undefined symbols. Pointed out by Cary
Coutant.
2007-09-28 06:36:25 +00:00
Ian Lance Taylor
dfbba8f432
From Andrew Chatham: add signedrel<>, rel32s and friends.
2007-09-28 06:00:26 +00:00
Ian Lance Taylor
9025d29d14
Put size and endianness in parameters.
2007-09-26 07:01:35 +00:00
Ian Lance Taylor
3151305a47
Add basic exception frame header, plus test.
2007-09-26 05:44:38 +00:00
Ian Lance Taylor
d1038c216f
Use mmap to read from input files.
2007-09-25 23:08:30 +00:00