1 2014-06-07 Alan Modra <amodra@gmail.com>
3 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
5 2014-06-06 Cary Coutant <ccoutant@google.com>
7 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
8 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
9 (Dwarf_pubnames_table::read_header): Likewise.
10 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
13 2014-06-05 Joel Brobecker <brobecker@adacore.com>
15 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
16 * Makefile.in, configure: Regenerate.
18 2014-06-03 Alan Modra <amodra@gmail.com>
20 * powerpc.cc (addis_12_2): Define.
21 (Stub_table::do_write): Support fusion on ELFv2 stubs.
23 2014-06-03 Alan Modra <amodra@gmail.com>
25 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
28 2014-06-02 Alan Modra <amodra@gmail.com>
30 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
31 Only ignore relocs on ELFv1.
32 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
34 2014-05-30 Cary Coutant <ccoutant@google.com>
36 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
37 * testsuite/Makefile.in: Regenerate.
38 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
40 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
43 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
44 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
46 2014-05-15 Alan Modra <amodra@gmail.com>
48 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
49 Compare FDE contents with DW_CFA_nop rather than 0.
51 2014-05-13 Sriraman Tallam <tmsriram@google.com>
53 * symtab.h (may_need_copy_reloc): Remove check for position independent
55 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
56 position independence before pc absolute may_need_copy_reloc call.
57 Add check for executable output befor pc relative may_need_copy_reloc
63 * powerpc.cc: Add check for no position independence before
64 may_need_copy_reloc calls.
65 * testsuite/pie_copyrelocs_test.cc: New file.
66 * testsuite/pie_copyrelocs_shared_test.cc: New file.
67 * Makefile.am (pie_copyrelocs_test): New test.
68 * Makefile.in: Regenerate.
70 2014-05-08 Martin Liška <mliska@suse.cz>
72 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
74 2014-05-06 Cary Coutant <ccoutant@google.com>
77 * i386.cc (Output_data_got_plt_i386): New class.
78 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
79 parameter. Change all callers.
80 (Output_data_plt_i386::layout_): Remove.
81 (Output_data_plt_i386::got_plt_): Change type.
82 (Target_i386::got_plt_): Change type. Change all references.
83 (Target_i386::got_section): Create instance of new class.
84 (Output_data_got_plt_i386::do_write): New function.
85 * x86_64.cc (Output_data_got_plt_x86_64): New class.
86 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
87 parameter. Change all callers.
88 (Output_data_plt_x86_64::layout_): Remove.
89 (Output_data_plt_x86_64::got_plt_): Change type.
90 (Target_x86_64::got_plt_): Change type. Change all references.
91 (Target_x86_64::got_section): Create instance of new class.
92 (Output_data_got_plt_x86_64::do_write): New function.
93 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
94 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
97 2014-05-05 Cary Coutant <ccoutant@google.com>
99 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
100 if we have pubnames/pubtypes.
102 2014-05-02 Cary Coutant <ccoutant@google.com>
104 * defstd.cc (in_segment): Define __ehdr_start here...
105 * layout.cc (Layout::finalize): ...Instead of here. Set the
106 output segment when known.
107 * resolve.cc (Symbol::override_base_with_special): Remember
108 the original binding.
109 * symtab.cc (Symbol::set_output_segment): New function.
110 (Symbol::set_undefined): New function.
111 * symtab.h (Symbol::is_weak_undefined): Check original undef
113 (Symbol::is_strong_undefined): New function.
114 (Symbol::set_output_segment): New function.
115 (Symbol::set_undefined): New function.
116 * target-reloc.h (is_strong_undefined): Remove.
117 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
118 Check for hidden undefs.
119 (relocate_section): Call Symbol::is_strong_undefined.
121 * testsuite/Makefile.am (ehdr_start_test_1)
122 (ehdr_start_test_2, ehdr_start_test_3)
123 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
124 * testsuite/Makefile.in: Regenerate.
125 * testsuite/ehdr_start_def.cc: New source file.
126 * testsuite/ehdr_start_test.cc: New source file.
127 * testsuite/ehdr_start_test.t: New linker script.
128 * testsuite/ehdr_start_test_4.sh: New shell script.
130 2014-04-23 Cary Coutant <ccoutant@google.com>
133 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
135 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
137 * layout.cc (Layout::include_section): Allow a target to decide
138 whether to include a section.
139 * target.h (Target::should_include_section): New function.
140 (Target::do_should_include_section): New function.
142 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
144 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
146 (Copy_relocs::emit): ... here.
147 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
148 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
149 (Copy_reloc_entry::entries_): Change from private to protected.
151 2014-04-02 Sriraman Tallam <tmsriram@google.com>
153 * icf.cc (get_section_contents): Replace copies of reloc
154 vectors with const references.
156 2014-04-02 Cary Coutant <ccoutant@google.com>
158 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
159 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
160 * configure: Regenerate.
161 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
162 -fno-use-linker-plugin.
163 (LINK1, CXXLINK1): Add it to the link command.
164 * testsuite/Makefile.in: Regenerate.
166 2014-03-12 Alan Modra <amodra@gmail.com>
168 * Makefile.in: Regenerate.
170 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
172 * symtab.h (Symbol::set_nonvis): New function.
174 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
176 * symtab.cc (Sized_symbol<32>::init_output_data):
177 Instantiate the template.
178 (Sized_symbol<64>::init_output_data): Likewise.
180 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
182 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
183 adjust dynamic symbol value.
184 * target.h (Target::adjust_dyn_symbol): New function.
185 (Target::do_adjust_dyn_symbol): New function.
187 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
189 * output.cc (Output_data_dynamic::Dynamic_entry::write):
190 Get the value of DYNAMIC_CUSTOM dynamic entry.
191 * output.h (Output_data_dynamic::add_custom): New function.
192 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
194 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
195 * target.h (Target::dynamic_tag_custom_value): New function.
196 (Target::do_dynamic_tag_custom_value): New function.
198 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
200 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
202 * target.h (Target::has_custom_set_dynsym_indexes): New function.
203 (Target::do_has_custom_set_dynsym_indexes): New function.
204 (Target::set_dynsym_indexes): New function.
205 (Target::do_set_dynsym_indexes): New function.
207 2014-03-07 Alan Modra <amodra@gmail.com>
209 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
210 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
211 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
212 (Powerpc_relocate_functions::has_overflow_bitfield,
213 overflowed): Use the above.
214 (Target_powerpc::Relocate::relocate): Correct overflow checking
215 for a number of relocations. Modify overflow test for 16-bit
216 fields in instructions to signed/unsigned according to whether
217 the field takes a signed or unsigned value.
219 2014-03-05 Alan Modra <amodra@gmail.com>
221 Update copyright years.
223 2014-03-05 Alan Modra <amodra@gmail.com>
225 * powerpc.cc (Target_powerpc::Scan::local, global): Support
226 R_PPC64_ADDR64_LOCAL.
227 (Target_powerpc::Relocate::relocate): Likewise.
229 2014-03-03 Alan Modra <amodra@gmail.com>
231 * dwp.cc (print_version): Update copyright year to current.
233 2014-02-10 Alan Modra <amodra@gmail.com>
235 * po/gold.pot: Regenerate.
237 2014-02-06 Cary Coutant <ccoutant@google.com>
239 Fix problem where -u is ignored when a weak undef is seen.
241 * archive.cc (Library_base::should_include_member): Reorder
242 code to check for -u option if a weak undef has already been seen.
243 * testsuite/Makefile.am (weak_undef_test_2): New test case.
244 * testsuite/Makefile.in: Regenerate.
245 * testsuite/weak_undef_file3.cc: New file.
246 * testsuite/weak_undef_file4.cc: New file.
247 * testsuite/weak_undef_test_2.cc: New file.
249 2014-02-05 Cary Coutant <ccoutant@google.com>
251 Fix issues with gold undefined symbol diagnostics.
254 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
256 * target-reloc.h (is_strong_undefined): New function.
257 (relocate_section): Move undef vtable symbol check from here.
258 Check for is_strong_undefined.
260 2014-02-05 Cary Coutant <ccoutant@google.com>
262 Fix problems with the --dynamic-list option.
265 * options.cc (General_options::parse_dynamic_list):
266 Set have_dynamic_list_.
267 (General_options::General_options): Initialize have_dynamic_list_.
268 (General_options::finalize): Turn off -Bsymbolic and
269 -Bsymbolic-functions if --dynamic-list provided.
270 * options.h (General_options::have_dynamic_list): New function.
271 (General_options::have_dynamic_list_): New data member.
272 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
276 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
277 in --dynamic-list, mark it.
279 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
280 (dynamic_list_2): New test case.
281 * testsuite/Makefile.in: Regenerate.
282 * testsuite/dynamic_list_2.cc: New file.
283 * testsuite/dynamic_list_2.t: New file.
284 * testsuite/dynamic_list_lib1.cc: New file.
285 * testsuite/dynamic_list_lib2.cc: New file.
286 * testsuite/gc_dynamic_list_test.c: New file.
287 * testsuite/gc_dynamic_list_test.sh: New file.
288 * testsuite/gc_dynamic_list_test.t: New file.
290 2014-01-28 Cary Coutant <ccoutant@google.com>
292 Add .gdb_index version 7 support.
294 * gold/dwarf_reader.cc: include <utility> (for make_pair).
295 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
297 (Dwarf_ranges_table::read_ranges_table): Likewise.
298 (Dwarf_pubnames_table::read_section): Check for GNU-style
299 sections, and for compressed debug sections.
300 (Dwarf_pubnames_table::read_header): Compute end address of table.
301 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
302 for end of list by offset, not by offset == 0.
303 (Dwarf_info_reader::do_read_string_table): Check for compressed
305 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
306 Initialize new data members.
307 (Dwarf_pubnames_table::next_name): return flag_byte.
308 (Dwarf_pubnames_table::end_of_table_): New data member.
309 (Dwarf_pubnames_table::is_gnu_style_): New data member.
310 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
311 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
312 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
313 read skeleton type unit DIEs.
314 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
315 (Gdb_index::do_write): Write flag_byte.
316 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
317 (Gdb_index::Cu_vector): Store flags along with cu indexes.
318 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
319 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
321 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
323 * version.cc (print_version): Update copyright year to 2014.
325 2013-12-19 Dimitry Andric <dimitry@andric.com>
327 * stringpool.cc (Stringpool_template::reserve): Add
328 HAVE_UNORDERED_MAP case.
329 * stringpool.cc (Stringpool_template::print_stats): Likewise.
331 2013-12-18 Cary Coutant <ccoutant@google.com>
333 * configure.ac: Check for <unordered_set> and <unordered_map>.
334 * config.in: Regenerate.
335 * configure: Regenerate.
336 * system.h: Use <unordered_set> and <unordered_map> if available.
338 2013-12-10 Roland McGrath <mcgrathr@google.com>
340 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
341 with $(INSTALL_PROGRAM_ENV).
342 * Makefile.in: Regenerate.
344 2013-11-22 Cary Coutant <ccoutant@google.com>
346 * configure.ac: Add check for which library is needed for
348 * configure: Regenerate.
350 2013-11-22 Cary Coutant <ccoutant@google.com>
352 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
354 * testsuite/Makefile.in: Regenerate.
356 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
358 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
359 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
360 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
361 (Target_x86_64<size>::Scan::local): Likewise.
362 (Target_x86_64<size>::Scan::global): Likewise.
363 (Target_x86_64<size>::Relocate::relocate): Likewise.
364 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
366 (Target_x86_64<size>::Scan::check_non_pic(): Handle
369 * testsuite/Makefile.am (check_PROGRAMS): Add
370 exception_x86_64_bnd_test.
371 (exception_x86_64_bnd_test_SOURCES): New macro.
372 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
373 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
374 (exception_x86_64_bnd_test_LDADD): Likewise.
375 (exception_x86_64_bnd_1.o): New rule.
376 (exception_x86_64_bnd_2.o): Likewise.
377 * testsuite/Makefile.in: Regenerated.
379 2013-11-15 Alan Modra <amodra@gmail.com>
381 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
383 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
384 Only call ppc64_local_entry_offset for 64-bit. Restrict
385 symval_for_branch lookup to ELFv1.
386 (Stub_table::add_plt_call_entry): Use unsigned int off.
387 (Output_data_glink::Address, invalid_address): New.
388 (Output_data_glink::add_eh_frame): Move out of line. Add
390 (Output_data_glink::add_global_entry, find_global_entry,
391 global_entry_address): New functions.
392 (Output_data_glink::global_entry_stubs_, end_branch_table_,
393 ge_size): New variables.
394 (Output_data_glink::set_final_data_size): Add global entry
396 (Output_data_glink::do_write): Write global entry stubs.
397 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
398 parameter. Return true for ELFv2. Adjust callers.
399 (Target_powerpc::Scan::local, global): Restrict opd lookup to
400 ELFv1. Similarly for ifunc and dynamic relocation processing
401 specific to ELFv1. Recognize that symbols are defined on
402 their plt entries for ELFv2.
403 (Target_powerpc::symval_for_branch): Assert if called for
405 (Target_powerpc::Relocate::relocate): Use global entry plt
406 stub for symbol value if such exists on ELFv2.
407 (Target_powerpc::Relocate::relocate): Don't call
408 symval_for_branch when ELFv2. Do adjust for local entry
410 (Target_powerpc::do_dynsym_value): Set symbols to global entry
412 (Target_powerpc::do_plt_address_for_global): Similarly.
414 2013-11-14 Cary Coutant <ccoutant@google.com>
416 Revert patch -- this did not fix the problem, and there is
419 2013-11-14 Cary Coutant <ccoutant@google.com>
422 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
423 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
424 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
425 updating fde_offsets_.
426 (Eh_frame_hdr::lock_): New data member.
428 2013-11-14 Cary Coutant <ccoutant@google.com>
430 * dwp.cc (Dwo_file_entry): New type.
431 (File_list): Use Dwo_file_entry.
432 (Dwo_file::verify): New function.
433 (Dwo_file::verify_dwo_list): New function.
434 (Dwo_file::sized_verify_dwo_list): New function.
435 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
437 (Dwp_options): New enum type.
438 (dwp_options): Add --verify-only.
441 * dwp.h (gold_info): Add declaration.
443 2013-11-14 Cary Coutant <ccoutant@google.com>
446 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
447 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
448 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
449 updating fde_offsets_.
450 (Eh_frame_hdr::lock_): New data member.
452 2013-11-06 Cary Coutant <ccoutant@google.com>
455 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
456 before reloc sections.
458 2013-11-04 Alan Modra <amodra@gmail.com>
460 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
461 (Symbol::needs_dynamic_reloc): Test new flag.
462 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
463 (Target_powerpc::Scan::get_reference_flags): Add target param.
464 Return FUNC_DESC_ABI for 64-bit ELFv1.
465 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
467 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
468 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
470 2013-10-31 Cary Coutant <ccoutant@google.com>
472 Restore support for dwp v2 DWARF package file format.
474 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
475 tu_length parameter. Adjust all callers.
476 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
477 * dwp.cc: Include dwarf.h.
478 (Section_bounds): New struct type.
479 (Unit_set): New struct type.
480 (Dwo_file::Dwo_file): Initialize new data member.
481 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
482 Combine and rename to...
483 (Dwo_file::read_unit_index): ...this.
484 (Dwo_file::sized_read_compunit_index)
485 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
486 (Dwo_file::sized_read_unit_index): ...this.
487 (Dwo_file::copy_section): Remove section_name, is_str_offsets
488 parameters; add section_id parameter.
489 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
490 (Dwo_file::add_unit_set): ...this.
491 (Dwo_file::shndx_map_): Remove.
492 (Dwo_file::sect_offsets_): New data member.
493 (Dwp_output_file::Dwp_output_file): Initialize new data members.
494 (Dwp_output_file::add_section): Rename to...
495 (Dwp_output_file::add_contribution): ...this.
496 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
497 (Dwp_output_file::add_tu_set): Likewise.
498 (Dwp_output_file::Contribution): New type.
499 (Dwp_output_file::Section::contributions): New data member.
500 (Dwp_output_file::Cu_or_tu_set): Remove.
501 (Dwp_output_file::Section::Section): New ctor.
502 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
503 (Dwp_output_file::Dwp_index::Section_table): New type.
504 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
505 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
507 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
508 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
509 (Dwp_output_file::Dwp_index::section_table): New member function.
510 (Dwp_output_file::Dwp_index::section_table_end): New member function.
511 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
512 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
513 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
514 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
515 (Dwp_output_file::Dwp_index::section_table_): New data member.
516 (Dwp_output_file::Dwp_index::section_mask_): New data member.
517 (Dwp_output_file::add_output_section): New member function.
518 (Dwp_output_file::write_new_section): New member function.
519 (Dwp_output_file::write_contributions): New member function.
520 (Dwp_output_file::section_id_map_): New data member.
521 (class Dwo_id_info_reader): Remove.
522 (class Unit_reader): New class.
523 (get_dwarf_section_name): New function.
524 (Dwo_file::read_executable): Adjust initializations of class data.
525 (Dwo_file::read): Add support for v2 package file format.
526 (Dwo_file::read_unit_index): Likewise.
527 (Dwo_file::sized_read_unit_index): Likewise.
528 (Dwo_file::copy_section): Likewise.
529 (Dwo_file::add_unit_set): Likewise.
530 (Dwp_output_file::add_output_section): Likewise.
531 (Dwp_output_file::add_contribution): Likewise.
532 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
534 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
536 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
538 (Dwp_output_file::initialize): Remove unused function.
539 (Dwp_output_file::finalize): Add support for v2 package file format.
540 (Dwp_output_file::write_index): Likewise.
541 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
544 2013-10-31 Cary Coutant <ccoutant@google.com>
546 * configure.ac: Fix check for -fmerge-constants.
547 * configure.ac: Regenerate.
549 2013-10-30 Roland McGrath <mcgrathr@google.com>
551 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
552 Correct 9-byte nop sequence to match what the assembler generates.
554 2013-10-30 Alan Modra <amodra@gmail.com>
556 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
557 ppc64_local_entry_offset, ppc64_local_entry_offset,
558 do_read_symbols): New functions.
559 (Powerpc_relobj::e_flags_, st_other_): New vars.
560 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
561 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
562 (Powerpc_relobj::e_flags_): New var.
563 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
564 and adjust for ELFv2.
565 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
566 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
567 (Powerpc_dynobj::do_find_special_sections): Likewise.
568 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
569 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
570 to ELFv2 local entry.
571 (Target_powerpc::do_relax): No thread safe barriers needed for
573 (Output_data_plt_powerpc::initial_plt_entry_size_,
574 plt_entry_size): Delete. Replace all uses with
575 first_plt_entry_offset() and plt_entry_size().
576 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
577 reserved_size parm. Update callers.
578 (Output_data_plt_powerpc::entry_count): Update.
579 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
580 and use Target_powerpc::first_plt_entry_offset().
581 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
582 rename to plt_entry_size.
583 (Output_data_plt_powerpc::add_ifunc_entry,
584 add_local_ifunc_entry): Adjust reloc for ELFv2.
585 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
586 (glink_eh_frame_fde_64v2): New.
587 (Stub_table::plt_call_size): Support ELFv2 sizing.
588 (Output_data_glink::add_eh_frame): Use the new FDE.
589 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
590 (Stub_table::do_write): Write ELFv2 stubs and glink.
591 (Target_powerpc::Relocate::relocate): Replaces nop after call
592 with ld 2,24(1) and adjust local offset destination for ELFv2.
594 2013-10-30 Alan Modra <amodra@gmail.com>
596 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
597 (Target_powerpc::Scan::global, local): Likewise.
598 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
599 on all ppc64 @h and @ha relocs.
601 2013-10-14 Alan Modra <amodra@gmail.com>
603 * output.h (Output_data_got::add_constant): Tidy.
604 (Output_data_got::add_constant_pair): New function.
605 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
606 methods used so as to first call reserve_ent().
608 2013-10-11 Roland McGrath <mcgrathr@google.com>
610 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
611 add_got_entry and add_got_entry_pair.
613 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
614 (HAVE_PUBNAMES): Likewise.
615 * configure: Regenerate.
617 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
618 * testsuite/Makefile.in: Regenerate.
620 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
621 Remove const from declaration.
622 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
623 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
624 * output.h (Output_file_header): Remove const from member target_
625 and corresponding constructor argument.
626 * output.cc (Output_file_header::Output_file_header): Update prototype.
627 (Output_file_header::do_sized_write): Use this->target_ in place
628 of parameters()->target().
630 * testsuite/undef_symbol.cc (Foo::get_a): New method.
632 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
633 * configure: Regenerate.
634 * Makefile.in: Regenerate.
635 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
636 * testsuite/merge_string_literals_2.c: Likewise.
637 * testsuite/Makefile.am
638 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
639 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
640 literal -fmerge-constants.
641 * testsuite/Makefile.in: Regenerate.
643 * i386.cc (Target_i386): Remove unused member dynbss_.
644 * arm.cc (Target_arm): Likewise.
645 * powerpc.cc (Target_powerpc): Likewise.
646 * sparc.cc (Target_sparc): Likewise.
647 * tilegx.cc (Target_tilegx): Likewise.
648 * x86_64.cc (Target_x86_64): Likewise.
649 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
650 type_signature_, type_offset_.
651 * plugin.h (Plugin_hook): Remove unused member layout_.
652 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
654 (Read_member): Remove unused members input_objects_, symtab_,
656 (Check_library): Remove unused member symtab_.
657 * archive.h (Lib_group): Remove unused member lib_.
658 * archive.cc (Lib_group::Lib_group): Update initializer.
659 * incremental.h (Incremental_binary): Remove unused member target_.
660 (Incremental_script_entry): Removed unused member script_.
661 * layout.h (Write_symbols_task): Remove unused member input_objects_.
662 * icf.h (Icf): Remove unused member num_tracked_relocs.
664 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
665 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
667 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
669 * archive.h: Use struct rather than class for forward declaration
670 of Read_symbols_data.
672 2013-10-07 Cary Coutant <ccoutant@google.com>
675 * testsuite/Makefile.am (icf_test): Fix dependencies.
676 (icf_safe_test): Likewise.
677 (icf_safe_so_test): Likewise.
678 (large_symbol_alignment): Add empty _LDADD rule.
679 * testsuite/Makefile.in: Regenerate.
681 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
684 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
685 relocation for R_X86_64_32 on x32.
687 2013-08-27 Roland McGrath <mcgrathr@google.com>
689 * output.cc (Output_segment::set_section_addresses): Take new
690 Target* argument. If target->isolate_execinstr() and the segment
691 is executable and starts at a target->abi_pagesize() boundary,
692 pad its end out to a target->abi_pagesize() boundary with code fill.
693 * output.h (Output_segment::set_section_addresses): Update decl.
694 * layout.h (Layout::check_output_data_for_reset_values): Take new
695 argument RELAX_OUTPUTS.
696 (Layout): New member relax_output_list_.
697 (Layout::add_relax_output): New method.
698 * layout.cc (Layout::Layout): Update constructor.
699 (Layout::reset_relax_output): New method.
700 (Layout::clean_up_after_relaxation): Call it.
701 (Layout::prepare_for_relaxation): Update caller.
702 (Layout::set_segment_offsets): Update callers of set_section_addresses.
703 Call reset_relax_output before re-processing segments for
704 isolate_execinstr case.
705 (Layout::write_data): Handle relax_output_list_.
706 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
707 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
709 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
712 * object.h: Fix typos.
714 2013-08-16 Roland McGrath <mcgrathr@google.com>
716 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
717 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
719 2013-08-07 Cary Coutant <ccoutant@google.com>
721 Revert support for v2 DWP files:
723 2013-03-01 Cary Coutant <ccoutant@google.com>
725 Add dwp support for v2 DWARF package file format.
726 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
727 tu_length parameter. Adjust all callers.
728 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
729 * dwp.cc: Include dwarf.h.
730 (Section_bounds): New struct type.
731 (Unit_set): New struct type.
732 (Dwo_file::Dwo_file): Initialize new data member.
733 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
734 Combine and rename to...
735 (Dwo_file::read_unit_index): ...this.
736 (Dwo_file::sized_read_compunit_index)
737 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
738 (Dwo_file::sized_read_unit_index): ...this.
739 (Dwo_file::copy_section): Remove section_name, is_str_offsets
740 parameters; add section_id parameter.
741 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
742 (Dwo_file::add_unit_set): ...this.
743 (Dwo_file::shndx_map_): Remove.
744 (Dwo_file::sect_offsets_): New data member.
745 (Dwp_output_file::Dwp_output_file): Initialize new data members.
746 (Dwp_output_file::add_section): Rename to...
747 (Dwp_output_file::add_contribution): ...this.
748 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
749 (Dwp_output_file::add_tu_set): Likewise.
750 (Dwp_output_file::Contribution): New type.
751 (Dwp_output_file::Section::contributions): New data member.
752 (Dwp_output_file::Cu_or_tu_set): Remove.
753 (Dwp_output_file::Section::Section): New ctor.
754 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
755 (Dwp_output_file::Dwp_index::Section_table): New type.
756 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
757 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
759 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
760 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
761 (Dwp_output_file::Dwp_index::section_table): New member function.
762 (Dwp_output_file::Dwp_index::section_table_end): New member function.
763 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
764 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
765 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
766 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
767 (Dwp_output_file::Dwp_index::section_table_): New data member.
768 (Dwp_output_file::Dwp_index::section_mask_): New data member.
769 (Dwp_output_file::add_output_section): New member function.
770 (Dwp_output_file::write_new_section): New member function.
771 (Dwp_output_file::write_contributions): New member function.
772 (Dwp_output_file::section_id_map_): New data member.
773 (class Dwo_id_info_reader): Remove.
774 (class Unit_reader): New class.
775 (get_dwarf_section_name): New function.
776 (Dwo_file::read_executable): Adjust initializations of class data.
777 (Dwo_file::read): Add support for v2 package file format.
778 (Dwo_file::read_unit_index): Likewise.
779 (Dwo_file::sized_read_unit_index): Likewise.
780 (Dwo_file::copy_section): Likewise.
781 (Dwo_file::add_unit_set): Likewise.
782 (Dwp_output_file::add_output_section): Likewise.
783 (Dwp_output_file::add_contribution): Likewise.
784 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
786 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
788 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
790 (Dwp_output_file::initialize): Remove unused function.
791 (Dwp_output_file::finalize): Add support for v2 package file format.
792 (Dwp_output_file::write_index): Likewise.
793 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
796 2013-07-31 Cary Coutant <ccoutant@google.com>
798 * object.cc (Sized_relobj::do_output_section_address): New function.
799 (Sized_relobj): Instantiate explicitly.
800 * object.h (Object::output_section_address): New function.
801 (Object::do_output_section_address): New function.
802 (Sized_relobj::do_output_section_address): New function.
803 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
805 2013-07-30 Cary Coutant <ccoutant@google.com>
806 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
808 * parameters.cc (Parameters::entry): Return target-specific entry
810 * target.h (Target::entry_symbol_name): New function.
811 (Target_info::entry_symbol_name): New data member.
813 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
814 * i386.cc (Target_i386::i386_info): Likewise.
815 (Target_i386_nacl::i386_nacl_info): Likewise.
816 * sparc.cc (Target_sparc::sparc_info): Likewise.
817 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
818 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
819 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
820 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
822 2013-07-22 Sterling Augustine <saugustine@google.com>
824 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
825 Convert parameter shndx to local variable. Add parameters symtab
826 and symtab_size. Scan over section names. Find relocation
827 section corresponding to current section. Create and initialize
828 reloc_mapper_ and reloc_type_.
829 (Dwarf_pubnames_table::read_header): Add assertion. Change
830 unit_length to off_t. Initialize member unit_length_. Fill in field
832 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
833 Initialize new fields unit_length_ and cu_offset_.
834 (Dwarf_pubnames_table::read_section): Update prototype.
835 (Dwarf_pubnames_table::cu_offset): New member function.
836 (Dwarf_pubnames_table::subsection_size): Likewise.
837 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
839 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
840 member functions public.
841 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
842 Update comment. Rework logic. Move repeated parts to...
843 (Gdb_index_info_reader::read_pubtable): ...here. New function.
844 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
845 pubtypes_table_, and stmt_list_offset.
846 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
847 Gdb_index::find_pubtype_offset,
848 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
849 (Gdb_index::pubnames_read): Update prototype and rework logic.
850 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
852 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
853 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
854 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
855 Gdb_index::map_pubtable_to_dies):
857 (Gdb_index::pubnames_read): Update declaration.
858 (Gdb_index::Pubname_offset_map): New type.
859 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
860 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
861 Gdb_index::stmt_list_offset): Declare.
862 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
863 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
864 Gdb_index::pubtypes_offset_): Remove.
866 2013-07-19 Roland McGrath <mcgrathr@google.com>
868 * options.h (General_options): Add -Trodata-segment option.
869 * parameters.cc (Parameters::check_rodata_segment): New function.
870 (Parameters::set_target_once): Call it.
871 * parameters.h (Parameters): Declare it (private member function).
872 * layout.cc (load_seg_unusable_for_headers): New function, broken
873 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
874 then validate rodata segment rather than text segment.
875 (relaxation_loop_body): Call that.
876 (is_text_segment): New function. Don't admit a non-executable
877 segment if TARGET->isolate_execinstr().
878 (set_segment_offsets): Call it. Honor -Trodata-segment option.
880 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
883 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
884 * nacl.h (Sniff_file::View::View): Request aligned view.
886 2013-07-11 Cary Coutant <ccoutant@google.com>
888 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
889 correct BRLT entry size.
891 2013-07-03 Alan Modra <amodra@gmail.com>
893 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
896 2013-07-01 Cary Coutant <ccoutant@google.com>
898 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
900 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
901 (Dwarf_ranges_table::lookup_reloc): New function.
902 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
904 (Dwarf_ranges_table::lookup_reloc): New function.
905 (Dwarf_ranges_table::reloc_type_): New data member.
907 2013-06-27 Jing Yu <jingyu@google.com>
910 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
912 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
913 (Target_powerpc::do_relax): Call the above.
915 2013-06-27 Cary Coutant <ccoutant@google.com>
917 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
918 on garbage collected .opd section.
920 2013-06-27 Alan Modra <amodra@gmail.com>
922 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
924 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
925 (Target_powerpc::do_function_location): Likewise for loc->shndx.
927 2013-06-14 Cary Coutant <ccoutant@google.com>
929 * resolve.cc (Symbol::override_base): Don't override st_type
930 from plugin placeholder symbols.
931 (Symbol_table::resolve): Likewise.
932 (Symbol_table::should_override): Don't complain about TLS mismatch
933 if the TO symbol is a plugin placeholder.
934 * testsuite/Makefile.am (plugin_test_tls): New test.
935 * testsuite/Makefile.in: Regenerate.
936 * testsuite/plugin_test_tls.sh: New test script.
937 * testsuite/two_file_test_2_tls.cc: New test source.
938 * testsuite/two_file_test_tls.cc: New test source.
940 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
942 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
943 the maximum segment alignment is larger than the page size.
944 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
945 correctly aligns the symbols with large alignemnt.
946 * testsuite/Makefile.in: Regenerate.
947 * testsuite/large_symbol_alignment.cc: New file.
949 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
950 Sriraman Tallam <tmsriram@google.com>
952 * options.h (sort_section): New option.
953 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
954 Rename from Input_section_sort_section_name_special_ordering_compare.
955 (Input_section_sort_section_name_compare): New struct.
956 * output.cc (Output_section::Input_section_sort_section_name_compare::
957 operator()): New function.
958 (Output_section::sort_attached_input_sections): Use new sort function
959 for .text if --sort-section=name is specified.
960 * layout.cc (Layout::make_output_section):
961 Add sorting by name when --sort-section=name is specified.
962 * testsuite/Makefile.am (text_section_grouping): Test option
964 * testsuite/Makefile.in: Regenerate.
965 * testsuite/section_sorting_name.cc: New file.
966 * testsuite/section_sorting_name.sh: New file.
968 2013-05-21 Cary Coutant <ccoutant@google.com>
970 * symtab.h (Symbol::is_cxx_vtable): New function.
971 * target-reloc.h (relocate_section): Check for vtable symbol.
972 * testsuite/Makefile.am (missing_key_func.sh): New test case.
973 * testsuite/Makefile.in: Regenerate.
974 * testsuite/missing_key_func.cc: New test source.
975 * testsuite/missing_key_func.sh: New test script.
977 2013-05-21 Cary Coutant <ccoutant@google.com>
979 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
980 type of enclosing symbol.
981 (Relocate_info::location): Check symbol type when describing symbol.
982 * object.h (Symbol_location_info): Remove unused line_number;
983 add enclosing_symbol_type.
984 * testsuite/debug_msg.sh: Adjust expected output.
986 2013-05-13 Cary Coutant <ccoutant@google.com>
988 * configure.ac: Export DEFAULT_TARGET.
989 * configure: Regenerate.
990 * Makefile.in: Regenerate.
991 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
992 * testsuite/Makefile.in: Regenerate.
993 * testsuite/debug_msg.sh: Delete duplicate tests.
994 Don't check undef_int error message match for powerpc where the
995 source file and line number aren't available.
997 2013-05-10 Roland McGrath <mcgrathr@google.com>
999 * options.h (General_options): Add --rosegment-gap option.
1000 * options.cc (finalize): --rosegment-gap implies --rosegment.
1001 * layout.cc (set_segment_offsets): Let user option override
1002 target->rosegment_gap().
1004 2013-05-10 Roland McGrath <mcgrathr@google.com>
1006 * options.h (General_options): Remove leading space from help
1007 messages for -nostdlib and --rosegment.
1009 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1012 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1014 2013-05-03 Alan Modra <amodra@gmail.com>
1016 * merge.cc (Output_merge_string::do_add_input_section): Correct
1017 scan for number of strings. Rename vars to avoid shadowing.
1018 Include missing terminator in input_size_.
1020 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1022 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1023 Restore empty string handling.
1025 2013-05-01 Cary Coutant <ccoutant@google.com>
1027 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1028 uninitialized warning.
1030 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1032 * output.cc (Output_section::add_merge_input_section): Allow
1033 to merge sections if the alignment is more than character size.
1034 * merge.h (Output_merge_string::Output_merge_string): Remove
1036 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1037 only not-null strings. Check the alignment of strings.
1039 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1040 alignment as the argument.
1041 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1042 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1043 Align non-zero length strings according to the addralign_.
1044 (Stringpool_template<Stringpool_char>::set_string_offsets):
1045 Updating offsets according to the given alignment.
1046 * testsuite/Makefile.am (text_section_grouping): Test if string
1047 literals are getting merged.
1048 * testsuite/Makefile.in: Regenerate.
1049 * testsuite/merge_string_literals_1.c: New file.
1050 * testsuite/merge_string_literals_2.c: Ditto.
1051 * testsuite/merge_string_literals.sh: Ditto.
1053 2013-04-26 Ian Lance Taylor <iant@google.com>
1055 * target-reloc.h (relocate_section): If the reloc offset is out of
1056 range, pass VIEW as NULL to relocate.relocate.
1057 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1058 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1059 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1060 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1061 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1062 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1064 2013-04-26 Geoff Pike <gpike@chromium.org>
1066 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1067 * layout.cc (Hash_task): New class.
1068 (Layout::queue_build_id_tasks): New function.
1069 (Layout::write_build_id): Handle single-thread portion of build ID
1070 computation. (In some cases, all of it is single-threaded.) Replace
1071 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1072 functionality in fewer lines of code.
1073 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1074 * options.h (General_options): make "--build-id" default to tree
1075 rather than sha1. Add two new options related to --build-id=tree:
1076 --build-id-chunk-size-for-treehash and
1077 --build-id-min-file-size-for-treehash.
1078 * Makefile.am: add testing of --build-id=tree and related new options
1079 (these tests will be invoked by "make check").
1080 * Makefile.in: Regenerate.
1082 2013-04-25 Alan Modra <amodra@gmail.com>
1084 * configure.tgt: Add powerpcle and powerpc64le.
1086 2013-04-22 Alan Modra <amodra@gmail.com>
1089 * layout.cc (Layout::segment_precedes): Allow more than one
1090 segment with the same type and flags.
1092 2013-04-15 Cary Coutant <ccoutant@google.com>
1094 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1095 allocate space in file for BSS sections.
1097 2013-04-15 Cary Coutant <ccoutant@google.com>
1099 * script-sections.cc (Orphan_output_section): Reset address
1100 to zero after each orphaned section for relocatable links.
1102 2013-04-15 Cary Coutant <ccoutant@google.com>
1104 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1105 section starting address for relocatable link.
1106 * testsuite/Makefile.am (script_test_11): New test.
1107 * testsuite/Makefile.in: Regenerate.
1108 * testsuite/script_test_11.c: New source file.
1109 * testsuite/script_test_11.t: New linker script.
1111 2013-04-13 Alan Modra <amodra@gmail.com>
1113 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1114 owner when sections are not adjacent and exceed group size.
1115 (Target_powerpc::group_sections): Handle corner case.
1116 (Target_powerpc::Branch_info::make_stub): Handle case where
1117 stub table doesn't exist due to branches in non-exec sections.
1118 (Target_powerpc::Relocate::relocate): Likewise.
1120 2013-04-11 Alan Modra <amodra@gmail.com>
1123 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1124 .branch_lt to match bfd ld. Adjust comments throughout file.
1126 2013-04-04 Ian Lance Taylor <iant@google.com>
1129 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1130 sections before checking whether they are included in the link.
1132 2013-03-29 Sriraman Tallam <tmsriram@google.com>
1134 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1135 object before calling the plugin claim_file handler. Pass the elf
1136 object of the archive to the plugin. Delete the elf object if the
1137 plugin claims the file.
1139 2013-03-21 Alan Modra <amodra@gmail.com>
1141 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1142 segment when omagic.
1144 2013-03-21 Alan Modra <amodra@gmail.com>
1146 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1148 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1149 uninitialized" warning.
1151 2013-03-20 Alan Modra <amodra@gmail.com>
1153 * symtab.h (Symbol::clear_version): New function.
1154 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1155 is_needed by weak references. Clear version for symbols defined
1156 in as-needed objects that are not needed.
1158 2013-03-15 Alan Modra <amodra@gmail.com>
1160 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1161 static and public. Add report_err param. Return false for data refs.
1162 (Target_powerpc::rela_dyn_section): New overloaded function.
1163 (Target_powerpc::plt_, iplt_): Elucidate.
1164 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1165 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1166 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1167 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1168 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1169 push_branch and make_plt_entry for ifunc syms when
1170 reloc_needs_plt_for_ifunc.
1171 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1172 for ifunc unless reloc_needs_plt_for_ifunc.
1174 2013-03-15 Alan Modra <amodra@gmail.com>
1176 * gc.h (gc_process_relocs): Don't look through function descriptors.
1177 * icf.cc (get_section_contents): Do so here instead.
1179 2013-03-13 Alan Modra <amodra@gmail.com>
1181 * powerpc.cc (is_branch_reloc): Forward declare.
1182 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1183 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1184 false for 64-bit, true for 32-bit non-branch relocs.
1185 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1186 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1188 (icf_safe_test): Generate linker map file as well as nm output.
1189 (icf_safe_so_test): Likewise.
1190 * testsuite/Makefile.in: Regenerate.
1191 * testsuite/icf_test.sh: Parse linker map file to determine
1193 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1194 * testsuite/icf_safe_so_test.sh: Likewise.
1195 (X86_32_or_ARM_specific_safe_fold): Merge into..
1196 (arch_specific_safe_fold): ..this.
1197 (X86_64_specific_safe_fold): Delete unused function.
1199 2013-03-12 Alan Modra <amodra@gmail.com>
1201 * gc.h (gc_process_relocs): Look through function descriptors
1202 to determine shndx, symvalue and addend used by ICF. Tidy
1203 variable duplication.
1205 2013-03-11 Alan Modra <amodra@gmail.com>
1207 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1208 * layout.cc (Layout_task_runner::run): ..to here.
1209 * symtab.h (struct Symbol_location): Extract from..
1210 (class Symbol_table): ..here.
1211 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1212 * target.h (class Target): Add function_location and
1213 do_function_location functions.
1214 (class Sized_target): Add do_function_location.
1215 * object.h (class Sized_relobj_file): Move find_shdr..
1216 (class Object): ..to here.
1217 * object.cc: Likewise. Update to suit. Instantiate.
1218 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1219 * powerpc.cc (class Powerpc_dynobj): New.
1220 (Target_powerpc::do_function_location): New function.
1221 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1222 (Powerpc_dynobj::do_read_symbols): New function.
1223 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1225 2013-03-08 Ian Lance Taylor <iant@google.com>
1227 * options.cc (General_options::string_to_object_format): Accept
1230 2013-03-08 Alan Modra <amodra@gmail.com>
1232 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1233 pointer to Post_fde.
1234 (struct Post_fde): Move definition to here..
1235 * ehframe.cc (struct Post_fde): ..from here.
1236 (Cie::write): Don't alloc Post_fde.
1237 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1239 2013-03-07 Alan Modra <amodra@gmail.com>
1241 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1242 relocation referencing .LC0.
1243 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1245 2013-03-07 Alan Modra <amodra@gmail.com>
1247 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1248 always_inline. Add assembly for powerpc to avoid GOT.
1250 2013-03-07 Alan Modra <amodra@gmail.com>
1252 * testsuite/script_test_10.sh: Don't test .bss section
1255 2013-03-06 Alan Modra <amodra@gmail.com>
1257 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1258 (Target_powerpc::symval_for_branch): Add symtab param. Update
1259 all callers. Handle folded sections.
1260 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1262 (Global_symbol_visitor_opd::operator()): Likewise.
1264 2013-03-04 Alan Modra <amodra@gmail.com>
1266 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1267 * testsuite/Makefile.in: Regenerate.
1269 2013-03-01 Cary Coutant <ccoutant@google.com>
1271 Add dwp support for v2 DWARF package file format.
1272 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1273 tu_length parameter. Adjust all callers.
1274 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1275 * dwp.cc: Include dwarf.h.
1276 (Section_bounds): New struct type.
1277 (Unit_set): New struct type.
1278 (Dwo_file::Dwo_file): Initialize new data member.
1279 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1280 Combine and rename to...
1281 (Dwo_file::read_unit_index): ...this.
1282 (Dwo_file::sized_read_compunit_index)
1283 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1284 (Dwo_file::sized_read_unit_index): ...this.
1285 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1286 parameters; add section_id parameter.
1287 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1288 (Dwo_file::add_unit_set): ...this.
1289 (Dwo_file::shndx_map_): Remove.
1290 (Dwo_file::sect_offsets_): New data member.
1291 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1292 (Dwp_output_file::add_section): Rename to...
1293 (Dwp_output_file::add_contribution): ...this.
1294 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1295 (Dwp_output_file::add_tu_set): Likewise.
1296 (Dwp_output_file::Contribution): New type.
1297 (Dwp_output_file::Section::contributions): New data member.
1298 (Dwp_output_file::Cu_or_tu_set): Remove.
1299 (Dwp_output_file::Section::Section): New ctor.
1300 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1301 (Dwp_output_file::Dwp_index::Section_table): New type.
1302 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1303 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1305 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1306 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1307 (Dwp_output_file::Dwp_index::section_table): New member function.
1308 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1309 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1310 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1311 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1312 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1313 (Dwp_output_file::Dwp_index::section_table_): New data member.
1314 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1315 (Dwp_output_file::add_output_section): New member function.
1316 (Dwp_output_file::write_new_section): New member function.
1317 (Dwp_output_file::write_contributions): New member function.
1318 (Dwp_output_file::section_id_map_): New data member.
1319 (class Dwo_id_info_reader): Remove.
1320 (class Unit_reader): New class.
1321 (get_dwarf_section_name): New function.
1322 (Dwo_file::read_executable): Adjust initializations of class data.
1323 (Dwo_file::read): Add support for v2 package file format.
1324 (Dwo_file::read_unit_index): Likewise.
1325 (Dwo_file::sized_read_unit_index): Likewise.
1326 (Dwo_file::copy_section): Likewise.
1327 (Dwo_file::add_unit_set): Likewise.
1328 (Dwp_output_file::add_output_section): Likewise.
1329 (Dwp_output_file::add_contribution): Likewise.
1330 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1332 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1334 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1336 (Dwp_output_file::initialize): Remove unused function.
1337 (Dwp_output_file::finalize): Add support for v2 package file format.
1338 (Dwp_output_file::write_index): Likewise.
1339 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1342 2013-03-01 Cary Coutant <ccoutant@google.com>
1344 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1345 function into class definition in header file.
1346 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1347 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1349 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1351 2013-02-28 Alan Modra <amodra@gmail.com>
1353 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1354 * target.cc (Target::do_plt_fde_location): New function.
1355 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1356 accessor function, and constructor param.
1357 (struct Post_fde, Post_fdes): Declare.
1358 (Cie::write): Add post_fdes param.
1359 * ehframe.cc (Fde::write): Use plt_fde_location.
1360 (struct Post_fde): Define.
1361 (Cie::write): Stash FDEs added post merge mapping.
1362 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1363 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1364 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1366 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1367 (Target_powerpc::has_glink): New function.
1368 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1369 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1370 glink_eh_frame_fde_32, default_fde): New data.
1371 (Stub_table::eh_frame_added_): New var.
1372 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1374 (Stub_table::add_eh_frame): New function.
1375 (Output_data_glink::add_eh_frame): New function.
1376 (Target_powerpc::make_glink_section): Call add_eh_frame.
1378 2013-02-15 Ian Lance Taylor <iant@google.com>
1380 * options.h (DEFINE_uint64_alias): Define.
1381 (class General_options): Add -Ttext-segment as an alias for
1384 2013-02-15 Alan Modra <amodra@gmail.com>
1386 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1387 (Stub_table::do_write): ..here, two places.
1388 (Stub_table::plt_call_size): Use it here too.
1390 2013-02-11 Ian Lance Taylor <iant@google.com>
1392 * descriptors.cc (Descriptors::close_all): New function.
1393 * descriptors.h (class Descriptors): Declare close_all.
1394 (close_all_descriptors): New inline function.
1395 * plugin.cc: Include "descriptors.h".
1396 (Plugin_manager::cleanup): Call close_all_descriptors.
1398 2013-02-06 Alan Modra <amodra@gmail.com>
1400 * README: Update coding style link.
1402 2013-01-28 Cary Coutant <ccoutant@google.com>
1404 * dwp.cc (File_list): New typedef.
1405 (Dwo_name_info_reader): New class.
1406 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1407 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1408 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1409 (Dwo_file::read_executable): New function.
1410 (Dwo_file::read): Move common setup code to ...
1411 (Dwo_file::make_object): ... here.
1412 (dwp_options): Add --exec/-e.
1416 2013-01-24 Sriraman Tallam <tmsriram@google.com>
1418 * layout.cc (Layout::layout): Check for option text_reorder.
1419 (Layout::make_output_section): Ditto.
1420 * options.h (text_reorder): New option.
1421 * output.cc (Input_section_sort_compare): Remove special ordering
1424 Input_section_sort_section_name_special_ordering_compare::
1425 operator()): New function.
1426 (Output_section::sort_attached_input_sections): Use new sort function
1428 * output.h (Input_section_sort_section_name_special_ordering_compare):
1430 * testsuite/Makefile.am (text_section_grouping): Test option
1432 * testsuite/Makefile.in: Regenerate.
1433 * testsuite/text_section_grouping.sh: Check order of functions without
1434 default text reordering.
1436 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1438 * options.h (General_options): Change default to true for new_dtags.
1440 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1442 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1443 when enable_new_dtags is false. Only add DT_RUNPATH when
1444 enable_new_dtags is true.
1446 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1448 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1449 used in declaration and definition consistent.
1450 (Target_powerpc::symval_for_branch): Ditto.
1452 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1454 * testsuite/plugin_final_layout.cc: Fix comment.
1456 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1458 * layout.cc (Layout::layout): Do not do default sorting for
1459 text sections when section ordering is specified.
1460 (make_output_section): Ditto.
1461 * testsuite/plugin_final_layout.cc: Name the function sections
1462 to catch reordering issues.
1464 2013-01-15 Alan Modra <amodra@gmail.com>
1466 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1469 2013-01-15 Alan Modra <amodra@gmail.com>
1471 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1472 * testsuite/Makefile.in: Regenerate.
1474 2013-01-14 Alan Modra <amodra@gmail.com>
1476 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1477 * testsuite/Makefile.in: Regenerate.
1479 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1482 Fix mingw gold build with plugins enabled
1483 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1484 * configure.ac: Export DLOPEN_LIBS and add headers check.
1485 * plugin.cc: Handle non-dlfcn case.
1486 * Makefile.in: Regenerate.
1487 * config.in: Regenerate.
1488 * configure: Regenerate.
1489 * testsuite/Makefile.in: Regenerate.
1491 2013-01-09 Sriraman Tallam <tmsriram@google.com>
1493 * output.h (sort_attached_input_sections): Change to be public.
1494 * script-sections.cc
1495 (Output_section_definition::set_section_addresses): Sort
1496 attached input sections according to section order before linker
1497 script assigns section addresses.
1498 (Orphan_output_section::set_section_addresses): Sort
1499 attached input sections according to section order before linker
1500 script assigns section addresses.
1501 * Makefile.am (final_layout.sh): Use a simple linker script to
1502 check if section ordering still works.
1503 * Makefile.in: Regenerate.
1505 2013-01-09 Ben Cheng <bccheng@google.com>
1507 * arm.cc (Target_arm::attributes_accept_div): New function.
1508 (Target_arm::attributes_forbid_div): New function.
1509 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1510 attribute using the same new functions as what bfd/elf32_arm.c
1513 2013-01-07 Cary Coutant <ccoutant@google.com>
1516 * output.cc (Output_section::add_input_section): For incremental
1517 updates, don't track input sections that are allocated from patch
1520 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1521 Ian Lance Taylor <iant@google.com>
1524 * configure.ac (--enable-ld): Removed.
1525 (install_as_default): Set to yes only for --enable-gold=default
1527 * configure: Regenerated.
1529 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1531 * options.h (General_options): Add -fuse-ld= for GCC linker
1532 option compatibility.
1534 2013-01-04 Cary Coutant <ccoutant@google.com>
1536 * configure.ac: Fix typo restoring CXXFLAGS.
1537 * configure: Regenerate.
1539 2013-01-04 Cary Coutant <ccoutant@google.com>
1541 * testsuite/Makefile.am (CXXLINK_S): New macro.
1542 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1543 * testsuite/Makefile.in: Regenerate.
1545 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1547 * version.cc (print_version): Update copyright year to 2013.
1549 2012-12-20 Ian Lance Taylor <iant@google.com>
1551 * layout.cc (Layout::special_ordering_of_input_section): New
1553 (Layout::layout): If input section requires special ordering, must
1554 sort input sections.
1555 (Layout::make_output_section): May sort .text input sections.
1556 (Layout::is_section_name_prefix_grouped): Remove.
1557 * layout.h (class Layout): Declare
1558 special_ordering_of_input_section. Don't declare
1559 is_section_name_prefix_grouped.
1560 * output.cc (Output_section::add_input_section): Revert last
1562 (Output_section::Input_section_sort::match_file_name): Don't crash
1563 if called on output section data.
1564 (Output_section::Input_section_sort_compare): Sort based on
1566 (Output_section::Input_section_sort_section_order_index_compare):
1568 (Output_section::sort_attached_input_sections): Likewise.
1570 2012-12-18 Sriraman Tallam <tmsriram@google.com>
1572 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
1573 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1574 * output.cc (Output_section::add_input_section): Check if section
1575 name contains special prefix. Keep input sections to sort such
1577 (Output_section::Input_section_sort_section_order_index_compare
1578 ::operator()): Group sections according to prefixes.
1579 (Output_section::sort_attached_input_sections): Add condition to
1580 Input_section_entry constructor call.
1581 * testsuite/Makefile.am (text_section_grouping): New test.
1582 * testsuite/Makefile.in: Regenerate.
1583 * testsuite/text_section_grouping.cc: New file.
1584 * testsuite/text_section_grouping.sh: New file.
1586 2012-12-17 Nick Clifton <nickc@redhat.com>
1588 * Makefile.am: Add copyright notice.
1591 * configure.ac: Likewise.
1592 * ftruncate.c: Likewise.
1593 * Makefile.in: Regenerate.
1595 2012-12-14 Cary Coutant <ccoutant@google.com>
1597 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1598 --no-as-needed flag.
1599 (exception_separate_shared_12_test): Likewise.
1600 (incremental_copy_test): Likewise.
1601 * testsuite/Makefile.in: Regenerate.
1603 2012-12-14 Cary Coutant <ccoutant@google.com>
1605 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1606 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1608 2012-12-12 Alan Modra <amodra@gmail.com>
1610 * powerpc.cc (class Track_tls): New.
1611 (class Relocate, class Scan): Inherit Track_tls.
1612 (Target_powerpc::Scan::local, global): Track tls optimization
1613 and avoid creating plt entry for __tls_get_addr if all uses
1615 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1617 2012-12-12 Alan Modra <amodra@gmail.com>
1619 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1620 Replace no_toc_optimize with toc_optimize.
1621 * output.h (Output_section::input_sections): Provide non-const variant.
1622 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1623 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1625 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1626 (class Sort_toc_sections): New.
1627 (Target_powerpc::do_finalize_sections): Sort toc sections.
1628 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1630 2012-12-10 Roland McGrath <mcgrathr@google.com>
1632 * testsuite/binary_unittest.cc (read_all): New function.
1633 (Sized_binary_test): Use it instead of ::read.
1634 * fileread.cc (do_read): Don't assume pread always reads the whole
1635 amount in a single call.
1637 2012-12-10 Alan Modra <amodra@gmail.com>
1639 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1640 Set EM_PPC64 or EM_PPC here.
1641 (Target_selector_powerpc::do_recognize): Delete.
1643 2012-12-10 Alan Modra <amodra@gmail.com>
1645 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1647 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1649 2012-12-07 Roland McGrath <mcgrathr@google.com>
1651 * testsuite/binary_unittest.cc (Sized_binary_test):
1652 Use open_descriptor rather than ::open.
1654 2012-12-07 Alan Modra <amodra@gmail.com>
1656 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1657 typedef and invalid_address constant.
1658 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1659 instantiate constants.
1661 2012-12-06 Roland McGrath <mcgrathr@google.com>
1663 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1664 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1665 * aclocal.m4: Regenerate.
1666 * configure: Regenerate.
1667 * Makefile.in: Regenerate.
1668 * testsuite/Makefile.in: Regenerate.
1670 2012-12-07 Alan Modra <amodra@gmail.com>
1672 * options.h (General_options): Add no_toc_optimize.
1673 * powerpc.cc (ok_lo_toc_insn): New function.
1674 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1676 2012-12-06 Alan Modra <amodra@gmail.com>
1678 * options.h (General_options): Add plt_align, plt_static_chain,
1679 plt_thread_safe. Update stub_group_size help text.
1680 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1681 for new plt_thread_safe_ var.
1682 (use_plt_offset): Correct comments.
1683 (Target_powerpc::do_relax): Look for thread creation symbols to
1684 determine default plt_thread_safe value. Clear plt call stubs
1685 as well as branch stubs each iteration.
1686 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1688 (l, hi, ha, write_insn): Move earlier.
1689 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1690 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1692 (Stub_table::update_size): Adjust.
1693 (Stub_table::prev_size, set_prev_size): Delete.
1694 (Stub_table::stub_align): Let --plt-align affect result.
1695 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1696 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1697 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1698 (Stub_table::do_write): Support more stub variants.
1700 2012-12-04 Alan Modra <amodra@gmail.com>
1702 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1703 (Target_powerpc::do_define_standard_symbols): New function.
1705 2012-12-03 Alan Modra <amodra@gmail.com>
1707 * output.h: Formatting, whitespace.
1709 2012-12-03 Alan Modra <amodra@gmail.com>
1711 * layout.h (Layout::get_executable_sections): Declare.
1712 * layout.cc (Layout::get_executable_sections): New function.
1713 * arm.cc (Target_arm::group_sections): Use it.
1714 (Arm_output_section::group_sections): Delete now redundant test.
1715 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1716 param to handle relative relocs.
1717 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1718 (Output_data_reloc::add_absolute): Adjust.
1719 (Output_data_reloc::add_relative): New function.
1720 (Output_data::reset_data_size): New function.
1721 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1722 (Output_section::set_addralign): New function.
1723 (Output_section::checkpoint_set_addralign): New function.
1724 (Output_section::clear_section_offsets_need_adjustment): New function.
1725 (Output_section::input_sections): Make public.
1726 * powerpc.cc (class Output_data_brlt_powerpc): New.
1727 (class Stub_table, class Stub_control): New.
1728 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1729 stub_table_, set_stub_table, stub_table): New vectors and accessor
1731 (Target_powerpc::do_may_relax, do_relax, push_branch,
1732 new_stub_table, stub_tables, brlt_section, group_sections,
1733 add_branch_lookup_table, find_branch_lookup_table,
1734 write_branch_lookup_table, make_brlt_section): New functions.
1735 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1736 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1737 branch_info_): New vars.
1738 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1739 make call stubs here.
1740 (Output_data_glink): Remove all call stub handling from this class.
1741 (Target_powerpc::Scan::local, global): Save interesting branch
1742 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1743 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1744 functions on final link.
1745 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1746 Handle long branch destinations too.
1747 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1748 do_plt_address_for_local): Adjust lookup of plt call stubs.
1750 2012-11-30 Alan Modra <amodra@gmail.com>
1752 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1753 relocs against protected symbols when building 32-bit shared libs.
1755 2012-11-30 Alan Modra <amodra@gmail.com>
1757 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1758 param. Call got_section() to make .got. Update all callers
1759 and their callers and so on.
1761 2012-11-30 Alan Modra <amodra@gmail.com>
1763 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1764 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1765 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1766 value if it already exists.
1768 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1771 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1773 2012-11-14 Roland McGrath <mcgrathr@google.com>
1775 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1776 than bfc instruction for data sandboxing.
1778 2012-11-08 Alan Modra <amodra@gmail.com>
1780 * po/POTFILES.in: Regenerate.
1782 2012-11-05 Alan Modra <amodra@gmail.com>
1784 * configure.ac: Apply 2012-09-10 change to config.in here.
1785 * configure: Regenerate.
1787 2012-11-05 Alan Modra <amodra@gmail.com>
1789 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1790 (struct Opd_ent): Use "Address" rather than "Offset".
1791 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1792 (Target_powerpc::got_section): Make public.
1793 (Target_powerpc::scan_relocs): Move code setting symbols..
1794 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1795 Create _SDA_BASE_ only when referenced.
1797 2012-11-02 Roland McGrath <mcgrathr@google.com>
1799 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1802 2012-11-01 Roland McGrath <mcgrathr@google.com>
1804 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1805 for offset_in_output_section parameter.
1806 (Sized_target::relocate_special_relocatable): Likewise.
1807 * arm.cc (Target_arm::relocate_relocs): Likewise.
1808 (Target_arm::relocate_special_relocatable): Likewise.
1809 * i386.cc (Target_i386::relocate_relocs): Likewise.
1810 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1811 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1812 * target-reloc.h (relocate_relocs): Likewise.
1813 * testsuite/testfile.cc (Target_test): Likewise.
1814 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1815 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1817 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1818 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1820 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1821 parameter, which is unused in the [!F_SETFD] case.
1823 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1824 SYMNDX to off_t before comparing it to this->data_size().
1825 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1826 * incremental.cc (Output_section_incremental_inputs::do_write):
1827 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1829 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1831 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1833 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1834 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1837 2012-10-29 Cary Coutant <ccoutant@google.com>
1839 * dwp.cc (usage): Add file and exit status parameters;
1840 add --help and --version options.
1841 (print_version): New function.
1842 (main): Add --help and --version options.
1844 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1846 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1847 final_layout_sequence.txt.
1848 * testsuite/Makefile.in: Regenerated.
1850 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1852 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1853 COMPILE generated by automake.
1855 (CXXCOMPILE1): Likewise.
1856 (CXXLINK1): Likewise.
1857 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1859 (CXXCOMPILE): Likewise.
1860 (CXXLINK): Likewise.
1861 * testsuite/Makefile.in: Regenerated.
1863 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1865 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1866 on bad fwrite return.
1868 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1870 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1873 2012-10-23 Cary Coutant <ccoutant@google.com>
1875 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1876 * testsuite/Makefile.in: Regenerate.
1877 * testsuite/dwp_test.h: New source file.
1878 * testsuite/dwp_test_1.cc: New source file.
1879 * testsuite/dwp_test_1.s: New source file.
1880 * testsuite/dwp_test_1.sh: New source file.
1881 * testsuite/dwp_test_1b.cc: New source file.
1882 * testsuite/dwp_test_1b.s: New source file.
1883 * testsuite/dwp_test_2.cc: New source file.
1884 * testsuite/dwp_test_2.s: New source file.
1885 * testsuite/dwp_test_2.sh: New source file.
1886 * testsuite/dwp_test_main.cc: New source file.
1887 * testsuite/dwp_test_main.s: New source file.
1889 2012-10-23 Cary Coutant <ccoutant@google.com>
1891 * dwp.h: New header file.
1892 * dwp.cc: New source file.
1893 * gold.h: Move shared declarations to system.h.
1894 * system.h: New header file.
1895 * Makefile.am: Add dwp.
1896 * Makefile.in: Regenerate.
1898 2012-10-23 Cary Coutant <ccoutant@google.com>
1900 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1901 Dwarf_info_reader::read_from_pointer.
1902 (Dwarf_pubnames_table::read_header): Likewise.
1903 (Dwarf_pubnames_table::next_name): Likewise.
1904 (Dwarf_die::read_attributes): Likewise.
1905 (Dwarf_die::skip_attributes): Likewise.
1906 (Dwarf_info_reader::read_from_pointer): New function template.
1907 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1908 (Dwarf_pubnames_table): Likewise.
1909 (Dwarf_info_reader::read_from_pointer): New function template.
1910 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1911 Dwarf_pubnames_table ctor.
1913 2012-10-23 Cary Coutant <ccoutant@google.com>
1915 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1917 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1919 (Dwarf_info_reader::set_abbrev_shndx): New method.
1920 (Dwarf_info_reader::abbrev_shndx_): New data member.
1922 2012-10-23 Cary Coutant <ccoutant@google.com>
1924 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1925 from object, not parameters.
1926 (Dwarf_info_reader::parse): Likewise.
1927 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1928 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1929 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1932 2012-10-23 Cary Coutant <ccoutant@google.com>
1934 * fileread.cc (Input_file::Input_file): New constructor.
1935 * fileread.h (class Input_file): Add new constructor.
1937 2012-10-18 Alan Modra <amodra@gmail.com>
1940 * object.cc (Relobj::is_section_name_included): Also match
1941 .sdata personality section.
1943 2012-10-18 Alan Modra <amodra@gmail.com>
1945 * target-reloc.h (class Default_comdat_behavior): New, package up..
1946 (get_comdat_behaviour): ..this.
1947 (relocate_section): Add Relocate_comdat_behavior template arg,
1948 adjust code to suit.
1949 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1950 (Target_arm::scan_reloc_section): Likewise.
1951 * i386.cc (Target_i386::relocate_section): Likewise.
1952 * sparc.cc (Target_sparc::relocate_section): Likewise.
1953 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1954 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1955 * powerpc.cc (class Relocate_comdat_behavior): New.
1956 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1957 gold::relocate_section with new template arg.
1959 2012-10-18 Alan Modra <amodra@gmail.com>
1961 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1962 dynamic relocs for GOT_TPREL got entries, without symbol if
1964 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1965 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1966 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1968 2012-10-17 Alan Modra <amodra@gmail.com>
1971 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1973 2012-10-16 Sriraman Tallam <tmsriram@google.com>
1975 * layout.cc (Layout::include_section): Keep sections marked
1976 SHF_EXCLUDE when doing relocatable links.
1978 2012-10-16 Alan Modra <amodra@gmail.com>
1980 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1981 (Target_powerpc::do_finalize_sections): Call it.
1982 (Output_data_save_res): New class and supporting functions.
1983 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1984 normal symbols defined in object files.
1986 2012-10-12 Alan Modra <amodra@gmail.com>
1988 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1989 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1990 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1991 section if scan_opd_relocs not yet called.
1992 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1994 2012-10-12 Alan Modra <amodra@gmail.com>
1996 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1997 add_local_ifunc_entry): Revert last change.
1998 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2000 2012-10-05 Alan Modra <amodra@gmail.com>
2002 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2003 do_plt_address_for_global): New functions.
2004 (Output_data_got_powerpc::do_write): Don't segfault when linking
2006 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2007 add_local_ifunc_entry): Return true on adding entry..
2008 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2009 glink->add_entry call. Remove unused symtab param. Adjust calls.
2010 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2011 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2012 set up symbols here.
2013 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2014 syms here. Do so even when no .iplt. Don't segfault when linking
2016 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2017 new variants without reloc param.
2018 (Glink_sym_ent::Glink_sym_ent): Likewise.
2019 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2020 reloc when refs will resolve to plt call stub.
2021 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2022 R_PPC_PLTREL24 to resolve locally.
2023 (Target_powerpc::Scan::global): Correct ifunc handling.
2024 (Target_powerpc::Relocate::relocate): Correct local sym glink
2025 lookup. Don't destroy "value" when we have a plt call stub,
2026 and when checking plt call validity.
2027 (Target_powerpc::do_dynsym_value): Simplify.
2029 2012-10-05 Alan Modra <amodra@gmail.com>
2031 * i386.cc (Output_data_plt_i386::address_for_global,
2032 address_for_local): Add plt offset to returned value. Adjust uses.
2033 * sparc.cc (Output_data_plt_sparc::address_for_global,
2034 address_for_local): Likewise.
2035 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2036 address_for_local): Likewise.
2037 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2038 address_for_local): Likewise.
2039 * target.h (Target::plt_address_for_global, plt_address_for_local):
2041 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2042 (Output_data_got::Got_entry::write): Nor here.
2043 * output.h: Comment fix.
2045 2012-10-02 Jiong Wang <jiwang@tilera.com>
2047 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2048 global_offset_table_ value for larget got.
2049 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2051 2012-09-29 Alan Modra <amodra@gmail.com>
2053 * powerpc.cc (Target_powerpc::iplt_): New output section.
2054 (Target_powerpc::iplt_section, make_iplt_section,
2055 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2056 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2057 Target_powerpc::plt_entry_count): Count iplt entries too.
2058 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2059 reloc section in constructor. New params.
2060 (Target_powerpc::make_plt_section): Create reloc section here instead.
2061 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2063 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2064 (Output_data_glink::add_entry, find_entry): New functions to
2065 deal with local syms.
2066 (Glink_sym_ent): Add support for local syms.
2067 (Output_data_glink::do_write): Handle ifunc plt entries.
2068 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2069 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2070 (Target_powerpc::Relocate::relocate): Likewise.
2071 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2073 2012-09-25 Alan Modra <amodra@gmail.com>
2075 * object.h (Sized_relobj_file::adjust_local_symbol,
2076 do_adjust_local_symbol): New functions.
2077 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2078 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2079 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2080 and irregular opd entry spacing.
2081 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2082 (Global_symbol_visitor_opd): New functor.
2083 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2084 on deleted opd entries.
2086 2012-09-15 Jiong Wang <jiwang@tilera.com>
2088 * tilegx.cc: New file.
2089 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2090 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2091 * configure.tgt: Add entries for tilegx*.
2092 * configure.ac: Likewise.
2093 * Makefile.in: Rebuild.
2094 * configure: Likewise.
2095 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2098 2012-09-13 Alan Modra <amodra@gmail.com>
2100 * target-reloc.h (scan_relocs): Call scan.local for relocs
2101 against symbols in discarded sections. Pass is_discarded
2103 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2104 Add is_discarded param.
2105 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2106 is_discarded to flag opd entry as discarded. Don't emit dyn
2107 relocs on such entries.
2108 (Target_powerpc::Scan::global): Similarly detect and handle
2110 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2111 opd_ent_. Update all uses.
2112 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2113 (Target_powerpc::relocate_section): Zero out discarded opd
2116 2012-09-12 Ian Lance Taylor <iant@google.com>
2119 * output.cc: Rename Output_data_got template parameter from size
2120 to got_size for all functions. Compile all variants of
2122 (Output_data_got::Got_entry::write): Correct use of size for
2123 symbol value. Use local_is_tls rather than casting to
2125 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2126 (class Sized_relobj_file): Add do_local_is_tls.
2127 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2129 2012-09-11 Alan Modra <amodra@gmail.com>
2132 * layout.cc (Layout::set_segment_offsets): When using
2133 common-page-size alignment, ensure we are on a new max-page-size
2135 * output.cc (Output_segment::set_section_addresses): Use
2136 abi_pagesize, not common_pagesize for relro boundary.
2137 (Output_segment::set_offset): Likewise.
2139 2012-09-11 Alan Modra <amodra@gmail.com>
2141 * output.h (Output_data_got::add_global_tls, add_local_tls,
2142 add_local_tls_pair): New functions.
2143 (Output_data_got::add_local_pair_with_rel): Remove second
2144 reloc param. Expand comment.
2145 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2146 use_plt_or_tls_offset_, similarly for constructor param.
2147 (Output_data_got::Got_entry::write): Add got_index param.
2148 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2149 add_local_tls_pair): New functions.
2150 (Output_data_got::Got_entry::write): Handle tls symbols
2151 with use_plt_or_tls_offset_ set specially.
2152 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2153 (Output_data_got::do_write): Replace iterator with index, pass
2154 index to entry write function.
2155 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2156 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2157 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2159 * i386.cc (Target_i386::Scan::local): Likewise.
2160 * sparc.cc (Target_sparc::Scan::local): Likewise.
2161 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2162 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2163 do_tls_offset_for_global): New functions.
2164 (Target_powerpc::Scan::local): Correct TLS relocations and got
2166 (Target_powerpc::Scan::global): Don't emit unnecessary
2167 dynamic relocations on TLS GOT entries.
2169 2012-09-10 Matthias Klose <doko@ubuntu.com>
2171 * config.in: Disable sanity check for kfreebsd.
2173 2012-09-10 Sterling Augustine <saugustine@google.com>
2175 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2176 (Gdb_index::pubtypes_read): New parameter.
2177 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2179 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2182 2012-09-09 Alan Modra <amodra@gmail.com>
2184 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2185 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2186 * gc.h (gc_process_relocs): Call target gc_add_reference.
2187 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2188 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2189 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2191 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2192 to cater for when we don't need code offset. Update use.
2193 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2194 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2195 set_opd_valid): New functions.
2196 (Target_powerpc::do_gc_add_reference): New function.
2197 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2199 (Target_powerpc::do_gc_mark_symbol): New function.
2201 2012-09-06 Cary Coutant <ccoutant@google.com>
2203 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2204 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2205 (Dwarf_die::skip_attributes): Likewise.
2206 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2207 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2209 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2211 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2213 * testsuite/script_test_3.t: Add .got.plt output section
2215 * testsuite/script_test_4.t: Likewise.
2217 2012-09-05 Alan Modra <amodra@gmail.com>
2219 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2220 update all uses and lose "enum" when using type.
2222 2012-09-05 Alan Modra <amodra@gmail.com>
2224 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2225 * configure: Regenerate.
2226 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2227 (plugin_final_layout.stdout): Likewise.
2228 (memory_test): Set page sizes to 0x1000.
2229 * testsuite/Makefile.in: Regenerate.
2230 * testsuite/discard_locals_test.sh: Add FIXME comment.
2231 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2232 * testsuite/pr14265.t: Add .got output section statement.
2233 * testsuite/script_test_2.t: Likewise.
2234 * testsuite/script_test_3.t: Likewise.
2235 * testsuite/script_test_4.t: Likewise.
2236 * testsuite/script_test_5.t: Likewise.
2237 * testsuite/script_test_6.t: Likewise.
2238 * testsuite/script_test_7.t: Likewise.
2239 * testsuite/script_test_9.t: Likewise.
2241 2012-09-05 Alan Modra <amodra@gmail.com>
2243 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2244 (Powerpc_relocate_functions::Status): New typedef.
2245 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2246 (Target_powerpc::Scan::local): Handle REL64.
2247 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2248 for REL32 and REL64.
2249 (Target_powerpc::symval_for_branch): New function, extracted from..
2250 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2251 checks. Report overflow errors.
2253 2012-09-05 Alan Modra <amodra@gmail.com>
2255 * object.h (Sized_relobj_file::emit_relocs): Delete.
2256 (Sized_relobj_file::emit_relocs_reltype): Delete.
2257 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2258 relocate_relocs for --emit-relocs.
2259 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2260 * output.h: Update comment.
2261 (Output_segment::first_section): New function.
2262 (Output_segment::first_section_load_address): Use first_section.
2263 * output.cc (Output_segment::first_section): New function extracted..
2264 (Output_segment::first_section_load_address): ..from here. Delete.
2265 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2266 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2267 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2268 adjust call to target.h function.
2269 * i386.cc (Target_i386): Likewise.
2270 * sparc.cc (Target_sparc): Likewise.
2271 * x86_64.cc (Target_x86_64): Likewise.
2272 * powerpc.cc (Target_powerpc): Likewise.
2273 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2274 first tls section has section symbol for optimised local dynamic
2276 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2277 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2279 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2280 Rename to relocate_relocs. Update error message.
2282 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2284 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2287 2012-08-31 Alan Modra <amodra@gmail.com>
2289 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2290 (Powerpc_relobj::toc_base_offset): New stub function.
2291 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2292 got_mod_index_offset to tlsld_got_offset. Update all refs.
2293 (Target_powerpc::Relocate::enum skip_tls): New.
2294 (Target_powerpc::call_tls_get_addr_): New var.
2295 (Target_powerpc::is_branch_reloc): Move to file scope.
2296 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2297 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2299 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2300 (powerpc_info): Correct common_pagesize for ppc64.
2301 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2302 (Powerpc_relocate_functions): Add overflow check enums and functions.
2303 Add non-shift version of rela, rela_ua. Delete all rel public
2304 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2305 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2306 addr16_ha3, addr14 functions.
2307 (Output_data_got_powerpc::add_constant_pair): New function.
2308 (Output_data_got_powerpc::got_base_offset): Likewise.
2309 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2310 (instruction constants): Sort, add some more.
2311 (Output_data_glink::do_write): Add and use Address typedef. Use
2312 object->toc_base_offset() stub for 64-bit.
2313 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2314 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2315 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2316 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2317 Always treat .opd relocs as against locally defined symbol.
2318 Correct condition for RELATIVE relocs.
2319 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2320 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2321 for 32-bit syms with a plt entry. Correct ppc64 toc base
2322 calculations. Handle TLS relocs, and more. Add overflow
2323 checking and adjust for Powerpc_relocate_functions changes.
2324 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2325 Reinstate --emit-relocs code with FIXME.
2327 2012-08-30 Alan Modra <amodra@gmail.com>
2329 * layout.cc (Layout::set_segment_offsets): Set p_align to
2330 abi_pagesize, not common_pagesize.
2331 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2332 to determine whether file header can go in segment.
2334 2012-08-30 Alan Modra <amodra@gmail.com>
2336 * output.h (Output_reloc::Output_reloc <output section>): Add
2337 is_relative param. Adjust calls.
2338 (Output_reloc::add_output_section_relative): New functions.
2339 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2341 (Output_reloc::symbol_value): Handle SECTION_CODE.
2343 2012-08-24 Sriraman Tallam <tmsriram@google.com>
2345 * gold.cc (queue_middle_tasks): Call layout again when unique
2346 segments for sections is desired.
2347 * layout.cc (Layout::Layout): Initialize new members.
2348 (Layout::get_output_section_flags): New function.
2349 (Layout::choose_output_section): Call get_output_section_flags.
2350 (Layout::layout): Make output section for mapping to a unique segment.
2351 (Layout::insert_section_segment_map): New function.
2352 (Layout::attach_allocated_section_to_segment): Make unique segment for
2353 output sections marked so.
2354 (Layout::segment_precedes): Check for unique segments when sorting.
2355 * layout.h (Layout::Unique_segment_info): New struct.
2356 (Layout::Section_segment_map): New typedef.
2357 (Layout::insert_section_segment_map): New function.
2358 (Layout::get_output_section_flags): New function.
2359 (Layout::is_unique_segment_for_sections_specified): New function.
2360 (Layout::set_unique_segment_for_sections_specified): New function.
2361 (Layout::unique_segment_for_sections_specified_): New member.
2362 (Layout::section_segment_map_): New member.
2363 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2364 Rename is_gc_pass_one to is_pass_one.
2365 Rename is_gc_pass_two to is_pass_two.
2366 Rename is_gc_or_icf to is_two_pass.
2367 Check for which pass based on whether symbols data is present.
2368 Make it two pass when unique segments for sections is desired.
2369 * output.cc (Output_section::Output_section): Initialize new
2371 * output.h (Output_section::is_unique_segment): New function.
2372 (Output_section::set_is_unique_segment): New function.
2373 (Output_section::is_unique_segment_): New member.
2374 (Output_section::extra_segment_flags): New function.
2375 (Output_section::set_extra_segment_flags): New function.
2376 (Output_section::extra_segment_flags_): New member.
2377 (Output_section::segment_alignment): New function.
2378 (Output_section::set_segment_alignment): New function.
2379 (Output_section::segment_alignment_): New member.
2380 (Output_segment::Output_segment): Initialize is_unique_segment_.
2381 (Output_segment::is_unique_segment): New function.
2382 (Output_segment::set_is_unique_segment): New function.
2383 (Output_segment::is_unique_segment_): New member.
2384 * plugin.cc (allow_unique_segment_for_sections): New function.
2385 (unique_segment_for_sections): New function.
2386 (Plugin::load): Add new functions to transfer vector.
2387 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2388 * Makefile.in: Regenerate.
2389 * testsuite/plugin_final_layout.sh: Check if unique segment
2390 functionality works.
2391 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2393 (allow_unique_segment_for_sections): New global.
2394 (unique_segment_for_sections): New global.
2395 (claim_file_hook): Call allow_unique_segment_for_sections.
2396 (all_symbols_read_hook): Call unique_segment_for_sections.
2398 2012-08-22 Cary Coutant <ccoutant@google.com>
2400 * layout.cc (Layout::include_section): Don't assert on GROUP
2401 sections with --emit-relocs.
2403 2012-08-21 Cary Coutant <ccoutant@google.com>
2405 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2406 if --export-dynamic-symbol names an undef symbol.
2408 2012-08-18 Alan Modra <amodra@gmail.com>
2410 * powerpc.cc: Formatting and white space.
2411 (Powerpc_relobj): Rename got2_section_ to special_.
2412 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2413 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2414 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2415 (Target_powerpc): Add Address typedef and invalid_address. Use
2417 (Target_powerpc::is_branch_reloc): New function.
2418 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2419 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2420 for dst_mask, value and addend.
2421 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2422 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2423 (Output_data_glink::do_write): Correct toc base. Don't try to use
2424 uint16_t for 24-bit offset. Use get_output_section_offset and
2426 (Target_powerpc::Scan::local): Handle more relocs.
2427 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2428 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2429 Plug in toc restoring insn after plt calls. Translate branches
2430 to function descriptor symbols to corresponding entry point.
2431 (Target_powerpc::relocate_for_relocatable): Check return from
2432 get_output_section_offset.
2433 * symtab.h: Comment typo.
2435 2012-08-14 Ian Lance Taylor <iant@google.com>
2437 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2438 unsupported_relocal_local to call unsupported_reloc_global.
2440 2012-08-14 Nick Clifton <nickc@redhat.com>
2443 * script-sections.cc (Sections_element::output_section_name): Add
2444 keep return parameter.
2445 (Output_section_element::match_name): Add keep return parameter.
2446 Return the value of the keep_ member.
2447 * script-sections.h (class Output_section): Update
2448 output_section_name prototype.
2449 * layout.cc (Layout::keep_input_section): New public member
2451 (Layout::choose_output_section): Pass keep parameter to
2452 output_section_name.
2453 * layout.h (class Layout): Add keep_input_section.
2454 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2456 * testsuite/Makefile.am: Add a test.
2457 * testsuite/Makefile.in: Regenerate.
2458 * testsuite/pr14265.c: Source file for the test.
2459 * testsuite/pr14265.t: Linker script for the test.
2460 * testsuite/pr14265.sh: Shell script for the test.
2462 2012-08-14 Alan Modra <amodra@gmail.com>
2464 * target.h (Target::output_section_name): New function.
2465 (Target::do_output_section_name): New function.
2466 * layout.cc (Layout::choose_output_section): Call the above.
2467 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2469 2012-08-14 Alan Modra <amodra@gmail.com>
2471 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2472 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2473 for replace_constant call.
2474 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2475 (Output_data_glink::do_print_to_mapfile): New function.
2476 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2477 (Target_powerpc::Relocate::relocate): Likewise.
2479 2012-08-14 Alan Modra <amodra@gmail.com>
2481 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2482 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2483 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2484 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2485 all references to shndx_. Handle special case for R_PPC_PLTREL24
2487 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2488 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2489 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2491 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2492 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2494 2012-08-12 Alan Modra <amodra@gmail.com>
2496 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2497 (glink insn constants): Use uint32_t.
2498 (Output_data_glink::add_entry): Use insert, not [] operator.
2500 2012-08-11 Alan Modra <amodra@gmail.com>
2502 * object.h (Sized_relobj_file::find_shdr): New function.
2503 (Sized_relobj_file::find_special_sections): New function.
2504 * object.cc (Sized_relobj_file::find_shdr): New function.
2505 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2506 (Sized_relobj_file::find_special_sections): New function, split out..
2507 (Sized_relobj_file::do_read_symbols): ..from here.
2508 * output.h (Output_data_got::replace_constant): New function.
2509 (Output_data_got::num_entries): New function.
2510 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2511 (Output_data_got::got_offset): Protected rather than private.
2512 (Output_data_got::replace_got_entry): New function.
2513 * output.cc (Output_data_got::replace_got_entry): New function.
2514 * powerpc.cc (class Powerpc_relobj): New.
2515 (class Powerpc_relocate_functions): Delete all psymval variants or
2516 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2517 Implement _ha functions using corresponding _hi function.
2518 (Powerpc_relobj::find_special_sections): New function.
2519 (Target_powerpc::do_make_elf_object): New function.
2520 (class Output_data_got_powerpc): New.
2521 (class Output_data_glink): New.
2522 (class Powerpc_scan_relocatable_reloc): New.
2523 Many more changes througout file.
2525 2012-08-09 Nick Clifton <nickc@redhat.com>
2527 * po/vi.po: Updated Vietnamese translation.
2529 2012-08-07 Ian Lance Taylor <iant@google.com>
2531 * layout.cc (Layout::add_target_dynamic_tags): If
2532 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2535 2012-07-30 Nick Clifton <nickc@redhat.com>
2537 * po/gold.pot: Updated template.
2538 * po/es.po: Updated Spanish translation.
2540 2012-07-18 Cary Coutant <ccoutant@google.com>
2543 * configure.ac: Add check for -gpubnames support.
2544 * configure: Regenerate.
2545 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2546 support; force -gno-pubnames.
2547 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2549 (gdb_index_test_4): New test.
2550 * testsuite/Makefile.in: Regenerate.
2551 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2552 * testsuite/gdb_index_test_2.sh: Likewise.
2553 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2554 * testsuite/gdb_index_test_4.sh: New script.
2555 * testsuite/gdb_index_test_comm.sh: New script with common code;
2556 don't look for space after colon.
2558 2012-07-16 Sriraman Tallam <tmsriram@google.com>
2560 * gold.cc (queue_middle_tasks): Update function order only after
2561 deferred objects due to plugins are processed.
2563 2012-07-11 Ian Lance Taylor <iant@google.com>
2565 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2566 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2567 (Target_arm::scan_reloc_for_stub): Likewise.
2568 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2569 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2570 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2571 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2572 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2574 2012-07-10 Dodji Seketeli <dodji@redhat.com>
2575 Ian Lance Taylor <iant@google.com>
2578 * configure.ac: Test whether std::tr1::hash<off_t> works.
2579 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2581 * output.h (class Output_fill): Add virtual destructor.
2582 * configure, config.in: Rebuild.
2584 2012-06-22 Roland McGrath <mcgrathr@google.com>
2586 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2588 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2590 * plugin.cc (Plugin::load): Handle position independent executables.
2592 2012-06-06 Cary Coutant <ccoutant@google.com>
2594 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2596 (lines_only_debug_sections): Likewise.
2597 (gdb_fast_lookup_sections): New static array.
2598 (is_gdb_debug_section): Rename formal parameter.
2599 (is_lines_only_debug_section): Likewise.
2600 (is_gdb_fast_lookup_section): New function.
2601 (Layout::include_section): Check for ".zdebug_" prefix; pass
2602 section name suffix to is_gdb_debug_section, et al.; check for
2603 fast-lookup sections when building .gdb_index.
2604 * options.h (--strip-debug-gdb): Update GDB version number.
2606 2012-06-06 Cary Coutant <ccoutant@google.com>
2608 * configure.ac: Add check for fallocate.
2609 * configure: Regenerate.
2610 * config.in: Regenerate.
2612 * options.h (class General_options): Add --mmap-output-file and
2613 --posix-fallocate options.
2614 * output.cc: (posix_fallocate): Remove; replace with...
2615 (gold_fallocate): New function.
2616 (Output_file::map_no_anonymous): Call gold_fallocate.
2617 (Output_file::map): Check --mmap-output-file option.
2619 2012-06-05 Jing Yu <jingyu@google.com>
2621 * gold.h (textdomain): Add do {} to empty while(0).
2622 (bindtextdomain): Likewise.
2624 2012-06-04 Cary Coutant <ccoutant@google.com>
2626 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2629 2012-05-25 Sriraman Tallam <tmsriram@google.com>
2631 * symtab.cc (Symbol_table::define_special_symbol):
2632 Initialize *poldsym to prevent uninitialized variable errors.
2634 2012-05-23 Cary Coutant <ccoutant@google.com>
2636 * layout.cc (Layout::section_name_mapping): Add rules to handle
2637 exact match on .data.rel.ro.local or .data.rel.ro.
2638 (Layout::output_section_name): Check for exact matches.
2640 2012-05-23 Cary Coutant <ccoutant@google.com>
2642 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2645 2012-05-22 Cary Coutant <ccoutant@google.com>
2647 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2648 object before exporting symbol.
2650 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2652 * testsuite/tls_test.cc: Include "config.h" first.
2653 * testsuite/tls_test_c.c: Likewise.
2655 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
2656 Nick Clifton <nickc@redhat.com>
2659 * configure.in: Add check that sysdep.h has been included before
2660 any system header files.
2661 * configure: Regenerate.
2662 * config.in: Regenerate.
2664 2012-05-14 Cary Coutant <ccoutant@google.com>
2666 * layout.cc (Layout::make_output_section): Mark .tdata section
2668 * testsuite/relro_test.cc: Add a TLS variable.
2670 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2673 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2674 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2677 2012-05-08 Cary Coutant <ccoutant@google.com>
2679 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2680 (lines_only_debug_sections): Likewise.
2682 2012-05-02 Roland McGrath <mcgrathr@google.com>
2684 * nacl.cc: New file.
2686 * Makefile.am (CCFILES, HFILES): Add them.
2687 * Makefile.in: Regenerate.
2688 * i386.cc (Output_data_plt_i386_nacl): New class.
2689 (Output_data_plt_i386_nacl_exec): New class.
2690 (Output_data_plt_i386_nacl_dyn): New class.
2691 (Target_i386_nacl): New class.
2692 (Target_selector_i386_nacl): New class.
2693 (target_selector_i386): Use it instead of Target_selector_i386.
2694 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2695 (Target_x86_64_nacl): New class.
2696 (Target_selector_x86_64_nacl): New class.
2697 (target_selector_x86_64, target_selector_x32): Use it instead of
2698 Target_selector_x86_64.
2699 * arm.cc (Output_data_plt_arm_nacl): New class.
2700 (Target_arm_nacl): New class.
2701 (Target_selector_arm_nacl): New class.
2702 (target_selector_arm, target_selector_armbe): Use it instead of
2703 Target_selector_arm.
2705 * target-select.cc (select_target): Take new Input_file* and off_t
2706 arguments, pass them on to recognize method of selector.
2707 * object.cc (make_elf_sized_object): Update caller.
2708 * parameters.cc (parameters_force_valid_target): Likewise.
2709 * incremental.cc (make_sized_incremental_binary): Likewise.
2710 * target-select.h: Update decl.
2711 (Target_selector::recognize): Take new Input_file* argument,
2712 pass it on to do_recognize.
2713 (Target_selector::do_recognize): Take new Input_file* argument.
2714 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2715 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2716 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2717 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2719 * target.h (Target::Target_info): New members isolate_execinstr
2721 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2722 * arm.cc (Target_arm::arm_info): Update initializer.
2723 * i386.cc (Target_i386::i386_info): Likewise.
2724 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2725 * sparc.cc (Target_sparc::sparc_info): Likewise.
2726 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2727 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2728 * layout.cc (Layout::attach_allocated_section_to_segment):
2729 Take new const Target* argument. If target->isolate_execinstr(), act
2731 (Layout::find_first_load_seg): Take new const Target* argument;
2732 if target->isolate_execinstr(), reject PF_X segments.
2733 (Layout::relaxation_loop_body): Update caller.
2734 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2735 reset file offset to zero when we hit LOAD_SEG, and then do a second
2736 loop over the segments before LOAD_SEG to reassign offsets after
2737 addresses have been determined. Handle target->rosegment_gap().
2738 (Layout::attach_section_to_segment): Take new const Target* argument;
2739 pass it to attach_allocated_section_to_segment.
2740 (Layout::make_output_section): Update caller.
2741 (Layout::attach_sections_to_segments): Take new const Target* argument;
2742 pass it to attach_section_to_segment.
2743 * gold.cc (queue_middle_tasks): Update caller.
2744 * layout.h (Layout): Update method decls with new arguments.
2746 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2747 Target_info pointer to use.
2748 (Target_arm::do_make_data_plt): New virtual method.
2749 (Target_arm::make_data_plt): New method that calls it.
2750 (Target_arm::make_plt_entry): Use it.
2751 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2752 for the section alignment.
2753 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2755 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2756 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2758 (Output_data_plt_arm::get_plt_entry_size): Call it.
2759 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2760 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2761 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2763 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2764 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2765 method instead of sizeof(plt_entry).
2766 (Output_data_plt_arm::add_entry): Likewise.
2767 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2768 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2770 (Target_arm::plt_entry_size): Likewise.
2771 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2773 (Output_data_plt_arm_standard): ... here, new class.
2774 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2775 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2776 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2778 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2779 Take additional argument for the PLT entry size.
2780 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2781 Use get_plt_entry_size method rather than plt_entry_size variable.
2782 (Output_data_plt_x86_64::reserve_slot): Likewise.
2783 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2784 (Output_data_plt_x86_64::add_entry): Likewise.
2785 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2786 (Output_data_plt_x86_64::address_for_global): Likewise.
2787 (Output_data_plt_x86_64::address_for_local): Likewise.
2788 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2789 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2790 Make method non-static.
2791 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2793 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2794 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2795 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2796 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2798 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2799 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2801 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2802 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2804 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2805 (Output_data_plt_x86_64::plt_entry_size)
2806 (Output_data_plt_x86_64::first_plt_entry)
2807 (Output_data_plt_x86_64::plt_entry)
2808 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2809 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2810 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2811 (Output_data_plt_x86_64_standard): ... here, new class.
2812 (Target_x86_64::Target_x86_64): Take optional argument for the
2813 Target_info pointer to use.
2814 (Target_x86_64::do_make_data_plt): New virtual method.
2815 (Target_x86_64::make_data_plt): New method to call it.
2816 (Target_x86_64::init_got_plt_for_update): Use that.
2817 Call this->plt_->add_eh_frame method here.
2818 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2819 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2820 rather than static method.
2821 (Target_x86_64::plt_entry_size): Likewise.
2822 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2823 rather than plt_entry_size variable. Move guts of PLT filling to...
2824 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2825 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2826 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2828 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2829 additional argument for the section alignment.
2830 Don't do add_eh_frame_for_plt here.
2831 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2832 non-static. Use get_plt_entry_size method rather than plt_entry_size
2834 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2836 (Output_data_plt_i386::get_plt_entry_size): Call it.
2837 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2838 (Output_data_plt_i386::add_eh_frame): New method to call it.
2839 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2841 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2842 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2844 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2845 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2846 method instead of plt_entry_size.
2847 (Output_data_plt_i386::plt_entry_size)
2848 (Output_data_plt_i386::plt_eh_frame_fde_size)
2849 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2850 (Output_data_plt_i386_standard): ... here, new class.
2851 (Output_data_plt_i386_exec): New class.
2852 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2853 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2854 (Output_data_plt_i386::exec_plt_entry): Move to ...
2855 (Output_data_plt_i386_exec::plt_entry): ... here.
2856 (Output_data_plt_i386_dyn): New class.
2857 (Output_data_plt_i386::first_plt_entry): Move to ...
2858 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2859 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2860 (Output_data_plt_i386_dyn::plt_entry): ... here.
2861 (Target_i386::Target_i386): Take optional argument for the Target_info
2863 (Target_i386::do_make_data_plt): New virtual method.
2864 (Target_i386::make_data_plt): New method to call it.
2865 (Target_i386::make_plt_section): Use that.
2866 Call this->plt_->add_eh_frame method here.
2867 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2868 rather than plt_entry_size variable.
2869 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2870 (Output_data_plt_i386::address_for_local): Likewise.
2871 (Output_data_plt_i386::do_write): Likewise.
2872 Move guts of PLT filling to...
2873 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2874 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2875 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2876 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2878 2012-05-01 Cary Coutant <ccoutant@google.com>
2880 * dwarf_reader.cc (Dwarf_die::read_attributes)
2881 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2882 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2883 * reduced_debug_output.cc
2884 (Output_reduced_debug_info_section::get_die_end): Remove
2885 DW_FORM_GNU_ref_index. Add default case.
2887 2012-04-26 Mark Wielaard <mjw@redhat.com>
2889 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2890 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2891 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2892 DW_AT_high_pc as offset from DW_AT_low_pc.
2894 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2895 * testsuite/Makefile.in: Regenerate.
2896 * testsuite/gdb_index_test_3.c: New test source file.
2897 * testsuite/gdb_index_test_3.sh: New test source file.
2899 2012-04-25 Ian Lance Taylor <iant@google.com>
2901 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2903 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2904 as a class, not a struct.
2905 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2906 (Target_arm::apply_cortex_a8_workaround): Likewise.
2907 * gc.h: Declare Reloc_types as a struct, not a class.
2908 * object.h: Declare Symbols_data as a struct.
2909 * reloc.h: Declare Read_relocs_data as a struct.
2910 * target.h: Declare Relocate_info as a struct.
2912 2012-04-24 David S. Miller <davem@davemloft.net>
2914 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2915 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2918 2012-04-24 Cary Coutant <ccoutant@google.com>
2920 * incremental-dump.cc (find_input_containing_global): Replace
2921 magic number with symbolic constant.
2922 (dump_incremental_inputs): Update version number.
2923 * incremental.cc (Output_section_incremental_inputs): Update version
2924 number; import symbolic constants from Incremental_inputs_reader.
2925 (Incremental_inputs::create_data_sections): Align relocations
2926 section correctly for 64-bit targets.
2927 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2928 constants; add padding.
2929 (Output_section_incremental_inputs::write_header): Add assert for
2931 (Output_section_incremental_inputs::write_input_files): Add assert
2932 for input_entry_size.
2933 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2934 add assert for object_info_size, input_section_entry_size,
2935 global_sym_entry_size.
2936 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2937 for data structure sizes; use them.
2938 (Incremental_input_entry_reader): Import symbolic constants from
2939 Incremental_inputs_reader; use them.
2941 2012-04-23 David S. Miller <davem@davemloft.net>
2943 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2945 (Target_sparc::Target_sparc): Initialize new fields.
2946 (Target_sparc::do_make_elf_object): New function.
2947 (Target_sparc::do_adjust_elf_header): New function.
2949 2012-04-23 Cary Coutant <ccoutant@google.com>
2951 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2952 CU range table of gdb index.
2954 2012-04-20 David S. Miller <davem@davemloft.net>
2956 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2959 2012-04-16 David S. Miller <davem@davemloft.net>
2961 * sparc.cc (Target_sparc::got_address): New function.
2962 (Sparc_relocate_functions::gdop_hix22): New function.
2963 (Sparc_relocate_functions::gdop_lox10): New function.
2964 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2966 (Target_sparc::Scan::local): Likewise if the global symbol is not
2967 preemptible and is not IFUNC.
2968 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2969 transformations for local and non-preemptible non-IFUNC global
2972 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2973 writing out 64-bit part of ranges.
2975 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2976 -fpic and -fpie respectively.
2977 * Makefile.in: Regenerate.
2979 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2980 (Target_sparc::Target_sparc): Initialize new field.
2981 (Target_sparc::do_plt_section_for_global): New function.
2982 (Target_sparc::do_plt_section_for_local): New function.
2983 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2984 (Target_sparc::make_plt_section): New function, broken out of
2985 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2986 (Target_sparc::make_plt_entry): Call make_plt_section.
2987 (Target_sparc::make_local_ifunc_plt_entry): New function.
2988 (Target_sparc::rela_ifunc_section): New function.
2989 (Target_sparc::plt_section): Remove const.
2990 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2991 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2992 and ifunc_count_ fields.
2993 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2994 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2995 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2996 (Output_data_plt_sparc::rela_ifunc): New function.
2997 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2998 (Output_data_plt_sparc::has_ifunc_section): New function.
2999 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3000 (Output_data_plt_sparc::address_for_global): New function.
3001 (Output_data_plt_sparc::address_for_local): New function.
3002 (Output_data_plt_sparc::plt_index_to_offset): New function.
3003 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3005 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3007 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3008 R_SPARC_JMP_IREL to switch.
3009 (Target_sparc::Scan::check_non_pic): Likewise.
3010 (Target_sparc::Scan::local): Handle IFUNC symbols.
3011 (Target_sparc::Scan::local): Likewise.
3012 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3013 and plt_address_for_local.
3014 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3015 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3017 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3018 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3019 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3020 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3022 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3023 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3025 * sparc.cc (Target_sparc::Scan::global): Likewise.
3026 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3028 2012-04-16 Cary Coutant <ccoutant@google.com>
3030 * archive.cc (Library_base::should_include_member): Check for
3031 --export-dynamic-symbol.
3032 * options.h (class General_options): Add --export-dynamic-symbol.
3033 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3034 --export-dynamic-symbol.
3035 (Symbol_table::gc_mark_undef_symbols): Likewise.
3036 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3038 2012-04-12 David S. Miller <davem@davemloft.net>
3040 * sparc.cc (Reloc::wdisp10): New relocation method.
3041 (Reloc::h34): Likewise.
3042 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3043 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3045 (Target_sparc::Scan::local): Likewise.
3046 (Target_sparc::Scan::global): Likewise.
3047 (Target_sparc::Relocate::relocate): Likewise.
3049 2012-04-09 Cary Coutant <ccoutant@google.com>
3051 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3054 2012-04-06 Ian Lance Taylor <iant@google.com>
3056 * timer.cc: #include <unistd.h>.
3058 2012-04-06 Roland McGrath <mcgrathr@google.com>
3060 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3061 * config.in: Regenerate.
3062 * configure: Regenerate.
3064 2012-04-05 Nick Clifton <nickc@redhat.com>
3066 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3067 (AM_LC_MESSAGES): Add.
3068 * aclocal.m4: Regenerate.
3069 * config.in: Regenerate.
3070 * configure: Regenerate.
3072 2012-03-21 Cary Coutant <ccoutant@google.com>
3074 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3075 * Makefile.in: Regenerate.
3076 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3077 (Sized_elf_reloc_mapper::symbol_section): New function.
3078 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3079 (make_elf_reloc_mapper): New function.
3080 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3081 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3082 (Dwarf_abbrev_table::do_get_abbrev): New function.
3083 (Dwarf_ranges_table::read_ranges_table): New function.
3084 (Dwarf_ranges_table::read_range_list): New function.
3085 (Dwarf_pubnames_table::read_section): New function.
3086 (Dwarf_pubnames_table::read_header): New function.
3087 (Dwarf_pubnames_table::next_name): New function.
3088 (Dwarf_die::Dwarf_die): New function.
3089 (Dwarf_die::read_attributes): New function.
3090 (Dwarf_die::skip_attributes): New function.
3091 (Dwarf_die::set_name): New function.
3092 (Dwarf_die::set_linkage_name): New function.
3093 (Dwarf_die::attribute): New function.
3094 (Dwarf_die::string_attribute): New function.
3095 (Dwarf_die::int_attribute): New function.
3096 (Dwarf_die::uint_attribute): New function.
3097 (Dwarf_die::ref_attribute): New function.
3098 (Dwarf_die::child_offset): New function.
3099 (Dwarf_die::sibling_offset): New function.
3100 (Dwarf_info_reader::check_buffer): New function.
3101 (Dwarf_info_reader::parse): New function.
3102 (Dwarf_info_reader::do_parse): New function.
3103 (Dwarf_info_reader::do_read_string_table): New function.
3104 (Dwarf_info_reader::lookup_reloc): New function.
3105 (Dwarf_info_reader::get_string): New function.
3106 (Dwarf_info_reader::visit_compilation_unit): New function.
3107 (Dwarf_info_reader::visit_type_unit): New function.
3108 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3109 Sized_elf_reloc_mapper.
3110 (Sized_dwarf_line_info::symbol_section): Remove function.
3111 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3112 (Sized_dwarf_line_info::read_line_mappings): Remove object
3113 parameter, adjust callers.
3114 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3115 * dwarf_reader.h: Include <sys/types.h>.
3116 (class Track_relocs): Remove forward declaration.
3117 (class Elf_reloc_mapper): New class.
3118 (class Sized_elf_reloc_mapper): New class.
3119 (class Dwarf_abbrev_table): New class.
3120 (class Dwarf_range_list): New class.
3121 (class Dwarf_ranges_table): New class.
3122 (class Dwarf_pubnames_table): New class.
3123 (class Dwarf_die): New class.
3124 (class Dwarf_info_reader): New class.
3125 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3126 (Sized_dwarf_line_info::symbol_section): Remove member function.
3127 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3129 * gdb-index.cc: New source file.
3130 * gdb-index.h: New source file.
3131 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3132 and .debug_types sections, call Layout::add_to_gdb_index.
3133 (Sized_relobj_incr::do_section_name): Implement.
3134 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3135 return type; Implement.
3136 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3138 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3139 parameter list and return type.
3140 (Sized_incr_dynobj::do_section_contents): Likewise.
3141 * layout.cc: Include gdb-index.h.
3142 (Layout::Layout): Initialize gdb_index_data_.
3143 (Layout::init_fixed_output_section): Check for .gdb_index section.
3144 (Layout::add_to_gdb_index): New function. Instantiate.
3145 * layout.h: Add forward declaration for class Gdb_index.
3146 (Layout::add_to_gdb_index): New member function.
3147 (Layout::gdb_index_data_): New data member.
3148 * main.cc: Include gdb-index.h.
3149 (main): Print statistics for gdb index.
3150 * object.cc (Object::section_contents): Move code into
3151 do_section_contents.
3152 (need_decompressed_section): Check for sections needed when building
3154 (build_compressed_section_map): Likewise.
3155 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3157 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3158 sections; call Layout::add_to_gdb_index.
3159 (Sized_relobj_file::do_decompressed_section_contents): Call
3160 do_section_contents directly.
3161 * object.h (Object::do_section_contents): Adjust parameter list and
3163 (Object::do_decompressed_section_contents): Call do_section_contents
3165 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3167 * options.h (class General_options): Add --gdb-index option.
3168 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3169 list and return type.
3170 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3171 * reloc.h (Track_relocs::checkpoint): New function.
3172 (Track_relocs::reset): New function.
3174 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3176 * testsuite/Makefile.in: Regenerate.
3177 * testsuite/gdb_index_test.cc: New test source file.
3178 * testsuite/gdb_index_test_1.sh: New test source file.
3179 * testsuite/gdb_index_test_2.sh: New test source file.
3181 2012-03-19 Doug Kwan <dougkwan@google.com>
3183 * arm.cc (Target_arm::do_define_standard_symbols): New method.
3184 (Target_arm::do_finalize_sections): Remove code which defines
3185 __exidx_start and __exidx_end. Make symbol table parameter
3186 anonymous as it is not used.
3187 * gold.cc (queue_middle_tasks): Call target hook to define any
3188 target-specific symbols.
3189 * target.h (Target::define_standard_symbols): New method.
3190 (Target::do_define_standard_symbols): Same.
3191 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3192 * testsuite/Makefile.in: Regenerate.
3193 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3195 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3196 relocations are generated for __exidx_start and __exidx_end.
3198 2012-03-16 Doug Kwan <dougkwan@google.com>
3200 * testsuite/Makefile.am: Disable test initpri3b.
3201 * testsuite/Makefile.in: Regenerate.
3203 2012-03-15 Doug Kwan <dougkwan@google.com>
3205 * arm.cc (Target_arm::got_section): Make .got section read-only
3208 2012-03-15 Ian Lance Taylor <iant@google.com>
3211 * layout.cc (Layout::make_output_section): Correctly mark
3212 SHT_INIT_ARRAY, et. al., as relro.
3214 2012-03-14 Doug Kwan <dougkwan@google.com>
3216 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3217 dynamic relocations for protected symbols in shared objects.
3219 2012-03-13 Ian Lance Taylor <iant@google.com>
3221 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3222 keep the larger alignment.
3224 2012-03-12 Cary Coutant <ccoutant@google.com>
3226 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3227 handling of DW_LNE_define_file.
3229 2012-03-12 Cary Coutant <ccoutant@google.com>
3231 * reduced_debug_output.cc
3232 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3235 2012-02-29 Cary Coutant <ccoutant@google.com>
3237 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3239 2012-02-29 Cary Coutant <ccoutant@google.com>
3241 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3242 Call Object::decompressed_section_contents.
3243 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3245 (Sized_dwarf_line_info::buffer_start_): New data member.
3246 * merge.cc (Output_merge_data::do_add_input_section): Call
3247 Object::decompressed_section_contents.
3248 (Output_merge_string::do_add_input_section): Likewise.
3249 * object.cc (need_decompressed_section): New function.
3250 (build_compressed_section_map): Decompress sections needed later.
3251 (Sized_relobj_file::do_decompressed_section_contents): New function.
3252 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3253 * object.h (Object::decompressed_section_contents): New function.
3254 (Object::discard_decompressed_sections): New function.
3255 (Object::do_decompressed_section_contents): New function.
3256 (Object::do_discard_decompressed_sections): New function.
3257 (Compressed_section_info): New type.
3258 (Compressed_section_map): Include decompressed section contents.
3259 (Sized_relobj_file::do_decompressed_section_contents): New function.
3260 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3262 2012-02-16 Cary Coutant <ccoutant@google.com>
3264 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3265 * testsuite/Makefile.in: Regenerate.
3267 2012-02-14 Cary Coutant <ccoutant@google.com>
3269 * options.cc (General_options::finalize): Disallow -pie and -static.
3271 2012-02-03 Doug Kwan <dougkwan@google.com>
3273 * arm.cc (Arm_relocate_functions::abs8,
3274 Arm_relocate_functions::abs16): Use
3275 Bits::has_signed_unsigned_overflow32.
3276 (Arm_relocate_functions::thm_abs8): Correct range of
3278 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3281 2012-02-02 Doug Kwan <dougkwan@google.com>
3283 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3284 position independent outputs, not just shared objects.
3286 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3288 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3289 * configure: Regenerated.
3291 2012-01-27 Ian Lance Taylor <iant@google.com>
3293 * reloc.h (Bits): New class with static functions, copied from
3294 namespace utils in arm.cc.
3295 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3298 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3300 * incremental.cc (write_info_blocks): Correct relocation offset.
3302 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3304 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3305 (Relocate::tls_gd_to_le): Likewise.
3307 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3309 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3311 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3313 * configure.ac: Check if -mcmodel=medium works.
3314 * configure: Regenerated.
3316 2012-01-24 Cary Coutant <ccoutant@google.com>
3318 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3320 (read_unsigned_LEB_128_x): ... this new function.
3321 (read_signed_LEB_128): Replaced with inline definition and ...
3322 (read_signed_LEB_128_x): ... this new function.
3323 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3324 (read_unsigned_LEB_128): Add inline definition.
3325 (read_signed_LEB_128_x): New function.
3326 (read_signed_LEB_128): Add inline definition.
3327 * testsuite/Makefile.am (leb128_unittest): New unit test.
3328 * testsuite/Makefile.in: Regenerate.
3329 * testsuite/leb128_unittest.cc: New unit test.
3331 2012-01-23 Ian Lance Taylor <iant@google.com>
3334 * i386.cc (Target_i386::do_code_fill): When using a jmp
3335 instruction, pad with nop instructions.
3336 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3338 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3340 * x86_64.cc (gc_process_relocs): Add typename on types used in
3342 (scan_relocs): Likewise.
3343 (relocate_section): Likewise.
3344 (apply_relocation): Likewise.
3346 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3348 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3349 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3352 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3354 * x86_64.cc: Initial support for x32.
3356 2012-01-03 Cary Coutant <ccoutant@google.com>
3358 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3359 Use abstract base class for GOT.
3360 * gold/output.h (class Output_data_got_base): New abstract base class.
3361 (class Output_data_got): Derive from new base class, adjust ctors.
3362 (Output_data_got::reserve_slot): Make virtual; rename to
3363 do_reserve_slot; Adjust callers.
3364 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3365 pointer to abstract base class.
3366 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3368 2011-12-18 Ian Lance Taylor <iant@google.com>
3370 * object.h (Relobj::local_symbol_value): New function.
3371 (Relobj::local_plt_offset): New function.
3372 (Relobj::local_has_got_offset): New function.
3373 (Relobj::local_got_offset): New function.
3374 (Relobj::set_local_got_offset): New function.
3375 (Relobj::do_local_symbol_value): New pure virtual function.
3376 (Relobj::do_local_plt_offset): Likewise.
3377 (Relobj::do_local_has_got_offset): Likewise.
3378 (Relobj::do_local_got_offset): Likewise.
3379 (Relobj::do_set_local_got_offset): Likewise.
3380 (Sized_relobj::do_local_has_got_offset): Rename from
3381 local_has_got_offset.
3382 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3383 (Sized_relobj::do_set_local_got_offset): Rename from
3384 set_local_got_offset.
3385 (Sized_relobj_file::do_local_plt_offset): Rename from
3387 (Sized_relobj_file::do_local_symbol_value): New function.
3388 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3390 * output.cc (Output_data_got::Got_entry::write): Change object to
3391 Relobj. Use local_symbol_value.
3392 (Output_data_got::add_global_with_rel): Change rel_dyn to
3393 Output_data_reloc_generic*. Use add_global_generic.
3394 (Output_data_got::add_global_with_rela): Remove. Change all
3395 callers to use add_global_with_rel.
3396 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3397 Output_data_reloc_generic*. Use add_global_generic.
3398 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3399 callers to use add_global_pair_with_rel.
3400 (Output_data_got::add_local): Change object to Relobj*.
3401 (Output_data_got::add_local_plt): Likewise.
3402 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3403 change rel_dyn to Output_data_reloc_generic*. Use
3405 (Output_data_got::add_local_with_rela): Remove. Change all
3406 callers to use all_local_with_rel.
3407 (Output_data_got::add_local_pair_with_rel): Change object to
3408 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3409 add_output_section_generic.
3410 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3411 callers to use add_local_pair_with_rel.
3412 (Output_data_got::reserve_local): Change object to Relobj*.
3413 * output.h: (class Output_data_reloc_generic): Add pure virtual
3414 declarations for add_global_generic, add_local_generic,
3415 add_output_section_generic.
3416 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3417 functions for Output_data_reloc_generic. Update declarations for
3418 changes listed in output.cc.
3419 (class Output_data_got): Change template parameter to got_size.
3420 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3421 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3423 (Sized_relobj_incr::do_local_plt_offset): New function.
3424 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3427 2011-12-17 Cary Coutant <ccoutant@google.com>
3429 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3430 * resolve.cc (Symbol_table::resolve): Likewise.
3431 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3433 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3435 2011-12-16 Ian Lance Taylor <iant@google.com>
3437 * output.h (Output_data_reloc_generic::add): Only call
3438 add_dynamic_reloc if this is a dynamic reloc section.
3440 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3443 * target-reloc.h (apply_relocation): Replace <64, false> with
3446 2011-11-25 Nick Clifton <nickc@redhat.com>
3448 * po/it.po: New Italian translation.
3450 2011-11-17 Sterling Augustine <saugustine@google.com>
3452 * script.cc (script_include_directive): Implement.
3453 (read_script_file): New local variables name and search_path. Update
3454 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3455 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3456 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3458 2011-11-11 Sterling Augustine <saugustine@google.com>
3460 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3461 (file_or_sections_cmd): Likewise.
3463 2011-11-11 Doug Kwan <dougkwan@google.com>
3465 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3466 if --just-symbols is given.
3468 2011-11-10 Doug Kwan <dougkwan@google.com>
3471 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3472 when processing data relocs.
3473 * reloc.h (Relocate_functions::rel_unaligned): New method.
3474 (Relocate_functions::pcrel_unaligned): Ditto.
3475 (Relocate_functions::rel32_unaligned): Ditto.
3476 (Relocate_functions::pcrel32_unaligned): Ditto.
3478 2011-11-09 Doug Kwan <dougkwan@google.com>
3481 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3482 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3483 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3484 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3485 (Relocate_functions::rel_unaligned): New.
3486 (Relocate_functions::rel32_unaligned): New.
3487 * target-reloc.h (relocate_for_relocatable): Add code to handle
3488 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3489 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3490 arm_unaligned_reloc_r): New targets.
3491 * testsuite/Makefile.in: Regenerate.
3492 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3495 2011-11-02 Ian Lance Taylor <iant@google.com>
3497 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3499 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3500 * options.cc (General_options::finalize): Use library search path
3501 from configure script if specified. If not native and no sysroot,
3502 only search TOOLLIBDIR.
3503 * options.h (Search_directory::Search_directory): Change name to
3505 (General_options::add_to_library_path_with_sysroot): Change arg to
3507 * configure, Makefile.in, config.in: Rebuild.
3509 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3511 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3512 we are working around the ARM1176 Erratum.
3513 * options.h (General_options::fix_arm1176): Add option.
3514 * testsuite/Makefile.am: Add testcases, and keep current ones
3516 * testsuite/Makefile.in: Regenerate.
3517 * testsuite/arm_fix_1176.s: New file.
3518 * testsuite/arm_fix_1176.sh: Likewise.
3520 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3522 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3524 (Target_arm::may_use_blx): Remove method.
3525 (Target_arm::set_may_use_blx): Likewise.
3526 (Target_arm::may_use_v4t_interworking): New method.
3527 (Target_arm::may_use_v5t_interworking): Likewise.
3528 (Target_arm::may_use_blx_): Remove member variable.
3529 (Arm_relocate_functions::arm_branch_common): Check for v5T
3531 (Arm_relocate_functions::thumb_branch_common): Likewise.
3532 (Reloc_stub::stub_type_for_reloc): Likewise.
3533 (Target_arm::do_finalize_sections): Correct interworking checks.
3534 * testsuite/Makefile.am: Add new tests.
3535 * testsuite/Makefile.in: Regenerate.
3536 * testsuite/arm_farcall_arm_arm.s: New test.
3537 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3538 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3539 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3540 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3541 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3542 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3543 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3545 2011-10-31 Cary Coutant <ccoutant@google.com>
3548 * expression.cc (Expression::eval_with_dot): Add
3549 is_section_dot_assignment parameter.
3550 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3551 absolute and assigning to dot within a section.
3552 * script-sections.cc
3553 (Output_section_element_assignment::set_section_addresses): Pass
3554 dot_section to set_if_absolute.
3555 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3556 as is_section_dot_assignment flag to eval_with_dot.
3557 (Output_section_element_dot_assignment::set_section_addresses):
3559 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3560 parameter. Also set value if relative to dot_section; set the
3561 symbol's output_section.
3562 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3563 parameter. Adjust all callers.
3564 (Expression::eval_maybe_dot): Likewise.
3565 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3567 * testsuite/script_test_2.t: Test assignment of an absolute value
3568 to dot within an output section element.
3570 2011-10-31 Cary Coutant <ccoutant@google.com>
3572 * options.h (class General_options): Add --[no-]gnu-unique options.
3573 * symtab.cc (Symbol_table::sized_write_globals): Convert
3574 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3576 2011-10-31 Cary Coutant <ccoutant@google.com>
3579 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3580 unnecessary assertion.
3581 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3583 2011-10-31 Sriraman Tallam <tmsriram@google.com>
3585 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3587 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3589 Change to just keep the section associated with symbol.
3590 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3591 they are externally visible and --export-dynamic is turned on.
3592 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3594 2011-10-19 Ian Lance Taylor <iant@google.com>
3597 * script-sections.cc
3598 (Output_section_element_dot_assignment::needs_output_section): New
3601 2011-10-19 Ian Lance Taylor <iant@google.com>
3604 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3605 --section-start option was seen.
3606 * options.h (General_options::any_section_start): New function.
3608 2011-10-18 David S. Miller <davem@davemloft.net>
3611 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3612 member to track relocation locations that have moved during TLS
3613 reloc optimizations.
3614 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3615 (Target_sparc::Relocate::relocate): Adjust view down by 4
3616 bytes if it matches reloc_adjust_addr_.
3617 (Target_sparc::Relocate::relocate_tls): Always move the
3618 __tls_get_addr call delay slot instruction forward 4 bytes when
3619 performing relaxation.
3621 2011-10-18 Cary Coutant <ccoutant@google.com>
3623 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3624 (Output_file::map_no_anonymous): Check for non-zero
3625 return code from posix_fallocate.
3627 2011-10-17 Cary Coutant <ccoutant@google.com>
3630 * plugin.cc (is_visible_from_outside): Check for symbols
3631 referenced from dynamic objects.
3632 * resolve.cc (Symbol_table::resolve): Don't count references
3633 from dynamic objects as references from real ELF files.
3634 * testsuite/plugin_test_2.sh: Adjust expected result.
3636 2011-10-17 Cary Coutant <ccoutant@google.com>
3638 * gold.cc: Include timer.h.
3639 (queue_middle_tasks): Stamp time.
3640 (queue_final_tasks): Likewise.
3641 * main.cc (main): Store timer in parameters. Print timers
3643 * parameters.cc (Parameters::Parameters): Initialize timer_.
3644 (Parameters::set_timer): New function.
3645 (set_parameters_timer): New function.
3646 * parameters.h (Parameters::set_timer): New function.
3647 (Parameters::timer): New function.
3648 (Parameters::timer_): New data member.
3649 (set_parameters_timer): New function.
3650 * timer.cc (Timer::stamp): New function.
3651 (Timer::get_pass_time): New function.
3652 * timer.h (Timer::stamp): New function.
3653 (Timer::get_pass_time): New function.
3654 (Timer::pass_times_): New data member.
3656 2011-10-17 Cary Coutant <ccoutant@google.com>
3658 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3659 task for members of lib groups.
3661 2011-10-17 Cary Coutant <ccoutant@google.com>
3664 * fileread.cc (File_read::find_view): Add assert.
3665 (File_read::make_view): Move bounds check (replace with assert)...
3666 (File_read::find_or_make_view): ... to here.
3668 2011-10-12 Cary Coutant <ccoutant@google.com>
3670 * output.cc (Output_file::open_base_file): Handle case where
3671 ::read returns less than requested size.
3673 2011-10-10 Cary Coutant <ccoutant@google.com>
3675 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
3676 Initialize defined_count_.
3677 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3678 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3679 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3680 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3681 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
3682 * incremental.h (Sized_relobj_incr::defined_count_): New data
3684 (Sized_incr_dynobj::defined_count_): New data member.
3685 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
3686 Return zeroes instead of internal error.
3688 2011-10-10 Cary Coutant <ccoutant@google.com>
3691 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
3692 (Output_reloc::symbol_value): Return PLT offset if flag is set.
3693 * output.h (class Output_reloc): Add use_plt_offset flag.
3694 (Output_reloc::type_): Adjust size of bit field.
3695 (Output_reloc::use_plt_offset_): New bit field.
3696 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3697 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3698 flag. Adjust all callers.
3699 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
3700 creating RELATIVE relocations.
3702 2011-10-10 Nick Clifton <nickc@redhat.com>
3704 * po/es.po: Updated Spanish translation.
3705 * po/fi.po: Updated Finnish translation.
3707 2011-10-03 Diego Novillo <dnovillo@google.com>
3709 * options.cc (parse_uint): Fix dereference of RETVAL.
3711 2011-09-29 Sriraman Tallam <tmsriram@google.com>
3713 * layout.h (section_order_map_): New member.
3714 (get_section_order_map): New member function.
3715 * output.cc (Output_section::add_input_section): Check for patterns
3716 only when --section-ordering-file is specified.
3717 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3718 output_sections have been formed.
3719 * layout.cc (Layout_Layout): Initialize section_order_map_.
3720 * plugin.cc (update_section_order): Store order in order_map. Do not
3722 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3723 * testsuite/Makefile.in: Regenerate.
3724 * testsuite/plugin_section_order.c: New file.
3725 * testsuite/plugin_final_layout.cc: New file.
3726 * testsuite/plugin_final_layout.sh: New file.
3728 2011-09-29 Cary Coutant <ccoutant@google.com>
3730 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3732 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
3733 symbols during incremental update.
3734 (Symbol_table::add_from_dynobj): Likewise.
3736 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3737 Ian Lance Taylor <iant@google.com>
3739 * symtab.cc (Symbol_table::define_special_symbol): Always
3740 canonicalize version string.
3742 2011-09-26 Cary Coutant <ccoutant@google.com>
3744 * gold.cc (queue_initial_tasks): Move option checks ...
3745 * options.cc (General_options::finalize): ... to here. Disable
3746 some options; make others fatal.
3748 2011-09-26 Cary Coutant <ccoutant@google.com>
3751 * plugin.cc (get_symbols_v2): New function.
3752 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3753 (is_referenced_from_outside): New function.
3754 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3755 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3756 (get_symbols): Pass version parameter.
3757 (get_symbols_v2): New function.
3758 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3760 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3761 (onload): Add LDPT_GET_SYMBOLS_V2.
3762 (all_symbols_read_hook): Use get_symbols_v2; check for
3763 LDPR_PREVAILING_DEF_IRONLY_EXP.
3764 * testsuite/plugin_test_3.sh: Update expected results.
3766 2011-09-23 Simon Baldwin <simonb@google.com>
3768 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3769 configuration options.
3770 * configure: Regenerate.
3771 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3772 * Makefile.in: Regenerate.
3773 * testsuite/Makefile.in: Regenerate.
3775 2011-09-19 Sriraman Tallam <tmsriram@google.com>
3777 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3779 2011-09-19 Cary Coutant <ccoutant@google.com>
3781 * incremental.cc (can_incremental_update): Fix typo in comment.
3782 * incremental.h (can_incremental_update): Likewise.
3784 2011-09-18 Cary Coutant <ccoutant@google.com>
3786 * incremental.cc (can_incremental_update): New function.
3787 * incremental.h (can_incremental_update): New function.
3788 * layout.cc (Layout::init_fixed_output_section): Call it.
3789 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3790 * object.cc (Sized_relobj_file::do_layout): Call
3791 can_incremental_update.
3793 2011-09-13 Cary Coutant <ccoutant@google.com>
3795 * configure.ac: Check for glibc support for gnu_indirect_function
3796 support with static linking, setting automake conditional
3798 * Makefile.in: Regenerate.
3799 * configure: Regenerate.
3801 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3802 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3804 * testsuite/Makefile.in: Regenerate.
3806 2011-09-13 Cary Coutant <ccoutant@google.com>
3808 * incremental.cc (Sized_relobj_incr::do_layout): Call
3809 report_comdat_group for kept comdat sections.
3810 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3811 * testsuite/Makefile.in: Regenerate.
3812 * testsuite/incr_comdat_test_1.cc: New source file.
3813 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3814 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3815 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3817 2011-09-13 Ian Lance Taylor <iant@google.com>
3819 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3820 variable external_symbols_offset.
3822 2011-09-12 Ian Lance Taylor <iant@google.com>
3824 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3825 triggered if object has no symbols.
3827 2011-09-09 David S. Miller <davem@davemloft.net>
3829 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3830 (Output_fill_debug_line::do_write): Likewise.
3832 2011-08-29 Cary Coutant <ccoutant@google.com>
3834 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3835 casts to match formatting specs.
3836 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3838 2011-08-26 Cary Coutant <ccoutant@google.com>
3840 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3841 remaining hole size when allocating.
3842 (Layout::make_output_section): Set fill methods for debug sections.
3843 * layout.h (Free_list::Free_list_node): Move from private to
3845 (Free_list::set_min_hole_size): New function.
3846 (Free_list::begin, Free_list::end): New functions.
3847 (Free_list::min_hole_): New data member.
3848 * output.cc: Include dwarf.h.
3849 (Output_fill_debug_info::do_minimum_hole_size): New function.
3850 (Output_fill_debug_info::do_write): New function.
3851 (Output_fill_debug_line::do_minimum_hole_size): New function.
3852 (Output_fill_debug_line::do_write): New function.
3853 (Output_section::Output_section): Initialize new data member.
3854 (Output_section::set_final_data_size): Ensure patch space is larger
3855 than minimum hole size.
3856 (Output_section::do_write): Fill holes in debug sections.
3857 * output.h (Output_fill): New class.
3858 (Output_fill_debug_info): New class.
3859 (Output_fill_debug_line): New class.
3860 (Output_section::set_free_space_fill): New function.
3861 (Output_section::free_space_fill_): New data member.
3862 * testsuite/Makefile.am (incremental_test_3): Add
3863 --incremental-patch option.
3864 (incremental_test_4): Likewise.
3865 (incremental_test_5): Likewise.
3866 (incremental_test_6): Likewise.
3867 (incremental_copy_test): Likewise.
3868 (incremental_common_test_1): Likewise.
3869 * testsuite/Makefile.in: Regenerate.
3871 2011-08-26 Nick Clifton <nickc@redhat.com>
3873 * po/es.po: Updated Spanish translation.
3875 2011-08-01 Cary Coutant <ccoutant@google.com>
3877 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3878 * gold/testsuite/Makefile.in: Regenerate.
3879 * gold/testsuite/justsyms_exec.c: New source file.
3880 * gold/testsuite/justsyms_lib.c: New source file.
3882 2011-08-01 Cary Coutant <ccoutant@google.com>
3884 * layout.cc (Layout::set_segment_offsets): Don't realign text
3885 segment if -Ttext was specified.
3886 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3888 * object.h (Sized_relobj_file::e_type): New function.
3889 (Sized_relobj_file::e_type_): New data member.
3890 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3891 base address for ET_EXEC files.
3892 * target.cc (Target::do_make_elf_object_implementation): Allow
3893 ET_EXEC files with --just-symbols option.
3895 2011-07-28 Cary Coutant <ccoutant@google.com>
3897 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3898 Add thread_number parameter.
3899 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3900 * workqueue-threads.cc
3901 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3902 current thread if its thread number is greater than desired thread
3904 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3905 Add thread_number parameter.
3906 (Workqueue::should_cancel_thread): Likewise.
3907 (Workqueue::find_runnable_or_wait): Pass thread_number to
3908 should_cancel_thread.
3909 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3912 2011-07-22 Sriraman Tallam <tmsriram@google.com>
3914 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3915 only after checking if it cannot be forced local.
3916 * symtab.h (is_externally_visible): Check if the symbol is not forced
3919 2011-07-15 Ian Lance Taylor <iant@google.com>
3921 * options.h (class General_options): Add --print-output-format.
3922 Move -EL next to -EB, for better --help output.
3923 * target-select.cc: Include <cstdio>, "options.h", and
3925 (Target_selector::do_target_bfd_name): New function.
3926 (print_output_format): New function.
3927 * target-select.h (class Target_selector): Update declarations.
3928 (Target_selector::target_bfd_name): New function.
3929 (print_output_format): Declare.
3930 * main.cc: Include "target-select.h".
3931 (main): Handle --print-output-format.
3932 * gold.cc: Include "target-select.h".
3933 (queue_initial_tasks): Handle --print-output-format when there are
3935 * parameters.cc (parameters_force_valid_target): Give a better
3936 error message if -EB/-EL does not match target.
3937 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3940 2011-07-15 Ian Lance Taylor <iant@google.com>
3942 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3943 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3944 (Output_data_plt_i386::do_write): Write address of .dynamic
3945 section to first entry in .got.plt section.
3946 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3947 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3949 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3950 section to first entry in .got.plt section.
3951 * layout.h (Layout::dynamic_section): New function.
3953 2011-07-13 Sriraman Tallam <tmsriram@google.com>
3955 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3957 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3958 input_section_position_, and input_section_glob_.
3959 (read_layout_from_file): Call function section_ordering_specified.
3960 * layout.h (is_section_ordering_specified): New function.
3961 (section_ordering_specified): New function.
3962 (section_ordering_specified_): New boolean member.
3963 * main.cc(main): Call load_plugins after layout object is defined.
3964 * output.cc (Output_section::add_input_section): Use
3965 function section_ordering_specified to check if section ordering is
3967 * output.cc (Output_section::add_relaxed_input_section): Use
3968 function section_ordering_specified to check if section ordering is
3970 (Output_section::update_section_layout): New function.
3971 (Output_section::sort_attached_input_sections): Check if input section
3973 * output.h (Output_section::update_section_layout): New function.
3974 * plugin.cc (get_section_count): New function.
3975 (get_section_type): New function.
3976 (get_section_name): New function.
3977 (get_section_contents): New function.
3978 (update_section_order): New function.
3979 (allow_section_ordering): New function.
3980 (Plugin::load): Add the new interfaces to the transfer vector.
3981 (Plugin_manager::load_plugins): New parameter.
3982 (Plugin_manager::all_symbols_read): New parameter.
3983 (Plugin_manager::claim_file): New parameter. Save the elf object for
3985 (Plugin_manager::get_elf_object): New function.
3986 (Plugin_manager::get_view): Change to directly use the bool to check
3987 if get_view is called from claim_file_hook.
3988 * plugin.h (input_objects): New function
3989 (Plugin__manager::load_plugins): New parameter.
3990 (Plugin_manager::claim_file): New parameter.
3991 (Plugin_manager::get_elf_object): New function.
3992 (Plugin_manager::in_claim_file_handler): New function.
3993 (Plugin_manager::in_claim_file_handler_): New member.
3994 (layout): New function.
3995 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3996 handler with an extra parameter. Make the elf object before calling
3998 * testsuite/plugin_test.c (get_section_count): New function pointer.
3999 (get_section_type): New function pointer.
4000 (get_section_name): New function pointer.
4001 (get_section_contents): New function pointer.
4002 (update_section_order): New function pointer.
4003 (allow_section_ordering): New function pointer.
4004 (onload): Check if the new interfaces exist.
4006 2011-07-13 Ian Lance Taylor <iant@google.com>
4008 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4010 * x86_64.cc (Target_x86_64::got_section): Likewise.
4011 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4012 (relro_now_test_SOURCES): New variable.
4013 (relro_now_test_DEPENDENCIES): New variable.
4014 (relro_now_test_LDFLAGS): New variable.
4015 (relro_now_test_LDADD): New variable.
4016 (relro_now_test.so): New target.
4017 * testsuite/Makefile.in: Rebuild.
4019 2011-07-12 Ian Lance Taylor <iant@google.com>
4022 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4023 GLOB_DAT relocation rather than a RELATIVE relocation for a
4024 protected symbol when creating a shared library.
4025 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4026 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4027 * testsuite/protected_main_1.cc (main): Test that protected
4028 function has same address.
4030 2011-07-11 Ian Lance Taylor <iant@google.com>
4033 * options.h (class General_options): Add -Bgroup.
4034 * options.cc (General_options::finalize): If -Bgroup is set,
4035 default to --unresolved-symbols=report-all.
4036 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4037 * target-reloc.h (issue_undefined_symbol_error): Handle
4038 --unresolved-symbols=report-all.
4040 2011-07-08 Ian Lance Taylor <iant@google.com>
4043 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4044 if linker script discards key sections.
4045 (Layout::create_dynamic_symtab): Likewise.
4046 (Layout::assign_local_dynsym_offsets): Likewise.
4047 (Layout::sized_create_version_sections): Likewise.
4048 (Layout::create_interp): Likewise.
4049 (Layout::finish_dynamic_section): Likewise.
4050 (Layout::set_dynamic_symbol_size): Likewise.
4052 2011-07-08 Ian Lance Taylor <iant@google.com>
4055 * options.h (class General_options): Add --unresolved-symbols.
4056 * target-reloc.h (issue_undefined_symbol_error): Check
4057 --unresolved-symbols. Add comments.
4059 2011-07-08 Ian Lance Taylor <iant@google.com>
4061 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4062 expression more complex.
4064 2011-07-08 Ian Lance Taylor <iant@google.com>
4067 * target-reloc.h (issue_undefined_symbol_error): New inline
4068 function, broken out of relocate_section.
4069 (relocate_section): Call issue_undefined_symbol_error.
4070 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4071 there is no TLS segment if we are about to issue an undefined
4073 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4075 2011-07-08 Ian Lance Taylor <iant@google.com>
4078 * resolve.cc (Symbol_table::should_override): Add fromtype
4079 parameter. Change all callers. Give error when linking together
4080 TLS and non-TLS symbol.
4081 (Symbol_table::should_override_with_special): Add fromtype
4082 parameter. Change all callers.
4083 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4084 there is no TLS segment if we have reported some errors.
4085 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4087 2011-07-08 Ian Lance Taylor <iant@google.com>
4090 * target.h (Target::plt_address_for_global): New function.
4091 (Target::plt_address_for_local): New function.
4092 (Target::plt_section_for_global): Remove.
4093 (Target::plt_section_for_local): Remove.
4094 (Target::do_plt_address_for_global): New virtual function.
4095 (Target::do_plt_address_for_local): New virtual function.
4096 (Target::do_plt_section_for_global): Remove.
4097 (Target::do_plt_section_for_local): Remove.
4098 (Target::register_global_plt_entry): Add Symbol_table and Layout
4100 * output.cc (Output_data_got::Got_entry::write): Use
4101 plt_address_for_global and plt_address_for_local.
4102 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4103 address of output section.
4104 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4105 got_irelative_, and irelative_count_ fields. Update
4107 (Output_data_plt_i386::has_irelative_section): New function.
4108 (Output_data_plt_i386::entry_count): Add irelative_count_.
4109 (Output_data_plt_i386::set_final_data_size): Likewise.
4110 (class Target_i386): Add got_irelative_ and rel_irelative_
4111 fields. Update declarations.
4112 (Target_i386::Target_i386): Initialize new fields.
4113 (Target_i386::do_plt_address_for_global): New function replacing
4114 do_plt_section_for_global.
4115 (Target_i386::do_plt_address_for_local): New function replacing
4116 do_plt_section_for_local.
4117 (Target_i386::got_section): Create got_irelative_.
4118 (Target_i386::rel_irelative_section): New function.
4119 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4120 fields. Don't define __rel_iplt_{start,end}.
4121 (Output_data_plt_i386::add_entry): Add symtab and layout
4122 parameters. Change all callers. Use different PLT and GOT for
4124 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4125 layout parameters. Change all callers. Use different PLT and
4127 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4128 (Output_data_plt_i386::rel_irelative): New function.
4129 (Output_data_plt_i386::address_for_global): New function.
4130 (Output_data_plt_i386::address_for_local): New function.
4131 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4132 IRELATIVE GOT when changing IFUNC GOT entries.
4133 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4135 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4136 if we didn't create an IRELATIVE GOT.
4137 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4138 plt_address_for_local.
4139 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4140 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4141 got_irelative_, and irelative_count_ fields. Update
4143 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4144 Initialize new fields. Remove symtab parameter. Change all
4146 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4148 (Output_data_plt_x86_64::has_irelative_section): New function.
4149 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4150 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4151 fields. Update declarations.
4152 (Target_x86_64::Target_x86_64): Initialize new fields.
4153 (Target_x86_64::do_plt_address_for_global): New function replacing
4154 do_plt_section_for_global.
4155 (Target_x86_64::do_plt_address_for_local): New function replacing
4156 do_plt_section_for_local.
4157 (Target_x86_64::got_section): Create got_irelative_.
4158 (Target_x86_64::rela_irelative_section): New function.
4159 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4160 all callers. Don't create __rel_iplt_{start,end}.
4161 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4162 parameters. Change all callers. Use different PLT and GOT for
4164 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4165 layout parameters. Change all callers. Use different PLT and
4167 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4168 parameters. Change all callers. Use different PLT and GOT for
4170 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4171 (Output_data_plt_x86_64::rela_irelative): New function.
4172 (Output_data_plt_x86_64::address_for_global): New function.
4173 (Output_data_plt_x86_64::address_for_local): New function.
4174 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4175 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4176 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4177 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4179 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4181 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4182 symbols if we didn't create an IRELATIVE GOT.
4183 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4184 plt_address_for_local.
4185 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4186 * testsuite/ifuncvar1.c: New test file.
4187 * testsuite/ifuncvar2.c: New test file.
4188 * testsuite/ifuncvar3.c: New test file.
4189 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4190 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4191 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4192 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4193 * testsuite/Makefile.in: Rebuild.
4195 2011-07-07 Cary Coutant <ccoutant@google.com>
4197 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4198 (two_file_test_1_ndebug.o): Likewise.
4199 (two_file_test_1b_ndebug.o): Likewise.
4200 (two_file_test_2_ndebug.o): Likewise.
4201 (two_file_test_main_ndebug.o): Likewise.
4202 (incremental_test_2): Link with no-debug versions.
4204 2011-07-06 Cary Coutant <ccoutant@google.com>
4206 * gold/incremental.cc
4207 (Output_section_incremental_inputs::write_info_blocks): Check for
4208 hidden and internal symbols.
4210 2011-07-06 Cary Coutant <ccoutant@google.com>
4212 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4213 Check disposition for startup file.
4214 (Incremental_inputs::report_command_line): Ignore
4215 --incremental-startup-unchanged option.
4216 * options.cc (General_options::parse_incremental_startup_unchanged):
4218 (General_options::General_options): Initialize new data member.
4219 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4220 (General_options): Add --incremental-startup-unchanged option.
4221 (General_options::incremental_startup_disposition): New function.
4222 (General_options::incremental_startup_disposition_): New data member.
4224 2011-07-06 Cary Coutant <ccoutant@google.com>
4226 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4227 input file index to Script_info ctor.
4228 (Sized_incremental_binary::do_file_has_changed): Find the
4229 command-line argument for files named in scripts.
4230 * incremental.h (Script_info::Script_info): New ctor
4231 with input file index.
4232 (Script_info::input_file_index): New function.
4233 (Script_info::input_file_index_): New data member.
4234 (Incremental_binary::get_library): Add const.
4235 (Incremental_binary::get_script_info): Add const.
4236 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4237 * testsuite/Makefile.am (incremental_test_5): New test case.
4238 (incremental_test_6): New test case.
4239 * testsuite/Makefile.in: Regenerate.
4241 2011-07-06 Cary Coutant <ccoutant@google.com>
4243 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4244 debug output when command lines differ.
4246 2011-07-06 Cary Coutant <ccoutant@google.com>
4248 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4249 --incremental-patch option.
4250 * layout.cc (Free_list::allocate): Extend allocation beyond original
4252 (Layout::make_output_section): Mark sections that should get
4254 * options.cc (parse_percent): New function.
4255 * options.h (parse_percent): New function.
4256 (DEFINE_percent): New macro.
4257 (General_options): Add --incremental-patch option.
4258 * output.cc (Output_section::Output_section): Initialize new data
4260 (Output_section::add_input_section): Print section name when out
4262 (Output_section::add_output_section_data): Likewise.
4263 (Output_section::set_final_data_size): Add patch space when
4264 doing --incremental-full.
4265 (Output_section::do_reset_address_and_file_offset): Remove patch
4267 (Output_segment::set_section_list_addresses): Print debug output
4268 only if --incremental-update.
4269 * output.h (Output_section::set_is_patch_space_allowed): New function.
4270 (Output_section::is_patch_space_allowed_): New data member.
4271 (Output_section::patch_space_): New data member.
4272 * parameters.cc (Parameters::incremental_full): New function.
4273 * parameters.h (Parameters::incremental_full): New function
4274 * testsuite/Makefile.am (incremental_test_2): Add test for
4275 --incremental-patch option.
4276 * testsuite/Makefile.in: Regenerate.
4277 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4278 (t18): Remove function body.
4280 2011-07-05 Doug Kwan <dougkwan@google.com>
4283 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4284 Arm_Address type for relocation result.
4285 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4287 (Arm_relocate_functions::abs32): Use unaligned access.
4288 (Arm_relocate_functions::rel32): Ditto.
4289 (Arm_relocate_functions::prel31): Ditto.
4290 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4291 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4292 static data relocations.
4293 * testsuite/Makefile.in: Regnerate.
4294 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4296 2011-07-05 Ian Lance Taylor <iant@google.com>
4299 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4300 symbols if necessary.
4301 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4303 2011-07-05 Ian Lance Taylor <iant@google.com>
4306 * resolve.cc (Symbol::override_base_with_special): Simply override
4307 version with special symbol version, ignoring previous version.
4309 2011-07-05 Ian Lance Taylor <iant@google.com>
4311 * object.cc (Sized_relobj_file::include_section_group): Add
4312 information to comment about signature location.
4314 2011-07-02 Ian Lance Taylor <iant@google.com>
4317 * options.h (class General_options): Add -f and -F.
4318 * options.cc (General_options::finalize): Fatal error if -f/-F
4319 are used without -shared.
4320 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4322 2011-07-02 Ian Lance Taylor <iant@google.com>
4324 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4326 2011-07-01 Ian Lance Taylor <iant@google.com>
4330 * resolve.cc (Symbol::override_base_with_special): Don't override
4331 the version if the overriding symbol has a different name.
4332 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4333 all callers. If we give an error about an undefined version,
4334 define the base version if necessary.
4335 * dynobj.h (class Versions): Update declaration.
4336 * testsuite/weak_alias_test_5.cc: New file.
4337 * testsuite/weak_alias_test.script: New file.
4338 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4339 and versioned_alias have the right value, and call t2.
4340 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4341 weak_alias_test_5.so.
4342 (weak_alias_test_LDADD): Likewise.
4343 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4344 * testsuite/Makefile.in: Rebuild.
4346 2011-07-01 Ian Lance Taylor <iant@google.com>
4349 * options.h (class General_options): Support -z notext.
4350 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4352 (two_file_shared_nonpic.so): Likewise.
4353 (two_file_shared_mixed.so): Likewise.
4354 (two_file_shared_mixed_1.so): Likewise.
4355 (weak_undef_lib_nonpic.so): Likewise.
4356 (alt/weak_undef_lib_nonpic.so): Likewise.
4357 (tls_test_shared_nonpic.so): Likewise.
4358 * testsuite/Makefile.in: Rebuild.
4360 2011-07-01 Ian Lance Taylor <iant@google.com>
4363 * configure.ac: Test whether static linking works, setting
4364 the automake conditional HAVE_STATIC.
4365 * testsuite/Makefile.am: Disable tests using -static if
4366 HAVE_STATIC is not true.
4367 * configure, testsuite/Makefile.in: Rebuild.
4369 2011-07-01 Ian Lance Taylor <iant@google.com>
4372 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4373 Assert if we see DW_EH_PE_indirect.
4374 * target.h (Target::ehframe_datarel_base): New function.
4375 (Target::do_ehframe_datarel_base): New target function.
4376 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4377 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4380 2011-07-01 Ian Lance Taylor <iant@google.com>
4383 * options.h (class General_options): Add
4384 --ld-generated-unwind-info.
4385 * ehframe.cc (Fde::write): Add address parameter. Change all
4386 callers. If associated with PLT, fill in address and size.
4387 (Cie::set_output_offset): Only add merge mapping if there is an
4389 (Cie::write): Add address parameter. Change all callers.
4390 (Eh_frame::add_ehframe_for_plt): New function.
4391 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4392 input_offset_ fields into union u_, with new plt field.
4393 (Fde::Fde): Adjust for new union field.
4394 (Fde::Fde) [Output_data version]: New constructor.
4395 (Fde::add_mapping): Only add merge mapping if there is an object.
4396 (class Cie): Update declarations.
4397 (class Eh_frame): Declare add_ehframe_for_plt.
4398 * layout.cc (Layout::layout_eh_frame): Break out code into
4399 make_eh_frame_section, and call it.
4400 (Layout::make_eh_frame_section): New function.
4401 (Layout::add_eh_frame_for_plt): New function.
4402 * layout.h (class Layout): Update declarations.
4403 * merge.cc (Merge_map::add_mapping): Add assertion.
4404 * i386.cc: Include "dwarf.h".
4405 (class Output_data_plt_i386): Make first_plt_entry,
4406 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4407 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4408 and plt_eh_frame_fde.
4409 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4410 boundary. Call add_eh_frame_for_plt if appropriate.
4411 * x86_64.cc: Include "dwarf.h".
4412 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4413 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4414 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4415 and plt_eh_frame_fde.
4416 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4419 2011-06-29 Ian Lance Taylor <iant@google.com>
4422 * object.cc (Sized_relobj_file::layout_section): Change shdr
4423 parameter to be const.
4424 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4426 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4427 appropriate. Call layout_eh_frame_section.
4428 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4430 * object.h (class Sized_relobj_file): Update declarations.
4432 2011-06-29 Ian Lance Taylor <iant@google.com>
4435 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4437 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4439 2011-06-29 Ian Lance Taylor <iant@google.com>
4442 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4444 * layout.cc (Layout::layout_eh_frame): Likewise.
4446 2011-06-29 Ian Lance Taylor <iant@google.com>
4449 * layout.cc (Layout::symtab_section_shndx): New function.
4450 * layout.h (class Layout): Declare symtab_section_shndx.
4451 * output.cc (Output_section::write_header): Call it.
4453 2011-06-29 Ian Lance Taylor <iant@google.com>
4456 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4457 symbols which are not used in a relocation.
4459 2011-06-28 Ian Lance Taylor <iant@google.com>
4462 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4463 script create indistinguishable segments.
4464 (Layout::set_segment_offsets): Use stable_sort when sorting
4465 segments. Pass this to Compare_segments constructor.
4466 * layout.h (class Layout): Make segment_precedes non-static.
4467 (class Compare_segments): Change from struct to class. Add
4468 layout_ field. Add constructor.
4469 * script-sections.cc
4470 (Script_sections::attach_sections_using_phdrs_clause): Rename
4471 local orphan to is_orphan. Don't report failure to put empty
4472 section in segment. On attachment failure, report name of
4473 section, and attach to first PT_LOAD segment.
4475 2011-06-28 Ian Lance Taylor <iant@google.com>
4478 * target-select.cc (Target_selector::Target_selector): Add
4479 emulation parameter. Change all callers.
4480 (select_target_by_bfd_name): Rename from select_target_by_name.
4482 (select_target_by_emulation): New function.
4483 (supported_emulation_names): New function.
4484 * target-select.h (class Target_selector): Add emulation_ field.
4485 Update declarations.
4486 (Target_selector::recognize_by_bfd_name): Rename from
4487 recognize_by_name. Change all callers.
4488 (Target_selector::supported_bfd_names): Rename from
4489 supported_names. Change all callers.
4490 (Target_selector::recognize_by_emulation): New function.
4491 (Target_selector::supported_emulations): New function.
4492 (Target_selector::emulation): New function.
4493 (Target_selector::do_recognize_by_bfd_name): Rename from
4494 do_recognize_by_name. Change all callers.
4495 (Target_selector::do_supported_bfd_names): Rename from
4496 do_supported_names. Change all callers.
4497 (Target_selector::do_recognize_by_emulation): New function.
4498 (Target_selector::do_supported_emulations): New function.
4499 (select_target_by_bfd_name): Change name in declaration.
4500 (select_target_by_emulation): Declare.
4501 (supported_emulation_names): Declare.
4502 * parameters.cc (parameters_force_valid_target): Try to find
4503 target based on emulation from -m option.
4504 * options.h (class General_options): Change doc string for -m.
4505 * options.cc (help): Print emulations.
4506 (General_options::parse_V): Likewise.
4507 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4508 Add emulation parameter. Change all callers.
4510 2011-06-28 Ian Lance Taylor <iant@google.com>
4512 * target.h (class Target): Add osabi_ field.
4513 (Target::osabi): New function.
4514 (Target::set_osabi): New function.
4515 (Target::Target): Initialize osabi_.
4516 (Target::do_adjust_elf_header): Make pure virtual.
4517 (Sized_target::do_adjust_elf_header): Declare.
4518 * target.cc (Sized_target::do_adjust_elf_header): New function.
4519 (class Sized_target): Instantiate all versions.
4520 * freebsd.h (class Target_freebsd): Remove.
4521 (Target_selector_freebsd::do_recognize): Call set_osabi on
4523 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4524 (Target_selector_freebsd::set_osabi): Remove.
4525 * i386.cc (class Target_i386): Inherit from Sized_target rather
4526 than Target_freebsd.
4527 * x86_64.cc (class Target_x86_64): Likewise.
4529 2011-06-28 Ian Lance Taylor <iant@google.com>
4531 * target.h (Target::can_check_for_function_pointers): Rewrite.
4533 (Target::can_icf_inline_merge_sections): Likewise.
4534 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4535 (Target::Target_info): Add can_icf_inline_merge_sections field.
4536 (Target::do_can_check_for_function_pointers): New virtual
4538 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4539 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4540 from can_check_for_function_pointers, move in file.
4541 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4542 section_may_have_icf_unsafe_poineters, move in file.
4543 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4544 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4545 Rename from can_check_for_function_pointers, move in file.
4546 (Target_i386::can_icf_inline_merge_sections): Remove.
4547 (Target_i386::i386_info): Initialize
4548 can_icf_inline_merge_sections.
4549 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4550 Initialize can_icf_inline_merge_sections.
4551 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4552 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4553 Rename from can_check_for_function_pointers, move in file.
4554 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4555 (Target_x86_64::x86_64_info): Initialize
4556 can_icf_inline_merge_sections.
4557 * testsuite/testfile.cc (Target_test::test_target_info):
4559 * icf.cc (get_section_contents): Correct formatting.
4561 2011-06-27 Ian Lance Taylor <iant@google.com>
4563 * symtab.cc (Symbol::versioned_name): New function.
4564 (Symbol_table::add_to_final_symtab): Use versioned_name when
4566 (Symbol_table::sized_write_symbol): Likewise.
4567 * symtab.h (class Symbol): Declare versioned_name.
4568 * stringpool.h (class Stringpool_template): Add variant of add
4569 which takes a std::basic_string.
4570 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4571 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4572 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4573 (ver_test_12.o): New target.
4574 * testsuite/Makefile.in: Rebuild.
4576 2011-06-27 Doug Kwan <dougkwan@google.com>
4578 * arm.cc (Arm_relocate_functions::thm_jump8,
4579 Arm_relocate_functions::thm_jump11): Use a wider signed
4580 type to compute offset.
4581 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4583 * testsuite/Makefile.in: Regenerate.
4584 * testsuite/arm_branch_in_range.sh: Check test results of
4585 arm_thm_jump11 and arm_thm_jump8.
4586 * testsuite/arm_thm_jump11.s: New test source file.
4587 * testsuite/arm_thm_jump11.t: New linker script.
4588 * testsuite/arm_thm_jump8.s: New test source file.
4589 * testsuite/arm_thm_jump8.t: New linker script.
4591 2011-06-24 Ian Lance Taylor <iant@google.com>
4593 * layout.cc: Include "object.h".
4594 (ctors_sections_in_init_array): New static variable.
4595 (Layout::is_ctors_in_init_array): New function.
4596 (Layout::layout): Add entry to ctors_sections_in_init_array if
4598 * layout.h (class Layout): Declare is_ctors_in_init_array.
4599 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4600 is_ctors_reverse_view is set.
4601 (Sized_relobj_file::write_sections): Add layout parameter. Change
4602 all callers. Set is_ctors_reverse_view field of View_size.
4603 (Sized_relobj_file::reverse_words): New function.
4604 * object.h (Sized_relobj_file::View_size): Add
4605 is_ctors_reverse_view field.
4606 (class Sized_relobj_file): Update declarations.
4607 * testsuite/initpri3.c: New test.
4608 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4610 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4611 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4612 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4613 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4614 * testsuite/Makefile.in: Rebuild.
4616 2011-06-24 Cary Coutant <ccoutant@google.com>
4618 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4619 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4620 (debug_msg_cdebug.err): New targets.
4621 * testsuite/Makefile.in: Regenerate.
4622 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4623 Fix checks for link with shared library.
4625 2011-06-24 Doug Kwan <dougkwan@google.com>
4627 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4628 skip empty text sections.
4629 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4631 2011-06-22 Ian Lance Taylor <iant@google.com>
4634 * options.h (class General_options): Add --ctors-in-init-array.
4635 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4636 friends as SHT_PROGBITS for merging sections.
4637 (Layout::layout): Remove special handling of .init_array and
4638 friends. Don't sort if doing relocatable link. Sort for .ctors
4639 and .dtors if ctors_in_init_array.
4640 (Layout::make_output_section): Force correct section types for
4641 .init_array and friends. Don't sort if doing relocatable link,
4642 Don't sort .ctors and .dtors if ctors_in_init_array.
4643 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4644 (Layout::output_section_name): Add relobj parameter. Change all
4645 callers. Handle .ctors. and .dtors. in code rather than table.
4646 Handle .ctors and .dtors if ctors_in_init_array.
4647 (Layout::match_file_name): New function, moved from output.cc.
4648 * layout.h (class Layout): Update declarations.
4649 * output.cc: Include "layout.h".
4650 (Input_section_sort_entry::get_priority): New function.
4651 (Input_section_sort_entry::match_file_name): Just call
4652 Layout::match_file_name.
4653 (Output_section::Input_section_sort_init_fini_compare::operator()):
4654 Handle .ctors and .dtors. Sort by explicit priority rather than
4656 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4657 * testsuite/initpri2.c: New test.
4658 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4659 (check_PROGRAMS): Add initpri2.
4660 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4661 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4662 * configure, testsuite/Makefile.in: Rebuild.
4664 2011-06-19 Ian Lance Taylor <iant@google.com>
4667 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4668 .interp section to a PT_INTERP segment even if we have seen a
4669 --dynamic-linker option. Don't do it if we have seen a PHDRS
4670 clause in a linker script.
4671 (Layout::finalize): Don't create a .interp section if we've
4672 already create a PT_INTERP segment.
4673 (Layout::create_interp): Always call choose_output_section (revert
4674 patch of 2011-06-17). Don't create PT_INTERP segment.
4675 * script-sections.cc
4676 (Script_sections::create_note_and_tls_segments): Add a .interp
4677 section to a PT_INTERP segment even if we have seen a
4678 --dynamic-linker option.
4680 2011-06-18 Ian Lance Taylor <iant@google.com>
4682 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4683 merely because a non-PT_LOAD segment has a dynamic reloc.
4685 2011-06-18 Ian Lance Taylor <iant@google.com>
4687 * layout.cc (Layout::finish_dynamic_section): Don't create
4688 DT_FLAGS entry if not needed.
4690 2011-06-18 Ian Lance Taylor <iant@google.com>
4693 * layout.cc (Layout::layout_eh_frame): Correct handling of
4694 writable .eh_frame section.
4696 2011-06-17 Ian Lance Taylor <iant@google.com>
4699 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4700 symbol is redefined with the exact same object and value.
4702 2011-06-17 Ian Lance Taylor <iant@google.com>
4705 * layout.h (class Layout): Add interp_segment_ field.
4706 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4707 (Layout::attach_allocated_section_to_segment): If making shared
4708 library, put .interp section in PT_INTERP segment.
4709 (Layout::finalize): Also call create_interp if -dynamic-linker
4711 (Layout::create_interp): Assert that there is no PT_INTERP
4712 segment. If not using a SECTIONS clause, use make_output_section.
4713 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4714 * script-sections.cc
4715 (Script_sections::create_note_and_tls_segments): If making shared
4716 library, put .interp section in PT_INTERP segment.
4718 2011-06-17 Ian Lance Taylor <iant@google.com>
4720 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4721 when making a shared library.
4723 2011-06-17 Ian Lance Taylor <iant@google.com>
4725 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4726 parameter. Change all callers. Don't issue warning about PC32
4727 against locally defined symbol.
4729 2011-06-16 Ian Lance Taylor <iant@google.com>
4731 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4732 occurs in same object.
4734 2011-06-14 Alan Modra <amodra@gmail.com>
4736 * po/POTFILES.in: Regenerate.
4738 2011-06-09 Ian Lance Taylor <iant@google.com>
4740 * script-sections.cc
4741 (Orphan_output_section::set_section_addresses): For a relocatable
4742 link set address to 0.
4744 2011-06-09 Cary Coutant <ccoutant@google.com>
4747 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4748 used with --compress-debug-sections.
4749 * gold/object.cc (Sized_relobj_file::do_layout): Report
4750 uncompressed size of compressed input sections.
4752 2011-06-08 Cary Coutant <ccoutant@google.com>
4755 * testsuite/two_file_test_2_v1.cc: Change initialization of
4756 v2 to keep it in .data.
4758 2011-06-07 Cary Coutant <ccoutant@google.com>
4760 * common.cc (Symbol_table::do_allocate_commons_list): Call
4762 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4763 (Errors::fallback): New function.
4764 (gold_fallback): New function.
4765 * errors.h (Errors::fallback): New function.
4766 * gold.cc (gold_exit): Change status parameter to enum; adjust
4768 (queue_initial_tasks): Call gold_fallback.
4769 * gold.h: Include cstdlib.
4770 (Exit_status): New enum type.
4771 (gold_exit): Change status parameter to enum.
4772 (gold_fallback): New function.
4773 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4774 (Layout::create_symtab_sections): Likewise.
4775 (Layout::create_shdrs): Likewise.
4776 * main.cc (main): Adjust call to gold_exit.
4777 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4778 (Output_data_got::add_got_entry_pair): Likewise.
4779 (Output_section::add_input_section): Likewise.
4780 (Output_section::add_output_section_data): Likewise.
4781 (Output_segment::set_section_list_addresses): Likewise.
4782 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4784 2011-06-07 Cary Coutant <ccoutant@google.com>
4786 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4787 for incremental links.
4788 * output.cc (Output_segment::set_section_list_addresses): Remove
4789 FIXME and test for TLS or BSS.
4791 2011-06-07 Cary Coutant <ccoutant@google.com>
4793 * testsuite/Makefile.am: Add incremental_copy_test,
4794 incremental_common_test_1.
4795 * testsuite/Makefile.in: Regenerate.
4796 * testsuite/common_test_1_v1.c: New source file.
4797 * testsuite/common_test_1_v2.c: New source file.
4798 * testsuite/copy_test_v1.cc: New source file.
4800 2011-06-07 Cary Coutant <ccoutant@google.com>
4802 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4803 update, allocate common from bss section's free list.
4804 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4805 linker-defined symbols.
4806 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4807 Skip GOT and PLT entries that are no longer referenced.
4808 (Output_section_incremental_inputs::write_info_blocks): Mark
4809 linker-defined symbols.
4810 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4811 * output.cc (Output_section::allocate): New function.
4812 * output.h (Output_section::allocate): New function.
4813 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4814 linker-defined symbols.
4815 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4816 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4817 (Symbol::init_base_output_data): Likewise.
4818 (Symbol::init_base_output_segment): Likewise.
4819 (Symbol::init_base_constant): Likewise.
4820 (Sized_symbol::init_output_data): Likewise.
4821 (Sized_symbol::init_output_segment): Likewise.
4822 (Sized_symbol::init_constant): Likewise.
4823 (Symbol_table::do_define_in_output_data): Likewise.
4824 (Symbol_table::do_define_in_output_segment): Likewise.
4825 (Symbol_table::do_define_as_constant): Likewise.
4826 * symtab.h (Symbol::is_predefined): New function.
4827 (Symbol::init_base_output_data): Add is_predefined parameter.
4828 (Symbol::init_base_output_segment): Likewise.
4829 (Symbol::init_base_constant): Likewise.
4830 (Symbol::is_predefined_): New data member.
4831 (Sized_symbol::init_output_data): Add is_predefined parameter.
4832 (Sized_symbol::init_output_segment): Likewise.
4833 (Sized_symbol::init_constant): Likewise.
4834 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4836 2011-06-07 Cary Coutant <ccoutant@google.com>
4838 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4839 instead of emit_copy_reloc.
4840 (Copy_relocs::emit_copy_reloc): Refactor.
4841 (Copy_relocs::make_copy_reloc): New function.
4842 (Copy_relocs::add_copy_reloc): Remove.
4843 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4845 (Copy_relocs::make_copy_reloc): New function.
4846 (Copy_relocs::add_copy_reloc): Remove.
4847 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4848 unchanged input files.
4849 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4850 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4851 Reserve BSS space for COPY relocations.
4852 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4853 (Output_section_incremental_inputs::write_info_blocks): Record
4854 whether a symbol is copied from a shared object.
4855 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4856 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4857 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4858 (Incremental_input_entry_reader::get_output_symbol_index): Add
4860 (Incremental_binary::emit_copy_relocs): New function.
4861 (Incremental_binary::do_emit_copy_relocs): New function.
4862 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4864 (Sized_incremental_binary::add_copy_reloc): New function.
4865 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4866 (Sized_incremental_binary::Copy_reloc): New struct.
4867 (Sized_incremental_binary::Copy_relocs): New typedef.
4868 (Sized_incremental_binary::copy_relocs_): New data member.
4869 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4870 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4871 * target.h (Sized_target::emit_copy_reloc): New function.
4872 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4874 2011-06-02 Cary Coutant <ccoutant@google.com>
4877 * gold/archive.cc (Archive::Archive): Initialize new data member.
4878 (Archive::include_all_members): Return if archive has already been
4880 * gold/archive.h (Archive::include_all_members_): New data member.
4882 2011-06-02 Nick Clifton <nickc@redhat.com>
4884 * dynobj.h: Fix spelling mistake in comment.
4885 * output.cc: Likewise.
4887 2011-05-31 Doug Kwan <dougkwan@google.com>
4891 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
4892 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4893 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4894 redundant arm_exidx_test.so.
4895 * testsuite/Makefile.in: Regenerate.
4896 (check_SCRIPTS): Add pr12826.sh
4897 (check_DATA): Add pr12826.stdout
4898 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4899 * testsuite/pr12826.sh: New file.
4900 * testsuite/pr12826_1.s: Ditto.
4901 * testsuite/pr12826_1.s: Ditto.
4903 2011-05-30 Ian Lance Taylor <iant@google.com>
4905 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4908 2011-05-29 Ian Lance Taylor <iant@google.com>
4911 * testsuite/Makefile.am: Use different file name for two_file_test
4912 temporary file for each incremental test.
4913 * testsuite/Makefile.in: Rebuild.
4915 2011-05-29 Ian Lance Taylor <iant@google.com>
4917 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4918 binary input file is empty.
4920 2011-05-27 Ian Lance Taylor <iant@google.com>
4922 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4923 (ver_test_9.so): Likewise.
4924 * testsuite/Makefile.in: Rebuild.
4926 2011-05-26 Cary Coutant <ccoutant@google.com>
4928 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4929 * incremental.cc (Incremental_inputs::report_input_section): Fix
4930 comment, indentation.
4931 (Incremental_inputs::report_comdat_group): New function.
4932 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4933 of data for incremental input file entry.
4934 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4935 group count, COMDAT group signatures.
4936 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4937 an unchanged input file.
4938 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4939 Initialize new data member.
4940 (Incremental_object_entry::add_comdat_group): New function.
4941 (Incremental_object_entry::get_comdat_group_count): New function.
4942 (Incremental_object_entry::get_comdat_signature_key): New function.
4943 (Incremental_object_entry::groups_): New data member.
4944 (Incremental_inputs::report_comdat_group): New function.
4945 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4946 data for incremental input file entry.
4947 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4948 (Incremental_input_entry_reader::get_input_section): Adjust size of
4949 data for incremental input file entry.
4950 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4951 (Incremental_input_entry_reader::get_comdat_group_signature): New
4953 * object.cc (Sized_relobj::include_section_group): Report kept
4954 COMDAT groups for incremental links.
4956 2011-05-24 David Meyer <pdox@google.com>
4958 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4959 with name parameter. Add found_name parameter.
4960 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4961 * dirsearch.h (class Dirsearch): Update declaration.
4963 2011-05-24 Ian Lance Taylor <iant@google.com>
4965 * archive.cc (Library_base::should_include_member): Pull in object
4966 from archive if it defines the entry symbol.
4967 * parameters.cc (Parameters::entry): New function.
4968 * parameters.h (class Parameters): Declare entry.
4969 * output.h (class Output_file_header): Remove entry_ field.
4970 * output.cc (Output_file_header::Output_file_header): Remove entry
4971 parameter. Change all callers.
4972 (Output_file_header::entry): Use parameters->entry.
4973 * gold.cc (queue_middle_tasks): Likewise.
4974 * plugin.cc (Plugin_hook::run): Likewise.
4976 2011-05-24 Cary Coutant <ccoutant@google.com>
4978 * gold.cc (queue_initial_tasks): Pass incremental base filename
4979 to Output_file::open_base_file; don't print error message.
4980 * incremental-dump.cc (main): Adjust call to
4981 Output_file::open_for_modification.
4982 * incremental-dump.cc (main): Likewise.
4983 * incremental.cc (Incremental_inputs::report_command_line):
4984 Ignore --incremental-base option when comparing command lines.
4985 Ignore parameter when given as separate argument.
4986 * options.h (class General_options): Add --incremental-base.
4987 * output.cc (Output_file::Output_file):
4988 (Output_file::open_base_file): Add base_name and writable parameters;
4989 read base file into new file; print error message here.
4990 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4992 * output.h (Output_file::open_for_modification): Rename to...
4993 (Output_file::open_base_file): ...this; add base_name and
4994 writable parameters; adjust all callers.
4995 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4997 * testsuite/Makefile.am (incremental_test_4): Test
4999 * testsuite/Makefile.in: Regenerate.
5001 2011-05-24 Cary Coutant <ccoutant@google.com>
5003 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5005 * testsuite/Makefile.in: Regenerate.
5006 * testsuite/two_file_test_1_v1.cc: New test source file.
5007 * testsuite/two_file_test_1b_v1.cc: New test source file.
5008 * testsuite/two_file_test_2_v1.cc: New test source file.
5010 2011-05-24 Cary Coutant <ccoutant@google.com>
5012 * dynobj.h (Dynobj::do_dynobj): New function.
5013 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5014 flag and soname for shared objects.
5015 * incremental.cc (Incremental_inputs::report_object): Make
5016 either Incremental_object_entry or Incremental_dynobj_entry; add
5017 soname to string table.
5018 (Incremental_inputs::report_input_section): Add assertion.
5019 (Output_section_incremental_inputs::set_final_data_size): Adjust
5020 type of input file entry for shared libraries; adjust size of
5021 shared library info entry.
5022 (Output_section_incremental_inputs::write_input_files): Write
5023 as_needed flag for shared libraries.
5024 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5025 of input file entry for shared libraries; write soname.
5026 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5027 soname from incremental info.
5028 * incremental.h (enum Incremental_input_flags): Add
5029 INCREMENTAL_INPUT_AS_NEEDED.
5030 (Incremental_input_entry::Incremental_input_entry): Initialize new
5032 (Incremental_input_entry::set_as_needed): New function.
5033 (Incremental_input_entry::as_needed): New function.
5034 (Incremental_input_entry::do_dynobj_entry): New function.
5035 (Incremental_input_entry::as_needed_): New data member.
5036 (Incremental_object_entry::Incremental_object_entry): Don't check
5038 (Incremental_object_entry::do_type): Likewise.
5039 (class Incremental_dynobj_entry): New class.
5040 (Incremental_input_entry_reader::as_needed): New function.
5041 (Incremental_input_entry_reader::get_soname): New function.
5042 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5043 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5044 size of shared library info entry.
5045 * layout.cc (Layout::finish_dynamic_section): Don't test for
5046 incremental link when adding DT_NEEDED entries.
5047 * object.h (Object::Object): Initialize new data member.
5048 (Object::dynobj): New function.
5049 (Object::set_as_needed): New function.
5050 (Object::as_needed): New function.
5051 (Object::do_dynobj): New function.
5052 (Object::as_needed_): New data member.
5054 2011-05-24 Cary Coutant <ccoutant@google.com>
5056 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5057 info; adjust display of GOT entries.
5058 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5059 vector of input objects; remove file_status_.
5060 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5061 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5062 got_plt reader; call target hooks to reserve GOT entries.
5063 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5064 of input file info header and GOT info entry.
5065 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5067 (Got_plt_view_info::got_descriptor): Remove.
5068 (Got_plt_view_info::sym_index): New data member.
5069 (Got_plt_view_info::input_index): New data member.
5070 (Local_got_offset_visitor::visit): Write input file index.
5071 (Global_got_offset_visitor::visit): Write 0 for input file index.
5072 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5073 with sym_index and input_index.
5074 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5075 incremental info GOT entry; replace got_descriptor with input_index.
5076 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5077 map from input file index to object.
5078 (Sized_relobj_incr::do_layout): Replace direct data member reference
5079 with accessor function.
5080 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5081 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5082 Adjust size of input file info header.
5083 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5084 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5085 (Incremental_input_entry_reader::get_input_section): Adjust size of
5086 input file info header.
5087 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5088 of incremental info GOT entry.
5089 (Incremental_got_plt_reader::get_got_desc): Remove.
5090 (Incremental_got_plt_reader::get_got_symndx): New function.
5091 (Incremental_got_plt_reader::get_got_input_index): New function.
5092 (Sized_incremental_binary::Sized_incremental_binary): Remove
5093 file_status_; add input_objects_.
5094 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5095 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5096 (Sized_incremental_binary::file_is_unchanged): Remove.
5097 (Sized_incremental_binary::set_input_object): New function.
5098 (Sized_incremental_binary::input_object): New function.
5099 (Sized_incremental_binary::file_status_): Remove.
5100 (Sized_incremental_binary::input_objects_): New data member.
5101 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5103 (Sized_relobj_incr::invalid_address): Move to base class.
5104 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5106 (Sized_relobj_incr::do_output_section_offset): Likewise.
5107 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5108 (Sized_relobj_incr::section_offsets_): Likewise.
5109 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5111 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5112 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5113 with accessor function.
5114 (Sized_relobj_file::do_layout): Likewise.
5115 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5116 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5117 (Sized_relobj_file::compute_final_local_value): Replace refs to
5118 section_offsets_ with accessor function.
5119 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5120 * object.h (Relobj::Relobj): Initialize new data members.
5121 (Relobj::add_dyn_reloc): New function.
5122 (Relobj::first_dyn_reloc): New function.
5123 (Relobj::dyn_reloc_count): New function.
5124 (Relobj::first_dyn_reloc_): New data member.
5125 (Relobj::dyn_reloc_count_): New data member.
5126 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5128 (Sized_relobj::Address): New typedef.
5129 (Sized_relobj::invalid_address): Move here from child class.
5130 (Sized_relobj::Sized_relobj): Initialize new data members.
5131 (Sized_relobj::sized_relobj): New function.
5132 (Sized_relobj::is_output_section_offset_invalid): Move here from
5134 (Sized_relobj::get_output_section_offset): Likewise.
5135 (Sized_relobj::local_has_got_offset): Likewise.
5136 (Sized_relobj::local_got_offset): Likewise.
5137 (Sized_relobj::set_local_got_offset): Likewise.
5138 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5139 (Sized_relobj::clear_got_offsets): New function.
5140 (Sized_relobj::section_offsets): Move here from child class.
5141 (Sized_relobj::do_output_section_offset): Likewise.
5142 (Sized_relobj::do_set_section_offset): Likewise.
5143 (Sized_relobj::Local_got_offsets): Likewise.
5144 (Sized_relobj::local_got_offsets_): Likewise.
5145 (Sized_relobj::section_offsets_): Likewise.
5146 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5148 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5150 (Sized_relobj_file::sized_relobj): New function
5151 (Sized_relobj_file::local_has_got_offset): Move to base class.
5152 (Sized_relobj_file::local_got_offset): Likewise.
5153 (Sized_relobj_file::set_local_got_offset): Likewise.
5154 (Sized_relobj_file::get_output_section_offset): Likewise.
5155 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5156 (Sized_relobj_file::do_output_section_offset): Likewise.
5157 (Sized_relobj_file::do_set_section_offset): Likewise.
5158 (Sized_relobj_file::Local_got_offsets): Likewise.
5159 (Sized_relobj_file::local_got_offsets_): Likewise.
5160 (Sized_relobj_file::section_offsets_): Likewise.
5161 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5163 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5164 (Output_reloc::get_symbol_index): Likewise.
5165 (Output_reloc::local_section_offset): Likewise.
5166 (Output_reloc::get_address): Likewise.
5167 (Output_reloc::symbol_value): Likewise.
5168 (Output_data_got::reserve_slot): Move to class definition.
5169 (Output_data_got::reserve_local): New function.
5170 (Output_data_got::reserve_slot_for_global): Remove.
5171 (Output_data_got::reserve_global): New function.
5172 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5173 (all constructors, two instantiations).
5174 (Output_reloc::get_relobj): New function (two instantiations).
5175 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5176 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5177 (Output_data_reloc::add_global): Adjust type of relobj.
5178 (Output_data_reloc::add_global_relative): Likewise.
5179 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5180 (Output_data_reloc::add_local): Likewise.
5181 (Output_data_reloc::add_local_relative): Likewise.
5182 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5183 (Output_data_reloc::add_local_section): Likewise.
5184 (Output_data_reloc::add_output_section): Likewise.
5185 (Output_data_reloc::add_absolute): Likewise.
5186 (Output_data_reloc::add_target_specific): Likewise.
5187 (Output_data_got::reserve_slot): Move definition here.
5188 (Output_data_got::reserve_local): New function.
5189 (Output_data_got::reserve_global): New function.
5190 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5191 section_offsets_ with accessor function.
5192 (Sized_relobj_file::write_sections): Likewise.
5193 (Sized_relobj_file::do_relocate_sections): Likewise.
5194 * target.h (Sized_target::reserve_local_got_entry): New function.
5195 (Sized_target::reserve_global_got_entry): New function.
5196 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5197 (Target_x86_64::reserve_global_got_entry): New function.
5198 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5200 2011-05-23 Cary Coutant <ccoutant@google.com>
5202 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5203 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5204 bit when checking got_type.
5205 * incremental.cc (Sized_incremental_binary::setup_readers):
5206 Store symbol table and string table locations; initialize bit vector
5207 of file status flags.
5208 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5210 (Sized_incremental_binary::do_process_got_plt): New function.
5211 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5212 (Output_section_incremental_inputs::set_final_data_size): Record
5213 file index for each input file.
5214 (Output_section_incremental_inputs::write_got_plt): Store file index
5215 instead of input entry offset for each GOT entry.
5217 (Incremental_input_entry::Incremental_input_entry): Initialize new
5219 (Incremental_input_entry::set_offset): Store file index.
5220 (Incremental_input_entry::get_file_index): New function.
5221 (Incremental_input_entry::file_index_): New data member.
5222 (Incremental_binary::process_got_plt): New function.
5223 (Incremental_binary::do_process_got_plt): New function.
5224 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5226 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5227 (Sized_incremental_binary::set_file_is_unchanged): New function.
5228 (Sized_incremental_binary::file_is_unchanged): New function.
5229 (Sized_incremental_binary::do_process_got_plt): New function.
5230 (Sized_incremental_binary::file_status_): New data member.
5231 (Sized_incremental_binary::main_symtab_loc_): New data member.
5232 (Sized_incremental_binary::main_strtab_loc_): New data member.
5233 * output.cc (Output_data_got::Got_entry::write): Add case
5235 (Output_data_got::add_global): Call add_got_entry.
5236 (Output_data_got::add_global_plt): Likewise.
5237 (Output_data_got::add_global_with_rel): Likewise.
5238 (Output_data_got::add_global_with_rela): Likewise.
5239 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5240 (Output_data_got::add_global_pair_with_rela): Likewise.
5241 (Output_data_got::add_local): Call add_got_entry.
5242 (Output_data_got::add_local_plt): Likewise.
5243 (Output_data_got::add_local_with_rel): Likewise.
5244 (Output_data_got::add_local_with_rela): Likewise.
5245 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5246 (Output_data_got::add_local_pair_with_rela): Likewise.
5247 (Output_data_got::reserve_slot): New function.
5248 (Output_data_got::reserve_slot_for_global): New function.
5249 (Output_data_got::add_got_entry): New function.
5250 (Output_data_got::add_got_entry_pair): New function.
5251 (Output_section::add_output_section_data): Edit FIXME.
5253 (Output_section_data_build::Output_section_data_build): New
5254 constructor with size parameter.
5255 (Output_data_space::Output_data_space): Likewise.
5256 (Output_data_got::Output_data_got): Initialize new data member; new
5257 constructor with size parameter.
5258 (Output_data_got::add_constant): Call add_got_entry.
5259 (Output_data_got::reserve_slot): New function.
5260 (Output_data_got::reserve_slot_for_global): New function.
5261 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5262 (Output_data_got::add_got_entry): New function.
5263 (Output_data_got::add_got_entry_pair): New function.
5264 (Output_data_got::free_list_): New data member.
5265 * target.h (Sized_target::init_got_plt_for_update): New function.
5266 (Sized_target::register_global_plt_entry): New function.
5267 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5268 Initialize new data member; call init; add constructor with PLT count.
5269 (Output_data_plt_x86_64::init): New function.
5270 (Output_data_plt_x86_64::add_relocation): New function.
5271 (Output_data_plt_x86_64::reserve_slot): New function.
5272 (Output_data_plt_x86_64::free_list_): New data member.
5273 (Target_x86_64::init_got_plt_for_update): New function.
5274 (Target_x86_64::register_global_plt_entry): New function.
5275 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5276 incremental updates.
5277 (Output_data_plt_x86_64::add_relocation): New function.
5278 * testsuite/object_unittest.cc (Object_test): Set default options.
5280 2011-05-16 Ian Lance Taylor <iant@google.com>
5282 * options.h (class General_options): Make -i a synonym for -r.
5284 2011-05-16 Ian Lance Taylor <iant@google.com>
5286 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5288 2011-05-10 Cary Coutant <ccoutant@google.com>
5290 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5293 2011-05-06 Ian Lance Taylor <iant@google.com>
5295 * layout.cc (Layout::layout): If the output section flags change,
5296 update the ordering.
5298 2011-04-25 Cary Coutant <ccoutant@google.com>
5300 * incremental-dump.cc (dump_incremental_inputs): Print local
5301 symbol info for each input file.
5303 (Output_section_incremental_inputs::set_final_data_size): Add local
5304 symbol info to input file entries in incremental info.
5305 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5306 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5307 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5308 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5310 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5311 (Sized_incr_relobj::do_relocate): Write the local symbols.
5312 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5313 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5314 Adjust size of input file header.
5315 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5316 (Incremental_inputs_reader::get_local_symbol_count): New function.
5317 (Incremental_inputs_reader::get_input_section): Adjust size of input
5319 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5320 (Sized_incr_relobj::This): New typedef.
5321 (Sized_incr_relobj::sym_size): New const data member.
5322 (Sized_incr_relobj::Local_symbol): New struct.
5323 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5324 (Sized_incr_relobj::do_local_symbol_offset): New function.
5325 (Sized_incr_relobj::local_symbol_count_): New data member.
5326 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5327 (Sized_incr_relobj::local_symbol_index_): New data member.
5328 (Sized_incr_relobj::local_symbol_offset_): New data member.
5329 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5330 (Sized_incr_relobj::local_symbols_): New data member.
5331 * object.h (Relobj::output_local_symbol_count): New function.
5332 (Relobj::local_symbol_offset): New function.
5333 (Relobj::do_output_local_symbol_count): New function.
5334 (Relobj::do_local_symbol_offset): New function.
5335 (Sized_relobj::do_output_local_symbol_count): New function.
5336 (Sized_relobj::do_local_symbol_offset): New function.
5338 2011-04-22 Vladimir Simonov <sv@sw.ru>
5340 * descriptors.cc (set_close_on_exec): New function.
5341 (Descriptors::open): Use set_close_on_exec.
5342 * output.cc (S_ISLNK): Define if not defined.
5344 2011-04-22 Cary Coutant <ccoutant@google.com>
5346 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5348 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5349 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5350 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5352 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5353 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5354 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5356 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5358 (Incremental_binary::apply_incremental_relocs): New function.
5359 (Incremental_binary::do_apply_incremental_relocs): New function.
5360 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5362 (Sized_incremental_binary::add_global_symbol): New function.
5363 (Sized_incremental_binary::global_symbol): New function.
5364 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5365 (Sized_incremental_binary::symbol_map_): New data member.
5366 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5367 * target.h (Sized_target::apply_relocation): New function.
5368 * target-reloc.h (apply_relocation): New function.
5369 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5371 2011-04-22 Doug Kwan <dougkwan@google.com>
5373 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5374 flag of a SHT_ARM_EXIDX section.
5375 * testsuite/Makefile.am (arm_exidx_test): New test rules.
5376 * testsuite/Makefile.in: Regenerate.
5377 * testsuite/arm_exidx_test.s: New file.
5378 * testsuite/arm_exidx_test.sh: Same.
5380 2011-04-20 Cary Coutant <ccoutant@google.com>
5383 * archive.h (Incremental_archive_entry::Archive_member):
5384 Initialize arg_serial_ (second constructor).
5386 2011-04-17 Ian Lance Taylor <iant@google.com>
5388 * object.cc (Relocate_info::location): Simplify location string.
5389 * errors.cc (Errors::error_at_location): Don't print program
5391 (Errors::warning_at_location): Likewise.
5392 (Errors::undefined_symbol): Likewise.
5393 * testsuite/debug_msg.sh: Update accordingly.
5395 2011-04-14 Cary Coutant <ccoutant@google.com>
5397 * gold/layout.cc (Layout::symtab_section_offset): New function.
5398 * gold/layout.h (Layout::symtab_section_offset): New function.
5399 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5401 2011-04-12 Ian Lance Taylor <iant@google.com>
5403 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5404 with MREMAP_MAYMOVE.
5405 * output.h (class Output_file): Add map_is_allocated_ field.
5406 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5407 not available, provide stubs. If mremap is not available, #define
5409 (MREMAP_MAYMOVE): Define if not defined.
5410 (Output_file::Output_file): Initialize map_is_allocated_.
5411 (Output_file::resize): Check map_is_allocated_.
5412 (Output_file::map_anonymous): If mmap fails, use malloc.
5413 (Output_file::unmap): Don't do anything for an anonymous map.
5414 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5415 is not available, provide stubs.
5416 (File_read::View::~View): Use free rather than delete[].
5417 (File_read::make_view): Use malloc rather than new[]. If mmap
5419 (File_read::find_or_make_view): Use malloc rather than new[].
5420 * gold.h: Remove HAVE_REMAP code.
5421 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5422 exists. Rename mremap to gold_mremap. If mmap is not available
5424 * configure, config.in: Rebuild.
5426 2011-04-11 Ian Lance Taylor <iant@google.com>
5428 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5429 initialize local variable v.
5431 2011-04-11 Cary Coutant <ccoutant@google.com>
5433 * archive.cc (Archive::include_member): Adjust call to
5435 (Add_archive_symbols::run): Track argument serial numbers.
5436 (Lib_group::include_member): Likewise.
5437 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5438 * archive.h (Incremental_archive_entry::Archive_member):
5439 Initialize arg_serial_.
5440 (Archive_member::arg_serial_): New data member.
5441 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5442 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5444 (Sized_dynobj::do_for_all_local_got_entries): New function.
5445 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5447 * fileread.cc (get_mtime): New function.
5448 * fileread.h (get_mtime): New function.
5449 * gold.cc (queue_initial_tasks): Check for incremental update.
5450 (process_incremental_input): New function.
5451 (queue_middle_tasks): Don't force valid target for incremental
5453 * incremental-dump.cc (find_input_containing_global): Adjust
5454 size of symbol info entry.
5455 (dump_incremental_inputs): Dump argument serial number and
5456 in_system_directory flag; bias shndx by 1; print symbol names
5457 when dumping per-file symbol lists; use new symbol info readers.
5459 (Output_section_incremental_inputs:update_data_size): New function.
5460 (Sized_incremental_binary::setup_readers): Setup input readers
5461 for each input file; build maps for files added from libraries
5463 (Sized_incremental_binary::check_input_args): New function.
5464 (Sized_incremental_binary::do_check_inputs): Build map of argument
5465 serial numbers to input arguments.
5466 (Sized_incremental_binary::do_file_has_changed): Rename
5467 do_file_is_unchanged to this; compare file modification times.
5468 (Sized_incremental_binary::do_init_layout): New function.
5469 (Sized_incremental_binary::do_reserve_layout): New function.
5470 (Sized_incremental_binary::do_get_input_reader): Remove.
5471 (Sized_incremental_binary::get_symtab_view): New function.
5472 (Incremental_checker::can_incrementally_link_output_file): Remove.
5473 (Incremental_inputs::report_command_line): Exclude --debug options.
5474 (Incremental_inputs::report_archive_begin): Add parameter; track
5475 argument serial numbers; don't put input file entry for archive
5476 before archive members.
5477 (Incremental_inputs::report_archive_end): Put input file entry
5478 for archive after archive members.
5479 (Incremental_inputs::report_object): Add parameter; track argument
5480 serial numbers and in_system_directory flag.
5481 (Incremental_inputs::report_script): Add parameter; track argument
5483 (Output_section_incremental_inputs::set_final_data_size): Adjust
5484 size of symbol info entry; check for forwarding symbols.
5485 (Output_section_incremental_inputs::write_input_files): Write
5486 in_system_directory flag and argument serial number.
5487 (Output_section_incremental_inputs::write_info_blocks): Map section
5488 indices between incremental info and original input file; store
5489 input section index for each symbol.
5490 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5491 change operator() to visit().
5492 (class Global_got_offset_visitor): Likewise.
5493 (class Global_symbol_visitor_got_plt):
5494 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5496 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5497 (Sized_incr_relobj::do_read_symbols): New function.
5498 (Sized_incr_relobj::do_layout): New function.
5499 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5500 (Sized_incr_relobj::do_add_symbols): New function.
5501 (Sized_incr_relobj::do_should_include_member): New function.
5502 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5503 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5504 (Sized_incr_relobj::do_section_size): New function.
5505 (Sized_incr_relobj::do_section_name): New function.
5506 (Sized_incr_relobj::do_section_contents): New function.
5507 (Sized_incr_relobj::do_section_flags): New function.
5508 (Sized_incr_relobj::do_section_entsize): New function.
5509 (Sized_incr_relobj::do_section_address): New function.
5510 (Sized_incr_relobj::do_section_type): New function.
5511 (Sized_incr_relobj::do_section_link): New function.
5512 (Sized_incr_relobj::do_section_info): New function.
5513 (Sized_incr_relobj::do_section_addralign): New function.
5514 (Sized_incr_relobj::do_initialize_xindex): New function.
5515 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5516 (Sized_incr_relobj::do_read_relocs): New function.
5517 (Sized_incr_relobj::do_gc_process_relocs): New function.
5518 (Sized_incr_relobj::do_scan_relocs): New function.
5519 (Sized_incr_relobj::do_count_local_symbols): New function.
5520 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5521 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5522 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5523 (Sized_incr_relobj::do_relocate): New function.
5524 (Sized_incr_relobj::do_set_section_offset): New function.
5525 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5526 (Sized_incr_dynobj::do_read_symbols): New function.
5527 (Sized_incr_dynobj::do_layout): New function.
5528 (Sized_incr_dynobj::do_add_symbols): New function.
5529 (Sized_incr_dynobj::do_should_include_member): New function.
5530 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5531 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5532 (Sized_incr_dynobj::do_section_size): New function.
5533 (Sized_incr_dynobj::do_section_name): New function.
5534 (Sized_incr_dynobj::do_section_contents): New function.
5535 (Sized_incr_dynobj::do_section_flags): New function.
5536 (Sized_incr_dynobj::do_section_entsize): New function.
5537 (Sized_incr_dynobj::do_section_address): New function.
5538 (Sized_incr_dynobj::do_section_type): New function.
5539 (Sized_incr_dynobj::do_section_link): New function.
5540 (Sized_incr_dynobj::do_section_info): New function.
5541 (Sized_incr_dynobj::do_section_addralign): New function.
5542 (Sized_incr_dynobj::do_initialize_xindex): New function.
5543 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5544 (make_sized_incremental_object): New function.
5545 (Incremental_library::copy_unused_symbols): New function.
5546 (Incremental_library::do_for_all_unused_symbols): New function.
5547 * incremental.h (enum Incremental_input_flags): New type.
5548 (class Incremental_checker): Remove.
5549 (Incremental_input_entry::Incremental_input_entry): Add argument
5551 (Incremental_input_entry::arg_serial): New function.
5552 (Incremental_input_entry::set_is_in_system_directory): New function.
5553 (Incremental_input_entry::is_in_system_directory): New function.
5554 (Incremental_input_entry::arg_serial_): New data member.
5555 (Incremental_input_entry::is_in_system_directory_): New data member.
5556 (class Script_info): Move here from script.h.
5557 (Script_info::Script_info): Add filename parameter.
5558 (Script_info::filename): New function.
5559 (Script_info::filename_): New data member.
5560 (Incremental_script_entry::Incremental_script_entry): Add argument
5562 (Incremental_object_entry::Incremental_object_entry): Likewise.
5563 (Incremental_object_entry::add_input_section): Build list of input
5564 sections with map to original shndx.
5565 (Incremental_object_entry::get_input_section_index): New function.
5566 (Incremental_object_entry::shndx_): New data member.
5567 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5568 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5569 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5571 (Incremental_inputs::report_archive_begin): Likewise.
5572 (Incremental_inputs::report_object): Likewise.
5573 (Incremental_inputs::report_script): Likewise.
5574 (class Incremental_global_symbol_reader): New class.
5575 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5576 and store flags and input file type.
5577 (Incremental_input_entry_reader::arg_serial): New function.
5578 (Incremental_input_entry_reader::type): Extract type from flags.
5579 (Incremental_input_entry_reader::is_in_system_directory): New function.
5580 (Incremental_input_entry_reader::get_input_section_count): Call
5581 accessor function for type.
5582 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5583 function for type; adjust size of global symbol entry.
5584 (Incremental_input_entry_reader::get_global_symbol_count): Call
5585 accessor function for type.
5586 (Incremental_input_entry_reader::get_object_count): Likewise.
5587 (Incremental_input_entry_reader::get_object_offset): Likewise.
5588 (Incremental_input_entry_reader::get_member_count): Likewise.
5589 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5590 (Incremental_input_entry_reader::get_member_offset): Likewise.
5591 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5592 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5593 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5594 (Incremental_input_entry_reader::get_global_symbol_reader): New
5596 (Incremental_input_entry_reader::get_output_symbol_index): New
5598 (Incremental_input_entry_reader::type_): Remove.
5599 (Incremental_input_entry_reader::flags_): New data member.
5600 (Incremental_inputs_reader::input_file_offset): New function.
5601 (Incremental_inputs_reader::input_file_index): New function.
5602 (Incremental_inputs_reader::input_file): Call input_file_offset.
5603 (Incremental_inputs_reader::input_file_at_offset): New function.
5604 (Incremental_relocs_reader::get_r_type): Reformat.
5605 (Incremental_relocs_reader::get_r_shndx): Reformat.
5606 (Incremental_relocs_reader::get_r_offset): Reformat.
5607 (Incremental_relocs_reader::data): New function.
5608 (Incremental_binary::Incremental_binary): Initialize new data members.
5609 (Incremental_binary::check_inputs): Add cmdline parameter.
5610 (Incremental_binary::file_is_unchanged): Remove.
5611 (Input_reader::arg_serial): New function.
5612 (Input_reader::get_unused_symbol_count): New function.
5613 (Input_reader::get_unused_symbol): New function.
5614 (Input_reader::do_arg_serial): New function.
5615 (Input_reader::do_get_unused_symbol_count): New function.
5616 (Input_reader::do_get_unused_symbol): New function.
5617 (Incremental_binary::input_file_count): New function.
5618 (Incremental_binary::get_input_reader): Change signature to use
5619 index instead of filename.
5620 (Incremental_binary::file_has_changed): New function.
5621 (Incremental_binary::get_input_argument): New function.
5622 (Incremental_binary::get_library): New function.
5623 (Incremental_binary::get_script_info): New function.
5624 (Incremental_binary::init_layout): New function.
5625 (Incremental_binary::reserve_layout): New function.
5626 (Incremental_binary::output_file): New function.
5627 (Incremental_binary::do_check_inputs): New function.
5628 (Incremental_binary::do_file_is_unchanged): Remove.
5629 (Incremental_binary::do_file_has_changed): New function.
5630 (Incremental_binary::do_init_layout): New function.
5631 (Incremental_binary::do_reserve_layout): New function.
5632 (Incremental_binary::do_input_file_count): New function.
5633 (Incremental_binary::do_get_input_reader): Change signature.
5634 (Incremental_binary::input_args_map_): New data member.
5635 (Incremental_binary::library_map_): New data member.
5636 (Incremental_binary::script_map_): New data member.
5637 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5639 (Sized_incremental_binary::output_section): New function.
5640 (Sized_incremental_binary::inputs_reader): Add const.
5641 (Sized_incremental_binary::symtab_reader): Add const.
5642 (Sized_incremental_binary::relocs_reader): Add const.
5643 (Sized_incremental_binary::got_plt_reader): Add const.
5644 (Sized_incremental_binary::get_symtab_view): New function.
5645 (Sized_incremental_binary::Inputs_reader): New typedef.
5646 (Sized_incremental_binary::Input_entry_reader): New typedef.
5647 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5648 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5649 (Sized_incremental_binary::do_file_has_changed): New function.
5650 (Sized_incremental_binary::do_init_layout): New function.
5651 (Sized_incremental_binary::do_reserve_layout): New function.
5652 (Sized_input_reader::Inputs_reader): Remove.
5653 (Sized_input_reader::Input_entry_reader): Remove.
5654 (Sized_input_reader::do_arg_serial): New function.
5655 (Sized_input_reader::do_get_unused_symbol_count): New function.
5656 (Sized_input_reader::do_get_unused_symbol): New function.
5657 (Sized_incremental_binary::do_input_file_count): New function.
5658 (Sized_incremental_binary::do_get_input_reader): Change signature;
5659 use index instead of filename.
5660 (Sized_incremental_binary::section_map_): New data member.
5661 (Sized_incremental_binary::input_entry_readers_): New data member.
5662 (class Sized_incr_relobj): New class.
5663 (class Sized_incr_dynobj): New class.
5664 (make_sized_incremental_object): New function.
5665 (class Incremental_library): New class.
5666 * layout.cc (Free_list::num_lists): New static data member.
5667 (Free_list::num_nodes): New static data member.
5668 (Free_list::num_removes): New static data member.
5669 (Free_list::num_remove_visits): New static data member.
5670 (Free_list::num_allocates): New static data member.
5671 (Free_list::num_allocate_visits): New static data member.
5672 (Free_list::init): New function.
5673 (Free_list::remove): New function.
5674 (Free_list::allocate): New function.
5675 (Free_list::dump): New function.
5676 (Free_list::print_stats): New function.
5677 (Layout_task_runner::run): Resize output file for incremental updates.
5678 (Layout::Layout): Initialize new data members.
5679 (Layout::set_incremental_base): New function.
5680 (Layout::init_fixed_output_section): New function.
5681 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5682 incremental updates.
5683 (Layout::create_gold_note): Do not create gold note section for
5684 incremental updates.
5685 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5686 for incremental updates.
5687 (Layout::set_section_offsets): For incremental updates, allocate space
5689 (Layout::create_symtab_sections): Layout with offsets relative to
5690 start of section; for incremental updates, allocate space from free
5692 (Layout::create_shdrs): For incremental updates, allocate space from
5694 (Layout::finish_dynamic_section): For incremental updates, do not
5695 check --as-needed (fixed in subsequent patch).
5696 * layout.h (class Free_list): New class.
5697 (Layout::set_incremental_base): New function.
5698 (Layout::incremental_base): New function.
5699 (Layout::init_fixed_output_section): New function.
5700 (Layout::allocate): New function.
5701 (Layout::incremental_base_): New data member.
5702 (Layout::free_list_): New data member.
5703 * main.cc (main): Print Free_list statistics.
5704 * object.cc (Relobj::finalize_incremental_relocs): Add
5705 clear_counts parameter; clear counts only when clear_counts is set.
5706 (Sized_relobj::Sized_relobj): Initialize new base class.
5707 (Sized_relobj::do_layout): Don't report special sections.
5708 (Sized_relobj::do_for_all_local_got_entries): New function.
5709 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5710 symtab_off to all symbol table offsets.
5711 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5712 * object.h (class Got_offset_list): Move to top of file.
5713 (Object::Object): Allow case where input_file == NULL.
5714 (Object::~Object): Likewise.
5715 (Object::input_file): Assert that input_file != NULL.
5716 (Object::lock): Allow case where input_file == NULL.
5717 (Object::unlock): Likewise.
5718 (Object::is_locked): Likewise.
5719 (Object::token): Likewise.
5720 (Object::release): Likewise.
5721 (Object::is_incremental): New function.
5722 (Object::get_mtime): New function.
5723 (Object::for_all_local_got_entries): New function.
5724 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5725 (Object::set_is_in_system_directory): New function.
5726 (Object::is_in_system_directory): New function.
5727 (Object::do_is_incremental): New function.
5728 (Object::do_get_mtime): New function.
5729 (Object::do_for_all_local_got_entries): New function.
5730 (Object::is_in_system_directory_): New data member.
5731 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5732 (class Sized_relobj_base): New class.
5733 (class Sized_relobj): Derive from Sized_relobj_base.
5734 (class Sized_relobj::Symbols): Redeclare from base class.
5735 (class Sized_relobj::local_got_offset_list): Remove.
5736 (class Sized_relobj::Output_sections): Redeclare from base class.
5737 (class Sized_relobj::do_for_all_local_got_entries): New function.
5738 (class Sized_relobj::write_local_symbols): Add offset parameter.
5739 (class Sized_relobj::local_symbol_offset_): Update comment.
5740 (class Sized_relobj::local_dynsym_offset_): Update comment.
5741 * options.cc (Input_arguments::add_file): Remove const.
5742 * options.h (Input_file_argument::Input_file_argument):
5743 Initialize arg_serial_ (all constructors).
5744 (Input_file_argument::set_arg_serial): New function.
5745 (Input_file_argument::arg_serial): New function.
5746 (Input_file_argument::arg_serial_): New data member.
5747 (Input_arguments::Input_arguments): Initialize file_count_.
5748 (Input_arguments::add_file): Remove const.
5749 (Input_arguments::number_of_input_files): New function.
5750 (Input_arguments::file_count_): New data member.
5751 (Command_line::number_of_input_files): Call
5752 Input_arguments::number_of_input_files.
5753 * output.cc (Output_segment_headers::Output_segment_headers):
5755 (Output_section::Input_section::current_data_size): New function.
5756 (Output_section::Output_section): Initialize new data members.
5757 (Output_section::add_input_section): Don't do merge sections for
5758 an incremental link; allocate space from free list for an
5760 (Output_section::add_output_section_data): Allocate space from
5761 free list for an incremental update.
5762 (Output_section::update_data_size): New function.
5763 (Output_section::set_fixed_layout): New function.
5764 (Output_section::reserve): New function.
5765 (Output_segment::set_section_addresses): Remove const.
5766 (Output_segment::set_section_list_addresses): Remove const; allocate
5767 space from free list for an incremental update.
5768 (Output_segment::set_offset): Adjust size of RELRO segment for an
5770 * output.h (Output_data::current_data_size): Move here from
5772 (Output_data::pre_finalize_data_size): New function.
5773 (Output_data::update_data_size): New function.
5774 (Output_section_headers::update_data_size): new function.
5775 (Output_section_data_build::current_data_size): Move to Output_data.
5776 (Output_data_strtab::update_data_size): New function.
5777 (Output_section::current_data_size): Move to Output_data.
5778 (Output_section::set_fixed_layout): New function.
5779 (Output_section::has_fixed_layout): New function.
5780 (Output_section::reserve): New function.
5781 (Output_section::update_data_size): New function.
5782 (Output_section::has_fixed_layout_): New data member.
5783 (Output_section::free_list_): New data member.
5784 (Output_segment::set_section_addresses): Remove const.
5785 (Output_segment::set_section_list_addresses): Remove const.
5786 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5788 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5790 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5791 parameter when calling Add_symbols constructor; store argument
5792 serial number for members of a lib group.
5793 (Add_symbols::locks): Allow case where token == NULL.
5794 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5795 (Read_member::~Read_member): New function.
5796 (Read_member::is_runnable): New function.
5797 (Read_member::locks): New function.
5798 (Read_member::run): New function.
5799 (Check_script::~Check_script): New function.
5800 (Check_script::is_runnable): New function.
5801 (Check_script::locks): New function.
5802 (Check_script::run): New function.
5803 (Check_library::~Check_library): New function.
5804 (Check_library::is_runnable): New function.
5805 (Check_library::locks): New function.
5806 (Check_library::run): New function.
5807 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5808 (Add_symbols::library_): New data member.
5809 (class Read_member): New class.
5810 (class Check_script): New class.
5811 (class Check_library): New class.
5812 * reloc.cc (Read_relocs::is_runnable): Allow case where
5814 (Read_relocs::locks): Likewise.
5815 (Scan_relocs::locks): Likewise.
5816 (Relocate_task::locks): Likewise.
5817 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5819 (Sized_relobj::incremental_relocs_scan): Fix comment.
5820 (Sized_relobj::do_relocate): Pass output file offset to
5821 write_local_symbols.
5822 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5823 from class declaration.
5824 * script.cc (read_input_script): Allocate Script_info; pass
5825 argument serial number to report_script.
5826 * script.h (class Script_info): Move to incremental.h.
5827 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5828 * symtab.h (Symbol_table::add_from_incrobj): New function.
5829 (Symbol_table::set_file_offset): New function.
5831 2011-04-05 Cary Coutant <ccoutant@google.com>
5833 * incremental-dump.cc (dump_incremental_inputs): Change signature
5834 to take a Sized_incremental_binary; change caller. Use readers
5835 in Sized_incremental_binary.
5837 (Sized_incremental_binary::find_incremental_inputs_sections):
5838 Rename do_find_incremental_inputs_sections to this.
5839 (Sized_incremental_binary::setup_readers): New function.
5840 (Sized_incremental_binary::do_check_inputs): Check
5841 has_incremental_info_ flag; move setup code to setup_readers;
5843 (Sized_incremental_binary::do_file_is_unchanged): New function.
5844 (Sized_incremental_binary::do_get_input_reader): New function.
5845 * incremental.h (class Incremental_binary): Move to end of file.
5846 (Incremental_binary::file_is_unchanged): New function.
5847 (Incremental_binary::do_file_is_unchanged): New function.
5848 (Incremental_binary::Input_reader): New class.
5849 (Incremental_binary::get_input_reader): New function.
5850 (class Sized_incremental_binary): Move to end of file.
5851 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5852 input section reader classes.
5853 (Sized_incremental_binary::has_incremental_info): New function.
5854 (Sized_incremental_binary::inputs_reader): New function.
5855 (Sized_incremental_binary::symtab_reader): New function.
5856 (Sized_incremental_binary::relocs_reader): New function.
5857 (Sized_incremental_binary::got_plt_reader): New function.
5858 (Sized_incremental_binary::do_file_is_unchanged): New function.
5859 (Sized_incremental_binary::Sized_input_reader): New class.
5860 (Sized_incremental_binary::get_input_reader): New function.
5861 (Sized_incremental_binary::find_incremental_inputs_sections):
5862 Rename do_find_incremental_inputs_sections to this.
5863 (Sized_incremental_binary::setup_readers): New function.
5864 (Sized_incremental_binary::has_incremental_info_): New data member.
5865 (Sized_incremental_binary::inputs_reader_): New data member.
5866 (Sized_incremental_binary::symtab_reader_): New data member.
5867 (Sized_incremental_binary::relocs_reader_): New data member.
5868 (Sized_incremental_binary::got_plt_reader_): New data member.
5869 (Sized_incremental_binary::current_input_file_): New data member.
5871 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5874 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5877 2011-03-30 Cary Coutant <ccoutant@google.com>
5879 * archive.cc (Archive::include_member): Adjust call to report_object.
5880 (Add_archive_symbols::run): Add script_info to call to
5881 report_archive_begin.
5882 (Lib_group::include_member): Adjust call to report_object.
5883 (Add_lib_group_symbols::run): Adjust call to report_object.
5884 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5885 blocks. Add object count for script input files.
5886 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5887 script_info parameter; change all callers.
5888 (Incremental_inputs::report_object): Add script_info parameter;
5890 (Incremental_inputs::report_script): Store backpointer to
5891 incremental info entry.
5892 (Output_section_incremental_inputs::set_final_data_size): Record
5893 additional information for scripts.
5894 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5895 * incremental.h (Incremental_script_entry::add_object): New function.
5896 (Incremental_script_entry::get_object_count): New function.
5897 (Incremental_script_entry::get_object): New function.
5898 (Incremental_script_entry::objects_): New data member; adjust
5900 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5901 (Incremental_inputs::report_object): Add script_info parameter.
5902 (Incremental_inputs_reader::get_object_count): New function.
5903 (Incremental_inputs_reader::get_object_offset): New function.
5904 * options.cc (Input_arguments::add_file): Return reference to
5906 * options.h (Input_argument::set_script_info): New function.
5907 (Input_argument::script_info): New function.
5908 (Input_argument::script_info_): New data member; adjust all
5910 (Input_file_group::add_file): Return reference to new input argument.
5911 (Input_file_lib::add_file): Likewise.
5912 (Input_arguments::add_file): Likewise.
5913 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5914 * script.cc (Parser_closure::Parser_closure): Add script_info
5915 parameter; adjust all callers.
5916 (Parser_closure::script_info): New function.
5917 (Parser_closure::script_info_): New data member.
5918 (read_input_script): Report scripts earlier to incremental info.
5919 (script_add_file): Set script_info in Input_argument.
5920 (script_add_library): Likewise.
5921 * script.h (Script_options::Script_info): Rewrite class.
5923 2011-03-29 Cary Coutant <ccoutant@google.com>
5925 * archive.cc (Library_base::should_include_member): Move
5926 method here from class Archive.
5927 (Archive::Archive): Initialize base class.
5928 (Archive::should_include_member): Move to base class.
5929 (Archive::do_for_all_unused_symbols): New function.
5930 (Add_archive_symbols::run): Remove redundant access to
5932 (Lib_group::Lib_group): Initialize base class.
5933 (Lib_group::do_filename): New function.
5934 (Lib_group::include_member): Pass pointer to Lib_group to
5936 (Lib_group::do_for_all_unused_symbols): New function.
5937 (Add_lib_group_symbols::run): Report archive information for
5939 * archive.h (class Library_base): New base class.
5940 (class Archive): Derive from Library_base.
5941 (Archive::filename): Move to base class.
5942 (Archive::set_incremental_info): Likewise.
5943 (Archive::incremental_info): Likewise.
5944 (Archive::Should_include): Likewise.
5945 (Archive::should_include_member): Likewise.
5946 (Archive::Armap_entry): Remove.
5947 (Archive::Unused_symbol_iterator): Remove.
5948 (Archive::unused_symbols_begin): Remove.
5949 (Archive::unused_symbols_end): Remove.
5950 (Archive::do_filename): New function.
5951 (Archive::do_get_mtime): New function.
5952 (Archive::do_for_all_unused_symbols): New function.
5953 (Archive::task_): Move to base class.
5954 (Archive::incremental_info_): Likewise.
5955 (class Lib_group): Derive from Library_base.
5956 (Lib_group::do_filename): New function.
5957 (Lib_group::do_get_mtime): New function.
5958 (Lib_group::do_for_all_unused_symbols): New function.
5959 (Lib_group::task_): Move to base class.
5960 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5962 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5964 * incremental.cc (Incremental_inputs::report_archive_begin):
5965 Use Library_base; call library's get_mtime; add incremental inputs
5966 entry before members.
5967 (class Unused_symbol_visitor): New class.
5968 (Incremental_inputs::report_archive_end): Use Library_base; use
5969 visitor class to record unused symbols; don't add incremental inputs
5970 entry after members.
5971 (Incremental_inputs::report_object): Use Library_base.
5973 (Incremental_archive_entry::Incremental_archive_entry): Remove
5974 unused Archive parameter.
5975 (Incremental_inputs::report_archive_begin): Use Library_base.
5976 (Incremental_inputs::report_archive_end): Likewise.
5977 (Incremental_inputs::report_object): Likewise.
5978 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5980 * object.h (Object::for_all_global_symbols): New function.
5981 (Object::do_for_all_global_symbols): New function.
5982 (Sized_relobj::do_for_all_global_symbols): New function.
5983 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5985 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5988 2011-03-27 Ian Lance Taylor <iant@google.com>
5990 * archive.cc (Archive::interpret_header): Return -1 if something
5991 goes wrong. Change callers accordingly.
5993 2011-03-25 Cary Coutant <ccoutant@google.com>
5995 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5996 * testsuite/Makefile.in: Regenerate.
5998 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
6000 * plugin.cc (get_view): New.
6001 (Plugin::load): Pass get_view to the plugin.
6002 (Plugin_manager::get_view): New.
6004 2011-03-21 Ian Lance Taylor <iant@google.com>
6006 * testsuite/final_layout.sh: Rewrite to not use dc.
6007 * testsuite/relro_test.sh: Fail if dc is not present.
6009 2011-03-21 Sriraman Tallam <tmsriram@google.com>
6011 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6013 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6014 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6016 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6017 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6019 2011-03-14 Ian Lance Taylor <iant@google.com>
6021 * script-sections.cc (Sort_output_sections::script_compare):
6022 Rename from is_before, change return type.
6023 (Sort_output_sections::operator()): Adjust accordingly.
6025 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6028 * testsuite/odr_violation2.cc: Add comment to make all error line
6029 numbers double digits.
6030 * testsuite/debug_msg.sh: Adjust expected errors.
6032 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6034 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6035 but mark earlier ones as non-canonical
6036 (offset_to_iterator): Update search target and example
6037 (do_addr2line): Return extra lines in a vector*
6038 (format_file_lineno): Extract from do_addr2line
6039 (one_addr2line): Add vector* out-param
6040 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6041 when a lineno entry appeared last for its instruction
6042 (Dwarf_line_info): Add vector* out-param
6043 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6044 * symtab.cc (Odr_violation_compare): Include the lineno in the
6046 (linenos_from_loc): New. Combine the canonical line for an
6047 address with its other lines.
6048 (True_if_intersect): New. Helper functor to make
6049 std::set_intersection a query.
6050 (detect_odr_violations): Compare sets of lines instead of just
6051 one line for each function. This became less deterministic, but
6052 has fewer false positives.
6053 * symtab.h: Declarations.
6054 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6055 mix an optimized and non-optimized object in the same binary
6056 (odr_violation2.so): Same.
6057 * testsuite/Makefile.in: Regenerate from Makefile.am.
6058 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6059 * testsuite/debug_msg.sh: Update line numbers and add
6061 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6062 non-optimized context.
6063 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6064 isn't inlined, and use OdrDerived in an optimized context.
6065 * testsuite/odr_header1.h: Defines OdrDerived, where
6066 optimization will change the
6067 first-instruction-in-the-destructor's file and line number.
6068 * testsuite/odr_header2.h: Defines OdrBase.
6070 2011-03-09 Ian Lance Taylor <iant@google.com>
6072 * fileread.cc (File_read::clear_views): Don't delete the whole
6075 2011-03-08 Ian Lance Taylor <iant@google.com>
6078 * fileread.cc: #include <climits>.
6079 (GOLD_IOV_MAX): Define.
6080 (File_read::read_multiple): Limit number of entries by iov_max.
6081 * fileread.h (class File_read): Always set max_readv_entries to
6084 2011-03-07 Ian Lance Taylor <iant@google.com>
6087 * options.h (class General_options): Add -dy and -dn.
6089 2011-03-02 Cary Coutant <ccoutant@google.com>
6091 * testsuite/script_test_9.t: Add TLS segment.
6093 2011-03-02 Simon Baldwin <simonb@google.com>
6095 * configure.ac: Add check for gnu_indirect_function support in
6096 the toolchain building binutils.
6097 * configure: Rebuild.
6099 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
6101 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6102 plugin only symbols.
6103 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6104 in plugin files as not needed in the symbol table.
6106 2011-02-11 Sriraman Tallam <tmsriram@google.com>
6108 * output.cc (Output_section::add_input_section): Delay fill
6109 generation for section ordering.
6111 2011-02-09 Ian Lance Taylor <iant@google.com>
6114 * object.h (class Sized_relobj): Remove clear_local_symbols.
6115 * reloc.cc (Sized_relobj::do_relocate): Don't call
6116 clear_local_symbols.
6118 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
6120 * plugin.cc (is_visible_from_outside): Return true for symbols
6123 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6125 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6128 2011-02-02 Sriraman Tallam <tmsriram@google.com>
6130 * icf.h (is_section_foldable_candidate): Change type of parameter
6132 * icf.cc (Icf::find_identical_sections): Change type of local variable
6133 section_name to be std::string.
6134 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6136 2011-01-25 Ian Lance Taylor <iant@google.com>
6138 * script.cc (script_add_extern): Rewrite to use
6139 add_symbol_reference.
6141 2011-01-25 Doug Kwan <dougkwan@google.com>
6143 * icf.cc (get_section_contents): Always lock section's object.
6145 2011-01-24 Ian Lance Taylor <iant@google.com>
6147 * options.h (class General_options): Accept
6148 --no-detect-odr-violations.
6150 2011-01-24 Ian Lance Taylor <iant@google.com>
6152 * version.cc (version_string): Bump to 1.11.
6154 2011-01-24 Ian Lance Taylor <iant@google.com>
6156 * plugin.cc (class Plugin_rescan): Define new class.
6157 (Plugin_manager::claim_file): Set any_claimed_.
6158 (Plugin_manager::save_archive): New function.
6159 (Plugin_manager::save_input_group): New function.
6160 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6162 (Plugin_manager::new_undefined_symbol): New function.
6163 (Plugin_manager::rescan): New function.
6164 (Plugin_manager::rescannable_defines): New function.
6165 (Plugin_manager::add_input_file): Set any_added_.
6166 * plugin.h (class Plugin_manager): define new fields rescannable_,
6167 undefined_symbols_, any_claimed_, and any_added_. Declare
6168 Plugin_rescan as friend. Declare new functions.
6169 (Plugin_manager::Rescannable): Define type.
6170 (Plugin_manager::Rescannable_list): Define type.
6171 (Plugin_manager::Undefined_symbol_list): Define type.
6172 (Plugin_manager::Plugin_manager): Initialize new fields.
6173 * archive.cc (Archive::defines_symbol): New function.
6174 (Add_archive_symbols::run): Pass archive to plugins if any.
6175 * archive.h (class Archive): Declare defines_symbol.
6176 * readsyms.cc (Input_group::~Input_group): New function.
6177 (Finish_group::run): Pass input_group to plugins if any.
6178 * readsyms.h (class Input_group): Declare destructor.
6179 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6182 2011-01-10 Ian Lance Taylor <iant@google.com>
6184 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6186 (Layout::set_segment_offsets): Reset increase_relro before calling
6187 set_section_addresses a second time.
6189 2011-01-04 Cary Coutant <ccoutant@google.com>
6191 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6192 sections before NOBITS sections.
6194 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6196 * version.cc (print_version): Update copyright to 2011.
6198 2010-12-23 Cary Coutant <ccoutant@google.com>
6200 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6201 of OS to this->add. Add OD parameter to second form of the function.
6203 2010-12-20 Ian Lance Taylor <iant@google.com>
6205 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6206 second of two consecutive entries with same offset.
6208 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6210 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6211 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6212 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6213 to avoid unneeded links against $(LDADD).
6214 * testsuite/Makefile.in: Regenerate.
6216 2010-12-15 Ian Lance Taylor <iant@google.com>
6219 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6220 for R_X86_64_32 and R_X86_64_PC32.
6221 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6222 ver_matching_def_pic.o.
6223 (ver_matching_def_pic.o): New target.
6225 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6227 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6228 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6229 Move definition before File_read::View member definitions.
6230 (File_read::View::~View): Initialize and hold lock before
6231 updating current_mapped_bytes.
6233 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6235 * dwarf_reader.cc: Remove outdated comment.
6236 * gold-threads.cc: Fix typo in error message.
6237 * archive.cc: Fix typos in comments.
6238 * archive.h: Likewise.
6239 * arm-reloc-property.cc: Likewise.
6240 * arm-reloc-property.h: Likewise.
6241 * arm-reloc.def: Likewise.
6243 * attributes.h: Likewise.
6244 * cref.cc: Likewise.
6245 * ehframe.cc: Likewise.
6246 * fileread.h: Likewise.
6248 * i386.cc: Likewise.
6250 * incremental.h: Likewise.
6251 * int_encoding.cc: Likewise.
6252 * layout.h: Likewise.
6253 * main.cc: Likewise.
6254 * merge.h: Likewise.
6255 * object.cc: Likewise.
6256 * object.h: Likewise.
6257 * options.cc: Likewise.
6258 * readsyms.cc: Likewise.
6259 * reduced_debug_output.cc: Likewise.
6260 * reloc.cc: Likewise.
6261 * script-sections.cc: Likewise.
6262 * sparc.cc: Likewise.
6263 * symtab.h: Likewise.
6264 * target-reloc.h: Likewise.
6265 * target.cc: Likewise.
6266 * target.h: Likewise.
6267 * timer.cc: Likewise.
6268 * timer.h: Likewise.
6269 * x86_64.cc: Likewise.
6271 2010-12-09 Cary Coutant <ccoutant@google.com>
6273 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6275 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6276 parameter; change all callers.
6277 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6278 * options.h (warn_execstack): New option.
6280 2010-12-07 Doug Kwan <dougkwan@google.com>
6282 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6283 like function call relocations.
6285 2010-12-07 Ian Lance Taylor <iant@google.com>
6287 * archive.cc (Archive::get_elf_object_for_member): Permit
6288 punconfigured to be NULL.
6289 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6290 (Archive::include_member): Pass NULL to get_elf_object_for_member
6291 if we searched for the archive and this is the first included
6294 2010-12-01 Ian Lance Taylor <iant@google.com>
6296 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6297 track_relocs_type_ field.
6298 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6299 Set track_relocs_type_.
6300 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6301 contents when using RELA relocs.
6302 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6304 * reloc.cc (Track_relocs::next_addend): New function.
6305 * reloc.h (class Track_relocs): Declare next_addend.
6307 2010-12-01 Ian Lance Taylor <iant@google.com>
6309 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6312 2010-12-01 Ian Lance Taylor <iant@google.com>
6314 * README: Update compilers known to work and fail.
6316 2010-11-23 Matthias Klose <doko@ubuntu.com>
6318 * configure.in: For --enable-gold, handle value `default' instead of
6319 `both*'. Always install ld as ld.bfd, install as ld if gold is
6321 * configure: Regenerate.
6323 2010-11-18 Doug Kwan <dougkwan@google.com>
6325 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6326 and right_alignment to be zero. Store result alignment only if it is
6327 greater than existing alignment.
6329 2010-11-16 Cary Coutant <ccoutant@google.com>
6332 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6333 Check for ".zdebug_line".
6335 2010-11-16 Doug Kwan <dougkwan@google.com>
6336 Cary Coutant <ccoutant@google.com>
6338 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6339 by reference; adjust all callers.
6340 * output.cc (Output_segment::set_section_addresses): Adjust references
6341 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6343 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6344 end at page boundary.
6346 2010-11-16 Cary Coutant <ccoutant@google.com>
6349 * layout.cc (Layout::choose_output_section): Transform names of
6350 compressed sections even when using a script with a SECTIONS clause.
6351 (Layout::output_section_name): Remove code to transform
6352 compressed debug section names.
6353 * output.cc (Output_section::add_input_section): Use uncompressed
6354 section size when tracking input sections.
6356 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6358 * symtab.h (Symbol::NON_PIC_REF): Remove.
6359 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6360 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6361 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6362 (Symbol::use_plt_offset): Take a flags argument and pass it
6363 directly to needs_dynamic_reloc. Restrict check for undefined
6364 weak symbols to function calls.
6365 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6366 (Target_arm::Scan::global): Use it.
6367 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6368 (Target_arm::Relocate::relocate): Likewise.
6369 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6370 parameter with an r_type parameter. Use get_reference_flags
6372 (Target_arm::Relocate::relocate): Update accordingly.
6373 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6374 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6375 (Target_i386::Scan::global): Likewise.
6376 (Target_i386::Relocate::relocate): Likewise.
6377 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6378 parameter with an r_type parameter. Use get_reference_flags
6380 (Target_i386::Relocate::relocate): Update accordingly.
6381 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6382 (Target_powerpc::Scan::global): Use it.
6383 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6384 (Target_powerpc::Relocate::relocate): Likewise.
6385 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6386 (Target_sparc::Scan::global): Use it.
6387 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6388 (Target_sparc::Relocate::relocate): Likewise.
6389 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6390 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6391 (Target_x86_64::Scan::global): Likewise.
6392 (Target_x86_64::Relocate::relocate): Likewise.
6394 2010-11-08 Doug Kwan <dougkwan@google.com>
6395 Cary Coutant <ccoutant@google.com>
6397 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6398 (Arm_exidx_merge_section::section_contents_): New data member.
6399 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6400 (Arm_input_section::~Arm_input_section): De-allocate memory.
6401 (Arm_input_section::original_contents_): New data member.
6402 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6403 in parameters instead of calling Object::section_contents without
6405 (Arm_output_section::group_section): New parameter TASK. Pass it
6406 to callees that need locking objects.
6407 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6408 to lock EXIDX input sections. Fix a formatting issue. Call
6409 Arm_exidx_merged_section::build_contents to create merged section
6411 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6412 to lock object of stub table owner.
6413 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6414 TEXT_SIZE to initialize data member TEXT_SIZE_.
6415 (Arm_exidx_input_section::addralign): Fix typo in comment.
6416 (Arm_exidx_input_section::text_size): New method.
6417 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6418 that require locking objects. Lock objects before scanning for stubs
6419 and updating local symbols.
6420 (Arm_input_section<big_endian>::init): Copy contents of original
6422 (Arm_input_section<big_endian>::do_write): Use saved contents of
6423 original input section instead of calling Object::section_contents
6425 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6426 size without calling Object::section_size().
6427 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6428 for size. Allocate a buffer for merged EXIDX entries.
6429 (Arm_exidx_merged_section::build_contents): New method.
6430 (Arm_exidx_merged_section::do_write): Move merge section contents
6431 building code to Arm_exidx_merged_section::build_contetns. Write
6432 out contetns in buffer instead of building it on the fly.
6433 (Arm_relobj::make_exidx_input_section): Also pass text section size
6434 to Arm_exidx_input_section constructor.
6435 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6436 (Arm_dynobj::do_read_symbols): Fix memory leak.
6437 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6438 * target.h: (class Task): Add forward declaration.
6439 (Target::relax): Add new parameter TASK and pass it to
6441 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6443 2010-11-05 Cary Coutant <ccoutant@google.com>
6446 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6447 object when reading from the file.
6448 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6450 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6451 when reading section contents.
6452 (get_section_contents): Likewise.
6453 (icf::find_identical_sections): Likewise.
6454 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6455 object when reading from the file.
6456 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6457 the object when doing deferred section layout.
6459 2010-11-03 Nick Clifton <nickc@redhat.com>
6462 * script.h (class Symbol_assignment: name): New member. Returns
6463 the name of the symbol.
6464 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6465 Returns true if the given symbol name is on the list of
6466 assignments wating to be processed.
6467 * archive.cc (should_incldue_member): If the symbol is undefined,
6468 check to see if it is on the list of symbols pending assignment.
6470 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6472 * script-sections.cc (Script_sections::find_memory_region): Check
6473 for a NULL output section pointer.
6475 2010-10-29 Doug Kwan <dougkwan@google.com>
6477 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6478 Output_section::add_relaxed_input_section.
6479 * output.cc (Output_section::add_relaxed_input_section): Add new
6480 arguments LAYOUT and NAME. Set section order index.
6481 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6482 Copy section order index.
6483 * output.h (Output_section::add_relaxed_input_section): Add new
6484 arguments LAYOUT and NAME.
6486 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6488 * testsuite/Makefile.am: Move gcctestdir/ld rule to
6489 NATIVE_OR_CROSS_LINKER.
6490 * testsuite/Makefile.in: Regenerate.
6492 2010-10-20 Doug Kwan <dougkwan@google.com>
6494 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6495 without SHF_LINK_ORDER flags.
6496 * layout.cc (Layout::choose_output_section): Do not filter
6497 SHF_LINK_ORDER flag in a relocatable link.
6499 2010-10-17 Cary Coutant <ccoutant@google.com>
6501 * output.h (Output_segment::set_section_addresses): Change function
6502 signature. Update all callers.
6503 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6505 (Output_segment::set_section_addresses): Align after last TLS
6506 section. Add padding before last relro section instead of after.
6508 2010-10-17 Doug Kwan <dougkwan@google.com>
6510 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6511 GOT output section to be writable.
6513 2010-10-14 Cary Coutant <ccoutant@google.com>
6515 * debug.h (DEBUG_INCREMENTAL): New flag.
6516 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6517 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6519 * incremental.cc (report_command_line): Ignore all forms of
6521 * layout.cc (Layout::Layout): Check parameters for incremental link
6523 * options.cc (General_options::parse_incremental): New function.
6524 (General_options::parse_no_incremental): New function.
6525 (General_options::parse_incremental_full): New function.
6526 (General_options::parse_incremental_update): New function.
6527 (General_options::incremental_mode_): New data member.
6528 (General_options::finalize): Check incremental_mode_.
6529 * options.h (General_options): Update help text for --incremental.
6530 Add --no-incremental, --incremental-full, --incremental-update.
6531 (General_options::Incremental_mode): New enum type.
6532 (General_options::incremental_mode): New function.
6533 (General_options::incremental_mode_): New data member.
6534 * parameters.cc (Parameters::incremental_mode_): New data member.
6535 (Parameters::set_options): Set incremental_mode_.
6536 (Parameters::set_incremental_full): New function.
6537 (Parameters::incremental): New function.
6538 (Parameters::incremental_update): New function.
6539 (set_parameters_incremental_full): New function.
6540 * parameters.h (Parameters::set_incremental_full): New function.
6541 (Parameters::incremental): New function.
6542 (Parameters::incremental_update): New function.
6543 (Parameters::incremental_mode_): New data member.
6544 (set_parameters_incremental_full): New function.
6545 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6546 incremental link mode.
6547 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6548 (Sized_relobj::do_relocate_sections): Likewise.
6549 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6551 * testsuite/Makefile.in: Regenerate.
6552 * testsuite/incremental_test.sh: Filter all forms of --incremental.
6554 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6556 * script-sections.h (class Script_sections): Make
6557 Sections_elements typedef public.
6558 * script-sections.cc (class Sort_output_sections): Add elements_
6559 field. Add constructor which sets it; change all callers.
6560 (Sort_output_sections::is_before): New function.
6561 (Sort_output_sections::operator()): Call is_before.
6562 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6564 * testsuite/script_test_10.sh: New test. Test script section
6566 * testsuite/script_test_10.t: Likewise.
6567 * testsuite/script_test_10.s: Likewise.
6568 * testsuite/Makefile.am: Wrap the cross linker tests and the
6569 common tests into NATIVE_OR_CROSS_LINKER.
6570 (check_SCRIPTS): Add script_test_10.sh.
6571 (check_DATA): Add script_test_10.stdout.
6572 (script_test_10.o, script_test_10): New targets.
6573 (script_test_10.stdout): New target.
6574 * configure, testsuite/Makefile.in: Regenerate.
6576 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6578 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6579 error for the deprecated relocations.
6580 (Target_arm::Scan::global): Likewise.
6581 (Target_arm::Relocate::relocate): Likewise.
6583 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6585 * fileread.cc (Input_file::find_file): Initialize *found_name
6586 and *namep when using the fallback search for case 4.
6588 2010-10-11 Cary Coutant <ccoutant@google.com>
6590 * options.h (class General_options): Redefine -z lazy as an alias for
6591 the negation of -z now.
6593 2010-10-11 Ian Lance Taylor <iant@google.com>
6595 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6598 2010-10-06 Nick Clifton <nickc@redhat.com>
6600 * script-sections.cc(class Memory_region): Remove
6601 current_lma_offset_ field. Rename current_vma_offset_ to
6602 current_offset_. Add last_section_ field.
6603 (Memory_region::get_current_vma_address): Rename to
6604 get_current_address.
6605 (Memory_region::get_current_lma_address): Delete.
6606 (Memory_region::increment_vma_offset): Rename to
6608 (Memory_region::increment_lma_offset): Delete.
6609 (Memory_region::attributes_compatible): New method. Returns
6610 true if the provided section is compatible with the region.
6611 (Memory_region::get_last_section): New method. Returns the last
6612 section to use the region.
6613 (Memory_region::set_last_section): New method. Stores the last
6614 section to use the region.
6615 (Script_sections::block_in_region): New method. Returns true if
6616 a block of memory is contained within a region.
6617 (Script_sections::find_memory_region): New method. Locates a
6618 memory region to be used to set a VMA or LMA address.
6619 (Output_section_definition::set_section_addresses): Add code to
6620 check for addresses set by memory regions.
6621 (Output_segment::set_section_addresses): Remove memory region
6623 (Script_sections::create_segment): Add a warning if a header
6624 segment is created outside of any region.
6625 * script-sections.h (class Script_sections): Add prototypes for
6626 find_memory_region and block_in_region methods.
6627 * testsuite/memory_test.s: Use .long instead of .word.
6628 * testsuite/memory_test.t: Add some more output sections.
6629 * testsuite/memory_test.sh: Update expected output.
6631 2010-10-02 Doug Kwan <dougkwan@google.com>
6633 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6634 defintion to symtab.h
6635 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6636 declaration to defintion.
6638 2010-10-01 Nick Clifton <nickc@redhat.com>
6640 * expression.cc (eval): Replace dummy argument with NULL.
6641 (eval_maybe_dot): Check for a NULL result section pointer.
6642 (Symbol_expression::value): Likewise.
6643 (Dot_expression::value): Likewise.
6644 (BINARY_EXPRESSION): Likewise.
6645 (Max_expression::value): Likewise.
6646 (Min_expression::value): Likewise.
6647 (Absolute_expression::value): Likewise.
6648 (Addr_expression::value_from_output_section): Likewise.
6649 (Loaddddr_expression::value_from_output_section): Likewise.
6650 (Segment_start_expression::value): Likewise.
6651 * script-sections.cc
6652 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6654 (Sections_elememt_dot_assignment::set_section_addresses):
6656 (Output_data_expression::do_write_to_buffer): Likewise.
6657 (Output_section_definition::finalize_symbols): Likewise.
6658 (Output_section_definition::set_section_addresses): Likewise.
6660 2010-09-30 Doug Kwan <dougkwan@google.com>
6662 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6664 2010-09-28 Sriraman Tallam <tmsriram@google.com>
6666 * target.h (Target::can_icf_inline_merge_sections): New virtual
6668 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6670 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6672 * icf.cc (get_section_contents): Inline merge sections only when
6675 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6677 * configure: Regenerate.
6679 2010-09-17 Ian Lance Taylor <iant@google.com>
6681 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
6682 * testsuite/Makefile.am (memory_test.o): New target.
6683 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6685 * testsuite/Makefile.in: Rebuild.
6687 2010-09-17 Doug Kwan <dougkwan@google.com>
6689 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6690 defintion if relocation uses GOT entries of the symbol.
6691 * testsuite/icf_safe_test.sh: Fix test.
6692 * testsuite/icf_safe_so_test.sh: Fix test.
6694 2010-09-16 Cary Coutant <ccoutant@google.com>
6696 * script_sections.cc (class Memory_region): Remove "NULL" from
6697 vector initializations.
6699 2010-09-15 Cary Coutant <ccoutant@google.com>
6701 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6702 Resolve forwarding symbols.
6704 2010-09-15 Doug Kwan <dougkwan@google.com>
6706 * gold/testsuite/script_test_3.t: Add ARM special sections.
6707 * gold/testsuite/script_test_4.t: Same.
6708 * gold/testsuite/script_test_5.t: Same.
6709 * gold/testsuite/script_test_6.t: Same.
6710 * gold/testsuite/script_test_7.t: Same.
6711 * gold/testsuite/script_test_7.t: Same.
6712 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6714 2010-09-14 Cary Coutant <ccoutant@google.com>
6716 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6717 (Target_x86_64::Relocate::relocate_tls): Replace check for
6718 saw_tls_block_reloc_ with test for executable section.
6720 2010-09-12 Cary Coutant <ccoutant@google.com>
6722 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6723 position-independent executables to shared libraries need dynamic
6725 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6726 position-independent executables.
6727 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6728 * testsuite/Makefile.in: Regenerate.
6730 2010-09-10 Nick Clifton <nickc@redhat.com>
6733 * testsuite/memory_test.t: Discard any sections that are not
6736 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6739 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6740 "This::" to work around a bug in gcc 4.2.
6742 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6744 2010-09-09 Rafael Espindola <espindola@google.com>
6746 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6747 sections with different PF_X flags in the same segment.
6748 (Layout::find_first_load_seg): Search all segments to find the first
6750 * options.h (rosegment): New.
6752 2010-09-08 Rafael Espindola <espindola@google.com>
6754 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
6756 2010-09-08 Doug Kwan <dougkwan@google.com>
6758 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6759 (Arm_relobj::do_relocate_sections): Add new parameter for output
6760 file to match the parent.
6761 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6762 of local symbols instead of input values. Update code to track
6763 changes in gold::relocate_section.
6764 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6765 (Sized_relobj::compute_final_local_value_internal): New methods.
6766 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6767 body into private version of Sized_relobj::compute_final_local_value.
6768 Call the inline method.
6769 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6770 merged symbol value if there is one.
6771 (Symbol_value::has_output_value): New method defintiion.
6772 (Sized_relobj::Compute_final_local_value_status): New enum type.
6773 (Sized_relobj::compute_final_local_value): New methods.
6774 (Sized_relobj::compute_final_local_value_internal): New methods.
6775 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6776 and arm_cortex_a8.sh.
6777 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6778 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6780 * Makefile.in: Regenerate.
6781 * testsuite/arm_bl_out_of_range.s: Update test.
6782 * testsuite/thumb_bl_out_of_range.s: Ditto.
6783 * testsuite/thumb_blx_out_of_range.s: Ditto.
6784 * testsuite/arm_branch_out_of_range.sh: New file.
6785 * testsuite/arm_cortex_a8.sh: Ditto.
6786 * testsuite/arm_cortex_a8_b.s: Ditto.
6787 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6788 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6789 * testsuite/arm_cortex_a8_bl.s: Ditto.
6790 * testsuite/arm_cortex_a8_blx.s: Ditto.
6791 * testsuite/arm_cortex_a8_local.s: Ditto.
6792 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6793 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6795 2010-09-08 Rafael Espindola <espindola@google.com>
6797 * Makefile.am (memory_test.stdout): Run readelf with -W.
6798 * Makefile.in: Regenerate.
6799 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6802 2010-09-08 Rafael Espindola <espindola@google.com>
6804 * script-sections.cc (Script_sections::add_memory_region): Convert
6805 field precision to int.
6806 * script.cc (script_set_section_region, script_set_section_region):
6807 Convert field precision to int.
6809 2010-09-08 Rafael Espindola <espindola@google.com>
6811 * arm.cc (do_finalize_sections): Create the __exidx_start and
6812 __exdix_end symbols even when the section is missing.
6814 2010-09-08 Nick Clifton <nickc@redhat.com>
6816 * README: Remove claim that MEMORY is not supported.
6817 * expression.cc (script_exp_function_origin)
6818 (script_exp_function_length): Move from here to ...
6819 * script.cc: ... here.
6820 (script_set_section_region, script_add_memory)
6821 (script_parse_memory_attr, script_include_directive): New
6823 * script-sections.cc
6824 (class Memory_region): New class.
6825 (class Output_section_definition): Add set_memory_region,
6826 set_section_vma, set_section_lma and get_section_name methods.
6827 (class Script_Sections): Add add_memory_region,
6828 find_memory_region, find_memory_region_origin,
6829 find_memory_region_length and set_memory_region methods.
6830 Have set_section_addresses method walk the list of set memory
6832 Extend the print methos to display memory regions.
6833 * script-sections.h: Add prototypes for new methods.
6834 Add enum for MEMORY region attributes.
6835 * yyscript.y: Add support for parsing MEMORY regions.
6836 * script-c.h: Add prototypes for new functions.
6837 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6838 * testsuite/Makefile.in: Regenerate.
6839 * testsuite/memory_test.sh: New script.
6840 * testsuite/memory_test.s: New assembler source file.
6841 * testsuite/memory_test.t: New linker script.
6843 2010-08-27 Doug Kwan <dougkwan@google.com>
6845 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6846 reference override an existing dynamic weak reference.
6847 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6848 * testsuite/Makefile.in: Regenerate.
6849 * testsuite/dyn_weak_ref.sh: New file.
6850 * testsuite/dyn_weak_ref_1.c: Ditto.
6851 * testsuite/dyn_weak_ref_2.c: Ditto.
6853 2010-08-27 Ian Lance Taylor <iant@google.com>
6855 * incremental.h (class Incremental_input_entry): Add virtual
6858 2010-08-27 Ian Lance Taylor <iant@google.com>
6860 * testsuite/start_lib_test_3.c: Mark t3 as used.
6862 2010-08-27 Nick Clifton <nickc@redhat.com>
6864 * options.cc (version_script): Fix small typo in previous
6867 2010-08-25 Nick Clifton <nickc@redhat.com>
6869 * archive.cc: Formatting fixes: Remove whitespace between
6870 typename and following asterisk. Remove whitespace between
6871 function name and opening parenthesis.
6872 * archive.h: Likewise.
6874 * attributes.cc: Likewise.
6875 * attributes.h: Likewise.
6876 * common.cc: Likewise.
6877 * copy-relocs.cc: Likewise.
6878 * dirsearch.h: Likewise.
6879 * dynobj.cc: Likewise.
6880 * ehframe.cc: Likewise.
6881 * ehframe.h: Likewise.
6882 * expression.cc: Likewise.
6883 * fileread.cc: Likewise.
6884 * fileread.h: Likewise.
6886 * gold-threads.cc: Likewise.
6887 * gold.cc: Likewise.
6888 * i386.cc: Likewise.
6890 * incremental-dump.cc: Likewise.
6891 * incremental.cc: Likewise.
6892 * layout.cc: Likewise.
6893 * layout.h: Likewise.
6894 * main.cc: Likewise.
6895 * merge.cc: Likewise.
6896 * merge.h: Likewise.
6897 * object.cc: Likewise.
6898 * object.h: Likewise.
6899 * options.cc: Likewise.
6900 * options.h: Likewise.
6901 * output.cc: Likewise.
6902 * output.h: Likewise.
6903 * plugin.cc: Likewise.
6904 * plugin.h: Likewise.
6905 * powerpc.cc: Likewise.
6906 * reloc.cc: Likewise.
6907 * script-c.h: Likewise.
6908 * script-sections.cc: Likewise.
6909 * script.cc: Likewise.
6910 * stringpool.cc: Likewise.
6911 * symtab.cc: Likewise.
6912 * symtab.h: Likewise.
6913 * target.cc: Likewise.
6914 * timer.cc: Likewise.
6915 * timer.h: Likewise.
6916 * version.cc: Likewise.
6917 * x86_64.cc: Likewise.
6919 2010-08-24 Nick Clifton <nickc@redhat.com>
6922 * layout.cc (segment_precedes): Sort segments by their physical
6923 addresses, if they have been set.
6925 2010-08-23 Cary Coutant <ccoutant@google.com>
6927 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6929 (Lib_group::include_member): Unlock object after deleting its
6931 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6934 2010-08-19 Neil Vachharajani <nvachhar@google.com>
6935 Cary Coutant <ccoutant@google.com>
6937 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6938 constructor, and set_blocker.
6939 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6941 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6942 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6943 * testsuite/Makefile.am (start_lib_test): New test case.
6944 * testsuite/Makefile.in: Regenerate.
6945 * testsuite/start_lib_test_main.c: New file.
6946 * testsuite/start_lib_test_1.c: New file.
6947 * testsuite/start_lib_test_2.c: New file.
6948 * testsuite/start_lib_test_3.c: New file.
6950 2010-08-19 Ian Lance Taylor <iant@google.com>
6952 * Makefile.in: Rebuild with automake 1.11.1.
6953 * aclocal.m4: Likewise.
6954 * testsuite/Makefile.in: Likewise.
6956 2010-08-19 Ian Lance Taylor <iant@google.com>
6959 * i386.cc (class Output_data_plt_i386): Update declarations.
6960 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6961 local_ifuncs_ fields.
6962 (Target_i386::do_plt_section_for_global): New function.
6963 (Target_i386::do_plt_section_for_local): New function.
6964 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6965 parameter; change all callers. Initialize global_ifuncs_ and
6966 local_ifuncs_. If doing a static link define __rel_iplt_start and
6968 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6969 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6970 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6972 (Target_i386::make_plt_section): New function, broken out of
6973 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6974 (Target_i386::make_plt_entry): Call make_plt_section.
6975 (Target_i386::make_local_ifunc_plt_entry): New function.
6976 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6977 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6978 R_386_IRELATIVE to switch.
6979 (Target_i386::Scan::global): Likewise.
6980 (Target_i386::Relocate::relocate): Likewise.
6981 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6983 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6984 (Target_x86_64::do_plt_section_for_global): New function.
6985 (Target_x86_64::do_plt_section_for_local): New function.
6986 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6987 parameter; change all callers. If doing a static link define
6988 __rela_iplt_start and __rela_iplt_end.
6989 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6990 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6991 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6993 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6994 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6996 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6997 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6998 R_X86_64_IRELATIVE to switch.
6999 (Target_x86_64::Scan::global): Likewise.
7000 (Target_x86_64::Relocate::relocate): Likewise.
7001 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7003 * target.h (class Target): Add plt_section_for_global and
7004 plt_section_for_local functions. Add do_plt_section_for_global
7005 and do_plt_section_for_local virtual functions.
7006 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7007 clarifying comments.
7008 (Symbol::use_plt_offset): Handle IFUNC symbol.
7009 * object.cc (Sized_relobj::Sized_relobj): Initialize
7011 (Sized_relobj::local_has_plt_offset): New function.
7012 (Sized_relobj::local_plt_offset): New function.
7013 (Sized_relobj::set_local_plt_offset): New function.
7014 (Sized_relobj::do_count): Handle IFUNC symbol.
7015 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7016 a bit away from input_shndx_ field. Add set_is_func_symbol and
7017 is_ifunc_symbol functions.
7018 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7019 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7020 local_plt_offsets_ field.
7021 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7022 * output.h (class Output_section_data): Add non-const
7023 output_section function.
7024 (class Output_data_got): Update declarations.
7025 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7026 Add use_plt_offset parameter to global and local constructors.
7027 Change all callers. Change local_sym_index_ field to 31 bits.
7028 Change GSYM_CODE and CONSTANT_CODE accordingly.
7029 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7030 doing a static link don't set sh_link field.
7031 (Output_data_got::Got_entry::write): Use PLT offset if
7033 (Output_data_got::add_global_plt): New function.
7034 (Output_data_got::add_local_plt): New function.
7035 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7036 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7037 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7038 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7039 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7041 * testsuite/ifunc-sel.h: New file.
7042 * testsuite/ifuncmain1.c: New file.
7043 * testsuite/ifuncmain1vis.c: New file.
7044 * testsuite/ifuncmod1.c: New file.
7045 * testsuite/ifuncdep2.c: New file.
7046 * testsuite/ifuncmain2.c: New file.
7047 * testsuite/ifuncmain3.c: New file.
7048 * testsuite/ifuncmod3.c: New file.
7049 * testsuite/ifuncmain4.c: New file.
7050 * testsuite/ifuncmain5.c: New file.
7051 * testsuite/ifuncmod5.c: New file.
7052 * testsuite/ifuncmain6pie.c: New file.
7053 * testsuite/ifuncmod6.c: New file.
7054 * testsuite/ifuncmain7.c: New file.
7055 * configure, testsuite/Makefile.in: Rebuild.
7057 2010-08-18 Ian Lance Taylor <iant@google.com>
7060 (Output_section_incremental_inputs::write_input_files): Add cast
7061 to avoid signed/unsigned comparison warning.
7062 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7064 2010-08-12 Cary Coutant <ccoutant@google.com>
7066 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7068 2010-08-13 Ian Lance Taylor <iant@google.com>
7070 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7072 2010-08-12 Cary Coutant <ccoutant@google.com>
7073 Doug Kwan <dougkwan@google.com>
7075 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7076 defintion overrides non-weak undef, remember that the original undef
7078 * symtab.cc (Symbol_table::sized_write_global): For undef without
7079 an original weak binding, set binding to global in output.
7080 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7081 * testsuite/Makefile.in: Regenerate.
7082 * testsuite/strong_ref_weak_def.sh: New file.
7083 * testsuite/strong_ref_weak_def_1.c: Ditto.
7084 * testsuite/strong_ref_weak_def_2.c: Ditto.
7086 2010-08-12 Cary Coutant <ccoutant@google.com>
7088 * testsuite/incremental_test.sh: Rewrite.
7089 * testsuite/incremental_test_1.c: Rewrite.
7090 * testsuite/incremental_test_2.c: Rewrite.
7092 2010-08-12 Cary Coutant <ccoutant@google.com>
7094 * arm.cc (Target_arm::got_size): Add const.
7095 (Target_arm::got_entry_count): New function.
7096 (Target_arm::plt_entry_count): New function.
7097 (Target_arm::first_plt_entry_offset): New function.
7098 (Target_arm::plt_entry_size): New function.
7099 (Output_data_plt_arm::entry_count): New function.
7100 (Output_data_plt_arm::first_plt_entry_offset): New function.
7101 (Output_data_plt_arm::get_plt_entry_size): New function.
7102 * i386.cc (Target_i386::got_size): Add const.
7103 (Target_i386::got_entry_count): New function.
7104 (Target_i386::plt_entry_count): New function.
7105 (Target_i386::first_plt_entry_offset): New function.
7106 (Target_i386::plt_entry_size): New function.
7107 (Output_data_plt_i386::entry_count): New function.
7108 (Output_data_plt_i386::first_plt_entry_offset): New function.
7109 (Output_data_plt_i386::get_plt_entry_size): New function.
7110 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7111 find_incremental_inputs_sections. Dump incremental_got_plt section.
7112 * incremental.cc: Include target.h.
7113 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7114 parameter. Adjust all callers. Find incremental_got_plt section.
7115 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7117 (Output_section_incremental_inputs::set_final_data_size): Calculate
7118 size of incremental_got_plt section.
7119 (Output_section_incremental_inputs::do_write): Write the
7120 incremental_got_plt section.
7121 (Got_plt_view_info): New struct.
7122 (Local_got_offset_visitor): New class.
7123 (Global_got_offset_visitor): New class.
7124 (Global_symbol_visitor_got_plt): New class.
7125 (Output_section_incremental_inputs::write_got_plt): New function.
7126 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7127 Add parameter. Adjust all callers.
7128 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7129 (Incremental_inputs::got_plt_section): New function.
7130 (Incremental_inputs::got_plt_section_): New data member.
7131 (Incremental_got_plt_reader): New class.
7132 * layout.cc (Layout::create_incremental_info_sections): Add the
7133 incremental_got_plt section.
7134 * object.h (Got_offset_list::get_list): New function.
7135 (Got offset_list::for_all_got_offsets): New function.
7136 (Sized_relobj::local_got_offset_list): New function.
7137 * powerpc.cc (Target_powerpc::got_size): Add const.
7138 (Target_powerpc::got_entry_count): New function.
7139 (Target_powerpc::plt_entry_count): New function.
7140 (Target_powerpc::first_plt_entry_offset): New function.
7141 (Target_powerpc::plt_entry_size): New function.
7142 (Output_data_plt_powerpc::entry_count): New function.
7143 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7144 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7145 * sparc.cc (Target_sparc::got_size): Add const.
7146 (Target_sparc::got_entry_count): New function.
7147 (Target_sparc::plt_entry_count): New function.
7148 (Target_sparc::first_plt_entry_offset): New function.
7149 (Target_sparc::plt_entry_size): New function.
7150 (Output_data_plt_sparc::entry_count): New function.
7151 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7152 (Output_data_plt_sparc::get_plt_entry_size): New function.
7153 * symtab.h (Symbol::got_offset_list): New function.
7154 (Symbol_table::for_all_symbols): New function.
7155 * target.h (Sized_target::got_entry_count): New function.
7156 (Sized_target::plt_entry_count): New function.
7157 (Sized_target::plt_entry_size): New function.
7158 * x86_64.cc (Target_x86_64::got_size): Add const.
7159 (Target_x86_64::got_entry_count): New function.
7160 (Target_x86_64::plt_entry_count): New function.
7161 (Target_x86_64::first_plt_entry_offset): New function.
7162 (Target_x86_64::plt_entry_size): New function.
7163 (Output_data_plt_x86_64::entry_count): New function.
7164 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7165 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7167 2010-08-12 Cary Coutant <ccoutant@google.com>
7169 * archive.cc: Include incremental.h.
7170 (Archive::Archive): Initialize incremental_info_.
7171 (Archive::include_member): Record archive members in incremental info.
7172 (Add_archive_symbols::run): Record begin and end of an archive in
7174 (Lib_group::include_member): Record objects in incremental info.
7175 * archive.h (Incremental_archive_entry): Forward declaration.
7176 (Archive::set_incremental_info): New member function.
7177 (Archive::incremental_info): New member function.
7178 (Archive::Unused_symbol_iterator): New class.
7179 (Archive::unused_symbols_begin): New member function.
7180 (Archive::unused_symbols_end): New member function.
7181 (Archive::incremental_info_): New data member.
7182 * incremental-dump.cc (find_input_containing_global): New function.
7183 (dump_incremental_inputs): Dump new incremental info sections.
7184 * incremental.cc: Include symtab.h.
7185 (Output_section_incremental_inputs): New class.
7186 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7187 new incremental info sections.
7188 (Sized_incremental_binary::do_check_inputs): Likewise.
7189 (Incremental_inputs::report_archive): Remove.
7190 (Incremental_inputs::report_archive_begin): New function.
7191 (Incremental_inputs::report_archive_end): New function.
7192 (Incremental_inputs::report_object): New function.
7193 (Incremental_inputs::finalize_inputs): Remove.
7194 (Incremental_inputs::report_input_section): New function.
7195 (Incremental_inputs::report_script): Rewrite.
7196 (Incremental_inputs::finalize): Do nothing but finalize string table.
7197 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7198 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7199 (Incremental_inputs::create_data_sections): New function.
7200 (Incremental_inputs::relocs_entsize): New function.
7201 (Output_section_incremental_inputs::set_final_data_size): New function.
7202 (Output_section_incremental_inputs::do_write): New function.
7203 (Output_section_incremental_inputs::write_header): New function.
7204 (Output_section_incremental_inputs::write_input_files): New function.
7205 (Output_section_incremental_inputs::write_info_blocks): New function.
7206 (Output_section_incremental_inputs::write_symtab): New function.
7207 * incremental.h (Incremental_script_entry): Forward declaration.
7208 (Incremental_object_entry): Forward declaration.
7209 (Incremental_archive_entry): Forward declaration.
7210 (Incremental_inputs): Forward declaration.
7211 (Incremental_inputs_header_data): Remove.
7212 (Incremental_inputs_header): Remove.
7213 (Incremental_inputs_header_write): Remove.
7214 (Incremental_inputs_entry_data): Remove.
7215 (Incremental_inputs_entry): Remove.
7216 (Incremental_inputs_entry_write): Remove.
7217 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7218 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7219 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7220 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7222 (Incremental_input_entry): New class.
7223 (Incremental_script_entry): New class.
7224 (Incremental_object_entry): New class.
7225 (Incremental_archive_entry): New class.
7226 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7227 (Incremental_inputs::report_inputs): Remove.
7228 (Incremental_inputs::report_archive): Remove.
7229 (Incremental_inputs::report_archive_begin): New function.
7230 (Incremental_inputs::report_archive_end): New function.
7231 (Incremental_inputs::report_object): Change prototype.
7232 (Incremental_inputs::report_input_section): New function.
7233 (Incremental_inputs::report_script): Change prototype.
7234 (Incremental_inputs::get_reloc_count): New function.
7235 (Incremental_inputs::set_reloc_count): New function.
7236 (Incremental_inputs::create_data_sections): New function.
7237 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7238 (Incremental_inputs::inputs_section): New function.
7239 (Incremental_inputs::symtab_section): New function.
7240 (Incremental_inputs::relocs_section): New function.
7241 (Incremental_inputs::get_stringpool): Add const.
7242 (Incremental_inputs::command_line): Add const.
7243 (Incremental_inputs::inputs): Remove.
7244 (Incremental_inputs::command_line_key): New function.
7245 (Incremental_inputs::input_file_count): New function.
7246 (Incremental_inputs::input_files): New function.
7247 (Incremental_inputs::relocs_entsize): New function.
7248 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7249 (Incremental_inputs::finalize_inputs): Remove.
7250 (Incremental_inputs::Input_info): Remove.
7251 (Incremental_inputs::lock_): Remove.
7252 (Incremental_inputs::inputs_): Change type.
7253 (Incremental_inputs::inputs_map_): Remove.
7254 (Incremental_inputs::current_object_entry_): New data member.
7255 (Incremental_inputs::inputs_section_): New data member.
7256 (Incremental_inputs::symtab_section_): New data member.
7257 (Incremental_inputs::relocs_section_): New data member.
7258 (Incremental_inputs::reloc_count_): New data member.
7259 (Incremental_inputs_reader): New class.
7260 (Incremental_symtab_reader): New class.
7261 (Incremental_relocs_reader): New class.
7262 * layout.cc (Layout::finalize): Move finalization of incremental info
7263 and creation of incremental info sections to follow finalization of
7264 symbol table. Set offsets for postprocessing sections.
7265 (Layout::create_incremental_info_sections): Call
7266 Incremental_inputs::create_data_sections. Add incremental symtab
7267 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7268 sections to layout after input sections.
7269 * layout.h (struct Timespec): Forward declaration.
7270 (Layout::incremental_inputs): Add const.
7271 (Layout::create_incremental_info_sections): Add parameter.
7272 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7273 * object.cc: Include incremental.h.
7274 (Relobj::finalize_incremental_relocs): New function.
7275 (Sized_relobj::do_layout): Record input sections in incremental info.
7276 * object.h (Object::output_section): New function.
7277 (Object::output_section_offset): Moved from Relobj.
7278 (Object::get_incremental_reloc_base): New function.
7279 (Object::get_incremental_reloc_count): New function.
7280 (Object::do_output_section): New function.
7281 (Object::do_output_section_offset): Moved from Relobj.
7282 (Object::do_get_incremental_reloc_base): New function.
7283 (Object::do_get_incremental_reloc_count): New function.
7284 (Object::Object): Initialize new data members.
7285 (Relobj::output_section): Renamed do_output_section and moved to
7287 (Relobj::output_section_offset): Moved to Object.
7288 (Relobj::do_get_incremental_reloc_base): New function.
7289 (Relobj::do_get_incremental_reloc_count): New function.
7290 (Relobj::allocate_incremental_reloc_counts): New function.
7291 (Relobj::count_incremental_reloc): New function.
7292 (Relobj::finalize_incremental_relocs): New function.
7293 (Relobj::next_incremental_reloc_index): New function.
7294 (Relobj::reloc_counts_): New data member.
7295 (Relobj::reloc_bases_): New data member.
7296 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7297 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7298 (Sized_relobj::incremental_relocs_scan): New function.
7299 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7300 (Sized_relobj::incremental_relocs_write): New function.
7301 (Sized_relobj::incremental_relocs_write_reltype): New function.
7302 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7304 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7305 archives and object files elsewhere.
7306 (Add_symbols::run): Report object files here.
7307 (Finish_group::run): Report end of archive at end of group.
7308 * reloc.cc: Include layout.h, incremental.h.
7309 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7310 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7311 (Sized_relobj::incremental_relocs_scan): New function.
7312 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7313 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7314 (Sized_relobj::incremental_relocs_write): New function.
7315 (Sized_relobj::incremental_relocs_write_reltype): New function.
7316 * script.cc (read_input_script): Rewrite test for incremental link.
7317 Change call to Incremental_inputs::report_script.
7318 * symtab.h (Symbol_table::first_global_index): New function.
7319 (Symbol_table::output_count): New function.
7321 2010-08-12 Doug Kwan <dougkwan@google.com>
7323 * arm.cc (Target_arm::merge_object_attributes): Check command line
7324 options --no-wchar-size-warning and --no-enum-size-warning.
7325 * options.h (General_options): Add ld-compatible options
7326 --no-enum-size-warning and --no-wchar-size-warning.
7328 2010-08-04 Ian Lance Taylor <iant@google.com>
7330 * x86_64.cc (Target_x86_64::Scan::local): Use
7331 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7332 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7333 (Target_x86_64::Scan::global): Likewise.
7334 (Target_x86_64::Relocate::relocate): Likewise.
7335 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7338 2010-08-03 Cary Coutant <ccoutant@google.com>
7340 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7341 to reserve space in merged_strings vector. Keep total input size
7343 (Output_merge_string::do_print_merge_stats): Print total input size.
7344 * merge.h (Output_merge_string): Add input_size_ field.
7345 * stringpool.cc (Stringpool_template::string_length): Move
7346 implementations out of Stringpool_template class and place in
7348 * stringpool.h (string_length): Move out of Stringpool_template.
7350 2010-08-03 Ian Lance Taylor <iant@google.com>
7353 * layout.cc (relaxation_loop_body): If address of load segment is
7354 set, adjust address to include headers if possible.
7356 2010-08-03 Ian Lance Taylor <iant@google.com>
7358 * version.cc (version_string): Bump to 1.10.
7360 2010-08-03 Ian Lance Taylor <iant@google.com>
7363 * layout.h (enum Output_section_order): Define.
7364 (class Layout): Update declarations.
7365 * layout.cc (Layout::get_output_section): Add order parameter.
7366 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7367 is_first_non_relro parameters. Change all callers.
7368 (Layout::choose_output_section): Likewise.
7369 (Layout::add_output_section_data): Likewise.
7370 (Layout::make_output_section): Likewise. Set order.
7371 (Layout::default_section_order): New function.
7372 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7373 * output.cc (Output_section::Output_section): Initialize order_.
7374 Don't initialize deleted fields.
7375 (Output_segment::Output_segment): Don't initialize deleted
7377 (Output_segment::add_output_section_to_load): New function
7378 replacing add_output_section. Change all callers to call this or
7379 add_output_section_to_nonload.
7380 (Output_segment::add_output_section_to_nonload): New function.
7381 (Output_segment::remove_output_section): Rewrite.
7382 (Output_segment::add_initial_output_data): Likewise.
7383 (Output_segment::has_any_data_sections): Likewise.
7384 (Output_segment::is_first_section_relro): Likewise.
7385 (Output_segment::maximum_alignment): Likewise.
7386 (Output_segment::has_dynamic_reloc): New function replacing
7387 dynamic_reloc_count. Change all callers.
7388 (Output_segment::has_dynamic_reloc_list): New function replacing
7389 dynamic_reloc_count_list. Change all callers.
7390 (Output_segment::set_section_addresses): Rewrite.
7391 (Output_segment::set_offset): Rewrite.
7392 (Output_segment::find_first_and_last_list): Remove.
7393 (Output_segment::set_tls_offsets): Rewrite.
7394 (Output_segment::first_section_load_address): Likewise.
7395 (Output_segment::output_section_count): Likewise.
7396 (Output_segment::section_with_lowest_load_address): Likewise.
7397 (Output_segment::write_section_headers): Likewise.
7398 (Output_segment::print_sections_to_map): Likewise.
7399 * output.h (class Output_data): Remove dynamic_reloc_count_
7400 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7401 (Output_data::add_dynamic_reloc): Rewrite.
7402 (Output_data::has_dynamic_reloc): New function.
7403 (Output_data::dynamic_reloc_count): Remove.
7404 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7405 is_last_relro_, is_first_non_relro_, is_interp_,
7406 is_dynamic_linker_section_ fields. Add order and set_order
7407 functions. Remove is_relro_local, set_is_relro_local,
7408 is_last_relro, set_is_last_relro, is_first_non_relro,
7409 set_is_first_non_relro functions, is_interp, set_is_interp,
7410 is_dynamic_linker_section, and set_is_dynamic_linker_section
7412 (class Output_segment): Change Output_data_list from std::list to
7413 std:;vector. Add output_lists_ field. Remove output_data_ and
7414 output_bss_ fields. Update declarations.
7416 2010-08-02 Ian Lance Taylor <iant@google.com>
7418 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7419 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7420 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7422 2010-08-02 Ian Lance Taylor <iant@google.com>
7425 * script.cc (Script_options::Script_options): Initialize
7426 symbol_definitions_ and symbol_references_.
7427 (Script_options::add_symbol_assignment): Update
7428 symbol_definitions_ and symbol_references_.
7429 (Script_options::add_symbol_reference): New function.
7430 (script_symbol): New function.
7431 * script.h (class Script_options): Add symbol_definitions_ and
7432 symbol_references_ fields.
7433 (Script_options::referenced_const_iterator): New type.
7434 (Script_options::referenced_begin): New function.
7435 (Script_options::referenced_end): New function.
7436 (Script_options::is_referenced): New function.
7437 (Script_options::any_unreferenced): New function.
7438 * script-c.h (script_symbol): Declare.
7439 * yyscript.y (exp): Call script_symbol.
7440 * symtab.cc: Include "script.h".
7441 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7442 Change all callers. Check symbols referenced by scripts.
7443 (Symbol_table::add_undefined_symbols_from_command_line): Add
7444 layout parameter. Change all callers.
7445 (Symbol_table::do_add_undefined_symbols_from_command_line):
7446 Likewise. Break out loop body. Check symbols referenced by
7448 (Symbol_table::add_undefined_symbol_from_command_line): New
7449 function broken out of
7450 do_add_undefined_symbols_from_command_line.
7451 * symtab.h (class Symbol_table): Update declarations.
7452 * archive.cc: Include "layout.h".
7453 (Archive::should_include_member): Add layout parameter. Change
7454 all callers. Check for symbol mentioned in expression.
7455 * archive.h (class Archive): Update declaration.
7456 * object.cc (Sized_relobj::do_should_include_member): Add layout
7458 * object.h (Object::should_include_member): Add layout parameter.
7460 (Object::do_should_include_member): Add layout parameter.
7461 (class Sized_relobj): Update declaration.
7462 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7464 * dynobj.h (class Sized_dynobj): Update declaration.
7465 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7467 * plugin.h (class Sized_pluginobj): Update declaration.
7469 2010-08-02 Ian Lance Taylor <iant@google.com>
7472 * output.cc (Output_segment::set_offset): Search for the first and
7473 last sections rather than assuming that the list is in order.
7474 (Output_segment::find_first_and_last_list): New function.
7475 * output.h (class Output_segment): Update declarations.
7476 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7477 (relro_strip_test_SOURCES): New variable.
7478 (relro_strip_test_DEPENDENCIES): New variable.
7479 (relro_strip_test_LDFLAGS): New variable.
7480 (relro_strip_test_LDADD): New variable.
7481 (relro_strip_test.so): New target.
7483 2010-08-02 Ian Lance Taylor <iant@google.com>
7485 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7486 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7487 (Target_i386::got_tlsdesc_section): New function.
7488 (Target_i386::got_section): Create space for GOT entries for
7489 TLSDESC relocations.
7490 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7492 (Target_i386::Scan::global): Likewise.
7493 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7495 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7496 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7497 (Target_x86_64::got_tlsdesc_section): New function.
7498 (Target_x86_64::got_section): Create space for GOT entries for
7499 TLSDESC relocations.
7500 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7502 (Target_x86_64::Scan::global): Likewise.
7503 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7506 2010-08-02 Ian Lance Taylor <iant@google.com>
7508 * testsuite/final_layout.sh: Use dc to convert from hex to
7511 2010-07-29 Sriraman Tallam <tmsriram@google.com>
7513 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7514 paramter to the call to gold::gc_process_relocs.
7515 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7516 paramter to the call to gold::gc_process_relocs.
7517 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7518 parameter to the call to gold::gc_process_relocs.
7519 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7520 template parameter to the call to gold::gc_process_relocs.
7521 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7522 paramter to the call to gold::gc_process_relocs.
7523 * gc.h (get_embedded_addend_size): New function.
7524 (gc_process_relocs): Save the size of the reloc for use by ICF.
7525 * icf.cc (get_section_contents): Get the addend from the text section
7526 for SHT_REL relocation sections.
7527 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7528 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7529 * int_encoding.h (read_from_pointer): New overloaded function.
7530 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7531 * testsuite/icf_sht_rel_addend_test.sh: New file.
7532 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7533 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7535 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7537 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7538 * Makefile.in: Regenerate.
7539 * testsuite/Makefile.in: Regenerate.
7541 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7543 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7544 * gold/testsuite/debug_msg.cc: Likewise.
7545 * gold/testsuite/odr_violation1.cc
7546 * gold/testsuite/odr_violation2.cc
7548 2010-07-21 Cary Coutant <ccoutant@google.com>
7550 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7551 string, and length fields.
7552 (Output_merge_string::Merged_strings_list): New type.
7553 (Output_merge_string::Merged_strings_lists): New typedef.
7554 (Output_merge_string): Replace merged_strings_ with
7555 merged_strings_lists_.
7556 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7557 Merged_strings_list per input object and section. Don't store pointer
7558 to the string. Don't store length with each merged string entry.
7559 (Output_merge_string::finalize_merged_data): Loop over list of merged
7560 strings lists. Recompute length of each merged string.
7562 2010-07-15 Cary Coutant <ccoutant@google.com>
7564 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7567 2010-07-14 Ian Lance Taylor <iant@google.com>
7569 * descriptors.cc (Descriptors::open): Report correct name in error
7572 2010-07-13 Doug Kwan <dougkwan@google.com>
7574 * arm.cc (Arm_input_section::Arm_input_section): For a
7575 SHT_ARM_EXIDX section, always keeps the input sections.
7576 (Arm_input_section::set_exidx_section_link): New method.
7577 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7578 has_errors_ to false.
7579 (Arm_exidx_input_section::has_errors,
7580 Arm_exidx_input_section::set_has_errors): New methods.
7581 (Arm_exidx_input_section::has_errors_): New data member.
7582 (Arm_relobj::get_exidx_shndx_list): New method.
7583 (Arm_output_section::append_text_sections_to_list): Do not skip
7584 section without SHF_EXECINSTR.
7585 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7587 (Arm_relobj::make_exidx_input_section): Add new parameter for text
7588 section header. Make error messages more verbose. Check for
7589 a non-executable section linked to an EXIDX section.
7590 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7591 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7592 check that there is no deferred EXIDX section if we exit early.
7593 Instead of not making an EXIDX section in case of an error, make one
7594 and set the has_errors flag of it.
7595 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7596 in a relocatable link.
7597 (Target_arm::do_relax): Look for the EXIDX output section instead of
7598 assuming that it is called .ARM.exidx.
7599 (Target_arm::fix_exidx_coverage): Add a new parameter for input
7600 section list. Do not check for SHF_EXECINSTR section flags but
7601 skip any input section with errors.
7602 * output.cc (Output_section::Output_section): Initialize
7603 always_keeps_input_sections_ to false.
7604 (Output_section::add_input_section): Check for
7605 always_keeps_input_sections_.
7606 * output.h (Output_section::always_keeps_input_sections,
7607 Output_section::set_always_keeps_input_sections): New methods.
7608 (Output_section::always_keeps_input_sections): New data member.
7610 2010-07-13 Rafael Espindola <espindola@google.com>
7612 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7613 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7615 2010-07-13 Philip Herron <herron.philip@googlemail.com>
7616 Ian Lance Taylor <iant@google.com>
7618 * output.h (Output_section_lookup_maps::add_merge_section):
7619 Correct check of whether value was inserted.
7620 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7621 (Output_section_lookup_maps::add_relaxed_input_section):
7623 * arm.cc (Target_arm::got_section): Remove used local os.
7624 * i386.cc (Target_i386::got_section): Likewise.
7625 * x86_64.cc (Target_x86_64::got_section): Likewise.
7626 * sparc.cc (Target_sparc::got_section): Likewise.
7627 (Target_sparc::relocate): Remove unused local have_got_offset.
7628 * powerpc.cc (Target_powerpc::relocate): Likewise.
7630 2010-07-13 Ian Lance Taylor <iant@google.com>
7632 * compressed_output.cc (zlib_decompress): Fix signature in
7635 * archive.cc (Archive::include_member): Unlock an external member
7636 of a thin archive. Don't bother to delete an object we know is
7639 2010-07-12 Cary Coutant <ccoutant@google.com>
7641 * compressed_output.cc (zlib_decompress): New function.
7642 (get_uncompressed_size): New function.
7643 (decompress_input_section): New function.
7644 * compressed_output.h (get_uncompressed_size): New function.
7645 (decompress_input_section): New function.
7646 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7647 Handle compressed debug sections.
7648 * layout.cc (is_compressed_debug_section): New function.
7649 (Layout::output_section_name): Map compressed section names to
7651 * layout.h (is_compressed_debug_section): New function.
7652 (is_debug_info_section): Recognize compressed debug sections.
7653 * merge.cc: Include compressed_output.h.
7654 (Output_merge_data::do_add_input_section): Handle compressed
7656 (Output_merge_string::do_add_input_section): Handle compressed
7658 * object.cc: Include compressed_output.h.
7659 (Sized_relobj::Sized_relobj): Initialize new data members.
7660 (build_compressed_section_map): New function.
7661 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7662 * object.h (Object::section_is_compressed): New method.
7663 (Object::do_section_is_compressed): New method.
7664 (Sized_relobj::Compressed_section_map): New type.
7665 (Sized_relobj::do_section_is_compressed): New method.
7666 (Sized_relobj::compressed_sections_): New data member.
7667 * output.cc (Output_section::add_input_section): Handle compressed
7669 * reloc.cc: Include compressed_output.h.
7670 (Sized_relobj::write_sections): Handle compressed debug sections.
7672 2010-07-08 Cary Coutant <ccoutant@google.com>
7674 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7675 weak when resolving to a dynamic def.
7676 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7677 for weak undef/dynamic def cases. Adjust callers.
7678 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7679 undef_binding_weak_.
7680 (Symbol_table::sized_write_globals): Adjust symbol binding.
7681 (Symbol_table::sized_write_symbol): Add binding parameter.
7682 * symtab.h (Symbol::set_undef_binding): New method.
7683 (Symbol::is_undef_binding_weak): New method.
7684 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7685 (Symbol_table::should_override): Add new parameter.
7686 (Symbol_table::sized_write_symbol): Add new parameter.
7688 * testsuite/weak_undef_file1.cc: Add new test case.
7689 * testsuite/weak_undef_file2.cc: Fix header comment.
7690 * testsuite/weak_undef_test.cc: Add new test case.
7692 2010-06-29 Doug Kwan <dougkwan@google.com>
7694 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7695 Initialize USE_SYMBOL_.
7696 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7698 (Arm_reloc_property::uses_symbol_): New data member declaration.
7699 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7700 uses symbol value and symbol is undefined but not weakly undefined.
7702 2010-06-28 Rafael Espindola <espindola@google.com>
7704 * plugin.cc (Plugin::load): Use dlerror.
7706 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7708 * symtab.cc (detect_odr_violations): When reporting an ODR
7709 violation, report an object where the symbol is defined.
7711 2010-06-25 Doug Kwan <dougkwan@google.com>
7713 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7714 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7716 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7717 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7718 target hook to detect function points.
7719 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7720 * icf.h (Icf::check_section_for_function_pointers): Change type of
7721 parameter SECTION_NAME to const reference to std::string. Use
7722 target hook to determine if section may have unsafe pointers.
7723 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7726 2010-06-21 Rafael Espindola <espindola@google.com>
7728 * fileread.cc (Input_file::find_fie): New
7729 (Input_file::open): Use Input_file::find_fie.
7730 * fileread.h (Input_file::find_fie): New
7731 * plugin.cc (set_extra_library_path): New.
7732 (Plugin::load): Add set_extra_library_path to the transfer vector.
7733 (Plugin_manager::set_extra_library_path): New.
7734 (Plugin_manager::add_input_file): Use the extra search path if set.
7735 (set_extra_library_path(): New.
7736 * plugin.h (Plugin_manager): Add set_extra_library_path and
7739 2010-06-19 Cary Coutant <ccoutant@google.com>
7741 * layout.cc (gdb_sections): Add .debug_types.
7742 (lines_only_debug_sections): Likewise.
7744 2010-06-18 Rafael Espindola <espindola@google.com>
7746 * plugin.cc (add_input_file,add_input_library)
7747 (Plugin_manager::add_input_file): Make filename arguments const.
7748 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7751 2010-06-16 Doug Kwan <dougkwan@google.com>
7753 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7754 .ARM.attributes section if we have not merged any input
7755 attributes sections.
7757 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7759 * arm.cc: Allow combining objects with no EABI version
7762 2010-06-15 Rafael Espindola <espindola@google.com>
7764 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7766 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7768 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7769 (struct iovec): Correct !HAVE_READV definition.
7771 2010-06-10 Cary Coutant <ccoutant@google.com>
7773 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7774 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7776 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7779 * symtab.h (Symbol::is_placeholder): New member function.
7780 * target-reloc.h (relocate_section): Check for placeholder symbols.
7782 * testsuite/Makefile.am (plugin_test_8): New test.
7783 (plugin_test_9): New test.
7784 * testsuite/Makefile.in: Regenerate.
7786 2010-06-09 Nick Clifton <nickc@redhat.com>
7788 * yyscript.y (input_list_element): Allow strings prefixed with
7789 the '-' character. Treat these as libraries.
7790 * script.cc (script_add_library): New function. Adds a library
7791 specified by "-l<name>" found in an input script.
7792 * script-c.h: Add prototype for script_add_library.
7794 2010-06-07 Doug Kwan <dougkwan@google.com>
7796 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7797 Restrict stub-group size to be within long conditional branch
7798 range when working around cortex-A8 erratum.
7800 2010-06-07 Damien Diederen <dd@crosstwine.com>
7802 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7805 2010-06-03 Sriraman Tallam <tmsriram@google.com>
7809 (Output_section::Input_section_sort_entry::compare_section_ordering):
7810 Change to return non-zero correctly.
7811 (Output_section::Input_section_sort_section_order_index_compare
7812 ::operator()): Change to fix ambiguity in comparisons.
7814 2010-06-01 Sriraman Tallam <tmsriram@google.com>
7816 * gold.h (is_wildcard_string): New function.
7817 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7818 (Layout::layout_eh_frame): Ditto.
7819 (Layout::find_section_order_index): New method.
7820 (Layout::read_layout_from_file): New method.
7821 * layout.h (Layout::find_section_order_index): New method.
7822 (Layout::read_layout_from_file): New method.
7823 (Layout::input_section_position_): New private member.
7824 (Layout::input_section_glob_): New private member.
7825 * main.cc (main): Call read_layout_from_file here.
7826 * options.h (--section-ordering-file): New option.
7827 * output.cc (Output_section::input_section_order_specified_): New
7829 (Output_section::Output_section): Initialize new member.
7830 (Output_section::add_input_section): Add new parameter.
7831 Keep input sections when --section-ordering-file is used.
7832 (Output_section::set_final_data_size): Sort input sections when
7833 section ordering file is specified.
7834 (Output_section::Input_section_sort_entry): Add new parameter.
7836 (Output_section::Input_section_sort_entry::compare_section_ordering):
7838 (Output_section::Input_section_sort_compare::operator()): Change to
7839 consider section_order_index.
7840 (Output_section::Input_section_sort_init_fini_compare::operator()):
7841 Change to consider section_order_index.
7842 (Output_section::Input_section_sort_section_order_index_compare
7843 ::operator()): New method.
7844 (Output_section::sort_attached_input_sections): Change to sort
7845 according to section order when specified.
7846 (Output_section::add_input_section<32, true>): Add new parameter.
7847 (Output_section::add_input_section<64, true>): Add new parameter.
7848 (Output_section::add_input_section<32, false>): Add new parameter.
7849 (Output_section::add_input_section<64, false>): Add new parameter.
7850 * output.h (Output_section::add_input_section): Add new parameter.
7851 (Output_section::input_section_order_specified): New
7853 (Output_section::set_input_section_order_specified): New method.
7854 (Input_section::Input_section): Initialize section_order_index_.
7855 (Input_section::section_order_index): New method.
7856 (Input_section::set_section_order_index): New method.
7857 (Input_section::section_order_index_): New member.
7858 (Input_section::Input_section_sort_section_order_index_compare): New
7860 (Output_section::input_section_order_specified_): New member.
7861 * script-sections.cc (is_wildcard_string): Delete and move modified
7863 (Output_section_element_input::Output_section_element_input): Modify
7864 call to is_wildcard_string.
7865 (Output_section_element_input::Input_section_pattern
7866 ::Input_section_pattern): Ditto.
7867 (Output_section_element_input::Output_section_element_input): Ditto.
7868 * testsuite/Makefile.am (final_layout): New test case.
7869 * testsuite/Makefile.in: Regenerate.
7870 * testsuite/final_layout.cc: New file.
7871 * testsuite/final_layout.sh: New file.
7873 2010-06-01 Rafael Espindola <espindola@google.com>
7875 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7877 2010-06-01 Rafael Espindola <espindola@google.com>
7879 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7880 visibility of symbols.
7882 2010-05-27 Doug Kwan <dougkwan@google.com>
7884 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7885 from start of output section instead of address for a local symbol
7886 in a merged or relaxed section when doing a relocatable link.
7888 2010-05-26 Rafael Espindola <espindola@google.com>
7891 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7892 adding sections the garbage collector removed.
7893 * gold/testsuite/Makefile.am: Add test.
7894 * gold/testsuite/Makefile.in: Regenerate.
7895 * gold/testsuite/plugin_test_7.sh: New.
7896 * gold/testsuite/plugin_test_7_1.c: New.
7897 * gold/testsuite/plugin_test_7_2.c: New.
7899 2010-05-26 Rafael Espindola <espindola@google.com>
7901 * script-sections.cc (Output_section_definition::set_section_addresses):
7902 Check for --section-start.
7904 2010-05-26 Doug Kwan <dougkwan@google.com>
7906 * arm.cc (Arm_scan_relocatable_relocs): New class.
7907 (Target_arm::relocate_special_relocatable): New method.
7908 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7909 (Arm_relocate_functions::thumb_branch_common): Same.
7910 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7911 instead of Default_scan_relocatable_relocs.
7912 * target-reloc.h (relocate_for_relocatable): Let target handle
7913 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7914 * target.h (Sized_target::relocate_special_relocatable): New method.
7916 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7918 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7920 2010-05-23 Doug Kwan <dougkwan@google.com>
7922 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7924 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7925 with a direct branch, not a conditional branch, to a stub.
7926 * merge.cc (Output_merge_base::record_input_section): New method
7928 (Output_merge_data::do_add_input_section): Record input section if
7929 keeps-input-sections flag is set.
7930 (Output_merge_string::do_add_input_section): Ditto.
7931 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7932 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7934 (Output_merge_base::keeps_input_sections,
7935 Output_merge_base::set_keeps_input_sections,
7936 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7938 (Output_merge_base::Input_sections): New type declaration.
7939 (Output_merge_base::input_sections_begin,
7940 Output_merge_base::input_sections_end,
7941 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7942 (Output_merge_base::bool keeps_input_sections_,
7943 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7944 Output_merge_base::input_sections_): New data members.
7945 (Output_merge_data::do_set_keeps_input_sections): New method
7947 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7948 * output.cc (Output_section::Input_section::relobj): Move method
7949 defintion from class declaration to here and handle merge sections.
7950 (Output_section::Input_section::shndx): Ditto.
7951 (Output_section::Output_section): Remove initializations of removed
7952 data members and initialize new data member LOOKUP_MAPS_.
7953 (Output_section::add_input_section): Set keeps-input-sections flag
7954 for a newly created merge output section as appropriate. Adjust code
7955 to use Output_section_lookup_maps class.
7956 (Output_section::add_relaxed_input_section): Adjst code for lookup
7957 maps code refactoring.
7958 (Output_section::add_merge_input_section): Add a new parameter
7959 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7960 class. If adding input section to a newly created merge output
7961 section fails, remove the new merge section.
7962 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
7963 Adjust code for use of the Output_section_lookup_maps class.
7964 (Output_section::find_merge_section): Ditto.
7965 (Output_section::build_lookup_maps): New method defintion.
7966 (Output_section::find_relaxed_input_section): Adjust code to use
7967 Output_section_lookup_maps class.
7968 (Output_section::get_input_sections): Export merge sections. Adjust
7969 code to use Output_section_lookup_maps class.
7970 (Output_section:::add_script_input_section): Adjust code to use
7971 Output_section_lookup_maps class. Update lookup maps for merge
7973 (Output_section::discard_states): Use Output_section_lookup_maps.
7974 (Output_section::restore_states): Same.
7975 * output.h (Merge_section_properties): Move class defintion out of
7977 (Output_section_lookup_maps): New class.
7978 (Output_section::Input_section::is_merge_section): New method
7980 (Output_section::Input_section::relobj): Move defintion out of class
7981 defintion. Declare method only.
7982 (Output_section::Input_section::shndx): Ditto.
7983 (Output_section::Input_section::output_merge_base): New method defintion.
7984 (Output_section::Input_section::u2_.pomb): New union field.
7985 (Output_section::Merge_section_by_properties_map,
7986 Output_section::Output_section_data_by_input_section_map,
7987 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7989 (Output_section::add_merge_input_section): Add new parameter
7990 KEEPS_INPUT_SECTIONS.
7991 (Output_section::build_lookup_maps): New method declaration.
7992 (Output_section::merge_section_map_,
7993 Output_section::merge_section_by_properties_map_,
7994 Output_section::relaxed_input_section_map_,
7995 Output_section::is_relaxed_input_section_map_valid_): Remove data
7997 (Output_section::lookup_maps_): New data member.
7999 2010-05-21 Doug Kwan <dougkwan@google.com>
8002 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8003 avoid a compilation error.
8005 2010-05-19 Rafael Espindola <espindola@google.com>
8007 * script-sections.cc (Output_section_definition::allocate_to_segment):
8008 Update the phdrs_list even when the output section is NULL.
8009 * testsuite/Makefile.am: Add test.
8010 * testsuite/Makefile.in: Regenerate.
8011 * testsuite/script_test_9.cc: New.
8012 * testsuite/script_test_9.sh: New.
8013 * testsuite/script_test_9.t: New.
8015 2010-05-19 Doug Kwan <dougkwan@google.com>
8017 * arm.cc (Arm_input_section::original_size): New method.
8018 (Arm_input_section::do_addralign): Add a cast.
8019 (Arm_input_section::do_output_offset): Remove static cast.
8020 (Arm_input_section::original_addralign,
8021 Arm_input_section::original_size_): Change type to uint32_t.
8022 (Arm_input_section::init): Add safe casts for section alignment
8024 (Arm_input_section::set_final_data_size): Do not set address and
8025 offset of stub table.
8026 (Arm_output_section::fix_exidx_coverage): Change use of of
8027 Output_section::Simple_input_section to that of
8028 Output_section::Input_section.
8029 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8030 except for the first pass.
8031 * output.cc (Output_section::get_input_sections): Change type of
8032 input_sections to std::list<Input_section>.
8033 (Output_section::add_script_input_section): Rename from
8034 Output_section::add_simple_input_section. Change type of SIS
8035 parameter from Simple_input_section to Input_section.
8036 * output.h (Output_section::Simple_input_section): Remove class.
8037 (Output_section::Input_section): Change class visibility to public.
8038 (Output_section::Input_section::addralign): Use stored alignments
8039 for special input sections if set.
8040 (Output_section::Input_section::set_addralign): New method.
8041 (Output_section::get_input_sections): Change parameter type from
8042 list of Simple_input_section to list of Input_section.
8043 (Output_section::add_script_input_section): Rename from
8044 Output_section::add_simple_input_section. Change first parameter's
8045 type from Simple_input_section to Input_section and remove the
8046 second and third parameters.
8047 * script-sections.cc (Input_section::Input_section_list): Change
8048 type to list of Output_section::Input_section/
8049 (Input_section_info::Input_section_info): Change parameter type of
8050 INPUT_SECTION to Output_section::Input_section.
8051 (Input_section_info::input_section): Change return type.
8052 (Input_section_info::input_section_): Change type to
8053 Output_section::Input_section.
8054 (Output_section_element_input::set_section_addresses): Adjust code
8055 to use Output_section::Input_section instead of
8056 Output_section::Simple_input_section. Adjust code for renaming
8057 of Output_section::add_simple_input_section.
8058 (Orphan_output_section::set_section_addresses): Ditto.
8060 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8062 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8063 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8065 2010-05-18 Rafael Espindola <espindola@google.com>
8067 * options.cc (General_options::finalize): Handle -nostdlib.
8068 * options.h (nostdlib): New option.
8069 * script.cc (script_add_search_dir): Handle -nostdlib.
8071 2010-05-12 Doug Kwan <dougkwan@google.com>
8073 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8074 attributes section only if there no attributes section after merging.
8075 (Target_arm::merge_object_attributes): Move value of
8076 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
8077 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8078 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8079 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8080 and arm_attr_merge_7.stdout.
8081 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8082 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8083 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8084 arm_attr_merge_7b.o): New rules.
8085 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8087 * testsuite/Makefile.in: Regenerate.
8088 * testsuite/arm_attr_merge.sh: New file.
8089 * testsuite/arm_attr_merge_[67][ab].s: Same.
8091 2010-05-05 Nick Clifton <nickc@redhat.com>
8093 * po/es.po: Updated Spanish translation.
8095 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8097 * Makefile.am (install-exec-local): Properly install gold as
8098 default cross linker.
8099 * Makefile.in: Regenerated.
8101 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8102 Nick Clifton <nickc@redhat.com>
8104 * configure.ac (install_as_default): Define and set to false
8105 unless --enable-gold or --enable-gold=both/gold has been
8107 * configure: Regenerate.
8109 * Makefile.am (install-exec-local): Install the executable as
8110 'ld.gold'. If install_as_default is true then also install it as
8112 * Makefile.in: Regenerated.
8114 2010-04-24 Ian Lance Taylor <iant@google.com>
8116 * layout.cc (Layout::layout_reloc): In relocatable link don't
8117 combine reloc sections for grouped sections.
8119 2010-04-23 Sriraman Tallam <tmsriram@google.com>
8121 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8122 sections that are not ordinary to icf.
8123 * icf.cc (get_section_contents): Handle relocation pointing to section
8124 with no object or shndx information.
8125 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8126 * testsuite/Makefile.in: Regenerate.
8127 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8128 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8130 2010-04-22 Ian Lance Taylor <iant@google.com>
8132 * expression.cc (Expression::Expression_eval_info): Add
8133 result_alignment_pointer field.
8134 (Expression::eval_with_dot): Add result_alignment_pointer
8135 parameter. Change all callers.
8136 (Expression::eval_maybe_dot): Likewise.
8137 (class Binary_expression): Add alignment_pointer parameter to
8138 left_value and right_value. Change all callers.
8139 (BINARY_EXPRESSION): Set result alignment.
8140 (class Trinary_expression): Add alignment_pointer parameter to
8141 arg2_value and arg3_value. Change all callers.
8142 (Trinary_cond::value): Set result alignment.
8143 (Max_expression::value, Min_expression::value): Likewise.
8144 (Align_expression::value): Likewise.
8145 * script-sections.cc (class Sections_element): Add dot_alignment
8146 parameter to set_section_addresses virtual function. Update
8148 (class Output_section_element): Likewise.
8149 (Script_sections::create_segments): Add dot_alignment parameter.
8151 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8152 (Script_sections::set_phdrs_clause_addresses): Likewise.
8153 * script-sections.h: Update declarations.
8154 * script.h: Update declarations.
8155 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8157 * testsuite/script_test_3.t: Set large alignment.
8158 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8159 segment has expected alignment.
8161 2010-04-22 Nick Clifton <nickc@redhat.com>
8163 * po/gold.pot: Updated by the Translation project.
8164 * po/vi.po: Updated Vietnamese translation.
8166 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8168 * testsuite/Makefile.am (check_PROGRAMS): Add
8169 icf_virtual_function_folding_test.
8170 * testsuite/Makefile.in: Regenerated.
8172 2010-04-15 Andrew Haley <aph@redhat.com>
8174 * options.h (merge_exidx_entries): New option.
8175 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8176 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8177 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8178 (Target_arm::merge_exidx_entries): New function.
8179 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8180 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8181 to Arm_exidx_fixup constructor.
8182 Add new arg, merge_exidx_entries.
8183 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8184 Arm_output_section::fix_exidx_coverage.
8186 2010-04-18 Sriraman Tallam <tmsriram@google.com>
8188 * icf.cc (get_section_contents): Check for preemptible functions.
8189 Ignore addend when appropriate.
8190 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8192 (add_from_relobj): Check for section folded.
8193 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8194 * symtab.h (should_add_dynsym_entry): Add new parameter.
8195 * target-reloc.h (scan_relocs): Check for section folded.
8196 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8197 Check reloc types for function pointers in shared objects.
8198 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8200 (icf_preemptible_functions_test): New test case.
8201 (icf_string_merge_test): New test case.
8202 * testsuite.Makefile.in: Regenerate.
8203 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8204 bar_glob. Refactor code.
8205 * testsuite/icf_preemptible_functions_test.cc: New file.
8206 * testsuite/icf_preemptible_functions_test.sh: New file.
8207 * testsuite/icf_string_merge_test.cc: New file.
8208 * testsuite/icf_string_merge_test.sh: New file.
8209 * testsuite/icf_virtual_function_folding_test.cc: New file.
8210 * testsuite/icf_virtual_function_folding_test.sh: New file.
8212 2010-04-14 Doug Kwan <dougkwan@google.com>
8214 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8215 for local symbol recounting if we remove a section due to ICF.
8216 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8217 there are no regular objects in input.
8219 2010-04-13 Doug Kwan <dougkwan@google.com>
8221 * arm.cc (Arm_input_section::set_final_data_size): Compute
8222 accurate final data size instead of using current data size.
8224 2010-04-09 Doug Kwan <dougkwan@google.com>
8226 * layout.cc (Layout::choose_output_section): Handle script section
8228 (Layout::make_output_section_for_script): Add section type parameter.
8229 Handle script section types.
8230 * layout.h (Layout::make_output_section_for_script): Add section
8232 * output.cc (Output_section::Output_section): Initialize data member
8234 (Output_section::do_reset_address_and_file_offset): Do not set address
8235 to 0 if section is a NOLOAD section.
8236 * output.h (Output_section::is_noload): New method.
8237 (Output_section::set_is_noload): Ditto.
8238 (Output_section::is_noload_): New data member.
8239 * script-c.h (Script_section_type): New enum type.
8240 (struct Parser_output_section_header): Add new file section_type.
8241 * script-sections.cc (Sections_element::output_section_name): Add
8242 parameter for returning script section type.
8243 (Output_section_definition::output_section_name): Ditto.
8244 (Output_section_definition::section_type)P; New method.
8245 (Output_section_definiton::script_section_type_name): Ditto.
8246 (Output_section_definition::script_section_type_): New data member.
8247 (Output_section_definition::Output_section_definition): Initialize
8248 data member Output_section_definition::script_section_type_.
8249 (Output_section_definition::create_sections): Pass script section type
8250 to Layout::make_output_section_for_script.
8251 (Output_section_definition::output_section_name): Return script
8252 section type to caller.
8253 (Output_section_definition::set_section_address): Do not advance
8254 dot value and load address if section type is NOLOAD. Set address
8255 of NOLOAD sections regardless of section flags.
8256 (Output_section_definition::print): Print section type if it is
8257 not SCRIPT_SECTION_TYPE_NONE.
8258 (Output_section_definition::section_type): New method.
8259 (Output_section_definition::script_section_type_name): Ditto.
8260 (Script_sections::output_section_name): Add new parameter
8261 PSECTION_TYPE for returning script section type. Pass it to
8262 section elements. Handle discard sections.
8263 (Sort_output_sections::operator()): Handle NOLOAD sections.
8264 * script-sections.h (Script_sections::Section_type): New enum type.
8265 (Script_sections::output_section_name): Add a new parameter for
8266 returning script section type.
8267 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8269 * yyscript.y (union): Add new field SECTION_TYPE.
8270 (COPY, DSECT, INFO, NOLOAD): New tokens.
8271 (opt_address_and_section_type): Change type to output_section_header.
8272 (section_type): New non-terminal
8273 (section_header): Handle section type.
8274 (opt_address_and_section_type): Return section type value.
8276 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8278 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8279 * testsuite/plugin_common_test_2.c (foo): Likewise.
8281 2010-04-08 Doug Kwan <dougkwan@google.com>
8283 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8285 * output.cc (Output_section::add_merge_input_section): Simplify
8286 code and return status of Output_merge_base::add_input_section.
8287 Update merge section map only if Output_merge_base::add_input_section
8290 2010-04-07 Doug Kwan <dougkwan@google.com>
8292 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8293 if section is marked as containing instructions but has no mapping
8295 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8296 correct section index.
8297 (Arm_relobj::find_linked_text_section): Ditto.
8299 2010-04-07 Cary Coutant <ccoutant@google.com>
8301 * archive.cc (include_member): Destroy Read_symbols_data object before
8303 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8304 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8305 (Read_symbols_data::~Read_symbols_data) New destructor.
8306 (Section_relocs::Section_relocs) New constructor.
8307 (Section_relocs::~Section_relocs) New destructor.
8308 (Read_relocs_data::Read_relocs_data) New constructor.
8309 (Read_relocs_data::~Read_relocs_data) New destructor.
8310 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8311 pointers to NULL after deleting.
8313 2010-04-07 Doug Kwan <dougkwan@google.com>
8315 * arm.cc: Replace "endianity" with "endianness" in comments.
8316 (Arm_exidx_cantunwind): Ditto.
8317 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8318 (Arm_relobj::merge_flags_and_attributes): New method.
8319 (Arm_relobj::merge_flags_and_attributes_): New data member.
8320 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8321 (Arm_relobj::scan_sections_for_stubs): Ditto.
8322 (Arm_relobj::do_read_symbols): Check to see if we really want to
8323 merge processor-specific flags and attributes. Exit early if
8324 an object is empty except for section names and the undefined symbol.
8325 (Target_arm::do_finalize_sections): Move check for ELF format to
8326 Arm_relobj::do_read_symbols. Merge processor specific flags and
8327 attributes from a regular object only when we have determined that
8328 it is aapropriate. Do not create an .ARM.attributes section in
8329 output if there is no regular input object.
8330 (Target_arm::merge_processor_specific_flags): Check
8331 --warn-mismatch before printing any error.
8332 (Target_arm::merge_object_attributes): Ditto.
8333 * gold.cc (queue_middle_tasks): Handle the case in which there is
8334 no regular object in input.
8335 * options.cc (General_options::parse_EB): New method.
8336 (General_options::parse_EL): Same.
8337 (General_options::General_options): Initialize endianness_.
8338 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8340 (General_options::Endianness): New enum.
8341 (General_options::endianness): New method.
8342 (General_options::endianness_): New data member.
8343 * parameters.cc (Parameters::set_options): Check target endianness.
8344 (Parameters::set_target_once): Ditto.
8345 (Parameters::check_target_endianness): New method.
8346 (parameters_force_valid_target): If either -EL or -EB is specified,
8347 use it to define endianness of default target.
8348 * parameters.h (Parameters::check_target_endianness): New method
8350 * target.h (class Target): Change "endianity" to "endianness"
8353 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8355 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8356 * configure: Regenerate.
8357 * Makefile.in: Regenerate.
8358 * testsuite/Makefile.in: Regenerate.
8360 2010-04-06 Cary Coutant <ccoutant@google.com>
8363 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8364 prevailing definitions of common symbols.
8365 * testsuite/plugin_test_6.sh: New test case.
8366 * testsuite/plugin_common_test_1.c: New test case.
8367 * testsuite/plugin_common_test_2.c: New test case.
8368 * testsuite/Makefile.am (plugin_test_6): New test case.
8369 * testsuite/Makefile.in: Regenerate.
8371 2010-04-06 Nick Clifton <nickc@redhat.com>
8373 * po/vi.po: New Vietnamese translation.
8375 2010-03-30 Doug Kwan <dougkwan@google.com>
8377 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8379 2010-03-25 Doug Kwan <dougkwan@google.com>
8381 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8382 to avoid a conversion warning on a 32-bit host.
8384 2010-03-24 Ian Lance Taylor <iant@google.com>
8386 * testsuite/script_test_3.t: Add a TLS segment.
8387 * testsuite/Makefile.am (check_PROGRAMS): Add
8388 tls_phdrs_script_test.
8389 (tls_phdrs_script_test_SOURCES): Define.
8390 (tls_phdrs_script_test_DEPENDENCIES): Define.
8391 (tls_phdrs_script_test_LDFLAGS): Define.
8392 (tls_phdrs_script_test_LDADD): Define.
8393 * testsuite/Makefile.in: Rebuild.
8395 2010-03-23 Cary Coutant <ccoutant@google.com>
8397 * fileread.cc (find_or_make_view): Fix comment.
8399 2010-03-23 Ian Lance Taylor <iant@google.com>
8401 * script-sections.cc (class Orphan_section_placement): Define
8402 PLACE_TLS and PLACE_TLS_BSS.
8403 (Orphan_section_placement::Orphan_section_placement): Initialize
8405 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8406 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8407 (tls_script_test_SOURCES): Define.
8408 (tls_script_test_DEPENDENCIES): Define.
8409 (tls_script_test_LDFLAGS): Define.
8410 (tls_script_test_LDADD): Define.
8411 * testsuite/Makefile.in: Rebuild.
8413 2010-03-22 Doug Kwan <dougkwan@google.com>
8415 * arm.cc (Arm_relocate_functions::abs8,
8416 Arm_relocate_functions::abs16): Use correct check for overflow
8417 specified in the ARM ELF specs.
8418 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8419 target of a BLX instruction specially.
8420 (Reloc_stub::stub_type_for_reloc): Ditto.
8421 (Relocate::relocate): Use symbolic names instead of numeric relocation
8422 codes to report error.
8423 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8425 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8426 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8427 thumb2_blx_out_of_range.stdout
8428 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8429 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8430 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8431 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8432 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8433 thumb2_blx_in_range, thumb2_blx_in_range.o,
8434 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8435 thumb2_blx_out_of_range.o): New rules.
8436 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
8437 thumb2_blx_in_range and thumb2_blx_out_of_range.
8438 * testsuite/Makefile.in: Regenerate.
8439 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8440 * testsuite/thumb_blx_in_range.s: New file.
8441 * testsuite/thumb_blx_out_of_range.s: New file.
8443 2010-03-22 Rafael Espindola <espindola@google.com>
8445 * archive.cc (Should_include): Move to archive.h.
8446 (should_include_member): Make it a member of Archive.
8448 (Add_lib_group_symbols): New.
8449 * archive.h: Include options.h.
8450 (Archive_member): Moved from Archive.
8451 (Should_include): Moved from archive.cc.
8453 (Add_lib_group_symbols): New.
8454 * dynobj.cc (do_should_include_member): New.
8455 * dynobj.h (do_should_include_member): New.
8456 * gold.cc (queue_initial_tasks): Update call to queue.
8457 * main.cc (main): Print lib group stats.
8458 * object.cc (do_should_include_member): New.
8459 * object.h: Include archive.h.
8460 (Object::should_include_member): New.
8461 (Object::do_should_include_member): New.
8462 (Sized_relobj::do_should_include_member): New.
8463 * options.cc (General_options::parse_start_lib): New.
8464 (General_options::parse_end_lib): New.
8465 (Input_arguments::add_file): Handle lib groups.
8466 (Input_arguments::start_group): Check we are not in a lib.
8467 (Input_arguments::start_lib): New.
8468 (Input_arguments::end_lib): New.
8469 * options.h (General_options): Add start_lib and end_lib.
8470 (Input_argument::lib_): New.
8471 (Input_argument::lib): New.
8472 (Input_argument::is_lib): New.
8473 (Input_file_lib): New.
8474 (Input_arguments::in_lib_): New.
8475 (Input_arguments::in_lib): New.
8476 (Input_arguments::start_lib): New.
8477 (Input_arguments::end_lib_): New.
8478 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8479 in unused members as preempted.
8480 (Sized_pluginobj::do_should_include_member): New.
8481 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8482 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8484 (Read_symbols::do_whole_lib_group): New.
8485 (Read_symbols::do_lib_group): New.
8486 (Read_symbols::do_read_symbols): Handle lib groups.
8487 (Read_symbols::get_name): Handle lib groups.
8488 * readsyms.h (Read_symbols): Add an archive member pointer.
8489 (Read_symbols::do_whole_lib_group): New.
8490 (Read_symbols::do_lib_group): New.
8491 (Read_symbols::member_): New.
8492 * script.cc (read_input_script): Update call to queue_soon.
8494 2010-03-19 Doug Kwan <dougkwan@google.com>
8496 * arm.cc (Stub_table::Stub_table): Initialize new data members
8497 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8498 (Stub_table::add_reloc_stub): Assign stub offset and update
8499 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8500 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8502 (Stub_table::update_data_size_and_addralign): Use
8503 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8504 instead of going over all reloc stubs.
8505 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
8506 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8507 Stringpool_template::offset_ to size of Stringpool_char.
8508 (Stringpool_template::new_key_offset): Remove code to initialize
8509 Stringpool_template::offset_.
8510 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8511 Stringpool_template::offset_ to zero.
8513 2010-03-15 Doug Kwan <dougkwan@google.com>
8515 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8517 (Stringpool_template::new_key_offset): New method.
8518 (Stringpool_template::add_string): Assign offsets when adding new
8520 (Stringpool_template::set_string_offsets): Do not set string offsets
8521 when not optimizing.
8522 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8524 (Chunked_vector::clear): Clear size_.
8525 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8526 (Chunked_vector::size): Return size_.
8527 (Chunked_vector::push_back): Use size_ to find insert position.
8528 (Chunked_vector::size_): New data member.
8529 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8530 (Stringpool_template::new_key_offset): New method declaration.
8531 (Stringpool_template::offset_): New data member.
8533 2010-03-15 Rafael Espindola <espindola@google.com>
8535 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8536 Add_symbols' constructor.
8537 * readsyms.h (Add_symbols): Remove the input_group member.
8539 2010-03-10 Ian Lance Taylor <iant@google.com>
8541 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8542 target to ask whether a reference to a symbol requires a stack
8544 * target.h (Target::is_call_to_non_split): New function.
8545 (Target::do_is_call_to_non_split): Declare virtual function.
8546 * target.cc: Include "symtab.h".
8547 (Target::do_is_call_to_non_split): New function.
8548 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8550 2010-03-10 Cary Coutant <ccoutant@google.com>
8552 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8553 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8554 (File_read::open[2]): Add whole_file_view_ to list of views.
8555 (File_read::make_view): Remove test of whole_file_view_.
8556 (File_read::find_or_make_view): Create whole_file_view_ if
8558 (File_read::clear_views): Replace bool parameter with enum;
8559 adjust all callers. Don't delete views with permanent data;
8560 do delete cached views and views from archives if
8561 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8562 if clearing the corresponding view.
8563 * fileread.h (File_read::Clear_views_mode): New enum.
8564 (File_read::View::is_permanent_view): New method.
8565 (File_read::clear_views): Replace bool parameter
8566 with enum; adjust all callers.
8567 * options.h (General_options): Change keep_files_mapped option;
8568 add map_whole_files.
8569 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8571 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8574 2010-03-10 David S. Miller <davem@davemloft.net>
8576 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8578 2010-03-09 Sriraman Tallam <tmsriram@google.com>
8580 * icf.cc (get_section_contents): Add '@' marker after processing the
8583 2010-03-08 Doug Kwan <dougkwan@google.com>
8585 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8586 due to a conversion warning.
8587 (Arm_relobj::update_output_local_symbol_count): Check for local
8588 symbol with unset output index.
8590 2010-03-05 Ian Lance Taylor <iant@google.com>
8592 * options.h (class General_options): Add --spare-dynamic-tags.
8593 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8594 --spare-dynamic-tags.
8596 2010-03-05 Ian Lance Taylor <iant@google.com>
8598 * incremental.cc: Include "libiberty.h".
8600 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8602 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8603 function, is_info_ member.
8604 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8605 (Versions::Versions): Update caller.
8606 (Versions::define_base_version): Likewise.
8607 (Versions::add_def): Likewise.
8609 2010-03-03 Sriraman Tallam <tmsriram@google.com>
8611 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8612 (Scan::possible_function_pointer_reloc): New function.
8613 (Scan::local_reloc_may_be_function_pointer): Change to call
8614 possible_function_pointer_reloc.
8615 (Scan::global_reloc_may_be_function_pointer): Ditto.
8616 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8617 relocations in ".data.rel.ro._ZTV" section.
8618 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8619 * testsuite/icf_safe_so_test.cc: Ditto.
8620 * testsuite/icf_safe_test.cc: Ditto.
8621 * testsuite/icf_safe_test.sh: Ditto.
8623 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8624 Ian Lance Taylor <iant@google.com>
8626 * target-reloc.h (relocate_section): Check the symbol table index
8627 for -1U before setting the local symbol index.
8628 (scan_relocatable_relocs): If copying the relocation, record that
8629 the local symbol is required.
8630 * object.h (Symbol_value::is_output_symtab_index_set): New
8632 (Symbol_value::may_be_discarded_from_output_symtab): New
8634 (Symbol_value::has_output_symtab_entry): New function.
8635 (Symbol_value::needs_output_symtab_entry): Remove.
8636 (Symbol_value::output_symtab_index): Make sure the symbol index is
8638 (Symbol_value::set_output_symtab_index): Make sure the symbol
8639 index is not set. Make sure the new index is valid.
8640 (Symbol_value::set_must_have_output_symtab_entry): New function.
8641 (Symbol_value::has_output_dynsym_entry): New function.
8642 (Symbol_value::set_output_dynsym_index): Make sure the new index
8644 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8645 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8646 local symbol if permitted.
8647 (Sized_relobj::do_finalize_local_symbols): Call
8648 is_output_symtab_index_set rather than needs_output_symtab_entry.
8649 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8650 rather than needs_output_symtab_entry. Call
8651 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8652 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8653 is_output_symtab_index_set rather than needs_output_symtab_entry.
8654 * testsuite/discard_locals_relocatable_test.c: New file.
8655 * testsuite/discard_locals_test.sh: Test -r.
8656 * testsuite/Makefile.am (check_DATA): Add
8657 discard_locals_relocatable_test1.syms,
8658 discard_local_relocatable_test2.syms.
8659 (MOSTLYCLEANFILES): Likewise. Also add
8660 discard_locals_relocatable_test1.lout and
8661 discard_locals_relocatable_test2.out.
8662 (discard_locals_relocatable_test1.syms): New target.
8663 (discard_locals_relocatable_test.o): New target.
8664 (discard_locals_relocatable_test1.out): New target.
8665 (discard_locals_relocatable_test2.syms): New target.
8666 (discard_locals_relocatable_test2.out): New target.
8667 (various): Add missing ../ld-new dependencies.
8668 * testsuite/Makefile.in: Rebuild.
8670 2010-03-03 Nick Clifton <nickc@redhat.com>
8672 * po/fi.po: New Finnish translation.
8674 2010-03-01 Doug Kwan <dougkwan@google.com>
8676 * layout.cc (Layout::Layout): Force section types of .init_array*,
8677 .preinit_array* and .fini_array* sections.
8678 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8679 Fix check of return value of std::string::find.().
8680 (Output_section::Input_section_sort_compare::operator()): Remove
8681 comment about .init_array.
8682 (Output_section::Input_section_sort_init_fini_compare::operator()):
8684 (Output_section::sort_attached_input_sections): Handle .init_array
8685 and .fini_array specially.
8686 * output.h (Output_section::Inut_section_sort_compare): Update
8688 (Output_section::Input_section_sort_init_fini_compare): New struct.
8690 2010-02-26 Doug Kwan <dougkwan@google.com>
8692 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8693 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8694 * testsuite/debug_msg.sh: Avoid matching source line number for
8695 use of global variable undef_int.
8697 2010-02-26 Doug Kwan <dougkwan@google.com>
8699 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8700 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8701 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8702 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8703 * options.cc (General_options::General_options): Initialize member
8705 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8706 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8707 and rm_no_fix_v4bx.stdout
8708 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8709 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8710 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8711 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8712 and arm_no_fix_v4bx.
8713 * Makefile.in: Regenerate.
8714 * testsuite/arm_fix_v4bx.s: New file.
8715 * testsuite/arm_fix_v4bx.sh: Ditto.
8717 2010-02-24 Doug Kwan <dougkwan@google.com>
8719 * arm.cc (Target_arm::got_section): Make the .got section the first
8720 non RELRO section in the data segment.
8721 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8722 suffixes of section names.
8724 2010-02-24 Doug Kwan <dougkwan@google.com>
8726 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8727 flags and attributes merging if an input file is a binary file.
8728 * fileread.cc (Input_file::open): Record format of original file.
8729 * fileread.h (Input_file::Format): New enum type.
8730 (Input_file::Input_file): Initialize data member format_.
8731 (Input_file::format): New method definition.
8732 (Input_file::format_):: New data member.
8734 2010-02-24 Doug Kwan <dougkwan@google.com>
8736 * arm.cc (Arm_output_data_got): New class.
8737 (ARM_TCB_SIZE): New constant
8738 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8739 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8740 If user uses a script with a SECTIONS clause, issue only a warning
8741 for a misplaced EXIDX input section. Otherwise, issue an error.
8742 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
8744 (Target_arm::got_mode_index_entry): Handle static linking.
8745 (Target_arm::Scan::local): Ditto.
8746 (Target_arm::Scan::global): Ditto.
8747 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8748 all incorrectly implemented relocations.
8749 (Target_arm::fix_exidx_coverage): Pass layout to
8750 Arm_output_section::fix_exidx_coverage.
8751 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8752 from ".ARM.exidx." and ".ARM.extab.".
8754 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8756 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8757 section if it does not already exist.
8758 * attributes.cc (Attributes_section_data::Attributes_section_data):
8759 Don't crash if size is zero.
8761 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8762 Ian Lance Taylor <iant@google.com>
8764 * gold.cc (queue_middle_tasks): If no input files were opened,
8766 * workqueue.h (Task_function::Task_function): Assert that there is
8769 2010-02-22 Doug Kwan <dougkwan@google.com>
8771 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8772 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8773 types to avoid warnings due to different uint64_t implementations
8776 2010-02-21 Doug Kwan <dougkwan@google.com>
8778 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8779 handling of the maximum backward branch offset.
8780 (Arm_relocate_functions::thumb_branch_common): Ditto.
8781 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8782 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
8783 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
8784 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8785 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8786 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8787 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8788 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8789 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8790 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8791 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8792 thumb2_bl_out_of_range.o): New rules.
8793 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8794 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8795 thumb2_bl_out_of_range
8796 * testsuite/Makefile.in: Regenerate.
8797 * testsuite/arm_bl_in_range.s: New file.
8798 * testsuite/arm_bl_out_of_range.s: Ditto.
8799 * testsuite/arm_branch_in_range.sh: Ditto.
8800 * testsuite/arm_branch_range.t: Ditto.
8801 * testsuite/thumb2_branch_range.t: Ditto.
8802 * testsuite/thumb_bl_in_range.s: Ditto.
8803 * testsuite/thumb_bl_out_of_range.s: Ditto.
8804 * testsuite/thumb_branch_range.t: Ditto.
8806 2010-02-20 Sriraman Tallam <tmsriram@google.com>
8808 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8809 Add reloc offset information.
8810 * icf.cc (get_section_contents): Change iterators to point to the new
8811 vectors. Add reloc offset information to the contents.
8812 * icf.h (Icf::Sections_reachable_info): New typedef.
8813 (Icf::Sections_reachable_list): New typedef.
8814 (Icf::Offset_info): New typedef.
8815 (Icf::Reloc_info): New struct typedef.
8816 (Icf::Reloc_info_list): New typedef.
8817 (Icf::symbol_reloc_list): Delete method.
8818 (Icf::addend_reloc_list): Delete method.
8819 (Icf::section_reloc_list): Delete method.
8820 (Icf::reloc_info_list): New method.
8821 (Icf::reloc_info_list_): New member.
8823 2010-02-19 Doug Kwan <dougkwan@google.com>
8825 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8826 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8827 * arm.cc (Arm_relocation_functions): New forward declaration.
8828 (Target_arm::Target_arm): Initialize new data members
8829 got_mod_index_offset_ and tls_base_symbol_defined_.
8830 (Target_arm::Relocate::relocate_tls): New method.
8831 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8832 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8834 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
8835 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8836 (Target_arm::got_mod_index_offset_,
8837 Target_arm::tls_base_symbol_defined_): New data members.
8838 (Target_arm::Scan::local, Target::Scan::global,
8839 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8842 2010-02-18 Doug Kwan <dougkwan@google.com>
8844 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8845 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8846 text section as a parameter becuase some broken tools may not set
8847 the link in section header.
8848 (Target_arm::has_got_section): New method.
8849 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8850 without any mapping symbol as data only. Remove warning.
8851 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8852 link in its section header, try to discover the link by inspecting the
8853 REL31 relocation at the beginning of the section.
8854 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8856 (Target_arm::Scan::global): Treat any reference to the symbol
8857 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8859 2010-02-12 Sriraman Tallam <tmsriram@google.com>
8861 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8862 (Scan::global_reloc_may_be_function_pointer): New function.
8863 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8864 (Scan::global_reloc_may_be_function_pointer): New function.
8865 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8866 (Scan::global_reloc_may_be_function_pointer): New function.
8867 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8868 (Scan::global_reloc_may_be_function_pointer): New function.
8869 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8870 (Scan::global_reloc_may_be_function_pointer): New function.
8871 (Scan::possible_function_pointer_reloc): New function.
8872 (Target_x86_64::can_check_for_function_pointers): New function.
8873 * gc.h (gc_process_relocs): Scan relocation types to determine if
8874 function pointers were taken for targets that support it.
8875 * icf.cc (Icf::find_identical_sections): Include functions for
8876 folding in safe ICF whose pointer is not taken.
8877 * icf.h (Secn_fptr_taken_set): New typedef.
8878 (fptr_section_id_): New member.
8879 (section_has_function_pointers): New function.
8880 (set_section_has_function_pointers): New function.
8881 (check_section_for_function_pointers): New function.
8882 * options.h: Fix comment for safe ICF option.
8883 * target.h (can_check_for_function_pointers): New function.
8884 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8885 Modify icf_safe_test for X86-64.
8886 * testsuite/Makefile.in: Regenerate.
8887 * testsuite/icf_safe_so_test.cc: New file.
8888 * testsuite/icf_safe_so_test.sh: New file.
8889 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8890 (main): Change to take pointer to function kept_func_3.
8891 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8892 folding is done correctly for X86-64.
8894 2010-02-12 David S. Miller <davem@davemloft.net>
8896 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8897 is_symbolless parameter.
8898 (Output_reloc<SHT_REL>::is_symbolless): New.
8899 (Output_reloc<SHT_REL>::is_symbolless_): New.
8900 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8901 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8902 (Output_reloc<SHT_RELA>::is_symbolless): New.
8903 (Output_data_reloc::add_global): Handle is_symbolless.
8904 (Output_data_reloc::add_global_relative): Likewise.
8905 (Output_data_reloc::add_local): Likewise.
8906 (Output_data_reloc::add_local_relative): Likewise.
8907 (Output_data_reloc::add_symbolless_global_addend): New.
8908 (Output_data_reloc::add_symbolless_local_addend): New.
8909 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8911 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8912 instead of ->is_relative_
8913 (Output_reloc::write): Likewise.
8914 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8915 (Output_reloc::write_rel): Simplify.
8917 * sparc.cc (Target_sparc::Scan::local): Use
8918 ->add_symbolless_local_addend as needed.
8919 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8920 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8921 based upon relocation offset.
8923 2010-02-11 Doug Kwan <dougkwan@google.com>
8925 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8926 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8927 beginning of function.
8928 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8929 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8930 parameter is_32bit in calls to should_apply_static_reloc.
8931 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8932 (check_DATA): Add arm_abs_global.stdout.
8933 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8934 arm_abs_global.stdout): New rules.
8935 (MOSTLLYCLEANFILES): Add arm_abs_global
8936 * Makefile.in: Regenerate.
8937 * testsuite/arm_abs_global.s: New file.
8938 * testsuite/arm_abs_global.sh: Ditto.
8939 * testsuite/arm_abs_lib.s: Ditto.
8941 2010-02-11 Ian Lance Taylor <iant@google.com>
8943 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8945 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8946 Allocate_commons_task first.
8947 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8948 task, rather than symtab_lock_.
8949 (Gc_process_relocs::~Gc_process_relocs): New function.
8950 (Gc_process_relocs::is_runnable): Check this_blocker_.
8951 (Gc_process_relocs::locks): Use next_blocker_ rather than
8953 (Scan_relocs::~Scan_relocs): New function.
8954 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8956 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8958 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8959 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8960 constructor accordingly.
8961 (class Gc_process_relocs): Likewise.
8962 (class Scan_relocs): Likewise.
8963 * common.h (class Allocate_commons_task): Remove symtab_lock_
8964 field, and corresponding constructor parameter.
8965 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8967 (Allocate_commons_task::locks): Likewise.
8969 2010-02-11 Ian Lance Taylor <iant@google.com>
8971 * gold-threads.h (class Once): Define.
8972 (class Initialize_lock): Rewrite as child of Once.
8973 * gold-threads.cc (class Once_initialize): Define.
8974 (once_pointer_control): New static variable.
8975 (once_pointer, once_arg): New static variables.
8976 (c_run_once): New static function.
8977 (Once::Once, Once::run_once, Once::internal_run): New functions.
8978 (class Initialize_lock_once): Remove.
8979 (initialize_lock_control): Remove.
8980 (initialize_lock_pointer): Remove.
8981 (initialize_lock_once): Remove.
8982 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8983 (Initialize_lock::initialize): Rewrite.
8984 (Initialize_lock::do_run_once): New function.
8985 * archive.cc (Archive::interpret_header): Only clear name if it is
8987 * fileread.cc: Include "gold-threads.h"
8988 (file_counts_lock): New static variable.
8989 (file_counts_initialize_lock): Likewise.
8990 (File_read::release): Only increment counts when using --stats.
8991 Use a lock around the increment.
8992 * parameters.cc (class Set_parameters_target_once): Define.
8993 (set_parameters_target_once): New static variable.
8994 (Parameters::Parameters): Move here from parameters.h.
8995 (Parameters::set_target): Rewrite.
8996 (Parameters::set_target_once): New function.
8997 (Parameters::clear_target): Move here and rewrite.
8998 * parameters.h (class Parameters): Update declarations. Add
8999 set_parameters_target_once_ field.
9000 (Parameters::Parameters): Move to parameters.cc.
9001 (Parameters::clear_target): Likewise.
9002 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9004 (Start_group::~Start_group): New function.
9005 (Start_group::is_runnable): New function.
9006 (Start_group::locks, Start_group::run): New functions.
9007 (Finish_group::run): Change saw_undefined to size_t.
9008 * readsyms.h (class Start_group): Define.
9009 (class Finish_group): Change saw_undefined_ field to size_t.
9010 (Finish_group::Finish_group): Remove saw_undefined and
9011 this_blocker parameters. Change all callers.
9012 (Finish_group::set_saw_undefined): New function.
9013 (Finish_group::set_blocker): New function.
9014 * symtab.h (class Symbol_table): Change saw_undefined to return
9015 size_t. Change saw_undefined_ field to size_t.
9016 * target-select.cc (Set_target_once::do_run_once): New function.
9017 (Target_selector::Target_selector): Initialize set_target_once_
9018 field. Don't initialize lock_ and initialize_lock_ fields.
9019 (Target_selector::instantiate_target): Rewrite.
9020 (Target_selector::set_target): New function.
9021 * target-select.h (class Set_target_once): Define.
9022 (class Target_selector): Update declarations. Make
9023 Set_target_once a friend. Remove lock_ and initialize_lock_
9024 fields. Add set_target_once_ field.
9026 2010-02-10 Ian Lance Taylor <iant@google.com>
9028 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9030 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9031 (queue_middle_tasks): Add all blockers before queueing any tasks.
9032 (queue_final_tasks): Likewise.
9033 * token.h (Task_token::add_blockers): New function.
9034 * object.h (Input_objects::number_of_relobjs): New function.
9036 2010-02-10 Ian Lance Taylor <iant@google.com>
9038 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9039 shared, not if not position independent.
9040 * x86_64.cc (Relocate::relocate_tls): Likewise.
9041 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9042 (tls_pie_pic_test): New target.
9043 * testsuite/Makefile.in: Rebuild.
9045 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9046 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9047 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9048 * testsuite/Makefile.in: Rebuild.
9050 2010-02-09 David S. Miller <davem@davemloft.net>
9052 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9053 R_SPARC_RELATIVE using ->add_local_relative().
9054 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9056 * output.h (Output_data_dynamic::add_section_size): New method
9057 that takes two Output_data objects.
9058 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9059 entry param. Handle it in initializers.
9060 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9061 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9062 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9064 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9065 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9066 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9067 for dynrel_includes_plt.
9068 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9069 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9070 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9072 (Target_sparc::do_finalize_sections): Update to pass true for
9073 dynrel_includes_plt.
9074 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9075 output before .rela.plt
9076 (Target_powerpc::do_finalize_sections): Update to pass true for
9077 dynrel_includes_plt when 32-bit.
9079 2010-02-08 Doug Kwan <dougkwan@google.com>
9081 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9083 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9084 Arm_relobj::scan_section_for_cortex_a8_stubs,
9085 Arm_relobj::do_relocation_section): Instead of calling
9086 Output_section::output_address, use faster
9087 Arm_relobj::simple_input_section_output_address.
9089 2010-02-08 David S. Miller <davem@davemloft.net>
9091 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9092 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9093 relocation helper function.
9095 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9096 just like R_SPARC_GOT{10,13,22}.
9097 (Target_sparc::Scan::local): Likewise.
9098 (Target_sparc::Relocate:relocate): Likewise.
9100 2010-02-06 Ian Lance Taylor <iant@google.com>
9102 * configure.ac: Rewrite targetobjs duplicate removal code to use
9103 only shell constructs.
9104 * configure: Rebuild.
9106 2010-02-05 Doug Kwan <dougkwan@google.com>
9109 * arm.cc (Arm_relobj::section_is_scannable): New method.
9110 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9111 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9113 2010-02-04 Doug Kwan <dougkwan@google.com>
9116 * arm-reloc-property.cc (cstdio): Include.
9117 * configure.ac (targetobjs): Remove duplicates.
9118 * configure: Regenerate.
9119 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9120 big and little endian version for a given address size.
9122 2010-02-03 Doug Kwan <dougkwan@google.com>
9124 * arm-reloc-property.cc
9125 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9127 * arm-reloc-property.h
9128 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9129 New method definition.
9130 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9132 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9134 (GOT_PREL): Change implemented to Y.
9135 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9136 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9137 (Arm_relocate_functions::movw_abs_nc): Remove method.
9138 (Arm_relocate_functions::movt_abs): Ditto.
9139 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9140 (Arm_relocate_functions::thm_movt_abs): Ditto.
9141 (Arm_relocate_functions::movw_rel_nc): Ditto.
9142 (Arm_relocate_functions::movw_rel): Ditto.
9143 (Arm_relocate_functions::movt_rel): Ditto.
9144 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9145 (Arm_relocate_functions:thm_movw_rel): Ditto.
9146 (Arm_relocate_functions:thm_movt_rel): Ditto.
9147 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9148 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9149 New method definitions.
9150 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9151 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9152 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9153 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9154 (Target_arm::Relocate::relocate): Check for non-static or
9155 unimplemented relocation code and exit early. Change calls to
9156 Target_arm::reloc_uses_thumb_bit and
9157 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9158 instead. Refactor code to handle similar relocations to increase
9159 code sharing. Remove check for unsupported relocation code in switch
9161 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9162 relocation property table to find out size. Change error message to
9163 print out the name of a relocation code instead of the numeric value.
9164 (Target_arm::scan_reloc_for_stub): Use relocation property table
9165 instead of calling Target_arm::reloc_uses_thumb_bit().
9167 2010-02-02 Doug Kwan <dougkwan@google.com>
9169 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9170 types of relaxed input section.
9172 2010-02-02 Doug Kwan <dougkwan@google.com>
9174 * Makefile.am (HFILES): Add arm-reloc-property.h.
9176 (TARGETSOURCES): Add arm-reloc-property.cc
9177 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
9178 (libgold_a_SOURCES): $(DEFFILES)
9179 * Makefile.in: Regenerate.
9180 * arm-reloc-property.cc: New file.
9181 * arm-reloc-property.h: New file.
9182 * arm-reloc.def: New file.
9183 * arm.cc: Update comments.
9184 (arm-reloc-property.h): New included header.
9185 (arm_reloc_property_table): New global variable.
9186 (Target_arm::do_select_as_default_target): New method definition.
9187 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9188 arm-reloc-property to targ_extra_obj.
9189 * parameters.cc (set_parameters_target): Call
9190 Target::select_as_default_target().
9191 * target.h (Target::select_as_default_target): New method definition.
9192 (Target::do_select_as_default_target): Same.
9194 2010-02-01 Doug Kwan <dougkwan@google.com>
9196 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9197 first_output_text_section_.
9198 (Arm_exidx_fixup::first_output_text_section): New method definition.
9199 (Arm_exidx_fixup::first_output_text_section_): New data member.
9200 (Arm_exidx_fixup::process_exidx_section): Record the first text
9201 output section seen.
9202 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9203 and entsize in output section header.
9205 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9207 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9208 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9209 (Arm_relocate_functions::thm_alu11): New Method.
9210 (Arm_relocate_functions::thm_pc8): New Method.
9211 (Arm_relocate_functions::thm_pc12): New Method.
9212 (Target_arm::Scan::local): Handle the relocations.
9213 (Target_arm::Scan::global): Likewise.
9214 (Target_arm::Relocate::relocate): Likewise.
9215 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9217 2010-01-29 Doug Kwan <dougkwan@google.com>
9219 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9220 of relocation types as ld.
9222 2010-01-29 Doug Kwan <dougkwan@google.com>
9224 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9226 (Arm_relocate_functions::thumb_branch_common): Ditto.
9227 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9228 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9229 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9230 Arm_relocate_functions::jump24): Remove.
9231 (Target_arm::Relocate::relocate): Adjust code to call
9232 Arm_relocation_functions::arm_branch_common and
9233 Arm_relocation_functions::thumb_branch_common instead of their removed
9234 wrappers. Merge switch-cases together to reduce source code size.
9236 2010-01-29 Doug Kwan <dougkwan@google.com>
9238 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9239 output_local_symbol_count_needs_update_.
9240 (Arm_relobj::output_local_symbol_count_needs_update,
9241 Arm_relobj::set_output_local_symbol_count_needs_update,
9242 Arm_relobj::update_output_local_symbol_count): New methods.
9243 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9245 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9246 of pointed function as in a R_ARM_PREL31 relocation.
9247 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9248 for output local symbol count updating.
9249 (Target_arm::do_relax): Update output local symbol counts in objects
9251 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9253 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9255 * arm.cc: Added support for the ARM relocations:
9256 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9257 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9258 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9260 (Arm_relocate_functions::movw_rel): New method.
9261 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9262 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9264 (Arm_relocate_functions::thm_movw_rel): New method.
9265 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9267 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9269 (Target_arm::Scan::global): Likewise.
9270 (Target_arm::Relocate::relocate): Likewise.
9271 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9274 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9276 * arm.cc: Added support for ARM group relocations.
9277 (Target_arm::reloc_needs_sym_origin): New method.
9278 (Arm_relocate_functions::calc_grp_kn): New method.
9279 (Arm_relocate_functions::calc_grp_residual): New method.
9280 (Arm_relocate_functions::calc_grp_gn): New method.
9281 (Arm_relocate_functions::arm_grp_alu): New Method.
9282 (Arm_relocate_functions::arm_grp_ldr): New Method.
9283 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9284 (Arm_relocate_functions::arm_grp_ldc): New Method.
9285 (Target_arm::Scan::local): Handle the ARM group relocations.
9286 (Target_arm::Scan::global): Likewise.
9287 (Target_arm::Relocate::relocate): Likewise.
9288 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9291 2010-01-26 Doug Kwan <dougkwan@google.com>
9293 * arm.cc (set): Include.
9294 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9296 (Arm_output_section::Text_section_list): New type.
9297 (Arm_output_section::append_text_sections_to_list): New method.
9298 (Arm_output_section::fix_exidx_coverage): Ditto.
9299 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
9300 (Arm_relobj::convert_input_section_to_relaxed_section): Use
9301 Relobj::set_section_offset() instead of
9302 Sized_relobj::invalidate_section_offset().
9303 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
9304 parameter for section headers. Ignore relocation sections for
9305 unallocated sections and EXIDX sections.
9306 (Target_arm::fix_exidx_coverage): New method.
9307 (Target_arm::output_section_address_less_than): New type.
9308 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9309 linked text section instead of the EXIDX section.
9310 (Arm_output_section::create_stub_group): Add an assertion to check
9311 that this is not an EXIDX output section.
9312 (Arm_output_section::append_text_sections_to_list): New method.
9313 (Arm_output_section::fix_exidx_coverage): Ditto.
9314 (Arm_relobj::scan_sections_for_stubs): Adjust call to
9315 Arm_relobj::section_needs_reloc_stub_scanning.
9316 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9318 (Target_arm::fix_exidx_coverage): New method.
9319 * object.h (Relobj::set_output_section): New method.
9320 (Sized_relobj::invalidate_section_offset): Remove method.
9321 (Sized_relobj::do_invalidate_section_offset): Remove method.
9322 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9324 2010-01-25 Doug Kwan <dougkwan@google.com>
9326 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9327 Fix warning due to signed and unsigned comparison on a 32-bit host.
9329 2010-01-22 Doug Kwan <dougkwan@google.com>
9331 * arm.cc (Target_arm::do_relax): Record an output section for section
9332 offset adjustment it contains any stub table that has changed.
9333 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9334 offsets in an output section if necessary.
9335 * output.cc (Output_section::Output_section): Initialize
9336 section_offsets_need_adjustments_.
9337 (Output_section::add_input_section_for_script): Renamed to
9338 Output_section::add_simple_input_section.
9339 (Output_section::save_states): Add a comment.
9340 (Output_section::discard_states): New method defintion.
9341 (Output_section::adjust_section_offsets): Same.
9342 * output.h (Output_section::add_input_section_for_script): Renamed to
9343 Output_section::add_simple_input_section.
9344 (Output_section::discard_states): New method declaration.
9345 (Output_section::adjust_section_offsets): Same.
9346 (Output_section::section_offsets_need_adjustment,
9347 Output_section::set_section_offsets_need_adjustment): New method
9349 (Output_section::section_offsets_need_adjustment_): New data member.
9350 * script-sections.cc
9351 (Output_section_element_input::set_section_address): Adjust code for
9352 renaming of Output_section::add_input_section_for_script.
9353 (Orphan_output_section::set_section_address): Same.
9355 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9357 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9358 Fix_v4bx enum values .
9359 * gold/options.h (General_options): New option definitions.
9360 (General_options::fix_v4bx): New method.
9361 (General_options::Fix_v4bx): New enum.
9362 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9363 (General_options::parse_fix_v4bx_interworking): New method.
9365 2010-01-22 Doug Kwan <dougkwan@google.com>
9367 * arm.cc (Arm_exidx_fixup): New class.
9369 2010-01-21 Doug Kwan <dougkwan@google.com>
9371 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9373 (Arm_exidx_section_offset_map): New type.
9375 2010-01-21 Doug Kwan <dougkwan@google.com>
9377 * arm.cc (Arm_exidx_input_section): New class.
9378 (Arm_relobj::exidx_input_section_by_link,
9379 Arm_relobj::exidx_input_section_by_shndx,
9380 Arm_relobj::make_exidx_input_section): New methods.
9381 (read_arm_attributes_section): Remove.
9382 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9383 information about them.
9384 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9387 2010-01-20 Doug Kwan <dougkwan@google.com>
9389 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9390 Input_section_specifier to Section_id.
9391 (Target_arm::new_arm_input_section: Adjust code for change of key
9393 (Target_arm::find_arm_input_section): Ditto.
9394 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9395 (Section_id): Remove.
9396 (Garbage_collection::Section_id_hash): Remove.
9397 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9398 (Section_id): Remove.
9399 (Icf::Section_id_hash): Remove.
9400 * object.h (Section_id, Const_section_id, Section_id_hash,
9401 Const_section_id_hash): New type definitions.
9402 * output.cc (Output_section::add_relaxed_input_section): Change to
9403 use Const_section_id instead of Input_section_specifier as key type.
9404 (Output_section::add_merge_input_section): Ditto.
9405 (Output_section::build_relaxation_map): Change to use Section_id
9406 instead of Input_section_specifier as key type.
9407 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9409 (Output_section::convert_input_sections_to_relaxed_sections): Change
9410 to use Const_section_id instead of Input_section_specifier as key type.
9411 (Output_section::find_merge_section): Ditto.
9412 (Output_section::find_relaxed_input_section): Ditto.
9413 * output.h (Input_section_specifier): Remove class.
9414 (Output_section::Output_section_data_by_input_section_map): Change
9415 key type to Const_section_id.
9416 (Output_section::Output_relaxed_input_section_by_input_section_map):
9418 (Output_section::Relaxation_map): Change key type to Section_id.
9420 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9422 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9423 (class Arm_v4bx_stub): New class.
9424 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9425 (Stub_factory::make_arm_v4bx_stub): New method.
9426 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9427 (Stub_table::empty): Handle v4bx stubs.
9428 (Stub_table::add_arm_v4bx_stub): New method.
9429 (Stub_table::find_arm_v4bx_stub): New method.
9430 (Arm_relocate_functions::v4bx): New method.
9431 (Target_arm::fix_v4bx): New method.
9432 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9433 (Stub_table::relocate_stubs): Likewise.
9434 (Stub_table::do_write): Likewise.
9435 (Stub_table::update_data_size_and_addralign): Likewise.
9436 (Stub_table::finalize_stubs): Likewise.
9437 (Target_arm::Scan::local): Likewise.
9438 (Target_arm::Scan::global): Likewise.
9439 (Target_arm::do_finalize_sections): Likewise.
9440 (Target_arm::Relocate::relocate): Likewise.
9441 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9443 (Target_arm::scan_reloc_for_stub): Likewise.
9444 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9446 2010-01-19 Ian Lance Taylor <iant@google.com>
9448 * output.cc (Output_section_headers::do_sized_write): Write large
9449 segment count to sh_info field.
9450 (Output_file_header::do_sized_write): For large segment count,
9451 write PN_XNUM to e_phnum field.
9453 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9455 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9456 (Arm_relocate_functions::thm_jump8): New function.
9457 (Arm_relocate_functions::thm_jump11): New function.
9458 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9460 (Target_arm::Scan::global): Likewise.
9461 (Target_arm::Relocate::relocate): Likewise.
9462 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9465 2010-01-14 Doug Kwan <dougkwan@google.com>
9467 * arm.cc (map, utility): Include headers.
9468 (Target_arm::apply_cortex_a8_workaround): New method.
9469 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9470 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9471 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9472 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9473 the --[no-]fix-cortex-a8 command line options.
9474 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9475 (Target_arm::relocate_stub): Use addend in instruction template.
9476 * options.h (DEFINE_bool): Set the user-set flag.
9477 (General_options): Add --[no-]-fix-cortex options.
9478 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
9479 : Update fast look-up map after conversion.
9481 2010-01-14 Sriraman Tallam <tmsriram@google.com>
9483 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9484 in the first pass of do_layout.
9486 2010-01-13 Doug Kwan <dougkwan@google.com>
9488 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9489 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9490 apparent compiler problem of not folding static constant integral
9491 data members of elfcpp::Elf_sizes<32>.
9493 2010-01-13 Doug Kwan <dougkwan@google.com>
9495 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9496 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9497 Arm_relobj::scan_section_for_cortex_a8_erratum,
9498 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9499 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9500 sections to scan for relocation stubs into a new method
9501 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9502 relocation and Cortex-A8 stub scanning.
9503 (Target_arm::do_relax): Force stubs to be after stubbed sections
9504 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
9505 the beginning of a new relaxation pass. Update a comment.
9506 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9508 2010-01-12 Ian Lance Taylor <iant@google.com>
9510 * target-reloc.h (visibility_error): New inline function.
9511 (relocate_section): Call visibility_error.
9512 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9513 (MOSTLYCLEANFILES): Likewise.
9514 (protected_4_pic.o, protected_3.err): New targets.
9515 * testsuite/protected_4.cc: New file.
9517 2010-01-12 Doug Kwan <dougkwan@google.com>
9519 * arm.cc (Cortex_a8_reloc): New class.
9520 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9521 and cortex_a8_relocs_info_.
9522 (Target_arm::fix_cortex_a8): New method definition.
9523 (Target_arm::Cortex_a8_relocs_info): New type.
9524 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9525 New data member declarations.
9526 (Target_arm::scan_reloc_for_stub): Record information about
9527 relocations for THUMB branches that might be exempted from the
9528 Cortex-A8 workaround.
9529 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9530 at the beginning of a relaxation pass.
9532 2010-01-12 Doug Kwan <dougkwan@google.com>
9534 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9535 (Arm_relobj::Mapping_symbol_position,
9536 Arm_reloj::Mapping_symbol_position_less,
9537 Arm_relobj::Mapping_symbols_info): New types.
9538 (Target_arm::is_mapping_symbol_name): New method definition.
9539 (Arm_relobj::do_count_local_symbols): Save information about mapping
9542 2010-01-11 Doug Kwan <dougkwan@google.com>
9544 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9545 Arm_relocate_functions::thumb32_branch_upper,
9546 Arm_relocate_functions::thumb32_branch_lower,
9547 Arm_relocate_functions::thumb32_cond_branch_offset,
9548 Arm_relocate_functions::thumb32_cond_branch_upper,
9549 Arm_relocate_functions::thumb32_cond_branch_lower,
9550 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9551 branch offset encoding.
9552 (Arm_relocate_functions::thumb_branch_common): Use new branch
9553 offset encoding methods to avoid code duplication.
9554 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9555 (Stub_addend_reader::operator()): Use new branch encoding method
9556 to avoid code duplication.
9558 2010-01-11 Doug Kwan <dougkwan@google.com>
9560 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9561 (Target_arm::do_finalize_sections): Define special EXIDX section
9562 symbols only if referenced.
9563 * gc.h (Garbage_collection::add_reference): New method.
9564 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9567 2010-01-11 Ian Lance Taylor <iant@google.com>
9569 * script.cc (Version_script_info::build_expression_list_lookup):
9570 Change complaing about duplicate wildcard match from error to
9573 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9575 (Version_script_info::Version_script_info): Initialize globs_,
9576 default_version_, default_is_global_, and exact_. Don't
9577 initialize globals_ or locals_.
9578 (Version_script_info::build_lookup_tables): Build local symbols
9580 (Version_script_info::unquote): New function.
9581 (Version_script_info::add_exact_match): New function.
9582 (Version_script_info::build_expression_list_lookup): Remove lookup
9583 parameter. Add is_global parameter. Change all callers. Handle
9584 wildcard pattern specially. Unquote pattern. Call
9586 (Version_script_info::get_name_to_match): New function.
9587 (Version_script_info::get_symbol_version): New function.
9588 (Version_script_info::get_symbol_version_helper): Remove.
9589 (Version_script_info::check_unmatched_names): Call unquote.
9590 * script.h (class Version_script_info): Change get_symbol_version
9591 to be non-inline and add is_global parameter; change all callers.
9592 Rewrite symbol_is_local. Update declarations. Define struct
9593 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9594 Remove globals_ and locals_ members. Add exact_, globs_,
9595 default_version_, is_global_.
9596 (Version_script_info::Glob): Remove pattern, add expression and
9597 is_global. Update constructor. Change all callers.
9598 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9600 (Versions::symbol_section_contents): If a symbol is undefined, or
9601 defined in a dynamic object, set the version index to
9603 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9605 (Symbol_table::add_from_pluginobj): Likewise.
9606 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9608 2010-01-11 Doug Kwan <dougkwan@google.com>
9610 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9611 (incremental_dump_LDADD): Add linking option for libintl.
9612 * Makefile.in: Regenerate.
9614 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9617 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9619 * testsuite/Makefile.in: Regenerated.
9621 2010-01-10 Doug Kwan <dougkwan@google.com>
9623 * options.h (DEFINE_var): Use parentheses around argument varname__
9624 in macro body to avoid any unintended subsequent substitutions.
9626 2010-01-10 Ian Lance Taylor <iant@google.com>
9628 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9629 candidates before doing symbol resolution.
9631 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9632 ODR candidates if only one is weak.
9634 2010-01-08 Ian Lance Taylor <iant@google.com>
9636 * script.cc (Version_script_info::build_expression_list_lookup):
9637 Don't warn about ambiguous version, just record the ambiguity.
9638 (Version_script_info::get_symbol_version_helper): Give error if
9639 version is ambiguous.
9641 2010-01-08 Doug Kwan <dougkwan@google.com>
9643 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
9644 prev_data_size_ and prev_addralign_. Remove initializer for
9645 deleted data member has_been_changed_.
9646 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9647 to determine if the table is empty.
9648 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9650 (Stub_table::add_reloc_stub): Define method in class definition
9651 instead of just declaring it there.
9652 (Stub_table::add_cortex_a8_stub): New method definition.
9653 (Stub_table::update_data_size_and_addralign): Ditto.
9654 (Stub_table::finalize_stubs): Ditto.
9655 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9656 (Stub_table::do_addralign_): Return address alignment in the
9657 (Stub_table::do_reset_address_and_file_offset): Define method in
9658 class definition instead of declaring it there. Set current data
9659 size to be the data size of the previous pass.
9660 (Stub_table::set_final_data_size): Use current data size as the
9662 (Stub_table::relocate_stub): Change parameter type of stub from
9663 Reloc_stub pointer to Stub pointer.
9664 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9665 (Stub_table::Cortex_a8_stub_list): New typedef.
9666 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9667 Stub_table::prev_addralign_): New data member.
9668 (Arm_relobj::Arm_relobj): Initialize data member
9669 section_has_cortex_a8_workaround_.
9670 (Arm_relobj::section_has_cortex_a8_workaround,
9671 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9673 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9675 (Target_arm::relocate_stub): Change parameter type of stub from
9676 Reloc_stub pointer to Stub pointer.
9677 (Insn_template::size, Insn_template::alignment): Handle
9678 THUMB16_SPECIAL_TYPE.
9679 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9680 Stub_table::update_data_size_and_addralign,
9681 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9683 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9684 (Stub_table::do_write): Ditto.
9685 (Target_arm::do_relax): Adjust code for changes in Stub_table.
9687 2010-01-08 Ian Lance Taylor <iant@google.com>
9690 * symtab.h (class Symbol): Remove fields is_target_special_ and
9691 has_plt_offset_. Add field is_defined_in_discarded_section_.
9692 (Symbol::is_defined_in_discarded_section): New function.
9693 (Symbol::set_is_defined_in_discarded_section): New function.
9694 (Symbol::has_plt_offset): Rewrite.
9695 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9696 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9697 Don't initialize is_target_special_ or has_plt_offset_.
9698 Initialize is_defined_in_discarded_section_.
9699 (Symbol_table::add_from_relobj): If appropriate, set
9700 is_defined_in_discarded_section.
9701 * resolve.cc (Symbol::override_base_with_special): Don't test
9702 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9703 * target-reloc.h (relocate_section): Do special handling for
9704 symbols defined in discarded sections for global symbols as well
9707 2010-01-08 Ian Lance Taylor <iant@google.com>
9709 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9710 the SHT_SYMTAB case.
9712 2010-01-08 Ian Lance Taylor <iant@google.com>
9714 * object.cc (Sized_relobj::do_layout): Don't get confused if
9715 layout_eh_frame returns NULL.
9717 2010-01-08 Ian Lance Taylor <iant@google.com>
9720 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9721 dynamic symbol table, use the normal symbol table.
9722 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9725 2010-01-08 Ian Lance Taylor <iant@google.com>
9728 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9731 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9733 * version.cc (print_version): Change to "Copyright 2010".
9735 2010-01-08 Ian Lance Taylor <iant@google.com>
9739 * i386.cc (class Target_i386): Change return type of plt_section
9741 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9742 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9743 tls_desc_rel_ field.
9744 (Output_data_plt_i386::rel_tls_desc): New function.
9745 (Target_i386::rel_tls_desc_section): New function.
9746 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9747 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9748 R_386_TLS_DESC reloc in rel_tls_desc_section.
9749 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9750 Define struct Tlsdesc_info.
9751 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9752 (Target_x86_64::do_reloc_symbol_index): New function.
9753 (Target_x86_64::add_tlsdesc_info): New function.
9754 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9755 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9757 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9759 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9760 (Target_x86_64::rela_tlsdesc_section): New function.
9761 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9763 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9764 (Target_x86_64::do_reloc_addend): New function.
9765 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9766 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9767 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9768 (Output_reloc::type): New function.
9769 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9770 (Output_reloc::is_target_specific): New function.
9771 (Output_reloc::target_arg): New function.
9772 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9773 absolute relocs and target specific relocs.
9774 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9775 add_target_specific.
9776 (class Output_data_reloc) [SHT_RELA]: Likewise.
9777 * output.cc (Output_reloc::Output_reloc): Add four new versions
9778 for absolute relocs and target specific relocs.
9779 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9780 (Output_reloc::get_symbol_index): Likewise.
9781 (Output_reloc::local_section_offset): Check that local_sym_index_
9782 is not TARGET_CODE or 0.
9783 (Output_reloc::symbol_value): Likewise.
9784 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9786 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9787 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9789 * layout.cc (add_target_dynamic_tags): Use output section for
9790 DT_PLTRELSZ and DT_JMPREL.
9792 2010-01-07 Ian Lance Taylor <iant@google.com>
9795 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9797 (class Output_data_reloc_generic): Define.
9798 (class Output_data_reloc_base): Change base class to
9799 Output_data_reloc_generic. Change add() method to call
9800 bump_relative_reloc_count for a relative reloc. Remove
9802 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9804 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9805 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9807 * layout.h (class Layout): Update declaration.
9809 2010-01-07 Ian Lance Taylor <iant@google.com>
9811 * output.h (class Output_data): Add const version of
9812 output_section and do_output_section.
9813 (class Output_section_data): Add const version of
9815 (class Output_section): Likewise.
9816 * layout.cc (Layout::add_target_dynamic_tags): New function.
9817 * layout.h (class Layout): Update declarations.
9818 * arm.cc (Target_arm::do_finalize_sections): Use
9819 add_target_dynamic_tags.
9820 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9821 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9822 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9823 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9825 2010-01-07 Ian Lance Taylor <iant@google.com>
9828 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9831 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9832 Ian Lance Taylor <iant@google.com>
9835 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9836 Xindex::read_symtab_xindex.
9838 2010-01-07 Doug Kwan <dougkwan@google.com>
9840 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9841 (Insn_template::thumb16_bcond_insn): New method declaration.
9842 (Insn_template): Fix spelling.
9843 (Stub::thumb16_special): New method declaration.
9844 (Stub::do_write): Define virtual method which was previously pure
9846 (Stub::do_thumb16_special): New method declaration.
9847 (Stub::do_fixed_endian_write): New template member.
9848 (Reloc_stub::do_write): Remove.
9849 (Reloc_stub::do_fixed_endian_write): Remove.
9850 (Cortex_a8_stub): New class definition.
9851 (Stub_factory::make_cortex_a8_stub): New method definition.
9852 (Stub_factory::Stub_factory): Add missing static storage class
9853 qualifier for elf32_arm_stub_a8_veneer_blx.
9855 2010-01-07 Ian Lance Taylor <iant@google.com>
9858 * options.h (class General_options): Add --warn-unresolved-symbols
9859 and --error-unresolved-symbols.
9860 * errors.cc (Errors::undefined_symbol): Implement
9861 --warn-unresolved-symbols.
9863 * options.h (class General_options): Add -z text and -z textoff.
9864 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9866 2010-01-06 Sriraman Tallam <tmsriram@google.com>
9868 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9869 (Garbage_collection::cident_sections): New function.
9870 (Garbage_collection::add_cident_section): New function.
9871 (Garbage_collection::cident_sections_): New member.
9872 (gc_process_relocs): Add references to sections whose names are C
9874 * gold.h (cident_section_start_prefix): New constant.
9875 (cident_section_stop_prefix): New constant.
9876 (is_cident): New function.
9877 * layout.cc (Layout::define_section_symbols): Replace string constants
9878 with the newly defined constants.
9879 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9881 * testsuite/Makefile.am: Add gc_orphan_section_test.
9882 * testsuite/Makefile.in: Regenerate.
9883 * testsuite/gc_orphan_section_test.cc: New file.
9884 * testsuite/gc_orphan_section_test.sh: New file.
9886 2010-01-06 Ian Lance Taylor <iant@google.com>
9889 * options.h (class General_options): Add --warn-shared-textrel.
9890 * layout.cc (Layout::finish_dynamic_section): Implement
9891 --warn-shared-textrel.
9894 * options.h (class General_options): Add --warn-multiple-gp.
9896 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9898 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9899 $(THREADSLIB) and $(LIBDL).
9900 * Makefile.in: Rebuild.
9902 2010-01-06 Ian Lance Taylor <iant@google.com>
9905 * options.cc (General_options::parse_section_start): New function.
9906 (General_options::section_start): New function.
9907 (General_options::General_options): Initialize all members.
9908 * options.h: Include <map>
9909 (class General_options): Add --section-start. Add section_starts_
9911 * layout.cc (Layout::attach_allocated_section_to_segment): If
9912 --section-start was used, set the address of the segment. Remove
9913 local sort_sections.
9914 (Layout::relaxation_loop_body): If the address of the load segment
9915 has been set by --section-start, don't use it.
9916 * output.h (Output_segment::update_flags_for_output_section): New
9918 * output.cc (Output_segment::add_output_section): Call
9919 update_flags_for_output_section.
9921 2010-01-05 Ian Lance Taylor <iant@google.com>
9924 * options.h (class General_options): Add --undefined-version.
9925 * script.cc (struct Version_expression): Add was_matched_by_symbol
9927 (Version_script_info::matched_symbol): New function.
9928 (Version_script_info::get_symbol_version_helper): Call
9930 (Version_script_info::check_unmatched_names): New function.
9931 * script.h (class Version_script_info): Update declarations.
9932 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9934 * options.h (class General_options): Use DEFINE_bool_alias for
9935 allow_multiple_definition.
9936 * resolve.cc (Symbol_table::should_override): Don't test
9937 allow_multiple_definition.
9940 * options.h (class General_options): Add --cref.
9941 * main.cc (main): Print cref table if --cref. Don't close mapfile
9942 until after printing cref table.
9943 * cref.cc: Include "symtab.h".
9944 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9945 (Cref_table_compare::operator()): New function.
9946 (Cref_inputs::gather_cref): New function.
9947 (filecol): New static const.
9948 (Cref_inputs::print_cref): New function.
9949 (Cref::print_cref): New function.
9950 * cref.h: Include <cstdio>.
9951 (class Cref): Update declarations.
9952 * mapfile.h (Mapfile::file): New function.
9953 * object.h (class Object): Define Symbols. Declare virtual
9954 do_get_global_symbols.
9955 (Object::get_global_symbols): New function.
9956 * object.cc (Input_objects::add_object): Pass object to cref_ if
9958 (Input_objects::archive_start): Likewise.
9959 (Input_objects::archive_stop): Likewise.
9960 (Input_objects::print_cref): New function.
9961 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9962 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9964 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9966 * plugin.h (class Sized_pluginobj): Update declarations.
9968 2010-01-05 Ian Lance Taylor <iant@google.com>
9970 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9971 to is_default_version. Rename insdef to insdefault.
9972 (Symbol_table::add_from_relobj): Rename def to is_default_version
9973 and local to is_forced_local.
9974 (Symbol_table::add_from_pluginobj): Likewise.
9975 (Symbol_table::add_from_dynobj): Likewise.
9976 (Symbol_table::define_special_symbol): Rename insdef to
9979 2010-01-04 Ian Lance Taylor <iant@google.com>
9982 * options.h (class General_options): Add
9983 --allow-multiple-definition and -z muldefs.
9984 * resolve.cc (Symbol_table::should_override): Don't warn about a
9985 multiple symbol definition if --allow-multiple-definition or -z
9989 * options.h (class General_options): Add --add-needed and
9990 --copy-dt-needed-entries. Tweak --as-needed help entry.
9991 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9992 error if --copy-dt-needed-entries aka --add-needed is used and
9993 would cause a change in behaviour.
9996 * options.h (class General_options): Add -G as a short version of
9997 --shared. Add no-op options -assert, -g, and -i.
9999 2010-01-04 Sriraman Tallam <tmsriram@google.com>
10001 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10002 check for .text or .gnu.linkonce.t sections.
10003 * icf.cc (Icf::find_identical_sections): Ditto.
10004 Change the detection for mangled function name within the section
10006 * icf.h (is_section_foldable_candidate): New function.
10008 2009-12-30 Ian Lance Taylor <iant@google.com>
10011 * options.h (class General_options): Permit two dashes with
10012 --retain-symbols-file.
10014 2009-12-30 Ian Lance Taylor <iant@google.com>
10017 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10018 don't put the file header and segment headers in the text
10022 * common.cc (Sort_commons::operator()): Stabilize sort when both
10024 (Symbol_table::do_allocate_commons_list): When allocating common
10025 symbols, skip a symbol which is no longer common.
10026 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10027 an object before checking its type.
10028 * testsuite/common_test_2.c: New file.
10029 * testsuite/common_test_3.c: New file.
10030 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10031 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10032 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10033 (common_test_2_pic.o, common_test_2.so): New targets.
10034 (common_test_3_pic.o, common_test_3.so): New targets.
10035 * testsuite/Makefile.in: Rebuild.
10038 * script.cc (read_input_script): If we see a new SECTIONS clause,
10039 and we have added an input section, give an error.
10040 * layout.h (class Layout): Add have_added_input_section function.
10041 Add have_added_input_section_ field.
10042 * layout.cc (Layout::Layout): Initialize
10043 have_added_input_section_.
10044 (Layout::layout): Set have_added_input_section_.
10045 (Layout::layout_eh_frame): Likewise.
10047 2009-12-30 Ian Lance Taylor <iant@google.com>
10050 * options.h (class General_options): Add --sort-common option.
10051 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10052 * common.cc (Sort_common): Add sort_order parameter to
10053 constructor. Add sort_order_ field.
10054 (Sort_commons::operator): Check sort_order_.
10055 (Symbol_table::allocate_commons): Determine the sort order.
10056 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10057 Change all callers.
10058 (Symbol_table::do_allocate_commons_list): Likewise.
10060 2009-12-30 Ian Lance Taylor <iant@google.com>
10063 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10064 symbols from this object, don't change the visibility of an
10066 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10068 2009-12-30 Ian Lance Taylor <iant@google.com>
10071 * script.h (class Version_script_info): Define Language enum.
10072 Update declarations. Define Glob, Exact, and Lookup types. Add
10073 new fields globals_, locals_, and is_finalized_.
10074 * script.cc: Various formatting fixes.
10075 (class Parser_closure): Change language_stack_ from a vector of
10076 std::string to one of Version_script_info::Language. Adjust all
10078 (class Lazy_demangler): Remove.
10079 (struct Version_expression): Change language from std::string to
10080 Version_script_info::Language.
10081 (Version_script_info::Version_script_info): New function.
10082 (Version_script_info::~Version_script_info): Don't call clear.
10083 (Version_script_info::finalize): New function.
10084 (Version_script_info::build_lookup_tables): New function.
10085 (Version_script_info::build_expression_list_lookup): New
10087 (Version_script_info::get_symbol_version_helper): Rewrite to use
10089 (Version_script_info::print_expression_list): Adjust to use
10090 Version_script_info::Language.
10091 (script_push_lex_into_version_mode): Check that the version script
10092 has not been finalized.
10093 (version_script_push_lang): Change language string to
10094 Version_script_info::Language.
10095 * options.cc (Command_line::version_script): New function.
10096 * options.h (class General_options): Add finalize_dynamic_list
10097 function. Change version_script from declaration to definition.
10098 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10099 * testsuite/version_script.map: Remove duplicate def of foo.
10100 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10101 version_script.map.
10102 * testsuite/Makefile.in: Rebuild.
10104 2009-12-30 Ian Lance Taylor <iant@google.com>
10107 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10108 if the input symbol index is 0, make the output symbol index 0.
10110 2009-12-30 Ian Lance Taylor <iant@google.com>
10113 * options.h (class General_options): Add -x/--discard-all.
10114 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10115 --discard-all. If the local symbol needs a dynamic entry, check
10116 that before handling --discard-locals.
10118 2009-12-30 Ian Lance Taylor <iant@google.com>
10121 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10123 (Output_segment::add_output_section): Don't change the flags if
10124 the type is PT_TLS.
10127 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10128 GNU hash table if they need a dynamic value. Otherwise, don't add
10129 them if they are defined in a dynamic object or are forced local.
10131 2009-12-29 Ian Lance Taylor <iant@google.com>
10134 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10135 .gnu.hash table for a 32-bit target.
10138 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10139 regular and a dynamic object only needs a dynamic symbol table
10140 entry if it is externally visible.
10143 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10144 constructor. Add global_offset_table_ field.
10145 (Target_i386::got_section): Set global_offset_table_.
10146 (Target_i386::do_finalize_sections): Set global_offset_table_
10148 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10149 in constructor. Add global_offset_table_ field.
10150 (Target_x86_64::got_section): Set global_offset_table_.
10151 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10154 * layout.cc (Layout::Layout): Initialize increase_relro_.
10155 (Layout::get_output_section): Add is_relro, is_last_relro, and
10156 is_first_non_relro parameters. Change all callers.
10157 (Layout::choose_output_section): Likewise.
10158 (Layout::add_output_section_data): Likewise.
10159 (Layout::make_output_section): Likewise.
10160 (Layout::set_segment_offsets): Clear increase_relro when using a
10162 * layout.h (class Layout): Add increase_relro method. Add
10163 increase_relro_ field. Update declarations.
10164 * output.cc (Output_section::Output_section): Initialize
10165 is_last_relro_ and is_first_non_relro_.
10166 (Output_segment::add_output_section): Group relro sections is
10167 do_sort is true. Handle is_last_relro and is_first_non_relro.
10168 (Output_segment::maximum_alignment): Remove relro handling.
10169 (Output_segment::set_section_addresses): Add increase_relro
10170 parameter. Change all callers. Add initial alignment to align
10171 relro sections on separate page. Remove old relro handling.
10172 (Output_segment::set_section_list_addresses): Remove in_relro
10173 parameter. Change all callers.
10174 (Output_segment::set_offset): Add increase parameter. Change all
10175 callers. Remove old relro handling.
10176 * output.h (class Output_section): Add new methods: is_last_relro,
10177 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10178 Add is_last_relro_ and is_first_non_relro_ fields.
10179 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10180 Create separate .got.plt section. Call increase_relro.
10181 * x86_64.cc (Target_x86_64::got_section): Likewise.
10182 * testsuite/relro_script_test.t: Add .got.plt.
10185 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10186 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10187 (Layout::finalize): Call set_dynamic_symbol_size.
10188 (Layout::set_dynamic_symbol_size): New function.
10189 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10190 set_dynamic_symbol_size.
10193 * output.h (class Output_section): Add is_entsize_zero_ field.
10194 * output.cc (Output_section::Output_section): Initialize
10196 (Output_section::set_entsize): If two different entsizes are
10197 requested, force it to zero.
10198 (Output_section::add_input_section): Set flags for .debug_str
10199 before updating section flags. Set entsize.
10200 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10201 and SHF_STRING if all input sections have those flags.
10203 2009-12-29 Rafael Espindola <espindola@google.com>
10205 * main.cc (main): Fix the sys time reporting.
10206 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10209 2009-12-29 Sriraman Tallam <tmsriram@google.com>
10211 * options.cc (General_options::parse_version): Allow -v to exit
10212 without an error if there is nothing to link.
10214 2009-12-29 Ian Lance Taylor <iant@google.com>
10216 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10217 using a version of gcc before 4.1.
10218 * configure: Rebuild.
10220 2009-12-28 Chris Demetriou <cgd@google.com>
10222 * attributes.cc (Output_attributes_section_data::do_write): Use
10223 std::vector::front rather than std::vector::data.
10225 2009-12-28 Ian Lance Taylor <iant@google.com>
10227 * symtab.h (class Symbol_table): Add enum Defined.
10228 * resolve.cc (Symbol_table::should_override): Add defined
10229 parameter. Change all callers. Test whether object is NULL
10230 before calling a method on it.
10231 (Symbol_table::report_resolve_problem): Add defined parameter.
10232 Change all callers.
10233 (Symbol_table::should_override_with_special): Likewise.
10234 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10235 parameter. Change all callers.
10236 (Symbol_table::do_define_in_output_data): Likewise.
10237 (Symbol_table::define_in_output_segment): Likewise.
10238 (Symbol_table::do_define_in_output_segment): Likewise.
10239 (Symbol_table::define_as_constant): Likewise.
10240 (Symbol_table::do_define_as_constant): Likewise.
10241 * script.h (class Symbol_assignment): Add is_defsym parameter to
10242 constructor; change all callers.
10243 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10244 parameter. Change all callers. Add is_defsym_ field.
10245 (class Parser_closure): Add parsing_defsym parameter to
10246 constructor; change all callers. Add parsing_defsym accessor
10247 function. Add parsing_defsym_ field.
10249 2009-12-28 Ian Lance Taylor <iant@google.com>
10251 * gold.cc (queue_middle_tasks): Fix formatting.
10252 * object.cc (Relobj::is_section_name_included): Likewise.
10254 2009-12-23 Ian Lance Taylor <iant@google.com>
10256 * i386.cc (Target_i386::do_calls_non_split): Recognize
10257 -fsplit-stack prologue for a function with a static chain.
10258 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10259 -fsplit-stack prologue when using %r11.
10261 2009-12-21 Sriraman Tallam <tmsriram@google.com>
10263 * options.cc (General_options::parse_version): Make -v continue and do
10264 the link like GNU ld does.
10266 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
10268 * Makefile.am (CCFILES): Add timer.cc.
10269 (HFILES): Add timer.h.
10270 * configure.ac: Check for sysconf and times.
10271 * main.cc: include timer.h.
10272 (main): Use Timer instead of get_run_time.
10275 * workqueue.cc: include timer.h.
10276 (Workqueue::find_and_run_task):
10277 Report user, sys and wall time.
10278 * Makefile.in: Regenerate.
10279 * config.in: Regenerate.
10280 * configure: Regenerate.
10282 2009-12-16 Doug Kwan <dougkwan@google.com>
10284 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10286 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10287 relaxed input sections.
10288 * output.cc (Output_section::find_relaxed_input_section): Change
10289 return type to Output_relaxed_input_section pointer. Adjust code
10290 for new type of relaxed_input_section_map_.
10291 * output.h (Output_section::find_relaxed_input_section): Change
10292 return type to Output_relaxed_input_section pointer.
10293 (Output_section::Output_relaxed_input_section_by_input_section_map):
10295 (Output_section::relaxed_input_section_map_): Change type to
10296 Output_section::Output_relaxed_input_section_by_input_section_map.
10297 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10300 2009-12-15 Ian Lance Taylor <iant@google.com>
10302 * layout.cc (Layout::create_shstrtab): Only write out after input
10303 sections if we are compressing debug sections.
10305 2009-12-15 Ian Lance Taylor <iant@google.com>
10307 * archive.cc (Archive::add_symbols): Only look up a symbol without
10308 a version if there is, in fact, a version.
10310 2009-12-14 Ian Lance Taylor <iant@google.com>
10312 Revert -Wshadow changes, all changes from:
10313 2009-12-11 Doug Kwan <dougkwan@google.com>
10314 2009-12-11 Nick Clifton <nickc@redhat.com>
10315 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10317 2009-12-11 Doug Kwan <dougkwan@google.com>
10319 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10321 * attributes.cc (Object_attribute::size): Ditto.
10322 (Attributes_section_data::size): Ditto.
10323 (Attributes_section_data::Attributes_section_data): Ditto.
10324 (Output_attributes_section_data::do_write): Ditto.
10325 * attributes.h (Object_attribute::set_type): Ditto.
10326 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10328 2009-12-11 Nick Clifton <nickc@redhat.com>
10330 * archive.cc: Fix shadowed variable warnings.
10331 * arm.cc: Likewise.
10332 * compressed_output.cc: Likewise.
10333 * compressed_output.h: Likewise.
10334 * configure: Likewise.
10335 * dwarf_reader.cc: Likewise.
10336 * dynobj.cc: Likewise.
10337 * dynobj.h: Likewise.
10338 * ehframe.cc: Likewise.
10339 * ehframe.h: Likewise.
10340 * errors.cc: Likewise.
10341 * expression.cc: Likewise.
10342 * fileread.cc: Likewise.
10343 * fileread.h: Likewise.
10344 * freebsd.h: Likewise.
10345 * i386.cc: Likewise.
10346 * icf.cc: Likewise.
10347 * incremental.h: Likewise.
10348 * layout.cc: Likewise.
10349 * layout.h: Likewise.
10350 * mapfile.cc: Likewise.
10351 * merge.cc: Likewise.
10352 * merge.h: Likewise.
10353 * object.cc: Likewise.
10354 * object.h: Likewise.
10355 * options.h: Likewise.
10356 * output.cc: Likewise.
10357 * output.h: Likewise.
10358 * parameters.cc: Likewise.
10359 * plugin.cc: Likewise.
10360 * powerpc.cc: Likewise.
10361 * reduced_debug_output.cc: Likewise.
10362 * reduced_debug_output.h: Likewise.
10363 * reloc.cc: Likewise.
10364 * reloc.h: Likewise.
10365 * resolve.cc: Likewise.
10366 * script-sections.cc: Likewise.
10367 * script.cc: Likewise.
10368 * script.h: Likewise.
10369 * sparc.cc: Likewise.
10370 * symtab.cc: Likewise.
10371 * symtab.h: Likewise.
10372 * target-select.cc: Likewise.
10373 * target-select.h: Likewise.
10374 * token.h: Likewise.
10375 * workqueue.cc: Likewise.
10376 * workqueue.h: Likewise.
10377 * x86_64.cc: Likewise.
10379 2009-12-10 Doug Kwan <dougkwan@google.com>
10381 * arm.cc (attributes.h): New include.
10382 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10383 (Arm_relobj::~Arm_relobj): Delete object pointed by
10384 attributes_section_data_.
10385 (Arm_relobj::attributes_section_data): New method definition.
10386 (Arm_relobj::attributes_section_data_): New data member declaration.
10387 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10388 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10389 attributes_section_data_.
10390 (Arm_dynobj::attributes_section_data): New method definition.
10391 (Arm_dynobj::attributes_section_data_): New data member declaration.
10392 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10393 initialization value of may_use_blx_ to false.
10394 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
10395 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10396 object attributes to compute results instead of hard-coding.
10397 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10398 Target_arm::get_secondary_compatible_arch,
10399 Target_arm::set_secondary_compatible_arch
10400 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10401 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10402 New method declarations.
10403 (Target_arm::get_aeabi_object_attribute): New method definition.
10404 (Target_arm::attributes_section_data_): New data member declaration.
10405 (read_arm_attributes_section): New template definition.
10406 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10407 (Arm_dynobj::do_read_symbols): Ditto.
10408 (Target_arm::do_finalize_sections): Merge attributes sections from
10409 input. Check for BLX use after attributes section merging.
10410 Fix __exidx_start and __exidx_end visibility. Create an
10411 .ARM.attributes section if necessary.
10412 (Target_arm::get_secondary_compatible_arch,
10413 Target_arm::set_secondary_compatible_arch,
10414 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10415 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
10416 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
10417 New method definitions.
10419 2009-12-09 Ian Lance Taylor <iant@google.com>
10421 * plugin.cc (Plugin::load): Don't cast from void* to a function
10424 2009-12-09 Ian Lance Taylor <iant@google.com>
10426 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10427 information fields.
10429 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10431 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10432 Replace two_file_shared_1.so with two_file_shared_2.so.
10433 * testsuite/Makefile.in: Regenerated.
10435 2009-12-08 Doug Kwan <dougkwan@google.com>
10437 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10438 (HFILES): Add attributes.h and int_encoding.h.
10439 * Makefile.in: Regenerate.
10440 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10441 function definitions to int_encoding.cc
10442 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10443 prototypes to int_encoding.h
10444 * reduced_debug_output.cc (int_encoding.h): New include.
10445 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10446 function definitions to int_encoding.cc
10447 (insert_into_vector, read_from_pointer): Move template definitions to
10449 * attributes.cc: New file.
10450 * attributes.h: New file.
10451 * int_encoding.cc: New file.
10452 * int_encoding.h: New file.
10454 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
10457 * incremental-dump.cc (dump_incremental_inputs): New.
10458 (main): Use dump_incremental_inputs.
10460 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10463 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10464 checking elfcpp::STT_FUNC.
10465 (Target_i386::Relocate::relocate): Likewise.
10466 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10468 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10469 symbols from shared libraries into normal FUNC symbols.
10471 * symtab.h (Symbol): Add is_func and use it.
10473 2009-12-05 Doug Kwan <dougkwan@google.com>
10475 * arm.cc (Target_arm::arm_info): Initialize new fields
10476 attributes_section and attributes_vendor.
10477 * i386.cc (Target_i386::i386_info): Same.
10478 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10479 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10480 fields attributes_section and attributes_vendor.
10481 * sparc.cc (Target_sparc::sparc_info): Same.
10482 * target.h (Target::attributes_section, Target::attributes_vendor,
10483 Target::is_attributes_section, Target::attribute_arg_type,
10484 Target::attributes_order): New method definitions.
10485 (Target::Target_info::attributes_section,
10486 Target::Target_info::attributes_vendor): New fields.
10487 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10488 virtual method definitions.
10489 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10490 attributes_section and attributes_vendor.
10491 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10493 2009-12-05 Doug Kwan <dougkwan@google.com>
10495 * arm.cc: Update comments about interworking and stub generation.
10496 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10497 considered as non-PIC.
10498 (Arm_relocate_functions::base_abs): Fix formatting.
10499 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10500 of function to use GOT entry address instead of offset.
10501 (Target_arm::Scan::global): Issue an error if a symbol would need a
10502 PLT does not get one because it is untyped. Remove code to create
10503 dynamic symbols for relative branches.
10504 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10505 takes unsigned integer instead of boolean.
10507 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10509 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10510 (two_file_test_LDADD): Likewise.
10511 (common_test_1_LDADD): Likewise.
10512 (exception_test_LDADD) Likewise.
10513 (weak_test_LDADD): Likewise.
10514 (many_sections_test_LDADD): Likewise.
10515 (initpri1_LDADD): Likewise.
10516 (script_test_1_LDADD): Likewise.
10517 (script_test_2_LDADD): Likewise.
10518 (justsyms_LDADD): Likewise.
10519 (binary_test_LDADD): Likewise.
10520 (large_LDADD): Likewise.
10521 * testsuite/Makefile.in: Regenerated.
10523 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
10525 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10526 (Symbol_table::override_with_special): Likewise.
10527 (Symbol_table::add_from_object): Likewise.
10529 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10531 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10532 Don't set the data_offset twice.
10534 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10536 * testsuite/Makefile.in: Regenerate.
10538 2009-12-03 Doug Kwan <dougkwan@google.com>
10540 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10541 (Target_arm::do_finalize_sections): Add parameter for symbol table
10542 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10543 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10544 parameter for symbol table pointer.
10545 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10546 an additional parameter for a pointer to symbol table.
10547 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10548 parameter for a symbol table pointer.
10549 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10550 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10552 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10553 parameter for a symbol table pointer.
10555 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
10557 * incremental.cc (Incremental_inputs_header)
10558 (Incremental_inputs_header_write, Incremental_inputs_entry)
10559 (Incremental_inputs_entry_write): Move ...
10560 * incremental.h (Incremental_inputs_header)
10561 (Incremental_inputs_header_write, Incremental_inputs_entry)
10562 (Incremental_inputs_entry_write): here.
10564 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10566 * incremental.cc (make_sized_incremental_binary): Set the target.
10567 Error if it is incompatible.
10568 * output.h (Output_file): Add filename method.
10570 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10572 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10573 from the get_* methods.
10575 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10577 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10578 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10579 Write 0 for the data_offset of scripts.
10581 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10583 * testsuite/Makefile.am: Add the incremental_test.sh test.
10584 * testsuite/incremental_test.sh: New.
10585 * testsuite/incremental_test_1.c: New.
10586 * testsuite/incremental_test_2.c: New.
10588 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
10590 * incremental-dump.cc (main): Fix typos.
10592 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
10595 * incremental-dump.cc (main): Use llu to print 64 bit values.
10597 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10598 H.J. Lu <hongjiu.lu@intel.com>
10600 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10602 (incremental_dump_LDADD): Likewise.
10603 * Makefile.in: Regenerated.
10605 2009-11-25 Doug Kwan <dougkwan@google.com>
10609 2009-11-25 Doug Kwan <dougkwan@google.com>
10611 * arm.cc (Target_arm::Target_arm): Move method definition
10612 outside of class definition. Add code to handle
10613 --target1-rel, --target1-abs and --target2= options.
10614 (Target_arm::get_reloc_reloc_type): Change method to be
10615 non-static and const.
10616 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10617 New data member declaration.
10618 (Target_arm::Scan::local, Target_arm::Scan::global,
10619 Target_arm::Relocate::relocate,
10620 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10621 Adjust call to Target_arm::get_real_reloc_type.
10622 (Target_arm::get_real_reloc_type): Use command line options
10623 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10624 * options.h (--target1-rel, --target1-abs, --target2): New
10627 2009-11-25 Doug Kwan <dougkwan@google.com>
10629 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10630 class definition. Add code to handle --target1-rel, --target1-abs
10631 and --target2= options.
10632 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10634 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10635 member declaration.
10636 (Target_arm::Scan::local, Target_arm::Scan::global,
10637 Target_arm::Relocate::relocate,
10638 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10639 call to Target_arm::get_real_reloc_type.
10640 (Target_arm::get_real_reloc_type): Use command line options to
10641 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10642 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10645 2009-11-25 Doug Kwan <dougkwan@google.com>
10647 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10648 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10649 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10651 (Arm_relocate_functions::thm_call): Replace body with a call to
10652 Arm_relocate_functions::thumb_branch_common.
10653 (Arm_relocate_functions::thm_jump24,
10654 Arm_relocate_functions::thm_xpc22): New method definitions.
10655 (Arm_relocate_functions::thumb_branch_common): New method definition.
10656 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10658 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10659 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10661 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10663 * Makefile.am: Build incremental-dump
10664 * Makefile.in: Regenerate.
10665 * incremental-dump.cc: New.
10666 * incremental.cc (Incremental_inputs_header_data,
10667 Incremental_inputs_entry_data): Move to incremental.h
10668 * incremental.h: (Incremental_inputs_header_data,
10669 Incremental_inputs_entry_data): Move from incremental.cc
10671 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10673 * incremental.cc (Incremental_inputs_header,
10674 Incremental_inputs_header_write, Incremental_inputs_entry,
10675 Incremental_inputs_entry_write): Add a typedef with the data type.
10677 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10679 * incremental.cc (Incremental_inputs_header,
10680 Incremental_inputs_header_write, Incremental_inputs_entry,
10681 Incremental_inputs_entry_write): Update comment about which
10682 type has the filed descriptions.
10684 2009-11-15 Doug Kwan <dougkwan@google.com>
10686 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10687 (Arm_relocate_functions::arm_branch_common): Change method defintion
10688 in class definition to a method declaration and update list of formal
10690 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10691 Arm_relocation_functions::jump24): Adjust call to
10692 Arm_relocate_functions::arm_branch_common. Update list of formal
10694 (Arm_relocate_functions::xpc25): New method definition.
10695 (Arm_relocate_functions::arm_branch_common): Move method defintion
10696 out from class definition. Use stubs for mode-switching and extending
10698 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10699 specially. Change code to enable use of stubs in ARM branches.
10701 2009-11-10 Doug Kwan <dougkwan@google.com>
10703 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10704 in method declaration.
10705 (Target_arm::relocate_stub): New method declaration.
10706 (Target_arm::default_target): Change to return a pointer instead of
10708 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10709 Target_arm::default_target.
10710 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10712 (Target_arm::relocate_section): Adjust view.
10713 (Target_arm::relocate_stub): New method definition.
10715 2009-11-10 Doug Kwan <dougkwan@google.com>
10717 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10719 * incremental.cc (open_incremental_binary): Initialized local
10720 variables to avoid warnings.
10721 * object.cc (make_elf_object): Ditto.
10722 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10725 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10728 * testsuite/plugin_test.c: Include "config.h".
10730 2009-11-09 Doug Kwan <dougkwan@google.com>
10732 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10733 (arm_symbol_value): Remove.
10734 (Arm_relocate_functions::arm_branch_common,
10735 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10736 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10737 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10738 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10739 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10740 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10741 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10742 Arm_relocate_functions::thm_mobw_abs_nc,
10743 Arm_relocate_functions::thm_mov_abs,
10744 Arm_relocate_functions::movw_prel_nc,
10745 Arm_relocate_functions::thm_movt_abs,
10746 Arm_relocate_functions::movt_prel,
10747 Arm_relocate_functions::thm_movw_prel_nc,
10748 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10749 (Target_arm::Relocate::relocate): Only decompose address into two
10750 parts if relocation type uses the thumb-bit and pass the actual
10751 bit instead of a flag indicating that the thumb-bit is used. Adjust
10752 calls to methods in Arm_relocate_functions for this change.
10754 2009-11-08 Ian Lance Taylor <iant@google.com>
10757 * reloc.cc: Instantiate
10758 Sized_relobj::initialize_input_to_output_maps and
10759 Sized_relobj:free_input_to_output_maps.
10761 2009-11-06 Ian Lance Taylor <iant@google.com>
10764 * defstd.cc (in_segment): Set only_if_ref true for "end".
10766 2009-11-06 Doug Kwan <dougkwan@google.com>
10768 * arm.cc (class Reloc_stub): Correct a comment.
10769 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10770 (Target_arm::scan_section_for_stubs): New method declaration.
10771 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10772 Change methods from private to protected.
10773 (Target_arm::do_may_relax): New method definition.
10774 (Target_arm::do_relax, Target_arm::group_sections,
10775 Target_arm::scan_reloc_for_stub,
10776 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10777 (Target_arm::arm_input_section_map_): New data member declaration.
10778 (Target_arm::scan_reloc_for_stub,
10779 Target_arm::scan_reloc_section_for_stubs,
10780 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10781 Target_arm::do_relax): New method definitions.
10783 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10785 * configure.ac: Check for (struct stat)::st_mtim
10786 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10787 * config.in: Regenerate.
10788 * configure: Regenerate.
10790 2009-11-05 Ian Lance Taylor <iant@google.com>
10793 * output.cc (Output_segment::add_output_section): Add missing
10796 2009-11-04 Ian Lance Taylor <iant@google.com>
10799 * object.h (class Object): Add is_needed and set_is_needed
10800 methods. Add is_needed_ field. Make bool fields into bitfields.
10801 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10802 defined in a dynamic object and referenced by a regular object,
10803 set is_needed for the dynamic object.
10804 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10805 if the file is marked with as_needed and it is not needed.
10807 2009-11-04 Ian Lance Taylor <iant@google.com>
10810 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10811 tags if data is discarded by linker script.
10812 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10813 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10814 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10815 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10817 2009-11-04 Ian Lance Taylor <iant@google.com>
10819 * layout.cc (Layout::get_output_section): Add is_interp and
10820 is_dynamic_linker_section parameters. Change all callers.
10821 (Layout::choose_output_section): Likewise.
10822 (Layout::make_output_section): Likewise.
10823 (Layout::add_output_section_data): Add is_dynamic_linker_section
10824 parameter. Change all callers.
10825 * layout.h (class Layout): Update declarations.
10826 * output.h (class Output_section): Add is_interp, set_is_interp,
10827 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10828 Add is_interp_, is_dynamic_linker_section_ fields. Change
10829 generate_code_fills_at_write_ to a bitfield.
10830 * output.cc (Output_section::Output_sections): Initialize new
10832 (Output_segment::add_output_section): Add do_sort parameter.
10833 Change all callers.
10835 2009-11-03 Ian Lance Taylor <iant@google.com>
10838 * options.h (class General_options): Add --warn-common.
10839 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10840 merging two common symbols.
10841 (Symbol_table::should_override): Handle --warn-common when merging
10842 a common symbol with a defined symbol. Use report_resolve_problem
10843 for multiple definitions.
10844 (Symbol_table::report_resolve_problem): New function.
10845 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10847 2009-11-03 Doug Kwan <dougkwan@google.com>
10849 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10851 (Target_arm::stub_factory): New method definition.
10852 (Target_arm::new_arm_input_section,
10853 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10854 Target_arm::reloc_uses_thumb_bit): New method declarations.
10855 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
10856 New type definitions.
10857 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10858 member declarations.
10859 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10860 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10861 New method definitions.
10863 2009-11-03 Ian Lance Taylor <iant@google.com>
10865 * options.h (class General_options): Add --warn_constructors.
10867 2009-11-03 Ian Lance Taylor <iant@google.com>
10870 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10871 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10873 2009-11-03 Ian Lance Taylor <iant@google.com>
10876 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10877 --msgid-bugs-address.
10878 (install-pdf): New target.
10879 (install-data_yes): Look up one directory to find mkinstalldirs.
10881 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10883 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10886 2009-10-30 Doug Kwan <dougkwan@google.com>
10888 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10890 2009-10-30 Doug Kwan <dougkwan@google.com>
10892 * arm.cc (Stub_addend_reader): New struct template definition
10893 and partial specializations.
10894 (Stub_addend_reader::operator()): New method definition for a
10895 partially specialized template.
10897 2009-10-30 Doug Kwan <dougkwan@google.com>
10899 * arm.cc (Arm_relobj::processor_specific_flags): New method
10901 (Arm_relobj::do_read_symbols): New method declaration.
10902 (Arm_relobj::processor_specific_flags_): New data member declaration.
10903 (Arm_dynobj): New class definition.
10904 (Target_arm::do_finalize_sections): Add input_objects parameter.
10905 (Target_arm::do_adjust_elf_header): New method declaration.
10906 (Target_arm::are_eabi_versions_compatible,
10907 (Target_arm::merge_processor_specific_flags): New method declaration.
10908 (Target_arm::do_make_elf_object): New overloaded method definitions
10910 (Arm_relobj::do_read_symbols): New method definition.
10911 (Arm_dynobj::do_read_symbols): Ditto.
10912 (Target_arm::do_finalize_sections): Add input_objects parameters.
10913 Merge processor-specific flags from all input objects.
10914 (Target_arm::are_eabi_versions_compatible,
10915 Target_arm::merge_processor_specific_flags,
10916 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10917 New method definitions.
10918 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10919 Input_objects pointer type parameter.
10920 * layout.cc (Layout::finalize): Pass input objects to target's.
10921 finalize_sections function.
10922 * output.cc (Output_file_header::do_sized_write): Set ELF file
10923 header's processor-specific flags.
10924 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10925 Input_objects pointer type parameter.
10926 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10927 * target.h (Input_objects): New forward class declaration.
10928 (Target::processor_specific_flags,
10929 Target::are_processor_specific_flags_sect): New method definitions.
10930 (Target::finalize_sections): Add input_objects parameter.
10931 (Target::Target): Initialize processor_specific_flags_ and
10932 are_processor_specific_flags_set_.
10933 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10935 (Target::set_processor_specific_flags): New method definition.
10936 (Target::processor_specific_flags_,
10937 Target::are_processor_specific_flags_set_): New data member
10939 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10940 Input_objects pointer type parameter.
10942 2009-10-30 Doug Kwan <dougkwan@google.com>
10944 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10946 2009-10-28 Ian Lance Taylor <iant@google.com>
10948 * object.h (class Relobj): Drop options parameter from
10949 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10950 do_scan_relocs, do_relocate. Change all callers.
10951 (class Sized_relobj): Drop options parameters from
10952 do_gc_process_relocs, do_scan_relocs, do_relocate,
10953 do_relocate_sections, relocate_sections, emit_relocs_scan,
10954 emit_relocs_scan_reltype. Change all callers.
10955 (struct Relocate_info): Remove options field and all references to
10957 * reloc.h (class Read_relocs): Remove options constructor
10958 parameter and options_ field. Change all callers.
10959 (class Gc_process_relocs, class Scan_relocs): Likewise.
10960 (class Relocate_task): Likewise.
10961 * target-reloc.h (scan_relocs): Remove options parameter. Change
10963 (scan_relocatable_relocs): Likewise.
10964 * target.h (class Sized_target): Remove options parameter from
10965 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10967 * gc.h (gc_process_relocs): Remove options parameter. Change all
10969 * arm.cc: Update functions to remove options parameters.
10970 * i386.cc: Likewise.
10971 * powerpc.cc: Likewise.
10972 * sparc.cc: Likewise.
10973 * x86_64.cc: Likewise.
10974 * testsuite/testfile.cc: Likewise.
10976 2009-10-28 Doug Kwan <dougkwan@google.com>
10978 * arm.cc (Arm_relobj): New class definition.
10979 (Arm_relobj::scan_sections_for_stubs,
10980 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10981 New method definitions.
10983 2009-10-28 Cary Coutant <ccoutant@google.com>
10985 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10986 (Plugin::cleanup_done_): New member.
10987 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10988 (Plugin_manager::cleanup_done_): Remove.
10989 (Plugin_manager::add_input_file): Edit error message.
10990 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10991 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10993 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10995 * fileread.cc: (File_read::View::~View): Use the new
10996 data_ownership_ filed.
10997 (File_read::~File_read): Dispose the new whole_file_view_.
10998 (File_read::open): Mmap the whole file if needed.
10999 (File_read::open): Use whole_file_view_ instead of contents_.
11000 (File_read::find_view): Use whole_file_view_ if applicable.
11001 (File_read::do_read): Use whole_file_view_ instead of contents_.
11002 (File_read::make_view): Use whole_file_view_ instead of contents_,
11003 update File_read::View::View call.
11004 (File_read::find_or_make_view): Update File_read::View::View
11006 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11008 (File_read::View::Data_ownership): New enum.
11009 (File_read::View::View): Replace bool mapped_ with Data_ownership
11011 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11012 (File_read::View::data_ownership_): New field.
11013 (File_read::contents_): Remove (replaced by whole_file_view_).
11014 (File_read::whole_file_view_): New field.
11015 * options.h (class General_options): Add --keep-files-mapped.
11017 2009-10-27 Cary Coutant <ccoutant@google.com>
11019 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11020 * testsuite/Makefile.am (plugin_test_5): New test case.
11021 * testsuite/Makefile.in: Regenerate.
11023 2009-10-25 Doug Kwan <dougkwan@google.com>
11025 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11026 from private to protected to allow access by child class.
11027 (Sized_relobj::do_relocate_sections): New method declaration.
11028 (Sized_relobj::relocate_sections): Virtualize.
11029 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
11030 Sized_relobj::relocate_sections. Instantiate template explicitly
11031 for different target sizes and endianity.
11033 2009-10-24 Doug Kwan <dougkwan@google.com>
11035 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11036 (Arm_input_section::as_arm_input_section): New method.
11037 (Arm_output_section): New class definition.
11038 (Arm_output_section::create_stub_group,
11039 Arm_output_section::group_sections): New method definitions.
11041 2009-10-22 Doug Kwan <dougkwan@google.com>
11043 * arm.cc (Arm_input_section): New class definition.
11044 (Arm_input_section::init, Arm_input_section:do_write,
11045 Arm_input_section::set_final_data_size,
11046 Arm_input_section::do_reset_address_and_file_offset): New method
11049 2009-10-21 Doug Kwan <dougkwan@google.com>
11051 * arm.cc (Stub_table, Arm_input_section): New forward class
11053 (Stub_table): New class defintion.
11054 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11055 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11056 New method definition.
11058 2009-10-21 Doug Kwan <dougkwan@google.com>
11060 * arm.cc: Update copyright comments.
11061 (Target_arm): New forward class template declaration.
11062 (Arm_address): New type.
11063 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11064 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11065 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11067 (Insn_template): Same.
11068 (DEF_STUBS): New macro.
11069 (Stub_type): New enum type.
11070 (Stub_template): New class definition.
11072 (Reloc_stub): Same.
11073 (Stub_factory): Same.
11074 (Target_arm::Target_arm): Initialize may_use_blx_ and
11075 should_force_pic_veneer_.
11076 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11077 Target_arm::should_force_pic_veneer,
11078 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11079 Target_arm::using_thumb_only, Target_arm:;default_target): New
11081 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11082 New data member declarations.
11083 (Insn_template::size, Insn_template::alignment): New method defintions.
11084 (Stub_template::Stub_template): New method definition.
11085 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11086 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11087 (Stub_factory::Stub_factory): New method definition.
11088 * gold.h (string_hash): New template.
11089 * output.h (Input_section_specifier::hash_value): Use
11091 (Input_section_specifier::string_hash): Remove.
11092 * stringpool.cc (Stringpool_template::string_hash): Use
11095 2009-10-20 Doug Kwan <dougkwan@google.com>
11097 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11098 symbols of relaxed input sections.
11099 * output.h (Output_section::find_relaxed_input_section): Make
11102 2009-10-16 Doug Kwan <dougkwan@google.com>
11104 * dynobj.cc (Versions::Versions): Initialize version_script_.
11105 Only insert base version symbol definition for a shared object
11106 if version script defines any version versions.
11107 (Versions::define_base_version): New method definition.
11108 (Versions::add_def): Check that base version is not needed.
11109 (Versions::add_need): Define base version lazily.
11110 * dynobj.h (Versions::define_base_version): New method declaration.
11111 (Versions::needs_base_version_): New data member declaration.
11112 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11113 (check_DATA): Add no_version_test.stdout.
11114 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11116 * testsuite/Makefile.in: Regenerate.
11117 * testsuite/no_version_test.c: New file.
11118 * testsuite/no_version_test.sh: Ditto.
11120 2009-10-16 Doug Kwan <dougkwan@google.com>
11122 * expression.cc (class Segment_start_expression): New class definition.
11123 (Segment_start_expression::value): New method definition.
11124 (script_exp_function_segment_start): Return a new
11125 Segment_start_expression.
11126 * gold/script-c.h (script_saw_segment_start_expression): New function
11128 * script-sections.cc (Script_sections::Script_sections): Initialize
11129 SAW_SEGMENT_START_EXPRESSION_ to false.
11130 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11131 and -Tbbs options to specify section addresses if given in
11132 command line and no SEGMENT_START expression is seen in a script.
11133 * script-sections.h (Script_sections::saw_segment_start_expression,
11134 Script_sections::set_saw_segment_start_expression): New method
11136 (Script_sections::saw_segment_start_expression_): New data member
11138 * script.cc (script_saw_segment_start_expression): New function.
11139 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11140 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11141 script_test_7.sh and script_test_8.sh.
11142 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11143 script_test_8.stdout.
11144 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11145 (script_test_6, script_test_6.stdout, script_test_7,
11146 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11147 * Makefile.in: Regenerate.
11148 * testsuite/script_test_6.sh: New file.
11149 * testsuite/script_test_6.t: Same.
11150 * testsuite/script_test_7.sh: Same.
11151 * testsuite/script_test_7.t: Same.
11152 * testsuite/script_test_8.sh: Same.
11154 2009-10-16 Doug Kwan <dougkwan@google.com>
11156 * output.cc (Output_segment::set_section_list_address): Cast
11157 expressions to unsigned long long type to avoid format warnings.
11159 2009-10-15 Ian Lance Taylor <iant@google.com>
11161 * script.cc (Script_options::add_symbol_assignment): Always add a
11162 dot assignment to script_sections_.
11163 * script-sections.cc (Script_sections::add_dot_assignment):
11164 Initialize if necessary.
11166 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11167 program headers with no load segment if there is a linker script.
11169 * layout.cc (Layout::set_segment_offsets): Align the file offset
11170 to the segment aligment for -N or -n with no load segment.
11171 * output.cc (Output_segment::add_output_section): Don't crash if
11172 the first section is a TLS section.
11173 (Output_segment::set_section_list_addresses): Print an error
11174 message if the address moves backward in a linker script.
11175 * script-sections.cc
11176 (Output_section_element_input::set_section_addresses): Don't
11177 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11178 (Orphan_output_section::set_section_addresses): Likewise.
11180 2009-10-15 Doug Kwan <dougkwan@google.com>
11182 * layout.cc (Layout::finish_dynamic_section): Generate tags
11183 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11184 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11185 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11187 2009-10-14 Ian Lance Taylor <iant@google.com>
11189 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11191 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11192 data_shdr fields of relinfo.
11193 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11194 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11195 R_386_TLS_LDO_32, adjust based on section flags.
11196 (Target_i386::Relocate::fix_up_ldo): Remove.
11198 2009-10-13 Ian Lance Taylor <iant@google.com>
11200 Add support for -pie.
11201 * options.h (class General_options): Add -pie and
11203 (General_options::output_is_position_independent): Test -pie.
11204 (General_options::output_is_executable): Return true if not shared
11205 and not relocatable.
11206 (General_options::output_is_pie): Remove.
11207 * options.cc (General_options::finalize): Reject incompatible uses
11209 * gold.cc (queue_middle_tasks): A -pie link is not static.
11210 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11211 * symtab.cc (Symbol::final_value_is_known): Return false if
11212 output_is_position_independent.
11213 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11214 output_is_position_independent.
11215 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11216 output_is_position_independent.
11217 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11218 output_is_position_independent.
11219 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11221 (basic_pie_test.o, basic_pie_test): New targets.
11222 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11223 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11224 (two_file_pie_test): New target.
11225 * testsuite/Makefile.in: Rebuild.
11226 * README: Remove note saying that -pie is not supported.
11228 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11230 * options.h (class General_options): Add -init and -fini.
11231 * layout.cc (Layout::finish_dynamic_section): Emit
11232 given init and fini functions.
11234 2009-10-13 Sriraman Tallam <tmsriram@google.com>
11236 * gc.h (gc_process_relocs): Check if icf is enabled using new
11238 * gold.cc (queue_initial_tasks): Likewise.
11239 (queue_middle_tasks): Likewise.
11240 * object.cc (do_layout): Likewise.
11241 * symtab.cc (is_section_folded): Likewise.
11242 * main.cc (main): Likewise.
11243 * reloc.cc (Read_relocs::run): Likewise.
11244 (Sized_relobj::do_scan_relocs): Likewise.
11245 * icf.cc (is_function_ctor_or_dtor): New function.
11246 (Icf::find_identical_sections): Check if function is ctor or dtor when
11247 safe icf is chosen.
11248 * options.h (General_options::icf): Change option to be an enum.
11249 (Icf_status): New enum.
11250 (icf_enabled): New method.
11251 (icf_safe_folding): New method.
11252 (set_icf_status): New method.
11253 (icf_status_): New variable.
11254 * (options.cc) (General_options::finalize): Set icf_status_.
11255 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11256 icf_test and icf_keep_unique_test to use the --icf enum flag.
11257 * testsuite/icf_safe_test.sh: New file.
11258 * testsuite/icf_safe_test.cc: New file.
11260 2009-10-12 Sriraman Tallam <tmsriram@google.com>
11262 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11263 includes to gc.h and icf.h.
11264 * arm.cc: Include gc.h.
11265 * gold.cc: Likewise.
11266 * i386.cc: Likewise.
11267 * powerpc.cc: Likewise.
11268 * sparc.cc: Likewise.
11269 * x86_64.cc: Likewise.
11270 * gc.h: Include icf.h.
11272 2009-10-11 Ian Lance Taylor <iant@google.com>
11274 * plugin.cc: Include "gold.h" before other header files.
11276 2009-10-10 Chris Demetriou <cgd@google.com>
11278 * options.h (Input_file_argument::Input_file_type): New enum.
11279 (Input_file_argument::is_lib_): Replace with...
11280 (Input_file_argument::type_): New member.
11281 (Input_file_argument::Input_file_argument): Take Input_file_type
11282 'type' rather than boolean 'is_lib' as second argument.
11283 (Input_file_argument::is_lib): Use type_.
11284 (Input_file_argument::is_searched_file): New function.
11285 (Input_file_argument::may_need_search): Handle is_searched_file.
11286 * options.cc (General_options::parse_library): Support -l:filename.
11287 (General_options::parse_just_symbols): Update for Input_file_argument
11289 (Command_line::process): Likewise.
11290 * archive.cc (Archive::get_file_and_offset): Likewise.
11291 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11292 * script.cc (read_script_file, script_add_file): Likewise.
11293 * fileread.cc (Input_file::Input_file): Likewise.
11294 (Input_file::will_search_for): Handle is_searched_file.
11295 (Input_file::open): Likewise.
11296 * readsyms.cc (Read_symbols::get_name): Likewise.
11297 * testsuite/Makefile.am (searched_file_test): New test.
11298 * testsuite/Makefile.in: Regenerate.
11299 * testsuite/searched_file_test.cc: New file.
11300 * testsuite/searched_file_test_lib.cc: New file.
11302 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11303 Ian Lance Taylor <iant@google.com>
11305 * descriptor.cc: Include <cstdio> and "binary-io.h".
11306 (Descriptors::open): Open the files in binary mode always.
11307 * script.cc (Lex::get_token): Treat \r as whitespace.
11309 2009-10-09 Ian Lance Taylor <iant@google.com>
11311 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11313 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11314 Ian Lance Taylor <iant@google.com>
11316 * configure.ac: Check for readv function also.
11317 * fileread.cc (readv): Define if not HAVE_READV.
11318 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11320 * config.in: Regenerate.
11321 * configure: Regenerate.
11323 2009-10-09 Doug Kwan <dougkwan@google.com>
11325 * layout.cc (Layout::make_output_section): Call target hook to make
11326 ordinary output section.
11327 (Layout::finalize): Adjust parameter list of call the
11328 Target::may_relax().
11329 * layout.h (class Layout::section_list): New method.
11330 * merge.h (Output_merge_base::entsize): Change visibility to public.
11331 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11333 (Output_merge_string::do_is_string): New method.
11334 * object.cc (Sized_relobj::do_setup): renamed from
11335 Sized_relobj::set_up.
11336 * object.h (Sized_relobj::adjust_shndx,
11337 Sized_relobj::initializ_input_to_output_maps,
11338 Sized_relobj::free_input_to_output_maps): Change visibilities to
11340 (Sized_relobj::setup): Virtualize.
11341 (Sized_relobj::do_setup): New method declaration.
11342 (Sized_relobj::invalidate_section_offset,
11343 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11344 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11345 * options.cc (parse_int): New function.
11346 * options.h (parse_int): New declaration.
11347 (DEFINE_int): New macro.
11348 (stub_group_size): New option.
11349 * output.cc (Output_section::Output_section): Initialize memebers
11350 merge_section_map_, merge_section_by_properties_map_,
11351 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11352 (Output_section::add_input_section): Handled deferred code-fill
11353 generation and remove an old comment.
11354 (Output_section::add_relaxed_input_section): New method definition.
11355 (Output_section::add_merge_input_section): Use merge section by
11356 properties map to speed to search. Update merge section maps
11358 (Output_section::build_relaxation_map): New method definition.
11359 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11361 (Output_section::relax_input_section): Renamed to
11362 Output_section::convert_input_sections_to_relaxed_sections and change
11363 interface to take a vector of pointers to relaxed sections.
11364 (Output_section::find_merge_section,
11365 Output_section::find_relaxed_input_section): New method definitions.
11366 (Output_section::is_input_address_mapped,
11367 Output_section::output_offset, Output_section::output_address):
11368 Use output section data maps to speed up searching.
11369 (Output_section::find_starting_output_address): Add comments.
11370 (Output_section::do_write,
11371 Output_section::write_to_postprocessing_buffer): Do code-fill
11372 generation as appropriate.
11373 (Output_section::get_input_sections): Invalidate relaxed input section
11375 (Output_section::restore_states): Adjust type of checkpoint .
11376 Invalidate relaxed input section map.
11377 * output.h (Output_merge_base): New class declaration.
11378 (Input_section_specifier): New class defintion.
11379 (class Output_relaxed_input_section) Change base class to
11380 Output_section_data_build.
11381 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11382 base class initializer.
11383 (Output_section::add_relaxed_input_section): New method declaration.
11384 (Output_section::Input_section): Change visibility to protected.
11385 (Output_section::Input_section::relobj,
11386 Output_section::Input_section::shndx): Handle relaxed input sections.
11387 Output_section::input_sections) Change visibility to protected. Also
11388 define overload to return a non-const pointer.
11389 (Output_section::Merge_section_properties): New class defintion.
11390 (Output_section::Merge_section_by_properties_map,
11391 Output_section::Output_section_data_by_input_section_map,
11392 Output_section::Relaxation_map): New types.
11393 (Output_section::relax_input_section): Rename method to
11394 Output_section::convert_input_sections_to_relaxed_sections and change
11395 interface to take a vector of relaxed section pointers.
11396 (Output_section::find_merge_section,
11397 Output_section::find_relaxed_input_section,
11398 Output_section::build_relaxation_map,
11399 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11400 New method declarations.
11401 (Output_section::merge_section_map_
11402 Output_section::merge_section_by_properties_map_,
11403 Output_section::relaxed_input_section_map_,
11404 Output_section::is_relaxed_input_section_map_valid_,
11405 Output_section::generate_code_fills_at_write_): New data members.
11406 * script-sections.cc
11407 (Output_section_element_input::set_section_addresses): Call
11408 current_data_size and addralign methods of relaxed input sections.
11409 (Orphan_output_section::set_section_addresses): Call current_data_size
11410 and addralign methods of relaxed input sections.
11411 * symtab.cc (Symbol_table::compute_final_value): Extract template
11412 from the body of Symbol_table::sized_finalize_symbol.
11413 (Symbol_table::sized_finalized_symbol): Call
11414 Symbol_table::compute_final_value.
11415 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11416 (Symbol_table::compute_final_value): New templated method declaration.
11417 * target.cc (Target::do_make_output_section): New method defintion.
11418 * target.h (Target::make_output_section): New method declaration.
11419 (Target::relax): Add more parameters for input objects, symbol table
11420 and layout. Adjust call to do_relax.
11421 (Target::do_make_output_section): New method declaration.
11422 (Target::do_relax): Add parameters for input objects, symbol table
11425 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11427 * pread.c: Include stdio.h.
11429 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11431 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11434 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11436 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11437 Change read_shndx type to unsigned int.
11438 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11440 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11441 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11442 Change read_shndx type to unsigned int.
11443 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11445 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11446 * layout.cc (Layout::create_symtab_sections): Cast the result of
11447 local_symcount * symsize to off_t in the gold_assert.
11449 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11451 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11452 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11454 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11455 (Arm_relocate_functions::thm_abs5): New function.
11456 (Arm_relocate_functions::abs12): New function.
11457 (Arm_relocate_functions::abs16): New function.
11458 (Arm_relocate_functions::base_abs): New function.
11459 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11460 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11461 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11463 (Scan::global): Likewise.
11464 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11465 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11466 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11467 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11470 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11472 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11473 (Arm_relocate_functions::movt_prel): New function.
11474 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11475 (Arm_relocate_functions::thm_movt_prel): New function.
11476 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11477 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11478 (Scan::global, Relocate::relocate): Likewise.
11479 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11481 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11483 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11484 Incremental_checker.
11485 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11487 (class Incremental_inputs_header): New class.
11488 (Incremental_inputs_header_writer): Edit comment.
11489 (Incremental_inputs_entry): New class.
11490 (Incremental_inputs_entry_writer): Edit comment.
11491 (Sized_incremental_binary::do_find_incremental_inputs_section):
11492 Add *strtab_shndx parameter, fill it.
11493 (Sized_incremental_binary::do_check_inputs): New method.
11494 (Incremental_checker::can_incrementally_link_output_file): Use
11495 Sized_incremental_binary::check_inputs.
11496 (Incremental_inputs::report_command_line): Save command line in
11499 (Incremental_binary::find_incremental_inputs_section): New
11501 (Incremental_binary::do_find_incremental_inputs_section): Add
11502 strtab_shndx parameter.
11503 (Incremental_binary::do_check_inputs): New pure virtual method.
11504 (Sized_incremental_binary::do_check_inputs): Declare.
11505 (Incremental_checker::Incremental_checker): Add incremental_inputs
11506 parameter, use it to initialize incremental_inputs_.
11507 (Incremental_checker::incremental_inputs_): New field.
11508 (Incremental_checker::command_line): New method.
11509 (Incremental_checker::inputs): New method.
11510 (Incremental_checker::command_line_): New field.
11512 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11514 * incremental.cc: Include <cstdarg> and "target-select.h".
11515 (vexplain_no_incremental): New function.
11516 (explain_no_incremental): New function.
11517 (Incremental_binary::error): New method.
11518 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11520 (make_sized_incremental_binary): New function.
11521 (open_incremental_binary): New function.
11522 (can_incrementally_link_file): Add checks if output is ELF and has
11524 * incremental.h: Include "elfcpp_file.h" and "output.h".
11525 (Incremental_binary): New class.
11526 (Sized_incremental_binary): New class.
11527 (open_incremental_binary): Declare.
11528 * object.cc (is_elf_object): Use
11529 elfcpp::Elf_recognizer::is_elf_file.
11530 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11531 * output.h (Output_file::filesize): New method.
11533 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11535 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11537 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11538 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11540 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11542 (Arm_relocate_functions::movw_abs_nc): New function.
11543 (Arm_relocate_functions::movt_abs): New function.
11544 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11545 (Arm_relocate_functions::thm_movt_abs): New function.
11546 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11547 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11548 (Scan::global): Likewise.
11549 (Relocate::relocate): Likewise.
11550 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11552 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11554 * arm.cc (Arm_relocate_functions::got_prel) New function.
11555 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11556 (Relocate::relocate): Likewise.
11557 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11559 2009-10-06 Ian Lance Taylor <iant@google.com>
11561 * options.h (class General_options): Define
11562 split_stack_adjust_size parameter.
11563 * object.h (class Object): Add uses_split_stack_ and
11564 has_no_split_stack_ fields. Add uses_split_stack and
11565 has_no_split_stack accessor functions. Declare
11566 handle_split_stack_section.
11567 (class Reloc_symbol_changes): Define.
11568 (class Sized_relobj): Define Function_offsets. Declare
11569 split_stack_adjust, split_stack_adjust_reltype, and
11571 * object.cc (Object::handle_split_stack_section): New function.
11572 (Sized_relobj::do_layout): Call handle_split_stack_section.
11573 * dynobj.cc (Sized_dynobj::do_layout): Call
11574 handle_split_stack_section.
11575 * reloc.cc (Sized_relobj::relocate_sections): Call
11576 split_stack_adjust for executable sections in split_stack
11577 objects. Pass reloc_map to relocate_section.
11578 (Sized_relobj::split_stack_adjust): New function.
11579 (Sized_relobj::split_stack_adjust_reltype): New function.
11580 (Sized_relobj::find_functions): New function.
11581 * target-reloc.h: Include "object.h".
11582 (relocate_section): Add reloc_symbol_changes parameter. Change
11584 * target.h (class Target): Add calls_non_split method. Declare
11585 do_calls_non_split virtual method. Declare match_view and
11587 * target.cc: Include "elfcpp.h".
11588 (Target::do_calls_non_split): New function.
11589 (Target::match_view): New function.
11590 (Target::set_view_to_nop): New function.
11591 * gold.cc (queue_middle_tasks): Give an error if mixing
11592 split-stack and non-split-stack objects with -r.
11593 * i386.cc (Target_i386::relocate_section): Add
11594 reloc_symbol_changes parameter.
11595 (Target_i386::do_calls_non_split): New function.
11596 * x86_64.cc (Target_x86_64::relocate_section): Add
11597 reloc_symbol_changes parameter.
11598 (Target_x86_64::do_calls_non_split): New function.
11599 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11601 * powerpc.cc (Target_powerpc::relocate_section): Add
11602 reloc_symbol_changes parameter.
11603 * sparc.cc (Target_sparc::relocate_section): Add
11604 reloc_symbol_changes parameter.
11605 * configure.ac: Call AM_CONDITIONAL for the default target.
11606 * configure: Rebuild.
11607 * testsuite/Makefile.am (TEST_AS): New variable.
11608 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11609 (check_DATA): Add split_i386 and split_x86_64 files.
11610 (SPLIT_DEFSYMS): Define.
11611 (split_i386_[1234n].o): New targets.
11612 (split_i386_[124]): New targets.
11613 (split_i386_[1234r].stdout): New targets.
11614 (split_x86_64_[1234n].o): New targets.
11615 (split_x86_64_[124]): New targets.
11616 (split_x86_64_[1234r].stdout): New targets.
11617 (MOSTLYCLEANFILES): Add new executables.
11618 * testsuite/split_i386.sh: New file.
11619 * testsuite/split_x86_64.sh: New file.
11620 * testsuite/split_i386_1.s: New file.
11621 * testsuite/split_i386_2.s: New file.
11622 * testsuite/split_i386_3.s: New file.
11623 * testsuite/split_i386_4.s: New file.
11624 * testsuite/split_i386_n.s: New file.
11625 * testsuite/split_x86_64_1.s: New file.
11626 * testsuite/split_x86_64_2.s: New file.
11627 * testsuite/split_x86_64_3.s: New file.
11628 * testsuite/split_x86_64_4.s: New file.
11629 * testsuite/split_x86_64_n.s: New file.
11630 * testsuite/testfile.cc (Target_test): Update relocation_section
11632 * testsuite/Makefile.in: Rebuild.
11634 2009-10-06 Ian Lance Taylor <iant@google.com>
11636 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11637 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11638 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11639 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11640 the address on ldo_addrs_.
11641 (Target_i386::Relocate::fix_up_ldo): New function.
11643 2009-10-06 Rafael Espindola <espindola@google.com>
11645 * plugin.cc (add_input_library): New.
11646 (Plugin::load): Add add_input_library to tv.
11647 (Plugin_manager::add_input_file): Add the is_lib argument.
11648 (add_input_file): Update call to Plugin_manager::add_input_file.
11649 (add_input_library): New.
11650 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11652 2009-09-30 Doug Kwan <dougkwan@google.com>
11654 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11655 symbol and call Symbol::may_need_copy_reloc to determine if
11656 a copy reloc is needed.
11657 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11658 nocopyreloc is given in command line.
11659 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11660 given in command line.
11661 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11662 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11663 of the removed Target_i386::may_need_copy_reloc.
11664 * options.h (copyreloc): New option with default value false.
11665 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11666 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11667 instead of the removed Target_powerpc::may_need_copy_reloc.
11668 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11669 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11670 instead of the removed Target_sparc::may_need_copy_reloc.
11671 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11672 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11673 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11674 instead of the removed Target_x86_64::may_need_copy_reloc.
11676 2009-09-30 Ian Lance Taylor <iant@google.com>
11678 * object.h (class Object): Remove target_ field, and target,
11679 sized_target, and set_target methods.
11680 (Object::sized_target): Remove.
11681 (class Sized_relobj): Update declarations. Remove sized_target.
11682 * object.cc (Sized_relobj::setup): Remove target parameter.
11683 Change all callers.
11684 (Input_objects::add_object): Don't do anything with the target.
11685 (make_elf_sized_object): Add punconfigured parameter. Change all
11686 callers. Set or test parameter target.
11687 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11688 Change all callers.
11689 * parameters.cc (Parameters::set_target): Change parameter type to
11691 (Parameters::default_target): Remove.
11692 (set_parameters_target): Change parameter type to be non-const.
11693 (parameters_force_valid_target): New function.
11694 (parameters_clear_target): New function.
11695 * parameters.h (class Parameters): Update declarations. Remove
11696 default_target method. Add sized_target and clear_target
11697 methods. Change target_ to be non-const.
11698 (set_parameters_target): Update declaration.
11699 (parameters_force_valid_target): Declare.
11700 (parameters_clear_target): Declare.
11701 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11702 as NULL if we aren't searching.
11703 (Add_symbols::run): Don't check for compatible target.
11704 * fileread.cc (Input_file::open_binary): Call
11705 parameters_force_valid_target.
11706 * gold.cc (queue_middle_tasks): Likewise.
11707 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11708 set_target on object.
11709 * dynobj.h (class Sized_dynobj): Update declarations.
11710 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11711 make_elf_object returns NULL.
11712 (Archive::include_member): Don't check whether object target is
11714 * output.cc (Output_section::add_input_section): Get target from
11716 (Output_section::relax_input_section): Likewise.
11717 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11719 (Sized_relobj::do_scan_relocs): Likewise.
11720 (Sized_relobj::relocate_sections): Likewise.
11721 * resolve.cc (Symbol_table::resolve): Likewise.
11722 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11723 parameter. Change all callers.
11724 (Symbol_table::add_from_object): Get target from parameters.
11725 (Symbol_table::add_from_relobj): Don't check object target.
11726 (Symbol_table::add_from_dynobj): Likewise.
11727 (Symbol_table::define_special_symbol): Get target from
11729 * symtab.h (class Symbol_table): Update declaration.
11730 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11731 parameter. Change all callers. Clear parameter target.
11732 (Binary_test): Test target here.
11733 * testsuite/object_unittest.cc (gold_testsuite): Remove
11734 target_test_pointer parameter. Change all callers.
11735 (Object_test): Test target here.
11737 2009-09-26 Ian Lance Taylor <iant@google.com>
11739 * testsuite/initpri1.c: Don't try to use constructor priorities if
11740 compiling with gcc before 4.3.
11742 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11744 * testsuite/retain_symbols_file_test.sh (check_present): Change
11745 output file name to retain_symbols_file_test.stdout.
11746 (check_absent): Likewise.
11748 2009-09-18 Craig Silverstein <csilvers@google.com>
11750 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11751 * options.cc: Include <cerrno> and <fstream>.
11752 (General_options::finalize): Parse -retain-symbols-file tag.
11753 * options.h: New flag.
11754 (General_options): New method should_retain_symbol, new
11755 variable symbols_to_retain.
11756 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11757 should_retain_symbol map.
11758 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11759 * testsuite/Makefile.in: Regenerate.
11760 * testsuite/retain_symbols_file_test.sh: New file.
11762 2009-09-18 Nick Clifton <nickc@redhat.com>
11764 * po/es.po: Updated Spanish translation.
11766 2009-09-17 Doug Kwan <dougkwan@google.com>
11768 * debug.h (DEBUG_RELAXATION): New constant.
11769 (DEBUG_ALL): Add DEBUG_RELAXATION.
11770 (debug_string_to_enum): Add relaxation debug option.
11772 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11773 Layout::Relaxation_debug_check::read_sections,
11774 Layout::Relaxation_debug_check::read_sections): New method definitions.
11775 (Layout::Layout): Initialize data members
11776 record_output_section_data_from_scrips_,
11777 script_output_section_data_list_ and relaxation_debug_check_.
11778 (Layout::save_segments, Layout::restore_segments,
11779 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11780 Layout::relaxation_loop_body): New method definitions.
11781 (Layout::finalize): Support relaxation. Move section layout code to
11782 Layout::relaxation_loop_body.
11783 (Layout::set_asection_address_from_script): Move code for orphan
11784 section placement out.
11785 (Layout::place_orphan_sections_in_script): New method definition.
11786 * layout.h (Output_segment_headers, Output_file_header):
11787 New forward class declarations.
11788 (Layout::~Layout): Define.
11789 (Layout::new_output_section_data_from_script): New method definition.
11790 (Layout::place_orphan_sections_in_script): New method declaration.
11791 (Layout::Segment_states): New type declaration.
11792 (Layout::save_segments, Layout::restore_segments,
11793 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11794 Layout::relaxation_loop_body): New method declarations.
11795 (Layout::Output_section_data_list): New type declaration.
11796 (Layout::Relaxation_debug_check): New class definition.
11797 (Layout::record_output_section_data_from_script_,
11798 Layout::script_output_section_data_list_, Layout::segment_states_,
11799 Layout::relaxation_debug_check_): New data members.
11800 * output.cc: (Output_section_headers::do_size): New method definition.
11801 (Output_section_headers::Output_section_headers): Move size
11802 computation to Output_section_headers::do_size.
11803 (Output_segment_headers::do_size): New method definition.
11804 (Output_file_header::Output_file_header): Move size computation to
11805 Output_file_header::do_size and call it.
11806 (Output_file_header::do_size): New method definition.
11807 (Output_data_group::Output_data_group): Adjust call to
11808 Output_section_data.
11809 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11810 (Output_symtab_xindex::do_write): Add array bound check.
11811 (Output_section::Input_section::print_to_mapfile): Handle
11812 RELAXED_INPUT_SECTION_CODE.
11813 (Output_section::Output_section): Initialize data member checkpoint_.
11814 (Output_section::~Output_section): Delete checkpoint object pointed
11816 (Output_section::add_input_section): Always add an Input_section if
11818 (Output_section::add_merge_input_section): Add assert.
11819 (Output_section::relax_input_section): New method definition.
11820 (Output_section::set_final_data_size): Set load address to zero for
11821 an unallocated section.
11822 (Output_section::do_address_and_file_offset_have_reset_values):
11823 New method definition.
11824 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11825 Handle relaxed input section.
11826 (Output_section::sort_attached_input_sections): Checkpoint input
11827 section list lazily.
11828 (Output_section::get_input_sections): Change type of input_sections to
11829 list of Simple_input_section pointers. Checkpoint input section list
11830 lazily. Also handle relaxed input sections.
11831 (Output_section::add_input_section_for_script): Take a reference to
11832 a Simple_input_section object instead of Relobj pointer and section
11833 index as parameter. Handle relaxed input sections.
11834 (Output_section::save_states, Output_section::restore_states): New
11835 method definitions.
11836 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11837 (Output_data::is_data_size_fixed): New method definition.
11838 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11840 (Output_data::address_and_file_offset_have_reset_values): New method
11842 (Output_data::do_address_and_file_offset_have_reset_values): New method
11844 (Output_data::set_data_size): Check that data size is not fixed.
11845 (Output_data::fix_data_size): New method definition.
11846 (Output_data::is_data_size_fixed_): New data member.
11847 (Output_section_headers::set_final_data_size): New method definition.
11848 (Output_section_headers::do_size): New method declaration.
11849 (Output_segment_headers::set_final_data_size): New method definition.
11850 (Output_segment_headers::do_size): New method declaration.
11851 (Output_file_header::set_final_data_size)::New method definition.
11852 (Output_file_header::do_size)::New method declaration.
11853 (Output_section_data::Output_section_data): Add new parameter
11854 is_data_size_fixed and use it to fix data size.
11855 (Output_data_const::Output_data_const): Adjust call to base class
11856 constructor and fix data size.
11857 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11858 base class constructor and fix data size.
11859 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11860 base class constructor and fix data size.
11861 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11862 class constructor and fix data size.
11863 (Output_data_group::set_final_data_size): New method definition.
11864 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11865 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11866 class constructor and fix data size.
11867 (Output_relaxed_input_section): New class definition.
11868 (Output_section::Simple_input_section): New class definition.
11869 (Output_section::get_input_sections): Adjust parameter list.
11870 (Output_section::add_input_section_for_script): Same.
11871 (Output_section::save_states, Output_section::restore_states,
11872 Output_section::do_address_and_file_offset_have_reset_values,
11873 (Output_section::Input_section::Input_section): Handle
11874 RELAXED_INPUT_SECTION_CODE. Add new overload for
11875 Output_relaxed_input_section.
11876 (Output_section::Input_section::is_input_section,
11877 Output_section::Input_section::set_output_section): Handle relaxed
11879 (Output_section::Input_section::is_relaxed_input_section,
11880 Output_section::Input_section::output_section_data,
11881 Output_section::Input_section::relaxed_input_section): New method
11883 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11885 (Output_section::Input_section::u1_): Update comments.
11886 (Output_section::Input_section::u2_): Add new union member poris.
11887 (Output_section::Checkpoint_output_section): New classs definition.
11888 (Output_section::relax_input_section): New method declaration.
11889 (Output_section::checkpoint_): New data member.
11890 (Output_segment): Update comments.
11891 (Output_segment::Output_segment): Un-privatize copy constructor.
11892 (Output_segment::operator=): Un-privatize.
11893 * script-sections.cc (Output_section_element::Input_section_list):
11894 Change element type to Output_section::Simple_input_section.
11895 (Output_section_element_dot_assignment::set_section_addresses):
11896 Register output section data for relaxation clean up.
11897 (Output_data_exression::Output_data_expression): Adjust call to base
11898 constructor to fix data size.
11899 (Output_section_element_data::set_section_addresses): Register
11900 Output_data_expression object for relaxation clean up.
11901 (struct Input_section_info): Replace Relobj pointer and section index
11902 pair with Output_section::Simple_input_section and Convert struct to a
11904 (Input_section_sorter::operator()): Adjust access to
11905 Input_section_info data member to use accessors.
11906 (Output_section_element_input::set_section_addresses): Use layout
11907 parameter. Adjust code to use Output_section::Simple_input_section
11908 and Input_secction_info classes. Register filler for relaxation
11910 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11911 and section index pair with Output_section::Simple_input_section
11912 class. Adjust code accordingly.
11913 (Phdrs_element::release_segment): New method definition.
11914 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11916 (Script_sections::release_segments): New method definition.
11917 * gold/script-sections.h (Script_sections::release_segments): New
11918 method declaration.
11919 * gold/target.h (Target::may_relax, Target::relax,
11920 Target::do_may_relax, Target::do_relax): New method definitions.
11922 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11924 * arm.cc (has_signed_unsigned_overflow): New function.
11925 (Arm_relocate_functions::abs8): New function.
11926 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11927 (Target_arm::Scan::global): Likewise.
11928 (Target_arm::relocate::relocate): Likewise.
11929 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11932 2009-09-16 Cary Coutant <ccoutant@google.com>
11934 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11935 * testsuite/Makefile.in: Regenerate.
11937 2009-09-11 Nick Clifton <nickc@redhat.com>
11939 * po/gold.pot: Updated by the Translation project.
11941 2009-09-08 Cary Coutant <ccoutant@google.com>
11943 * output.cc (Output_file::open): Add execute permission to empty file.
11944 * testsuite/Makefile.am (permission_test): New test.
11945 * testsuite/Makefile.in: Regenerate.
11947 2009-09-02 Ian Lance Taylor <iant@google.com>
11949 * output.cc (Output_file::resize): Call map_no_anonymous rather
11952 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11954 * gold.cc: Include "incremental.h".
11955 (queue_initial_tasks): Call Incremental_checker methods.
11956 * incremental.cc: Include "output.h".
11957 (Incremental_checker::can_incrementally_link_output_file): New
11959 * incremental.h (Incremental_checker): New class.
11961 * output.cc (Output_file::open_for_modification): New method.
11962 (Output_file::map_anonymous): Changed return type to bool. Record
11963 map in base_ field.
11964 (Output_file::map_no_anonymous): New method, broken out of map.
11965 (Output_file::map): Use map_no_anonymous and map_anonymous.
11966 * output.h (class Output_file): Update declarations.
11968 2009-08-24 Cary Coutant <ccoutant@google.com>
11970 * options.h (Command_line::Pre_options): New class.
11971 (Command_line::pre_options): New member.
11972 * options.cc (gold::options::ready_to_register): New variable.
11973 (One_option::register_option): Do nothing if not registering options.
11974 Assert if same short option registered twice.
11975 (General_options::General_options): Turn off option registration when
11977 (Command_line::Pre_options::Pre_options): New constructor.
11979 2009-08-24 Cary Coutant <ccoutant@google.com>
11981 * options.h (General_options::no_keep_memory): Remove incorrect
11984 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11986 * Makefile.am (am__skiplex, am__skipyacc): New.
11987 * Makefile.in: Regenerate.
11989 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11991 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11992 (INCLUDES): ... this.
11993 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11994 (AM_CPPFLAGS): Renamed from ...
11995 (INCLUDE): ... this.
11996 * Makefile.in, testsuite/Makefile.in: Regenerate.
11998 * Makefile.in: Regenerate.
11999 * aclocal.m4: Likewise.
12000 * config.in: Likewise.
12001 * configure: Likewise.
12002 * testsuite/Makefile.in: Likewise.
12004 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12005 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12006 * Makefile.in: Regenerate.
12007 * testsuite/Makefile.in: Regenerate.
12009 2009-08-19 Cary Coutant <ccoutant@google.com>
12011 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12012 symbols in shared libraries overridden by hidden or internal symbols
12013 in the main program.
12015 2009-08-19 Chris Demetriou <cgd@google.com>
12017 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12018 checking source file names in error messages.
12020 2009-08-18 Doug Kwan <dougkwan@google.com>
12022 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12023 an elcpp::Ehdr as parameter. Adjust call to set_target.
12024 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12025 an elfcpp::Ehdr as parameter.
12026 * object.cc (Object::set_target): Remove the version that looks up
12027 a target and sets it.
12028 (Sized_relobj::setup): Take a Target object instead of
12029 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12030 (make_elf_sized_object): Find target and ask target to
12031 make an ELF object.
12032 * object.h: (Object::set_target): Remove the version that looks up
12033 a target and sets it.
12034 (Sized_relobj::setup): Take a Target object instead of
12035 an elfcpp:Ehdr as parameter.
12036 * target.cc: Include dynobj.h.
12037 (Target::do_make_elf_object_implementation): New.
12038 (Target::do_make_elf_object): New.
12039 * target.h (Target::make_elf_object): New template declaration.
12040 (Target::do_make_elf_object): New method declarations.
12041 (Target::do_make_elf_object_implementation): New template declaration.
12043 2009-08-14 Ian Lance Taylor <iant@google.com>
12045 * gold.h (FUNCTION_NAME): Define.
12046 (gold_unreachable): Use FUNCTION_NAME.
12048 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12050 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12051 symbol in the --keep-unique list is not found.
12053 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12055 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12056 been maked as --keep-unique.
12057 (Icf::unfold_section): New function.
12058 * icf.h (Icf::unfold_section): New function.
12059 * options.h (General_options::keep_unique): New option.
12060 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12061 * testsuite/Makefile.in: Regenerate.
12062 * testsuite/icf_keep_unique_test.sh: New file.
12063 * testsuite/icf_keep_unique_test.cc: New file.
12065 2009-08-12 Cary Coutant <ccoutant@google.com>
12068 * resolve.cc (Symbol_table::resolve): Check for references from
12069 dynamic objects to hidden and internal symbols.
12070 * testsuite/Makefile.am (hidden_test.sh): New test.
12071 * testsuite/Makefile.in: Regenerate.
12072 * testsuite/hidden_test.sh: New script.
12073 * testsuite/hidden_test_1.c: New test source.
12074 * testsuite/hidden_test_main.c: New test source.
12076 2009-08-11 Doug Kwan <dougkwan@google.com>
12078 * arm.cc: Update comments.
12079 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12080 segment to locate the .ARM.exidx section if present.
12082 2009-08-09 Doug Kwan <dougkwan@google.com>
12084 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12087 2009-08-07 Sriraman Tallam <tmsriram@google.com>
12088 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12091 2009-08-06 Sriraman Tallam <tmsriram@google.com>
12093 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12094 valid tls_segment only for non-debug-section relocations.
12095 * testsuite/Makefile.am: Add gc_tls_test.
12096 * testsuite/Makefile.in: Regenerate.
12097 * testsuite/gc_tls_test.cc: New file.
12098 * testsuite/gc_tls_test.sh: New file.
12100 2009-08-05 Sriraman Tallam <tmsriram@google.com>
12102 * icf.cc: New file.
12104 * Makefile.am (CCFILES): Add icf.cc.
12105 (HFILES): Add icf.h
12106 * Makefile.in: Regenerate.
12107 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12108 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12109 section, symbol and addend information for the relocs.
12110 * gold.cc (queue_middle_tasks): Call identical code folding.
12111 * gold.h: Add defines for multimap.
12112 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12113 to the call of finalize_local_symbols.
12114 * main.cc (main): Create object of class Icf.
12115 * object.cc (Sized_relobj::do_layout): Allow this function to be
12116 called twice during icf.
12117 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12118 to sections marked as identical by icf.
12119 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12121 (Sized_relobj::do_section_entsize): New function.
12122 * object.h (Object::section_entsize): New function.
12123 (Object::do_section_entsize): New pure virtual function.
12124 (Relobj::finalize_local_symbols): Add new parameter.
12125 (Relobj::do_section_entsize): New function.
12126 * options.h (General_options::icf): New option.
12127 (General_options::icf_iterations): New option.
12128 (General_options::print_icf_sections): New option.
12129 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12130 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12131 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12133 * symtab.cc (Symbol_table::is_section_folded): New function.
12134 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12135 to sections marked as identical by icf.
12136 * symtab.h (Symbol_table::set_icf): New function.
12137 (Symbol_table::icf): New function.
12138 (Symbol_table::is_section_folded): New function.
12139 (Symbol_table::icf_): New data member.
12140 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12141 * testsuite/Makefile.am: Add commands to build icf_test.
12142 * testsuite/Makefile.in: Regenerate.
12143 * testsuite/icf_test.sh: New file.
12144 * testsuite/icf_test.cc: New file.
12146 2009-07-24 Chris Demetriou <cgd@google.com>
12148 * layout.cc (is_compressible_debug_section): Fix incorrect
12149 comment about compressed section names.
12151 2009-07-20 Ian Lance Taylor <ian@airs.com>
12154 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12156 2009-07-16 Ian Lance Taylor <iant@google.com>
12159 * layout.h: #include <map>.
12160 (class Kept_section): Change from struct to class. Add accessors
12161 and setters. Add section size to Comdat_group mapping. Change
12162 Comdat_group to std::map. Add is_comdat_ field. Add
12163 linkonce_size field in union.
12164 (class Layout): Update declaration of find_or_add_kept_section.
12165 Don't declare find_kept_object.
12166 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12167 parameter. Add object, shndx, is_comdat, and is_group_name
12168 parameters. Change all callers. Adjust for new Kept_section.
12169 (Layout::find_kept_object): Remove.
12170 * object.cc (Sized_relobj::include_section_group): Update use of
12171 Kept_section. Rename secnum to shndx. Only record
12172 Kept_comdat_section if sections are the same size.
12173 (Sized_relobj::include_linkonce_section): Update use of
12174 Kept_section. Only record Kept_comdat_section if sections are the
12175 same size. Set size of linkonce section.
12176 (Sized_relobj::map_to_kept_section): Update call to
12177 get_kept_comdat_section.
12178 * object.h (class Sized_relobj): Rename fields in
12179 Kept_comdat_section to drop trailing underscores; change object
12180 field to Relobj*. Change Kept_comdat_section_table to store
12181 struct rather than pointer.
12182 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12183 Add kept_object and kept_shndx parameters. Change all callers.
12184 (Sized_relobj::get_kept_comdat_section): Change return type to
12185 bool. Add kept_object and kept_shndx parameters. Change all
12187 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12188 Layout::find_or_add_kept_section.
12190 2009-07-09 Ian Lance Taylor <iant@google.com>
12192 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12193 Reserve space in the hash table.
12195 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12197 * fileread.cc (File_read::get_mtime): New method.
12198 * fileread.h (Timespec): New structure.
12199 (File_read::get_mtime): New method.
12200 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12201 Renamed from timestamp_nsec.
12202 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12204 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
12206 (Incremental_inputs::report_archive): Save mtime; style fix.
12207 (Incremental_inputs::report_obejct): Save mtime; style fix.
12208 (Incremental_inputs::report_script): Save mtime; style fix.
12209 (Incremental_inputs::finalize_inputs): Style fix.
12210 (Incremental_inputs::finalize): Style fix.
12211 (Incremental_inputs::create_input_section_data): Store inputs
12213 * incremental.h (Incremental_inputs::report_script): Add mtime
12215 (Incremental_inputs::Input_info::Input_info): Intialize only one
12217 (Incremental_inputs::Input_info::archive): Move to nameless
12219 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12220 (Incremental_inputs::Input_info::script): Move to nameless union.
12221 (Incremental_inputs::mtime): New field.
12222 * script.cc (read_input_script): Pass file mtime to
12224 * script.h (Script_info::inputs): Style fix.
12226 2009-07-01 Ian Lance Taylor <ian@airs.com>
12228 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12231 2009-06-24 Ian Lance Taylor <iant@google.com>
12234 * layout.cc (Layout::choose_output_section): If we find an
12235 existing section, update the flags.
12236 (Layout::create_notes): New function, broken out of
12238 (Layout::finalize): Don't create note sections.
12239 (Layout::create_note): Don't crash if linker script discards
12241 (Layout::create_gold_note): Likewise.
12242 (Layout::create_build_id): Likewise. Don't set
12243 after_input_sections on the section.
12244 (Layout::create_executable_stack_info): Remove target parameter.
12246 * layout.h (class Layout): Declare create_notes. Update
12247 declaration of create_executable_stack_info.
12248 * gold.cc (queue_middle_tasks): Call create_notes.
12249 * output.cc (Output_section::update_flags_for_input_section): Move
12250 here from output.h. If SHF_ALLOC flag is newly set, mark address
12252 * output.h (Output_data::mark_address_invalid): New function.
12253 (class Output_section): Only declare, not define,
12254 update_flags_for_input_section. Remove set_flags.
12256 2009-06-24 Ian Lance Taylor <iant@google.com>
12258 * script-sections.cc (Output_section_definition::
12259 set_section_addresses): Rename shadowing local load_address to
12262 2009-06-24 Ian Lance Taylor <iant@google.com>
12265 * reloc.cc (relocate_sections): Skip empty relocation sections.
12267 2009-06-23 Ian Lance Taylor <iant@google.com>
12270 * layout.cc (Layout::create_note): Use choose_output_section
12271 rather than make_output_section.
12273 2009-06-23 Ian Lance Taylor <iant@google.com>
12276 * options.cc (General_options::parse_V): Set printed_version_.
12277 (General_options::General_options): Initialize printed_version_.
12278 * options.h (class General_options): Add printed_version_ field.
12279 * gold.cc (queue_initial_tasks): If there are no input files,
12280 don't give a fatal error if we printed the version information.
12281 (queue_middle_tasks): If using -r with a shared object, give a
12282 fatal error rather than an ordinary error.
12284 2009-06-23 Ian Lance Taylor <iant@google.com>
12287 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12288 (Layout::make_output_section): Set have_stabstr_section_ if we see
12289 a .stab*str section.
12290 (Layout::finalize): Call link_stabs_sections.
12291 (Layout::link_stabs_sections): New file.
12292 * layout.h (class Layout): Add have_stabstr_section_ field.
12293 Declare link_stabs_sections.
12295 2009-06-23 Doug Kwan <dougkwan@google.com>
12297 * Makefile.am (libgold_a_LIBADD): New.
12298 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
12299 * Makefile.in: Regenerate.
12300 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12301 * configure: Regenerate.
12302 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12303 * fileread.cc: Include sys/state.h
12304 * gold.h: Declare memmem and strndup if found missing.
12305 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12307 2009-06-23 Ian Lance Taylor <iant@google.com>
12309 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12310 * configure: Rebuild.
12312 2009-06-23 Ian Lance Taylor <iant@google.com>
12315 * object.cc (Object::section_contents): Don't try to get a view if
12316 the section has length zero.
12317 (Object::handle_gnu_warning_section): If the section is empty, use
12318 the name of the section as the warning.
12320 2009-06-23 Ian Lance Taylor <iant@google.com>
12323 * stringpool.h (class Stringpool_template): Add optimize_ field.
12324 (Stringpool_template::set_optimize): New function.
12325 * stringpool.cc (Stringpool_template::Stringpool_template):
12326 Initialize optimize_ field.
12327 (Stringpool_template::set_string_offsets): Test local optimize
12328 fild rather than parameter.
12329 * layout.cc (Layout::Layout): Call set_optimize on the section
12332 2009-06-22 Ian Lance Taylor <iant@google.com>
12335 * yyscript.y: Parse TARGET.
12336 * script.cc (script_set_target): New function.
12337 * script-c.h (script_set_target): Declare.
12338 * options.cc (General_options::string_to_object_format): Rename
12339 from string_to_object_format in anonymous namespace. Change
12341 * options.h (class General_options): Declare
12342 string_to_object_format.
12344 2009-06-22 Ian Lance Taylor <iant@google.com>
12346 * script-sections.cc (Script_sections::create_segments): Don't put
12347 program headers in a PT_LOAD segment if -n or -N.
12349 2009-06-22 Ian Lance Taylor <iant@google.com>
12352 * options.h (class General_options): Add -z lazy and -z now. Sort
12353 -z options into alphabetical order.
12354 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12356 2009-06-21 Ian Lance Taylor <iant@google.com>
12358 * layout.cc (Layout::make_output_section): Call
12359 Target::new_output_section.
12360 (Layout::attach_allocated_section_to_segment): Put large section
12361 sections in a separate load segment with the large segment flag
12363 (Layout::segment_precedes): Sort large data segments after other
12365 (align_file_offset): New static function.
12366 (Layout::set_segment_offsets): Use align_file_offset.
12367 * output.h (class Output_section): Add is_small_section_ and
12368 is_large_section_ fields.
12369 (Output_section::is_small_section): New function.
12370 (Output_section::set_is_small_section): New function.
12371 (Output_section::is_large_section): New function.
12372 (Output_section::set_is_large_section): New function.
12373 (Output_section::is_large_data_section): New function.
12374 (class Output_segment): Add is_large_data_segment_ field.
12375 (Output_segment::is_large_data_segment): New function.
12376 (Output_segment::set_is_large_data_segment): New function.
12377 * output.cc (Output_section::Output_section): Initialize new
12379 (Output_segment::Output_segment): Likewise.
12380 (Output_segment::add_output_section): Add assertion that large
12381 data sections always go in large data segments. Force small data
12382 sections to the end of the list of data sections. Force small BSS
12383 sections to the start of the list of BSS sections. For large BSS
12384 sections to the end of the list of BSS sections.
12385 * symtab.h (class Symbol): Declare is_common_shndx.
12386 (Symbol::is_defined): Check Symbol::is_common_shndx.
12387 (Symbol::is_common): Likewise.
12388 (class Symbol_table): Define enum Commons_section_type. Update
12389 declarations. Add small_commons_ and large_commons_ fields.
12390 * symtab.cc (Symbol::is_common_shndx): New function.
12391 (Symbol_table::Symbol_table): Initialize new fields.
12392 (Symbol_table::add_from_object): Put small and large common
12393 symbols in the right list.
12394 (Symbol_table::sized_finalized_symbol): Check
12395 Symbol::is_common_shndx.
12396 (Symbol_table::sized_write_globals): Likewise.
12397 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12398 common symbol lists. Don't call do_allocate_commons_list if the
12400 (Symbol_table::do_allocate_commons_list): Remove is_tls
12401 parameter. Add comons_section_type parameter. Change all
12402 callers. Handle small and large common symbols.
12403 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12404 Symbol::is_common_shndx.
12405 * resolve.cc (symbol_to_bits): Likewise.
12406 * target.h (Target::small_common_shndx): New function.
12407 (Target::small_common_section_flags): New function.
12408 (Target::large_common_shndx): New function.
12409 (Target::large_common_section_flags): New function.
12410 (Target::new_output_section): New function.
12411 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12412 small_common_section_flags, and large_common_section_flags
12414 (Target::do_new_output_section): New virtual function.
12415 * arm.cc (Target_arm::arm_info): Initialize new fields.
12416 * i386.cc (Target_i386::i386_info): Likewise.
12417 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12419 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12420 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12421 (Target_x86_64::do_new_output_section): New function.
12422 * configure.ac: Define conditional MCMODEL_MEDIUM.
12423 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12424 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12425 (large_LDFLAGS): Define.
12426 * testsuite/large.c: New file.
12427 * testsuite/testfile.cc (Target_test::test_target_info):
12428 Initialize new fields.
12429 * configure, testsuite/Makefile.in: Rebuild.
12431 2009-06-05 Doug Kwan <dougkwan@google.com>
12433 * Makefile.am (CCFILES): Add target.cc.
12434 * Makefile.in: Regenerate.
12435 * i386.cc (class Target_i386): Define new virtual method to
12436 override do_is_local_label_name in parent.
12437 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12438 local symbols if --discard-locals or -X is given.
12439 * options.h (class General_options): Declare new options
12440 '--discard-locals' and '-X' for discarding locals.
12441 * target.h (class Target): Define new methods is_local_label_name.
12442 Declare new virtual method do_is_local_label_name.
12443 * target.cc: New file.
12444 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12445 (check_SCRIPTS): Add discard_locals_test.sh.
12446 (check_DATA): Add discard_local_tests.syms.
12447 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12448 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12449 * testsuite/Makefile.in: Regenerate.
12450 * testsuite/discard_locals_test.c: New file.
12451 * testsuite/discard_locals_test.sh: Same.
12453 2009-06-05 Doug Kwan <dougkwan@google.com>
12455 * object.cc (Sized_relobj::Sized_relobj): Initialize
12456 discarded_eh_frame_shndx_ to -1U.
12457 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12459 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12460 a discarded .eh_frame section.
12461 (Sized_relobj::do_finalize_local_symbols): Ditto.
12462 * object.h (class Sized_relobj): Declare new member
12463 discarded_eh_frame_shndx_.
12464 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12465 (local_labels_test.o, local_labels_test): New rules.
12466 * testsuite/Makefile.in: Regenerate.
12468 2009-06-04 Doug Kwan <dougkwan@google.com>
12470 * layout.cc (Layout::section_name_mapping): Add mapping for
12471 special ARM sections.
12473 2009-06-03 Doug Kwan <dougkwan@google.com>
12475 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12476 (utils::has_overflow): Same.
12478 2009-06-03 Ian Lance Taylor <iant@google.com>
12480 * layout.cc (Layout::section_name_mapping): New array, replacing
12481 Layout::linkonce_mapping.
12482 (Layout::section_name_mapping_count): New variable, replacing
12483 Layout::linkonce_mapping_count.
12484 (Layout::linkonce_output_name): Remove.
12485 (Layout::output_section_name): Rewrite.
12486 * layout.h (class Layout): Rename Linkonce_mapping to
12487 Section_name_mapping, linkonce_mapping to section_name_mapping,
12488 linkonce_mapping_count to section_name_mapping_count. Don't
12489 declare linkonce_output_name.
12491 2009-06-03 Doug Kwan <dougkwan@google.com>
12493 * gold/arm.cc (namespace utils): New.
12494 (Target_arm::reloc_is_non_pic): Define new method.
12495 (class Arm_relocate_functions): New.
12496 (Target_arm::Relocate::relocate): Handle relocation types used by
12499 2009-06-03 Ian Lance Taylor <iant@google.com>
12501 * arm.cc (Target_arm::scan::global): Use || instead of |.
12503 2009-06-02 Doug Kwan <dougkwan@google.com>
12505 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12506 issued_non_pic_error_.
12507 (class Target_arm::Scan): Declare new method check_non_pic.
12508 Define new method symbol_needs_plt_entry.
12509 Declare new data member issued_non_pic_error_.
12510 (class Target_arm::Relocate): Declare new method
12511 should_apply_static_reloc.
12512 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12513 (Target_arm::Scan::check_non_pic): Define new method.
12514 (Target_arm::Scan::local): Handle a small subset of reloc types used
12516 (Target_arm::Scan::local): Same.
12517 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12519 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12521 * incremental.cc (Incremental_inputs::report_command_line): Filter
12522 out --incremental-* options.
12524 2009-05-29 Doug Kwan <dougkwan@google.com>
12526 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12528 (class Target_arm): Update comment.
12529 (Target_arm::Target_arm): Initialize new data members GOT_,
12530 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12531 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12532 and Target_arm::rel_dyn_section.
12533 Declare new_enum Target_arm::Got_type.
12534 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12536 Update commments for member do_dynsym_value.
12537 (Target_arm::got_size, Target_arm::plt_section,
12538 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12539 new methods inside class defintion.
12540 (Target_arm::got_section): Define new method.
12541 (Target_arm::rel_dyn_section): Same.
12542 (Output_data_plt_arm): New template class.
12543 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12544 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12545 (Output_data_plt_arm::add_entry): Same.
12546 (Output_data_plt_arm::first_plt_entry): Define new
12547 static data member for PLT instruction template.
12548 (Output_data_plt_arm::plt_entry): Same.
12549 (Output_data_plt_arm::do_write): Define new method.
12550 (Target_arm::make_plt_entry): Same.
12551 (Target_arm::do_finalize_sections): Same.
12552 (Target_arm::do_dynsym_value): Same.
12554 2009-05-28 Doug Kwan <dougkwan@google.com>
12556 * Makefile.am (TARGETSOURCES): Add arm.cc.
12557 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12558 * Makefile.in: Regenerate.
12559 * arm.cc: New file.
12560 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12562 2009-05-26 Doug Kwan <dougkwan@google.com>
12564 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12565 (General_options::check_excluded_libs): Strip off directories in
12566 archive name before matching like GNU ld does.
12567 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12568 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12569 (exclude_libs_test_LDFLAGS): Add linker option
12570 -Wl,--exclude-libs,libexclude_libs_test_3
12571 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12572 an explicit archive without using -l.
12573 (alt/libexclude_libs_test_3.a): New make rule.
12574 * testsuite/Makefile.in: Regenerate.
12575 * testsuite/exclude_libs_test.c : Declare lib3_default().
12577 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12578 * exclude_libs_test_3.c: New file.
12580 2009-05-26 Nick Clifton <nickc@redhat.com>
12582 * po/id.po: New Indonesian translation.
12583 * po/gold.pot: Updated template file.
12585 2009-05-22 Sriraman Tallam <tmsriram@google.com>
12587 * testsuite/Makefile.am: Add -ffunction-sections to compile
12588 gc_comdat_test files. Add -Wl,--gc-sections to build
12590 * testsuite/Makefile.in: Regenerate.
12591 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12593 2009-05-21 Sriraman Tallam <tmsriram@google.com>
12595 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12596 kept comdat section was garbage collected.
12597 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12598 * testsuite/Makefile.in: Regenerate.
12599 * testsuite/gc_comdat_test.sh: New file.
12600 * testsuite/gc_comdat_test_1.cc: New file.
12601 * testsuite/gc_comdat_test_2.cc: New file.
12603 2009-05-19 Doug Kwan <dougkwan@google.com>
12605 * archive.cc (Archive::Archive): Move constructor from archive.h
12606 to here. Initialize no_export_.
12607 (Archive::get_elf_object_for_member): Set no_export flag of object.
12608 * archive.h (Archive::Archive): Move constructor body to
12610 (Archive::no_export): New method.
12611 (Archive::no_export_): New field.
12612 * object.h (Object::Object): Initialize no_export_ to false.
12613 (Object::no_export, Object::set_no_export): New methods.
12614 (Object::no_export_): New field.
12615 * options.cc (General_options::parse_exclude_libs): New method.
12616 (General_options::check_excluded_libs) Same.
12617 * options.h (exclude_libs): New option.
12618 (General_options::check_excluded_libs): New method declaration.
12619 (General_options::excluded_libs_): New field.
12620 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12621 default or protected visibility if an object has no-export flag set.
12622 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12623 (check_SCRIPTS): Add exclude_libs_test.sh.
12624 (check_DATA): Add exclude_libs_test.syms.
12625 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12626 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12627 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12628 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12629 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12630 libexclude_libs_test_2.a): New rules.
12631 * testsuite/Makefile.in: Regenerate.
12632 * testsuite/exclude_libs_test.c: New file.
12633 * testsuite/exclude_libs_test.sh: Ditto.
12634 * testsuite/exclude_libs_test_1.c: Ditto.
12635 * testsuite/exclude_libs_test_2.c: Ditto.
12637 2009-05-15 Ian Lance Taylor <iant@google.com>
12639 * configure.ac: Check for declarations for cases where libiberty.h
12640 checks HAVE_DECL_xxx.
12641 * configure, config.in: Rebuild.
12643 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12645 * gold.h (Incremental_argument_list): Remove (invalid) forward
12647 * incremental.cc (Incremental_inputs::report_achive): New method.
12648 (Incremental_inputs::report_object): New method.
12649 (Incremental_inputs::report_script): New method.
12650 (Incremental_inputs::finalize_inputs): New method.
12651 (Incremental_inputs::finalize): Call finalize_inputs().
12652 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12653 Create inputs entries.
12654 * incremental.h (Incremental_input_type): New enum.
12655 (Incremental_inputs::Incremental_input): Initialize new fields.
12656 (Incremental_inputs::report_inputs): New method.
12657 (Incremental_inputs::report_achive): New method.
12658 (Incremental_inputs::report_object): New method.
12659 (Incremental_inputs::report_script): New method.
12660 (Incremental_inputs::finalize_inputs): New method.
12661 (Incremental_inputs::Input_info): New struct.
12662 (Incremental_inputs::Input_info_map): New typedef.
12663 (Incremental_inputs::lock_): New field.
12664 (Incremental_inputs::Inputs_): New field.
12665 (Incremental_inputs::Inputs_map): New field.
12666 * main.cc (main): Call Incremental_input::report_inputs.
12667 * options.h (Input_argument_list): Typedef moved from
12669 (Input_file_group::Files): Remove, use ::Input_argument_list.
12670 (Input_file_group::Input_argument_list): Remove, use
12671 ::Input_argument_list.
12672 * plugin.cc (Plugin_manager::add_input_file): Add error in
12674 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12676 * script.cc (read_input_script): Call
12677 Incremental_input::report_script.
12678 * script.h (Script_info): New class.
12680 2009-04-27 Ian Lance Taylor <iant@google.com>
12682 * x86_64.cc (do_adjust_output_section): Set entsize to
12685 2009-04-23 Elliott Hughes <enh@google.com>
12687 * output.cc (Output_file::close): After short writes, continue
12688 writing from the correct offset in the buffer being written.
12690 2009-04-23 Chris Demetriou <cgd@google.com>
12692 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12693 * configure: Regenerate.
12694 * config.in: Regenerate.
12695 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12696 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12698 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12700 * incremental.cc (Incremental_inputs_header_data): Renamed from
12701 Incremental_input_header_data.
12702 (Incremental_inputs_header_data::data_size): New field.
12703 (Incremental_inputs_header_data::put_input_file_count): Renamed
12704 from input_file_count.
12705 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12706 from command_line_offset.
12707 (Incremental_inputs_header_data::put_reserved): Renamed from
12709 (Incremental_inputs_entry_data): Renamed from
12710 Incremental_input_entry_data.
12711 (Incremental_inputs_entry_data::data_size): New field.
12712 (Incremental_inputs::report_command_line): New method.
12713 (Incremental_inputs::finalize): New method.
12714 (Incremental_inputs::create_incremental_inputs_data): New method.
12715 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12716 * incremental.h: New file.
12717 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
12718 (Layout::finalize): Create incremental inputs section in
12719 incremental builds.
12720 (Layout::create_incremental_info_sections): New method.
12721 * layout.h (Layout::incremental_inputs): New method.
12722 (Layout::create_incremental_info_sections): New method.
12723 (Layout::incremental_inputs_): New field.
12724 * main.cc (main): Notify Incremental_input of the command line.
12726 2009-04-01 Ian Lance Taylor <iant@google.com>
12727 Mikolaj Zalewski <mikolajz@google.com>
12729 * gold.h (reserve_unordered_map): Define, three versions, one for
12730 each version of Unordered_map.
12731 * layout.cc (Layout::Layout): Remove options parameter. Add
12732 number_of_input_files parameter. Don't initialize options_.
12733 Initialize number_of_input_files_ and resized_signatures_. Move
12734 sections_are_attached_.
12735 (Layout::layout_group): Reserve space for group_signatures_.
12736 (Layout::find_or_add_kept_section): Change name parameter to be a
12737 reference. Resize signatures_ map when it gets large enough.
12738 (Layout::layout_eh_frame): Use parameters->options() instead of
12740 (Layout::make_output_section): Likewise.
12741 (Layout::attach_allocated_section_to_segment): Likewise.
12742 (Layout::finalize, Layout::create_executable_stack): Likewise.
12743 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12744 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12745 * layout.h (class Layout): Update declarations. Remove options_
12746 field. Add number_of_input_files_ and resized_signatures_
12747 fields. Move sections_are_attached_ field.
12748 * main.cc (main): Pass number of input files to Layout
12749 constructor. Don't pass options.
12751 2009-03-30 Ian Lance Taylor <iant@google.com>
12753 * ffsll.c (ffsll): Correct implementation.
12755 2009-03-27 Ian Lance Taylor <iant@google.com>
12757 * ffsll.c: New file.
12758 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12759 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12760 * ftruncate.c (ftruncate): Declare before definition.
12761 * mremap.c (mremap): Likewise.
12762 * pread.c (pread): Likewise.
12763 * configure, Makefile.in, config.in: Rebuild.
12765 * mremap.c: New file.
12766 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12767 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12768 (mremap): Declare if HAVE_MREMAP is not defined.
12769 * configure, Makefile.in, config.in: Rebuild.
12771 2009-03-27 Cary Coutant <ccoutant@google.com>
12773 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12774 position independent.
12775 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12776 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12778 2009-03-24 Cary Coutant <ccoutant@google.com>
12780 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12782 (needs_dynamic_reloc): Likewise.
12784 2009-03-24 Ian Lance Taylor <iant@google.com>
12786 * yyscript.y (file_cmd): Recognize EXTERN.
12787 (extern_name_list, extern_name_list_body): New nonterminals.
12788 * script.cc (script_add_extern): Define.
12789 * script-c.h (script_add_extern): Declare.
12791 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
12793 * object.cc (is_elf_object): Define.
12794 * object.h (is_elf_object): Declare.
12795 * archive.cc (Archive::get_elf_object_for_member): Call
12797 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
12799 2009-03-24 Elliott Hughes <enh@google.com>
12801 * output.cc (Output_file::map_anonymous): Define.
12802 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12803 try an anonymous one. Report the size if the mmap fails.
12804 * output.h (class Output_file): Declare map_anonymous.
12806 2009-03-24 Ian Lance Taylor <iant@google.com>
12808 * target-select.cc (instantiate_target): Don't acquire the lock if
12809 the instantiated_target_ field has already been set.
12811 2009-03-23 Ian Lance Taylor <iant@google.com>
12813 * gold-threads.h (class Initialize_lock): Define.
12814 * gold-threads.cc (class Initialize_lock_once): Define.
12815 (initialize_lock_control): New static variable.
12816 (initialize_lock_pointer): New static variable.
12817 (initialize_lock_once): New static function.
12818 (Initialize_lock::Initialize_lock): Define.
12819 (Initialize_lock::initialize): Define.
12820 * target-select.h: Include "gold-threads.h".
12821 (class Target_selector): Add lock_ and initialize_lock_ fields.
12822 Don't define instantiate_target, just declare it.
12823 * target-select.cc (Target_selector::Target_selector): Initialize
12825 (Target_selector::instantiate_target): Define.
12826 * descriptors.h: Include "gold-threads.h".
12827 (class Descriptors): Add initialize_lock_ field.
12828 * descriptors.cc (Descriptors::Descriptors): Initialize new
12830 (Descriptors::open): Use initialize_lock_ field
12831 * errors.h (class Errors): Add initialize_lock_ field.
12832 * errors.cc (Errors::Errors): Initialize new field.
12833 (Errors::initialize_lock): Use initialize_lock_ field.
12834 * powerpc.cc (class Target_selector_powerpc): Remove
12835 instantiated_target_ field. In do_recognize call
12836 instantiate_target rather than do_instantiate_target. In
12837 do_instantiate_target just allocate a new target.
12838 * sparc.cc (class Target_selector_sparc): Likewise.
12840 * freebsd.h: New file.
12841 * i386.cc: Include "freebsd.h".
12842 (Target_i386): Derive from Target_freebsd rather than
12844 (Target_selector_i386): Derive from Target_selector_freebsd rather
12845 than Target_selector.
12846 * x86_64.cc: Include "freebsd.h".
12847 (Target_x86_64): Derive from Target_freebsd rather than
12849 (Target_selector_x86_64): Derive from Target_selector_freebsd
12850 rather than Target_selector.
12851 * target.h (class Target): Add adjust_elf_header and
12852 do_adjust_elf_header.
12853 * output.cc (Output_file_header:: do_sized_write): Call target
12854 adjust_elf_header routine.
12855 * configure.tgt: Set targ_osabi.
12856 * configure.ac: Define GOLD_DEFAULT_OSABI.
12857 * parameters.cc (Parameters::default_target): Pass
12858 GOLD_DEFAULT_OSABI to select_target.
12859 * target-select.h (class Target_selector): Make instantiate_target
12860 protected rather than private.
12861 * Makefile.am (HFILES): Add freebsd.h.
12862 * configure, Makefile.in, config.in: Rebuild.
12864 * merge.cc (do_add_input_section): Correct pend value. Change
12865 message about last entry not being null terminated from error to
12868 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12870 * incremental.cc: New file.
12871 * Makefile.am (CCFILES): Add incremental.cc.
12872 * Makefile.in: Rebuild.
12874 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12876 * layout.cc (Layout::output_section_name): Preserve names
12877 of '.note.' sections.
12879 2009-03-19 Ian Lance Taylor <iant@google.com>
12881 * descriptors.cc (Descriptors::open): Check that the options are
12882 valid before using them.
12884 2009-03-18 Ian Lance Taylor <iant@google.com>
12886 * script-sections.h: Include <list>.
12887 (class Script_sections): Change Sections_elements from std::vector
12888 to std::list. Typedef public Elements_iterator. Add
12889 orphan_section_placement_, data_segment_align_start_, and
12890 saw_data_segment_align_ fields. Remove data_segment_align_index_
12892 * script-sections.cc (class Orphan_section_placement): New class.
12893 (class Sections_element): Add virtual functions is_relro and
12894 orphan_section_init. Remove virtual function place_orphan_here.
12895 (class Output_section_definition): Add is_relro and
12896 orphan_section_init. Remove place_orphan_here.
12897 (class Orphan_output_section): Likewise.
12898 (Script_sections::Script_sections): Update for field changes.
12899 (Script_sections::data_segment_align): Set saw_data_segment_align_
12900 and data_segment_align_start_, not data_segment_align_index.
12901 (Script_sections::data_segment_relro_end): Check
12902 saw_data_segment_align_. Use data_segment_align_start_ rather
12903 than data_segment_align_index_.
12904 (Script_sections::place_orphan): Rewrite to use
12905 Orphan_section_placement.
12907 2009-03-17 Ian Lance Taylor <iant@google.com>
12909 * archive.cc (Archive::add_symbols): Check for a version attached
12910 to the symbol name in the archive map.
12911 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12912 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12913 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12914 (ver_test_11.a): New target.
12915 * testsuite/Makefile.in: Rebuild.
12917 * configure.ac: Check for chsize and posix_fallocate. Replace
12919 * ftruncate.c: New file, from gnulib.
12920 * output.cc (posix_fallocate): Define dummy version if not
12921 HAVE_POSIX_FALLOCATE.
12922 (Output_file::map): Call posix_fallocate rather than lseek and
12924 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12925 * configure, Makefile.in, config.in: Rebuild.
12927 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
12929 * layout.h (Layout::create_note): Add section_name parameter.
12930 * layout.cc (Layout::create_note): Likewise.
12931 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
12933 2009-03-17 Ian Lance Taylor <iant@google.com>
12935 * descriptors.cc: Include "options.h".
12936 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12937 (Descriptors::open): Always use O_CLOEXEC when opening a new
12938 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12939 then set FD_CLOEXEC.
12941 * sparc.cc (class Target_sparc): Add has_got_section.
12942 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12943 make sure we have a GOT section.
12945 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12946 (Target_sparc::Scan::local): Likewise.
12947 (Target_sparc::Scan::global): Likewise.
12948 (Target_sparc::Relocate::relocate): Likewise.
12949 (Target_sparc::Relocate::relocate_tls): Likewise.
12951 * symtab.cc (Symbol_table::define_default_version): New function,
12952 broken out of add_from_object.
12953 (Symbol_table::add_from_object): Call define_default_version.
12954 (Symbol_table::define_special_symbol): Add resolve_oldsym
12955 parameter. Change all callers. If the version for a symbol comes
12956 from a version script, resolve it with the symbol with the same
12957 name with no version. Also add the symbol without a version if
12959 (do_define_in_output_data): If resolving with oldsym, don't delete
12961 (do_define_in_output_segment): Likewise.
12962 (do_define_as_constant): Likewise.
12963 * symtab.h (class Symbol_table): Update declarations.
12965 2009-03-13 Ian Lance Taylor <iant@google.com>
12967 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12968 (Read_symbols::requeue): New function.
12969 (Read_symbols::do_read_symbols): If make_elf_object fails because
12970 the target type is not configured, and the file was searched for,
12971 issue a warning and retry with the next directory.
12972 (Add_symbols::run): If the file has an incompatible format, and
12973 it was searched for, requeue the Read_symbols task. On error,
12974 release the object.
12975 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12976 dirindex parameter to constructor. Change all callers. Declare
12977 incompatible_warning and requeue.
12978 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12979 input_argument_ and input_group_ fields. Add them to
12980 constructor. Change all callers.
12981 (class Read_script): Add dirindex_ field. Add it to constructor.
12982 Change all callers.
12983 * archive.cc (Archive::setup): Remove input_objects parameter.
12984 Change all callers.
12985 (Archive::get_file_and_offset): Likewise.
12986 (Archive::read_all_symbols): Likewise.
12987 (Archive::read_symbols): Likewise.
12988 (Archive::get_elf_object_for_member): Remove input_objects
12989 parameter. Add punconfigured parameter. Change all callers.
12990 (Archive::add_symbols): Change return type to bool. Check return
12991 value of include_member.
12992 (Archive::include_all_members): Likewise.
12993 (Archive::include_member): Change return type to bool. Return
12994 false if first included object has incompatible target. Set
12995 included_member_ field.
12996 (Add_archive_symbols::run): If add_symbols returns false, requeue
12998 * archive.h (class Archive): Add included_member_ field.
12999 Initialize it in constructor. Add input_file and searched_for
13000 methods. Update declarations.
13001 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13002 input_argument_ fields. Add them to constructor. Change all
13004 * script.cc: Include "target-select.h".
13005 (class Parser_closure): Add skip_on_incompatible_target_ and
13006 found_incompatible_target_ fields. Add
13007 skip_on_incompatible_target parameter to constructor. Change all
13008 callers. Add methods skip_on_incompatible_target,
13009 clear_skip_on_incompatible_target, found_incompatible_target, and
13010 set_found_incompatible_target.
13011 (read_input_script): Add dirindex parameter. Change all callers.
13012 If parser finds an incompatible target, requeue Read_symbols
13014 (script_set_symbol): Clear skip_on_incompatible_target in
13016 (script_add_assertion, script_parse_option): Likewise.
13017 (script_start_sections, script_add_phdr): Likewise.
13018 (script_check_output_format): New function.
13019 * script.h (read_input_script): Update declaration.
13020 * script-c.h (script_check_output_format): Declare.
13021 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13022 (ignore_cmd): Remove OUTPUT_FORMAT.
13023 * fileread.cc (Input_file::Input_file): Add explicit this.
13024 (Input_file::will_search_for): New function.
13025 (Input_file::open): Add pindex parameter. Change all callers.
13026 * fileread.h (class Input_file): Add input_file_argument method.
13027 Declare will_search_for. Update declarations.
13028 * object.cc (make_elf_object): Add punconfigured parameter.
13029 Change all callers.
13030 * object.h (class Object): Make input_file public. Add
13031 searched_for method.
13032 (make_elf_object): Update declaration.
13033 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13035 * dirsearch.h (class Dirsearch): Update declaration.
13036 * options.h (class General_options): Add --warn-search-mismatch.
13037 * parameters.cc (Parameters::is_compatible_target): New function.
13038 * parameters.h (class Parameters): Declare is_compatible_target.
13039 * workqueue.cc (Workqueue::add_blocker): New function.
13040 * workqueue.h (class Workqueue): Declare add_blocker.
13042 * fileread.cc (Input_file::open): Remove options parameter.
13043 Change all callers.
13044 (Input_file::open_binary): Likewise.
13045 * script.cc (read_input_script): Likewise.
13046 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13047 options parameter from constructor. Change all callers.
13048 (class Read_script): Likewise.
13049 * fileread.h (class Input_file): Update declarations.
13050 * script.h (read_input_script): Update declaration.
13052 2009-03-10 Nick Clifton <nickc@redhat.com>
13054 * po/es.po: New Spanish translation.
13056 2009-03-06 Cary Coutant <ccoutant@google.com>
13058 * options.cc (parse_short_option): Keep dash_z from registering itself.
13060 2009-03-03 Ian Lance Taylor <iant@google.com>
13063 * target-reloc.h (relocate_section): Pass output_section to
13065 * i386.cc (Target_i386::should_apply_static_reloc): Add
13066 output_section parameter. Change all callers.
13067 (Target_i386::Relocate::relocate): Add output_section parameter.
13068 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13069 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13070 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13071 * testsuite/two_file_shared.sh: New script.
13072 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13073 (check_DATA): Add two_file_shared.dbg.
13074 (two_file_shared.dbg): New target.
13075 * testsuite/Makefile.in: Rebuild.
13077 2009-03-01 Ian Lance Taylor <iant@google.com>
13079 * configure.ac: Check for byteswap.h.
13080 * configure: Rebuild.
13081 * config.in: Rebuild.
13083 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13085 * layout.cc (Layout::find_or_add_kept_section): New function.
13086 (Layout::add_comdat): Removed.
13087 * layout.h (struct Kept_section): Move out of class Layout.
13088 Remove trailing underscores from field names. Add group_sections
13089 field. Rename group_ field to is_group. Change all uses.
13090 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13091 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13092 comdat_groups_ field.
13093 (Sized_relobj::include_section_group): Use
13094 find_or_add_kept_section and Kept_section::group_sections.
13095 (Sized_relobj::include_linkonce_section): Likewise.
13096 * object.cc (class Sized_relobj): Don't define Comdat_group or
13097 Comdat_group_table. Remove find_comdat_group and
13098 add_comdat_group. Remove comdat_groups_ field.
13099 * plugin.cc (include_comdat_group): Use
13100 Layout::find_or_add_kept_section.
13102 2009-02-28 Ian Lance Taylor <iant@google.com>
13104 * README: --gc-sections and map files are now supported. Document
13105 some build requirements.
13108 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13109 relocatable link set the value of the section symbol to zero.
13110 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13111 relocatable link don't include the section address in the local
13114 2009-02-27 Ian Lance Taylor <iant@google.com>
13117 * options.h (class Search_directory): Add is_system_directory.
13118 (class General_options): Declare is_in_system_directory.
13119 * options.cc (get_relative_sysroot): Make static.
13120 (get_default_sysroot): Make static.
13121 (General_optoins::is_in_system_directory): New function.
13122 * fileread.cc (Input_file::is_in_system_directory): New function.
13123 * fileread.h (class Input_file): Declare is_in_system_directory.
13124 * object.h (class Object): Add is_in_system_directory.
13125 (class Input_objects): Remove system_library_directory_ field.
13126 * object.cc (Input_objects::add_object): Don't set
13127 system_library_directory_.
13128 (input_objects::found_in_system_library_directory): Remove.
13129 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13130 parameter. Change all callers.
13131 (Symbol_table::sized_write_globals): Likewise.
13132 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13133 Call Object::is_in_system_directory.
13134 * symtab.h (class Symbol_table): Update declarations.
13137 * descriptors.h (Open_descriptor): Add is_on_stack field.
13138 * descriptors.cc (Descriptors::open): If the descriptor is on the
13139 top of the stack, remove it. Initialize is_on_stack field.
13140 (Descriptors::release): Only add pod to stack if it is not on the
13142 (Descriptors::close_some_descriptor): Clear stack_next and
13143 is_on_stack fields.
13146 * output.cc (Output_section::find_starting_output_address): Rename
13147 from starting_output_address; add PADDR parameter; change return
13149 * output.h (class Output_section): Declare
13150 find_starting_output_address instead of starting_output_address.
13151 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13152 section symbol for which we can't find a merge section.
13155 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13156 hidden or internal, force the symbol to be local.
13157 * resolve.cc (Symbol::override_visibility): Define.
13158 (Symbol::override_base): Use override_visibility.
13159 (Symbol_table::resolve): Likewise.
13160 (Symbol::override_base_with_special): Likewise.
13161 (Symbol_table::override_with_special): If the visibility is hidden
13162 or internal, force the symbol to be local.
13163 * symtab.h (class Symbol): Add set_visibility and
13164 override_visibility.
13165 * testsuite/ver_test_1.sh: New file.
13166 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13167 (check_DATA): Add ver_test_1.syms.
13168 (ver_test_1.syms): New target.
13169 * testsuite/Makefile.in: Rebuild.
13171 2009-02-25 Cary Coutant <ccoutant@google.com>
13173 * layout.cc (Layout::choose_output_section): Don't rename sections
13174 when using a linker script that has a SECTIONS clause.
13175 * Makefile.in: Regenerate.
13177 * testsuite/Makefile.am (script_test_5.sh): New test case.
13178 * testsuite/Makefile.in: Regenerate.
13179 * testsuite/script_test_5.cc: New file.
13180 * testsuite/script_test_5.sh: New file.
13181 * testsuite/script_test_5.t: New file.
13183 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
13185 * archive.cc (Archive::include_member): Update calls to add_symbols.
13186 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13187 the Layout argument.
13188 * dynobj.h (do_add_symbols): Add the Layout argument.
13189 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13191 * object.h (Object::add_symbols): Add the Layout argument.
13192 (Object::do_add_symbols): Add the Layout argument.
13193 (Sized_relobj::do_add_symbols): Add the Layout argument.
13194 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13195 Unify the two versions.
13196 (Add_plugin_symbols): Remove.
13197 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13198 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13199 (Add_plugin_symbols): Remove.
13200 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13201 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13202 (Add_symbols::run): Make it work with Pulginobj.
13204 2009-02-06 Ian Lance Taylor <iant@google.com>
13206 * object.cc (Sized_relobj::do_layout): Make info message start
13207 with lower case letter.
13209 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13211 * binary.cc: Fix file comment.
13213 * options.h (enum Incremental_disposition): Define.
13214 (class General_options): Add new options: --incremental,
13215 --incremental_changed, --incremental_unchanged,
13216 --incremental_unknown. Add incremental_disposition_ and
13217 implicit_incremental_ fields.
13218 (General_options::incremental_disposition): New function.
13219 (class Position_dependent_options): Add incremental_disposition
13221 (Position_dependent_options::copy_from_options): Set incremental
13223 * options.cc (General_options::parse_incremental_changed): New
13225 (General_options::parse_incremental_unchanged): New function.
13226 (General_options::parse_incremental_unknown): New function.
13227 (General_options::General_options): Initialize new fields
13228 incremental_disposition_ and implicit_incremental_.
13229 (General_options::finalize): Check for uasge of --incremental-*
13230 without --incremental.
13232 2009-02-06 Chris Demetriou <cgd@google.com>
13234 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13235 pointer and to report location as the file name associated with
13237 (gold_undefined_symbol_at_location): New function to replace the
13238 old gold_undefined_symbol functionality.
13239 * target-reloc.h (relocate_section): Update to use
13240 gold_undefined_symbol_at_location.
13241 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13242 Call gold_undefined_symbol function rather than gold_error.
13243 * errors.h (Errors::undefined_symbol): Take location as a
13244 string, rather than calculating it from a relocation.
13245 * errors.cc (Errors::fatal): Print "fatal error:" before the
13247 (Errors::error, Errors::error_at_location): Print "error: "
13248 before the formatted message.
13249 (Errors::undefined_symbol): Take location as a string, rather
13250 than calculating it from a relocation.
13251 (gold_undefined_symbol_at_location): New function akin to
13252 old gold_undefined_symbol, calculates location from relocation.
13253 (gold_undefined_symbol): Change to take only a Symbol pointer
13254 and to report location as the file name associated with the symbol.
13255 * testsuite/debug_msg.sh: Update for changed error messages.
13256 * testsuite/undef_symbol.sh: Likewise.
13258 2009-02-04 Duncan Sands <baldrick@free.fr>
13261 * reduced_debug_output.h
13262 (Output_reduced_debug_abbrev_section::failed): Use format for
13264 (Output_reduced_debug_info_section::faild): Likewise.
13266 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13268 * script.cc (Lazy_demangler): New class.
13269 (Version_script_info::get_symbol_version_helper): Demangle a
13272 2009-01-29 Cary Coutant <ccoutant@google.com>
13274 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13276 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13278 2009-01-28 Ian Lance Taylor <iant@google.com>
13280 * version.cc (version_string): Bump to 1.9.
13282 * gold.h: Include <cstring> and <stdint.h>.
13283 * version.cc: Include <cstdio>.
13284 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13286 * reduced_debug_output.cc (insert_into_vector): Rename from
13287 Insert_into_vector; change all callers. Use Swap_unaligned to
13288 avoid aliasing issue; remove union since it is unnecessary.
13290 2009-01-27 Sriraman Tallam <tmsriram@google.com>
13292 * Makefile.am (CCFILES): Add gc.cc.
13293 (HFILES): Add gc.h.
13294 * Makefile.in: Regenerate.
13295 * gold.cc (Gc_runner): New class.
13296 (queue_initial_tasks): Call garbage collection related tasks
13297 when corresponding options are invoked.
13298 (queue_middle_gc_tasks): New function.
13299 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13300 processed early before laying out sections during garbage collection.
13301 * gold.h (queue_middle_gc_tasks): New function.
13302 (is_prefix_of): Move from "layout.cc".
13303 * i386.cc (Target_i386::gc_process_relocs): New function.
13304 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13305 * main.cc (main): Create object of class "Garbage_collection".
13306 * object.cc (Relobj::copy_symbols_data): New function.
13307 (Relobj::is_section_name_included): New function.
13308 (Sized_relobj::do_layout): Allow this function to be called twice
13309 during garbage collection and defer layout of section during the
13311 * object.h (Relobj::get_symbols_data): New function.
13312 (Relobj::is_section_name_included): New function.
13313 (Relobj::copy_symbols_data): New function.
13314 (Relobj::set_symbols_data): New function.
13315 (Relobj::get_relocs_data): New function.
13316 (Relobj::set_relocs_data): New function.
13317 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13318 (Relobj::gc_process_relocs): New function.
13319 (Relobj::do_gc_process_relocs): New pure virtual function.
13320 (Relobj::sd_): New data member.
13321 (Sized_relobj::is_output_section_offset_invalid): New function.
13322 (Sized_relobj::do_gc_process_relocs): New function.
13323 * options.h (General_options::gc_sections): Modify to not be a no-op.
13324 (General_options::print_gc_sections): New option.
13325 * plugin.cc (Plugin_finish::run): Remove function call to
13326 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13327 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13328 * reloc.cc (Read_relocs::run): Add task to process relocs and
13329 determine unreferenced sections when doing garbage collection.
13330 (Gc_process_relocs): New class.
13331 (Sized_relobj::do_gc_process_relocs): New function.
13332 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13333 sections that are garbage collected.
13334 * reloc.h (Gc_process_relocs): New class.
13335 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13336 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13337 symbols whose corresponding sections are garbage collected.
13338 (Symbol_table::Symbol_table): Add new parameter for the garbage
13340 (Symbol_table::gc_mark_undef_symbols): New function.
13341 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13342 (Symbol_table::gc_mark_dyn_syms): New function.
13343 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13345 (Symbol_table::add_from_object): Likewise.
13346 (Symbol_table::add_from_relobj): When building shared objects, do not
13347 treat externally visible symbols as garbage.
13348 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13349 table information for static and relocatable links.
13350 * symtab.h (Symbol_table::set_gc): New function.
13351 (Symbol_table::gc): New function.
13352 (Symbol_table::gc_mark_undef_symbols): New function.
13353 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13354 (Symbol_table::gc_mark_dyn_syms): New function.
13355 (Symbol_table::gc_): New data member.
13356 * target.h (Sized_target::gc_process_relocs): New pure virtual
13358 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13359 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13361 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13363 * options.h (General_options::gc_sections): Define as a no-op for now.
13364 (General_options::no_keep_memory): Ditto.
13365 (General_options::Bshareable): Define.
13366 * options.cc (General_options::finalize): Honor -Bshareable.
13368 2009-01-20 Andreas Schwab <schwab@suse.de>
13370 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13371 read the value in the contents, since we don't use it. Use the
13372 template endianness when writing.
13373 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13375 2009-01-19 Andreas Schwab <schwab@suse.de>
13377 * configure.tgt (powerpc64-*): Fix targ_obj.
13379 2009-01-15 Ian Lance Taylor <iant@google.com>
13381 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13382 local symbols when stripping all symbols.
13384 2009-01-14 Cary Coutant <ccoutant@google.com>
13386 * output.cc (Output_reloc): Add explicit instantiations.
13388 2009-01-14 Cary Coutant <ccoutant@google.com>
13390 * archive.cc (Archive::get_elf_object_for_member): Remove call
13391 to File_read::claim_for_plugin.
13392 * descriptors.cc (Descriptors::open): Remove reference to
13394 (Descriptors::claim_for_plugin): Remove.
13395 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13396 (Descriptors::is_claimed): Remove.
13397 (claim_descriptor_for_plugin): Remove.
13398 * fileread.cc (File_read::claim_for_plugin): Remove.
13399 * fileread.h (File_read::claim_for_plugin): Remove.
13400 (File_read::descriptor): Reopen descriptor if necessary.
13401 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13402 (Plugin_manager::all_symbols_read): Add task parameter. Change
13404 (Plugin_manager::get_input_file): New function.
13405 (Plugin_manager::release_input_file): New function.
13406 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13407 corresponding data member.
13408 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13409 and pass to base constructor. Change all callers.
13410 (get_input_file, release_input_file): New functions.
13411 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13412 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13413 (Plugin_manager::all_symbols_read): Add task parameter.
13414 (Plugin_manager::get_input_file): New function.
13415 (Plugin_manager::release_input_file): New function.
13416 (Plugin_manager::task_): New data member.
13417 (Pluginobj::Pluginobj): Add filesize parameter.
13418 (Pluginobj::filename): New function.
13419 (Pluginobj::descriptor): New function.
13420 (Pluginobj::filesize): New function.
13421 (Pluginobj::filesize_): New data member.
13422 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13423 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13424 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13426 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13427 with archive libraries.
13428 * testsuite/Makefile.in: Regenerate.
13429 * testsuite/plugin_test.c (struct sym_info): New type.
13430 (get_input_file, release_input_file): New static variables.
13431 (onload): Capture new transfer vector entries.
13432 (claim_file_hook): Stop reading at end of file according to filesize.
13433 Factor out parsing of readelf output into separate function.
13434 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13435 APIs and get the source file name from the symbol table. Convert
13436 source file name to corresponding object file name. Print info
13437 message when adding new input files.
13438 (parse_readelf_line): New function.
13439 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13440 * testsuite/plugin_test_2.sh: Likewise.
13441 * testsuite/plugin_test_3.sh: Likewise.
13442 * testsuite/plugin_test_4.sh: New test case.
13444 2009-01-07 Ian Lance Taylor <iant@google.com>
13446 * version.cc (version_string): Bump to 1.8.
13448 2008-12-23 Cary Coutant <ccoutant@google.com>
13450 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13451 * plugin.cc (Plugin_manager::finish): Rename as
13452 layout_deferred_objects. Move cleanup to separate function.
13453 (Plugin_manager::cleanup): New function.
13454 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13456 * plugin.h (Plugin_manager::finish): Rename as
13457 layout_deferred_objects.
13458 (Plugin_manager::cleanup): New function.
13459 (Plugin_manager::cleanup_done): New field.
13461 2008-12-23 Cary Coutant <ccoutant@google.com>
13463 * plugin.cc (is_visible_from_outside): New function.
13464 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13465 so we don't return "IR only" status for exported symbols or -r links.
13467 * testsuite/Makefile.am (plugin_test_3): New test case.
13468 * testsuite/Makefile.in: Regenerate.
13469 * testsuite/plugin_test_3.sh: New file.
13471 2008-12-22 Cary Coutant <ccoutant@google.com>
13473 * object.cc (Sized_relobj::layout_section): New function.
13474 (Sized_relobj::do_layout): Defer layout of input sections until after
13475 plugin has provided replacement files.
13476 (Sized_relobj::do_layout_deferred_sections): New function.
13477 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13478 (Relobj::layout_deferred_sections): New function.
13479 (Relobj::do_layout_deferred_sections): New function.
13480 (Sized_relobj::do_layout_deferred_sections): New function.
13481 (Sized_relobj::layout_section): New function.
13482 (Sized_relobj::Deferred_layout): New structure.
13483 (Sized_relobj::deferred_layout_): New field.
13484 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13485 Change all callers. Layout deferred sections.
13486 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13488 (Plugin_hook::run): Move code from do_plugin_hook inline.
13489 (Plugin_hook::do_plugin_hook): Remove.
13490 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13491 (Plugin_manager::finish): Renamed, was cleanup.
13492 (Plugin_manager::should_defer_layout): New function.
13493 (Plugin_manager::add_deferred_layout_object): New function.
13494 (Plugin_manager::Deferred_layout_list): New type.
13495 (Plugin_manager::deferred_layout_objects_): New field.
13496 (Plugin_hook::do_plugin_hook): Remove.
13498 2008-12-17 Ian Lance Taylor <iant@google.com>
13500 * options.h (class General_options): Add --no case for
13503 2008-12-16 Cary Coutant <ccoutant@google.com>
13505 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13507 (Plugin_manager::claim_file): Create plugin object even if
13508 plugin did not call the add_symbols callback.
13509 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13510 asking for more symbols than were added.
13511 * testsuite/Makefile.am (plugin_test_1): Add test case with
13513 (empty.syms): New target.
13514 * testsuite/Makefile.in: Regenerate.
13515 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13516 message. Don't call add_symbols if no globals.
13517 (all_symbols_read_hook): Don't provide replacement for empty
13520 2008-12-12 Ian Lance Taylor <iant@google.com>
13522 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13523 r_type == 0 for a local symbol with r_sym == 0.
13524 (scan_relocatable_relocs): Pass r_sym to
13525 local_non_section_strategy.
13526 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13529 * configure.ac: Update test for TLS descriptors: they are
13530 supported as of glibc 2.9.
13531 * configure: Rebuild.
13533 2008-12-11 Ian Lance Taylor <iant@google.com>
13536 * target-reloc.h (Default_scan_relocatable_relocs): For each
13537 function, map r_type == 0 to RELOC_DISCARD.
13539 2008-12-10 Cary Coutant <ccoutant@google.com>
13541 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13542 object to override a kept COMDAT group from a plugin object.
13544 2008-12-09 Ian Lance Taylor <iant@google.com>
13547 * yyscript.y (file_cmd): Handle INPUT.
13549 * testsuite/initpri1.c: Change all declarations to be full
13550 prototypes by adding void, to avoid compiler warnings.
13552 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
13554 * options.cc (General_options::parse_plugin_opt): New.
13555 (General_options::add_plugin): The argument now is just the filename.
13556 (General_options::add_plugin_option): New.
13557 * options.h (plugin_opt): New.
13558 (add_plugin): Change argument name.
13559 (add_plugin_option): New.
13560 * plugin.cc (Plugin::load): Don't parse the plugin option.
13561 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13562 (Plugin::add_option): New.
13563 (Plugin::args_): Change type.
13564 (Plugin::filename_): New.
13565 (Plugin_manager::add_plugin_option): New.
13566 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13567 * testsuite/Makefile.in: Regenerate.
13569 2008-12-05 Cary Coutant <ccoutant@google.com>
13571 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13572 Handle --strip-lto-sections option.
13573 * options.h (strip_lto_sections): New option.
13575 2008-12-01 Cary Coutant <ccoutant@google.com>
13577 * plugin.cc (ld_plugin_message): Change format parameter to const.
13578 Fix mismatch between new[] and delete.
13580 2008-11-14 Cary Coutant <ccoutant@google.com>
13582 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13585 2008-11-05 Craig Silverstein <csilvers@google.com>
13587 * options.cc (General_options::parse_dynamic_list): New function.
13588 * options.h (General_options): New flags dynamic_list,
13589 dynamic_list_data, dynamic_list_cpp_new, and
13590 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13591 (General_options::in_dynamic_list): New function.
13592 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13593 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13594 (Lex::can_continue_name): Likewise.
13596 (read_script_file): New parameter script_options.
13597 (read_dynamic_list): New function.
13598 (Script_options::define_dynamic_list): New function.
13599 (dynamic_list_keyword_parsecodes): New variable.
13600 (dynamic_list_keywords): New variable.
13601 * script.h (Script_options::define_dynamic_list): New function
13603 (read_dynamic_list): New function prototype.
13604 * symtab.cc (strprefix): New macro.
13605 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13606 dynamic_list_data, dynamic_list_cpp_new, and
13607 dynamic_list_cpp_typeinfo.
13608 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13609 (dynamic_list_expr): New rule.
13610 (dynamic_list_nodes): Likewise.
13611 (dynamic_list_node): Likewise.
13612 * testsuite/Makefile.am (dynamic_list): New test.
13613 * testsuite/Makefile.in: Regenerated.
13614 * testsuite/dynamic_list.t: New file.
13615 * testsuite/dynamic_list.sh: New file.
13617 2008-11-05 Craig Silverstein <csilvers@google.com>
13619 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13620 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13621 (t11_last): Likewise.
13622 * testsuite/ver_test_6.c (main): Likewise.
13624 2008-10-07 Cary Coutant <ccoutant@google.com>
13626 * options.c (General_options::finalize): Add check for -static and
13628 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13631 2008-10-02 Cary Coutant <ccoutant@google.com>
13633 * plugin.cc (make_sized_plugin_object): Fix conditional
13634 compilation to work when not all targets are enabled.
13636 2008-09-29 Cary Coutant <ccoutant@google.com>
13638 * archive.cc (Archive::get_file_and_offset): Use filename instead
13639 of name to get library path.
13640 (Archive::include_member): Unlock external member of a thin archive.
13642 * testsuite/Makefile.am (TEST_AR): New variable.
13643 (thin_archive_test_1): New test.
13644 (thin_archive_test_2): New test.
13645 * testsuite/Makefile.in: Regenerate.
13646 * testsuite/thin_archive_main.cc: New file.
13647 * testsuite/thin_archive_test_1.cc: New file.
13648 * testsuite/thin_archive_test_2.cc: New file.
13649 * testsuite/thin_archive_test_3.cc: New file.
13650 * testsuite/thin_archive_test_4.cc: New file.
13652 2008-09-29 Cary Coutant <ccoutant@google.com>
13654 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13655 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13657 (Sized_relobj::do_finalize_local_symbols): Likewise.
13658 (Sized_relobj::map_to_kept_section): Likewise.
13659 * object.h (Sized_relobj::invalid_address): New constant.
13660 (Sized_relobj::do_output_section_offset): Check for invalid_address
13662 * output.cc (Output_reloc::local_section_offset): Use constant
13663 invalid_address instead of -1U.
13664 (Output_reloc::get_address): Likewise.
13665 (Output_section::output_address): Change -1U to -1ULL.
13666 * output.h (Output_reloc::invalid_address): New constant.
13667 * reloc.cc (Sized_relobj::write_sections): Use constant
13668 invalid_address instead of -1U.
13669 (Sized_relobj::relocate_sections): Likewise.
13670 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13671 values for merge sections.
13672 * target-reloc.h (relocate_for_relocatable): Use constant
13673 invalid_address instead of -1U.
13675 2008-09-19 Cary Coutant <ccoutant@google.com>
13677 Add plugin functionality for link-time optimization (LTO).
13678 * configure.ac (plugins): Add --enable-plugins option.
13679 * configure: Regenerate.
13680 * config.in: Regenerate.
13681 * Makefile.am (LIBDL): New variable.
13682 (CCFILES): Add plugin.cc.
13683 (HFILES): Add plugin.h.
13684 (ldadd_var): Add LIBDL.
13685 * Makefile.in: Regenerate.
13687 * archive.cc: Include "plugin.h".
13688 (Archive::setup): Don't preread archive symbols when using a plugin.
13689 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13690 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13692 (Archive::include_member): Add symbols from plugin objects.
13693 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13694 * descriptors.cc (Descriptors::open): Check for file descriptors
13695 abandoned by plugins.
13696 (Descriptors::claim_for_plugin): New function.
13697 * descriptors.h (Descriptors::claim_for_plugin): New function.
13698 (Open_descriptor::is_claimed): New field.
13699 (claim_descriptor_for_plugin): New function.
13700 * fileread.cc (File_read::claim_for_plugin): New function.
13701 * fileread.h (File_read::claim_for_plugin): New function.
13702 (File_read::descriptor): New function.
13703 * gold.cc: Include "plugin.h".
13704 (queue_initial_tasks): Add task to call plugin hooks for generating
13706 * main.cc: Include "plugin.h".
13707 (main): Load plugin libraries.
13708 * object.h (Pluginobj): Declare.
13709 (Object::pluginobj): New function.
13710 (Object::do_pluginobj): New function.
13711 (Object::set_target): New function.
13712 * options.cc: Include "plugin.h".
13713 (General_options::parse_plugin): New function.
13714 (General_options::General_options): Initialize plugins_ field.
13715 (General_options::add_plugin): New function.
13716 * options.h (Plugin_manager): Declare.
13717 (General_options): Add --plugin option.
13718 (General_options::has_plugins): New function.
13719 (General_options::plugins): New function.
13720 (General_options::add_plugin): New function.
13721 (General_options::plugins_): New field.
13722 * plugin.cc: New file.
13723 * plugin.h: New file.
13724 * readsyms.cc: Include "plugin.h".
13725 (Read_symbols::do_read_symbols): Check for archive before checking
13726 for ELF file. Call plugin hooks to claim files.
13727 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13728 from a real object file; force override when processing replacement
13730 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13731 (Symbol::init_base_object): Likewise.
13732 (Symbol::init_base_output_data): Likewise.
13733 (Symbol::init_base_output_segment): Likewise.
13734 (Symbol::init_base_constant): Likewise.
13735 (Symbol::init_base_undefined): Likewise.
13736 (Symbol::output_section): Assert that object is not a plugin.
13737 (Symbol_table::add_from_pluginobj): New function.
13738 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13740 (Symbol_table::sized_write_globals): Likewise.
13741 (Symbol_table::add_from_pluginobj): Instantiate template.
13742 * symtab.h (Sized_pluginobj): Declare.
13743 (Symbol::in_real_elf): New function.
13744 (Symbol::set_in_real_elf): New function.
13745 (Symbol::in_real_elf_): New field.
13746 (Symbol_table::add_from_pluginobj): New function.
13748 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13749 (LIBDL): New variable.
13750 (LDADD): Add LIBDL.
13751 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13752 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13753 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13754 (MOSTLYCLEANFILES): Likewise.
13755 * testsuite/Makefile.in: Regenerate.
13756 * testsuite/plugin_test.c: New file.
13757 * testsuite/plugin_test_1.sh: New file.
13758 * testsuite/plugin_test_2.sh: New file.
13760 2008-09-16 Ian Lance Taylor <iant@google.com>
13762 * target-reloc.h (relocate_section): Check whether a symbol is
13763 defined by the ABI before reporting an undefined symbol error.
13764 * target.h (Target::is_defined_by_abi): Make parameter const.
13765 (Target::do_is_defined_by_abi): Likewise.
13766 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13767 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13768 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13769 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13770 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13771 * testsuite/Makefile.in: Rebuild.
13773 * fileread.cc (make_view): Add casts to avoid warning.
13775 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13777 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13778 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13780 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13782 * options.h (General_options::output_is_executable): New.
13783 (General_options::output_is_pie): New.
13784 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13785 for shared libraries.
13786 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13788 2008-09-11 Chris Demetriou <cgd@google.com>
13790 * options.h (origin): New -z option.
13791 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13792 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13795 2008-09-05 Cary Coutant <ccoutant@google.com>
13797 * fileread.cc (File_read::make_view): Add check for attempt to map
13798 beyond end of file.
13800 2008-09-05 Cary Coutant <ccoutant@google.com>
13802 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13803 explicit instantiations.
13805 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13808 * options.cc (General_options::finalize): Allow undefined symbols
13809 in shlibs if linking -shared.
13812 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13813 symbols as not needing a dynsym entry.
13815 2008-08-20 Craig Silverstein <csilvers@google.com>
13817 * fileread.cc (File_read::open): Do not lock the file unless it
13818 was successfully opened.
13820 2008-08-14 Cary Coutant <ccoutant@google.com>
13822 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13823 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13824 * testsuite/tls_test.cc (struct int128): 128-bit struct
13825 for testing TLS relocs with non-zero addend.
13826 (v12): New TLS variable.
13828 (t_last): Add check for v12.
13829 * testsuite/tls_test.h (t12): New function.
13830 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13832 2008-08-13 Ian Lance Taylor <iant@google.com>
13834 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13835 set tls_segment_ or relro_segment_.
13836 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13838 * output.h (Output_section::clear_is_relro): New function.
13839 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13840 sections specially even when output_data_ is empty.
13841 (Output_segment::maximum_alignment): When first section is relro,
13842 only force alignment for PT_LOAD segments.
13843 * script.cc (script_data_segment_align): New function.
13844 (script_data_segment_relro_end): New function.
13845 * script-c.h (script_data_segment_align): Declare.
13846 (script_data_segment_relro_end): Declare.
13847 * script-sections.h (class Script_sections): Declare
13848 data_segment_align and data_segment_relro_end. Add fields
13849 segment_align_index_ and saw_relro_end_.
13850 * script-sections.cc (class Sections_element): Add set_is_relro
13851 virtual function. Add new bool* parameter to place_orphan_here.
13852 Add get_output_section virtual function.
13853 (class Output_section_definition): Add set_is_relro. Add new
13854 bool* parameter to place_orphan_here. Add get_output_section.
13855 Add is_relro_ field.
13856 (Output_section_definition::Output_section_definition): Initialize
13857 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13858 and is_relro_ fields.
13859 (Output_section_definition::place_orphan_here): Add is_relro
13861 (Output_section_definition::set_section_addresses): Set relro for
13863 (Output_section_definition::alternate_constraint): Likewise.
13864 (class Orphan_output_section): Add new bool* parameter to
13865 place_orphan_here. Add get_output_section.
13866 (Orphan_output_section::place_orphan_here): Add is_relro
13868 (Script_sections::Script_sections): Initialize
13869 data_segment_align_index_ and saw_relro_end_.
13870 (Script_sections::data_segment_align): New function.
13871 (Script_sections::data_segment_relro_end): New function.
13872 (Script_sections::place_orphan): Set or clear is_relro.
13873 (Script_sections::set_section_addresses): Force alignment of first
13875 * yyscript.y (exp): Call script_data_segment_align and
13876 script_data_segment_relro_end.
13877 * testsuite/relro_script_test.t: New file.
13878 * testsuite/relro_test.cc (using_script): Declare.
13879 (t1, t2): Test using_script.
13880 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13881 (relro_script_test_SOURCES): Define.
13882 (relro_script_test_DEPENDENCIES): Define.
13883 (relro_script_test_LDFLAGS): Define.
13884 (relro_script_test_LDADD): Define.
13885 (relro_script_test.so): New target.
13886 * testsuite/Makefile.in: Rebuild.
13888 2008-08-06 Cary Coutant <ccoutant@google.com>
13890 * archive.cc (Archive::total_archives, Archive::total_members)
13891 (Archive::total_members_loaded): New variables.
13892 (Archive::setup): Add parameter. Add option to preread
13894 (Archive::read_armap): Add counter.
13895 (Archive::get_file_and_offset): New function.
13896 (Archive::get_elf_object_for_member): New function.
13897 (Archive::read_all_symbols): New function.
13898 (Archive::read_symbols): New function.
13899 (Archive::add_symbols): Add counters.
13900 (Archive::include_all_members): Use armap to find members if it's
13902 (Archive::include_member): Skip reading symbols if already read.
13903 Factored code into Archive::get_file_and_offset and
13904 Archive::get_elf_object_for_member. Changed call to
13905 Mapfile::report_include_archive_member.
13906 (Archive::print_stats): New function.
13907 * archive.h: Declare Object and Read_symbols_data classes.
13908 (Archive::Archive): Add initializers for new members.
13909 (Archive::setup): Add parameter.
13910 (Archive::print_stats): New function.
13911 (Archive::total_archives, Archive::total_members)
13912 (Archive::total_members_loaded): New variables.
13913 (Archive::get_file_and_offset): New function.
13914 (Archive::get_elf_object_for_member): New function.
13915 (Archive::read_all_symbols): New function.
13916 (Archive::read_symbols): New function.
13917 (Archive::Archive_member): New class.
13918 (Archive::members_): New member.
13919 (Archive::num_members_): New member.
13920 * main.cc: Include archive.h.
13921 (main): Call Archive::print_stats.
13922 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13923 archive parameter; member_name is now the fully-decorated name.
13924 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13925 * options.h: (General_options): Add --preread-archive-symbols option.
13926 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13929 2008-08-04 Ian Lance Taylor <iant@google.com>
13931 * symtab.h (Symbol::use_plt_offset): New function.
13932 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13933 * powerpc.cc (Relocate::relocate): Likewise.
13934 * sparc.cc (Relocate::relocate): Likewise.
13935 * x86_64.cc (Relocate::relocate): Likewise.
13936 * testsuite/weak_plt.sh: New test.
13937 * testsuite/weak_plt_main.cc: New test.
13938 * testsuite/weak_plt_shared.cc: New test.
13939 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13940 (check_PROGRAMS): Add weak_plt.
13941 (check_DATA): Add weak_plt_shared.so.
13942 (weak_plt_main_pic.o, weak_plt): New targets.
13943 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13944 * testsuite/Makefile.in: Rebuild.
13946 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13948 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13949 * testsuite/Makefile.in: Rebuild.
13951 2008-08-04 Alan Modra <amodra@bigpond.net.au>
13953 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13954 * Makefile.in: Regenerate.
13955 * po/POTFILES.in: Regenerate.
13957 2008-07-29 Ian Lance Taylor <iant@google.com>
13959 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13960 symbols before other symbols.
13961 * testsuite/script_test_2.cc (test_addr): Declare.
13962 (test_addr_alias): Declare.
13963 (main): Check that test_addr and test_addr_alias have the right
13965 * testsuite/script_test_2.t: Define test_addr_alias and
13968 2008-07-24 Ian Lance Taylor <iant@google.com>
13971 * descriptors.cc: New file.
13972 * descriptors.h: New file.
13973 * gold-threads.h (class Hold_optional_lock): New class.
13974 * fileread.cc: Include "descriptors.h".
13975 (File_read::~File_read): Release descriptor rather than closing
13977 (File_read::open) [file]: Call open_descriptor rather than open.
13978 Set is_descriptor_opened_.
13979 (File_read::open) [memory]: Assert that descriptor is not open.
13980 (File_read::reopen_descriptor): New function.
13981 (File_read::release): Release descriptor.
13982 (File_read::do_read): Make non-const. Reopen descriptor.
13983 (File_read::read): Make non-const.
13984 (File_read::make_view): Reopen descriptor.
13985 (File_read::do_readv): Likewise.
13986 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13987 Update declarations.
13988 * layout.cc: Include "descriptors.h".
13989 (Layout::create_build_id): Use open_descriptor rather than open.
13990 * output.cc: Include "descriptors.h".
13991 (Output_file::open): Use open_descriptor rather than open.
13992 * archive.cc (Archive::const_iterator): Change Archive to be
13994 (Archive::begin, Archive::end): Make non-const.
13995 (Archive::count_members): Likewise.
13996 * archive.h (class Archive): Update declarations.
13997 * object.h (Object::read): Make non-const.
13998 * Makefile.am (CCFILES): Add descriptors.cc.
13999 (HFILES): Add descriptors.h.
14000 * Makefile.in: Rebuild.
14003 * gold.h: Always include <clocale>. Add Solaris workarounds
14004 following code in binutils/sysdep.h.
14007 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14008 this->eh_frame_hdr_ is NULL before using it.
14010 * dynobj.cc (Versions::Versions): Update comment.
14012 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14013 the base version name.
14015 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14016 array size plus one.
14017 (Stringpool_template::set_string_offsets): Subtract one from key
14018 before using it as an array index.
14019 (Stringpool_template::get_offset_with_length): Likewise.
14020 (Stringpool_template::write_to_buffer): Likewise.
14021 * stringpool.h (Stringpool_template::get_offset_from_key):
14024 2008-07-23 Ian Lance Taylor <iant@google.com>
14027 * object.h (Merged_symbol_value::value): Do our best to handle a
14031 * script.cc (Version_script_info::get_versions): Don't add empty
14032 version tag to return value.
14033 (Version_script_info::get_symbol_version_helper): Change return
14034 type to bool. Add pversion parameter. Change all callers.
14035 (script_register_vers_node): Don't require a non-NULL tag.
14036 * script.h (class Version_script_info): Update declarations.
14037 (Version_script_info::get_symbol_version): Change return type to
14038 bool. Add version parameter. Change all callers.
14039 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14040 handling. Handle an empty version from a version script.
14041 (Symbol_table::define_special_symbol): Likewise.
14042 * testsuite/ver_test_10.script: New file.
14043 * testsuite/ver_test_10.sh: New file.
14044 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14045 (check_DATA): Add ver_test_10.syms.
14046 (ver_test_10.syms, ver_test_10.so): New target.
14047 * testsuite/Makefile.in: Rebuild.
14049 2008-07-23 Simon Baldwin <simonb@google.com>
14051 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14052 to zero for undefined symbols from dynamic libraries.
14054 2008-07-23 Ian Lance Taylor <iant@google.com>
14056 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14057 Change all callers.
14058 * symtab.h (class Symbol_table): Update declaration.
14059 * testsuite/ver_test_9.cc: New file.
14060 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14061 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14062 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14063 (ver_test_9.so, ver_test_9.o): New targets.
14064 * testsuite/Makefile.in: Rebuild.
14066 2008-07-22 Ian Lance Taylor <iant@google.com>
14068 * options.h (class General_options): Define --check-sections.
14069 * layout.cc (Layout::set_segment_offsets): Handle
14072 * options.h (class General_options): Define -n/--nmagic and
14074 * options.cc (General_options::finalize): For -n/--nmagic or
14075 -N/--omagic, set -static.
14076 * layout.cc (Layout::attach_allocated_section_to_segment): If
14077 -N/--omagic, don't put read-only and read-write sections in
14078 different segments.
14079 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14080 finding a read-only segment.
14081 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14082 don't set the minimum segment alignment to the common page size,
14083 and don't set the file offset to the address modulo the page size.
14084 * script-sections.cc (Script_sections::create_segments): If
14085 -n/--omagic, don't put read-only and read-write sections in
14086 different segments.
14088 * cref.cc: New file.
14089 * cref.h: New file.
14090 * options.h (class General_options): Add --print-symbol-counts.
14091 * main.cc (main): Issue defined symbol report if requested.
14092 * archive.cc (Archive::interpret_header): Make into a const member
14094 (Archive::add_symbols): Call Input_objects::archive_start and
14096 (Archive::const_iterator): Define new class.
14097 (Archive::begin, Archive::end): New functions.
14098 (Archive::include_all_members): Rewrite to use iterator.
14099 (Archive::count_members): New function.
14100 * archive.h (class Archive): Update declarations.
14101 (Archive::filename): New function.
14102 * object.cc: Include "cref.h".
14103 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14104 (Sized_relobj::do_get_global_symbol_counts): New function.
14105 (Input_objects::add_object): Add object to cross-referencer.
14106 (Input_objects::archive_start): New function.
14107 (Input_objects::archive_stop): New function.
14108 (Input_objects::print_symbol_counts): New function.
14109 * object.h: Declare Cref and Archive.
14110 (Object::get_global_symbol_counts): New function.
14111 (Object::do_get_global_symbol_counts): New pure virtual function.
14112 (class Sized_relobj): Add defined_count_ field. Update
14114 (class Input_objects): Add cref_ field. Update constructor.
14115 Update declarations.
14116 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14118 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14120 (Sized_dynobj::do_get_global_symbol_counts): New function.
14121 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14122 defined_count_. Update declarations. Define Symbols typedef.
14123 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14124 parameter. Change all callers.
14125 (Symbol_table::add_from_dynobj): Add sympointers and defined
14126 parameters. Change all callers.
14127 * symtab.h (class Symbol_table): Update declarations.
14128 * Makefile.am (CCFILES): Add cref.cc.
14129 (HFILES): Add cref.h.
14130 * Makefile.in: Rebuild.
14132 2008-07-22 Simon Baldwin <simonb@google.com>
14134 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14135 to zero when writing undefined symbols.
14137 2008-07-22 Ian Lance Taylor <iant@google.com>
14139 * output.cc (Output_section::add_input_section): Don't try to
14140 merge empty merge sections.
14142 2008-07-21 Craig Silverstein <csilvers@google.com>
14144 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14145 Include symbol version in error message.
14147 2008-07-20 Chris Demetriou <cgd@google.com>
14149 * configure.ac (gold_cv_c_random_seed): New configured variable.
14150 (RANDOM_SEED_CFLAGS): New substituted variable.
14151 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14152 * configure: Rebuild.
14153 * Makefile.in: Likewise.
14154 * testsuite/Makefile.in: Likewise.
14156 2008-07-18 Ian Lance Taylor <iant@google.com>
14158 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14159 where we see NAME/NULL and NAME/VERSION as separate symbols.
14160 * testsuite/ver_test_main.cc (main): Call t4.
14161 (t4, t4_2a): Define.
14162 * testsuite/ver_test_2.cc (t4_2): Define.
14163 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14164 * testsuite/ver_test_4.cc (t4_2a): Define.
14165 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14166 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14168 2008-07-17 Ian Lance Taylor <iant@google.com>
14170 * dynobj.cc (Versions::add_def): If we give an error about a
14171 missing version, go ahead and create the version anyhow.
14173 2008-07-10 Ian Lance Taylor <iant@google.com>
14175 Handle output sections with more than 0x7fffffff bytes.
14176 * object.h (class Relobj): Change map_to_output_ to
14177 output_sections_, and just keep a section pointer. Change all
14178 uses. Move comdat group support to Sized_relobj.
14179 (Relobj::is_section_specially_mapped): Remove.
14180 (Relobj::output_section): Remove poff parameter. Change all
14182 (Relobj::output_section_offset): New function.
14183 (Relobj::set_section_offset): Rewrite.
14184 (Relobj::map_to_output): Remove.
14185 (Relobj::output_sections): New function.
14186 (Relobj::do_output_section_offset): New pure virtual function.
14187 (Relobj::do_set_section_offset): Likewise.
14188 (class Sized_relobj): Add section_offsets_ field. Add comdat
14189 group support from Relobj. Update declarations.
14190 (Sized_relobj::get_output_section_offset): New function.
14191 (Sized_relobj::do_output_section_offset): New function.
14192 (Sized_relobj::do_set_section_offset): New function.
14193 * object.cc (Relobj::output_section_address): Remove.
14194 (Sized_relobj::Sized_relobj): Initialize new fields.
14195 (Sized_relobj::include_section_group): Cast find_kept_object to
14197 (Sized_relobj::include_linkonce_section): Likewise.
14198 (Sized_relobj::do_layout): Use separate arrays for output section
14200 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14202 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14203 output_sections and section_offsets.
14204 (Sized_relobj::write_local_symbols): Likewise.
14205 (map_to_kept_section): Compute output address directly.
14206 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14207 output_sections and section_offsets.
14208 (Sized_relobj::write_sections): Likewise.
14209 (Sized_relobj::relocate_sections): Likewise.
14210 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14211 * output.h (class Output_reloc): Update declarations. Change
14212 u2_.relobj to Sized_relobj*.
14213 (class Output_data_reloc): Change add functions to use
14215 * output.cc (Output_reloc::Output_reloc): Change relobj to
14217 (Output_reloc::local_section_offset): Change return type to
14218 Elf_Addr. Use get_output_section_offset.
14219 (Output_reloc::get_address): Likewise.
14220 (Output_section::is_input_address_mapped): Don't call
14221 is_section_specially_mapped.
14222 (Output_section::output_offset): Likewise.
14223 (Output_section::output_address): Likewise.
14224 (Output_section::starting_output_address): Likewise.
14225 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14226 parameter to Sized_relobj*.
14227 (Copy_relocs::need_copy_reloc): Likewise.
14228 (Copy_relocs::save): Likewise.
14229 * copy-relocs.h (class Copy_relocs): Update declarations.
14230 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14231 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14232 * target-reloc.h (relocate_for_relocatable): Change
14233 offset_in_output_section type to Elf_Addr. Change code that uses
14235 * layout.cc (Layout::layout): Always set *off.
14236 * mapfile.cc (Mapfile::print_input_section): Use
14237 output_section_offset.
14238 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14240 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14241 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14242 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14244 2008-07-03 Ian Lance Taylor <iant@google.com>
14246 * layout.cc (Layout::include_section): Do not discard unrecognized
14247 SHT_STRTAB sections.
14249 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14251 * script.cc (Lex::can_continue_name): Make '?' allowable in
14252 version-script names.
14253 * testsuite/version_script.map: Change glob pattern to use '?'
14255 2008-06-30 Manish Singh <yosh@gimp.org>
14258 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14261 2008-06-30 Ian Lance Taylor <iant@google.com>
14265 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14266 versions]: Don't try to read the value in the contents, since we
14267 don't use it. Use the template endianness when writing.
14269 2008-06-25 Cary Coutant <ccoutant@google.com>
14271 * fileread.cc (File_read::make_view): Assert on zero-length view.
14272 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14273 symbol table when there are no symbols to read.
14275 2008-06-23 Craig Silverstein <csilvers@google.com>
14277 * version.cc (version_string): Bump to 1.7
14279 2008-06-18 Craig Silverstein <csilvers@google.com>
14281 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14282 constant 0xFFFF to type Valtype.
14283 (Powerpc_relocate_functions::rel16_ha): Likewise.
14285 2008-06-17 Ian Lance Taylor <iant@google.com>
14287 * output.h (Output_section::Input_section): Initialize p2align_ to
14288 zero for Output_section_data constructors.
14289 (Output_section::Input_section::addralign): If not an input
14290 section, return the alignment of the Output_section_data.
14291 * testsuite/copy_test.cc: New file.
14292 * testsuite/copy_test_1.cc: New file.
14293 * testsuite/copy_test_2.cc: New file.
14294 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14295 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14296 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14297 (copy_test_1_pic.o, copy_test_1.so): New targets.
14298 (copy_test_2_pic.o, copy_test_2.so): New targets.
14299 * testsuite/Makefile.in: Rebuild.
14301 * script-sections.cc (Script_sections::place_orphan): Initialize
14302 local variable exact.
14304 2008-06-13 David Edelsohn <edelsohn@gnu.org>
14306 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14308 2008-06-12 David Edelsohn <edelsohn@gnu.org>
14309 David S. Miller <davem@davemloft.net>
14311 * powerpc.cc: New file.
14312 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14313 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14314 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14315 * Makefile.in: Rebuild.
14317 2008-06-09 Ian Lance Taylor <iant@google.com>
14319 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14321 (throwing, orig_terminate): New static variables.
14322 (terminate_handler): New static function.
14323 (t2): Set terminate handler.
14325 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14328 * binary.cc (Binary_to_elf::sized_convert): Fix .data
14331 2008-05-30 Cary Coutant <ccoutant@google.com>
14333 * archive.cc (Archive::include_all_members) Correct to step
14334 over symbol table and extended name table in thin archives.
14336 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14339 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14342 2008-05-28 Caleb Howe <cshowe@google.com>
14344 * reduced_debug_output.cc: New file.
14345 * reduced_debug_output.h: New file.
14346 * options.h (class General_options): Add --strip-debug-non-line.
14347 * options.cc (General_options::finalize): Add strip_debug_non_line
14348 to the strip heirarchy.
14349 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14351 * layout.cc: Include "reduced_debug_output.h".
14352 (Layout::Layout): Initialize new fields.
14353 (line_only_debug_sections): New static array.
14354 (is_lines_only_debug_sections): New static inline function.
14355 (Layout::include_section): Handle --strip-debug-non-line.
14356 (Layout::make_output_section): If --strip-debug-non-line, build
14357 new output sections for .debug_abbrev and .debug_info.
14358 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14359 gold. Warn about possible overflow.
14360 (read_signed_LEB_128): Likewise.
14361 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14362 (read_signed_LEB_128): Declare.
14363 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14364 (HFILES): Add reduced_debug_output.h.
14365 * Makefile.in: Rebuild.
14367 2008-05-21 Ian Lance Taylor <iant@google.com>
14369 * mapfile.cc: New file.
14370 * mapfile.h: New file.
14371 * options.h (class General_options): Add -M/--print-map and -Map.
14372 * options.cc (General_options::finalize): Make -M equivalent to
14374 * main.cc: Include <cstdio> and "mapfile.h".
14375 (main): Open mapfile if requested.
14376 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14377 constructor. Change caller.
14378 (queue_initial_tasks): Add mapfile parameter. Change caller.
14379 (queue_middle_tasks): Likewise.
14380 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14382 * archive.cc: Include "mapfile.h".
14383 (Archive::add_symbols): Add mapfile parameter. Change all
14384 callers. Pass mapfile, symbol, and reason to include_member.
14385 (Archive::include_all_members): Add mapfile parameter. Change all
14387 (Archive::include_member): Add mapfile, sym, and why parameters.
14388 Change all callers. Report inclusion to map file.
14389 * archive.h: Include "fileread.h".
14390 (class Archive): Update declarations.
14391 (Archive::file): New const method.
14392 (class Add_archive_symbols): Add mapfile_ field. Update
14393 constructor. Change all callers.
14394 * readsyms.h (class Read_symbols): Likewise.
14395 (class Finish_group): Likewise.
14396 (class Read_script): Likewise.
14397 * common.cc: Include "mapfile.h".
14398 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14400 (Symbol_table::do_allocate_commons): Likewise.
14401 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14402 symbol allocation to mapfile.
14403 * common.h (class Allocate_commons_task): Add mapfile_ field.
14404 Update constructor. Change all callers.
14405 * symtab.h (class Symbol_table): Update declarations.
14406 * layout.cc: Include "mapfile.h".
14407 (Layout_task_runner::run): Print information to mapfile.
14408 (Layout::create_gold_note): Change Output_data_fixed_space to
14409 Output_data_zero_fill.
14410 (Layout::create_build_id): Likewise.
14411 (Layout::print_to_mapfile): New function.
14412 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14413 constructor. Change caller.
14414 (class Layout): Declare print_to_mapfile.
14415 * output.cc (Output_section::Input_section::print_to_mapfile): New
14417 (Output_section::add_input_section): If producing a map, always
14418 add to input_sections_ list.
14419 (Output_section::do_print_to_mapfile): New function.
14420 (Output_segment::print_sections_to_mapfile): New function.
14421 (Output_segment::print_section_list_to_mapfile): New function.
14422 * output.h: Include "mapfile.h".
14423 (Output_data::print_to_mapfile): New function.
14424 (Output_data::do_print_to_mapfile): New virtual function.
14425 (Output_segment_headers::do_print_to_mapfile): New function.
14426 (Output_file_header::do_print_to_mapfile): New function.
14427 (Output_data_const::do_print_to_mapfile): New function.
14428 (class Output_data_const_buffer): Add map_name_ field. Update
14429 constructor. Change all callers. Add do_print_to_mapfile
14431 (class Output_data_fixed_space): Likewise.
14432 (class Output_data_space): Likewise.
14433 (class Output_data_zero_fill): New class.
14434 (Output_data_strtab::do_print_to_mapfile): New function.
14435 (Output_data_reloc_base::do_print_to_mapfile): New function.
14436 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14437 (Output_data_group::do_print_to_mapfile): New function.
14438 (Output_data_got::do_print_to_mapfile): New function.
14439 (Output_data_dynamic::do_print_to_mapfile): New function.
14440 (Output_symtab_xindex::do_print_to_mapfile): New function.
14441 (class Output_section): Declare do_print_to_mapflie. Declare
14442 print_to_mapfile in Input_section.
14443 (class Output_segment): Declare new functions.
14444 * object.h (Sized_relobj::symbol_count): New function.
14445 * script-sections.cc
14446 (Output_section_element_dot_assignment::set_section_addresses):
14447 Change Output_data_fixed_space to Output_data_zero_fill.
14448 (Output_data_expression::do_print_to_mapfile): New function.
14449 * script.cc (read_input_script): Add mapfile parameter. Change
14451 * script.h (read_input_script): Update declaration.
14452 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14453 (Eh_frame::do_print_to_mapfile): New function.
14454 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14455 (Output_merge_string::do_print_to_mapfile): New function.
14456 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14458 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14460 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14462 * Makefile.am (CCFILES): Add mapfile.cc.
14463 (HFILES): Add mapfile.h.
14464 * Makefile.in: Rebuild.
14466 2008-05-19 Ian Lance Taylor <iant@google.com>
14468 * options.h (class General_options): Add -z relro.
14469 * layout.cc (Layout::Layout): Initialize relro_segment_.
14470 (Layout::add_output_section_data): Return the output section.
14471 (Layout::make_output_section): Rcognize relro sections and mark
14472 them appropriately.
14473 (Layout::attach_allocated_section_to_segment): Put relro sections
14474 in a PT_GNU_RELRO segment.
14475 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14477 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14479 (Layout::linkonce_mapping): Map d.rel.ro.local to
14480 .data.rel.ro.local.
14481 (Layout::output_section_name): Us .data.rel.ro.local for any
14482 section which begins with that.
14483 * layout.h (class Layout): Update add_output_section_data
14484 declaration. Add relro_segment_ field.
14485 * output.cc (Output_section::Output_section): Initialize is_relro_
14486 and is_relro_local_ fields.
14487 (Output_segment::add_output_section): Group relro sections.
14488 (Output_segment::is_first_section_relro): New function.
14489 (Output_segment::maximum_alignment): If there is a relro section,
14490 align the segment to the common page size.
14491 (Output_segment::set_section_addresses): Track whether we are
14492 looking at relro sections. If the last section is a relro
14493 section, align to the common page size.
14494 (Output_segment::set_section_list_addresses): Add in_relro
14495 parameter. Change all callers. Align to the page size when
14496 moving from relro to non-relro section.
14497 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14499 * output.h (class Output_section): Add is_relro_ and
14500 is_relro_local_ fields.
14501 (Output_section::is_relro): New function.
14502 (Output_section::set_is_relro): New function.
14503 (Output_section::is_relro_local): New function.
14504 (Output_section::set_is_relro_local): New function.
14505 (class Output_segment): Update declarations.
14506 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14507 * sparc.cc (Target_sparc::got_section): Likewise.
14508 * x86_64.cc (Target_x86_64::got_section): Likewise.
14509 * testsuite/relro_test_main.cc: New file.
14510 * testsuite/relro_test.cc: New file.
14511 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14512 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14513 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14514 (relro_test.so, relro_test_pic.o): New targets.
14515 * testsuite/Makefile.in: Rebuild.
14517 2008-05-16 Ian Lance Taylor <iant@google.com>
14519 * output.cc (Output_segment::add_output_section): Remove front
14521 * output.h (class Output_segment): Remove
14522 add_initial_output_section and overloaded add_output_section.
14523 Update declaration of remaining add_output_section.
14524 * layout.cc (Layout::create_interp): Call add_output_section
14525 rather than add_initial_output_section.
14526 (Layout::finish_dynamic_section): Likewise.
14528 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14529 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14530 know the dynamic type.
14531 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14532 field. Initialize it in constructor.
14533 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14534 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14535 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14538 * output.cc (Output_reloc::get_address): Change return type to
14540 * output.h (class Output_reloc): Update get_address declaration.
14541 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14542 for section addresses.
14544 2008-05-09 Ian Lance Taylor <iant@google.com>
14547 * gold.cc (gold_nomem): Use return value of write.
14549 2008-05-08 Ian Lance Taylor <iant@google.com>
14551 * symtab.c (Symbol::init_base_output_data): Add version
14552 parameter. Change all callers.
14553 (Symbol::init_base_output_segment): Likewise.
14554 (Symbol::init_base_constant): Likewise.
14555 (Symbol::init_base_undefined): Likewise.
14556 (Sized_symbol::init_output_data): Likewise.
14557 (Sized_symbol::init_output_segment): Likewise.
14558 (Sized_symbol::init_constant): Likewise.
14559 (Sized_symbol::init_undefined): Likewise.
14560 (Symbol_table::do_define_in_output_data): If the new symbol has a
14561 version, mark it as the default.
14562 (Symbol_table::do_define_in_output_segment): Likewise.
14563 (Symbol_table::do_define_as_constant): Likewise.
14564 * symtab.h (class Symbol): Update declarations.
14565 (class Sized_symbol): Likewise.
14566 * resolve.cc (Symbol::override_version): New function.
14567 (Symbol::override_base): Call override_version.
14568 (Symbol::override_base_with_special): Likewise.
14569 * testsuite/ver_script_8.script: New file.
14570 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14571 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14572 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14573 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14575 2008-05-06 Ian Lance Taylor <iant@google.com>
14578 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14580 (class General_options): Remove existing --undefined, and add
14581 --no-undefined instead. Add new --undefined as synonym for -u.
14582 * archive.cc (Archive::add_symbols): Check whether symbol was
14584 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14585 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14586 all uses. Add IS_UNDEFINED. Update declarations to split
14587 different versions of init_base. Declare init_base_undefined.
14588 (Symbol::is_defined): Handle IS_UNDEFINED.
14589 (Symbol::is_undefined): Likewise.
14590 (Symbol::is_weak_undefined): Call is_undefined.
14591 (Symbol::is_absolute): Handle IS_CONSTANT.
14592 (class Sized_symbol): Update declarations to split different
14593 versions of init. Declare init_undefined.
14594 (class Symbol_table): Declare new functions.
14595 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14596 Change all callers.
14597 (Symbol::init_base_output_data): Likewise.
14598 (Symbol::init_base_output_segment): Likewise.
14599 (Symbol::init_base_constant): Likewise.
14600 (Symbol::init_base_undefined): New function.
14601 (Sized_symbol::init_object): Rename from init. Change all
14603 (Sized_symbol::init_output_data): Likewise.
14604 (Sized_symbol::init_output_segment): Likewise.
14605 (Sized_symbol::init_constant): Likewise.
14606 (Sized_symbol::init_undefined): New function.
14607 (Symbol_table::add_undefined_symbols_from_command_line): New
14609 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14611 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14612 (Symbol::output_section): Likewise.
14613 (Symbol::set_output_section): Likewise.
14614 (Symbol_table::sized_finalize_symbol): Likewise.
14615 (Symbol_table::sized_write_globals): Likewise.
14616 * resolve.cc (Symbol_table::should_override): Likewise.
14617 (Symbol::override_base_with_special): Likewise.
14619 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14620 symbol, change it to have default visibility.
14621 * testsuite/protected_1.cc: New file.
14622 * testsuite/protected_2.cc: New file.
14623 * testsuite/protected_3.cc: New file.
14624 * testsuite/protected_main_1.cc: New file.
14625 * testsuite/protected_main_2.cc: New file.
14626 * testsuite/protected_main_3.cc: New file.
14627 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14628 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14629 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14630 (protected_1.so): New target.
14631 (protected_1_pic.o, protected_2_pic.o): New targets.
14632 (protected_3_pic.o): New target.
14633 (check_PROGRAMS): Add protected_2.
14634 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14635 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14636 * testsuite/Makefile.in: Rebuild.
14638 * options.h (DEFINE_var): Add set_user_set_##varname__.
14639 (DEFINE_bool_alias): New macro.
14640 (class General_options): Define -Bstatic using DEFINE_bool_alias
14641 rather than DEFINE_special. Add --undefined as an alias for -z
14643 * options.cc (General_options::parse_Bstatic): Remove.
14645 * options.h (class General_options): Add --fatal-warnings.
14646 * main.cc (main): Implement --fatal-warnings.
14647 * errors.h (Errors::warning_count): New function.
14649 * options.h (class General_options): Add -Bsymbolic-functions.
14650 * symtab.h (Symbol::is_preemptible): Check for
14651 -Bsymbolic-functions.
14653 2008-05-05 Ian Lance Taylor <iant@google.com>
14655 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14656 as noVARNAME rather than no-VARNAME.
14657 (class General_options): Add option -z combreloc.
14658 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14660 (Output_reloc::sort_before) [SHT_REL]: New function.
14661 (Output_reloc::sort_before) [SHT_RELA]: New function.
14662 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14663 Sort_relocs_comparison.
14664 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14665 parameter. Change all callers.
14666 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14667 sort_relocs parameter. Change all callers.
14668 * output.cc (Output_reloc::get_address): New function, broken out
14670 (Output_reloc::write_rel): Call it.
14671 (Output_reloc::compare): New function.
14672 (Output_data_reloc_base::do_write): Optionally sort relocs.
14674 * configure.ac: If targ_extra_obj is set, link it in.
14675 * configure.tgt: Initialize all variables.
14676 (x86_64*): Set targ_extra_obj and targ_extra_size.
14677 * configure: Rebuild.
14679 * object.cc (Sized_relobj::include_section_group): Adjust section
14680 indexes read from group data. Build vector to pass to
14682 * layout.cc (Layout::layout_group): Add flags and shndxes
14683 parameters. Remove contents parameter. Change caller. Update
14684 explicit instantiations.
14685 * layout.h (class Layout): Update layout_group declaration.
14686 * output.cc (Output_data_group::Output_data_group): Add flags and
14687 input_shndxes parameters. Remove contents parameter. Change
14689 (Output_data_group::do_write): Change input_sections_ to
14691 * output.h (class Output_data_group): Update constructor
14692 declaration. Rename input_sections_ to input_shndxes_.
14693 * testsuite/many_sections_test.cc: Add template.
14695 2008-04-30 Cary Coutant <ccoutant@google.com>
14697 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14699 * layout.cc (Layout::include_section): Refactored check for debug
14701 (Layout::add_comdat): Add new parameters. Change type
14702 of signature parameter. Add object and shndx to signatures table.
14703 (Layout::find_kept_object): New function.
14704 * layout.h: Include <cstring>.
14705 (Layout::is_debug_info_section): New function.
14706 (Layout::add_comdat): Add new parameters.
14707 (Layout::find_kept_object): New function.
14708 (Layout::Kept_section): New struct.
14709 (Layout::Signatures): Change type of map range.
14710 * object.cc (Relobj::output_section_address): New function.
14711 (Sized_relobj::include_section_group): Add new parameters. Change
14712 calls to Layout::add_comdat. Change to build table of kept comdat
14713 groups and table mapping discarded sections to kept sections.
14714 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14715 (Sized_relobj::do_layout): Change calls to include_section_group and
14716 include_linkonce_section.
14717 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14718 value to zero when section is discarded.
14719 (Sized_relobj::map_to_kept_section): New function.
14720 * object.h (Relobj::output_section_address): New function.
14721 (Relobj::Comdat_group): New type.
14722 (Relobj::find_comdat_group): New function.
14723 (Relobj::Comdat_group_table): New type.
14724 (Relobj::Kept_comdat_section): New type.
14725 (Relobj::Kept_comdat_section_table): New type.
14726 (Relobj::add_comdat_group): New function.
14727 (Relobj::set_kept_comdat_section): New function.
14728 (Relobj::get_kept_comdat_section): New function.
14729 (Relobj::comdat_groups_): New field.
14730 (Relobj::kept_comdat_sections_): New field.
14731 (Symbol_value::input_value): Update comment.
14732 (Sized_relobj::map_to_kept_section) New function.
14733 (Sized_relobj::include_linkonce_section): Add new parameter.
14734 * target-reloc.h (Comdat_behavior): New type.
14735 (get_comdat_behavior): New function.
14736 (relocate_section): Add code to map a discarded section to the
14737 corresponding kept section when applying a relocation.
14739 2008-04-30 Craig Silverstein <csilvers@google.com>
14741 * dwarf_reader.cc (next_generation_count): New static var.
14742 (Addr2line_cache_entry): New struct.
14743 (addr2line_cache): New static var.
14744 (Dwarf_line_info::one_addr2line): Added caching.
14745 (Dwarf_line_info::clear_addr2line_cache): New function.
14746 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14747 cache-size parameter.
14748 (Dwarf_line_info::one_addr2line_cache): New function.
14749 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14750 new cache-size argument to one_addr2line(), and clear cache.
14752 2008-04-28 Cary Coutant <ccoutant@google.com>
14754 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14755 R_386_PC8 relocations.
14757 2008-04-23 Ian Lance Taylor <iant@google.com>
14759 * object.cc (Sized_relobj::include_section_group): Check for
14760 invalid section group.
14762 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14765 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14766 than read for file header.
14767 * archive.cc (Archive::include_member): Likewise.
14769 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
14771 * aclocal.m4: Regenerate.
14772 * configure: Regenerate.
14774 2008-04-19 Ian Lance Taylor <iant@google.com>
14776 * version.cc (version_string): Bump to 1.6.
14778 * testsuite/Makefile.am (many_sections_r_test): New target.
14779 (many_sections_r_test_SOURCES): Remove.
14780 (many_sections_r_test_DEPENDENCIES): Remove.
14781 (many_sections_r_test_LDFLAGS): Remove.
14782 (many_sections_r_test_LDADD): Remove.
14784 * object.cc (Sized_relobj::do_add_symbols): Always pass
14785 local_symbol_count_ to add_from_relobj.
14787 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14788 every thousand variables.
14789 * testsuite/Makefile.in: Rebuild.
14791 * object.cc (Xindex::initialize_symtab_xindex): New function.
14792 (Xindex::read_symtab_xindex): New function.
14793 (Xindex::sym_xindex_to_shndx): New function.
14794 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14796 (Sized_relobj::do_initialize_xindex): New function.
14797 (Sized_relobj::do_read_symbols): Adjust section links.
14798 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14799 parameter. Change all callers.
14800 (Sized_relobj::include_section_group): Adjust section links and
14801 symbol section indexes.
14802 (Sized_relobj::do_layout): Adjust section links.
14803 (Sized_relobj::do_count_local_symbols): Adjust section links and
14804 symbol section indexes.
14805 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14806 ordinary and special symbols.
14807 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14808 dynsym_xindex parameters. Change all callers. Adjust section
14809 links. Use SHN_XINDEX when needed.
14810 (Sized_relobj::get_symbol_location_info): Adjust section links.
14811 Don't get fooled by special symbols.
14812 * object.h (class Xindex): Define.
14813 (class Object): Add xindex_ parameter. Declare virtual functoin
14814 do_initialize_xindex.
14815 (Object::adjust_sym_shndx): New function.
14816 (Object::set_xindex): New protected function.
14817 (class Symbol_value): Add is_ordinary_shndx_ field.
14818 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14819 (Symbol_value::value): Assert ordinary section.
14820 (Symbol_value::initialize_input_to_output_map): Likewise.
14821 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14822 Change all callers.
14823 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14825 (class Sized_relobj): Update declarations.
14826 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14827 parameter. Change all callers.
14828 (Sized_relobj::adjust_shndx): New function.
14829 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14831 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14832 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14833 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14834 (Sized_dynobj::read_dynsym_section): Adjust section links.
14835 (Sized_dynobj::read_dynamic): Likewise.
14836 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14838 (Sized_dynobj::do_initialize_xindex): New function.
14839 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14840 do_initialize_xindex.
14841 (Sized_dynobj::adjust_shndx): New function.
14842 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14843 dynsym_xindex_ fields.
14844 (Layout::finalize): Add a call to set_section_indexes before
14845 creating the symtab sections.
14846 (Layout::set_section_indexes): Don't do anything if the section
14847 already has a section index.
14848 (Layout::create_symtab_sections): Add shnum parameter. Change
14849 caller. Create .symtab_shndx section if needed.
14850 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14852 (Layout::allocated_output_section_count): New function.
14853 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14855 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14856 fields. Update declarations.
14857 (Layout::symtab_xindex): New function.
14858 (Layout::dynsym_xindex): New function.
14859 (class Write_symbols_task): Add layout_ field.
14860 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14862 * output.cc (Output_section_headers::Output_section_headers): Add
14863 shstrtab_section parameter. Change all callers.
14864 (Output_section_headers::do_sized_write): Store overflow values
14865 for section count and section string table section index in
14866 section header zero.
14867 (Output_file_header::do_sized_write): Check for overflow of
14868 section count and section string table section index.
14869 (Output_symtab_xindex::do_write): New function.
14870 (Output_symtab_xindex::endian_do_write): New function.
14871 * output.h (class Output_section_headers): Add shstrtab_section_.
14872 Update declarations.
14873 (class Output_symtab_xindex): Define.
14874 (Output_section::has_out_shndx): New function.
14875 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14877 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14878 Change all callers.
14879 (Sized_symbol::init): Likewise.
14880 (Symbol::output_section): Check for ordinary symbol.
14881 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14882 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14884 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14885 Change all callers. Simplify handling of symbols from sections
14886 not included in the link.
14887 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14889 (Weak_alias_sorter::operator()): Assert that symbols are
14891 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14893 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14894 parameters. Change all callers.
14895 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14896 symbol distinction. Use SHN_XINDEX when needed.
14897 (Symbol_table::write_section_symbol): Add symtab_xindex
14898 parameter. Change all callers.
14899 (Symbol_table::sized_write_section_symbol): Likewise. Use
14900 SHN_XINDEX when needed.
14901 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14903 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14904 (Symbol::is_defined): Check is_ordinary.
14905 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14906 (Symbol::is_absolute, Symbol::is_common): Likewise.
14907 (class Sized_symbol): Update declarations.
14908 (class Symbol_table): Update declarations.
14909 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14910 parameters. Change all callers.
14911 (Sized_symbol::override): Likewise.
14912 (Symbol_table::override): Likewise.
14913 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14914 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14915 is_ordinary, and orig_st_shndx parameters. Change all callers.
14916 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14917 to be in an ordinary section.
14918 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14919 object and is_ordinary parameters. Change all callers.
14920 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14921 Change all callers. Don't add undefined or non-ordinary symbols
14923 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14924 Change all callers.
14925 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14927 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14928 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14929 (Sized_relobj::relocate_sections): Likewise.
14930 * target-reloc.h (scan_relocs): Adjust section symbol index.
14931 (scan_relocatable_relocs): Likewise.
14932 * i386.cc (Scan::local): Check for ordinary symbols.
14933 * sparc.cc (Scan::local): Likewise.
14934 * x86_64.cc (Scan::local): Likewise.
14935 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14936 to symbol_section_and_value.
14937 * testsuite/many_sections_test.cc: New file.
14938 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14939 (check_PROGRAMS): Add many_sections_test.
14940 (many_sections_test_SOURCES): Define.
14941 (many_sections_test_DEPENDENCIES): Define.
14942 (many_sections_test_LDFLAGS): Define.
14943 (BUILT_SOURCES): Add many_sections_define.h.
14944 (many_sections_define.h): New target.
14945 (BUILT_SOURCES): Add many_sections_check.h.
14946 (many_sections_check.h): New target.
14947 (check_PROGRAMS): Add many_sections_r_test.
14948 (many_sections_r_test_SOURCES): Define.
14949 (many_sections_r_test_DEPENDENCIES): Define.
14950 (many_sections_r_test_LDFLAGS): Define.
14951 (many_sections_r_test_LDADD): Define.
14952 (many_sections_r_test.o): New target.
14953 * testsuite/Makefile.in: Rebuild.
14955 2008-04-17 Cary Coutant <ccoutant@google.com>
14957 * errors.cc (Errors::info): New function.
14958 (gold_info): New function.
14959 * errors.h (Errors::info): New function.
14960 * gold.h (gold_info): New function.
14961 * object.cc (Input_objects::add_object): Print trace output.
14962 * options.cc (options::parse_set): New function.
14963 (General_options::parse_wrap): Deleted.
14964 (General_options::General_options): Deleted initializer.
14965 * options.h (options::String_set): New typedef.
14966 (options::parse_set): New function.
14967 (DEFINE_set): New macro.
14968 (General_options::wrap): Changed to use DEFINE_set. Changed
14969 callers of any_wrap_symbols and is_wrap_symbol.
14970 (General_options::trace, General_options::trace_symbol):
14972 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14973 (General_options::wrap_symbols_): Deleted.
14974 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14976 2008-04-17 David S. Miller <davem@davemloft.net>
14978 * options.cc (General_options::parse_V): New function.
14979 * options.h: Add entries for -V and -Qy.
14981 2008-04-17 Ian Lance Taylor <iant@google.com>
14983 * common.cc (Symbol_table::allocate_commons): Remove options
14984 parameter. Change caller.
14985 (Symbol_table::do_allocate_commons): Remove options parameter.
14986 Change caller. Just call do_allocate_commons_list twice.
14987 (Symbol_table::do_allocate_commons_list): New function, broken out
14988 of do_allocate_commons.
14989 * common.h (class Allocate_commons_task): Remove options_ field.
14990 Update constructor.
14991 * symtab.cc (Symbol_table::Symbol_table): Initialize
14993 (Symbol_table::add_from_object): Put TLS common symbols on
14995 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14996 which are IN_OUTPUT_DATA.
14997 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14998 allocate_commons and do_allocate_commons declarations. Declare
14999 do_allocate_commons_list.
15000 * gold.cc (queue_middle_tasks): Update creation of
15001 Allocate_commons_task to not pass options.
15002 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15003 (TLS_TEST_C_FLAGS): New variable.
15004 (tls_test_c_pic.o): New target.
15005 (tls_test_shared.so): Link in tls_test_c_pic.o.
15006 (tls_test_c_pic_ie.o): New target.
15007 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15008 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15009 (tls_test_c.o): New target.
15010 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15011 (tls_pic_test_LDADD): Likewise.
15012 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15013 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15014 (tls_test_c_gnu2.o): New target.
15015 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15017 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15018 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15019 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15020 * testsuite/tls_test.cc: Include "config.h".
15021 (t_last): Call t11_last.
15022 * testsuite/tls_test.h (t11, t11_last): Declare.
15023 * testsuite/tls_test_c.c: New file.
15024 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15025 * configure.ac: Check for OpenMP support.
15026 * configure, config.in, Makefile.in: Rebuild.
15027 * testsuite/Makefile.in: Rebuild.
15029 2008-04-16 Cary Coutant <ccoutant@google.com>
15031 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15032 (Target_i386::tls_base_symbol_defined_): New field.
15033 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15034 (Target_i386::Scan::global): Likewise.
15035 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15036 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15037 (Target_x86_64::tls_base_symbol_defined_): New field.
15038 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15039 (Target_x86_64::Scan::global): Likewise.
15041 2008-04-16 Cary Coutant <ccoutant@google.com>
15043 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15044 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15045 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15046 building shared libraries.
15047 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15048 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15049 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15050 * testsuite/Makefile.in: Rebuild.
15051 * testsuite/weak_undef.h: New file.
15052 * testsuite/weak_undef_file1.cc: Add extra test cases.
15053 * testsuite/weak_undef_file2.cc: Likewise.
15054 * testsuite/weak_undef_test.cc: Likewise.
15056 2008-04-16 David S. Miller <davem@davemloft.net>
15058 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15059 Add issued_non_pic_error_ field. Declare check_non_pic.
15060 (Target_sparc::Scan::check_non_pic): New function.
15061 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15062 (Target_sparc::Scan::global): Likewise.
15064 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15065 * configure: Rebuild.
15067 * options.h (DEFINE_enable): New macro.
15068 (new_dtags): New enable option.
15069 (initfirst, interpose, loadfltr, nodefaultlib,
15070 nodelete, nodlopen, nodump): New -z options.
15071 * layout.cc (Layout:finish_dynamic_section): If new
15072 dtags enabled, emit DT_RUNPATH. Also, emit a
15073 DT_FLAGS_1 containing any specified -z flags.
15075 2008-04-16 Ian Lance Taylor <iant@google.com>
15077 * copy-relocs.cc: New file.
15078 * copy-relocs.h: New file.
15079 * reloc.cc: Remove Copy_relocs code.
15080 * reloc.h: Likewise.
15081 * reloc-types.h (struct Reloc_types) [both versions]: Add
15082 get_reloc_addend_noerror.
15083 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15084 variants of add_global which take an addend which must be zero.
15085 * i386.cc: Include "copy-relocs.h".
15086 (class Target_i386): Change type of copy_relocs_ to variable,
15087 update initializer.
15088 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15089 Change all callers.
15090 (Target_i386::do_finalize_sections): Change handling of
15092 * sparc.cc: Include "copy-relocs.h".
15093 (class Target_sparc): Change type of copy_relocs_ to variable,
15094 update initializer.
15095 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15096 Change all callers.
15097 (Target_sparc::do_finalize_sections): Change handling of
15099 * x86_64.cc: Include "copy-relocs.h".
15100 (class Target_x86_64): Change type of copy_relocs_ to variable,
15101 update initializer.
15102 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15103 class. Change all callers.
15104 (Target_x86_64::do_finalize_sections): Change handling of
15106 * Makefile.am (CCFILES): Add copy-relocs.cc.
15107 (HFILES): Add copy-relocs.h.
15109 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15111 * testsuite/script_test_4.sh: Permit leading zeroes.
15113 2008-04-15 Ian Lance Taylor <iant@google.com>
15115 * script-sections.cc (Script_sections::create_segments): Use
15116 header_size_adjustment even when there is enough room for the
15118 * testsuite/script_test_4.sh: New file.
15119 * testsuite/script_test_4.t: New file.
15120 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15121 (check_DATA): Add script_test_4.stdout.
15122 (MOSTLYCLEANFILES): Likewise.
15123 (script_test_4): New target.
15124 (script_test_4.stdout): New target.
15125 * testsuite/Makefile.in: Rebuild.
15127 * sparc.cc: Add definitions for Output_data_plt_sparc class
15130 2008-04-14 David S. Miller <davem@davemloft.net>
15132 * sparc.cc: New file.
15133 * Makefile.am (TARGETSOURCES): Add sparc.cc
15134 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15135 * configure.tgt: Document targ_extra_size and
15136 targ_extra_big_endian. Add entries for sparc-* and
15138 * configure.ac: Handle targ_extra_size and
15139 targ_extra_big_endian.
15140 * Makefile.in: Rebuild.
15141 * configure: Likewise.
15142 * po/POTFILES.in: Likewise.
15143 * po/gold.pot: Likewise.
15145 2008-04-14 Ian Lance Taylor <iant@google.com>
15147 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15148 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15149 in the name/type/flags to section mapping. Don't call
15150 allocate_output_section.
15151 (Layout::choose_output_section): Change parameter from adjust_name
15152 to is_input_section. Don't permit input sections after sections
15153 are attached to segments. Don't call allocate_output_section.
15154 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15155 not write_enable_output_section.
15156 (Layout::make_output_section): Don't push to
15157 unattached_section_list_ nor call attach_to_segment. Call
15158 attach_section_to_segment if sections are attached.
15159 (Layout::attach_sections_to_segments): New function.
15160 (Layout::attach_section_to_segment): New function.
15161 (Layout::attach_allocated_section_to_segment): Rename from
15162 attach_to_segment. Remove flags parameter.
15163 (Layout::allocate_output_section): Remove function.
15164 (Layout::write_enable_output_section): Remove function.
15165 * layout.h (class Layout): Update for above changes. Add new
15166 field sections_are_attached_.
15167 * output.h (Output_section::update_flags_for_input_section): New
15169 * output.cc (Output_section::add_input_section): Call
15170 update_flags_for_input_section.
15171 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15173 2008-04-11 Cary Coutant <ccoutant@google.com>
15175 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15176 thought unnecessary.
15177 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15179 2008-04-11 Ian Lance Taylor <iant@google.com>
15181 * output.h (class Output_section_data): Remove inline definition
15183 * output.cc (Output_section_data::set_addralign): New function.
15185 2008-04-11 Cary Coutant <ccoutant@google.com>
15187 Add support for TLS descriptors for i386 and x86_64.
15188 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15189 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15190 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15192 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15193 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15194 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15196 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15197 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15198 Fix problem with initial-exec relocations.
15199 (Target_i386::Relocate::relocate_tls): Likewise.
15200 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15202 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15203 support for section-plus-offset dynamic table entries.
15204 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15205 (Output_data_dynamic::Dynamic_entry): Add support for
15206 section-plus-offset dynamic table entries.
15207 (Output_data_dynamic::Classification): Likewise.
15208 (Output_data_dynamic::classification_): Renamed offset_.
15209 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15210 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15211 (Target_x86_64::make_plt_section): New function.
15212 (Target_x86_64::reserve_tlsdesc_entries): New function.
15213 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15214 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15215 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15216 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15217 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15218 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15219 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15220 add extra PLT entry for TLS descriptors.
15221 (Output_data_plt_x86_64::got_): New field.
15222 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15223 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15225 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15227 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15228 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15229 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15230 R_386_TLS_DESC_CALL relocations.
15231 (Target_x86_64::Scan::global): Likewise.
15232 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15233 for TLS descriptors.
15234 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15235 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15236 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15237 GD-to-IE relaxation.
15238 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15239 and TLS_DESCRIPTORS.
15240 * Makefile.in: Rebuild.
15241 * configure: Rebuild.
15242 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15243 (tls_test_shared2.so): New target.
15244 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15245 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15246 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15247 (tls_shared_gd_to_ie_test_LDADD): New variable.
15248 (tls_shared_gnu2_gd_to_ie_test): New target.
15249 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15251 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15252 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15253 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15254 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15255 (tls_shared_gnu2_test): New target.
15256 (tls_test_gnu2_shared.so): New target.
15257 (tls_shared_gnu2_test_SOURCES): New variable.
15258 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15259 (tls_shared_gnu2_test_LDFLAGS): New variable.
15260 (tls_shared_gnu2_test_LDADD): New variable.
15261 * testsuite/Makefile.in: Rebuild.
15262 * testsuite/Makefile.
15264 2008-04-11 Ian Lance Taylor <iant@google.com>
15266 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15268 * testsuite/Makefile.in: Rebuild.
15270 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15272 * testsuite/script_test_2.cc (main): Adjust test.
15274 2008-04-11 David S. Miller <davem@davemloft.net>
15275 Ian Lance Taylor <iant@google.com>
15277 * options.h (General_options): Add entries for '-Y' and
15279 * options.cc (General_options:finalize): If -Y was used, add those
15280 entries to the library path instead of the default "/lib" and
15283 2008-04-11 David S. Miller <davem@davemloft.net>
15285 * testsuite/justsyms.t: Start at 0x100.
15286 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
15287 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15289 * testsuite/script_test_2.cc: Adjust string and section length
15292 2008-04-09 Ian Lance Taylor <iant@google.com>
15295 * script-sections.cc (Sections_element::allocate_to_segment): Add
15297 (Output_section_definition::allocate_to_segment): Likewise.
15298 (Orphan_output_section::allocate_to_segment): Likewise.
15299 (Script_sections::attach_sections_using_phdrs_clause): Don't
15300 propagate non-PT_LOAD segments to orphan sections.
15301 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15302 readelf rather than objdump.
15303 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15304 .interp section and PT_INTERP segment are the same size.
15305 * testsuite/Makefile.in: Rebuild.
15307 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15308 aliases for symbols defined in the same object.
15309 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15310 (weak_alias_test_SOURCES): New variable.
15311 (weak_alias_test_DEPENDENCIES): New variable.
15312 (weak_alias_test_LDFLAGS): New variable.
15313 (weak_alias_test_LDADD): New variable.
15314 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15315 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15316 (weak_alias_test_3.o): New target.
15317 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15318 * testsuite/weak_alias_test_main.cc: New file.
15319 * testsuite/weak_alias_test_1.cc: New file.
15320 * testsuite/weak_alias_test_2.cc: New file.
15321 * testsuite/weak_alias_test_3.cc: New file.
15323 2008-04-08 Ian Lance Taylor <iant@google.com>
15325 * options.h (class General_options): Add --noinhibit-exec option.
15326 * main.cc (main): Check --noinhibit-exec.
15328 * options.h (class General_options): Define --wrap as a special
15329 option. Add wrap_symbols_ field.
15330 (General_options::any_wrap_symbols): New function.
15331 (General_options::is_wrap_symbol): New function.
15332 * options.cc (General_options::parse_wrap): New function.
15333 (General_options::General_options): Initialize wrap_symbols_.
15334 * symtab.cc (Symbol_table::wrap_symbol): New function.
15335 (Symbol_table::add_from_object): Handle --wrap.
15336 * symtab.h (class Symbol_table): Declare wrap_symbol.
15337 * target.h (Target::wrap_char): New function.
15338 (Target::Target_info): Add wrap_char field.
15339 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15340 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15341 * testsuite/testfile.cc (Target_test::test_target_info):
15344 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15347 * layout.h (class Layout): Add added_eh_frame_data_ field.
15348 * layout.cc (Layout::Layout): Initialize new field.
15349 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15350 output section until we find a section we merged successfully.
15351 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15352 that the size be non-zero.
15354 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15357 2008-04-08 Craig Silverstein <csilvers@google.com>
15359 * configure.ac: Export new conditional variable HAVE_ZLIB.
15360 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15362 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15363 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15365 2008-04-07 Ian Lance Taylor <iant@google.com>
15367 * version.cc (version_string): Set to "1.5".
15369 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15370 Add issued_non_pic_error_ field. Declare check_non_pic.
15371 (Target_x86_64::Scan::check_non_pic): New function.
15372 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15373 (Target_x86_64::Scan::global): Likewise.
15375 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15376 addend parameter. Change caller. Handle merge sections.
15377 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15378 Address to Addend. Don't add in the result of
15379 local_section_offset, pass down the addend and use the returned
15381 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15382 Update declarations of local_section_offset and symbol_value.
15383 * testsuite/two_file_test_1.cc (t18): New function.
15384 * testsuite/two_file_test_2.cc (f18): New function.
15385 * testsuite/two_file_test_main.cc (main): Call t18.
15386 * testsuite/two_file_test.h (t18, f18): Declare.
15388 * configure.ac: Don't test for objdump, c++filt, or readelf.
15389 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15391 (TEST_READELF): New variable.
15392 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15393 (check_PROGRAMS): Add two_file_strip_test.
15394 (two_file_strip_test): New target.
15395 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15396 (two_file_same_shared_strip_test_SOURCES): New variable.
15397 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15398 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15399 (two_file_same_shared_strip_test_LDADD): New variable.
15400 (two_file_shared_strip.so): New target.
15401 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15402 (ver_test_5.syms, ver_test_7.syms): Likewise.
15403 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15404 (strip_test_3.stdout): Use TEST_OBJDUMP.
15405 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15407 2008-04-04 Cary Coutant <ccoutant@google.com>
15409 * symtab.h (Symbol::is_weak_undefined): New function.
15410 (Symbol::is_strong_undefined): New function.
15411 (Symbol::is_absolute): New function.
15412 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15413 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15415 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15416 (weak_undef_test): New target.
15417 * testsuite/Makefile.in: Rebuild.
15418 * testsuite/weak_undef_file1.cc: New file.
15419 * testsuite/weak_undef_file2.cc: New file.
15420 * testsuite/weak_undef_test.cc: New file.
15422 2008-04-03 Craig Silverstein <csilvers@google.com>
15424 * compressed_output.h (class Output_compressed_section): Use
15426 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15428 (zlib_compressed_suffix): Removed.
15429 (Output_compressed_section::set_final_data_size): Use unsigned
15431 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15432 Fix linker invocation.
15433 (flagstest_o_specialfile_and_compress_debug_sections):
15435 * testsuite/Makefile.in: Regenerated.
15437 2008-04-02 David S. Miller <davem@davemloft.net>
15439 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15440 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15442 2008-04-02 Craig Silverstein <csilvers@google.com>
15446 2008-04-02 Ian Lance Taylor <iant@google.com>
15448 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15449 parameters. Update for new key type to views_. Change all
15451 (File_read::read): Adjust for byteshift in returned view.
15452 (File_read::add_view): New function, broken out of
15453 find_and_make_view.
15454 (File_read::make_view): New function, broken out of
15455 find_and_make_view.
15456 (File_read::find_or_make_view): Add offset and aligned
15457 parameters. Rewrite accordingly. Change all callers.
15458 (File_read::get_view): Add offset and aligned parameters. Adjust
15459 for byteshift in return value.
15460 (File_read::get_lasting_view): Likewise.
15461 * fileread.h (class File_read): Update declarations.
15462 (class File_read::View): Add byteshift_ field. Add byteshift to
15463 constructor. Add byteshift method.
15464 * archive.h (Archive::clear_uncached_views): New function.
15465 (Archive::get_view): Add aligned parameter. Change all callers.
15466 * object.h (Object::get_view): Add aligned parameter. Change all
15468 (Object::get_lasting_view): Likewise.
15470 * fileread.cc (File_read::release): Don't call clear_views if
15471 there are multiple objects.
15472 * fileread.h (File_read::clear_uncached_views): New function.
15473 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15476 2008-03-31 Cary Coutant <ccoutant@google.com>
15478 Add thin archive support.
15479 * archive.cc (Archive::armagt): New const.
15480 (Archive::setup): Remove task parameter and calls to unlock.
15481 (Archive::unlock_nested_archives): New function.
15482 (Archive::read_header): Add nested_off parameter. Change
15484 (Archive::interpret_header): Likewise.
15485 (Archive::include_all_members): Change to handle thin
15487 (Archive::include_member): Likewise.
15488 * archive.h (Archive::Archive): Add new parameters and
15490 (Archive::armagt): New const.
15491 (Archive::setup): Remove task parameter.
15492 (Archive::unlock_nested_archives): New function.
15493 (Archive::read_header): Add nested_off parameter.
15494 (Archive::interpret_header): Likewise.
15495 (Archive::Nested_archive_table): New typedef.
15496 (Archive::is_thin_archive_): New field.
15497 (Archive::nested_archives_): New field.
15498 (Archive::options_): New field.
15499 (Archive::dirpath_): New field.
15500 (Archive::task_): New field.
15501 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15502 for thin archives. Pass additional parameters to
15503 Archive::Archive. Unlock the archive file after calling
15506 2008-03-29 Ian Lance Taylor <iant@google.com>
15508 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15509 version symbol to be local.
15510 * testsuite/ver_test_4.sh: New file.
15511 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15512 (check_DATA): Add ver_test_4.syms.
15513 (ver_test_4.syms): New target.
15514 * testsuite/Makefile.in: Rebuild.
15517 (Output_section::Input_section_sort_entry::has_priority): New
15519 (Output_section::Input_section_sort_entry::match_file_name): New
15521 (Output_section::Input_section_sort_entry::match_section_name):
15523 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15525 (Output_section::Input_section_sort_entry::match_section_file):
15527 (Output_section::Input_section_sort_compare::operator()): Rewrite
15528 using new Input_section_sort_entry functions. Sort crtbegin and
15529 crtend first. Sort sections with no priority before sections with
15531 * testsuite/initpri1.c (d3): Check j != 4.
15532 (cd5): New constructor/destructor function.
15533 (main): Check j != 2.
15535 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15536 new symbol when resolving, don't call set_is_default.
15537 * testsuite/ver_test_7.cc: New file.
15538 * testsuite/ver_test_7.sh: New file.
15539 * testsuite/Makefile.am (ver_test_7.so): New target.
15540 (ver_test_7.o): New target.
15541 (check_SCRIPTS): Add ver_test_7.sh.
15542 (check_DATA): Add ver_test_7.syms.
15543 (ver_test_7.syms): New target.
15545 2008-03-28 Ian Lance Taylor <iant@google.com>
15547 * layout.cc (Layout::layout): If we see an input section with a
15548 name that needs sorting, set the must_sort flag for the output
15550 (Layout::make_output_section): If the name of the output section
15551 indicates that it might require sorting, set the may_sort flag.
15552 * output.h (Output_section::may_sort_attached_input_sections): New
15554 (Output_section::set_may_sort_attached_input_sections): New
15556 (Output_section::must_sort_attached_input_sections): New
15558 (Output_section::set_must_sort_attached_input_sections): New
15560 (class Output_section): Declare Input_section_sort_entry. Define
15561 Input_section_sort_compare. Declare
15562 sort_attached_input_sections. Add new fields:
15563 may_sort_attached_input_sections_,
15564 must_sort_attached_input_sections_,
15565 attached_input_sections_are_sorted_.
15566 * output.cc (Output_section::Output_section): Initialize new
15568 (Output_section::add_input_section): Add an entry to
15569 input_sections_ if may_sort or must_sort are true.
15570 (Output_section::set_final_data_size): Call
15571 sort_attached_input_sections if necessary.
15572 (Output_section::Input_section_sort_entry): Define new class.
15573 (Output_section::Input_section_sort_compare::operator()): New
15575 (Output_section::sort_attached_input_sections): New function.
15576 * configure.ac: Check whether the compiler supports constructor
15577 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15578 * testsuite/initpri1.c: New file.
15579 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15580 CONSTRUCTOR_PRIORITY.
15581 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15582 (initpri1_LDFLAGS): New variable.
15583 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15585 2008-03-27 Ian Lance Taylor <iant@google.com>
15587 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15588 * testsuite/common_test_1.c: New file.
15589 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15590 (common_test_1_SOURCES): New variable.
15591 (common_test_1_DEPENDENCIES): New variable.
15592 (common_test_1_LDFLAGS): New variable.
15594 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15595 and commons_ correctly when NAME/VERSION does not override
15597 * testsuite/ver_test_6.c: New file.
15598 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15599 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15600 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15602 2008-03-26 Ian Lance Taylor <iant@google.com>
15604 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15605 of an undefined symbol from a version script.
15606 * testsuite/Makefile.am (ver_test_5.so): New target.
15607 (ver_test_5.o): New target.
15608 (check_SCRIPTS): Add ver_test_5.sh.
15609 (check_DATA): Add ver_test_5.syms.
15610 (ver_test_5.syms): New target.
15611 * testsuite/ver_test_5.cc: New file.
15612 * testsuite/ver_test_5.script: New file.
15613 * testsuite/ver_test_5.sh: New file.
15614 * Makefile.in, testsuite/Makefile.in: Rebuild.
15617 Fix problems building gold with gcc 4.3.0.
15618 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15619 (gold_error_at_location, gold_warning_at_location): Use it.
15620 * configure.ac: Check whether we can compile and use a template
15621 function with a printf attribute.
15622 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15623 when jumping over bytes.
15624 * object.cc: Instantiate Object::read_section_data.
15625 * debug.h: Include <cstring>
15626 * dwarf_reader.cc: Include <algorithm>
15627 * main.cc: Include <cstring>.
15628 * options.cc: Include <cstring>.
15629 * output.cc: Include <cstring>.
15630 * script.cc: Include <cstring>.
15631 * script.h: Include <string>.
15632 * symtab.cc: Include <cstring> and <algorithm>.
15633 * target-select.cc: Include <cstring>.
15634 * version.cc: Include <string>.
15635 * testsuite/testmain.cc: Include <cstdlib>.
15636 * configure, config.in: Rebuild.
15638 2008-03-25 Ian Lance Taylor <iant@google.com>
15640 * options.cc: Include "../bfd/bfdver.h".
15641 (options::help): Print bug reporting address.
15643 * version.cc (print_version): Adjust output for current value of
15644 BFD_VERSION_STRING.
15648 * options.cc (options::help): Print list of supported targets.
15649 * target-select.h: Include <vector>.
15650 (class Target_selector): Make machine_, size_, and is_big_endian_
15651 fields const. Add bfd_name_ and instantiated_target_ fields.
15652 (Target_selector::Target_selector): Add bfd_name parameter.
15653 (Target_selector::recognize): Make non-virtual, call
15655 (Target_selector::recognize_by_name): Make non-virtual, call
15656 do_recognize_by_name.
15657 (Target_selector::supported_names): New function.
15658 (Target_selector::bfd_name): New function.
15659 (Target_selector::do_instantiate_target): New pure virtual
15661 (Target_selector::do_recognize): New virtual function.
15662 (Target_selector::do_recognize_by_name): New virtual function.
15663 (Target_selector::instantiate_target): New private function.
15664 (supported_target_names): Declare.
15665 * target-select.cc (Target_selector::Target_selector): Update for
15666 new parameter and fields.
15667 (select_target_by_name): Check that the name matches before
15668 calling recognize_by_name.
15669 (supported_target_names): New function.
15670 * i386.cc (class Target_selector_i386): Update Target_selector
15671 constructor call. Remove recognize and recognize_by_name. Add
15672 do_instantiate_target.
15673 * x86_64.cc (class Target_selector_x86_64): Likewise.
15674 * testsuite/testfile.cc (class Target_selector_test): Update for
15675 changes to Target_selector.
15677 * README: Rewrite, with some notes on unsupported features.
15679 2008-03-24 Cary Coutant <ccoutant@google.com>
15681 * i386.cc (Target_i386::Got_type): New enum declaration.
15682 (Target_i386::Scan::local): Updated callers of Output_data_got
15684 (Target_i386::Scan::global): Likewise.
15685 (Target_i386::Relocate::relocate): Likewise.
15686 (Target_i386::Relocate::relocate_tls): Likewise.
15687 * object.h (Got_offset_list): New class.
15688 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15689 (Sized_relobj::local_got_offset): Likewise.
15690 (Sized_relobj::set_local_got_offset): Likewise.
15691 (Sized_relobj::local_has_tls_got_offset): Removed.
15692 (Sized_relobj::local_tls_got_offset): Removed.
15693 (Sized_relobj::set_local_tls_got_offset): Removed.
15694 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15695 * output.cc (Output_data_got::add_global): Added got_type parameter.
15696 (Output_data_got::add_global_with_rel): Likewise.
15697 (Output_data_got::add_global_with_rela): Likewise.
15698 (Output_data_got::add_global_pair_with_rel): New function.
15699 (Output_data_got::add_global_pair_with_rela): New function.
15700 (Output_data_got::add_local): Added got_type parameter.
15701 (Output_data_got::add_local_with_rel): Likewise.
15702 (Output_data_got::add_local_with_rela): Likewise.
15703 (Output_data_got::add_local_pair_with_rel): New function.
15704 (Output_data_got::add_local_pair_with_rela): New function.
15705 (Output_data_got::add_global_tls): Removed.
15706 (Output_data_got::add_global_tls_with_rel): Removed.
15707 (Output_data_got::add_global_tls_with_rela): Removed.
15708 (Output_data_got::add_local_tls): Removed.
15709 (Output_data_got::add_local_tls_with_rel): Removed.
15710 (Output_data_got::add_local_tls_with_rela): Removed.
15711 * output.h (Output_data_got::add_global): Added got_type parameter.
15712 (Output_data_got::add_global_with_rel): Likewise.
15713 (Output_data_got::add_global_with_rela): Likewise.
15714 (Output_data_got::add_global_pair_with_rel): New function.
15715 (Output_data_got::add_global_pair_with_rela): New function.
15716 (Output_data_got::add_local): Added got_type parameter.
15717 (Output_data_got::add_local_with_rel): Likewise.
15718 (Output_data_got::add_local_with_rela): Likewise.
15719 (Output_data_got::add_local_pair_with_rel): New function.
15720 (Output_data_got::add_local_pair_with_rela): New function.
15721 (Output_data_got::add_global_tls): Removed.
15722 (Output_data_got::add_global_tls_with_rel): Removed.
15723 (Output_data_got::add_global_tls_with_rela): Removed.
15724 (Output_data_got::add_local_tls): Removed.
15725 (Output_data_got::add_local_tls_with_rel): Removed.
15726 (Output_data_got::add_local_tls_with_rela): Removed.
15727 * resolve.cc (Symbol::override_base_with_special): Removed
15728 reference to has_got_offset_ field.
15729 * symtab.cc (Symbol::init_fields): Replaced initialization
15730 of got_offset_ with got_offsets_. Removed initialization
15732 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
15733 (Symbol::got_offset): Likewise.
15734 (Symbol::set_got_offset): Likewise.
15735 (Symbol::has_tls_got_offset): Removed.
15736 (Symbol::tls_got_offset): Removed.
15737 (Symbol::set_tls_got_offset): Removed.
15738 (Symbol::got_offset_): Removed.
15739 (Symbol::tls_mod_got_offset_): Removed.
15740 (Symbol::tls_pair_got_offset_): Removed.
15741 (Symbol::got_offsets_): New field.
15742 (Symbol::has_got_offset): Removed.
15743 (Symbol::has_tls_mod_got_offset): Removed.
15744 (Symbol::has_tls_pair_got_offset): Removed.
15745 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15746 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15748 (Target_x86_64::Scan::global): Likewise.
15749 (Target_x86_64::Relocate::relocate): Likewise.
15750 (Target_x86_64::Relocate::relocate_tls): Likewise.
15752 2008-03-25 Ben Elliston <bje@au.ibm.com>
15754 * yyscript.y: Fix spelling error in comment.
15756 2008-03-24 Ian Lance Taylor <iant@google.com>
15758 * options.h (class General_options): Define build_id option.
15759 * layout.h (class Layout): Declare write_build_id, create_note,
15760 create_build_id. Add build_id_note_ member.
15761 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15762 "libiberty.h", "md5.h", "sha1.h".
15763 (Layout::Layout): Initialize eh_frame_data_,
15764 eh_frame_hdr_section_, and build_id_note_.
15765 (Layout::finalize): Call create_build_id.
15766 (Layout::create_note): New function, broken out of
15767 Layout::create_gold_note.
15768 (Layout::create_gold_note): Call create_note.
15769 (Layout::create_build_id): New function.
15770 (Layout::write_build_id): New function.
15771 (Close_task_runner::run): Call write_build_id.
15773 * x86_64.cc: Correct license to GPLv3.
15775 2008-03-23 Ian Lance Taylor <iant@google.com>
15777 * options.cc: Include "demangle.h".
15778 (parse_optional_string): New function.
15779 (parse_long_option): Handle takes_optional_argument.
15780 (parse_short_option): Update dash_z initializer. Handle
15781 takes_optional_argument.
15782 (General_options::General_options): Initialize do_demangle_.
15783 (General_options::finalize): Set do_demangle_. Handle demangling
15785 * options.h (parse_optional_string): Declare.
15786 (struct One_option): Add optional_arg field. Update constructor.
15787 Update call constructor calls. Add takes_optional_argument
15789 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15790 (DEFINE_optional_string): Define.
15791 (General_options::demangle): Change from DEFINE_bool to
15792 DEFINE_optional_string.
15793 (General_options::no_demangle): New function.
15794 (General_options::do_demangle): New function.
15795 (General_options::set_do_demangle): New function.
15796 (General_options::execstack_status_): Move definition to end of
15798 (General_options::static_): Likewise.
15799 (General_options::do_demangle_): New field.
15800 * object.cc (big_endian>::get_symbol_location_info): Call
15801 Options::do_demangle, not Options::demangle.
15802 * symtab.cc (demangle): Likewise.
15804 2008-03-22 Ian Lance Taylor <iant@google.com>
15806 * gold.h: Include <cstddef> and <sys/types.h>
15807 * options.h: Include <cstring>.
15809 2008-03-21 Ian Lance Taylor <iant@google.com>
15811 * Added source code to GNU binutils.
15813 Copyright (C) 2008-2014 Free Software Foundation, Inc.
15815 Copying and distribution of this file, with or without modification,
15816 are permitted in any medium without royalty provided the copyright
15817 notice and this notice are preserved.
15823 version-control: never