47f824ee65baa86909736145f8ce29d7b4c28df4
[external/binutils.git] / gold / ChangeLog
1 2008-05-05  Ian Lance Taylor  <iant@google.com>
2
3         * object.cc (Sized_relobj::include_section_group): Adjust section
4         indexes read from group data.  Build vector to pass to
5         layout_group.
6         * layout.cc (Layout::layout_group): Add flags and shndxes
7         parameters.  Remove contents parameter.  Change caller.  Update
8         explicit instantiations.
9         * layout.h (class Layout): Update layout_group declaration.
10         * output.cc (Output_data_group::Output_data_group): Add flags and
11         input_shndxes parameters.  Remove contents parameter.  Change
12         caller.
13         (Output_data_group::do_write): Change input_sections_ to
14         input_shndxes_.
15         * output.h (class Output_data_group): Update constructor
16         declaration.  Rename input_sections_ to input_shndxes_.
17         * testsuite/many_sections_test.cc: Add template.
18
19 2008-04-30  Cary Coutant  <ccoutant@google.com>
20
21         * target-reloc.h (relocate_section): Fix dead-pointer bug.
22
23         * layout.cc (Layout::include_section): Refactored check for debug
24         info section.
25         (Layout::add_comdat): Add new parameters.  Change type
26         of signature parameter.  Add object and shndx to signatures table.
27         (Layout::find_kept_object): New function.
28         * layout.h: Include <cstring>.
29         (Layout::is_debug_info_section): New function.
30         (Layout::add_comdat): Add new parameters.
31         (Layout::find_kept_object): New function.
32         (Layout::Kept_section): New struct.
33         (Layout::Signatures): Change type of map range.
34         * object.cc (Relobj::output_section_address): New function.
35         (Sized_relobj::include_section_group): Add new parameters.  Change
36         calls to Layout::add_comdat.  Change to build table of kept comdat
37         groups and table mapping discarded sections to kept sections.
38         (Sized_relobj::include_linkonce_section): Likewise.  Add new parameter.
39         (Sized_relobj::do_layout): Change calls to include_section_group and
40         include_linkonce_section.
41         (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
42         value to zero when section is discarded.
43         (Sized_relobj::map_to_kept_section): New function.
44         * object.h (Relobj::output_section_address): New function.
45         (Relobj::Comdat_group): New type.
46         (Relobj::find_comdat_group): New function.
47         (Relobj::Comdat_group_table): New type.
48         (Relobj::Kept_comdat_section): New type.
49         (Relobj::Kept_comdat_section_table): New type.
50         (Relobj::add_comdat_group): New function.
51         (Relobj::set_kept_comdat_section): New function.
52         (Relobj::get_kept_comdat_section): New function.
53         (Relobj::comdat_groups_): New field.
54         (Relobj::kept_comdat_sections_): New field.
55         (Symbol_value::input_value): Update comment.
56         (Sized_relobj::map_to_kept_section) New function.
57         (Sized_relobj::include_linkonce_section): Add new parameter.
58         * target-reloc.h (Comdat_behavior): New type.
59         (get_comdat_behavior): New function.
60         (relocate_section): Add code to map a discarded section to the
61         corresponding kept section when applying a relocation.
62
63 2008-04-30  Craig Silverstein  <csilvers@google.com>
64
65         * dwarf_reader.cc (next_generation_count): New static var.
66         (Addr2line_cache_entry): New struct.
67         (addr2line_cache): New static var.
68         (Dwarf_line_info::one_addr2line): Added caching.
69         (Dwarf_line_info::clear_addr2line_cache): New function.
70         * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
71         cache-size parameter.
72         (Dwarf_line_info::one_addr2line_cache): New function.
73         * symtab.cc (Symbol_table::detect_odr_violations): Pass
74         new cache-size argument to one_addr2line(), and clear cache.
75
76 2008-04-28  Cary Coutant  <ccoutant@google.com>
77
78         * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
79         R_386_PC8 relocations.
80
81 2008-04-23  Ian Lance Taylor  <iant@google.com>
82
83         * object.cc (Sized_relobj::include_section_group): Check for
84         invalid section group.
85
86         * object.cc (make_elf_object): Correct test for 64-bit ELF file
87         header size.
88
89         * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
90         than read for file header.
91         * archive.cc (Archive::include_member): Likewise.
92
93 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
94
95         * aclocal.m4: Regenerate.
96         * configure: Regenerate.
97
98 2008-04-19  Ian Lance Taylor  <iant@google.com>
99
100         * version.cc (version_string): Bump to 1.6.
101
102         * testsuite/Makefile.am (many_sections_r_test): New target.
103         (many_sections_r_test_SOURCES): Remove.
104         (many_sections_r_test_DEPENDENCIES): Remove.
105         (many_sections_r_test_LDFLAGS): Remove.
106         (many_sections_r_test_LDADD): Remove.
107
108         * object.cc (Sized_relobj::do_add_symbols): Always pass
109         local_symbol_count_ to add_from_relobj.
110
111         * testsuite/Makefile.am (many_sections_check.h): Only check one in
112         every thousand variables.
113         * testsuite/Makefile.in: Rebuild.
114
115         * object.cc (Xindex::initialize_symtab_xindex): New function.
116         (Xindex::read_symtab_xindex): New function.
117         (Xindex::sym_xindex_to_shndx): New function.
118         (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
119         available.
120         (Sized_relobj::do_initialize_xindex): New function.
121         (Sized_relobj::do_read_symbols): Adjust section links.
122         (Sized_relobj::symbol_section_and_value): Add is_ordinary
123         parameter.  Change all callers.
124         (Sized_relobj::include_section_group): Adjust section links and
125         symbol section indexes.
126         (Sized_relobj::do_layout): Adjust section links.
127         (Sized_relobj::do_count_local_symbols): Adjust section links and
128         symbol section indexes.
129         (Sized_relobj::do_finalize_local_symbols): Distinguish between
130         ordinary and special symbols.
131         (Sized_relobj::write_local_symbols): Add symtab_xindex and
132         dynsym_xindex parameters.  Change all callers.  Adjust section
133         links.  Use SHN_XINDEX when needed.
134         (Sized_relobj::get_symbol_location_info): Adjust section links.
135         Don't get fooled by special symbols.
136         * object.h (class Xindex): Define.
137         (class Object): Add xindex_ parameter.  Declare virtual functoin
138         do_initialize_xindex.
139         (Object::adjust_sym_shndx): New function.
140         (Object::set_xindex): New protected function.
141         (class Symbol_value): Add is_ordinary_shndx_ field.
142         (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
143         (Symbol_value::value): Assert ordinary section.
144         (Symbol_value::initialize_input_to_output_map): Likewise.
145         (Symbol_value::set_input_shndx): Add is_ordinary parameter.
146         Change all callers.
147         (Symbol_value::input_shndx): Add is_ordinary parameter.  Change
148         all callers.
149         (class Sized_relobj): Update declarations.
150         (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
151         parameter.  Change all callers.
152         (Sized_relobj::adjust_shndx): New function.
153         * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
154         field.
155         (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
156         parameter.  Change all callers.  Pick up SHT_DYNSYM_SHNDX section
157         for SHT_DYNSYM section if available.  Set dynsym_shndx_ field.
158         (Sized_dynobj::read_dynsym_section): Adjust section links.
159         (Sized_dynobj::read_dynamic): Likewise.
160         (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field.  Adjust
161         section links.
162         (Sized_dynobj::do_initialize_xindex): New function.
163         * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field.  Declare
164         do_initialize_xindex.
165         (Sized_dynobj::adjust_shndx): New function.
166         * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
167         dynsym_xindex_ fields.
168         (Layout::finalize): Add a call to set_section_indexes before
169         creating the symtab sections.
170         (Layout::set_section_indexes): Don't do anything if the section
171         already has a section index.
172         (Layout::create_symtab_sections): Add shnum parameter.  Change
173         caller.  Create .symtab_shndx section if needed.
174         (Layout::create_shdrs): Add shstrtab_section parameter.  Change
175         caller.
176         (Layout::allocated_output_section_count): New function.
177         (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
178         needed.
179         * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
180         fields.  Update declarations.
181         (Layout::symtab_xindex): New function.
182         (Layout::dynsym_xindex): New function.
183         (class Write_symbols_task): Add layout_ field.
184         (Write_symbols_task::Write_symbols_task): Add layout parameter.
185         Change caller.
186         * output.cc (Output_section_headers::Output_section_headers): Add
187         shstrtab_section parameter.  Change all callers.
188         (Output_section_headers::do_sized_write): Store overflow values
189         for section count and section string table section index in
190         section header zero.
191         (Output_file_header::do_sized_write): Check for overflow of
192         section count and section string table section index.
193         (Output_symtab_xindex::do_write): New function.
194         (Output_symtab_xindex::endian_do_write): New function.
195         * output.h (class Output_section_headers): Add shstrtab_section_.
196         Update declarations.
197         (class Output_symtab_xindex): Define.
198         (Output_section::has_out_shndx): New function.
199         * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
200         field.
201         (Symbol::init_base): Add st_shndx and is_ordinary parameters.
202         Change all callers.
203         (Sized_symbol::init): Likewise.
204         (Symbol::output_section): Check for ordinary symbol.
205         (Symbol_table::add_from_object): Remove orig_sym parameter.  Add
206         st_shndx, is_ordinary, and orig_st_shndx parameters.  Change all
207         callers.
208         (Symbol_table::add_from_relobj): Add symndx_offset parameter.
209         Change all callers.  Simplify handling of symbols from sections
210         not included in the link.
211         (Symbol_table::add_from_dynobj): Handle ordinary symbol
212         distinction.
213         (Weak_alias_sorter::operator()): Assert that symbols are
214         ordinary.
215         (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
216         distinction.
217         (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
218         parameters.  Change all callers.
219         (Symbol_table::sized_write_globals): Likewise.  Handle ordinary
220         symbol distinction.  Use SHN_XINDEX when needed.
221         (Symbol_table::write_section_symbol): Add symtab_xindex
222         parameter.  Change all callers.
223         (Symbol_table::sized_write_section_symbol): Likewise.  Use
224         SHN_XINDEX when needed.
225         * symtab.h (class Symbol): Add is_ordinary_shndx_ field.  Update
226         declarations.
227         (Symbol::shndx): Add is_ordinary parameter.  Change all callers.
228         (Symbol::is_defined): Check is_ordinary.
229         (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
230         (Symbol::is_absolute, Symbol::is_common): Likewise.
231         (class Sized_symbol): Update declarations.
232         (class Symbol_table): Update declarations.
233         * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
234         parameters.  Change all callers.
235         (Sized_symbol::override): Likewise.
236         (Symbol_table::override): Likewise.
237         (symbol_to_bits): Add is_ordinary parameter.  Change all callers.
238         (Symbol_table::resolve): Remove orig_sym parameter.  Add st_shndx,
239         is_ordinary, and orig_st_shndx parameters.  Change all callers.
240         * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
241         to be in an ordinary section.
242         * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
243         object and is_ordinary parameters.  Change all callers.
244         (Sized_dwarf_line_info::read_relocs): Add object parameter.
245         Change all callers.  Don't add undefined or non-ordinary symbols
246         to reloc_map_.
247         (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
248         Change all callers.
249         * dwarf_reader.h (class Sized_dwarf_line_info): Update
250         declarations.
251         * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
252         * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
253         (Sized_relobj::relocate_sections): Likewise.
254         * target-reloc.h (scan_relocs): Adjust section symbol index.
255         (scan_relocatable_relocs): Likewise.
256         * i386.cc (Scan::local): Check for ordinary symbols.
257         * sparc.cc (Scan::local): Likewise.
258         * x86_64.cc (Scan::local): Likewise.
259         * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
260         to symbol_section_and_value.
261         * testsuite/many_sections_test.cc: New file.
262         * testsuite/Makefile.am (BUILT_SOURCES): Define.
263         (check_PROGRAMS): Add many_sections_test.
264         (many_sections_test_SOURCES): Define.
265         (many_sections_test_DEPENDENCIES): Define.
266         (many_sections_test_LDFLAGS): Define.
267         (BUILT_SOURCES): Add many_sections_define.h.
268         (many_sections_define.h): New target.
269         (BUILT_SOURCES): Add many_sections_check.h.
270         (many_sections_check.h): New target.
271         (check_PROGRAMS): Add many_sections_r_test.
272         (many_sections_r_test_SOURCES): Define.
273         (many_sections_r_test_DEPENDENCIES): Define.
274         (many_sections_r_test_LDFLAGS): Define.
275         (many_sections_r_test_LDADD): Define.
276         (many_sections_r_test.o): New target.
277         * testsuite/Makefile.in: Rebuild.
278
279 2008-04-17  Cary Coutant  <ccoutant@google.com>
280
281         * errors.cc (Errors::info): New function.
282         (gold_info): New function.
283         * errors.h (Errors::info): New function.
284         * gold.h (gold_info): New function.
285         * object.cc (Input_objects::add_object): Print trace output.
286         * options.cc (options::parse_set): New function.
287         (General_options::parse_wrap): Deleted.
288         (General_options::General_options): Deleted initializer.
289         * options.h (options::String_set): New typedef.
290         (options::parse_set): New function.
291         (DEFINE_set): New macro.
292         (General_options::wrap): Changed to use DEFINE_set. Changed
293         callers of any_wrap_symbols and is_wrap_symbol.
294         (General_options::trace, General_options::trace_symbol):
295         New options.
296         (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
297         (General_options::wrap_symbols_): Deleted.
298         * symtab.cc (Symbol_table::add_from_object): Print trace output.
299
300 2008-04-17  David S. Miller  <davem@davemloft.net>
301
302         * options.cc (General_options::parse_V): New function.
303         * options.h: Add entries for -V and -Qy.
304
305 2008-04-17  Ian Lance Taylor  <iant@google.com>
306
307         * common.cc (Symbol_table::allocate_commons): Remove options
308         parameter.  Change caller.
309         (Symbol_table::do_allocate_commons): Remove options parameter.
310         Change caller.  Just call do_allocate_commons_list twice.
311         (Symbol_table::do_allocate_commons_list): New function, broken out
312         of do_allocate_commons.
313         * common.h (class Allocate_commons_task): Remove options_ field.
314         Update constructor.
315         * symtab.cc (Symbol_table::Symbol_table): Initialize
316         tls_commons_.
317         (Symbol_table::add_from_object): Put TLS common symbols on
318         tls_commons_ list.
319         (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
320         which are IN_OUTPUT_DATA.
321         * symtab.h (class Symbol_table): Add tls_commons_ field.  Update
322         allocate_commons and do_allocate_commons declarations.  Declare
323         do_allocate_commons_list.
324         * gold.cc (queue_middle_tasks): Update creation of
325         Allocate_commons_task to not pass options.
326         * testsuite/Makefile.am (INCLUDES): Add -I.. .
327         (TLS_TEST_C_FLAGS): New variable.
328         (tls_test_c_pic.o): New target.
329         (tls_test_shared.so): Link in tls_test_c_pic.o.
330         (tls_test_c_pic_ie.o): New target.
331         (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
332         (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
333         (tls_test_c.o): New target.
334         (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
335         (tls_pic_test_LDADD): Likewise.
336         (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
337         (tls_shared_gd_to_ie_test_LDADD): Likewise.
338         (tls_test_c_gnu2.o): New target.
339         (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
340         tls_test_c_gnu2.o.
341         (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
342         (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
343         (tls_test_shared_nonpic.so): Link in tls_test_c.o.
344         * testsuite/tls_test.cc: Include "config.h".
345         (t_last): Call t11_last.
346         * testsuite/tls_test.h (t11, t11_last): Declare.
347         * testsuite/tls_test_c.c: New file.
348         * testsuite/tls_test_main.cc (thread_routine): Call t11.
349         * configure.ac: Check for OpenMP support.
350         * configure, config.in, Makefile.in: Rebuild.
351         * testsuite/Makefile.in: Rebuild.
352
353 2008-04-16  Cary Coutant  <ccoutant@google.com>
354
355         * i386.cc (Target_i386::define_tls_base_symbol): New function.
356         (Target_i386::tls_base_symbol_defined_): New field.
357         (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
358         (Target_i386::Scan::global): Likewise.
359         * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
360         * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
361         (Target_x86_64::tls_base_symbol_defined_): New field.
362         (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
363         (Target_x86_64::Scan::global): Likewise.
364
365 2008-04-16  Cary Coutant  <ccoutant@google.com>
366
367         * symtab.h (Symbol::is_strong_undefined): Removed unused function.
368         (Symbol::needs_plt_entry): Allow weak undefined symbols.
369         (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
370         building shared libraries.
371         * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
372         (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
373         (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
374         * testsuite/Makefile.in: Rebuild.
375         * testsuite/weak_undef.h: New file.
376         * testsuite/weak_undef_file1.cc: Add extra test cases.
377         * testsuite/weak_undef_file2.cc: Likewise.
378         * testsuite/weak_undef_test.cc: Likewise.
379
380 2008-04-16  David S. Miller  <davem@davemloft.net>
381
382         * sparc.cc (Target_sparc::Scan): Change from struct to class.
383         Add issued_non_pic_error_ field.  Declare check_non_pic.
384         (Target_sparc::Scan::check_non_pic): New function.
385         (Target_sparc::Scan::local): Call check_non_pic as appropriate.
386         (Target_sparc::Scan::global): Likewise.
387
388         * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
389         * configure: Rebuild.
390
391         * options.h (DEFINE_enable): New macro.
392         (new_dtags): New enable option.
393         (initfirst, interpose, loadfltr, nodefaultlib,
394         nodelete, nodlopen, nodump): New -z options.
395         * layout.cc (Layout:finish_dynamic_section): If new
396         dtags enabled, emit DT_RUNPATH.  Also, emit a
397         DT_FLAGS_1 containing any specified -z flags.
398
399 2008-04-16  Ian Lance Taylor  <iant@google.com>
400
401         * copy-relocs.cc: New file.
402         * copy-relocs.h: New file.
403         * reloc.cc: Remove Copy_relocs code.
404         * reloc.h: Likewise.
405         * reloc-types.h (struct Reloc_types) [both versions]: Add
406         get_reloc_addend_noerror.
407         * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
408         variants of add_global which take an addend which must be zero.
409         * i386.cc: Include "copy-relocs.h".
410         (class Target_i386): Change type of copy_relocs_ to variable,
411         update initializer.
412         (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
413         Change all callers.
414         (Target_i386::do_finalize_sections): Change handling of
415         copy_relocs_.
416         * sparc.cc: Include "copy-relocs.h".
417         (class Target_sparc): Change type of copy_relocs_ to variable,
418         update initializer.
419         (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
420         Change all callers.
421         (Target_sparc::do_finalize_sections): Change handling of
422         copy_relocs_.
423         * x86_64.cc: Include "copy-relocs.h".
424         (class Target_x86_64): Change type of copy_relocs_ to variable,
425         update initializer.
426         (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
427         class.  Change all callers.
428         (Target_x86_64::do_finalize_sections): Change handling of
429         copy_relocs_.
430         * Makefile.am (CCFILES): Add copy-relocs.cc.
431         (HFILES): Add copy-relocs.h.
432
433         * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
434
435         * testsuite/script_test_4.sh: Permit leading zeroes.
436
437 2008-04-15  Ian Lance Taylor  <iant@google.com>
438
439         * script-sections.cc (Script_sections::create_segments): Use
440         header_size_adjustment even when there is enough room for the
441         headers.
442         * testsuite/script_test_4.sh: New file.
443         * testsuite/script_test_4.t: New file.
444         * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
445         (check_DATA): Add script_test_4.stdout.
446         (MOSTLYCLEANFILES): Likewise.
447         (script_test_4): New target.
448         (script_test_4.stdout): New target.
449         * testsuite/Makefile.in: Rebuild.
450
451         * sparc.cc: Add definitions for Output_data_plt_sparc class
452         constants.
453
454 2008-04-14  David S. Miller  <davem@davemloft.net>
455
456         * sparc.cc: New file.
457         * Makefile.am (TARGETSOURCES): Add sparc.cc
458         (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
459         * configure.tgt: Document targ_extra_size and
460         targ_extra_big_endian.  Add entries for sparc-* and
461         sparc64-*.
462         * configure.ac: Handle targ_extra_size and
463         targ_extra_big_endian.
464         * Makefile.in: Rebuild.
465         * configure: Likewise.
466         * po/POTFILES.in: Likewise.
467         * po/gold.pot: Likewise.
468
469 2008-04-14  Ian Lance Taylor  <iant@google.com>
470
471         * layout.cc (Layout::Layout): Initialize sections_are_attached_.
472         (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
473         in the name/type/flags to section mapping.  Don't call
474         allocate_output_section.
475         (Layout::choose_output_section): Change parameter from adjust_name
476         to is_input_section.  Don't permit input sections after sections
477         are attached to segments.  Don't call allocate_output_section.
478         (Layout::layout_eh_frame): Call update_flags_for_input_section,
479         not write_enable_output_section.
480         (Layout::make_output_section): Don't push to
481         unattached_section_list_ nor call attach_to_segment.  Call
482         attach_section_to_segment if sections are attached.
483         (Layout::attach_sections_to_segments): New function.
484         (Layout::attach_section_to_segment): New function.
485         (Layout::attach_allocated_section_to_segment): Rename from
486         attach_to_segment.  Remove flags parameter.
487         (Layout::allocate_output_section): Remove function.
488         (Layout::write_enable_output_section): Remove function.
489         * layout.h (class Layout): Update for above changes.  Add new
490         field sections_are_attached_.
491         * output.h (Output_section::update_flags_for_input_section): New
492         function.
493         * output.cc (Output_section::add_input_section): Call
494         update_flags_for_input_section.
495         * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
496
497 2008-04-11  Cary Coutant  <ccoutant@google.com>
498
499         * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
500         thought unnecessary.
501         * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
502
503 2008-04-11  Ian Lance Taylor  <iant@google.com>
504
505         * output.h (class Output_section_data): Remove inline definition
506         of set_addralign.
507         * output.cc (Output_section_data::set_addralign): New function.
508
509 2008-04-11  Cary Coutant  <ccoutant@google.com>
510
511         Add support for TLS descriptors for i386 and x86_64.
512         * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
513         (Target_i386::Relocate::tls_desc_gd_to_le): New function.
514         (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
515         GOT_TYPE_TLS_DESC.
516         (Target_i386::got_mod_index_entry): Remove unnecessary code.
517         (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
518         R_386_TLS_DESC_CALL relocations.  Fix problem with initial-exec
519         relocations.
520         (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
521         Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
522         Fix problem with initial-exec relocations.
523         (Target_i386::Relocate::relocate_tls): Likewise.
524         (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
525         relaxation.
526         * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
527         support for section-plus-offset dynamic table entries.
528         * output.h (Output_data_dynamic::add_section_plus_offset): New function.
529         (Output_data_dynamic::Dynamic_entry): Add support for
530         section-plus-offset dynamic table entries.
531         (Output_data_dynamic::Classification): Likewise.
532         (Output_data_dynamic::classification_): Renamed offset_.
533         * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
534         (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
535         (Target_x86_64::make_plt_section): New function.
536         (Target_x86_64::reserve_tlsdesc_entries): New function.
537         (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
538         (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
539         (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
540         (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
541         (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
542         (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
543         (Output_data_plt_x86_64::set_final_data_size): Move out of line;
544         add extra PLT entry for TLS descriptors.
545         (Output_data_plt_x86_64::got_): New field.
546         (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
547         (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
548         fields.
549         (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
550         descriptors.
551         (Target_x86_64::make_plt_entry): Factor out make_plt_section.
552         (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
553         (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
554         R_386_TLS_DESC_CALL relocations.
555         (Target_x86_64::Scan::global): Likewise.
556         (Target_x86_64::do_finalize_sections): Add dynamic table entries
557         for TLS descriptors.
558         (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
559         Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
560         (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
561         GD-to-IE relaxation.
562         * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
563         and TLS_DESCRIPTORS.
564         * Makefile.in: Rebuild.
565         * configure: Rebuild.
566         * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
567         (tls_test_shared2.so): New target.
568         (tls_shared_gd_to_ie_test_SOURCES): New variable.
569         (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
570         (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
571         (tls_shared_gd_to_ie_test_LDADD): New variable.
572         (tls_shared_gnu2_gd_to_ie_test): New target.
573         (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
574         New targets.
575         (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
576         (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
577         (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
578         (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
579         (tls_shared_gnu2_test): New target.
580         (tls_test_gnu2_shared.so): New target.
581         (tls_shared_gnu2_test_SOURCES): New variable.
582         (tls_shared_gnu2_test_DEPENDENCIES): New variable.
583         (tls_shared_gnu2_test_LDFLAGS): New variable.
584         (tls_shared_gnu2_test_LDADD): New variable.
585         * testsuite/Makefile.in: Rebuild.
586         * testsuite/Makefile.
587
588 2008-04-11  Ian Lance Taylor  <iant@google.com>
589
590         * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
591         justsyms.t.
592         * testsuite/Makefile.in: Rebuild.
593
594         * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
595         long.
596         * testsuite/script_test_2.cc (main): Adjust test.
597
598 2008-04-11  David S. Miller  <davem@davemloft.net>
599             Ian Lance Taylor  <iant@google.com>
600
601         * options.h (General_options): Add entries for '-Y' and
602         '-relax'.
603         * options.cc (General_options:finalize): If -Y was used, add those
604         entries to the library path instead of the default "/lib" and
605         "/usr/lib".
606
607 2008-04-11  David S. Miller  <davem@davemloft.net>
608
609         * testsuite/justsyms.t: Start at 0x100.
610         * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
611         * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
612         long.
613         * testsuite/script_test_2.cc: Adjust string and section length
614         checks.
615
616 2008-04-09  Ian Lance Taylor  <iant@google.com>
617
618         PR gold/5996
619         * script-sections.cc (Sections_element::allocate_to_segment): Add
620         orphan parameter.
621         (Output_section_definition::allocate_to_segment): Likewise.
622         (Orphan_output_section::allocate_to_segment): Likewise.
623         (Script_sections::attach_sections_using_phdrs_clause): Don't
624         propagate non-PT_LOAD segments to orphan sections.
625         * testsuite/Makefile.am (script_test_3.stdout): Generate using
626         readelf rather than objdump.
627         * testsuite/script_test_3.sh: Adjust accordingly.  Test that
628         .interp section and PT_INTERP segment are the same size.
629         * testsuite/Makefile.in: Rebuild.
630
631         * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
632         aliases for symbols defined in the same object.
633         * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
634         (weak_alias_test_SOURCES): New variable.
635         (weak_alias_test_DEPENDENCIES): New variable.
636         (weak_alias_test_LDFLAGS): New variable.
637         (weak_alias_test_LDADD): New variable.
638         (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
639         (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
640         (weak_alias_test_3.o): New target.
641         (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
642         * testsuite/weak_alias_test_main.cc: New file.
643         * testsuite/weak_alias_test_1.cc: New file.
644         * testsuite/weak_alias_test_2.cc: New file.
645         * testsuite/weak_alias_test_3.cc: New file.
646
647 2008-04-08  Ian Lance Taylor  <iant@google.com>
648
649         * options.h (class General_options): Add --noinhibit-exec option.
650         * main.cc (main): Check --noinhibit-exec.
651
652         * options.h (class General_options): Define --wrap as a special
653         option.  Add wrap_symbols_ field.
654         (General_options::any_wrap_symbols): New function.
655         (General_options::is_wrap_symbol): New function.
656         * options.cc (General_options::parse_wrap): New function.
657         (General_options::General_options): Initialize wrap_symbols_.
658         * symtab.cc (Symbol_table::wrap_symbol): New function.
659         (Symbol_table::add_from_object): Handle --wrap.
660         * symtab.h (class Symbol_table): Declare wrap_symbol.
661         * target.h (Target::wrap_char): New function.
662         (Target::Target_info): Add wrap_char field.
663         * i386.cc (Target_i386::i386_info): Initialize wrap_char.
664         * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
665         * testsuite/testfile.cc (Target_test::test_target_info):
666         Likewise.
667
668         * errors.cc (Errors::undefined_symbol): Mention symbol version if
669         there is one.
670
671         * layout.h (class Layout): Add added_eh_frame_data_ field.
672         * layout.cc (Layout::Layout): Initialize new field.
673         (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
674         output section until we find a section we merged successfully.
675         * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
676         that the size be non-zero.
677
678         * merge.cc (Object_merge_map::get_output_offset): Remove inline
679         qualifier.
680
681 2008-04-08  Craig Silverstein  <csilvers@google.com>
682
683         * configure.ac: Export new conditional variable HAVE_ZLIB.
684         * testsuite/Makefile.am (flagstest_o_specialfile): Condition
685         on HAVE_ZLIB.
686         (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
687         * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
688
689 2008-04-07  Ian Lance Taylor  <iant@google.com>
690
691         * version.cc (version_string): Set to "1.5".
692
693         * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
694         Add issued_non_pic_error_ field.  Declare check_non_pic.
695         (Target_x86_64::Scan::check_non_pic): New function.
696         (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
697         (Target_x86_64::Scan::global): Likewise.
698
699         * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
700         addend parameter.  Change caller.  Handle merge sections.
701         (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
702         Address to Addend.  Don't add in the result of
703         local_section_offset, pass down the addend and use the returned
704         value.
705         * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
706         Update declarations of local_section_offset and symbol_value.
707         * testsuite/two_file_test_1.cc (t18): New function.
708         * testsuite/two_file_test_2.cc (f18): New function.
709         * testsuite/two_file_test_main.cc (main): Call t18.
710         * testsuite/two_file_test.h (t18, f18): Declare.
711
712         * configure.ac: Don't test for objdump, c++filt, or readelf.
713         * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
714         conditionals.
715         (TEST_READELF): New variable.
716         (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
717         (check_PROGRAMS): Add two_file_strip_test.
718         (two_file_strip_test): New target.
719         (check_PROGRAMS): Add two_file_same_shared_strip_test.
720         (two_file_same_shared_strip_test_SOURCES): New variable.
721         (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
722         (two_file_same_shared_strip_test_LDFLAGS): New variable.
723         (two_file_same_shared_strip_test_LDADD): New variable.
724         (two_file_shared_strip.so): New target.
725         (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
726         (ver_test_5.syms, ver_test_7.syms): Likewise.
727         (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
728         (strip_test_3.stdout): Use TEST_OBJDUMP.
729         * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
730
731 2008-04-04  Cary Coutant  <ccoutant@google.com>
732
733         * symtab.h (Symbol::is_weak_undefined): New function.
734         (Symbol::is_strong_undefined): New function.
735         (Symbol::is_absolute): New function.
736         (Symbol::needs_plt_entry): Exclude weak undefined symbols.
737         (Symbol::needs_dynamic_reloc): Exclude weak undefined and
738         absolute symbols.
739         * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
740         (weak_undef_test): New target.
741         * testsuite/Makefile.in: Rebuild.
742         * testsuite/weak_undef_file1.cc: New file.
743         * testsuite/weak_undef_file2.cc: New file.
744         * testsuite/weak_undef_test.cc: New file.
745
746 2008-04-03  Craig Silverstein  <csilvers@google.com>
747
748         * compressed_output.h (class Output_compressed_section): Use
749         unsigned buffer.
750         * compressed_output.cc (zlib_compress): Use unsigned buffers,
751         add zlib header.
752         (zlib_compressed_suffix): Removed.
753         (Output_compressed_section::set_final_data_size): Use unsigned
754         buffers.
755         * testsuite/Makefile.am (flagstest_compress_debug_sections):
756         Fix linker invocation.
757         (flagstest_o_specialfile_and_compress_debug_sections):
758         Likewise.
759         * testsuite/Makefile.in: Regenerated.
760
761 2008-04-02  David S. Miller  <davem@davemloft.net>
762
763         *  dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
764         Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
765
766 2008-04-02  Craig Silverstein  <csilvers@google.com>
767
768         * TODO: New file.
769
770 2008-04-02  Ian Lance Taylor  <iant@google.com>
771
772         * fileread.cc (File_read::find_view): Add byteshift and vshifted
773         parameters.  Update for new key type to views_.  Change all
774         callers.
775         (File_read::read): Adjust for byteshift in returned view.
776         (File_read::add_view): New function, broken out of
777         find_and_make_view.
778         (File_read::make_view): New function, broken out of
779         find_and_make_view.
780         (File_read::find_or_make_view): Add offset and aligned
781         parameters.  Rewrite accordingly.  Change all callers.
782         (File_read::get_view): Add offset and aligned parameters.  Adjust
783         for byteshift in return value.
784         (File_read::get_lasting_view): Likewise.
785         * fileread.h (class File_read): Update declarations.
786         (class File_read::View): Add byteshift_ field.  Add byteshift to
787         constructor.  Add byteshift method.
788         * archive.h (Archive::clear_uncached_views): New function.
789         (Archive::get_view): Add aligned parameter.  Change all callers.
790         * object.h (Object::get_view): Add aligned parameter.  Change all
791         callers.
792         (Object::get_lasting_view): Likewise.
793
794         * fileread.cc (File_read::release): Don't call clear_views if
795         there are multiple objects.
796         * fileread.h (File_read::clear_uncached_views): New function.
797         * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
798         on the archive.
799
800 2008-03-31  Cary Coutant  <ccoutant@google.com>
801
802         Add thin archive support.
803         * archive.cc (Archive::armagt): New const.
804         (Archive::setup): Remove task parameter and calls to unlock.
805         (Archive::unlock_nested_archives): New function.
806         (Archive::read_header): Add nested_off parameter. Change
807         all callers.
808         (Archive::interpret_header): Likewise.
809         (Archive::include_all_members): Change to handle thin
810         archives.
811         (Archive::include_member): Likewise.
812         * archive.h (Archive::Archive): Add new parameters and
813         initializers.
814         (Archive::armagt): New const.
815         (Archive::setup): Remove task parameter.
816         (Archive::unlock_nested_archives): New function.
817         (Archive::read_header): Add nested_off parameter.
818         (Archive::interpret_header): Likewise.
819         (Archive::Nested_archive_table): New typedef.
820         (Archive::is_thin_archive_): New field.
821         (Archive::nested_archives_): New field.
822         (Archive::options_): New field.
823         (Archive::dirpath_): New field.
824         (Archive::task_): New field.
825         * readsyms.cc (Read_symbols::do_read_symbols): Add check
826         for thin archives.  Pass additional parameters to
827         Archive::Archive.  Unlock the archive file after calling
828         Archive::setup.
829         
830 2008-03-29  Ian Lance Taylor  <iant@google.com>
831
832         * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
833         version symbol to be local.
834         * testsuite/ver_test_4.sh: New file.
835         * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
836         (check_DATA): Add ver_test_4.syms.
837         (ver_test_4.syms): New target.
838         * testsuite/Makefile.in: Rebuild.
839
840         * output.cc
841         (Output_section::Input_section_sort_entry::has_priority): New
842         function.
843         (Output_section::Input_section_sort_entry::match_file_name): New
844         function.
845         (Output_section::Input_section_sort_entry::match_section_name):
846         Remove.
847         (Output_section::Input_section_sort_entry::match_section_name_prefix):
848         Remove.
849         (Output_section::Input_section_sort_entry::match_section_file):
850         Remove.
851         (Output_section::Input_section_sort_compare::operator()): Rewrite
852         using new Input_section_sort_entry functions.  Sort crtbegin and
853         crtend first.  Sort sections with no priority before sections with
854         a priority.
855         * testsuite/initpri1.c (d3): Check j != 4.
856         (cd5): New constructor/destructor function.
857         (main): Check j != 2.
858
859         * symtab.cc (Symbol_table::add_from_object): If we don't use the
860         new symbol when resolving, don't call set_is_default.
861         * testsuite/ver_test_7.cc: New file.
862         * testsuite/ver_test_7.sh: New file.
863         * testsuite/Makefile.am (ver_test_7.so): New target.
864         (ver_test_7.o): New target.
865         (check_SCRIPTS): Add ver_test_7.sh.
866         (check_DATA): Add ver_test_7.syms.
867         (ver_test_7.syms): New target.
868
869 2008-03-28  Ian Lance Taylor  <iant@google.com>
870
871         * layout.cc (Layout::layout): If we see an input section with a
872         name that needs sorting, set the must_sort flag for the output
873         section.
874         (Layout::make_output_section): If the name of the output section
875         indicates that it might require sorting, set the may_sort flag.
876         * output.h (Output_section::may_sort_attached_input_sections): New
877         function.
878         (Output_section::set_may_sort_attached_input_sections): New
879         function.
880         (Output_section::must_sort_attached_input_sections): New
881         function.
882         (Output_section::set_must_sort_attached_input_sections): New
883         function.
884         (class Output_section): Declare Input_section_sort_entry.  Define
885         Input_section_sort_compare.  Declare
886         sort_attached_input_sections.  Add new fields:
887         may_sort_attached_input_sections_,
888         must_sort_attached_input_sections_,
889         attached_input_sections_are_sorted_.
890         * output.cc (Output_section::Output_section): Initialize new
891         fields.
892         (Output_section::add_input_section): Add an entry to
893         input_sections_ if may_sort or must_sort are true.
894         (Output_section::set_final_data_size): Call
895         sort_attached_input_sections if necessary.
896         (Output_section::Input_section_sort_entry): Define new class.
897         (Output_section::Input_section_sort_compare::operator()): New
898         function.
899         (Output_section::sort_attached_input_sections): New function.
900         * configure.ac: Check whether the compiler supports constructor
901         priorities.  Define a CONSTRUCTOR_PRIORITY automake conditional.
902         * testsuite/initpri1.c: New file.
903         * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
904         CONSTRUCTOR_PRIORITY.
905         (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
906         (initpri1_LDFLAGS): New variable.
907         * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
908
909 2008-03-27  Ian Lance Taylor  <iant@google.com>
910
911         * common.cc (Sort_commons::operator): Correct sorting algorithm.
912         * testsuite/common_test_1.c: New file.
913         * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
914         (common_test_1_SOURCES): New variable.
915         (common_test_1_DEPENDENCIES): New variable.
916         (common_test_1_LDFLAGS): New variable.
917
918         * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
919         and commons_ correctly when NAME/VERSION does not override
920         NAME/NULL.
921         * testsuite/ver_test_6.c: New file.
922         * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
923         (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
924         (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
925
926 2008-03-26  Ian Lance Taylor  <iant@google.com>
927
928         * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
929         of an undefined symbol from a version script.
930         * testsuite/Makefile.am (ver_test_5.so): New target.
931         (ver_test_5.o): New target.
932         (check_SCRIPTS): Add ver_test_5.sh.
933         (check_DATA): Add ver_test_5.syms.
934         (ver_test_5.syms): New target.
935         * testsuite/ver_test_5.cc: New file.
936         * testsuite/ver_test_5.script: New file.
937         * testsuite/ver_test_5.sh: New file.
938         * Makefile.in, testsuite/Makefile.in: Rebuild.
939
940         PR gold/5986
941         Fix problems building gold with gcc 4.3.0.
942         * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
943         (gold_error_at_location, gold_warning_at_location): Use it.
944         * configure.ac: Check whether we can compile and use a template
945         function with a printf attribute.
946         * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
947         when jumping over bytes.
948         * object.cc: Instantiate Object::read_section_data.
949         * debug.h: Include <cstring>
950         * dwarf_reader.cc: Include <algorithm>
951         * main.cc: Include <cstring>.
952         * options.cc: Include <cstring>.
953         * output.cc: Include <cstring>.
954         * script.cc: Include <cstring>.
955         * script.h: Include <string>.
956         * symtab.cc: Include <cstring> and <algorithm>.
957         * target-select.cc: Include <cstring>.
958         * version.cc: Include <string>.
959         * testsuite/testmain.cc: Include <cstdlib>.
960         * configure, config.in: Rebuild.
961
962 2008-03-25  Ian Lance Taylor  <iant@google.com>
963
964         * options.cc: Include "../bfd/bfdver.h".
965         (options::help): Print bug reporting address.
966
967         * version.cc (print_version): Adjust output for current value of
968         BFD_VERSION_STRING.
969
970         * NEWS: New file.
971
972         * options.cc (options::help): Print list of supported targets.
973         * target-select.h: Include <vector>.
974         (class Target_selector): Make machine_, size_, and is_big_endian_
975         fields const.  Add bfd_name_ and instantiated_target_ fields.
976         (Target_selector::Target_selector): Add bfd_name parameter.
977         (Target_selector::recognize): Make non-virtual, call
978         do_recognize.
979         (Target_selector::recognize_by_name): Make non-virtual, call
980         do_recognize_by_name.
981         (Target_selector::supported_names): New function.
982         (Target_selector::bfd_name): New function.
983         (Target_selector::do_instantiate_target): New pure virtual
984         function.
985         (Target_selector::do_recognize): New virtual function.
986         (Target_selector::do_recognize_by_name): New virtual function.
987         (Target_selector::instantiate_target): New private function.
988         (supported_target_names): Declare.
989         * target-select.cc (Target_selector::Target_selector): Update for
990         new parameter and fields.
991         (select_target_by_name): Check that the name matches before
992         calling recognize_by_name.
993         (supported_target_names): New function.
994         * i386.cc (class Target_selector_i386): Update Target_selector
995         constructor call.  Remove recognize and recognize_by_name.  Add
996         do_instantiate_target.
997         * x86_64.cc (class Target_selector_x86_64): Likewise.
998         * testsuite/testfile.cc (class Target_selector_test): Update for
999         changes to Target_selector.
1000
1001         * README: Rewrite, with some notes on unsupported features.
1002
1003 2008-03-24  Cary Coutant  <ccoutant@google.com>
1004
1005         * i386.cc (Target_i386::Got_type): New enum declaration.
1006         (Target_i386::Scan::local): Updated callers of Output_data_got
1007         member functions.
1008         (Target_i386::Scan::global): Likewise.
1009         (Target_i386::Relocate::relocate): Likewise.
1010         (Target_i386::Relocate::relocate_tls): Likewise.
1011         * object.h (Got_offset_list): New class.
1012         (Sized_relobj::local_has_got_offset): Added got_type parameter.
1013         (Sized_relobj::local_got_offset): Likewise.
1014         (Sized_relobj::set_local_got_offset): Likewise.
1015         (Sized_relobj::local_has_tls_got_offset): Removed.
1016         (Sized_relobj::local_tls_got_offset): Removed.
1017         (Sized_relobj::set_local_tls_got_offset): Removed.
1018         (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
1019         * output.cc (Output_data_got::add_global): Added got_type parameter.
1020         (Output_data_got::add_global_with_rel): Likewise.
1021         (Output_data_got::add_global_with_rela): Likewise.
1022         (Output_data_got::add_global_pair_with_rel): New function.
1023         (Output_data_got::add_global_pair_with_rela): New function.
1024         (Output_data_got::add_local): Added got_type parameter.
1025         (Output_data_got::add_local_with_rel): Likewise.
1026         (Output_data_got::add_local_with_rela): Likewise.
1027         (Output_data_got::add_local_pair_with_rel): New function.
1028         (Output_data_got::add_local_pair_with_rela): New function.
1029         (Output_data_got::add_global_tls): Removed.
1030         (Output_data_got::add_global_tls_with_rel): Removed.
1031         (Output_data_got::add_global_tls_with_rela): Removed.
1032         (Output_data_got::add_local_tls): Removed.
1033         (Output_data_got::add_local_tls_with_rel): Removed.
1034         (Output_data_got::add_local_tls_with_rela): Removed.
1035         * output.h (Output_data_got::add_global): Added got_type parameter.
1036         (Output_data_got::add_global_with_rel): Likewise.
1037         (Output_data_got::add_global_with_rela): Likewise.
1038         (Output_data_got::add_global_pair_with_rel): New function.
1039         (Output_data_got::add_global_pair_with_rela): New function.
1040         (Output_data_got::add_local): Added got_type parameter.
1041         (Output_data_got::add_local_with_rel): Likewise.
1042         (Output_data_got::add_local_with_rela): Likewise.
1043         (Output_data_got::add_local_pair_with_rel): New function.
1044         (Output_data_got::add_local_pair_with_rela): New function.
1045         (Output_data_got::add_global_tls): Removed.
1046         (Output_data_got::add_global_tls_with_rel): Removed.
1047         (Output_data_got::add_global_tls_with_rela): Removed.
1048         (Output_data_got::add_local_tls): Removed.
1049         (Output_data_got::add_local_tls_with_rel): Removed.
1050         (Output_data_got::add_local_tls_with_rela): Removed.
1051         * resolve.cc (Symbol::override_base_with_special): Removed
1052         reference to has_got_offset_ field.
1053         * symtab.cc (Symbol::init_fields): Replaced initialization
1054         of got_offset_ with got_offsets_.  Removed initialization
1055         of has_got_offset_
1056         * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
1057         (Symbol::got_offset): Likewise.
1058         (Symbol::set_got_offset): Likewise.
1059         (Symbol::has_tls_got_offset): Removed.
1060         (Symbol::tls_got_offset): Removed.
1061         (Symbol::set_tls_got_offset): Removed.
1062         (Symbol::got_offset_): Removed.
1063         (Symbol::tls_mod_got_offset_): Removed.
1064         (Symbol::tls_pair_got_offset_): Removed.
1065         (Symbol::got_offsets_): New field.
1066         (Symbol::has_got_offset): Removed.
1067         (Symbol::has_tls_mod_got_offset): Removed.
1068         (Symbol::has_tls_pair_got_offset): Removed.
1069         * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
1070         (Target_x86_64::Scan::local): Updated callers of Output_data_got
1071         member functions.
1072         (Target_x86_64::Scan::global): Likewise.
1073         (Target_x86_64::Relocate::relocate): Likewise.
1074         (Target_x86_64::Relocate::relocate_tls): Likewise.
1075
1076 2008-03-25  Ben Elliston  <bje@au.ibm.com>
1077
1078         * yyscript.y: Fix spelling error in comment.
1079
1080 2008-03-24  Ian Lance Taylor  <iant@google.com>
1081
1082         * options.h (class General_options): Define build_id option.
1083         * layout.h (class Layout): Declare write_build_id, create_note,
1084         create_build_id.  Add build_id_note_ member.
1085         * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
1086         "libiberty.h", "md5.h", "sha1.h".
1087         (Layout::Layout): Initialize eh_frame_data_,
1088         eh_frame_hdr_section_, and build_id_note_.
1089         (Layout::finalize): Call create_build_id.
1090         (Layout::create_note): New function, broken out of
1091         Layout::create_gold_note.
1092         (Layout::create_gold_note): Call create_note.
1093         (Layout::create_build_id): New function.
1094         (Layout::write_build_id): New function.
1095         (Close_task_runner::run): Call write_build_id.
1096
1097         * x86_64.cc: Correct license to GPLv3.
1098
1099 2008-03-23  Ian Lance Taylor  <iant@google.com>
1100
1101         * options.cc: Include "demangle.h".
1102         (parse_optional_string): New function.
1103         (parse_long_option): Handle takes_optional_argument.
1104         (parse_short_option): Update dash_z initializer.  Handle
1105         takes_optional_argument.
1106         (General_options::General_options): Initialize do_demangle_.
1107         (General_options::finalize): Set do_demangle_.  Handle demangling
1108         style.
1109         * options.h (parse_optional_string): Declare.
1110         (struct One_option): Add optional_arg field.  Update constructor.
1111         Update call constructor calls.  Add takes_optional_argument
1112         function.
1113         (DEFINE_var): Add optional_arg__ parameter.  Change all callers.
1114         (DEFINE_optional_string): Define.
1115         (General_options::demangle): Change from DEFINE_bool to
1116         DEFINE_optional_string.
1117         (General_options::no_demangle): New function.
1118         (General_options::do_demangle): New function.
1119         (General_options::set_do_demangle): New function.
1120         (General_options::execstack_status_): Move definition to end of
1121         class definition.
1122         (General_options::static_): Likewise.
1123         (General_options::do_demangle_): New field.
1124         * object.cc (big_endian>::get_symbol_location_info): Call
1125         Options::do_demangle, not Options::demangle.
1126         * symtab.cc (demangle): Likewise.
1127
1128 2008-03-22  Ian Lance Taylor  <iant@google.com>
1129
1130         * gold.h: Include <cstddef> and <sys/types.h>
1131         * options.h: Include <cstring>.
1132
1133 2008-03-21  Ian Lance Taylor  <iant@google.com>
1134
1135         * Added source code to GNU binutils.
1136