* testsuite/script_test_4.sh: Permit leading zeroes.
[binutils.git] / gold / ChangeLog
blobf749dea9ffc3225bab4097d82b22a2f41f3a9ff3
1 2008-04-16  Ian Lance Taylor  <iant@google.com>
3         * testsuite/script_test_4.sh: Permit leading zeroes.
5 2008-04-15  Ian Lance Taylor  <iant@google.com>
7         * script-sections.cc (Script_sections::create_segments): Use
8         header_size_adjustment even when there is enough room for the
9         headers.
10         * testsuite/script_test_4.sh: New file.
11         * testsuite/script_test_4.t: New file.
12         * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13         (check_DATA): Add script_test_4.stdout.
14         (MOSTLYCLEANFILES): Likewise.
15         (script_test_4): New target.
16         (script_test_4.stdout): New target.
17         * testsuite/Makefile.in: Rebuild.
19         * sparc.cc: Add definitions for Output_data_plt_sparc class
20         constants.
22 2008-04-14  David S. Miller  <davem@davemloft.net>
24         * sparc.cc: New file.
25         * Makefile.am (TARGETSOURCES): Add sparc.cc
26         (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
27         * configure.tgt: Document targ_extra_size and
28         targ_extra_big_endian.  Add entries for sparc-* and
29         sparc64-*.
30         * configure.ac: Handle targ_extra_size and
31         targ_extra_big_endian.
32         * Makefile.in: Rebuild.
33         * configure: Likewise.
34         * po/POTFILES.in: Likewise.
35         * po/gold.pot: Likewise.
37 2008-04-14  Ian Lance Taylor  <iant@google.com>
39         * layout.cc (Layout::Layout): Initialize sections_are_attached_.
40         (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
41         in the name/type/flags to section mapping.  Don't call
42         allocate_output_section.
43         (Layout::choose_output_section): Change parameter from adjust_name
44         to is_input_section.  Don't permit input sections after sections
45         are attached to segments.  Don't call allocate_output_section.
46         (Layout::layout_eh_frame): Call update_flags_for_input_section,
47         not write_enable_output_section.
48         (Layout::make_output_section): Don't push to
49         unattached_section_list_ nor call attach_to_segment.  Call
50         attach_section_to_segment if sections are attached.
51         (Layout::attach_sections_to_segments): New function.
52         (Layout::attach_section_to_segment): New function.
53         (Layout::attach_allocated_section_to_segment): Rename from
54         attach_to_segment.  Remove flags parameter.
55         (Layout::allocate_output_section): Remove function.
56         (Layout::write_enable_output_section): Remove function.
57         * layout.h (class Layout): Update for above changes.  Add new
58         field sections_are_attached_.
59         * output.h (Output_section::update_flags_for_input_section): New
60         function.
61         * output.cc (Output_section::add_input_section): Call
62         update_flags_for_input_section.
63         * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
65 2008-04-11  Cary Coutant  <ccoutant@google.com>
67         * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
68         thought unnecessary.
69         * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
71 2008-04-11  Ian Lance Taylor  <iant@google.com>
73         * output.h (class Output_section_data): Remove inline definition
74         of set_addralign.
75         * output.cc (Output_section_data::set_addralign): New function.
77 2008-04-11  Cary Coutant  <ccoutant@google.com>
79         Add support for TLS descriptors for i386 and x86_64.
80         * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
81         (Target_i386::Relocate::tls_desc_gd_to_le): New function.
82         (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
83         GOT_TYPE_TLS_DESC.
84         (Target_i386::got_mod_index_entry): Remove unnecessary code.
85         (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
86         R_386_TLS_DESC_CALL relocations.  Fix problem with initial-exec
87         relocations.
88         (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
89         Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
90         Fix problem with initial-exec relocations.
91         (Target_i386::Relocate::relocate_tls): Likewise.
92         (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
93         relaxation.
94         * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
95         support for section-plus-offset dynamic table entries.
96         * output.h (Output_data_dynamic::add_section_plus_offset): New function.
97         (Output_data_dynamic::Dynamic_entry): Add support for
98         section-plus-offset dynamic table entries.
99         (Output_data_dynamic::Classification): Likewise.
100         (Output_data_dynamic::classification_): Renamed offset_.
101         * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
102         (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
103         (Target_x86_64::make_plt_section): New function.
104         (Target_x86_64::reserve_tlsdesc_entries): New function.
105         (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
106         (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
107         (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
108         (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
109         (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
110         (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
111         (Output_data_plt_x86_64::set_final_data_size): Move out of line;
112         add extra PLT entry for TLS descriptors.
113         (Output_data_plt_x86_64::got_): New field.
114         (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
115         (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
116         fields.
117         (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
118         descriptors.
119         (Target_x86_64::make_plt_entry): Factor out make_plt_section.
120         (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
121         (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
122         R_386_TLS_DESC_CALL relocations.
123         (Target_x86_64::Scan::global): Likewise.
124         (Target_x86_64::do_finalize_sections): Add dynamic table entries
125         for TLS descriptors.
126         (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
127         Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
128         (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
129         GD-to-IE relaxation.
130         * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
131         and TLS_DESCRIPTORS.
132         * Makefile.in: Rebuild.
133         * configure: Rebuild.
134         * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
135         (tls_test_shared2.so): New target.
136         (tls_shared_gd_to_ie_test_SOURCES): New variable.
137         (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
138         (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
139         (tls_shared_gd_to_ie_test_LDADD): New variable.
140         (tls_shared_gnu2_gd_to_ie_test): New target.
141         (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
142         New targets.
143         (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
144         (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
145         (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
146         (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
147         (tls_shared_gnu2_test): New target.
148         (tls_test_gnu2_shared.so): New target.
149         (tls_shared_gnu2_test_SOURCES): New variable.
150         (tls_shared_gnu2_test_DEPENDENCIES): New variable.
151         (tls_shared_gnu2_test_LDFLAGS): New variable.
152         (tls_shared_gnu2_test_LDADD): New variable.
153         * testsuite/Makefile.in: Rebuild.
154         * testsuite/Makefile.
156 2008-04-11  Ian Lance Taylor  <iant@google.com>
158         * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
159         justsyms.t.
160         * testsuite/Makefile.in: Rebuild.
162         * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
163         long.
164         * testsuite/script_test_2.cc (main): Adjust test.
166 2008-04-11  David S. Miller  <davem@davemloft.net>
167             Ian Lance Taylor  <iant@google.com>
169         * options.h (General_options): Add entries for '-Y' and
170         '-relax'.
171         * options.cc (General_options:finalize): If -Y was used, add those
172         entries to the library path instead of the default "/lib" and
173         "/usr/lib".
175 2008-04-11  David S. Miller  <davem@davemloft.net>
177         * testsuite/justsyms.t: Start at 0x100.
178         * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
179         * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
180         long.
181         * testsuite/script_test_2.cc: Adjust string and section length
182         checks.
184 2008-04-09  Ian Lance Taylor  <iant@google.com>
186         PR gold/5996
187         * script-sections.cc (Sections_element::allocate_to_segment): Add
188         orphan parameter.
189         (Output_section_definition::allocate_to_segment): Likewise.
190         (Orphan_output_section::allocate_to_segment): Likewise.
191         (Script_sections::attach_sections_using_phdrs_clause): Don't
192         propagate non-PT_LOAD segments to orphan sections.
193         * testsuite/Makefile.am (script_test_3.stdout): Generate using
194         readelf rather than objdump.
195         * testsuite/script_test_3.sh: Adjust accordingly.  Test that
196         .interp section and PT_INTERP segment are the same size.
197         * testsuite/Makefile.in: Rebuild.
199         * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
200         aliases for symbols defined in the same object.
201         * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
202         (weak_alias_test_SOURCES): New variable.
203         (weak_alias_test_DEPENDENCIES): New variable.
204         (weak_alias_test_LDFLAGS): New variable.
205         (weak_alias_test_LDADD): New variable.
206         (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
207         (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
208         (weak_alias_test_3.o): New target.
209         (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
210         * testsuite/weak_alias_test_main.cc: New file.
211         * testsuite/weak_alias_test_1.cc: New file.
212         * testsuite/weak_alias_test_2.cc: New file.
213         * testsuite/weak_alias_test_3.cc: New file.
215 2008-04-08  Ian Lance Taylor  <iant@google.com>
217         * options.h (class General_options): Add --noinhibit-exec option.
218         * main.cc (main): Check --noinhibit-exec.
220         * options.h (class General_options): Define --wrap as a special
221         option.  Add wrap_symbols_ field.
222         (General_options::any_wrap_symbols): New function.
223         (General_options::is_wrap_symbol): New function.
224         * options.cc (General_options::parse_wrap): New function.
225         (General_options::General_options): Initialize wrap_symbols_.
226         * symtab.cc (Symbol_table::wrap_symbol): New function.
227         (Symbol_table::add_from_object): Handle --wrap.
228         * symtab.h (class Symbol_table): Declare wrap_symbol.
229         * target.h (Target::wrap_char): New function.
230         (Target::Target_info): Add wrap_char field.
231         * i386.cc (Target_i386::i386_info): Initialize wrap_char.
232         * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
233         * testsuite/testfile.cc (Target_test::test_target_info):
234         Likewise.
236         * errors.cc (Errors::undefined_symbol): Mention symbol version if
237         there is one.
239         * layout.h (class Layout): Add added_eh_frame_data_ field.
240         * layout.cc (Layout::Layout): Initialize new field.
241         (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
242         output section until we find a section we merged successfully.
243         * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
244         that the size be non-zero.
246         * merge.cc (Object_merge_map::get_output_offset): Remove inline
247         qualifier.
249 2008-04-08  Craig Silverstein  <csilvers@google.com>
251         * configure.ac: Export new conditional variable HAVE_ZLIB.
252         * testsuite/Makefile.am (flagstest_o_specialfile): Condition
253         on HAVE_ZLIB.
254         (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
255         * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
257 2008-04-07  Ian Lance Taylor  <iant@google.com>
259         * version.cc (version_string): Set to "1.5".
261         * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
262         Add issued_non_pic_error_ field.  Declare check_non_pic.
263         (Target_x86_64::Scan::check_non_pic): New function.
264         (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
265         (Target_x86_64::Scan::global): Likewise.
267         * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
268         addend parameter.  Change caller.  Handle merge sections.
269         (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
270         Address to Addend.  Don't add in the result of
271         local_section_offset, pass down the addend and use the returned
272         value.
273         * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
274         Update declarations of local_section_offset and symbol_value.
275         * testsuite/two_file_test_1.cc (t18): New function.
276         * testsuite/two_file_test_2.cc (f18): New function.
277         * testsuite/two_file_test_main.cc (main): Call t18.
278         * testsuite/two_file_test.h (t18, f18): Declare.
280         * configure.ac: Don't test for objdump, c++filt, or readelf.
281         * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
282         conditionals.
283         (TEST_READELF): New variable.
284         (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
285         (check_PROGRAMS): Add two_file_strip_test.
286         (two_file_strip_test): New target.
287         (check_PROGRAMS): Add two_file_same_shared_strip_test.
288         (two_file_same_shared_strip_test_SOURCES): New variable.
289         (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
290         (two_file_same_shared_strip_test_LDFLAGS): New variable.
291         (two_file_same_shared_strip_test_LDADD): New variable.
292         (two_file_shared_strip.so): New target.
293         (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
294         (ver_test_5.syms, ver_test_7.syms): Likewise.
295         (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
296         (strip_test_3.stdout): Use TEST_OBJDUMP.
297         * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
299 2008-04-04  Cary Coutant  <ccoutant@google.com>
301         * symtab.h (Symbol::is_weak_undefined): New function.
302         (Symbol::is_strong_undefined): New function.
303         (Symbol::is_absolute): New function.
304         (Symbol::needs_plt_entry): Exclude weak undefined symbols.
305         (Symbol::needs_dynamic_reloc): Exclude weak undefined and
306         absolute symbols.
307         * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
308         (weak_undef_test): New target.
309         * testsuite/Makefile.in: Rebuild.
310         * testsuite/weak_undef_file1.cc: New file.
311         * testsuite/weak_undef_file2.cc: New file.
312         * testsuite/weak_undef_test.cc: New file.
314 2008-04-03  Craig Silverstein  <csilvers@google.com>
316         * compressed_output.h (class Output_compressed_section): Use
317         unsigned buffer.
318         * compressed_output.cc (zlib_compress): Use unsigned buffers,
319         add zlib header.
320         (zlib_compressed_suffix): Removed.
321         (Output_compressed_section::set_final_data_size): Use unsigned
322         buffers.
323         * testsuite/Makefile.am (flagstest_compress_debug_sections):
324         Fix linker invocation.
325         (flagstest_o_specialfile_and_compress_debug_sections):
326         Likewise.
327         * testsuite/Makefile.in: Regenerated.
329 2008-04-02  David S. Miller  <davem@davemloft.net>
331         *  dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
332         Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
334 2008-04-02  Craig Silverstein  <csilvers@google.com>
336         * TODO: New file.
338 2008-04-02  Ian Lance Taylor  <iant@google.com>
340         * fileread.cc (File_read::find_view): Add byteshift and vshifted
341         parameters.  Update for new key type to views_.  Change all
342         callers.
343         (File_read::read): Adjust for byteshift in returned view.
344         (File_read::add_view): New function, broken out of
345         find_and_make_view.
346         (File_read::make_view): New function, broken out of
347         find_and_make_view.
348         (File_read::find_or_make_view): Add offset and aligned
349         parameters.  Rewrite accordingly.  Change all callers.
350         (File_read::get_view): Add offset and aligned parameters.  Adjust
351         for byteshift in return value.
352         (File_read::get_lasting_view): Likewise.
353         * fileread.h (class File_read): Update declarations.
354         (class File_read::View): Add byteshift_ field.  Add byteshift to
355         constructor.  Add byteshift method.
356         * archive.h (Archive::clear_uncached_views): New function.
357         (Archive::get_view): Add aligned parameter.  Change all callers.
358         * object.h (Object::get_view): Add aligned parameter.  Change all
359         callers.
360         (Object::get_lasting_view): Likewise.
362         * fileread.cc (File_read::release): Don't call clear_views if
363         there are multiple objects.
364         * fileread.h (File_read::clear_uncached_views): New function.
365         * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
366         on the archive.
368 2008-03-31  Cary Coutant  <ccoutant@google.com>
370         Add thin archive support.
371         * archive.cc (Archive::armagt): New const.
372         (Archive::setup): Remove task parameter and calls to unlock.
373         (Archive::unlock_nested_archives): New function.
374         (Archive::read_header): Add nested_off parameter. Change
375         all callers.
376         (Archive::interpret_header): Likewise.
377         (Archive::include_all_members): Change to handle thin
378         archives.
379         (Archive::include_member): Likewise.
380         * archive.h (Archive::Archive): Add new parameters and
381         initializers.
382         (Archive::armagt): New const.
383         (Archive::setup): Remove task parameter.
384         (Archive::unlock_nested_archives): New function.
385         (Archive::read_header): Add nested_off parameter.
386         (Archive::interpret_header): Likewise.
387         (Archive::Nested_archive_table): New typedef.
388         (Archive::is_thin_archive_): New field.
389         (Archive::nested_archives_): New field.
390         (Archive::options_): New field.
391         (Archive::dirpath_): New field.
392         (Archive::task_): New field.
393         * readsyms.cc (Read_symbols::do_read_symbols): Add check
394         for thin archives.  Pass additional parameters to
395         Archive::Archive.  Unlock the archive file after calling
396         Archive::setup.
397         
398 2008-03-29  Ian Lance Taylor  <iant@google.com>
400         * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
401         version symbol to be local.
402         * testsuite/ver_test_4.sh: New file.
403         * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
404         (check_DATA): Add ver_test_4.syms.
405         (ver_test_4.syms): New target.
406         * testsuite/Makefile.in: Rebuild.
408         * output.cc
409         (Output_section::Input_section_sort_entry::has_priority): New
410         function.
411         (Output_section::Input_section_sort_entry::match_file_name): New
412         function.
413         (Output_section::Input_section_sort_entry::match_section_name):
414         Remove.
415         (Output_section::Input_section_sort_entry::match_section_name_prefix):
416         Remove.
417         (Output_section::Input_section_sort_entry::match_section_file):
418         Remove.
419         (Output_section::Input_section_sort_compare::operator()): Rewrite
420         using new Input_section_sort_entry functions.  Sort crtbegin and
421         crtend first.  Sort sections with no priority before sections with
422         a priority.
423         * testsuite/initpri1.c (d3): Check j != 4.
424         (cd5): New constructor/destructor function.
425         (main): Check j != 2.
427         * symtab.cc (Symbol_table::add_from_object): If we don't use the
428         new symbol when resolving, don't call set_is_default.
429         * testsuite/ver_test_7.cc: New file.
430         * testsuite/ver_test_7.sh: New file.
431         * testsuite/Makefile.am (ver_test_7.so): New target.
432         (ver_test_7.o): New target.
433         (check_SCRIPTS): Add ver_test_7.sh.
434         (check_DATA): Add ver_test_7.syms.
435         (ver_test_7.syms): New target.
437 2008-03-28  Ian Lance Taylor  <iant@google.com>
439         * layout.cc (Layout::layout): If we see an input section with a
440         name that needs sorting, set the must_sort flag for the output
441         section.
442         (Layout::make_output_section): If the name of the output section
443         indicates that it might require sorting, set the may_sort flag.
444         * output.h (Output_section::may_sort_attached_input_sections): New
445         function.
446         (Output_section::set_may_sort_attached_input_sections): New
447         function.
448         (Output_section::must_sort_attached_input_sections): New
449         function.
450         (Output_section::set_must_sort_attached_input_sections): New
451         function.
452         (class Output_section): Declare Input_section_sort_entry.  Define
453         Input_section_sort_compare.  Declare
454         sort_attached_input_sections.  Add new fields:
455         may_sort_attached_input_sections_,
456         must_sort_attached_input_sections_,
457         attached_input_sections_are_sorted_.
458         * output.cc (Output_section::Output_section): Initialize new
459         fields.
460         (Output_section::add_input_section): Add an entry to
461         input_sections_ if may_sort or must_sort are true.
462         (Output_section::set_final_data_size): Call
463         sort_attached_input_sections if necessary.
464         (Output_section::Input_section_sort_entry): Define new class.
465         (Output_section::Input_section_sort_compare::operator()): New
466         function.
467         (Output_section::sort_attached_input_sections): New function.
468         * configure.ac: Check whether the compiler supports constructor
469         priorities.  Define a CONSTRUCTOR_PRIORITY automake conditional.
470         * testsuite/initpri1.c: New file.
471         * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
472         CONSTRUCTOR_PRIORITY.
473         (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
474         (initpri1_LDFLAGS): New variable.
475         * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
477 2008-03-27  Ian Lance Taylor  <iant@google.com>
479         * common.cc (Sort_commons::operator): Correct sorting algorithm.
480         * testsuite/common_test_1.c: New file.
481         * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
482         (common_test_1_SOURCES): New variable.
483         (common_test_1_DEPENDENCIES): New variable.
484         (common_test_1_LDFLAGS): New variable.
486         * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
487         and commons_ correctly when NAME/VERSION does not override
488         NAME/NULL.
489         * testsuite/ver_test_6.c: New file.
490         * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
491         (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
492         (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
494 2008-03-26  Ian Lance Taylor  <iant@google.com>
496         * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
497         of an undefined symbol from a version script.
498         * testsuite/Makefile.am (ver_test_5.so): New target.
499         (ver_test_5.o): New target.
500         (check_SCRIPTS): Add ver_test_5.sh.
501         (check_DATA): Add ver_test_5.syms.
502         (ver_test_5.syms): New target.
503         * testsuite/ver_test_5.cc: New file.
504         * testsuite/ver_test_5.script: New file.
505         * testsuite/ver_test_5.sh: New file.
506         * Makefile.in, testsuite/Makefile.in: Rebuild.
508         PR gold/5986
509         Fix problems building gold with gcc 4.3.0.
510         * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
511         (gold_error_at_location, gold_warning_at_location): Use it.
512         * configure.ac: Check whether we can compile and use a template
513         function with a printf attribute.
514         * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
515         when jumping over bytes.
516         * object.cc: Instantiate Object::read_section_data.
517         * debug.h: Include <cstring>
518         * dwarf_reader.cc: Include <algorithm>
519         * main.cc: Include <cstring>.
520         * options.cc: Include <cstring>.
521         * output.cc: Include <cstring>.
522         * script.cc: Include <cstring>.
523         * script.h: Include <string>.
524         * symtab.cc: Include <cstring> and <algorithm>.
525         * target-select.cc: Include <cstring>.
526         * version.cc: Include <string>.
527         * testsuite/testmain.cc: Include <cstdlib>.
528         * configure, config.in: Rebuild.
530 2008-03-25  Ian Lance Taylor  <iant@google.com>
532         * options.cc: Include "../bfd/bfdver.h".
533         (options::help): Print bug reporting address.
535         * version.cc (print_version): Adjust output for current value of
536         BFD_VERSION_STRING.
538         * NEWS: New file.
540         * options.cc (options::help): Print list of supported targets.
541         * target-select.h: Include <vector>.
542         (class Target_selector): Make machine_, size_, and is_big_endian_
543         fields const.  Add bfd_name_ and instantiated_target_ fields.
544         (Target_selector::Target_selector): Add bfd_name parameter.
545         (Target_selector::recognize): Make non-virtual, call
546         do_recognize.
547         (Target_selector::recognize_by_name): Make non-virtual, call
548         do_recognize_by_name.
549         (Target_selector::supported_names): New function.
550         (Target_selector::bfd_name): New function.
551         (Target_selector::do_instantiate_target): New pure virtual
552         function.
553         (Target_selector::do_recognize): New virtual function.
554         (Target_selector::do_recognize_by_name): New virtual function.
555         (Target_selector::instantiate_target): New private function.
556         (supported_target_names): Declare.
557         * target-select.cc (Target_selector::Target_selector): Update for
558         new parameter and fields.
559         (select_target_by_name): Check that the name matches before
560         calling recognize_by_name.
561         (supported_target_names): New function.
562         * i386.cc (class Target_selector_i386): Update Target_selector
563         constructor call.  Remove recognize and recognize_by_name.  Add
564         do_instantiate_target.
565         * x86_64.cc (class Target_selector_x86_64): Likewise.
566         * testsuite/testfile.cc (class Target_selector_test): Update for
567         changes to Target_selector.
569         * README: Rewrite, with some notes on unsupported features.
571 2008-03-24  Cary Coutant  <ccoutant@google.com>
573         * i386.cc (Target_i386::Got_type): New enum declaration.
574         (Target_i386::Scan::local): Updated callers of Output_data_got
575         member functions.
576         (Target_i386::Scan::global): Likewise.
577         (Target_i386::Relocate::relocate): Likewise.
578         (Target_i386::Relocate::relocate_tls): Likewise.
579         * object.h (Got_offset_list): New class.
580         (Sized_relobj::local_has_got_offset): Added got_type parameter.
581         (Sized_relobj::local_got_offset): Likewise.
582         (Sized_relobj::set_local_got_offset): Likewise.
583         (Sized_relobj::local_has_tls_got_offset): Removed.
584         (Sized_relobj::local_tls_got_offset): Removed.
585         (Sized_relobj::set_local_tls_got_offset): Removed.
586         (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
587         * output.cc (Output_data_got::add_global): Added got_type parameter.
588         (Output_data_got::add_global_with_rel): Likewise.
589         (Output_data_got::add_global_with_rela): Likewise.
590         (Output_data_got::add_global_pair_with_rel): New function.
591         (Output_data_got::add_global_pair_with_rela): New function.
592         (Output_data_got::add_local): Added got_type parameter.
593         (Output_data_got::add_local_with_rel): Likewise.
594         (Output_data_got::add_local_with_rela): Likewise.
595         (Output_data_got::add_local_pair_with_rel): New function.
596         (Output_data_got::add_local_pair_with_rela): New function.
597         (Output_data_got::add_global_tls): Removed.
598         (Output_data_got::add_global_tls_with_rel): Removed.
599         (Output_data_got::add_global_tls_with_rela): Removed.
600         (Output_data_got::add_local_tls): Removed.
601         (Output_data_got::add_local_tls_with_rel): Removed.
602         (Output_data_got::add_local_tls_with_rela): Removed.
603         * output.h (Output_data_got::add_global): Added got_type parameter.
604         (Output_data_got::add_global_with_rel): Likewise.
605         (Output_data_got::add_global_with_rela): Likewise.
606         (Output_data_got::add_global_pair_with_rel): New function.
607         (Output_data_got::add_global_pair_with_rela): New function.
608         (Output_data_got::add_local): Added got_type parameter.
609         (Output_data_got::add_local_with_rel): Likewise.
610         (Output_data_got::add_local_with_rela): Likewise.
611         (Output_data_got::add_local_pair_with_rel): New function.
612         (Output_data_got::add_local_pair_with_rela): New function.
613         (Output_data_got::add_global_tls): Removed.
614         (Output_data_got::add_global_tls_with_rel): Removed.
615         (Output_data_got::add_global_tls_with_rela): Removed.
616         (Output_data_got::add_local_tls): Removed.
617         (Output_data_got::add_local_tls_with_rel): Removed.
618         (Output_data_got::add_local_tls_with_rela): Removed.
619         * resolve.cc (Symbol::override_base_with_special): Removed
620         reference to has_got_offset_ field.
621         * symtab.cc (Symbol::init_fields): Replaced initialization
622         of got_offset_ with got_offsets_.  Removed initialization
623         of has_got_offset_
624         * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
625         (Symbol::got_offset): Likewise.
626         (Symbol::set_got_offset): Likewise.
627         (Symbol::has_tls_got_offset): Removed.
628         (Symbol::tls_got_offset): Removed.
629         (Symbol::set_tls_got_offset): Removed.
630         (Symbol::got_offset_): Removed.
631         (Symbol::tls_mod_got_offset_): Removed.
632         (Symbol::tls_pair_got_offset_): Removed.
633         (Symbol::got_offsets_): New field.
634         (Symbol::has_got_offset): Removed.
635         (Symbol::has_tls_mod_got_offset): Removed.
636         (Symbol::has_tls_pair_got_offset): Removed.
637         * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
638         (Target_x86_64::Scan::local): Updated callers of Output_data_got
639         member functions.
640         (Target_x86_64::Scan::global): Likewise.
641         (Target_x86_64::Relocate::relocate): Likewise.
642         (Target_x86_64::Relocate::relocate_tls): Likewise.
644 2008-03-25  Ben Elliston  <bje@au.ibm.com>
646         * yyscript.y: Fix spelling error in comment.
648 2008-03-24  Ian Lance Taylor  <iant@google.com>
650         * options.h (class General_options): Define build_id option.
651         * layout.h (class Layout): Declare write_build_id, create_note,
652         create_build_id.  Add build_id_note_ member.
653         * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
654         "libiberty.h", "md5.h", "sha1.h".
655         (Layout::Layout): Initialize eh_frame_data_,
656         eh_frame_hdr_section_, and build_id_note_.
657         (Layout::finalize): Call create_build_id.
658         (Layout::create_note): New function, broken out of
659         Layout::create_gold_note.
660         (Layout::create_gold_note): Call create_note.
661         (Layout::create_build_id): New function.
662         (Layout::write_build_id): New function.
663         (Close_task_runner::run): Call write_build_id.
665         * x86_64.cc: Correct license to GPLv3.
667 2008-03-23  Ian Lance Taylor  <iant@google.com>
669         * options.cc: Include "demangle.h".
670         (parse_optional_string): New function.
671         (parse_long_option): Handle takes_optional_argument.
672         (parse_short_option): Update dash_z initializer.  Handle
673         takes_optional_argument.
674         (General_options::General_options): Initialize do_demangle_.
675         (General_options::finalize): Set do_demangle_.  Handle demangling
676         style.
677         * options.h (parse_optional_string): Declare.
678         (struct One_option): Add optional_arg field.  Update constructor.
679         Update call constructor calls.  Add takes_optional_argument
680         function.
681         (DEFINE_var): Add optional_arg__ parameter.  Change all callers.
682         (DEFINE_optional_string): Define.
683         (General_options::demangle): Change from DEFINE_bool to
684         DEFINE_optional_string.
685         (General_options::no_demangle): New function.
686         (General_options::do_demangle): New function.
687         (General_options::set_do_demangle): New function.
688         (General_options::execstack_status_): Move definition to end of
689         class definition.
690         (General_options::static_): Likewise.
691         (General_options::do_demangle_): New field.
692         * object.cc (big_endian>::get_symbol_location_info): Call
693         Options::do_demangle, not Options::demangle.
694         * symtab.cc (demangle): Likewise.
696 2008-03-22  Ian Lance Taylor  <iant@google.com>
698         * gold.h: Include <cstddef> and <sys/types.h>
699         * options.h: Include <cstring>.
701 2008-03-21  Ian Lance Taylor  <iant@google.com>
703         * Added source code to GNU binutils.
704