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