1 2014-06-06 Cary Coutant <ccoutant@google.com>
3 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
4 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
5 (Dwarf_pubnames_table::read_header): Likewise.
6 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
9 2014-06-05 Joel Brobecker <brobecker@adacore.com>
11 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
12 * Makefile.in, configure: Regenerate.
14 2014-06-03 Alan Modra <amodra@gmail.com>
16 * powerpc.cc (addis_12_2): Define.
17 (Stub_table::do_write): Support fusion on ELFv2 stubs.
19 2014-06-03 Alan Modra <amodra@gmail.com>
21 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
24 2014-06-02 Alan Modra <amodra@gmail.com>
26 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
27 Only ignore relocs on ELFv1.
28 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
30 2014-05-30 Cary Coutant <ccoutant@google.com>
32 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
33 * testsuite/Makefile.in: Regenerate.
34 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
36 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
39 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
40 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
42 2014-05-15 Alan Modra <amodra@gmail.com>
44 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
45 Compare FDE contents with DW_CFA_nop rather than 0.
47 2014-05-13 Sriraman Tallam <tmsriram@google.com>
49 * symtab.h (may_need_copy_reloc): Remove check for position independent
51 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
52 position independence before pc absolute may_need_copy_reloc call.
53 Add check for executable output befor pc relative may_need_copy_reloc
59 * powerpc.cc: Add check for no position independence before
60 may_need_copy_reloc calls.
61 * testsuite/pie_copyrelocs_test.cc: New file.
62 * testsuite/pie_copyrelocs_shared_test.cc: New file.
63 * Makefile.am (pie_copyrelocs_test): New test.
64 * Makefile.in: Regenerate.
66 2014-05-08 Martin Liška <mliska@suse.cz>
68 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
70 2014-05-06 Cary Coutant <ccoutant@google.com>
73 * i386.cc (Output_data_got_plt_i386): New class.
74 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
75 parameter. Change all callers.
76 (Output_data_plt_i386::layout_): Remove.
77 (Output_data_plt_i386::got_plt_): Change type.
78 (Target_i386::got_plt_): Change type. Change all references.
79 (Target_i386::got_section): Create instance of new class.
80 (Output_data_got_plt_i386::do_write): New function.
81 * x86_64.cc (Output_data_got_plt_x86_64): New class.
82 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
83 parameter. Change all callers.
84 (Output_data_plt_x86_64::layout_): Remove.
85 (Output_data_plt_x86_64::got_plt_): Change type.
86 (Target_x86_64::got_plt_): Change type. Change all references.
87 (Target_x86_64::got_section): Create instance of new class.
88 (Output_data_got_plt_x86_64::do_write): New function.
89 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
90 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
93 2014-05-05 Cary Coutant <ccoutant@google.com>
95 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
96 if we have pubnames/pubtypes.
98 2014-05-02 Cary Coutant <ccoutant@google.com>
100 * defstd.cc (in_segment): Define __ehdr_start here...
101 * layout.cc (Layout::finalize): ...Instead of here. Set the
102 output segment when known.
103 * resolve.cc (Symbol::override_base_with_special): Remember
104 the original binding.
105 * symtab.cc (Symbol::set_output_segment): New function.
106 (Symbol::set_undefined): New function.
107 * symtab.h (Symbol::is_weak_undefined): Check original undef
109 (Symbol::is_strong_undefined): New function.
110 (Symbol::set_output_segment): New function.
111 (Symbol::set_undefined): New function.
112 * target-reloc.h (is_strong_undefined): Remove.
113 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
114 Check for hidden undefs.
115 (relocate_section): Call Symbol::is_strong_undefined.
117 * testsuite/Makefile.am (ehdr_start_test_1)
118 (ehdr_start_test_2, ehdr_start_test_3)
119 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
120 * testsuite/Makefile.in: Regenerate.
121 * testsuite/ehdr_start_def.cc: New source file.
122 * testsuite/ehdr_start_test.cc: New source file.
123 * testsuite/ehdr_start_test.t: New linker script.
124 * testsuite/ehdr_start_test_4.sh: New shell script.
126 2014-04-23 Cary Coutant <ccoutant@google.com>
129 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
131 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
133 * layout.cc (Layout::include_section): Allow a target to decide
134 whether to include a section.
135 * target.h (Target::should_include_section): New function.
136 (Target::do_should_include_section): New function.
138 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
140 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
142 (Copy_relocs::emit): ... here.
143 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
144 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
145 (Copy_reloc_entry::entries_): Change from private to protected.
147 2014-04-02 Sriraman Tallam <tmsriram@google.com>
149 * icf.cc (get_section_contents): Replace copies of reloc
150 vectors with const references.
152 2014-04-02 Cary Coutant <ccoutant@google.com>
154 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
155 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
156 * configure: Regenerate.
157 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
158 -fno-use-linker-plugin.
159 (LINK1, CXXLINK1): Add it to the link command.
160 * testsuite/Makefile.in: Regenerate.
162 2014-03-12 Alan Modra <amodra@gmail.com>
164 * Makefile.in: Regenerate.
166 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
168 * symtab.h (Symbol::set_nonvis): New function.
170 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
172 * symtab.cc (Sized_symbol<32>::init_output_data):
173 Instantiate the template.
174 (Sized_symbol<64>::init_output_data): Likewise.
176 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
178 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
179 adjust dynamic symbol value.
180 * target.h (Target::adjust_dyn_symbol): New function.
181 (Target::do_adjust_dyn_symbol): New function.
183 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
185 * output.cc (Output_data_dynamic::Dynamic_entry::write):
186 Get the value of DYNAMIC_CUSTOM dynamic entry.
187 * output.h (Output_data_dynamic::add_custom): New function.
188 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
190 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
191 * target.h (Target::dynamic_tag_custom_value): New function.
192 (Target::do_dynamic_tag_custom_value): New function.
194 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
196 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
198 * target.h (Target::has_custom_set_dynsym_indexes): New function.
199 (Target::do_has_custom_set_dynsym_indexes): New function.
200 (Target::set_dynsym_indexes): New function.
201 (Target::do_set_dynsym_indexes): New function.
203 2014-03-07 Alan Modra <amodra@gmail.com>
205 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
206 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
207 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
208 (Powerpc_relocate_functions::has_overflow_bitfield,
209 overflowed): Use the above.
210 (Target_powerpc::Relocate::relocate): Correct overflow checking
211 for a number of relocations. Modify overflow test for 16-bit
212 fields in instructions to signed/unsigned according to whether
213 the field takes a signed or unsigned value.
215 2014-03-05 Alan Modra <amodra@gmail.com>
217 Update copyright years.
219 2014-03-05 Alan Modra <amodra@gmail.com>
221 * powerpc.cc (Target_powerpc::Scan::local, global): Support
222 R_PPC64_ADDR64_LOCAL.
223 (Target_powerpc::Relocate::relocate): Likewise.
225 2014-03-03 Alan Modra <amodra@gmail.com>
227 * dwp.cc (print_version): Update copyright year to current.
229 2014-02-10 Alan Modra <amodra@gmail.com>
231 * po/gold.pot: Regenerate.
233 2014-02-06 Cary Coutant <ccoutant@google.com>
235 Fix problem where -u is ignored when a weak undef is seen.
237 * archive.cc (Library_base::should_include_member): Reorder
238 code to check for -u option if a weak undef has already been seen.
239 * testsuite/Makefile.am (weak_undef_test_2): New test case.
240 * testsuite/Makefile.in: Regenerate.
241 * testsuite/weak_undef_file3.cc: New file.
242 * testsuite/weak_undef_file4.cc: New file.
243 * testsuite/weak_undef_test_2.cc: New file.
245 2014-02-05 Cary Coutant <ccoutant@google.com>
247 Fix issues with gold undefined symbol diagnostics.
250 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
252 * target-reloc.h (is_strong_undefined): New function.
253 (relocate_section): Move undef vtable symbol check from here.
254 Check for is_strong_undefined.
256 2014-02-05 Cary Coutant <ccoutant@google.com>
258 Fix problems with the --dynamic-list option.
261 * options.cc (General_options::parse_dynamic_list):
262 Set have_dynamic_list_.
263 (General_options::General_options): Initialize have_dynamic_list_.
264 (General_options::finalize): Turn off -Bsymbolic and
265 -Bsymbolic-functions if --dynamic-list provided.
266 * options.h (General_options::have_dynamic_list): New function.
267 (General_options::have_dynamic_list_): New data member.
268 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
272 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
273 in --dynamic-list, mark it.
275 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
276 (dynamic_list_2): New test case.
277 * testsuite/Makefile.in: Regenerate.
278 * testsuite/dynamic_list_2.cc: New file.
279 * testsuite/dynamic_list_2.t: New file.
280 * testsuite/dynamic_list_lib1.cc: New file.
281 * testsuite/dynamic_list_lib2.cc: New file.
282 * testsuite/gc_dynamic_list_test.c: New file.
283 * testsuite/gc_dynamic_list_test.sh: New file.
284 * testsuite/gc_dynamic_list_test.t: New file.
286 2014-01-28 Cary Coutant <ccoutant@google.com>
288 Add .gdb_index version 7 support.
290 * gold/dwarf_reader.cc: include <utility> (for make_pair).
291 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
293 (Dwarf_ranges_table::read_ranges_table): Likewise.
294 (Dwarf_pubnames_table::read_section): Check for GNU-style
295 sections, and for compressed debug sections.
296 (Dwarf_pubnames_table::read_header): Compute end address of table.
297 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
298 for end of list by offset, not by offset == 0.
299 (Dwarf_info_reader::do_read_string_table): Check for compressed
301 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
302 Initialize new data members.
303 (Dwarf_pubnames_table::next_name): return flag_byte.
304 (Dwarf_pubnames_table::end_of_table_): New data member.
305 (Dwarf_pubnames_table::is_gnu_style_): New data member.
306 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
307 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
308 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
309 read skeleton type unit DIEs.
310 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
311 (Gdb_index::do_write): Write flag_byte.
312 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
313 (Gdb_index::Cu_vector): Store flags along with cu indexes.
314 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
315 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
317 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
319 * version.cc (print_version): Update copyright year to 2014.
321 2013-12-19 Dimitry Andric <dimitry@andric.com>
323 * stringpool.cc (Stringpool_template::reserve): Add
324 HAVE_UNORDERED_MAP case.
325 * stringpool.cc (Stringpool_template::print_stats): Likewise.
327 2013-12-18 Cary Coutant <ccoutant@google.com>
329 * configure.ac: Check for <unordered_set> and <unordered_map>.
330 * config.in: Regenerate.
331 * configure: Regenerate.
332 * system.h: Use <unordered_set> and <unordered_map> if available.
334 2013-12-10 Roland McGrath <mcgrathr@google.com>
336 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
337 with $(INSTALL_PROGRAM_ENV).
338 * Makefile.in: Regenerate.
340 2013-11-22 Cary Coutant <ccoutant@google.com>
342 * configure.ac: Add check for which library is needed for
344 * configure: Regenerate.
346 2013-11-22 Cary Coutant <ccoutant@google.com>
348 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
350 * testsuite/Makefile.in: Regenerate.
352 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
354 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
355 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
356 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
357 (Target_x86_64<size>::Scan::local): Likewise.
358 (Target_x86_64<size>::Scan::global): Likewise.
359 (Target_x86_64<size>::Relocate::relocate): Likewise.
360 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
362 (Target_x86_64<size>::Scan::check_non_pic(): Handle
365 * testsuite/Makefile.am (check_PROGRAMS): Add
366 exception_x86_64_bnd_test.
367 (exception_x86_64_bnd_test_SOURCES): New macro.
368 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
369 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
370 (exception_x86_64_bnd_test_LDADD): Likewise.
371 (exception_x86_64_bnd_1.o): New rule.
372 (exception_x86_64_bnd_2.o): Likewise.
373 * testsuite/Makefile.in: Regenerated.
375 2013-11-15 Alan Modra <amodra@gmail.com>
377 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
379 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
380 Only call ppc64_local_entry_offset for 64-bit. Restrict
381 symval_for_branch lookup to ELFv1.
382 (Stub_table::add_plt_call_entry): Use unsigned int off.
383 (Output_data_glink::Address, invalid_address): New.
384 (Output_data_glink::add_eh_frame): Move out of line. Add
386 (Output_data_glink::add_global_entry, find_global_entry,
387 global_entry_address): New functions.
388 (Output_data_glink::global_entry_stubs_, end_branch_table_,
389 ge_size): New variables.
390 (Output_data_glink::set_final_data_size): Add global entry
392 (Output_data_glink::do_write): Write global entry stubs.
393 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
394 parameter. Return true for ELFv2. Adjust callers.
395 (Target_powerpc::Scan::local, global): Restrict opd lookup to
396 ELFv1. Similarly for ifunc and dynamic relocation processing
397 specific to ELFv1. Recognize that symbols are defined on
398 their plt entries for ELFv2.
399 (Target_powerpc::symval_for_branch): Assert if called for
401 (Target_powerpc::Relocate::relocate): Use global entry plt
402 stub for symbol value if such exists on ELFv2.
403 (Target_powerpc::Relocate::relocate): Don't call
404 symval_for_branch when ELFv2. Do adjust for local entry
406 (Target_powerpc::do_dynsym_value): Set symbols to global entry
408 (Target_powerpc::do_plt_address_for_global): Similarly.
410 2013-11-14 Cary Coutant <ccoutant@google.com>
412 Revert patch -- this did not fix the problem, and there is
415 2013-11-14 Cary Coutant <ccoutant@google.com>
418 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
419 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
420 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
421 updating fde_offsets_.
422 (Eh_frame_hdr::lock_): New data member.
424 2013-11-14 Cary Coutant <ccoutant@google.com>
426 * dwp.cc (Dwo_file_entry): New type.
427 (File_list): Use Dwo_file_entry.
428 (Dwo_file::verify): New function.
429 (Dwo_file::verify_dwo_list): New function.
430 (Dwo_file::sized_verify_dwo_list): New function.
431 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
433 (Dwp_options): New enum type.
434 (dwp_options): Add --verify-only.
437 * dwp.h (gold_info): Add declaration.
439 2013-11-14 Cary Coutant <ccoutant@google.com>
442 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
443 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
444 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
445 updating fde_offsets_.
446 (Eh_frame_hdr::lock_): New data member.
448 2013-11-06 Cary Coutant <ccoutant@google.com>
451 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
452 before reloc sections.
454 2013-11-04 Alan Modra <amodra@gmail.com>
456 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
457 (Symbol::needs_dynamic_reloc): Test new flag.
458 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
459 (Target_powerpc::Scan::get_reference_flags): Add target param.
460 Return FUNC_DESC_ABI for 64-bit ELFv1.
461 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
463 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
464 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
466 2013-10-31 Cary Coutant <ccoutant@google.com>
468 Restore support for dwp v2 DWARF package file format.
470 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
471 tu_length parameter. Adjust all callers.
472 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
473 * dwp.cc: Include dwarf.h.
474 (Section_bounds): New struct type.
475 (Unit_set): New struct type.
476 (Dwo_file::Dwo_file): Initialize new data member.
477 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
478 Combine and rename to...
479 (Dwo_file::read_unit_index): ...this.
480 (Dwo_file::sized_read_compunit_index)
481 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
482 (Dwo_file::sized_read_unit_index): ...this.
483 (Dwo_file::copy_section): Remove section_name, is_str_offsets
484 parameters; add section_id parameter.
485 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
486 (Dwo_file::add_unit_set): ...this.
487 (Dwo_file::shndx_map_): Remove.
488 (Dwo_file::sect_offsets_): New data member.
489 (Dwp_output_file::Dwp_output_file): Initialize new data members.
490 (Dwp_output_file::add_section): Rename to...
491 (Dwp_output_file::add_contribution): ...this.
492 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
493 (Dwp_output_file::add_tu_set): Likewise.
494 (Dwp_output_file::Contribution): New type.
495 (Dwp_output_file::Section::contributions): New data member.
496 (Dwp_output_file::Cu_or_tu_set): Remove.
497 (Dwp_output_file::Section::Section): New ctor.
498 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
499 (Dwp_output_file::Dwp_index::Section_table): New type.
500 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
501 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
503 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
504 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
505 (Dwp_output_file::Dwp_index::section_table): New member function.
506 (Dwp_output_file::Dwp_index::section_table_end): New member function.
507 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
508 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
509 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
510 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
511 (Dwp_output_file::Dwp_index::section_table_): New data member.
512 (Dwp_output_file::Dwp_index::section_mask_): New data member.
513 (Dwp_output_file::add_output_section): New member function.
514 (Dwp_output_file::write_new_section): New member function.
515 (Dwp_output_file::write_contributions): New member function.
516 (Dwp_output_file::section_id_map_): New data member.
517 (class Dwo_id_info_reader): Remove.
518 (class Unit_reader): New class.
519 (get_dwarf_section_name): New function.
520 (Dwo_file::read_executable): Adjust initializations of class data.
521 (Dwo_file::read): Add support for v2 package file format.
522 (Dwo_file::read_unit_index): Likewise.
523 (Dwo_file::sized_read_unit_index): Likewise.
524 (Dwo_file::copy_section): Likewise.
525 (Dwo_file::add_unit_set): Likewise.
526 (Dwp_output_file::add_output_section): Likewise.
527 (Dwp_output_file::add_contribution): Likewise.
528 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
530 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
532 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
534 (Dwp_output_file::initialize): Remove unused function.
535 (Dwp_output_file::finalize): Add support for v2 package file format.
536 (Dwp_output_file::write_index): Likewise.
537 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
540 2013-10-31 Cary Coutant <ccoutant@google.com>
542 * configure.ac: Fix check for -fmerge-constants.
543 * configure.ac: Regenerate.
545 2013-10-30 Roland McGrath <mcgrathr@google.com>
547 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
548 Correct 9-byte nop sequence to match what the assembler generates.
550 2013-10-30 Alan Modra <amodra@gmail.com>
552 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
553 ppc64_local_entry_offset, ppc64_local_entry_offset,
554 do_read_symbols): New functions.
555 (Powerpc_relobj::e_flags_, st_other_): New vars.
556 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
557 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
558 (Powerpc_relobj::e_flags_): New var.
559 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
560 and adjust for ELFv2.
561 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
562 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
563 (Powerpc_dynobj::do_find_special_sections): Likewise.
564 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
565 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
566 to ELFv2 local entry.
567 (Target_powerpc::do_relax): No thread safe barriers needed for
569 (Output_data_plt_powerpc::initial_plt_entry_size_,
570 plt_entry_size): Delete. Replace all uses with
571 first_plt_entry_offset() and plt_entry_size().
572 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
573 reserved_size parm. Update callers.
574 (Output_data_plt_powerpc::entry_count): Update.
575 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
576 and use Target_powerpc::first_plt_entry_offset().
577 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
578 rename to plt_entry_size.
579 (Output_data_plt_powerpc::add_ifunc_entry,
580 add_local_ifunc_entry): Adjust reloc for ELFv2.
581 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
582 (glink_eh_frame_fde_64v2): New.
583 (Stub_table::plt_call_size): Support ELFv2 sizing.
584 (Output_data_glink::add_eh_frame): Use the new FDE.
585 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
586 (Stub_table::do_write): Write ELFv2 stubs and glink.
587 (Target_powerpc::Relocate::relocate): Replaces nop after call
588 with ld 2,24(1) and adjust local offset destination for ELFv2.
590 2013-10-30 Alan Modra <amodra@gmail.com>
592 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
593 (Target_powerpc::Scan::global, local): Likewise.
594 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
595 on all ppc64 @h and @ha relocs.
597 2013-10-14 Alan Modra <amodra@gmail.com>
599 * output.h (Output_data_got::add_constant): Tidy.
600 (Output_data_got::add_constant_pair): New function.
601 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
602 methods used so as to first call reserve_ent().
604 2013-10-11 Roland McGrath <mcgrathr@google.com>
606 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
607 add_got_entry and add_got_entry_pair.
609 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
610 (HAVE_PUBNAMES): Likewise.
611 * configure: Regenerate.
613 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
614 * testsuite/Makefile.in: Regenerate.
616 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
617 Remove const from declaration.
618 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
619 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
620 * output.h (Output_file_header): Remove const from member target_
621 and corresponding constructor argument.
622 * output.cc (Output_file_header::Output_file_header): Update prototype.
623 (Output_file_header::do_sized_write): Use this->target_ in place
624 of parameters()->target().
626 * testsuite/undef_symbol.cc (Foo::get_a): New method.
628 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
629 * configure: Regenerate.
630 * Makefile.in: Regenerate.
631 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
632 * testsuite/merge_string_literals_2.c: Likewise.
633 * testsuite/Makefile.am
634 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
635 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
636 literal -fmerge-constants.
637 * testsuite/Makefile.in: Regenerate.
639 * i386.cc (Target_i386): Remove unused member dynbss_.
640 * arm.cc (Target_arm): Likewise.
641 * powerpc.cc (Target_powerpc): Likewise.
642 * sparc.cc (Target_sparc): Likewise.
643 * tilegx.cc (Target_tilegx): Likewise.
644 * x86_64.cc (Target_x86_64): Likewise.
645 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
646 type_signature_, type_offset_.
647 * plugin.h (Plugin_hook): Remove unused member layout_.
648 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
650 (Read_member): Remove unused members input_objects_, symtab_,
652 (Check_library): Remove unused member symtab_.
653 * archive.h (Lib_group): Remove unused member lib_.
654 * archive.cc (Lib_group::Lib_group): Update initializer.
655 * incremental.h (Incremental_binary): Remove unused member target_.
656 (Incremental_script_entry): Removed unused member script_.
657 * layout.h (Write_symbols_task): Remove unused member input_objects_.
658 * icf.h (Icf): Remove unused member num_tracked_relocs.
660 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
661 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
663 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
665 * archive.h: Use struct rather than class for forward declaration
666 of Read_symbols_data.
668 2013-10-07 Cary Coutant <ccoutant@google.com>
671 * testsuite/Makefile.am (icf_test): Fix dependencies.
672 (icf_safe_test): Likewise.
673 (icf_safe_so_test): Likewise.
674 (large_symbol_alignment): Add empty _LDADD rule.
675 * testsuite/Makefile.in: Regenerate.
677 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
680 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
681 relocation for R_X86_64_32 on x32.
683 2013-08-27 Roland McGrath <mcgrathr@google.com>
685 * output.cc (Output_segment::set_section_addresses): Take new
686 Target* argument. If target->isolate_execinstr() and the segment
687 is executable and starts at a target->abi_pagesize() boundary,
688 pad its end out to a target->abi_pagesize() boundary with code fill.
689 * output.h (Output_segment::set_section_addresses): Update decl.
690 * layout.h (Layout::check_output_data_for_reset_values): Take new
691 argument RELAX_OUTPUTS.
692 (Layout): New member relax_output_list_.
693 (Layout::add_relax_output): New method.
694 * layout.cc (Layout::Layout): Update constructor.
695 (Layout::reset_relax_output): New method.
696 (Layout::clean_up_after_relaxation): Call it.
697 (Layout::prepare_for_relaxation): Update caller.
698 (Layout::set_segment_offsets): Update callers of set_section_addresses.
699 Call reset_relax_output before re-processing segments for
700 isolate_execinstr case.
701 (Layout::write_data): Handle relax_output_list_.
702 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
703 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
705 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
708 * object.h: Fix typos.
710 2013-08-16 Roland McGrath <mcgrathr@google.com>
712 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
713 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
715 2013-08-07 Cary Coutant <ccoutant@google.com>
717 Revert support for v2 DWP files:
719 2013-03-01 Cary Coutant <ccoutant@google.com>
721 Add dwp support for v2 DWARF package file format.
722 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
723 tu_length parameter. Adjust all callers.
724 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
725 * dwp.cc: Include dwarf.h.
726 (Section_bounds): New struct type.
727 (Unit_set): New struct type.
728 (Dwo_file::Dwo_file): Initialize new data member.
729 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
730 Combine and rename to...
731 (Dwo_file::read_unit_index): ...this.
732 (Dwo_file::sized_read_compunit_index)
733 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
734 (Dwo_file::sized_read_unit_index): ...this.
735 (Dwo_file::copy_section): Remove section_name, is_str_offsets
736 parameters; add section_id parameter.
737 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
738 (Dwo_file::add_unit_set): ...this.
739 (Dwo_file::shndx_map_): Remove.
740 (Dwo_file::sect_offsets_): New data member.
741 (Dwp_output_file::Dwp_output_file): Initialize new data members.
742 (Dwp_output_file::add_section): Rename to...
743 (Dwp_output_file::add_contribution): ...this.
744 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
745 (Dwp_output_file::add_tu_set): Likewise.
746 (Dwp_output_file::Contribution): New type.
747 (Dwp_output_file::Section::contributions): New data member.
748 (Dwp_output_file::Cu_or_tu_set): Remove.
749 (Dwp_output_file::Section::Section): New ctor.
750 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
751 (Dwp_output_file::Dwp_index::Section_table): New type.
752 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
753 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
755 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
756 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
757 (Dwp_output_file::Dwp_index::section_table): New member function.
758 (Dwp_output_file::Dwp_index::section_table_end): New member function.
759 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
760 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
761 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
762 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
763 (Dwp_output_file::Dwp_index::section_table_): New data member.
764 (Dwp_output_file::Dwp_index::section_mask_): New data member.
765 (Dwp_output_file::add_output_section): New member function.
766 (Dwp_output_file::write_new_section): New member function.
767 (Dwp_output_file::write_contributions): New member function.
768 (Dwp_output_file::section_id_map_): New data member.
769 (class Dwo_id_info_reader): Remove.
770 (class Unit_reader): New class.
771 (get_dwarf_section_name): New function.
772 (Dwo_file::read_executable): Adjust initializations of class data.
773 (Dwo_file::read): Add support for v2 package file format.
774 (Dwo_file::read_unit_index): Likewise.
775 (Dwo_file::sized_read_unit_index): Likewise.
776 (Dwo_file::copy_section): Likewise.
777 (Dwo_file::add_unit_set): Likewise.
778 (Dwp_output_file::add_output_section): Likewise.
779 (Dwp_output_file::add_contribution): Likewise.
780 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
782 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
784 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
786 (Dwp_output_file::initialize): Remove unused function.
787 (Dwp_output_file::finalize): Add support for v2 package file format.
788 (Dwp_output_file::write_index): Likewise.
789 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
792 2013-07-31 Cary Coutant <ccoutant@google.com>
794 * object.cc (Sized_relobj::do_output_section_address): New function.
795 (Sized_relobj): Instantiate explicitly.
796 * object.h (Object::output_section_address): New function.
797 (Object::do_output_section_address): New function.
798 (Sized_relobj::do_output_section_address): New function.
799 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
801 2013-07-30 Cary Coutant <ccoutant@google.com>
802 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
804 * parameters.cc (Parameters::entry): Return target-specific entry
806 * target.h (Target::entry_symbol_name): New function.
807 (Target_info::entry_symbol_name): New data member.
809 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
810 * i386.cc (Target_i386::i386_info): Likewise.
811 (Target_i386_nacl::i386_nacl_info): Likewise.
812 * sparc.cc (Target_sparc::sparc_info): Likewise.
813 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
814 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
815 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
816 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
818 2013-07-22 Sterling Augustine <saugustine@google.com>
820 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
821 Convert parameter shndx to local variable. Add parameters symtab
822 and symtab_size. Scan over section names. Find relocation
823 section corresponding to current section. Create and initialize
824 reloc_mapper_ and reloc_type_.
825 (Dwarf_pubnames_table::read_header): Add assertion. Change
826 unit_length to off_t. Initialize member unit_length_. Fill in field
828 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
829 Initialize new fields unit_length_ and cu_offset_.
830 (Dwarf_pubnames_table::read_section): Update prototype.
831 (Dwarf_pubnames_table::cu_offset): New member function.
832 (Dwarf_pubnames_table::subsection_size): Likewise.
833 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
835 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
836 member functions public.
837 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
838 Update comment. Rework logic. Move repeated parts to...
839 (Gdb_index_info_reader::read_pubtable): ...here. New function.
840 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
841 pubtypes_table_, and stmt_list_offset.
842 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
843 Gdb_index::find_pubtype_offset,
844 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
845 (Gdb_index::pubnames_read): Update prototype and rework logic.
846 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
848 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
849 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
850 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
851 Gdb_index::map_pubtable_to_dies):
853 (Gdb_index::pubnames_read): Update declaration.
854 (Gdb_index::Pubname_offset_map): New type.
855 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
856 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
857 Gdb_index::stmt_list_offset): Declare.
858 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
859 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
860 Gdb_index::pubtypes_offset_): Remove.
862 2013-07-19 Roland McGrath <mcgrathr@google.com>
864 * options.h (General_options): Add -Trodata-segment option.
865 * parameters.cc (Parameters::check_rodata_segment): New function.
866 (Parameters::set_target_once): Call it.
867 * parameters.h (Parameters): Declare it (private member function).
868 * layout.cc (load_seg_unusable_for_headers): New function, broken
869 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
870 then validate rodata segment rather than text segment.
871 (relaxation_loop_body): Call that.
872 (is_text_segment): New function. Don't admit a non-executable
873 segment if TARGET->isolate_execinstr().
874 (set_segment_offsets): Call it. Honor -Trodata-segment option.
876 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
879 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
880 * nacl.h (Sniff_file::View::View): Request aligned view.
882 2013-07-11 Cary Coutant <ccoutant@google.com>
884 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
885 correct BRLT entry size.
887 2013-07-03 Alan Modra <amodra@gmail.com>
889 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
892 2013-07-01 Cary Coutant <ccoutant@google.com>
894 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
896 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
897 (Dwarf_ranges_table::lookup_reloc): New function.
898 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
900 (Dwarf_ranges_table::lookup_reloc): New function.
901 (Dwarf_ranges_table::reloc_type_): New data member.
903 2013-06-27 Jing Yu <jingyu@google.com>
906 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
908 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
909 (Target_powerpc::do_relax): Call the above.
911 2013-06-27 Cary Coutant <ccoutant@google.com>
913 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
914 on garbage collected .opd section.
916 2013-06-27 Alan Modra <amodra@gmail.com>
918 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
920 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
921 (Target_powerpc::do_function_location): Likewise for loc->shndx.
923 2013-06-14 Cary Coutant <ccoutant@google.com>
925 * resolve.cc (Symbol::override_base): Don't override st_type
926 from plugin placeholder symbols.
927 (Symbol_table::resolve): Likewise.
928 (Symbol_table::should_override): Don't complain about TLS mismatch
929 if the TO symbol is a plugin placeholder.
930 * testsuite/Makefile.am (plugin_test_tls): New test.
931 * testsuite/Makefile.in: Regenerate.
932 * testsuite/plugin_test_tls.sh: New test script.
933 * testsuite/two_file_test_2_tls.cc: New test source.
934 * testsuite/two_file_test_tls.cc: New test source.
936 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
938 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
939 the maximum segment alignment is larger than the page size.
940 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
941 correctly aligns the symbols with large alignemnt.
942 * testsuite/Makefile.in: Regenerate.
943 * testsuite/large_symbol_alignment.cc: New file.
945 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
946 Sriraman Tallam <tmsriram@google.com>
948 * options.h (sort_section): New option.
949 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
950 Rename from Input_section_sort_section_name_special_ordering_compare.
951 (Input_section_sort_section_name_compare): New struct.
952 * output.cc (Output_section::Input_section_sort_section_name_compare::
953 operator()): New function.
954 (Output_section::sort_attached_input_sections): Use new sort function
955 for .text if --sort-section=name is specified.
956 * layout.cc (Layout::make_output_section):
957 Add sorting by name when --sort-section=name is specified.
958 * testsuite/Makefile.am (text_section_grouping): Test option
960 * testsuite/Makefile.in: Regenerate.
961 * testsuite/section_sorting_name.cc: New file.
962 * testsuite/section_sorting_name.sh: New file.
964 2013-05-21 Cary Coutant <ccoutant@google.com>
966 * symtab.h (Symbol::is_cxx_vtable): New function.
967 * target-reloc.h (relocate_section): Check for vtable symbol.
968 * testsuite/Makefile.am (missing_key_func.sh): New test case.
969 * testsuite/Makefile.in: Regenerate.
970 * testsuite/missing_key_func.cc: New test source.
971 * testsuite/missing_key_func.sh: New test script.
973 2013-05-21 Cary Coutant <ccoutant@google.com>
975 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
976 type of enclosing symbol.
977 (Relocate_info::location): Check symbol type when describing symbol.
978 * object.h (Symbol_location_info): Remove unused line_number;
979 add enclosing_symbol_type.
980 * testsuite/debug_msg.sh: Adjust expected output.
982 2013-05-13 Cary Coutant <ccoutant@google.com>
984 * configure.ac: Export DEFAULT_TARGET.
985 * configure: Regenerate.
986 * Makefile.in: Regenerate.
987 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
988 * testsuite/Makefile.in: Regenerate.
989 * testsuite/debug_msg.sh: Delete duplicate tests.
990 Don't check undef_int error message match for powerpc where the
991 source file and line number aren't available.
993 2013-05-10 Roland McGrath <mcgrathr@google.com>
995 * options.h (General_options): Add --rosegment-gap option.
996 * options.cc (finalize): --rosegment-gap implies --rosegment.
997 * layout.cc (set_segment_offsets): Let user option override
998 target->rosegment_gap().
1000 2013-05-10 Roland McGrath <mcgrathr@google.com>
1002 * options.h (General_options): Remove leading space from help
1003 messages for -nostdlib and --rosegment.
1005 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1008 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1010 2013-05-03 Alan Modra <amodra@gmail.com>
1012 * merge.cc (Output_merge_string::do_add_input_section): Correct
1013 scan for number of strings. Rename vars to avoid shadowing.
1014 Include missing terminator in input_size_.
1016 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1018 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1019 Restore empty string handling.
1021 2013-05-01 Cary Coutant <ccoutant@google.com>
1023 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1024 uninitialized warning.
1026 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1028 * output.cc (Output_section::add_merge_input_section): Allow
1029 to merge sections if the alignment is more than character size.
1030 * merge.h (Output_merge_string::Output_merge_string): Remove
1032 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1033 only not-null strings. Check the alignment of strings.
1035 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1036 alignment as the argument.
1037 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1038 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1039 Align non-zero length strings according to the addralign_.
1040 (Stringpool_template<Stringpool_char>::set_string_offsets):
1041 Updating offsets according to the given alignment.
1042 * testsuite/Makefile.am (text_section_grouping): Test if string
1043 literals are getting merged.
1044 * testsuite/Makefile.in: Regenerate.
1045 * testsuite/merge_string_literals_1.c: New file.
1046 * testsuite/merge_string_literals_2.c: Ditto.
1047 * testsuite/merge_string_literals.sh: Ditto.
1049 2013-04-26 Ian Lance Taylor <iant@google.com>
1051 * target-reloc.h (relocate_section): If the reloc offset is out of
1052 range, pass VIEW as NULL to relocate.relocate.
1053 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1054 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1055 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1056 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1057 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1058 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1060 2013-04-26 Geoff Pike <gpike@chromium.org>
1062 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1063 * layout.cc (Hash_task): New class.
1064 (Layout::queue_build_id_tasks): New function.
1065 (Layout::write_build_id): Handle single-thread portion of build ID
1066 computation. (In some cases, all of it is single-threaded.) Replace
1067 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1068 functionality in fewer lines of code.
1069 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1070 * options.h (General_options): make "--build-id" default to tree
1071 rather than sha1. Add two new options related to --build-id=tree:
1072 --build-id-chunk-size-for-treehash and
1073 --build-id-min-file-size-for-treehash.
1074 * Makefile.am: add testing of --build-id=tree and related new options
1075 (these tests will be invoked by "make check").
1076 * Makefile.in: Regenerate.
1078 2013-04-25 Alan Modra <amodra@gmail.com>
1080 * configure.tgt: Add powerpcle and powerpc64le.
1082 2013-04-22 Alan Modra <amodra@gmail.com>
1085 * layout.cc (Layout::segment_precedes): Allow more than one
1086 segment with the same type and flags.
1088 2013-04-15 Cary Coutant <ccoutant@google.com>
1090 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1091 allocate space in file for BSS sections.
1093 2013-04-15 Cary Coutant <ccoutant@google.com>
1095 * script-sections.cc (Orphan_output_section): Reset address
1096 to zero after each orphaned section for relocatable links.
1098 2013-04-15 Cary Coutant <ccoutant@google.com>
1100 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1101 section starting address for relocatable link.
1102 * testsuite/Makefile.am (script_test_11): New test.
1103 * testsuite/Makefile.in: Regenerate.
1104 * testsuite/script_test_11.c: New source file.
1105 * testsuite/script_test_11.t: New linker script.
1107 2013-04-13 Alan Modra <amodra@gmail.com>
1109 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1110 owner when sections are not adjacent and exceed group size.
1111 (Target_powerpc::group_sections): Handle corner case.
1112 (Target_powerpc::Branch_info::make_stub): Handle case where
1113 stub table doesn't exist due to branches in non-exec sections.
1114 (Target_powerpc::Relocate::relocate): Likewise.
1116 2013-04-11 Alan Modra <amodra@gmail.com>
1119 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1120 .branch_lt to match bfd ld. Adjust comments throughout file.
1122 2013-04-04 Ian Lance Taylor <iant@google.com>
1125 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1126 sections before checking whether they are included in the link.
1128 2013-03-29 Sriraman Tallam <tmsriram@google.com>
1130 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1131 object before calling the plugin claim_file handler. Pass the elf
1132 object of the archive to the plugin. Delete the elf object if the
1133 plugin claims the file.
1135 2013-03-21 Alan Modra <amodra@gmail.com>
1137 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1138 segment when omagic.
1140 2013-03-21 Alan Modra <amodra@gmail.com>
1142 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1144 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1145 uninitialized" warning.
1147 2013-03-20 Alan Modra <amodra@gmail.com>
1149 * symtab.h (Symbol::clear_version): New function.
1150 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1151 is_needed by weak references. Clear version for symbols defined
1152 in as-needed objects that are not needed.
1154 2013-03-15 Alan Modra <amodra@gmail.com>
1156 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1157 static and public. Add report_err param. Return false for data refs.
1158 (Target_powerpc::rela_dyn_section): New overloaded function.
1159 (Target_powerpc::plt_, iplt_): Elucidate.
1160 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1161 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1162 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1163 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1164 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1165 push_branch and make_plt_entry for ifunc syms when
1166 reloc_needs_plt_for_ifunc.
1167 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1168 for ifunc unless reloc_needs_plt_for_ifunc.
1170 2013-03-15 Alan Modra <amodra@gmail.com>
1172 * gc.h (gc_process_relocs): Don't look through function descriptors.
1173 * icf.cc (get_section_contents): Do so here instead.
1175 2013-03-13 Alan Modra <amodra@gmail.com>
1177 * powerpc.cc (is_branch_reloc): Forward declare.
1178 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1179 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1180 false for 64-bit, true for 32-bit non-branch relocs.
1181 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1182 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1184 (icf_safe_test): Generate linker map file as well as nm output.
1185 (icf_safe_so_test): Likewise.
1186 * testsuite/Makefile.in: Regenerate.
1187 * testsuite/icf_test.sh: Parse linker map file to determine
1189 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1190 * testsuite/icf_safe_so_test.sh: Likewise.
1191 (X86_32_or_ARM_specific_safe_fold): Merge into..
1192 (arch_specific_safe_fold): ..this.
1193 (X86_64_specific_safe_fold): Delete unused function.
1195 2013-03-12 Alan Modra <amodra@gmail.com>
1197 * gc.h (gc_process_relocs): Look through function descriptors
1198 to determine shndx, symvalue and addend used by ICF. Tidy
1199 variable duplication.
1201 2013-03-11 Alan Modra <amodra@gmail.com>
1203 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1204 * layout.cc (Layout_task_runner::run): ..to here.
1205 * symtab.h (struct Symbol_location): Extract from..
1206 (class Symbol_table): ..here.
1207 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1208 * target.h (class Target): Add function_location and
1209 do_function_location functions.
1210 (class Sized_target): Add do_function_location.
1211 * object.h (class Sized_relobj_file): Move find_shdr..
1212 (class Object): ..to here.
1213 * object.cc: Likewise. Update to suit. Instantiate.
1214 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1215 * powerpc.cc (class Powerpc_dynobj): New.
1216 (Target_powerpc::do_function_location): New function.
1217 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1218 (Powerpc_dynobj::do_read_symbols): New function.
1219 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1221 2013-03-08 Ian Lance Taylor <iant@google.com>
1223 * options.cc (General_options::string_to_object_format): Accept
1226 2013-03-08 Alan Modra <amodra@gmail.com>
1228 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1229 pointer to Post_fde.
1230 (struct Post_fde): Move definition to here..
1231 * ehframe.cc (struct Post_fde): ..from here.
1232 (Cie::write): Don't alloc Post_fde.
1233 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1235 2013-03-07 Alan Modra <amodra@gmail.com>
1237 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1238 relocation referencing .LC0.
1239 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1241 2013-03-07 Alan Modra <amodra@gmail.com>
1243 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1244 always_inline. Add assembly for powerpc to avoid GOT.
1246 2013-03-07 Alan Modra <amodra@gmail.com>
1248 * testsuite/script_test_10.sh: Don't test .bss section
1251 2013-03-06 Alan Modra <amodra@gmail.com>
1253 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1254 (Target_powerpc::symval_for_branch): Add symtab param. Update
1255 all callers. Handle folded sections.
1256 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1258 (Global_symbol_visitor_opd::operator()): Likewise.
1260 2013-03-04 Alan Modra <amodra@gmail.com>
1262 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1263 * testsuite/Makefile.in: Regenerate.
1265 2013-03-01 Cary Coutant <ccoutant@google.com>
1267 Add dwp support for v2 DWARF package file format.
1268 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1269 tu_length parameter. Adjust all callers.
1270 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1271 * dwp.cc: Include dwarf.h.
1272 (Section_bounds): New struct type.
1273 (Unit_set): New struct type.
1274 (Dwo_file::Dwo_file): Initialize new data member.
1275 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1276 Combine and rename to...
1277 (Dwo_file::read_unit_index): ...this.
1278 (Dwo_file::sized_read_compunit_index)
1279 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1280 (Dwo_file::sized_read_unit_index): ...this.
1281 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1282 parameters; add section_id parameter.
1283 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1284 (Dwo_file::add_unit_set): ...this.
1285 (Dwo_file::shndx_map_): Remove.
1286 (Dwo_file::sect_offsets_): New data member.
1287 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1288 (Dwp_output_file::add_section): Rename to...
1289 (Dwp_output_file::add_contribution): ...this.
1290 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1291 (Dwp_output_file::add_tu_set): Likewise.
1292 (Dwp_output_file::Contribution): New type.
1293 (Dwp_output_file::Section::contributions): New data member.
1294 (Dwp_output_file::Cu_or_tu_set): Remove.
1295 (Dwp_output_file::Section::Section): New ctor.
1296 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1297 (Dwp_output_file::Dwp_index::Section_table): New type.
1298 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1299 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1301 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1302 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1303 (Dwp_output_file::Dwp_index::section_table): New member function.
1304 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1305 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1306 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1307 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1308 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1309 (Dwp_output_file::Dwp_index::section_table_): New data member.
1310 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1311 (Dwp_output_file::add_output_section): New member function.
1312 (Dwp_output_file::write_new_section): New member function.
1313 (Dwp_output_file::write_contributions): New member function.
1314 (Dwp_output_file::section_id_map_): New data member.
1315 (class Dwo_id_info_reader): Remove.
1316 (class Unit_reader): New class.
1317 (get_dwarf_section_name): New function.
1318 (Dwo_file::read_executable): Adjust initializations of class data.
1319 (Dwo_file::read): Add support for v2 package file format.
1320 (Dwo_file::read_unit_index): Likewise.
1321 (Dwo_file::sized_read_unit_index): Likewise.
1322 (Dwo_file::copy_section): Likewise.
1323 (Dwo_file::add_unit_set): Likewise.
1324 (Dwp_output_file::add_output_section): Likewise.
1325 (Dwp_output_file::add_contribution): Likewise.
1326 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1328 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1330 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1332 (Dwp_output_file::initialize): Remove unused function.
1333 (Dwp_output_file::finalize): Add support for v2 package file format.
1334 (Dwp_output_file::write_index): Likewise.
1335 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1338 2013-03-01 Cary Coutant <ccoutant@google.com>
1340 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1341 function into class definition in header file.
1342 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1343 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1345 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1347 2013-02-28 Alan Modra <amodra@gmail.com>
1349 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1350 * target.cc (Target::do_plt_fde_location): New function.
1351 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1352 accessor function, and constructor param.
1353 (struct Post_fde, Post_fdes): Declare.
1354 (Cie::write): Add post_fdes param.
1355 * ehframe.cc (Fde::write): Use plt_fde_location.
1356 (struct Post_fde): Define.
1357 (Cie::write): Stash FDEs added post merge mapping.
1358 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1359 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1360 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1362 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1363 (Target_powerpc::has_glink): New function.
1364 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1365 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1366 glink_eh_frame_fde_32, default_fde): New data.
1367 (Stub_table::eh_frame_added_): New var.
1368 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1370 (Stub_table::add_eh_frame): New function.
1371 (Output_data_glink::add_eh_frame): New function.
1372 (Target_powerpc::make_glink_section): Call add_eh_frame.
1374 2013-02-15 Ian Lance Taylor <iant@google.com>
1376 * options.h (DEFINE_uint64_alias): Define.
1377 (class General_options): Add -Ttext-segment as an alias for
1380 2013-02-15 Alan Modra <amodra@gmail.com>
1382 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1383 (Stub_table::do_write): ..here, two places.
1384 (Stub_table::plt_call_size): Use it here too.
1386 2013-02-11 Ian Lance Taylor <iant@google.com>
1388 * descriptors.cc (Descriptors::close_all): New function.
1389 * descriptors.h (class Descriptors): Declare close_all.
1390 (close_all_descriptors): New inline function.
1391 * plugin.cc: Include "descriptors.h".
1392 (Plugin_manager::cleanup): Call close_all_descriptors.
1394 2013-02-06 Alan Modra <amodra@gmail.com>
1396 * README: Update coding style link.
1398 2013-01-28 Cary Coutant <ccoutant@google.com>
1400 * dwp.cc (File_list): New typedef.
1401 (Dwo_name_info_reader): New class.
1402 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1403 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1404 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1405 (Dwo_file::read_executable): New function.
1406 (Dwo_file::read): Move common setup code to ...
1407 (Dwo_file::make_object): ... here.
1408 (dwp_options): Add --exec/-e.
1412 2013-01-24 Sriraman Tallam <tmsriram@google.com>
1414 * layout.cc (Layout::layout): Check for option text_reorder.
1415 (Layout::make_output_section): Ditto.
1416 * options.h (text_reorder): New option.
1417 * output.cc (Input_section_sort_compare): Remove special ordering
1420 Input_section_sort_section_name_special_ordering_compare::
1421 operator()): New function.
1422 (Output_section::sort_attached_input_sections): Use new sort function
1424 * output.h (Input_section_sort_section_name_special_ordering_compare):
1426 * testsuite/Makefile.am (text_section_grouping): Test option
1428 * testsuite/Makefile.in: Regenerate.
1429 * testsuite/text_section_grouping.sh: Check order of functions without
1430 default text reordering.
1432 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1434 * options.h (General_options): Change default to true for new_dtags.
1436 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1438 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1439 when enable_new_dtags is false. Only add DT_RUNPATH when
1440 enable_new_dtags is true.
1442 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1444 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1445 used in declaration and definition consistent.
1446 (Target_powerpc::symval_for_branch): Ditto.
1448 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1450 * testsuite/plugin_final_layout.cc: Fix comment.
1452 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1454 * layout.cc (Layout::layout): Do not do default sorting for
1455 text sections when section ordering is specified.
1456 (make_output_section): Ditto.
1457 * testsuite/plugin_final_layout.cc: Name the function sections
1458 to catch reordering issues.
1460 2013-01-15 Alan Modra <amodra@gmail.com>
1462 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1465 2013-01-15 Alan Modra <amodra@gmail.com>
1467 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1468 * testsuite/Makefile.in: Regenerate.
1470 2013-01-14 Alan Modra <amodra@gmail.com>
1472 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1473 * testsuite/Makefile.in: Regenerate.
1475 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1478 Fix mingw gold build with plugins enabled
1479 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1480 * configure.ac: Export DLOPEN_LIBS and add headers check.
1481 * plugin.cc: Handle non-dlfcn case.
1482 * Makefile.in: Regenerate.
1483 * config.in: Regenerate.
1484 * configure: Regenerate.
1485 * testsuite/Makefile.in: Regenerate.
1487 2013-01-09 Sriraman Tallam <tmsriram@google.com>
1489 * output.h (sort_attached_input_sections): Change to be public.
1490 * script-sections.cc
1491 (Output_section_definition::set_section_addresses): Sort
1492 attached input sections according to section order before linker
1493 script assigns section addresses.
1494 (Orphan_output_section::set_section_addresses): Sort
1495 attached input sections according to section order before linker
1496 script assigns section addresses.
1497 * Makefile.am (final_layout.sh): Use a simple linker script to
1498 check if section ordering still works.
1499 * Makefile.in: Regenerate.
1501 2013-01-09 Ben Cheng <bccheng@google.com>
1503 * arm.cc (Target_arm::attributes_accept_div): New function.
1504 (Target_arm::attributes_forbid_div): New function.
1505 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1506 attribute using the same new functions as what bfd/elf32_arm.c
1509 2013-01-07 Cary Coutant <ccoutant@google.com>
1512 * output.cc (Output_section::add_input_section): For incremental
1513 updates, don't track input sections that are allocated from patch
1516 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1517 Ian Lance Taylor <iant@google.com>
1520 * configure.ac (--enable-ld): Removed.
1521 (install_as_default): Set to yes only for --enable-gold=default
1523 * configure: Regenerated.
1525 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1527 * options.h (General_options): Add -fuse-ld= for GCC linker
1528 option compatibility.
1530 2013-01-04 Cary Coutant <ccoutant@google.com>
1532 * configure.ac: Fix typo restoring CXXFLAGS.
1533 * configure: Regenerate.
1535 2013-01-04 Cary Coutant <ccoutant@google.com>
1537 * testsuite/Makefile.am (CXXLINK_S): New macro.
1538 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1539 * testsuite/Makefile.in: Regenerate.
1541 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1543 * version.cc (print_version): Update copyright year to 2013.
1545 2012-12-20 Ian Lance Taylor <iant@google.com>
1547 * layout.cc (Layout::special_ordering_of_input_section): New
1549 (Layout::layout): If input section requires special ordering, must
1550 sort input sections.
1551 (Layout::make_output_section): May sort .text input sections.
1552 (Layout::is_section_name_prefix_grouped): Remove.
1553 * layout.h (class Layout): Declare
1554 special_ordering_of_input_section. Don't declare
1555 is_section_name_prefix_grouped.
1556 * output.cc (Output_section::add_input_section): Revert last
1558 (Output_section::Input_section_sort::match_file_name): Don't crash
1559 if called on output section data.
1560 (Output_section::Input_section_sort_compare): Sort based on
1562 (Output_section::Input_section_sort_section_order_index_compare):
1564 (Output_section::sort_attached_input_sections): Likewise.
1566 2012-12-18 Sriraman Tallam <tmsriram@google.com>
1568 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
1569 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1570 * output.cc (Output_section::add_input_section): Check if section
1571 name contains special prefix. Keep input sections to sort such
1573 (Output_section::Input_section_sort_section_order_index_compare
1574 ::operator()): Group sections according to prefixes.
1575 (Output_section::sort_attached_input_sections): Add condition to
1576 Input_section_entry constructor call.
1577 * testsuite/Makefile.am (text_section_grouping): New test.
1578 * testsuite/Makefile.in: Regenerate.
1579 * testsuite/text_section_grouping.cc: New file.
1580 * testsuite/text_section_grouping.sh: New file.
1582 2012-12-17 Nick Clifton <nickc@redhat.com>
1584 * Makefile.am: Add copyright notice.
1587 * configure.ac: Likewise.
1588 * ftruncate.c: Likewise.
1589 * Makefile.in: Regenerate.
1591 2012-12-14 Cary Coutant <ccoutant@google.com>
1593 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1594 --no-as-needed flag.
1595 (exception_separate_shared_12_test): Likewise.
1596 (incremental_copy_test): Likewise.
1597 * testsuite/Makefile.in: Regenerate.
1599 2012-12-14 Cary Coutant <ccoutant@google.com>
1601 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1602 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1604 2012-12-12 Alan Modra <amodra@gmail.com>
1606 * powerpc.cc (class Track_tls): New.
1607 (class Relocate, class Scan): Inherit Track_tls.
1608 (Target_powerpc::Scan::local, global): Track tls optimization
1609 and avoid creating plt entry for __tls_get_addr if all uses
1611 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1613 2012-12-12 Alan Modra <amodra@gmail.com>
1615 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1616 Replace no_toc_optimize with toc_optimize.
1617 * output.h (Output_section::input_sections): Provide non-const variant.
1618 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1619 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1621 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1622 (class Sort_toc_sections): New.
1623 (Target_powerpc::do_finalize_sections): Sort toc sections.
1624 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1626 2012-12-10 Roland McGrath <mcgrathr@google.com>
1628 * testsuite/binary_unittest.cc (read_all): New function.
1629 (Sized_binary_test): Use it instead of ::read.
1630 * fileread.cc (do_read): Don't assume pread always reads the whole
1631 amount in a single call.
1633 2012-12-10 Alan Modra <amodra@gmail.com>
1635 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1636 Set EM_PPC64 or EM_PPC here.
1637 (Target_selector_powerpc::do_recognize): Delete.
1639 2012-12-10 Alan Modra <amodra@gmail.com>
1641 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1643 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1645 2012-12-07 Roland McGrath <mcgrathr@google.com>
1647 * testsuite/binary_unittest.cc (Sized_binary_test):
1648 Use open_descriptor rather than ::open.
1650 2012-12-07 Alan Modra <amodra@gmail.com>
1652 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1653 typedef and invalid_address constant.
1654 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1655 instantiate constants.
1657 2012-12-06 Roland McGrath <mcgrathr@google.com>
1659 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1660 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1661 * aclocal.m4: Regenerate.
1662 * configure: Regenerate.
1663 * Makefile.in: Regenerate.
1664 * testsuite/Makefile.in: Regenerate.
1666 2012-12-07 Alan Modra <amodra@gmail.com>
1668 * options.h (General_options): Add no_toc_optimize.
1669 * powerpc.cc (ok_lo_toc_insn): New function.
1670 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1672 2012-12-06 Alan Modra <amodra@gmail.com>
1674 * options.h (General_options): Add plt_align, plt_static_chain,
1675 plt_thread_safe. Update stub_group_size help text.
1676 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1677 for new plt_thread_safe_ var.
1678 (use_plt_offset): Correct comments.
1679 (Target_powerpc::do_relax): Look for thread creation symbols to
1680 determine default plt_thread_safe value. Clear plt call stubs
1681 as well as branch stubs each iteration.
1682 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1684 (l, hi, ha, write_insn): Move earlier.
1685 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1686 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1688 (Stub_table::update_size): Adjust.
1689 (Stub_table::prev_size, set_prev_size): Delete.
1690 (Stub_table::stub_align): Let --plt-align affect result.
1691 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1692 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1693 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1694 (Stub_table::do_write): Support more stub variants.
1696 2012-12-04 Alan Modra <amodra@gmail.com>
1698 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1699 (Target_powerpc::do_define_standard_symbols): New function.
1701 2012-12-03 Alan Modra <amodra@gmail.com>
1703 * output.h: Formatting, whitespace.
1705 2012-12-03 Alan Modra <amodra@gmail.com>
1707 * layout.h (Layout::get_executable_sections): Declare.
1708 * layout.cc (Layout::get_executable_sections): New function.
1709 * arm.cc (Target_arm::group_sections): Use it.
1710 (Arm_output_section::group_sections): Delete now redundant test.
1711 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1712 param to handle relative relocs.
1713 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1714 (Output_data_reloc::add_absolute): Adjust.
1715 (Output_data_reloc::add_relative): New function.
1716 (Output_data::reset_data_size): New function.
1717 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1718 (Output_section::set_addralign): New function.
1719 (Output_section::checkpoint_set_addralign): New function.
1720 (Output_section::clear_section_offsets_need_adjustment): New function.
1721 (Output_section::input_sections): Make public.
1722 * powerpc.cc (class Output_data_brlt_powerpc): New.
1723 (class Stub_table, class Stub_control): New.
1724 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1725 stub_table_, set_stub_table, stub_table): New vectors and accessor
1727 (Target_powerpc::do_may_relax, do_relax, push_branch,
1728 new_stub_table, stub_tables, brlt_section, group_sections,
1729 add_branch_lookup_table, find_branch_lookup_table,
1730 write_branch_lookup_table, make_brlt_section): New functions.
1731 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1732 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1733 branch_info_): New vars.
1734 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1735 make call stubs here.
1736 (Output_data_glink): Remove all call stub handling from this class.
1737 (Target_powerpc::Scan::local, global): Save interesting branch
1738 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1739 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1740 functions on final link.
1741 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1742 Handle long branch destinations too.
1743 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1744 do_plt_address_for_local): Adjust lookup of plt call stubs.
1746 2012-11-30 Alan Modra <amodra@gmail.com>
1748 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1749 relocs against protected symbols when building 32-bit shared libs.
1751 2012-11-30 Alan Modra <amodra@gmail.com>
1753 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1754 param. Call got_section() to make .got. Update all callers
1755 and their callers and so on.
1757 2012-11-30 Alan Modra <amodra@gmail.com>
1759 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1760 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1761 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1762 value if it already exists.
1764 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1767 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1769 2012-11-14 Roland McGrath <mcgrathr@google.com>
1771 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1772 than bfc instruction for data sandboxing.
1774 2012-11-08 Alan Modra <amodra@gmail.com>
1776 * po/POTFILES.in: Regenerate.
1778 2012-11-05 Alan Modra <amodra@gmail.com>
1780 * configure.ac: Apply 2012-09-10 change to config.in here.
1781 * configure: Regenerate.
1783 2012-11-05 Alan Modra <amodra@gmail.com>
1785 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1786 (struct Opd_ent): Use "Address" rather than "Offset".
1787 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1788 (Target_powerpc::got_section): Make public.
1789 (Target_powerpc::scan_relocs): Move code setting symbols..
1790 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1791 Create _SDA_BASE_ only when referenced.
1793 2012-11-02 Roland McGrath <mcgrathr@google.com>
1795 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1798 2012-11-01 Roland McGrath <mcgrathr@google.com>
1800 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1801 for offset_in_output_section parameter.
1802 (Sized_target::relocate_special_relocatable): Likewise.
1803 * arm.cc (Target_arm::relocate_relocs): Likewise.
1804 (Target_arm::relocate_special_relocatable): Likewise.
1805 * i386.cc (Target_i386::relocate_relocs): Likewise.
1806 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1807 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1808 * target-reloc.h (relocate_relocs): Likewise.
1809 * testsuite/testfile.cc (Target_test): Likewise.
1810 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1811 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1813 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1814 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1816 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1817 parameter, which is unused in the [!F_SETFD] case.
1819 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1820 SYMNDX to off_t before comparing it to this->data_size().
1821 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1822 * incremental.cc (Output_section_incremental_inputs::do_write):
1823 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1825 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1827 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1829 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1830 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1833 2012-10-29 Cary Coutant <ccoutant@google.com>
1835 * dwp.cc (usage): Add file and exit status parameters;
1836 add --help and --version options.
1837 (print_version): New function.
1838 (main): Add --help and --version options.
1840 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1842 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1843 final_layout_sequence.txt.
1844 * testsuite/Makefile.in: Regenerated.
1846 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1848 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1849 COMPILE generated by automake.
1851 (CXXCOMPILE1): Likewise.
1852 (CXXLINK1): Likewise.
1853 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1855 (CXXCOMPILE): Likewise.
1856 (CXXLINK): Likewise.
1857 * testsuite/Makefile.in: Regenerated.
1859 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1861 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1862 on bad fwrite return.
1864 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1866 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1869 2012-10-23 Cary Coutant <ccoutant@google.com>
1871 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1872 * testsuite/Makefile.in: Regenerate.
1873 * testsuite/dwp_test.h: New source file.
1874 * testsuite/dwp_test_1.cc: New source file.
1875 * testsuite/dwp_test_1.s: New source file.
1876 * testsuite/dwp_test_1.sh: New source file.
1877 * testsuite/dwp_test_1b.cc: New source file.
1878 * testsuite/dwp_test_1b.s: New source file.
1879 * testsuite/dwp_test_2.cc: New source file.
1880 * testsuite/dwp_test_2.s: New source file.
1881 * testsuite/dwp_test_2.sh: New source file.
1882 * testsuite/dwp_test_main.cc: New source file.
1883 * testsuite/dwp_test_main.s: New source file.
1885 2012-10-23 Cary Coutant <ccoutant@google.com>
1887 * dwp.h: New header file.
1888 * dwp.cc: New source file.
1889 * gold.h: Move shared declarations to system.h.
1890 * system.h: New header file.
1891 * Makefile.am: Add dwp.
1892 * Makefile.in: Regenerate.
1894 2012-10-23 Cary Coutant <ccoutant@google.com>
1896 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1897 Dwarf_info_reader::read_from_pointer.
1898 (Dwarf_pubnames_table::read_header): Likewise.
1899 (Dwarf_pubnames_table::next_name): Likewise.
1900 (Dwarf_die::read_attributes): Likewise.
1901 (Dwarf_die::skip_attributes): Likewise.
1902 (Dwarf_info_reader::read_from_pointer): New function template.
1903 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1904 (Dwarf_pubnames_table): Likewise.
1905 (Dwarf_info_reader::read_from_pointer): New function template.
1906 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1907 Dwarf_pubnames_table ctor.
1909 2012-10-23 Cary Coutant <ccoutant@google.com>
1911 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1913 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1915 (Dwarf_info_reader::set_abbrev_shndx): New method.
1916 (Dwarf_info_reader::abbrev_shndx_): New data member.
1918 2012-10-23 Cary Coutant <ccoutant@google.com>
1920 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1921 from object, not parameters.
1922 (Dwarf_info_reader::parse): Likewise.
1923 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1924 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1925 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1928 2012-10-23 Cary Coutant <ccoutant@google.com>
1930 * fileread.cc (Input_file::Input_file): New constructor.
1931 * fileread.h (class Input_file): Add new constructor.
1933 2012-10-18 Alan Modra <amodra@gmail.com>
1936 * object.cc (Relobj::is_section_name_included): Also match
1937 .sdata personality section.
1939 2012-10-18 Alan Modra <amodra@gmail.com>
1941 * target-reloc.h (class Default_comdat_behavior): New, package up..
1942 (get_comdat_behaviour): ..this.
1943 (relocate_section): Add Relocate_comdat_behavior template arg,
1944 adjust code to suit.
1945 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1946 (Target_arm::scan_reloc_section): Likewise.
1947 * i386.cc (Target_i386::relocate_section): Likewise.
1948 * sparc.cc (Target_sparc::relocate_section): Likewise.
1949 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1950 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1951 * powerpc.cc (class Relocate_comdat_behavior): New.
1952 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1953 gold::relocate_section with new template arg.
1955 2012-10-18 Alan Modra <amodra@gmail.com>
1957 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1958 dynamic relocs for GOT_TPREL got entries, without symbol if
1960 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1961 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1962 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1964 2012-10-17 Alan Modra <amodra@gmail.com>
1967 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1969 2012-10-16 Sriraman Tallam <tmsriram@google.com>
1971 * layout.cc (Layout::include_section): Keep sections marked
1972 SHF_EXCLUDE when doing relocatable links.
1974 2012-10-16 Alan Modra <amodra@gmail.com>
1976 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1977 (Target_powerpc::do_finalize_sections): Call it.
1978 (Output_data_save_res): New class and supporting functions.
1979 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1980 normal symbols defined in object files.
1982 2012-10-12 Alan Modra <amodra@gmail.com>
1984 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1985 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1986 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1987 section if scan_opd_relocs not yet called.
1988 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1990 2012-10-12 Alan Modra <amodra@gmail.com>
1992 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1993 add_local_ifunc_entry): Revert last change.
1994 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
1996 2012-10-05 Alan Modra <amodra@gmail.com>
1998 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
1999 do_plt_address_for_global): New functions.
2000 (Output_data_got_powerpc::do_write): Don't segfault when linking
2002 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2003 add_local_ifunc_entry): Return true on adding entry..
2004 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2005 glink->add_entry call. Remove unused symtab param. Adjust calls.
2006 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2007 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2008 set up symbols here.
2009 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2010 syms here. Do so even when no .iplt. Don't segfault when linking
2012 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2013 new variants without reloc param.
2014 (Glink_sym_ent::Glink_sym_ent): Likewise.
2015 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2016 reloc when refs will resolve to plt call stub.
2017 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2018 R_PPC_PLTREL24 to resolve locally.
2019 (Target_powerpc::Scan::global): Correct ifunc handling.
2020 (Target_powerpc::Relocate::relocate): Correct local sym glink
2021 lookup. Don't destroy "value" when we have a plt call stub,
2022 and when checking plt call validity.
2023 (Target_powerpc::do_dynsym_value): Simplify.
2025 2012-10-05 Alan Modra <amodra@gmail.com>
2027 * i386.cc (Output_data_plt_i386::address_for_global,
2028 address_for_local): Add plt offset to returned value. Adjust uses.
2029 * sparc.cc (Output_data_plt_sparc::address_for_global,
2030 address_for_local): Likewise.
2031 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2032 address_for_local): Likewise.
2033 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2034 address_for_local): Likewise.
2035 * target.h (Target::plt_address_for_global, plt_address_for_local):
2037 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2038 (Output_data_got::Got_entry::write): Nor here.
2039 * output.h: Comment fix.
2041 2012-10-02 Jiong Wang <jiwang@tilera.com>
2043 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2044 global_offset_table_ value for larget got.
2045 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2047 2012-09-29 Alan Modra <amodra@gmail.com>
2049 * powerpc.cc (Target_powerpc::iplt_): New output section.
2050 (Target_powerpc::iplt_section, make_iplt_section,
2051 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2052 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2053 Target_powerpc::plt_entry_count): Count iplt entries too.
2054 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2055 reloc section in constructor. New params.
2056 (Target_powerpc::make_plt_section): Create reloc section here instead.
2057 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2059 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2060 (Output_data_glink::add_entry, find_entry): New functions to
2061 deal with local syms.
2062 (Glink_sym_ent): Add support for local syms.
2063 (Output_data_glink::do_write): Handle ifunc plt entries.
2064 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2065 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2066 (Target_powerpc::Relocate::relocate): Likewise.
2067 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2069 2012-09-25 Alan Modra <amodra@gmail.com>
2071 * object.h (Sized_relobj_file::adjust_local_symbol,
2072 do_adjust_local_symbol): New functions.
2073 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2074 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2075 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2076 and irregular opd entry spacing.
2077 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2078 (Global_symbol_visitor_opd): New functor.
2079 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2080 on deleted opd entries.
2082 2012-09-15 Jiong Wang <jiwang@tilera.com>
2084 * tilegx.cc: New file.
2085 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2086 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2087 * configure.tgt: Add entries for tilegx*.
2088 * configure.ac: Likewise.
2089 * Makefile.in: Rebuild.
2090 * configure: Likewise.
2091 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2094 2012-09-13 Alan Modra <amodra@gmail.com>
2096 * target-reloc.h (scan_relocs): Call scan.local for relocs
2097 against symbols in discarded sections. Pass is_discarded
2099 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2100 Add is_discarded param.
2101 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2102 is_discarded to flag opd entry as discarded. Don't emit dyn
2103 relocs on such entries.
2104 (Target_powerpc::Scan::global): Similarly detect and handle
2106 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2107 opd_ent_. Update all uses.
2108 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2109 (Target_powerpc::relocate_section): Zero out discarded opd
2112 2012-09-12 Ian Lance Taylor <iant@google.com>
2115 * output.cc: Rename Output_data_got template parameter from size
2116 to got_size for all functions. Compile all variants of
2118 (Output_data_got::Got_entry::write): Correct use of size for
2119 symbol value. Use local_is_tls rather than casting to
2121 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2122 (class Sized_relobj_file): Add do_local_is_tls.
2123 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2125 2012-09-11 Alan Modra <amodra@gmail.com>
2128 * layout.cc (Layout::set_segment_offsets): When using
2129 common-page-size alignment, ensure we are on a new max-page-size
2131 * output.cc (Output_segment::set_section_addresses): Use
2132 abi_pagesize, not common_pagesize for relro boundary.
2133 (Output_segment::set_offset): Likewise.
2135 2012-09-11 Alan Modra <amodra@gmail.com>
2137 * output.h (Output_data_got::add_global_tls, add_local_tls,
2138 add_local_tls_pair): New functions.
2139 (Output_data_got::add_local_pair_with_rel): Remove second
2140 reloc param. Expand comment.
2141 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2142 use_plt_or_tls_offset_, similarly for constructor param.
2143 (Output_data_got::Got_entry::write): Add got_index param.
2144 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2145 add_local_tls_pair): New functions.
2146 (Output_data_got::Got_entry::write): Handle tls symbols
2147 with use_plt_or_tls_offset_ set specially.
2148 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2149 (Output_data_got::do_write): Replace iterator with index, pass
2150 index to entry write function.
2151 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2152 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2153 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2155 * i386.cc (Target_i386::Scan::local): Likewise.
2156 * sparc.cc (Target_sparc::Scan::local): Likewise.
2157 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2158 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2159 do_tls_offset_for_global): New functions.
2160 (Target_powerpc::Scan::local): Correct TLS relocations and got
2162 (Target_powerpc::Scan::global): Don't emit unnecessary
2163 dynamic relocations on TLS GOT entries.
2165 2012-09-10 Matthias Klose <doko@ubuntu.com>
2167 * config.in: Disable sanity check for kfreebsd.
2169 2012-09-10 Sterling Augustine <saugustine@google.com>
2171 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2172 (Gdb_index::pubtypes_read): New parameter.
2173 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2175 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2178 2012-09-09 Alan Modra <amodra@gmail.com>
2180 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2181 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2182 * gc.h (gc_process_relocs): Call target gc_add_reference.
2183 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2184 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2185 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2187 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2188 to cater for when we don't need code offset. Update use.
2189 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2190 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2191 set_opd_valid): New functions.
2192 (Target_powerpc::do_gc_add_reference): New function.
2193 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2195 (Target_powerpc::do_gc_mark_symbol): New function.
2197 2012-09-06 Cary Coutant <ccoutant@google.com>
2199 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2200 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2201 (Dwarf_die::skip_attributes): Likewise.
2202 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2203 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2205 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2207 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2209 * testsuite/script_test_3.t: Add .got.plt output section
2211 * testsuite/script_test_4.t: Likewise.
2213 2012-09-05 Alan Modra <amodra@gmail.com>
2215 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2216 update all uses and lose "enum" when using type.
2218 2012-09-05 Alan Modra <amodra@gmail.com>
2220 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2221 * configure: Regenerate.
2222 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2223 (plugin_final_layout.stdout): Likewise.
2224 (memory_test): Set page sizes to 0x1000.
2225 * testsuite/Makefile.in: Regenerate.
2226 * testsuite/discard_locals_test.sh: Add FIXME comment.
2227 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2228 * testsuite/pr14265.t: Add .got output section statement.
2229 * testsuite/script_test_2.t: Likewise.
2230 * testsuite/script_test_3.t: Likewise.
2231 * testsuite/script_test_4.t: Likewise.
2232 * testsuite/script_test_5.t: Likewise.
2233 * testsuite/script_test_6.t: Likewise.
2234 * testsuite/script_test_7.t: Likewise.
2235 * testsuite/script_test_9.t: Likewise.
2237 2012-09-05 Alan Modra <amodra@gmail.com>
2239 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2240 (Powerpc_relocate_functions::Status): New typedef.
2241 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2242 (Target_powerpc::Scan::local): Handle REL64.
2243 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2244 for REL32 and REL64.
2245 (Target_powerpc::symval_for_branch): New function, extracted from..
2246 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2247 checks. Report overflow errors.
2249 2012-09-05 Alan Modra <amodra@gmail.com>
2251 * object.h (Sized_relobj_file::emit_relocs): Delete.
2252 (Sized_relobj_file::emit_relocs_reltype): Delete.
2253 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2254 relocate_relocs for --emit-relocs.
2255 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2256 * output.h: Update comment.
2257 (Output_segment::first_section): New function.
2258 (Output_segment::first_section_load_address): Use first_section.
2259 * output.cc (Output_segment::first_section): New function extracted..
2260 (Output_segment::first_section_load_address): ..from here. Delete.
2261 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2262 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2263 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2264 adjust call to target.h function.
2265 * i386.cc (Target_i386): Likewise.
2266 * sparc.cc (Target_sparc): Likewise.
2267 * x86_64.cc (Target_x86_64): Likewise.
2268 * powerpc.cc (Target_powerpc): Likewise.
2269 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2270 first tls section has section symbol for optimised local dynamic
2272 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2273 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2275 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2276 Rename to relocate_relocs. Update error message.
2278 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2280 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2283 2012-08-31 Alan Modra <amodra@gmail.com>
2285 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2286 (Powerpc_relobj::toc_base_offset): New stub function.
2287 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2288 got_mod_index_offset to tlsld_got_offset. Update all refs.
2289 (Target_powerpc::Relocate::enum skip_tls): New.
2290 (Target_powerpc::call_tls_get_addr_): New var.
2291 (Target_powerpc::is_branch_reloc): Move to file scope.
2292 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2293 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2295 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2296 (powerpc_info): Correct common_pagesize for ppc64.
2297 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2298 (Powerpc_relocate_functions): Add overflow check enums and functions.
2299 Add non-shift version of rela, rela_ua. Delete all rel public
2300 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2301 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2302 addr16_ha3, addr14 functions.
2303 (Output_data_got_powerpc::add_constant_pair): New function.
2304 (Output_data_got_powerpc::got_base_offset): Likewise.
2305 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2306 (instruction constants): Sort, add some more.
2307 (Output_data_glink::do_write): Add and use Address typedef. Use
2308 object->toc_base_offset() stub for 64-bit.
2309 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2310 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2311 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2312 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2313 Always treat .opd relocs as against locally defined symbol.
2314 Correct condition for RELATIVE relocs.
2315 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2316 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2317 for 32-bit syms with a plt entry. Correct ppc64 toc base
2318 calculations. Handle TLS relocs, and more. Add overflow
2319 checking and adjust for Powerpc_relocate_functions changes.
2320 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2321 Reinstate --emit-relocs code with FIXME.
2323 2012-08-30 Alan Modra <amodra@gmail.com>
2325 * layout.cc (Layout::set_segment_offsets): Set p_align to
2326 abi_pagesize, not common_pagesize.
2327 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2328 to determine whether file header can go in segment.
2330 2012-08-30 Alan Modra <amodra@gmail.com>
2332 * output.h (Output_reloc::Output_reloc <output section>): Add
2333 is_relative param. Adjust calls.
2334 (Output_reloc::add_output_section_relative): New functions.
2335 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2337 (Output_reloc::symbol_value): Handle SECTION_CODE.
2339 2012-08-24 Sriraman Tallam <tmsriram@google.com>
2341 * gold.cc (queue_middle_tasks): Call layout again when unique
2342 segments for sections is desired.
2343 * layout.cc (Layout::Layout): Initialize new members.
2344 (Layout::get_output_section_flags): New function.
2345 (Layout::choose_output_section): Call get_output_section_flags.
2346 (Layout::layout): Make output section for mapping to a unique segment.
2347 (Layout::insert_section_segment_map): New function.
2348 (Layout::attach_allocated_section_to_segment): Make unique segment for
2349 output sections marked so.
2350 (Layout::segment_precedes): Check for unique segments when sorting.
2351 * layout.h (Layout::Unique_segment_info): New struct.
2352 (Layout::Section_segment_map): New typedef.
2353 (Layout::insert_section_segment_map): New function.
2354 (Layout::get_output_section_flags): New function.
2355 (Layout::is_unique_segment_for_sections_specified): New function.
2356 (Layout::set_unique_segment_for_sections_specified): New function.
2357 (Layout::unique_segment_for_sections_specified_): New member.
2358 (Layout::section_segment_map_): New member.
2359 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2360 Rename is_gc_pass_one to is_pass_one.
2361 Rename is_gc_pass_two to is_pass_two.
2362 Rename is_gc_or_icf to is_two_pass.
2363 Check for which pass based on whether symbols data is present.
2364 Make it two pass when unique segments for sections is desired.
2365 * output.cc (Output_section::Output_section): Initialize new
2367 * output.h (Output_section::is_unique_segment): New function.
2368 (Output_section::set_is_unique_segment): New function.
2369 (Output_section::is_unique_segment_): New member.
2370 (Output_section::extra_segment_flags): New function.
2371 (Output_section::set_extra_segment_flags): New function.
2372 (Output_section::extra_segment_flags_): New member.
2373 (Output_section::segment_alignment): New function.
2374 (Output_section::set_segment_alignment): New function.
2375 (Output_section::segment_alignment_): New member.
2376 (Output_segment::Output_segment): Initialize is_unique_segment_.
2377 (Output_segment::is_unique_segment): New function.
2378 (Output_segment::set_is_unique_segment): New function.
2379 (Output_segment::is_unique_segment_): New member.
2380 * plugin.cc (allow_unique_segment_for_sections): New function.
2381 (unique_segment_for_sections): New function.
2382 (Plugin::load): Add new functions to transfer vector.
2383 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2384 * Makefile.in: Regenerate.
2385 * testsuite/plugin_final_layout.sh: Check if unique segment
2386 functionality works.
2387 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2389 (allow_unique_segment_for_sections): New global.
2390 (unique_segment_for_sections): New global.
2391 (claim_file_hook): Call allow_unique_segment_for_sections.
2392 (all_symbols_read_hook): Call unique_segment_for_sections.
2394 2012-08-22 Cary Coutant <ccoutant@google.com>
2396 * layout.cc (Layout::include_section): Don't assert on GROUP
2397 sections with --emit-relocs.
2399 2012-08-21 Cary Coutant <ccoutant@google.com>
2401 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2402 if --export-dynamic-symbol names an undef symbol.
2404 2012-08-18 Alan Modra <amodra@gmail.com>
2406 * powerpc.cc: Formatting and white space.
2407 (Powerpc_relobj): Rename got2_section_ to special_.
2408 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2409 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2410 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2411 (Target_powerpc): Add Address typedef and invalid_address. Use
2413 (Target_powerpc::is_branch_reloc): New function.
2414 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2415 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2416 for dst_mask, value and addend.
2417 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2418 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2419 (Output_data_glink::do_write): Correct toc base. Don't try to use
2420 uint16_t for 24-bit offset. Use get_output_section_offset and
2422 (Target_powerpc::Scan::local): Handle more relocs.
2423 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2424 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2425 Plug in toc restoring insn after plt calls. Translate branches
2426 to function descriptor symbols to corresponding entry point.
2427 (Target_powerpc::relocate_for_relocatable): Check return from
2428 get_output_section_offset.
2429 * symtab.h: Comment typo.
2431 2012-08-14 Ian Lance Taylor <iant@google.com>
2433 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2434 unsupported_relocal_local to call unsupported_reloc_global.
2436 2012-08-14 Nick Clifton <nickc@redhat.com>
2439 * script-sections.cc (Sections_element::output_section_name): Add
2440 keep return parameter.
2441 (Output_section_element::match_name): Add keep return parameter.
2442 Return the value of the keep_ member.
2443 * script-sections.h (class Output_section): Update
2444 output_section_name prototype.
2445 * layout.cc (Layout::keep_input_section): New public member
2447 (Layout::choose_output_section): Pass keep parameter to
2448 output_section_name.
2449 * layout.h (class Layout): Add keep_input_section.
2450 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2452 * testsuite/Makefile.am: Add a test.
2453 * testsuite/Makefile.in: Regenerate.
2454 * testsuite/pr14265.c: Source file for the test.
2455 * testsuite/pr14265.t: Linker script for the test.
2456 * testsuite/pr14265.sh: Shell script for the test.
2458 2012-08-14 Alan Modra <amodra@gmail.com>
2460 * target.h (Target::output_section_name): New function.
2461 (Target::do_output_section_name): New function.
2462 * layout.cc (Layout::choose_output_section): Call the above.
2463 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2465 2012-08-14 Alan Modra <amodra@gmail.com>
2467 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2468 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2469 for replace_constant call.
2470 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2471 (Output_data_glink::do_print_to_mapfile): New function.
2472 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2473 (Target_powerpc::Relocate::relocate): Likewise.
2475 2012-08-14 Alan Modra <amodra@gmail.com>
2477 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2478 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2479 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2480 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2481 all references to shndx_. Handle special case for R_PPC_PLTREL24
2483 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2484 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2485 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2487 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2488 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2490 2012-08-12 Alan Modra <amodra@gmail.com>
2492 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2493 (glink insn constants): Use uint32_t.
2494 (Output_data_glink::add_entry): Use insert, not [] operator.
2496 2012-08-11 Alan Modra <amodra@gmail.com>
2498 * object.h (Sized_relobj_file::find_shdr): New function.
2499 (Sized_relobj_file::find_special_sections): New function.
2500 * object.cc (Sized_relobj_file::find_shdr): New function.
2501 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2502 (Sized_relobj_file::find_special_sections): New function, split out..
2503 (Sized_relobj_file::do_read_symbols): ..from here.
2504 * output.h (Output_data_got::replace_constant): New function.
2505 (Output_data_got::num_entries): New function.
2506 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2507 (Output_data_got::got_offset): Protected rather than private.
2508 (Output_data_got::replace_got_entry): New function.
2509 * output.cc (Output_data_got::replace_got_entry): New function.
2510 * powerpc.cc (class Powerpc_relobj): New.
2511 (class Powerpc_relocate_functions): Delete all psymval variants or
2512 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2513 Implement _ha functions using corresponding _hi function.
2514 (Powerpc_relobj::find_special_sections): New function.
2515 (Target_powerpc::do_make_elf_object): New function.
2516 (class Output_data_got_powerpc): New.
2517 (class Output_data_glink): New.
2518 (class Powerpc_scan_relocatable_reloc): New.
2519 Many more changes througout file.
2521 2012-08-09 Nick Clifton <nickc@redhat.com>
2523 * po/vi.po: Updated Vietnamese translation.
2525 2012-08-07 Ian Lance Taylor <iant@google.com>
2527 * layout.cc (Layout::add_target_dynamic_tags): If
2528 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2531 2012-07-30 Nick Clifton <nickc@redhat.com>
2533 * po/gold.pot: Updated template.
2534 * po/es.po: Updated Spanish translation.
2536 2012-07-18 Cary Coutant <ccoutant@google.com>
2539 * configure.ac: Add check for -gpubnames support.
2540 * configure: Regenerate.
2541 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2542 support; force -gno-pubnames.
2543 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2545 (gdb_index_test_4): New test.
2546 * testsuite/Makefile.in: Regenerate.
2547 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2548 * testsuite/gdb_index_test_2.sh: Likewise.
2549 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2550 * testsuite/gdb_index_test_4.sh: New script.
2551 * testsuite/gdb_index_test_comm.sh: New script with common code;
2552 don't look for space after colon.
2554 2012-07-16 Sriraman Tallam <tmsriram@google.com>
2556 * gold.cc (queue_middle_tasks): Update function order only after
2557 deferred objects due to plugins are processed.
2559 2012-07-11 Ian Lance Taylor <iant@google.com>
2561 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2562 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2563 (Target_arm::scan_reloc_for_stub): Likewise.
2564 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2565 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2566 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2567 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2568 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2570 2012-07-10 Dodji Seketeli <dodji@redhat.com>
2571 Ian Lance Taylor <iant@google.com>
2574 * configure.ac: Test whether std::tr1::hash<off_t> works.
2575 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2577 * output.h (class Output_fill): Add virtual destructor.
2578 * configure, config.in: Rebuild.
2580 2012-06-22 Roland McGrath <mcgrathr@google.com>
2582 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2584 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2586 * plugin.cc (Plugin::load): Handle position independent executables.
2588 2012-06-06 Cary Coutant <ccoutant@google.com>
2590 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2592 (lines_only_debug_sections): Likewise.
2593 (gdb_fast_lookup_sections): New static array.
2594 (is_gdb_debug_section): Rename formal parameter.
2595 (is_lines_only_debug_section): Likewise.
2596 (is_gdb_fast_lookup_section): New function.
2597 (Layout::include_section): Check for ".zdebug_" prefix; pass
2598 section name suffix to is_gdb_debug_section, et al.; check for
2599 fast-lookup sections when building .gdb_index.
2600 * options.h (--strip-debug-gdb): Update GDB version number.
2602 2012-06-06 Cary Coutant <ccoutant@google.com>
2604 * configure.ac: Add check for fallocate.
2605 * configure: Regenerate.
2606 * config.in: Regenerate.
2608 * options.h (class General_options): Add --mmap-output-file and
2609 --posix-fallocate options.
2610 * output.cc: (posix_fallocate): Remove; replace with...
2611 (gold_fallocate): New function.
2612 (Output_file::map_no_anonymous): Call gold_fallocate.
2613 (Output_file::map): Check --mmap-output-file option.
2615 2012-06-05 Jing Yu <jingyu@google.com>
2617 * gold.h (textdomain): Add do {} to empty while(0).
2618 (bindtextdomain): Likewise.
2620 2012-06-04 Cary Coutant <ccoutant@google.com>
2622 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2625 2012-05-25 Sriraman Tallam <tmsriram@google.com>
2627 * symtab.cc (Symbol_table::define_special_symbol):
2628 Initialize *poldsym to prevent uninitialized variable errors.
2630 2012-05-23 Cary Coutant <ccoutant@google.com>
2632 * layout.cc (Layout::section_name_mapping): Add rules to handle
2633 exact match on .data.rel.ro.local or .data.rel.ro.
2634 (Layout::output_section_name): Check for exact matches.
2636 2012-05-23 Cary Coutant <ccoutant@google.com>
2638 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2641 2012-05-22 Cary Coutant <ccoutant@google.com>
2643 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2644 object before exporting symbol.
2646 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2648 * testsuite/tls_test.cc: Include "config.h" first.
2649 * testsuite/tls_test_c.c: Likewise.
2651 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
2652 Nick Clifton <nickc@redhat.com>
2655 * configure.in: Add check that sysdep.h has been included before
2656 any system header files.
2657 * configure: Regenerate.
2658 * config.in: Regenerate.
2660 2012-05-14 Cary Coutant <ccoutant@google.com>
2662 * layout.cc (Layout::make_output_section): Mark .tdata section
2664 * testsuite/relro_test.cc: Add a TLS variable.
2666 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2669 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2670 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2673 2012-05-08 Cary Coutant <ccoutant@google.com>
2675 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2676 (lines_only_debug_sections): Likewise.
2678 2012-05-02 Roland McGrath <mcgrathr@google.com>
2680 * nacl.cc: New file.
2682 * Makefile.am (CCFILES, HFILES): Add them.
2683 * Makefile.in: Regenerate.
2684 * i386.cc (Output_data_plt_i386_nacl): New class.
2685 (Output_data_plt_i386_nacl_exec): New class.
2686 (Output_data_plt_i386_nacl_dyn): New class.
2687 (Target_i386_nacl): New class.
2688 (Target_selector_i386_nacl): New class.
2689 (target_selector_i386): Use it instead of Target_selector_i386.
2690 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2691 (Target_x86_64_nacl): New class.
2692 (Target_selector_x86_64_nacl): New class.
2693 (target_selector_x86_64, target_selector_x32): Use it instead of
2694 Target_selector_x86_64.
2695 * arm.cc (Output_data_plt_arm_nacl): New class.
2696 (Target_arm_nacl): New class.
2697 (Target_selector_arm_nacl): New class.
2698 (target_selector_arm, target_selector_armbe): Use it instead of
2699 Target_selector_arm.
2701 * target-select.cc (select_target): Take new Input_file* and off_t
2702 arguments, pass them on to recognize method of selector.
2703 * object.cc (make_elf_sized_object): Update caller.
2704 * parameters.cc (parameters_force_valid_target): Likewise.
2705 * incremental.cc (make_sized_incremental_binary): Likewise.
2706 * target-select.h: Update decl.
2707 (Target_selector::recognize): Take new Input_file* argument,
2708 pass it on to do_recognize.
2709 (Target_selector::do_recognize): Take new Input_file* argument.
2710 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2711 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2712 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2713 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2715 * target.h (Target::Target_info): New members isolate_execinstr
2717 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2718 * arm.cc (Target_arm::arm_info): Update initializer.
2719 * i386.cc (Target_i386::i386_info): Likewise.
2720 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2721 * sparc.cc (Target_sparc::sparc_info): Likewise.
2722 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2723 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2724 * layout.cc (Layout::attach_allocated_section_to_segment):
2725 Take new const Target* argument. If target->isolate_execinstr(), act
2727 (Layout::find_first_load_seg): Take new const Target* argument;
2728 if target->isolate_execinstr(), reject PF_X segments.
2729 (Layout::relaxation_loop_body): Update caller.
2730 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2731 reset file offset to zero when we hit LOAD_SEG, and then do a second
2732 loop over the segments before LOAD_SEG to reassign offsets after
2733 addresses have been determined. Handle target->rosegment_gap().
2734 (Layout::attach_section_to_segment): Take new const Target* argument;
2735 pass it to attach_allocated_section_to_segment.
2736 (Layout::make_output_section): Update caller.
2737 (Layout::attach_sections_to_segments): Take new const Target* argument;
2738 pass it to attach_section_to_segment.
2739 * gold.cc (queue_middle_tasks): Update caller.
2740 * layout.h (Layout): Update method decls with new arguments.
2742 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2743 Target_info pointer to use.
2744 (Target_arm::do_make_data_plt): New virtual method.
2745 (Target_arm::make_data_plt): New method that calls it.
2746 (Target_arm::make_plt_entry): Use it.
2747 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2748 for the section alignment.
2749 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2751 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2752 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2754 (Output_data_plt_arm::get_plt_entry_size): Call it.
2755 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2756 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2757 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2759 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2760 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2761 method instead of sizeof(plt_entry).
2762 (Output_data_plt_arm::add_entry): Likewise.
2763 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2764 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2766 (Target_arm::plt_entry_size): Likewise.
2767 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2769 (Output_data_plt_arm_standard): ... here, new class.
2770 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2771 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2772 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2774 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2775 Take additional argument for the PLT entry size.
2776 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2777 Use get_plt_entry_size method rather than plt_entry_size variable.
2778 (Output_data_plt_x86_64::reserve_slot): Likewise.
2779 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2780 (Output_data_plt_x86_64::add_entry): Likewise.
2781 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2782 (Output_data_plt_x86_64::address_for_global): Likewise.
2783 (Output_data_plt_x86_64::address_for_local): Likewise.
2784 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2785 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2786 Make method non-static.
2787 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2789 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2790 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2791 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2792 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2794 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2795 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2797 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2798 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2800 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2801 (Output_data_plt_x86_64::plt_entry_size)
2802 (Output_data_plt_x86_64::first_plt_entry)
2803 (Output_data_plt_x86_64::plt_entry)
2804 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2805 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2806 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2807 (Output_data_plt_x86_64_standard): ... here, new class.
2808 (Target_x86_64::Target_x86_64): Take optional argument for the
2809 Target_info pointer to use.
2810 (Target_x86_64::do_make_data_plt): New virtual method.
2811 (Target_x86_64::make_data_plt): New method to call it.
2812 (Target_x86_64::init_got_plt_for_update): Use that.
2813 Call this->plt_->add_eh_frame method here.
2814 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2815 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2816 rather than static method.
2817 (Target_x86_64::plt_entry_size): Likewise.
2818 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2819 rather than plt_entry_size variable. Move guts of PLT filling to...
2820 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2821 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2822 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2824 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2825 additional argument for the section alignment.
2826 Don't do add_eh_frame_for_plt here.
2827 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2828 non-static. Use get_plt_entry_size method rather than plt_entry_size
2830 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2832 (Output_data_plt_i386::get_plt_entry_size): Call it.
2833 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2834 (Output_data_plt_i386::add_eh_frame): New method to call it.
2835 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2837 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2838 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2840 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2841 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2842 method instead of plt_entry_size.
2843 (Output_data_plt_i386::plt_entry_size)
2844 (Output_data_plt_i386::plt_eh_frame_fde_size)
2845 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2846 (Output_data_plt_i386_standard): ... here, new class.
2847 (Output_data_plt_i386_exec): New class.
2848 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2849 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2850 (Output_data_plt_i386::exec_plt_entry): Move to ...
2851 (Output_data_plt_i386_exec::plt_entry): ... here.
2852 (Output_data_plt_i386_dyn): New class.
2853 (Output_data_plt_i386::first_plt_entry): Move to ...
2854 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2855 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2856 (Output_data_plt_i386_dyn::plt_entry): ... here.
2857 (Target_i386::Target_i386): Take optional argument for the Target_info
2859 (Target_i386::do_make_data_plt): New virtual method.
2860 (Target_i386::make_data_plt): New method to call it.
2861 (Target_i386::make_plt_section): Use that.
2862 Call this->plt_->add_eh_frame method here.
2863 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2864 rather than plt_entry_size variable.
2865 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2866 (Output_data_plt_i386::address_for_local): Likewise.
2867 (Output_data_plt_i386::do_write): Likewise.
2868 Move guts of PLT filling to...
2869 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2870 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2871 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2872 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2874 2012-05-01 Cary Coutant <ccoutant@google.com>
2876 * dwarf_reader.cc (Dwarf_die::read_attributes)
2877 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2878 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2879 * reduced_debug_output.cc
2880 (Output_reduced_debug_info_section::get_die_end): Remove
2881 DW_FORM_GNU_ref_index. Add default case.
2883 2012-04-26 Mark Wielaard <mjw@redhat.com>
2885 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2886 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2887 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2888 DW_AT_high_pc as offset from DW_AT_low_pc.
2890 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2891 * testsuite/Makefile.in: Regenerate.
2892 * testsuite/gdb_index_test_3.c: New test source file.
2893 * testsuite/gdb_index_test_3.sh: New test source file.
2895 2012-04-25 Ian Lance Taylor <iant@google.com>
2897 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2899 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2900 as a class, not a struct.
2901 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2902 (Target_arm::apply_cortex_a8_workaround): Likewise.
2903 * gc.h: Declare Reloc_types as a struct, not a class.
2904 * object.h: Declare Symbols_data as a struct.
2905 * reloc.h: Declare Read_relocs_data as a struct.
2906 * target.h: Declare Relocate_info as a struct.
2908 2012-04-24 David S. Miller <davem@davemloft.net>
2910 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2911 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2914 2012-04-24 Cary Coutant <ccoutant@google.com>
2916 * incremental-dump.cc (find_input_containing_global): Replace
2917 magic number with symbolic constant.
2918 (dump_incremental_inputs): Update version number.
2919 * incremental.cc (Output_section_incremental_inputs): Update version
2920 number; import symbolic constants from Incremental_inputs_reader.
2921 (Incremental_inputs::create_data_sections): Align relocations
2922 section correctly for 64-bit targets.
2923 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2924 constants; add padding.
2925 (Output_section_incremental_inputs::write_header): Add assert for
2927 (Output_section_incremental_inputs::write_input_files): Add assert
2928 for input_entry_size.
2929 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2930 add assert for object_info_size, input_section_entry_size,
2931 global_sym_entry_size.
2932 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2933 for data structure sizes; use them.
2934 (Incremental_input_entry_reader): Import symbolic constants from
2935 Incremental_inputs_reader; use them.
2937 2012-04-23 David S. Miller <davem@davemloft.net>
2939 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2941 (Target_sparc::Target_sparc): Initialize new fields.
2942 (Target_sparc::do_make_elf_object): New function.
2943 (Target_sparc::do_adjust_elf_header): New function.
2945 2012-04-23 Cary Coutant <ccoutant@google.com>
2947 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2948 CU range table of gdb index.
2950 2012-04-20 David S. Miller <davem@davemloft.net>
2952 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2955 2012-04-16 David S. Miller <davem@davemloft.net>
2957 * sparc.cc (Target_sparc::got_address): New function.
2958 (Sparc_relocate_functions::gdop_hix22): New function.
2959 (Sparc_relocate_functions::gdop_lox10): New function.
2960 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2962 (Target_sparc::Scan::local): Likewise if the global symbol is not
2963 preemptible and is not IFUNC.
2964 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2965 transformations for local and non-preemptible non-IFUNC global
2968 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2969 writing out 64-bit part of ranges.
2971 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2972 -fpic and -fpie respectively.
2973 * Makefile.in: Regenerate.
2975 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2976 (Target_sparc::Target_sparc): Initialize new field.
2977 (Target_sparc::do_plt_section_for_global): New function.
2978 (Target_sparc::do_plt_section_for_local): New function.
2979 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2980 (Target_sparc::make_plt_section): New function, broken out of
2981 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2982 (Target_sparc::make_plt_entry): Call make_plt_section.
2983 (Target_sparc::make_local_ifunc_plt_entry): New function.
2984 (Target_sparc::rela_ifunc_section): New function.
2985 (Target_sparc::plt_section): Remove const.
2986 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2987 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2988 and ifunc_count_ fields.
2989 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2990 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2991 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2992 (Output_data_plt_sparc::rela_ifunc): New function.
2993 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2994 (Output_data_plt_sparc::has_ifunc_section): New function.
2995 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
2996 (Output_data_plt_sparc::address_for_global): New function.
2997 (Output_data_plt_sparc::address_for_local): New function.
2998 (Output_data_plt_sparc::plt_index_to_offset): New function.
2999 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3001 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3003 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3004 R_SPARC_JMP_IREL to switch.
3005 (Target_sparc::Scan::check_non_pic): Likewise.
3006 (Target_sparc::Scan::local): Handle IFUNC symbols.
3007 (Target_sparc::Scan::local): Likewise.
3008 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3009 and plt_address_for_local.
3010 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3011 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3013 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3014 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3015 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3016 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3018 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3019 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3021 * sparc.cc (Target_sparc::Scan::global): Likewise.
3022 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3024 2012-04-16 Cary Coutant <ccoutant@google.com>
3026 * archive.cc (Library_base::should_include_member): Check for
3027 --export-dynamic-symbol.
3028 * options.h (class General_options): Add --export-dynamic-symbol.
3029 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3030 --export-dynamic-symbol.
3031 (Symbol_table::gc_mark_undef_symbols): Likewise.
3032 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3034 2012-04-12 David S. Miller <davem@davemloft.net>
3036 * sparc.cc (Reloc::wdisp10): New relocation method.
3037 (Reloc::h34): Likewise.
3038 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3039 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3041 (Target_sparc::Scan::local): Likewise.
3042 (Target_sparc::Scan::global): Likewise.
3043 (Target_sparc::Relocate::relocate): Likewise.
3045 2012-04-09 Cary Coutant <ccoutant@google.com>
3047 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3050 2012-04-06 Ian Lance Taylor <iant@google.com>
3052 * timer.cc: #include <unistd.h>.
3054 2012-04-06 Roland McGrath <mcgrathr@google.com>
3056 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3057 * config.in: Regenerate.
3058 * configure: Regenerate.
3060 2012-04-05 Nick Clifton <nickc@redhat.com>
3062 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3063 (AM_LC_MESSAGES): Add.
3064 * aclocal.m4: Regenerate.
3065 * config.in: Regenerate.
3066 * configure: Regenerate.
3068 2012-03-21 Cary Coutant <ccoutant@google.com>
3070 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3071 * Makefile.in: Regenerate.
3072 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3073 (Sized_elf_reloc_mapper::symbol_section): New function.
3074 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3075 (make_elf_reloc_mapper): New function.
3076 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3077 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3078 (Dwarf_abbrev_table::do_get_abbrev): New function.
3079 (Dwarf_ranges_table::read_ranges_table): New function.
3080 (Dwarf_ranges_table::read_range_list): New function.
3081 (Dwarf_pubnames_table::read_section): New function.
3082 (Dwarf_pubnames_table::read_header): New function.
3083 (Dwarf_pubnames_table::next_name): New function.
3084 (Dwarf_die::Dwarf_die): New function.
3085 (Dwarf_die::read_attributes): New function.
3086 (Dwarf_die::skip_attributes): New function.
3087 (Dwarf_die::set_name): New function.
3088 (Dwarf_die::set_linkage_name): New function.
3089 (Dwarf_die::attribute): New function.
3090 (Dwarf_die::string_attribute): New function.
3091 (Dwarf_die::int_attribute): New function.
3092 (Dwarf_die::uint_attribute): New function.
3093 (Dwarf_die::ref_attribute): New function.
3094 (Dwarf_die::child_offset): New function.
3095 (Dwarf_die::sibling_offset): New function.
3096 (Dwarf_info_reader::check_buffer): New function.
3097 (Dwarf_info_reader::parse): New function.
3098 (Dwarf_info_reader::do_parse): New function.
3099 (Dwarf_info_reader::do_read_string_table): New function.
3100 (Dwarf_info_reader::lookup_reloc): New function.
3101 (Dwarf_info_reader::get_string): New function.
3102 (Dwarf_info_reader::visit_compilation_unit): New function.
3103 (Dwarf_info_reader::visit_type_unit): New function.
3104 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3105 Sized_elf_reloc_mapper.
3106 (Sized_dwarf_line_info::symbol_section): Remove function.
3107 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3108 (Sized_dwarf_line_info::read_line_mappings): Remove object
3109 parameter, adjust callers.
3110 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3111 * dwarf_reader.h: Include <sys/types.h>.
3112 (class Track_relocs): Remove forward declaration.
3113 (class Elf_reloc_mapper): New class.
3114 (class Sized_elf_reloc_mapper): New class.
3115 (class Dwarf_abbrev_table): New class.
3116 (class Dwarf_range_list): New class.
3117 (class Dwarf_ranges_table): New class.
3118 (class Dwarf_pubnames_table): New class.
3119 (class Dwarf_die): New class.
3120 (class Dwarf_info_reader): New class.
3121 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3122 (Sized_dwarf_line_info::symbol_section): Remove member function.
3123 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3125 * gdb-index.cc: New source file.
3126 * gdb-index.h: New source file.
3127 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3128 and .debug_types sections, call Layout::add_to_gdb_index.
3129 (Sized_relobj_incr::do_section_name): Implement.
3130 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3131 return type; Implement.
3132 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3134 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3135 parameter list and return type.
3136 (Sized_incr_dynobj::do_section_contents): Likewise.
3137 * layout.cc: Include gdb-index.h.
3138 (Layout::Layout): Initialize gdb_index_data_.
3139 (Layout::init_fixed_output_section): Check for .gdb_index section.
3140 (Layout::add_to_gdb_index): New function. Instantiate.
3141 * layout.h: Add forward declaration for class Gdb_index.
3142 (Layout::add_to_gdb_index): New member function.
3143 (Layout::gdb_index_data_): New data member.
3144 * main.cc: Include gdb-index.h.
3145 (main): Print statistics for gdb index.
3146 * object.cc (Object::section_contents): Move code into
3147 do_section_contents.
3148 (need_decompressed_section): Check for sections needed when building
3150 (build_compressed_section_map): Likewise.
3151 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3153 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3154 sections; call Layout::add_to_gdb_index.
3155 (Sized_relobj_file::do_decompressed_section_contents): Call
3156 do_section_contents directly.
3157 * object.h (Object::do_section_contents): Adjust parameter list and
3159 (Object::do_decompressed_section_contents): Call do_section_contents
3161 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3163 * options.h (class General_options): Add --gdb-index option.
3164 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3165 list and return type.
3166 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3167 * reloc.h (Track_relocs::checkpoint): New function.
3168 (Track_relocs::reset): New function.
3170 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3172 * testsuite/Makefile.in: Regenerate.
3173 * testsuite/gdb_index_test.cc: New test source file.
3174 * testsuite/gdb_index_test_1.sh: New test source file.
3175 * testsuite/gdb_index_test_2.sh: New test source file.
3177 2012-03-19 Doug Kwan <dougkwan@google.com>
3179 * arm.cc (Target_arm::do_define_standard_symbols): New method.
3180 (Target_arm::do_finalize_sections): Remove code which defines
3181 __exidx_start and __exidx_end. Make symbol table parameter
3182 anonymous as it is not used.
3183 * gold.cc (queue_middle_tasks): Call target hook to define any
3184 target-specific symbols.
3185 * target.h (Target::define_standard_symbols): New method.
3186 (Target::do_define_standard_symbols): Same.
3187 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3188 * testsuite/Makefile.in: Regenerate.
3189 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3191 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3192 relocations are generated for __exidx_start and __exidx_end.
3194 2012-03-16 Doug Kwan <dougkwan@google.com>
3196 * testsuite/Makefile.am: Disable test initpri3b.
3197 * testsuite/Makefile.in: Regenerate.
3199 2012-03-15 Doug Kwan <dougkwan@google.com>
3201 * arm.cc (Target_arm::got_section): Make .got section read-only
3204 2012-03-15 Ian Lance Taylor <iant@google.com>
3207 * layout.cc (Layout::make_output_section): Correctly mark
3208 SHT_INIT_ARRAY, et. al., as relro.
3210 2012-03-14 Doug Kwan <dougkwan@google.com>
3212 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3213 dynamic relocations for protected symbols in shared objects.
3215 2012-03-13 Ian Lance Taylor <iant@google.com>
3217 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3218 keep the larger alignment.
3220 2012-03-12 Cary Coutant <ccoutant@google.com>
3222 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3223 handling of DW_LNE_define_file.
3225 2012-03-12 Cary Coutant <ccoutant@google.com>
3227 * reduced_debug_output.cc
3228 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3231 2012-02-29 Cary Coutant <ccoutant@google.com>
3233 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3235 2012-02-29 Cary Coutant <ccoutant@google.com>
3237 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3238 Call Object::decompressed_section_contents.
3239 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3241 (Sized_dwarf_line_info::buffer_start_): New data member.
3242 * merge.cc (Output_merge_data::do_add_input_section): Call
3243 Object::decompressed_section_contents.
3244 (Output_merge_string::do_add_input_section): Likewise.
3245 * object.cc (need_decompressed_section): New function.
3246 (build_compressed_section_map): Decompress sections needed later.
3247 (Sized_relobj_file::do_decompressed_section_contents): New function.
3248 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3249 * object.h (Object::decompressed_section_contents): New function.
3250 (Object::discard_decompressed_sections): New function.
3251 (Object::do_decompressed_section_contents): New function.
3252 (Object::do_discard_decompressed_sections): New function.
3253 (Compressed_section_info): New type.
3254 (Compressed_section_map): Include decompressed section contents.
3255 (Sized_relobj_file::do_decompressed_section_contents): New function.
3256 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3258 2012-02-16 Cary Coutant <ccoutant@google.com>
3260 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3261 * testsuite/Makefile.in: Regenerate.
3263 2012-02-14 Cary Coutant <ccoutant@google.com>
3265 * options.cc (General_options::finalize): Disallow -pie and -static.
3267 2012-02-03 Doug Kwan <dougkwan@google.com>
3269 * arm.cc (Arm_relocate_functions::abs8,
3270 Arm_relocate_functions::abs16): Use
3271 Bits::has_signed_unsigned_overflow32.
3272 (Arm_relocate_functions::thm_abs8): Correct range of
3274 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3277 2012-02-02 Doug Kwan <dougkwan@google.com>
3279 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3280 position independent outputs, not just shared objects.
3282 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3284 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3285 * configure: Regenerated.
3287 2012-01-27 Ian Lance Taylor <iant@google.com>
3289 * reloc.h (Bits): New class with static functions, copied from
3290 namespace utils in arm.cc.
3291 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3294 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3296 * incremental.cc (write_info_blocks): Correct relocation offset.
3298 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3300 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3301 (Relocate::tls_gd_to_le): Likewise.
3303 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3305 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3307 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3309 * configure.ac: Check if -mcmodel=medium works.
3310 * configure: Regenerated.
3312 2012-01-24 Cary Coutant <ccoutant@google.com>
3314 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3316 (read_unsigned_LEB_128_x): ... this new function.
3317 (read_signed_LEB_128): Replaced with inline definition and ...
3318 (read_signed_LEB_128_x): ... this new function.
3319 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3320 (read_unsigned_LEB_128): Add inline definition.
3321 (read_signed_LEB_128_x): New function.
3322 (read_signed_LEB_128): Add inline definition.
3323 * testsuite/Makefile.am (leb128_unittest): New unit test.
3324 * testsuite/Makefile.in: Regenerate.
3325 * testsuite/leb128_unittest.cc: New unit test.
3327 2012-01-23 Ian Lance Taylor <iant@google.com>
3330 * i386.cc (Target_i386::do_code_fill): When using a jmp
3331 instruction, pad with nop instructions.
3332 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3334 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3336 * x86_64.cc (gc_process_relocs): Add typename on types used in
3338 (scan_relocs): Likewise.
3339 (relocate_section): Likewise.
3340 (apply_relocation): Likewise.
3342 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3344 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3345 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3348 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3350 * x86_64.cc: Initial support for x32.
3352 2012-01-03 Cary Coutant <ccoutant@google.com>
3354 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3355 Use abstract base class for GOT.
3356 * gold/output.h (class Output_data_got_base): New abstract base class.
3357 (class Output_data_got): Derive from new base class, adjust ctors.
3358 (Output_data_got::reserve_slot): Make virtual; rename to
3359 do_reserve_slot; Adjust callers.
3360 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3361 pointer to abstract base class.
3362 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3364 2011-12-18 Ian Lance Taylor <iant@google.com>
3366 * object.h (Relobj::local_symbol_value): New function.
3367 (Relobj::local_plt_offset): New function.
3368 (Relobj::local_has_got_offset): New function.
3369 (Relobj::local_got_offset): New function.
3370 (Relobj::set_local_got_offset): New function.
3371 (Relobj::do_local_symbol_value): New pure virtual function.
3372 (Relobj::do_local_plt_offset): Likewise.
3373 (Relobj::do_local_has_got_offset): Likewise.
3374 (Relobj::do_local_got_offset): Likewise.
3375 (Relobj::do_set_local_got_offset): Likewise.
3376 (Sized_relobj::do_local_has_got_offset): Rename from
3377 local_has_got_offset.
3378 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3379 (Sized_relobj::do_set_local_got_offset): Rename from
3380 set_local_got_offset.
3381 (Sized_relobj_file::do_local_plt_offset): Rename from
3383 (Sized_relobj_file::do_local_symbol_value): New function.
3384 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3386 * output.cc (Output_data_got::Got_entry::write): Change object to
3387 Relobj. Use local_symbol_value.
3388 (Output_data_got::add_global_with_rel): Change rel_dyn to
3389 Output_data_reloc_generic*. Use add_global_generic.
3390 (Output_data_got::add_global_with_rela): Remove. Change all
3391 callers to use add_global_with_rel.
3392 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3393 Output_data_reloc_generic*. Use add_global_generic.
3394 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3395 callers to use add_global_pair_with_rel.
3396 (Output_data_got::add_local): Change object to Relobj*.
3397 (Output_data_got::add_local_plt): Likewise.
3398 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3399 change rel_dyn to Output_data_reloc_generic*. Use
3401 (Output_data_got::add_local_with_rela): Remove. Change all
3402 callers to use all_local_with_rel.
3403 (Output_data_got::add_local_pair_with_rel): Change object to
3404 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3405 add_output_section_generic.
3406 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3407 callers to use add_local_pair_with_rel.
3408 (Output_data_got::reserve_local): Change object to Relobj*.
3409 * output.h: (class Output_data_reloc_generic): Add pure virtual
3410 declarations for add_global_generic, add_local_generic,
3411 add_output_section_generic.
3412 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3413 functions for Output_data_reloc_generic. Update declarations for
3414 changes listed in output.cc.
3415 (class Output_data_got): Change template parameter to got_size.
3416 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3417 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3419 (Sized_relobj_incr::do_local_plt_offset): New function.
3420 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3423 2011-12-17 Cary Coutant <ccoutant@google.com>
3425 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3426 * resolve.cc (Symbol_table::resolve): Likewise.
3427 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3429 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3431 2011-12-16 Ian Lance Taylor <iant@google.com>
3433 * output.h (Output_data_reloc_generic::add): Only call
3434 add_dynamic_reloc if this is a dynamic reloc section.
3436 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3439 * target-reloc.h (apply_relocation): Replace <64, false> with
3442 2011-11-25 Nick Clifton <nickc@redhat.com>
3444 * po/it.po: New Italian translation.
3446 2011-11-17 Sterling Augustine <saugustine@google.com>
3448 * script.cc (script_include_directive): Implement.
3449 (read_script_file): New local variables name and search_path. Update
3450 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3451 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3452 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3454 2011-11-11 Sterling Augustine <saugustine@google.com>
3456 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3457 (file_or_sections_cmd): Likewise.
3459 2011-11-11 Doug Kwan <dougkwan@google.com>
3461 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3462 if --just-symbols is given.
3464 2011-11-10 Doug Kwan <dougkwan@google.com>
3467 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3468 when processing data relocs.
3469 * reloc.h (Relocate_functions::rel_unaligned): New method.
3470 (Relocate_functions::pcrel_unaligned): Ditto.
3471 (Relocate_functions::rel32_unaligned): Ditto.
3472 (Relocate_functions::pcrel32_unaligned): Ditto.
3474 2011-11-09 Doug Kwan <dougkwan@google.com>
3477 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3478 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3479 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3480 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3481 (Relocate_functions::rel_unaligned): New.
3482 (Relocate_functions::rel32_unaligned): New.
3483 * target-reloc.h (relocate_for_relocatable): Add code to handle
3484 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3485 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3486 arm_unaligned_reloc_r): New targets.
3487 * testsuite/Makefile.in: Regenerate.
3488 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3491 2011-11-02 Ian Lance Taylor <iant@google.com>
3493 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3495 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3496 * options.cc (General_options::finalize): Use library search path
3497 from configure script if specified. If not native and no sysroot,
3498 only search TOOLLIBDIR.
3499 * options.h (Search_directory::Search_directory): Change name to
3501 (General_options::add_to_library_path_with_sysroot): Change arg to
3503 * configure, Makefile.in, config.in: Rebuild.
3505 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3507 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3508 we are working around the ARM1176 Erratum.
3509 * options.h (General_options::fix_arm1176): Add option.
3510 * testsuite/Makefile.am: Add testcases, and keep current ones
3512 * testsuite/Makefile.in: Regenerate.
3513 * testsuite/arm_fix_1176.s: New file.
3514 * testsuite/arm_fix_1176.sh: Likewise.
3516 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3518 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3520 (Target_arm::may_use_blx): Remove method.
3521 (Target_arm::set_may_use_blx): Likewise.
3522 (Target_arm::may_use_v4t_interworking): New method.
3523 (Target_arm::may_use_v5t_interworking): Likewise.
3524 (Target_arm::may_use_blx_): Remove member variable.
3525 (Arm_relocate_functions::arm_branch_common): Check for v5T
3527 (Arm_relocate_functions::thumb_branch_common): Likewise.
3528 (Reloc_stub::stub_type_for_reloc): Likewise.
3529 (Target_arm::do_finalize_sections): Correct interworking checks.
3530 * testsuite/Makefile.am: Add new tests.
3531 * testsuite/Makefile.in: Regenerate.
3532 * testsuite/arm_farcall_arm_arm.s: New test.
3533 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3534 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3535 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3536 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3537 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3538 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3539 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3541 2011-10-31 Cary Coutant <ccoutant@google.com>
3544 * expression.cc (Expression::eval_with_dot): Add
3545 is_section_dot_assignment parameter.
3546 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3547 absolute and assigning to dot within a section.
3548 * script-sections.cc
3549 (Output_section_element_assignment::set_section_addresses): Pass
3550 dot_section to set_if_absolute.
3551 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3552 as is_section_dot_assignment flag to eval_with_dot.
3553 (Output_section_element_dot_assignment::set_section_addresses):
3555 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3556 parameter. Also set value if relative to dot_section; set the
3557 symbol's output_section.
3558 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3559 parameter. Adjust all callers.
3560 (Expression::eval_maybe_dot): Likewise.
3561 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3563 * testsuite/script_test_2.t: Test assignment of an absolute value
3564 to dot within an output section element.
3566 2011-10-31 Cary Coutant <ccoutant@google.com>
3568 * options.h (class General_options): Add --[no-]gnu-unique options.
3569 * symtab.cc (Symbol_table::sized_write_globals): Convert
3570 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3572 2011-10-31 Cary Coutant <ccoutant@google.com>
3575 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3576 unnecessary assertion.
3577 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3579 2011-10-31 Sriraman Tallam <tmsriram@google.com>
3581 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3583 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3585 Change to just keep the section associated with symbol.
3586 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3587 they are externally visible and --export-dynamic is turned on.
3588 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3590 2011-10-19 Ian Lance Taylor <iant@google.com>
3593 * script-sections.cc
3594 (Output_section_element_dot_assignment::needs_output_section): New
3597 2011-10-19 Ian Lance Taylor <iant@google.com>
3600 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3601 --section-start option was seen.
3602 * options.h (General_options::any_section_start): New function.
3604 2011-10-18 David S. Miller <davem@davemloft.net>
3607 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3608 member to track relocation locations that have moved during TLS
3609 reloc optimizations.
3610 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3611 (Target_sparc::Relocate::relocate): Adjust view down by 4
3612 bytes if it matches reloc_adjust_addr_.
3613 (Target_sparc::Relocate::relocate_tls): Always move the
3614 __tls_get_addr call delay slot instruction forward 4 bytes when
3615 performing relaxation.
3617 2011-10-18 Cary Coutant <ccoutant@google.com>
3619 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3620 (Output_file::map_no_anonymous): Check for non-zero
3621 return code from posix_fallocate.
3623 2011-10-17 Cary Coutant <ccoutant@google.com>
3626 * plugin.cc (is_visible_from_outside): Check for symbols
3627 referenced from dynamic objects.
3628 * resolve.cc (Symbol_table::resolve): Don't count references
3629 from dynamic objects as references from real ELF files.
3630 * testsuite/plugin_test_2.sh: Adjust expected result.
3632 2011-10-17 Cary Coutant <ccoutant@google.com>
3634 * gold.cc: Include timer.h.
3635 (queue_middle_tasks): Stamp time.
3636 (queue_final_tasks): Likewise.
3637 * main.cc (main): Store timer in parameters. Print timers
3639 * parameters.cc (Parameters::Parameters): Initialize timer_.
3640 (Parameters::set_timer): New function.
3641 (set_parameters_timer): New function.
3642 * parameters.h (Parameters::set_timer): New function.
3643 (Parameters::timer): New function.
3644 (Parameters::timer_): New data member.
3645 (set_parameters_timer): New function.
3646 * timer.cc (Timer::stamp): New function.
3647 (Timer::get_pass_time): New function.
3648 * timer.h (Timer::stamp): New function.
3649 (Timer::get_pass_time): New function.
3650 (Timer::pass_times_): New data member.
3652 2011-10-17 Cary Coutant <ccoutant@google.com>
3654 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3655 task for members of lib groups.
3657 2011-10-17 Cary Coutant <ccoutant@google.com>
3660 * fileread.cc (File_read::find_view): Add assert.
3661 (File_read::make_view): Move bounds check (replace with assert)...
3662 (File_read::find_or_make_view): ... to here.
3664 2011-10-12 Cary Coutant <ccoutant@google.com>
3666 * output.cc (Output_file::open_base_file): Handle case where
3667 ::read returns less than requested size.
3669 2011-10-10 Cary Coutant <ccoutant@google.com>
3671 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
3672 Initialize defined_count_.
3673 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3674 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3675 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3676 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3677 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
3678 * incremental.h (Sized_relobj_incr::defined_count_): New data
3680 (Sized_incr_dynobj::defined_count_): New data member.
3681 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
3682 Return zeroes instead of internal error.
3684 2011-10-10 Cary Coutant <ccoutant@google.com>
3687 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
3688 (Output_reloc::symbol_value): Return PLT offset if flag is set.
3689 * output.h (class Output_reloc): Add use_plt_offset flag.
3690 (Output_reloc::type_): Adjust size of bit field.
3691 (Output_reloc::use_plt_offset_): New bit field.
3692 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3693 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3694 flag. Adjust all callers.
3695 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
3696 creating RELATIVE relocations.
3698 2011-10-10 Nick Clifton <nickc@redhat.com>
3700 * po/es.po: Updated Spanish translation.
3701 * po/fi.po: Updated Finnish translation.
3703 2011-10-03 Diego Novillo <dnovillo@google.com>
3705 * options.cc (parse_uint): Fix dereference of RETVAL.
3707 2011-09-29 Sriraman Tallam <tmsriram@google.com>
3709 * layout.h (section_order_map_): New member.
3710 (get_section_order_map): New member function.
3711 * output.cc (Output_section::add_input_section): Check for patterns
3712 only when --section-ordering-file is specified.
3713 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3714 output_sections have been formed.
3715 * layout.cc (Layout_Layout): Initialize section_order_map_.
3716 * plugin.cc (update_section_order): Store order in order_map. Do not
3718 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3719 * testsuite/Makefile.in: Regenerate.
3720 * testsuite/plugin_section_order.c: New file.
3721 * testsuite/plugin_final_layout.cc: New file.
3722 * testsuite/plugin_final_layout.sh: New file.
3724 2011-09-29 Cary Coutant <ccoutant@google.com>
3726 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3728 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
3729 symbols during incremental update.
3730 (Symbol_table::add_from_dynobj): Likewise.
3732 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3733 Ian Lance Taylor <iant@google.com>
3735 * symtab.cc (Symbol_table::define_special_symbol): Always
3736 canonicalize version string.
3738 2011-09-26 Cary Coutant <ccoutant@google.com>
3740 * gold.cc (queue_initial_tasks): Move option checks ...
3741 * options.cc (General_options::finalize): ... to here. Disable
3742 some options; make others fatal.
3744 2011-09-26 Cary Coutant <ccoutant@google.com>
3747 * plugin.cc (get_symbols_v2): New function.
3748 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3749 (is_referenced_from_outside): New function.
3750 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3751 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3752 (get_symbols): Pass version parameter.
3753 (get_symbols_v2): New function.
3754 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3756 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3757 (onload): Add LDPT_GET_SYMBOLS_V2.
3758 (all_symbols_read_hook): Use get_symbols_v2; check for
3759 LDPR_PREVAILING_DEF_IRONLY_EXP.
3760 * testsuite/plugin_test_3.sh: Update expected results.
3762 2011-09-23 Simon Baldwin <simonb@google.com>
3764 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3765 configuration options.
3766 * configure: Regenerate.
3767 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3768 * Makefile.in: Regenerate.
3769 * testsuite/Makefile.in: Regenerate.
3771 2011-09-19 Sriraman Tallam <tmsriram@google.com>
3773 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3775 2011-09-19 Cary Coutant <ccoutant@google.com>
3777 * incremental.cc (can_incremental_update): Fix typo in comment.
3778 * incremental.h (can_incremental_update): Likewise.
3780 2011-09-18 Cary Coutant <ccoutant@google.com>
3782 * incremental.cc (can_incremental_update): New function.
3783 * incremental.h (can_incremental_update): New function.
3784 * layout.cc (Layout::init_fixed_output_section): Call it.
3785 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3786 * object.cc (Sized_relobj_file::do_layout): Call
3787 can_incremental_update.
3789 2011-09-13 Cary Coutant <ccoutant@google.com>
3791 * configure.ac: Check for glibc support for gnu_indirect_function
3792 support with static linking, setting automake conditional
3794 * Makefile.in: Regenerate.
3795 * configure: Regenerate.
3797 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3798 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3800 * testsuite/Makefile.in: Regenerate.
3802 2011-09-13 Cary Coutant <ccoutant@google.com>
3804 * incremental.cc (Sized_relobj_incr::do_layout): Call
3805 report_comdat_group for kept comdat sections.
3806 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3807 * testsuite/Makefile.in: Regenerate.
3808 * testsuite/incr_comdat_test_1.cc: New source file.
3809 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3810 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3811 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3813 2011-09-13 Ian Lance Taylor <iant@google.com>
3815 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3816 variable external_symbols_offset.
3818 2011-09-12 Ian Lance Taylor <iant@google.com>
3820 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3821 triggered if object has no symbols.
3823 2011-09-09 David S. Miller <davem@davemloft.net>
3825 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3826 (Output_fill_debug_line::do_write): Likewise.
3828 2011-08-29 Cary Coutant <ccoutant@google.com>
3830 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3831 casts to match formatting specs.
3832 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3834 2011-08-26 Cary Coutant <ccoutant@google.com>
3836 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3837 remaining hole size when allocating.
3838 (Layout::make_output_section): Set fill methods for debug sections.
3839 * layout.h (Free_list::Free_list_node): Move from private to
3841 (Free_list::set_min_hole_size): New function.
3842 (Free_list::begin, Free_list::end): New functions.
3843 (Free_list::min_hole_): New data member.
3844 * output.cc: Include dwarf.h.
3845 (Output_fill_debug_info::do_minimum_hole_size): New function.
3846 (Output_fill_debug_info::do_write): New function.
3847 (Output_fill_debug_line::do_minimum_hole_size): New function.
3848 (Output_fill_debug_line::do_write): New function.
3849 (Output_section::Output_section): Initialize new data member.
3850 (Output_section::set_final_data_size): Ensure patch space is larger
3851 than minimum hole size.
3852 (Output_section::do_write): Fill holes in debug sections.
3853 * output.h (Output_fill): New class.
3854 (Output_fill_debug_info): New class.
3855 (Output_fill_debug_line): New class.
3856 (Output_section::set_free_space_fill): New function.
3857 (Output_section::free_space_fill_): New data member.
3858 * testsuite/Makefile.am (incremental_test_3): Add
3859 --incremental-patch option.
3860 (incremental_test_4): Likewise.
3861 (incremental_test_5): Likewise.
3862 (incremental_test_6): Likewise.
3863 (incremental_copy_test): Likewise.
3864 (incremental_common_test_1): Likewise.
3865 * testsuite/Makefile.in: Regenerate.
3867 2011-08-26 Nick Clifton <nickc@redhat.com>
3869 * po/es.po: Updated Spanish translation.
3871 2011-08-01 Cary Coutant <ccoutant@google.com>
3873 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3874 * gold/testsuite/Makefile.in: Regenerate.
3875 * gold/testsuite/justsyms_exec.c: New source file.
3876 * gold/testsuite/justsyms_lib.c: New source file.
3878 2011-08-01 Cary Coutant <ccoutant@google.com>
3880 * layout.cc (Layout::set_segment_offsets): Don't realign text
3881 segment if -Ttext was specified.
3882 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3884 * object.h (Sized_relobj_file::e_type): New function.
3885 (Sized_relobj_file::e_type_): New data member.
3886 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3887 base address for ET_EXEC files.
3888 * target.cc (Target::do_make_elf_object_implementation): Allow
3889 ET_EXEC files with --just-symbols option.
3891 2011-07-28 Cary Coutant <ccoutant@google.com>
3893 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3894 Add thread_number parameter.
3895 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3896 * workqueue-threads.cc
3897 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3898 current thread if its thread number is greater than desired thread
3900 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3901 Add thread_number parameter.
3902 (Workqueue::should_cancel_thread): Likewise.
3903 (Workqueue::find_runnable_or_wait): Pass thread_number to
3904 should_cancel_thread.
3905 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3908 2011-07-22 Sriraman Tallam <tmsriram@google.com>
3910 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3911 only after checking if it cannot be forced local.
3912 * symtab.h (is_externally_visible): Check if the symbol is not forced
3915 2011-07-15 Ian Lance Taylor <iant@google.com>
3917 * options.h (class General_options): Add --print-output-format.
3918 Move -EL next to -EB, for better --help output.
3919 * target-select.cc: Include <cstdio>, "options.h", and
3921 (Target_selector::do_target_bfd_name): New function.
3922 (print_output_format): New function.
3923 * target-select.h (class Target_selector): Update declarations.
3924 (Target_selector::target_bfd_name): New function.
3925 (print_output_format): Declare.
3926 * main.cc: Include "target-select.h".
3927 (main): Handle --print-output-format.
3928 * gold.cc: Include "target-select.h".
3929 (queue_initial_tasks): Handle --print-output-format when there are
3931 * parameters.cc (parameters_force_valid_target): Give a better
3932 error message if -EB/-EL does not match target.
3933 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3936 2011-07-15 Ian Lance Taylor <iant@google.com>
3938 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3939 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3940 (Output_data_plt_i386::do_write): Write address of .dynamic
3941 section to first entry in .got.plt section.
3942 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3943 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3945 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3946 section to first entry in .got.plt section.
3947 * layout.h (Layout::dynamic_section): New function.
3949 2011-07-13 Sriraman Tallam <tmsriram@google.com>
3951 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3953 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3954 input_section_position_, and input_section_glob_.
3955 (read_layout_from_file): Call function section_ordering_specified.
3956 * layout.h (is_section_ordering_specified): New function.
3957 (section_ordering_specified): New function.
3958 (section_ordering_specified_): New boolean member.
3959 * main.cc(main): Call load_plugins after layout object is defined.
3960 * output.cc (Output_section::add_input_section): Use
3961 function section_ordering_specified to check if section ordering is
3963 * output.cc (Output_section::add_relaxed_input_section): Use
3964 function section_ordering_specified to check if section ordering is
3966 (Output_section::update_section_layout): New function.
3967 (Output_section::sort_attached_input_sections): Check if input section
3969 * output.h (Output_section::update_section_layout): New function.
3970 * plugin.cc (get_section_count): New function.
3971 (get_section_type): New function.
3972 (get_section_name): New function.
3973 (get_section_contents): New function.
3974 (update_section_order): New function.
3975 (allow_section_ordering): New function.
3976 (Plugin::load): Add the new interfaces to the transfer vector.
3977 (Plugin_manager::load_plugins): New parameter.
3978 (Plugin_manager::all_symbols_read): New parameter.
3979 (Plugin_manager::claim_file): New parameter. Save the elf object for
3981 (Plugin_manager::get_elf_object): New function.
3982 (Plugin_manager::get_view): Change to directly use the bool to check
3983 if get_view is called from claim_file_hook.
3984 * plugin.h (input_objects): New function
3985 (Plugin__manager::load_plugins): New parameter.
3986 (Plugin_manager::claim_file): New parameter.
3987 (Plugin_manager::get_elf_object): New function.
3988 (Plugin_manager::in_claim_file_handler): New function.
3989 (Plugin_manager::in_claim_file_handler_): New member.
3990 (layout): New function.
3991 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3992 handler with an extra parameter. Make the elf object before calling
3994 * testsuite/plugin_test.c (get_section_count): New function pointer.
3995 (get_section_type): New function pointer.
3996 (get_section_name): New function pointer.
3997 (get_section_contents): New function pointer.
3998 (update_section_order): New function pointer.
3999 (allow_section_ordering): New function pointer.
4000 (onload): Check if the new interfaces exist.
4002 2011-07-13 Ian Lance Taylor <iant@google.com>
4004 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4006 * x86_64.cc (Target_x86_64::got_section): Likewise.
4007 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4008 (relro_now_test_SOURCES): New variable.
4009 (relro_now_test_DEPENDENCIES): New variable.
4010 (relro_now_test_LDFLAGS): New variable.
4011 (relro_now_test_LDADD): New variable.
4012 (relro_now_test.so): New target.
4013 * testsuite/Makefile.in: Rebuild.
4015 2011-07-12 Ian Lance Taylor <iant@google.com>
4018 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4019 GLOB_DAT relocation rather than a RELATIVE relocation for a
4020 protected symbol when creating a shared library.
4021 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4022 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4023 * testsuite/protected_main_1.cc (main): Test that protected
4024 function has same address.
4026 2011-07-11 Ian Lance Taylor <iant@google.com>
4029 * options.h (class General_options): Add -Bgroup.
4030 * options.cc (General_options::finalize): If -Bgroup is set,
4031 default to --unresolved-symbols=report-all.
4032 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4033 * target-reloc.h (issue_undefined_symbol_error): Handle
4034 --unresolved-symbols=report-all.
4036 2011-07-08 Ian Lance Taylor <iant@google.com>
4039 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4040 if linker script discards key sections.
4041 (Layout::create_dynamic_symtab): Likewise.
4042 (Layout::assign_local_dynsym_offsets): Likewise.
4043 (Layout::sized_create_version_sections): Likewise.
4044 (Layout::create_interp): Likewise.
4045 (Layout::finish_dynamic_section): Likewise.
4046 (Layout::set_dynamic_symbol_size): Likewise.
4048 2011-07-08 Ian Lance Taylor <iant@google.com>
4051 * options.h (class General_options): Add --unresolved-symbols.
4052 * target-reloc.h (issue_undefined_symbol_error): Check
4053 --unresolved-symbols. Add comments.
4055 2011-07-08 Ian Lance Taylor <iant@google.com>
4057 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4058 expression more complex.
4060 2011-07-08 Ian Lance Taylor <iant@google.com>
4063 * target-reloc.h (issue_undefined_symbol_error): New inline
4064 function, broken out of relocate_section.
4065 (relocate_section): Call issue_undefined_symbol_error.
4066 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4067 there is no TLS segment if we are about to issue an undefined
4069 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4071 2011-07-08 Ian Lance Taylor <iant@google.com>
4074 * resolve.cc (Symbol_table::should_override): Add fromtype
4075 parameter. Change all callers. Give error when linking together
4076 TLS and non-TLS symbol.
4077 (Symbol_table::should_override_with_special): Add fromtype
4078 parameter. Change all callers.
4079 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4080 there is no TLS segment if we have reported some errors.
4081 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4083 2011-07-08 Ian Lance Taylor <iant@google.com>
4086 * target.h (Target::plt_address_for_global): New function.
4087 (Target::plt_address_for_local): New function.
4088 (Target::plt_section_for_global): Remove.
4089 (Target::plt_section_for_local): Remove.
4090 (Target::do_plt_address_for_global): New virtual function.
4091 (Target::do_plt_address_for_local): New virtual function.
4092 (Target::do_plt_section_for_global): Remove.
4093 (Target::do_plt_section_for_local): Remove.
4094 (Target::register_global_plt_entry): Add Symbol_table and Layout
4096 * output.cc (Output_data_got::Got_entry::write): Use
4097 plt_address_for_global and plt_address_for_local.
4098 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4099 address of output section.
4100 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4101 got_irelative_, and irelative_count_ fields. Update
4103 (Output_data_plt_i386::has_irelative_section): New function.
4104 (Output_data_plt_i386::entry_count): Add irelative_count_.
4105 (Output_data_plt_i386::set_final_data_size): Likewise.
4106 (class Target_i386): Add got_irelative_ and rel_irelative_
4107 fields. Update declarations.
4108 (Target_i386::Target_i386): Initialize new fields.
4109 (Target_i386::do_plt_address_for_global): New function replacing
4110 do_plt_section_for_global.
4111 (Target_i386::do_plt_address_for_local): New function replacing
4112 do_plt_section_for_local.
4113 (Target_i386::got_section): Create got_irelative_.
4114 (Target_i386::rel_irelative_section): New function.
4115 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4116 fields. Don't define __rel_iplt_{start,end}.
4117 (Output_data_plt_i386::add_entry): Add symtab and layout
4118 parameters. Change all callers. Use different PLT and GOT for
4120 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4121 layout parameters. Change all callers. Use different PLT and
4123 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4124 (Output_data_plt_i386::rel_irelative): New function.
4125 (Output_data_plt_i386::address_for_global): New function.
4126 (Output_data_plt_i386::address_for_local): New function.
4127 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4128 IRELATIVE GOT when changing IFUNC GOT entries.
4129 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4131 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4132 if we didn't create an IRELATIVE GOT.
4133 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4134 plt_address_for_local.
4135 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4136 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4137 got_irelative_, and irelative_count_ fields. Update
4139 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4140 Initialize new fields. Remove symtab parameter. Change all
4142 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4144 (Output_data_plt_x86_64::has_irelative_section): New function.
4145 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4146 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4147 fields. Update declarations.
4148 (Target_x86_64::Target_x86_64): Initialize new fields.
4149 (Target_x86_64::do_plt_address_for_global): New function replacing
4150 do_plt_section_for_global.
4151 (Target_x86_64::do_plt_address_for_local): New function replacing
4152 do_plt_section_for_local.
4153 (Target_x86_64::got_section): Create got_irelative_.
4154 (Target_x86_64::rela_irelative_section): New function.
4155 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4156 all callers. Don't create __rel_iplt_{start,end}.
4157 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4158 parameters. Change all callers. Use different PLT and GOT for
4160 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4161 layout parameters. Change all callers. Use different PLT and
4163 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4164 parameters. Change all callers. Use different PLT and GOT for
4166 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4167 (Output_data_plt_x86_64::rela_irelative): New function.
4168 (Output_data_plt_x86_64::address_for_global): New function.
4169 (Output_data_plt_x86_64::address_for_local): New function.
4170 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4171 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4172 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4173 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4175 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4177 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4178 symbols if we didn't create an IRELATIVE GOT.
4179 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4180 plt_address_for_local.
4181 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4182 * testsuite/ifuncvar1.c: New test file.
4183 * testsuite/ifuncvar2.c: New test file.
4184 * testsuite/ifuncvar3.c: New test file.
4185 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4186 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4187 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4188 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4189 * testsuite/Makefile.in: Rebuild.
4191 2011-07-07 Cary Coutant <ccoutant@google.com>
4193 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4194 (two_file_test_1_ndebug.o): Likewise.
4195 (two_file_test_1b_ndebug.o): Likewise.
4196 (two_file_test_2_ndebug.o): Likewise.
4197 (two_file_test_main_ndebug.o): Likewise.
4198 (incremental_test_2): Link with no-debug versions.
4200 2011-07-06 Cary Coutant <ccoutant@google.com>
4202 * gold/incremental.cc
4203 (Output_section_incremental_inputs::write_info_blocks): Check for
4204 hidden and internal symbols.
4206 2011-07-06 Cary Coutant <ccoutant@google.com>
4208 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4209 Check disposition for startup file.
4210 (Incremental_inputs::report_command_line): Ignore
4211 --incremental-startup-unchanged option.
4212 * options.cc (General_options::parse_incremental_startup_unchanged):
4214 (General_options::General_options): Initialize new data member.
4215 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4216 (General_options): Add --incremental-startup-unchanged option.
4217 (General_options::incremental_startup_disposition): New function.
4218 (General_options::incremental_startup_disposition_): New data member.
4220 2011-07-06 Cary Coutant <ccoutant@google.com>
4222 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4223 input file index to Script_info ctor.
4224 (Sized_incremental_binary::do_file_has_changed): Find the
4225 command-line argument for files named in scripts.
4226 * incremental.h (Script_info::Script_info): New ctor
4227 with input file index.
4228 (Script_info::input_file_index): New function.
4229 (Script_info::input_file_index_): New data member.
4230 (Incremental_binary::get_library): Add const.
4231 (Incremental_binary::get_script_info): Add const.
4232 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4233 * testsuite/Makefile.am (incremental_test_5): New test case.
4234 (incremental_test_6): New test case.
4235 * testsuite/Makefile.in: Regenerate.
4237 2011-07-06 Cary Coutant <ccoutant@google.com>
4239 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4240 debug output when command lines differ.
4242 2011-07-06 Cary Coutant <ccoutant@google.com>
4244 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4245 --incremental-patch option.
4246 * layout.cc (Free_list::allocate): Extend allocation beyond original
4248 (Layout::make_output_section): Mark sections that should get
4250 * options.cc (parse_percent): New function.
4251 * options.h (parse_percent): New function.
4252 (DEFINE_percent): New macro.
4253 (General_options): Add --incremental-patch option.
4254 * output.cc (Output_section::Output_section): Initialize new data
4256 (Output_section::add_input_section): Print section name when out
4258 (Output_section::add_output_section_data): Likewise.
4259 (Output_section::set_final_data_size): Add patch space when
4260 doing --incremental-full.
4261 (Output_section::do_reset_address_and_file_offset): Remove patch
4263 (Output_segment::set_section_list_addresses): Print debug output
4264 only if --incremental-update.
4265 * output.h (Output_section::set_is_patch_space_allowed): New function.
4266 (Output_section::is_patch_space_allowed_): New data member.
4267 (Output_section::patch_space_): New data member.
4268 * parameters.cc (Parameters::incremental_full): New function.
4269 * parameters.h (Parameters::incremental_full): New function
4270 * testsuite/Makefile.am (incremental_test_2): Add test for
4271 --incremental-patch option.
4272 * testsuite/Makefile.in: Regenerate.
4273 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4274 (t18): Remove function body.
4276 2011-07-05 Doug Kwan <dougkwan@google.com>
4279 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4280 Arm_Address type for relocation result.
4281 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4283 (Arm_relocate_functions::abs32): Use unaligned access.
4284 (Arm_relocate_functions::rel32): Ditto.
4285 (Arm_relocate_functions::prel31): Ditto.
4286 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4287 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4288 static data relocations.
4289 * testsuite/Makefile.in: Regnerate.
4290 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4292 2011-07-05 Ian Lance Taylor <iant@google.com>
4295 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4296 symbols if necessary.
4297 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4299 2011-07-05 Ian Lance Taylor <iant@google.com>
4302 * resolve.cc (Symbol::override_base_with_special): Simply override
4303 version with special symbol version, ignoring previous version.
4305 2011-07-05 Ian Lance Taylor <iant@google.com>
4307 * object.cc (Sized_relobj_file::include_section_group): Add
4308 information to comment about signature location.
4310 2011-07-02 Ian Lance Taylor <iant@google.com>
4313 * options.h (class General_options): Add -f and -F.
4314 * options.cc (General_options::finalize): Fatal error if -f/-F
4315 are used without -shared.
4316 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4318 2011-07-02 Ian Lance Taylor <iant@google.com>
4320 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4322 2011-07-01 Ian Lance Taylor <iant@google.com>
4326 * resolve.cc (Symbol::override_base_with_special): Don't override
4327 the version if the overriding symbol has a different name.
4328 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4329 all callers. If we give an error about an undefined version,
4330 define the base version if necessary.
4331 * dynobj.h (class Versions): Update declaration.
4332 * testsuite/weak_alias_test_5.cc: New file.
4333 * testsuite/weak_alias_test.script: New file.
4334 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4335 and versioned_alias have the right value, and call t2.
4336 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4337 weak_alias_test_5.so.
4338 (weak_alias_test_LDADD): Likewise.
4339 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4340 * testsuite/Makefile.in: Rebuild.
4342 2011-07-01 Ian Lance Taylor <iant@google.com>
4345 * options.h (class General_options): Support -z notext.
4346 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4348 (two_file_shared_nonpic.so): Likewise.
4349 (two_file_shared_mixed.so): Likewise.
4350 (two_file_shared_mixed_1.so): Likewise.
4351 (weak_undef_lib_nonpic.so): Likewise.
4352 (alt/weak_undef_lib_nonpic.so): Likewise.
4353 (tls_test_shared_nonpic.so): Likewise.
4354 * testsuite/Makefile.in: Rebuild.
4356 2011-07-01 Ian Lance Taylor <iant@google.com>
4359 * configure.ac: Test whether static linking works, setting
4360 the automake conditional HAVE_STATIC.
4361 * testsuite/Makefile.am: Disable tests using -static if
4362 HAVE_STATIC is not true.
4363 * configure, testsuite/Makefile.in: Rebuild.
4365 2011-07-01 Ian Lance Taylor <iant@google.com>
4368 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4369 Assert if we see DW_EH_PE_indirect.
4370 * target.h (Target::ehframe_datarel_base): New function.
4371 (Target::do_ehframe_datarel_base): New target function.
4372 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4373 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4376 2011-07-01 Ian Lance Taylor <iant@google.com>
4379 * options.h (class General_options): Add
4380 --ld-generated-unwind-info.
4381 * ehframe.cc (Fde::write): Add address parameter. Change all
4382 callers. If associated with PLT, fill in address and size.
4383 (Cie::set_output_offset): Only add merge mapping if there is an
4385 (Cie::write): Add address parameter. Change all callers.
4386 (Eh_frame::add_ehframe_for_plt): New function.
4387 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4388 input_offset_ fields into union u_, with new plt field.
4389 (Fde::Fde): Adjust for new union field.
4390 (Fde::Fde) [Output_data version]: New constructor.
4391 (Fde::add_mapping): Only add merge mapping if there is an object.
4392 (class Cie): Update declarations.
4393 (class Eh_frame): Declare add_ehframe_for_plt.
4394 * layout.cc (Layout::layout_eh_frame): Break out code into
4395 make_eh_frame_section, and call it.
4396 (Layout::make_eh_frame_section): New function.
4397 (Layout::add_eh_frame_for_plt): New function.
4398 * layout.h (class Layout): Update declarations.
4399 * merge.cc (Merge_map::add_mapping): Add assertion.
4400 * i386.cc: Include "dwarf.h".
4401 (class Output_data_plt_i386): Make first_plt_entry,
4402 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4403 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4404 and plt_eh_frame_fde.
4405 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4406 boundary. Call add_eh_frame_for_plt if appropriate.
4407 * x86_64.cc: Include "dwarf.h".
4408 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4409 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4410 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4411 and plt_eh_frame_fde.
4412 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4415 2011-06-29 Ian Lance Taylor <iant@google.com>
4418 * object.cc (Sized_relobj_file::layout_section): Change shdr
4419 parameter to be const.
4420 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4422 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4423 appropriate. Call layout_eh_frame_section.
4424 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4426 * object.h (class Sized_relobj_file): Update declarations.
4428 2011-06-29 Ian Lance Taylor <iant@google.com>
4431 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4433 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4435 2011-06-29 Ian Lance Taylor <iant@google.com>
4438 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4440 * layout.cc (Layout::layout_eh_frame): Likewise.
4442 2011-06-29 Ian Lance Taylor <iant@google.com>
4445 * layout.cc (Layout::symtab_section_shndx): New function.
4446 * layout.h (class Layout): Declare symtab_section_shndx.
4447 * output.cc (Output_section::write_header): Call it.
4449 2011-06-29 Ian Lance Taylor <iant@google.com>
4452 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4453 symbols which are not used in a relocation.
4455 2011-06-28 Ian Lance Taylor <iant@google.com>
4458 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4459 script create indistinguishable segments.
4460 (Layout::set_segment_offsets): Use stable_sort when sorting
4461 segments. Pass this to Compare_segments constructor.
4462 * layout.h (class Layout): Make segment_precedes non-static.
4463 (class Compare_segments): Change from struct to class. Add
4464 layout_ field. Add constructor.
4465 * script-sections.cc
4466 (Script_sections::attach_sections_using_phdrs_clause): Rename
4467 local orphan to is_orphan. Don't report failure to put empty
4468 section in segment. On attachment failure, report name of
4469 section, and attach to first PT_LOAD segment.
4471 2011-06-28 Ian Lance Taylor <iant@google.com>
4474 * target-select.cc (Target_selector::Target_selector): Add
4475 emulation parameter. Change all callers.
4476 (select_target_by_bfd_name): Rename from select_target_by_name.
4478 (select_target_by_emulation): New function.
4479 (supported_emulation_names): New function.
4480 * target-select.h (class Target_selector): Add emulation_ field.
4481 Update declarations.
4482 (Target_selector::recognize_by_bfd_name): Rename from
4483 recognize_by_name. Change all callers.
4484 (Target_selector::supported_bfd_names): Rename from
4485 supported_names. Change all callers.
4486 (Target_selector::recognize_by_emulation): New function.
4487 (Target_selector::supported_emulations): New function.
4488 (Target_selector::emulation): New function.
4489 (Target_selector::do_recognize_by_bfd_name): Rename from
4490 do_recognize_by_name. Change all callers.
4491 (Target_selector::do_supported_bfd_names): Rename from
4492 do_supported_names. Change all callers.
4493 (Target_selector::do_recognize_by_emulation): New function.
4494 (Target_selector::do_supported_emulations): New function.
4495 (select_target_by_bfd_name): Change name in declaration.
4496 (select_target_by_emulation): Declare.
4497 (supported_emulation_names): Declare.
4498 * parameters.cc (parameters_force_valid_target): Try to find
4499 target based on emulation from -m option.
4500 * options.h (class General_options): Change doc string for -m.
4501 * options.cc (help): Print emulations.
4502 (General_options::parse_V): Likewise.
4503 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4504 Add emulation parameter. Change all callers.
4506 2011-06-28 Ian Lance Taylor <iant@google.com>
4508 * target.h (class Target): Add osabi_ field.
4509 (Target::osabi): New function.
4510 (Target::set_osabi): New function.
4511 (Target::Target): Initialize osabi_.
4512 (Target::do_adjust_elf_header): Make pure virtual.
4513 (Sized_target::do_adjust_elf_header): Declare.
4514 * target.cc (Sized_target::do_adjust_elf_header): New function.
4515 (class Sized_target): Instantiate all versions.
4516 * freebsd.h (class Target_freebsd): Remove.
4517 (Target_selector_freebsd::do_recognize): Call set_osabi on
4519 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4520 (Target_selector_freebsd::set_osabi): Remove.
4521 * i386.cc (class Target_i386): Inherit from Sized_target rather
4522 than Target_freebsd.
4523 * x86_64.cc (class Target_x86_64): Likewise.
4525 2011-06-28 Ian Lance Taylor <iant@google.com>
4527 * target.h (Target::can_check_for_function_pointers): Rewrite.
4529 (Target::can_icf_inline_merge_sections): Likewise.
4530 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4531 (Target::Target_info): Add can_icf_inline_merge_sections field.
4532 (Target::do_can_check_for_function_pointers): New virtual
4534 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4535 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4536 from can_check_for_function_pointers, move in file.
4537 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4538 section_may_have_icf_unsafe_poineters, move in file.
4539 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4540 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4541 Rename from can_check_for_function_pointers, move in file.
4542 (Target_i386::can_icf_inline_merge_sections): Remove.
4543 (Target_i386::i386_info): Initialize
4544 can_icf_inline_merge_sections.
4545 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4546 Initialize can_icf_inline_merge_sections.
4547 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4548 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4549 Rename from can_check_for_function_pointers, move in file.
4550 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4551 (Target_x86_64::x86_64_info): Initialize
4552 can_icf_inline_merge_sections.
4553 * testsuite/testfile.cc (Target_test::test_target_info):
4555 * icf.cc (get_section_contents): Correct formatting.
4557 2011-06-27 Ian Lance Taylor <iant@google.com>
4559 * symtab.cc (Symbol::versioned_name): New function.
4560 (Symbol_table::add_to_final_symtab): Use versioned_name when
4562 (Symbol_table::sized_write_symbol): Likewise.
4563 * symtab.h (class Symbol): Declare versioned_name.
4564 * stringpool.h (class Stringpool_template): Add variant of add
4565 which takes a std::basic_string.
4566 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4567 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4568 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4569 (ver_test_12.o): New target.
4570 * testsuite/Makefile.in: Rebuild.
4572 2011-06-27 Doug Kwan <dougkwan@google.com>
4574 * arm.cc (Arm_relocate_functions::thm_jump8,
4575 Arm_relocate_functions::thm_jump11): Use a wider signed
4576 type to compute offset.
4577 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4579 * testsuite/Makefile.in: Regenerate.
4580 * testsuite/arm_branch_in_range.sh: Check test results of
4581 arm_thm_jump11 and arm_thm_jump8.
4582 * testsuite/arm_thm_jump11.s: New test source file.
4583 * testsuite/arm_thm_jump11.t: New linker script.
4584 * testsuite/arm_thm_jump8.s: New test source file.
4585 * testsuite/arm_thm_jump8.t: New linker script.
4587 2011-06-24 Ian Lance Taylor <iant@google.com>
4589 * layout.cc: Include "object.h".
4590 (ctors_sections_in_init_array): New static variable.
4591 (Layout::is_ctors_in_init_array): New function.
4592 (Layout::layout): Add entry to ctors_sections_in_init_array if
4594 * layout.h (class Layout): Declare is_ctors_in_init_array.
4595 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4596 is_ctors_reverse_view is set.
4597 (Sized_relobj_file::write_sections): Add layout parameter. Change
4598 all callers. Set is_ctors_reverse_view field of View_size.
4599 (Sized_relobj_file::reverse_words): New function.
4600 * object.h (Sized_relobj_file::View_size): Add
4601 is_ctors_reverse_view field.
4602 (class Sized_relobj_file): Update declarations.
4603 * testsuite/initpri3.c: New test.
4604 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4606 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4607 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4608 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4609 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4610 * testsuite/Makefile.in: Rebuild.
4612 2011-06-24 Cary Coutant <ccoutant@google.com>
4614 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4615 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4616 (debug_msg_cdebug.err): New targets.
4617 * testsuite/Makefile.in: Regenerate.
4618 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4619 Fix checks for link with shared library.
4621 2011-06-24 Doug Kwan <dougkwan@google.com>
4623 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4624 skip empty text sections.
4625 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4627 2011-06-22 Ian Lance Taylor <iant@google.com>
4630 * options.h (class General_options): Add --ctors-in-init-array.
4631 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4632 friends as SHT_PROGBITS for merging sections.
4633 (Layout::layout): Remove special handling of .init_array and
4634 friends. Don't sort if doing relocatable link. Sort for .ctors
4635 and .dtors if ctors_in_init_array.
4636 (Layout::make_output_section): Force correct section types for
4637 .init_array and friends. Don't sort if doing relocatable link,
4638 Don't sort .ctors and .dtors if ctors_in_init_array.
4639 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4640 (Layout::output_section_name): Add relobj parameter. Change all
4641 callers. Handle .ctors. and .dtors. in code rather than table.
4642 Handle .ctors and .dtors if ctors_in_init_array.
4643 (Layout::match_file_name): New function, moved from output.cc.
4644 * layout.h (class Layout): Update declarations.
4645 * output.cc: Include "layout.h".
4646 (Input_section_sort_entry::get_priority): New function.
4647 (Input_section_sort_entry::match_file_name): Just call
4648 Layout::match_file_name.
4649 (Output_section::Input_section_sort_init_fini_compare::operator()):
4650 Handle .ctors and .dtors. Sort by explicit priority rather than
4652 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4653 * testsuite/initpri2.c: New test.
4654 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4655 (check_PROGRAMS): Add initpri2.
4656 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4657 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4658 * configure, testsuite/Makefile.in: Rebuild.
4660 2011-06-19 Ian Lance Taylor <iant@google.com>
4663 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4664 .interp section to a PT_INTERP segment even if we have seen a
4665 --dynamic-linker option. Don't do it if we have seen a PHDRS
4666 clause in a linker script.
4667 (Layout::finalize): Don't create a .interp section if we've
4668 already create a PT_INTERP segment.
4669 (Layout::create_interp): Always call choose_output_section (revert
4670 patch of 2011-06-17). Don't create PT_INTERP segment.
4671 * script-sections.cc
4672 (Script_sections::create_note_and_tls_segments): Add a .interp
4673 section to a PT_INTERP segment even if we have seen a
4674 --dynamic-linker option.
4676 2011-06-18 Ian Lance Taylor <iant@google.com>
4678 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4679 merely because a non-PT_LOAD segment has a dynamic reloc.
4681 2011-06-18 Ian Lance Taylor <iant@google.com>
4683 * layout.cc (Layout::finish_dynamic_section): Don't create
4684 DT_FLAGS entry if not needed.
4686 2011-06-18 Ian Lance Taylor <iant@google.com>
4689 * layout.cc (Layout::layout_eh_frame): Correct handling of
4690 writable .eh_frame section.
4692 2011-06-17 Ian Lance Taylor <iant@google.com>
4695 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4696 symbol is redefined with the exact same object and value.
4698 2011-06-17 Ian Lance Taylor <iant@google.com>
4701 * layout.h (class Layout): Add interp_segment_ field.
4702 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4703 (Layout::attach_allocated_section_to_segment): If making shared
4704 library, put .interp section in PT_INTERP segment.
4705 (Layout::finalize): Also call create_interp if -dynamic-linker
4707 (Layout::create_interp): Assert that there is no PT_INTERP
4708 segment. If not using a SECTIONS clause, use make_output_section.
4709 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4710 * script-sections.cc
4711 (Script_sections::create_note_and_tls_segments): If making shared
4712 library, put .interp section in PT_INTERP segment.
4714 2011-06-17 Ian Lance Taylor <iant@google.com>
4716 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4717 when making a shared library.
4719 2011-06-17 Ian Lance Taylor <iant@google.com>
4721 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4722 parameter. Change all callers. Don't issue warning about PC32
4723 against locally defined symbol.
4725 2011-06-16 Ian Lance Taylor <iant@google.com>
4727 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4728 occurs in same object.
4730 2011-06-14 Alan Modra <amodra@gmail.com>
4732 * po/POTFILES.in: Regenerate.
4734 2011-06-09 Ian Lance Taylor <iant@google.com>
4736 * script-sections.cc
4737 (Orphan_output_section::set_section_addresses): For a relocatable
4738 link set address to 0.
4740 2011-06-09 Cary Coutant <ccoutant@google.com>
4743 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4744 used with --compress-debug-sections.
4745 * gold/object.cc (Sized_relobj_file::do_layout): Report
4746 uncompressed size of compressed input sections.
4748 2011-06-08 Cary Coutant <ccoutant@google.com>
4751 * testsuite/two_file_test_2_v1.cc: Change initialization of
4752 v2 to keep it in .data.
4754 2011-06-07 Cary Coutant <ccoutant@google.com>
4756 * common.cc (Symbol_table::do_allocate_commons_list): Call
4758 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4759 (Errors::fallback): New function.
4760 (gold_fallback): New function.
4761 * errors.h (Errors::fallback): New function.
4762 * gold.cc (gold_exit): Change status parameter to enum; adjust
4764 (queue_initial_tasks): Call gold_fallback.
4765 * gold.h: Include cstdlib.
4766 (Exit_status): New enum type.
4767 (gold_exit): Change status parameter to enum.
4768 (gold_fallback): New function.
4769 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4770 (Layout::create_symtab_sections): Likewise.
4771 (Layout::create_shdrs): Likewise.
4772 * main.cc (main): Adjust call to gold_exit.
4773 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4774 (Output_data_got::add_got_entry_pair): Likewise.
4775 (Output_section::add_input_section): Likewise.
4776 (Output_section::add_output_section_data): Likewise.
4777 (Output_segment::set_section_list_addresses): Likewise.
4778 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4780 2011-06-07 Cary Coutant <ccoutant@google.com>
4782 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4783 for incremental links.
4784 * output.cc (Output_segment::set_section_list_addresses): Remove
4785 FIXME and test for TLS or BSS.
4787 2011-06-07 Cary Coutant <ccoutant@google.com>
4789 * testsuite/Makefile.am: Add incremental_copy_test,
4790 incremental_common_test_1.
4791 * testsuite/Makefile.in: Regenerate.
4792 * testsuite/common_test_1_v1.c: New source file.
4793 * testsuite/common_test_1_v2.c: New source file.
4794 * testsuite/copy_test_v1.cc: New source file.
4796 2011-06-07 Cary Coutant <ccoutant@google.com>
4798 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4799 update, allocate common from bss section's free list.
4800 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4801 linker-defined symbols.
4802 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4803 Skip GOT and PLT entries that are no longer referenced.
4804 (Output_section_incremental_inputs::write_info_blocks): Mark
4805 linker-defined symbols.
4806 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4807 * output.cc (Output_section::allocate): New function.
4808 * output.h (Output_section::allocate): New function.
4809 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4810 linker-defined symbols.
4811 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4812 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4813 (Symbol::init_base_output_data): Likewise.
4814 (Symbol::init_base_output_segment): Likewise.
4815 (Symbol::init_base_constant): Likewise.
4816 (Sized_symbol::init_output_data): Likewise.
4817 (Sized_symbol::init_output_segment): Likewise.
4818 (Sized_symbol::init_constant): Likewise.
4819 (Symbol_table::do_define_in_output_data): Likewise.
4820 (Symbol_table::do_define_in_output_segment): Likewise.
4821 (Symbol_table::do_define_as_constant): Likewise.
4822 * symtab.h (Symbol::is_predefined): New function.
4823 (Symbol::init_base_output_data): Add is_predefined parameter.
4824 (Symbol::init_base_output_segment): Likewise.
4825 (Symbol::init_base_constant): Likewise.
4826 (Symbol::is_predefined_): New data member.
4827 (Sized_symbol::init_output_data): Add is_predefined parameter.
4828 (Sized_symbol::init_output_segment): Likewise.
4829 (Sized_symbol::init_constant): Likewise.
4830 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4832 2011-06-07 Cary Coutant <ccoutant@google.com>
4834 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4835 instead of emit_copy_reloc.
4836 (Copy_relocs::emit_copy_reloc): Refactor.
4837 (Copy_relocs::make_copy_reloc): New function.
4838 (Copy_relocs::add_copy_reloc): Remove.
4839 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4841 (Copy_relocs::make_copy_reloc): New function.
4842 (Copy_relocs::add_copy_reloc): Remove.
4843 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4844 unchanged input files.
4845 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4846 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4847 Reserve BSS space for COPY relocations.
4848 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4849 (Output_section_incremental_inputs::write_info_blocks): Record
4850 whether a symbol is copied from a shared object.
4851 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4852 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4853 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4854 (Incremental_input_entry_reader::get_output_symbol_index): Add
4856 (Incremental_binary::emit_copy_relocs): New function.
4857 (Incremental_binary::do_emit_copy_relocs): New function.
4858 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4860 (Sized_incremental_binary::add_copy_reloc): New function.
4861 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4862 (Sized_incremental_binary::Copy_reloc): New struct.
4863 (Sized_incremental_binary::Copy_relocs): New typedef.
4864 (Sized_incremental_binary::copy_relocs_): New data member.
4865 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4866 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4867 * target.h (Sized_target::emit_copy_reloc): New function.
4868 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4870 2011-06-02 Cary Coutant <ccoutant@google.com>
4873 * gold/archive.cc (Archive::Archive): Initialize new data member.
4874 (Archive::include_all_members): Return if archive has already been
4876 * gold/archive.h (Archive::include_all_members_): New data member.
4878 2011-06-02 Nick Clifton <nickc@redhat.com>
4880 * dynobj.h: Fix spelling mistake in comment.
4881 * output.cc: Likewise.
4883 2011-05-31 Doug Kwan <dougkwan@google.com>
4887 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
4888 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4889 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4890 redundant arm_exidx_test.so.
4891 * testsuite/Makefile.in: Regenerate.
4892 (check_SCRIPTS): Add pr12826.sh
4893 (check_DATA): Add pr12826.stdout
4894 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4895 * testsuite/pr12826.sh: New file.
4896 * testsuite/pr12826_1.s: Ditto.
4897 * testsuite/pr12826_1.s: Ditto.
4899 2011-05-30 Ian Lance Taylor <iant@google.com>
4901 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4904 2011-05-29 Ian Lance Taylor <iant@google.com>
4907 * testsuite/Makefile.am: Use different file name for two_file_test
4908 temporary file for each incremental test.
4909 * testsuite/Makefile.in: Rebuild.
4911 2011-05-29 Ian Lance Taylor <iant@google.com>
4913 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4914 binary input file is empty.
4916 2011-05-27 Ian Lance Taylor <iant@google.com>
4918 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4919 (ver_test_9.so): Likewise.
4920 * testsuite/Makefile.in: Rebuild.
4922 2011-05-26 Cary Coutant <ccoutant@google.com>
4924 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4925 * incremental.cc (Incremental_inputs::report_input_section): Fix
4926 comment, indentation.
4927 (Incremental_inputs::report_comdat_group): New function.
4928 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4929 of data for incremental input file entry.
4930 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4931 group count, COMDAT group signatures.
4932 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4933 an unchanged input file.
4934 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4935 Initialize new data member.
4936 (Incremental_object_entry::add_comdat_group): New function.
4937 (Incremental_object_entry::get_comdat_group_count): New function.
4938 (Incremental_object_entry::get_comdat_signature_key): New function.
4939 (Incremental_object_entry::groups_): New data member.
4940 (Incremental_inputs::report_comdat_group): New function.
4941 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4942 data for incremental input file entry.
4943 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4944 (Incremental_input_entry_reader::get_input_section): Adjust size of
4945 data for incremental input file entry.
4946 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4947 (Incremental_input_entry_reader::get_comdat_group_signature): New
4949 * object.cc (Sized_relobj::include_section_group): Report kept
4950 COMDAT groups for incremental links.
4952 2011-05-24 David Meyer <pdox@google.com>
4954 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4955 with name parameter. Add found_name parameter.
4956 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4957 * dirsearch.h (class Dirsearch): Update declaration.
4959 2011-05-24 Ian Lance Taylor <iant@google.com>
4961 * archive.cc (Library_base::should_include_member): Pull in object
4962 from archive if it defines the entry symbol.
4963 * parameters.cc (Parameters::entry): New function.
4964 * parameters.h (class Parameters): Declare entry.
4965 * output.h (class Output_file_header): Remove entry_ field.
4966 * output.cc (Output_file_header::Output_file_header): Remove entry
4967 parameter. Change all callers.
4968 (Output_file_header::entry): Use parameters->entry.
4969 * gold.cc (queue_middle_tasks): Likewise.
4970 * plugin.cc (Plugin_hook::run): Likewise.
4972 2011-05-24 Cary Coutant <ccoutant@google.com>
4974 * gold.cc (queue_initial_tasks): Pass incremental base filename
4975 to Output_file::open_base_file; don't print error message.
4976 * incremental-dump.cc (main): Adjust call to
4977 Output_file::open_for_modification.
4978 * incremental-dump.cc (main): Likewise.
4979 * incremental.cc (Incremental_inputs::report_command_line):
4980 Ignore --incremental-base option when comparing command lines.
4981 Ignore parameter when given as separate argument.
4982 * options.h (class General_options): Add --incremental-base.
4983 * output.cc (Output_file::Output_file):
4984 (Output_file::open_base_file): Add base_name and writable parameters;
4985 read base file into new file; print error message here.
4986 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4988 * output.h (Output_file::open_for_modification): Rename to...
4989 (Output_file::open_base_file): ...this; add base_name and
4990 writable parameters; adjust all callers.
4991 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4993 * testsuite/Makefile.am (incremental_test_4): Test
4995 * testsuite/Makefile.in: Regenerate.
4997 2011-05-24 Cary Coutant <ccoutant@google.com>
4999 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5001 * testsuite/Makefile.in: Regenerate.
5002 * testsuite/two_file_test_1_v1.cc: New test source file.
5003 * testsuite/two_file_test_1b_v1.cc: New test source file.
5004 * testsuite/two_file_test_2_v1.cc: New test source file.
5006 2011-05-24 Cary Coutant <ccoutant@google.com>
5008 * dynobj.h (Dynobj::do_dynobj): New function.
5009 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5010 flag and soname for shared objects.
5011 * incremental.cc (Incremental_inputs::report_object): Make
5012 either Incremental_object_entry or Incremental_dynobj_entry; add
5013 soname to string table.
5014 (Incremental_inputs::report_input_section): Add assertion.
5015 (Output_section_incremental_inputs::set_final_data_size): Adjust
5016 type of input file entry for shared libraries; adjust size of
5017 shared library info entry.
5018 (Output_section_incremental_inputs::write_input_files): Write
5019 as_needed flag for shared libraries.
5020 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5021 of input file entry for shared libraries; write soname.
5022 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5023 soname from incremental info.
5024 * incremental.h (enum Incremental_input_flags): Add
5025 INCREMENTAL_INPUT_AS_NEEDED.
5026 (Incremental_input_entry::Incremental_input_entry): Initialize new
5028 (Incremental_input_entry::set_as_needed): New function.
5029 (Incremental_input_entry::as_needed): New function.
5030 (Incremental_input_entry::do_dynobj_entry): New function.
5031 (Incremental_input_entry::as_needed_): New data member.
5032 (Incremental_object_entry::Incremental_object_entry): Don't check
5034 (Incremental_object_entry::do_type): Likewise.
5035 (class Incremental_dynobj_entry): New class.
5036 (Incremental_input_entry_reader::as_needed): New function.
5037 (Incremental_input_entry_reader::get_soname): New function.
5038 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5039 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5040 size of shared library info entry.
5041 * layout.cc (Layout::finish_dynamic_section): Don't test for
5042 incremental link when adding DT_NEEDED entries.
5043 * object.h (Object::Object): Initialize new data member.
5044 (Object::dynobj): New function.
5045 (Object::set_as_needed): New function.
5046 (Object::as_needed): New function.
5047 (Object::do_dynobj): New function.
5048 (Object::as_needed_): New data member.
5050 2011-05-24 Cary Coutant <ccoutant@google.com>
5052 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5053 info; adjust display of GOT entries.
5054 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5055 vector of input objects; remove file_status_.
5056 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5057 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5058 got_plt reader; call target hooks to reserve GOT entries.
5059 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5060 of input file info header and GOT info entry.
5061 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5063 (Got_plt_view_info::got_descriptor): Remove.
5064 (Got_plt_view_info::sym_index): New data member.
5065 (Got_plt_view_info::input_index): New data member.
5066 (Local_got_offset_visitor::visit): Write input file index.
5067 (Global_got_offset_visitor::visit): Write 0 for input file index.
5068 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5069 with sym_index and input_index.
5070 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5071 incremental info GOT entry; replace got_descriptor with input_index.
5072 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5073 map from input file index to object.
5074 (Sized_relobj_incr::do_layout): Replace direct data member reference
5075 with accessor function.
5076 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5077 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5078 Adjust size of input file info header.
5079 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5080 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5081 (Incremental_input_entry_reader::get_input_section): Adjust size of
5082 input file info header.
5083 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5084 of incremental info GOT entry.
5085 (Incremental_got_plt_reader::get_got_desc): Remove.
5086 (Incremental_got_plt_reader::get_got_symndx): New function.
5087 (Incremental_got_plt_reader::get_got_input_index): New function.
5088 (Sized_incremental_binary::Sized_incremental_binary): Remove
5089 file_status_; add input_objects_.
5090 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5091 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5092 (Sized_incremental_binary::file_is_unchanged): Remove.
5093 (Sized_incremental_binary::set_input_object): New function.
5094 (Sized_incremental_binary::input_object): New function.
5095 (Sized_incremental_binary::file_status_): Remove.
5096 (Sized_incremental_binary::input_objects_): New data member.
5097 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5099 (Sized_relobj_incr::invalid_address): Move to base class.
5100 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5102 (Sized_relobj_incr::do_output_section_offset): Likewise.
5103 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5104 (Sized_relobj_incr::section_offsets_): Likewise.
5105 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5107 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5108 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5109 with accessor function.
5110 (Sized_relobj_file::do_layout): Likewise.
5111 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5112 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5113 (Sized_relobj_file::compute_final_local_value): Replace refs to
5114 section_offsets_ with accessor function.
5115 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5116 * object.h (Relobj::Relobj): Initialize new data members.
5117 (Relobj::add_dyn_reloc): New function.
5118 (Relobj::first_dyn_reloc): New function.
5119 (Relobj::dyn_reloc_count): New function.
5120 (Relobj::first_dyn_reloc_): New data member.
5121 (Relobj::dyn_reloc_count_): New data member.
5122 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5124 (Sized_relobj::Address): New typedef.
5125 (Sized_relobj::invalid_address): Move here from child class.
5126 (Sized_relobj::Sized_relobj): Initialize new data members.
5127 (Sized_relobj::sized_relobj): New function.
5128 (Sized_relobj::is_output_section_offset_invalid): Move here from
5130 (Sized_relobj::get_output_section_offset): Likewise.
5131 (Sized_relobj::local_has_got_offset): Likewise.
5132 (Sized_relobj::local_got_offset): Likewise.
5133 (Sized_relobj::set_local_got_offset): Likewise.
5134 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5135 (Sized_relobj::clear_got_offsets): New function.
5136 (Sized_relobj::section_offsets): Move here from child class.
5137 (Sized_relobj::do_output_section_offset): Likewise.
5138 (Sized_relobj::do_set_section_offset): Likewise.
5139 (Sized_relobj::Local_got_offsets): Likewise.
5140 (Sized_relobj::local_got_offsets_): Likewise.
5141 (Sized_relobj::section_offsets_): Likewise.
5142 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5144 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5146 (Sized_relobj_file::sized_relobj): New function
5147 (Sized_relobj_file::local_has_got_offset): Move to base class.
5148 (Sized_relobj_file::local_got_offset): Likewise.
5149 (Sized_relobj_file::set_local_got_offset): Likewise.
5150 (Sized_relobj_file::get_output_section_offset): Likewise.
5151 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5152 (Sized_relobj_file::do_output_section_offset): Likewise.
5153 (Sized_relobj_file::do_set_section_offset): Likewise.
5154 (Sized_relobj_file::Local_got_offsets): Likewise.
5155 (Sized_relobj_file::local_got_offsets_): Likewise.
5156 (Sized_relobj_file::section_offsets_): Likewise.
5157 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5159 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5160 (Output_reloc::get_symbol_index): Likewise.
5161 (Output_reloc::local_section_offset): Likewise.
5162 (Output_reloc::get_address): Likewise.
5163 (Output_reloc::symbol_value): Likewise.
5164 (Output_data_got::reserve_slot): Move to class definition.
5165 (Output_data_got::reserve_local): New function.
5166 (Output_data_got::reserve_slot_for_global): Remove.
5167 (Output_data_got::reserve_global): New function.
5168 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5169 (all constructors, two instantiations).
5170 (Output_reloc::get_relobj): New function (two instantiations).
5171 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5172 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5173 (Output_data_reloc::add_global): Adjust type of relobj.
5174 (Output_data_reloc::add_global_relative): Likewise.
5175 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5176 (Output_data_reloc::add_local): Likewise.
5177 (Output_data_reloc::add_local_relative): Likewise.
5178 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5179 (Output_data_reloc::add_local_section): Likewise.
5180 (Output_data_reloc::add_output_section): Likewise.
5181 (Output_data_reloc::add_absolute): Likewise.
5182 (Output_data_reloc::add_target_specific): Likewise.
5183 (Output_data_got::reserve_slot): Move definition here.
5184 (Output_data_got::reserve_local): New function.
5185 (Output_data_got::reserve_global): New function.
5186 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5187 section_offsets_ with accessor function.
5188 (Sized_relobj_file::write_sections): Likewise.
5189 (Sized_relobj_file::do_relocate_sections): Likewise.
5190 * target.h (Sized_target::reserve_local_got_entry): New function.
5191 (Sized_target::reserve_global_got_entry): New function.
5192 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5193 (Target_x86_64::reserve_global_got_entry): New function.
5194 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5196 2011-05-23 Cary Coutant <ccoutant@google.com>
5198 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5199 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5200 bit when checking got_type.
5201 * incremental.cc (Sized_incremental_binary::setup_readers):
5202 Store symbol table and string table locations; initialize bit vector
5203 of file status flags.
5204 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5206 (Sized_incremental_binary::do_process_got_plt): New function.
5207 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5208 (Output_section_incremental_inputs::set_final_data_size): Record
5209 file index for each input file.
5210 (Output_section_incremental_inputs::write_got_plt): Store file index
5211 instead of input entry offset for each GOT entry.
5213 (Incremental_input_entry::Incremental_input_entry): Initialize new
5215 (Incremental_input_entry::set_offset): Store file index.
5216 (Incremental_input_entry::get_file_index): New function.
5217 (Incremental_input_entry::file_index_): New data member.
5218 (Incremental_binary::process_got_plt): New function.
5219 (Incremental_binary::do_process_got_plt): New function.
5220 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5222 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5223 (Sized_incremental_binary::set_file_is_unchanged): New function.
5224 (Sized_incremental_binary::file_is_unchanged): New function.
5225 (Sized_incremental_binary::do_process_got_plt): New function.
5226 (Sized_incremental_binary::file_status_): New data member.
5227 (Sized_incremental_binary::main_symtab_loc_): New data member.
5228 (Sized_incremental_binary::main_strtab_loc_): New data member.
5229 * output.cc (Output_data_got::Got_entry::write): Add case
5231 (Output_data_got::add_global): Call add_got_entry.
5232 (Output_data_got::add_global_plt): Likewise.
5233 (Output_data_got::add_global_with_rel): Likewise.
5234 (Output_data_got::add_global_with_rela): Likewise.
5235 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5236 (Output_data_got::add_global_pair_with_rela): Likewise.
5237 (Output_data_got::add_local): Call add_got_entry.
5238 (Output_data_got::add_local_plt): Likewise.
5239 (Output_data_got::add_local_with_rel): Likewise.
5240 (Output_data_got::add_local_with_rela): Likewise.
5241 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5242 (Output_data_got::add_local_pair_with_rela): Likewise.
5243 (Output_data_got::reserve_slot): New function.
5244 (Output_data_got::reserve_slot_for_global): New function.
5245 (Output_data_got::add_got_entry): New function.
5246 (Output_data_got::add_got_entry_pair): New function.
5247 (Output_section::add_output_section_data): Edit FIXME.
5249 (Output_section_data_build::Output_section_data_build): New
5250 constructor with size parameter.
5251 (Output_data_space::Output_data_space): Likewise.
5252 (Output_data_got::Output_data_got): Initialize new data member; new
5253 constructor with size parameter.
5254 (Output_data_got::add_constant): Call add_got_entry.
5255 (Output_data_got::reserve_slot): New function.
5256 (Output_data_got::reserve_slot_for_global): New function.
5257 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5258 (Output_data_got::add_got_entry): New function.
5259 (Output_data_got::add_got_entry_pair): New function.
5260 (Output_data_got::free_list_): New data member.
5261 * target.h (Sized_target::init_got_plt_for_update): New function.
5262 (Sized_target::register_global_plt_entry): New function.
5263 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5264 Initialize new data member; call init; add constructor with PLT count.
5265 (Output_data_plt_x86_64::init): New function.
5266 (Output_data_plt_x86_64::add_relocation): New function.
5267 (Output_data_plt_x86_64::reserve_slot): New function.
5268 (Output_data_plt_x86_64::free_list_): New data member.
5269 (Target_x86_64::init_got_plt_for_update): New function.
5270 (Target_x86_64::register_global_plt_entry): New function.
5271 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5272 incremental updates.
5273 (Output_data_plt_x86_64::add_relocation): New function.
5274 * testsuite/object_unittest.cc (Object_test): Set default options.
5276 2011-05-16 Ian Lance Taylor <iant@google.com>
5278 * options.h (class General_options): Make -i a synonym for -r.
5280 2011-05-16 Ian Lance Taylor <iant@google.com>
5282 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5284 2011-05-10 Cary Coutant <ccoutant@google.com>
5286 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5289 2011-05-06 Ian Lance Taylor <iant@google.com>
5291 * layout.cc (Layout::layout): If the output section flags change,
5292 update the ordering.
5294 2011-04-25 Cary Coutant <ccoutant@google.com>
5296 * incremental-dump.cc (dump_incremental_inputs): Print local
5297 symbol info for each input file.
5299 (Output_section_incremental_inputs::set_final_data_size): Add local
5300 symbol info to input file entries in incremental info.
5301 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5302 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5303 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5304 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5306 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5307 (Sized_incr_relobj::do_relocate): Write the local symbols.
5308 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5309 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5310 Adjust size of input file header.
5311 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5312 (Incremental_inputs_reader::get_local_symbol_count): New function.
5313 (Incremental_inputs_reader::get_input_section): Adjust size of input
5315 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5316 (Sized_incr_relobj::This): New typedef.
5317 (Sized_incr_relobj::sym_size): New const data member.
5318 (Sized_incr_relobj::Local_symbol): New struct.
5319 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5320 (Sized_incr_relobj::do_local_symbol_offset): New function.
5321 (Sized_incr_relobj::local_symbol_count_): New data member.
5322 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5323 (Sized_incr_relobj::local_symbol_index_): New data member.
5324 (Sized_incr_relobj::local_symbol_offset_): New data member.
5325 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5326 (Sized_incr_relobj::local_symbols_): New data member.
5327 * object.h (Relobj::output_local_symbol_count): New function.
5328 (Relobj::local_symbol_offset): New function.
5329 (Relobj::do_output_local_symbol_count): New function.
5330 (Relobj::do_local_symbol_offset): New function.
5331 (Sized_relobj::do_output_local_symbol_count): New function.
5332 (Sized_relobj::do_local_symbol_offset): New function.
5334 2011-04-22 Vladimir Simonov <sv@sw.ru>
5336 * descriptors.cc (set_close_on_exec): New function.
5337 (Descriptors::open): Use set_close_on_exec.
5338 * output.cc (S_ISLNK): Define if not defined.
5340 2011-04-22 Cary Coutant <ccoutant@google.com>
5342 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5344 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5345 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5346 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5348 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5349 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5350 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5352 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5354 (Incremental_binary::apply_incremental_relocs): New function.
5355 (Incremental_binary::do_apply_incremental_relocs): New function.
5356 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5358 (Sized_incremental_binary::add_global_symbol): New function.
5359 (Sized_incremental_binary::global_symbol): New function.
5360 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5361 (Sized_incremental_binary::symbol_map_): New data member.
5362 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5363 * target.h (Sized_target::apply_relocation): New function.
5364 * target-reloc.h (apply_relocation): New function.
5365 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5367 2011-04-22 Doug Kwan <dougkwan@google.com>
5369 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5370 flag of a SHT_ARM_EXIDX section.
5371 * testsuite/Makefile.am (arm_exidx_test): New test rules.
5372 * testsuite/Makefile.in: Regenerate.
5373 * testsuite/arm_exidx_test.s: New file.
5374 * testsuite/arm_exidx_test.sh: Same.
5376 2011-04-20 Cary Coutant <ccoutant@google.com>
5379 * archive.h (Incremental_archive_entry::Archive_member):
5380 Initialize arg_serial_ (second constructor).
5382 2011-04-17 Ian Lance Taylor <iant@google.com>
5384 * object.cc (Relocate_info::location): Simplify location string.
5385 * errors.cc (Errors::error_at_location): Don't print program
5387 (Errors::warning_at_location): Likewise.
5388 (Errors::undefined_symbol): Likewise.
5389 * testsuite/debug_msg.sh: Update accordingly.
5391 2011-04-14 Cary Coutant <ccoutant@google.com>
5393 * gold/layout.cc (Layout::symtab_section_offset): New function.
5394 * gold/layout.h (Layout::symtab_section_offset): New function.
5395 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5397 2011-04-12 Ian Lance Taylor <iant@google.com>
5399 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5400 with MREMAP_MAYMOVE.
5401 * output.h (class Output_file): Add map_is_allocated_ field.
5402 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5403 not available, provide stubs. If mremap is not available, #define
5405 (MREMAP_MAYMOVE): Define if not defined.
5406 (Output_file::Output_file): Initialize map_is_allocated_.
5407 (Output_file::resize): Check map_is_allocated_.
5408 (Output_file::map_anonymous): If mmap fails, use malloc.
5409 (Output_file::unmap): Don't do anything for an anonymous map.
5410 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5411 is not available, provide stubs.
5412 (File_read::View::~View): Use free rather than delete[].
5413 (File_read::make_view): Use malloc rather than new[]. If mmap
5415 (File_read::find_or_make_view): Use malloc rather than new[].
5416 * gold.h: Remove HAVE_REMAP code.
5417 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5418 exists. Rename mremap to gold_mremap. If mmap is not available
5420 * configure, config.in: Rebuild.
5422 2011-04-11 Ian Lance Taylor <iant@google.com>
5424 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5425 initialize local variable v.
5427 2011-04-11 Cary Coutant <ccoutant@google.com>
5429 * archive.cc (Archive::include_member): Adjust call to
5431 (Add_archive_symbols::run): Track argument serial numbers.
5432 (Lib_group::include_member): Likewise.
5433 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5434 * archive.h (Incremental_archive_entry::Archive_member):
5435 Initialize arg_serial_.
5436 (Archive_member::arg_serial_): New data member.
5437 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5438 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5440 (Sized_dynobj::do_for_all_local_got_entries): New function.
5441 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5443 * fileread.cc (get_mtime): New function.
5444 * fileread.h (get_mtime): New function.
5445 * gold.cc (queue_initial_tasks): Check for incremental update.
5446 (process_incremental_input): New function.
5447 (queue_middle_tasks): Don't force valid target for incremental
5449 * incremental-dump.cc (find_input_containing_global): Adjust
5450 size of symbol info entry.
5451 (dump_incremental_inputs): Dump argument serial number and
5452 in_system_directory flag; bias shndx by 1; print symbol names
5453 when dumping per-file symbol lists; use new symbol info readers.
5455 (Output_section_incremental_inputs:update_data_size): New function.
5456 (Sized_incremental_binary::setup_readers): Setup input readers
5457 for each input file; build maps for files added from libraries
5459 (Sized_incremental_binary::check_input_args): New function.
5460 (Sized_incremental_binary::do_check_inputs): Build map of argument
5461 serial numbers to input arguments.
5462 (Sized_incremental_binary::do_file_has_changed): Rename
5463 do_file_is_unchanged to this; compare file modification times.
5464 (Sized_incremental_binary::do_init_layout): New function.
5465 (Sized_incremental_binary::do_reserve_layout): New function.
5466 (Sized_incremental_binary::do_get_input_reader): Remove.
5467 (Sized_incremental_binary::get_symtab_view): New function.
5468 (Incremental_checker::can_incrementally_link_output_file): Remove.
5469 (Incremental_inputs::report_command_line): Exclude --debug options.
5470 (Incremental_inputs::report_archive_begin): Add parameter; track
5471 argument serial numbers; don't put input file entry for archive
5472 before archive members.
5473 (Incremental_inputs::report_archive_end): Put input file entry
5474 for archive after archive members.
5475 (Incremental_inputs::report_object): Add parameter; track argument
5476 serial numbers and in_system_directory flag.
5477 (Incremental_inputs::report_script): Add parameter; track argument
5479 (Output_section_incremental_inputs::set_final_data_size): Adjust
5480 size of symbol info entry; check for forwarding symbols.
5481 (Output_section_incremental_inputs::write_input_files): Write
5482 in_system_directory flag and argument serial number.
5483 (Output_section_incremental_inputs::write_info_blocks): Map section
5484 indices between incremental info and original input file; store
5485 input section index for each symbol.
5486 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5487 change operator() to visit().
5488 (class Global_got_offset_visitor): Likewise.
5489 (class Global_symbol_visitor_got_plt):
5490 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5492 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5493 (Sized_incr_relobj::do_read_symbols): New function.
5494 (Sized_incr_relobj::do_layout): New function.
5495 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5496 (Sized_incr_relobj::do_add_symbols): New function.
5497 (Sized_incr_relobj::do_should_include_member): New function.
5498 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5499 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5500 (Sized_incr_relobj::do_section_size): New function.
5501 (Sized_incr_relobj::do_section_name): New function.
5502 (Sized_incr_relobj::do_section_contents): New function.
5503 (Sized_incr_relobj::do_section_flags): New function.
5504 (Sized_incr_relobj::do_section_entsize): New function.
5505 (Sized_incr_relobj::do_section_address): New function.
5506 (Sized_incr_relobj::do_section_type): New function.
5507 (Sized_incr_relobj::do_section_link): New function.
5508 (Sized_incr_relobj::do_section_info): New function.
5509 (Sized_incr_relobj::do_section_addralign): New function.
5510 (Sized_incr_relobj::do_initialize_xindex): New function.
5511 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5512 (Sized_incr_relobj::do_read_relocs): New function.
5513 (Sized_incr_relobj::do_gc_process_relocs): New function.
5514 (Sized_incr_relobj::do_scan_relocs): New function.
5515 (Sized_incr_relobj::do_count_local_symbols): New function.
5516 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5517 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5518 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5519 (Sized_incr_relobj::do_relocate): New function.
5520 (Sized_incr_relobj::do_set_section_offset): New function.
5521 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5522 (Sized_incr_dynobj::do_read_symbols): New function.
5523 (Sized_incr_dynobj::do_layout): New function.
5524 (Sized_incr_dynobj::do_add_symbols): New function.
5525 (Sized_incr_dynobj::do_should_include_member): New function.
5526 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5527 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5528 (Sized_incr_dynobj::do_section_size): New function.
5529 (Sized_incr_dynobj::do_section_name): New function.
5530 (Sized_incr_dynobj::do_section_contents): New function.
5531 (Sized_incr_dynobj::do_section_flags): New function.
5532 (Sized_incr_dynobj::do_section_entsize): New function.
5533 (Sized_incr_dynobj::do_section_address): New function.
5534 (Sized_incr_dynobj::do_section_type): New function.
5535 (Sized_incr_dynobj::do_section_link): New function.
5536 (Sized_incr_dynobj::do_section_info): New function.
5537 (Sized_incr_dynobj::do_section_addralign): New function.
5538 (Sized_incr_dynobj::do_initialize_xindex): New function.
5539 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5540 (make_sized_incremental_object): New function.
5541 (Incremental_library::copy_unused_symbols): New function.
5542 (Incremental_library::do_for_all_unused_symbols): New function.
5543 * incremental.h (enum Incremental_input_flags): New type.
5544 (class Incremental_checker): Remove.
5545 (Incremental_input_entry::Incremental_input_entry): Add argument
5547 (Incremental_input_entry::arg_serial): New function.
5548 (Incremental_input_entry::set_is_in_system_directory): New function.
5549 (Incremental_input_entry::is_in_system_directory): New function.
5550 (Incremental_input_entry::arg_serial_): New data member.
5551 (Incremental_input_entry::is_in_system_directory_): New data member.
5552 (class Script_info): Move here from script.h.
5553 (Script_info::Script_info): Add filename parameter.
5554 (Script_info::filename): New function.
5555 (Script_info::filename_): New data member.
5556 (Incremental_script_entry::Incremental_script_entry): Add argument
5558 (Incremental_object_entry::Incremental_object_entry): Likewise.
5559 (Incremental_object_entry::add_input_section): Build list of input
5560 sections with map to original shndx.
5561 (Incremental_object_entry::get_input_section_index): New function.
5562 (Incremental_object_entry::shndx_): New data member.
5563 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5564 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5565 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5567 (Incremental_inputs::report_archive_begin): Likewise.
5568 (Incremental_inputs::report_object): Likewise.
5569 (Incremental_inputs::report_script): Likewise.
5570 (class Incremental_global_symbol_reader): New class.
5571 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5572 and store flags and input file type.
5573 (Incremental_input_entry_reader::arg_serial): New function.
5574 (Incremental_input_entry_reader::type): Extract type from flags.
5575 (Incremental_input_entry_reader::is_in_system_directory): New function.
5576 (Incremental_input_entry_reader::get_input_section_count): Call
5577 accessor function for type.
5578 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5579 function for type; adjust size of global symbol entry.
5580 (Incremental_input_entry_reader::get_global_symbol_count): Call
5581 accessor function for type.
5582 (Incremental_input_entry_reader::get_object_count): Likewise.
5583 (Incremental_input_entry_reader::get_object_offset): Likewise.
5584 (Incremental_input_entry_reader::get_member_count): Likewise.
5585 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5586 (Incremental_input_entry_reader::get_member_offset): Likewise.
5587 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5588 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5589 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5590 (Incremental_input_entry_reader::get_global_symbol_reader): New
5592 (Incremental_input_entry_reader::get_output_symbol_index): New
5594 (Incremental_input_entry_reader::type_): Remove.
5595 (Incremental_input_entry_reader::flags_): New data member.
5596 (Incremental_inputs_reader::input_file_offset): New function.
5597 (Incremental_inputs_reader::input_file_index): New function.
5598 (Incremental_inputs_reader::input_file): Call input_file_offset.
5599 (Incremental_inputs_reader::input_file_at_offset): New function.
5600 (Incremental_relocs_reader::get_r_type): Reformat.
5601 (Incremental_relocs_reader::get_r_shndx): Reformat.
5602 (Incremental_relocs_reader::get_r_offset): Reformat.
5603 (Incremental_relocs_reader::data): New function.
5604 (Incremental_binary::Incremental_binary): Initialize new data members.
5605 (Incremental_binary::check_inputs): Add cmdline parameter.
5606 (Incremental_binary::file_is_unchanged): Remove.
5607 (Input_reader::arg_serial): New function.
5608 (Input_reader::get_unused_symbol_count): New function.
5609 (Input_reader::get_unused_symbol): New function.
5610 (Input_reader::do_arg_serial): New function.
5611 (Input_reader::do_get_unused_symbol_count): New function.
5612 (Input_reader::do_get_unused_symbol): New function.
5613 (Incremental_binary::input_file_count): New function.
5614 (Incremental_binary::get_input_reader): Change signature to use
5615 index instead of filename.
5616 (Incremental_binary::file_has_changed): New function.
5617 (Incremental_binary::get_input_argument): New function.
5618 (Incremental_binary::get_library): New function.
5619 (Incremental_binary::get_script_info): New function.
5620 (Incremental_binary::init_layout): New function.
5621 (Incremental_binary::reserve_layout): New function.
5622 (Incremental_binary::output_file): New function.
5623 (Incremental_binary::do_check_inputs): New function.
5624 (Incremental_binary::do_file_is_unchanged): Remove.
5625 (Incremental_binary::do_file_has_changed): New function.
5626 (Incremental_binary::do_init_layout): New function.
5627 (Incremental_binary::do_reserve_layout): New function.
5628 (Incremental_binary::do_input_file_count): New function.
5629 (Incremental_binary::do_get_input_reader): Change signature.
5630 (Incremental_binary::input_args_map_): New data member.
5631 (Incremental_binary::library_map_): New data member.
5632 (Incremental_binary::script_map_): New data member.
5633 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5635 (Sized_incremental_binary::output_section): New function.
5636 (Sized_incremental_binary::inputs_reader): Add const.
5637 (Sized_incremental_binary::symtab_reader): Add const.
5638 (Sized_incremental_binary::relocs_reader): Add const.
5639 (Sized_incremental_binary::got_plt_reader): Add const.
5640 (Sized_incremental_binary::get_symtab_view): New function.
5641 (Sized_incremental_binary::Inputs_reader): New typedef.
5642 (Sized_incremental_binary::Input_entry_reader): New typedef.
5643 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5644 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5645 (Sized_incremental_binary::do_file_has_changed): New function.
5646 (Sized_incremental_binary::do_init_layout): New function.
5647 (Sized_incremental_binary::do_reserve_layout): New function.
5648 (Sized_input_reader::Inputs_reader): Remove.
5649 (Sized_input_reader::Input_entry_reader): Remove.
5650 (Sized_input_reader::do_arg_serial): New function.
5651 (Sized_input_reader::do_get_unused_symbol_count): New function.
5652 (Sized_input_reader::do_get_unused_symbol): New function.
5653 (Sized_incremental_binary::do_input_file_count): New function.
5654 (Sized_incremental_binary::do_get_input_reader): Change signature;
5655 use index instead of filename.
5656 (Sized_incremental_binary::section_map_): New data member.
5657 (Sized_incremental_binary::input_entry_readers_): New data member.
5658 (class Sized_incr_relobj): New class.
5659 (class Sized_incr_dynobj): New class.
5660 (make_sized_incremental_object): New function.
5661 (class Incremental_library): New class.
5662 * layout.cc (Free_list::num_lists): New static data member.
5663 (Free_list::num_nodes): New static data member.
5664 (Free_list::num_removes): New static data member.
5665 (Free_list::num_remove_visits): New static data member.
5666 (Free_list::num_allocates): New static data member.
5667 (Free_list::num_allocate_visits): New static data member.
5668 (Free_list::init): New function.
5669 (Free_list::remove): New function.
5670 (Free_list::allocate): New function.
5671 (Free_list::dump): New function.
5672 (Free_list::print_stats): New function.
5673 (Layout_task_runner::run): Resize output file for incremental updates.
5674 (Layout::Layout): Initialize new data members.
5675 (Layout::set_incremental_base): New function.
5676 (Layout::init_fixed_output_section): New function.
5677 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5678 incremental updates.
5679 (Layout::create_gold_note): Do not create gold note section for
5680 incremental updates.
5681 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5682 for incremental updates.
5683 (Layout::set_section_offsets): For incremental updates, allocate space
5685 (Layout::create_symtab_sections): Layout with offsets relative to
5686 start of section; for incremental updates, allocate space from free
5688 (Layout::create_shdrs): For incremental updates, allocate space from
5690 (Layout::finish_dynamic_section): For incremental updates, do not
5691 check --as-needed (fixed in subsequent patch).
5692 * layout.h (class Free_list): New class.
5693 (Layout::set_incremental_base): New function.
5694 (Layout::incremental_base): New function.
5695 (Layout::init_fixed_output_section): New function.
5696 (Layout::allocate): New function.
5697 (Layout::incremental_base_): New data member.
5698 (Layout::free_list_): New data member.
5699 * main.cc (main): Print Free_list statistics.
5700 * object.cc (Relobj::finalize_incremental_relocs): Add
5701 clear_counts parameter; clear counts only when clear_counts is set.
5702 (Sized_relobj::Sized_relobj): Initialize new base class.
5703 (Sized_relobj::do_layout): Don't report special sections.
5704 (Sized_relobj::do_for_all_local_got_entries): New function.
5705 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5706 symtab_off to all symbol table offsets.
5707 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5708 * object.h (class Got_offset_list): Move to top of file.
5709 (Object::Object): Allow case where input_file == NULL.
5710 (Object::~Object): Likewise.
5711 (Object::input_file): Assert that input_file != NULL.
5712 (Object::lock): Allow case where input_file == NULL.
5713 (Object::unlock): Likewise.
5714 (Object::is_locked): Likewise.
5715 (Object::token): Likewise.
5716 (Object::release): Likewise.
5717 (Object::is_incremental): New function.
5718 (Object::get_mtime): New function.
5719 (Object::for_all_local_got_entries): New function.
5720 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5721 (Object::set_is_in_system_directory): New function.
5722 (Object::is_in_system_directory): New function.
5723 (Object::do_is_incremental): New function.
5724 (Object::do_get_mtime): New function.
5725 (Object::do_for_all_local_got_entries): New function.
5726 (Object::is_in_system_directory_): New data member.
5727 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5728 (class Sized_relobj_base): New class.
5729 (class Sized_relobj): Derive from Sized_relobj_base.
5730 (class Sized_relobj::Symbols): Redeclare from base class.
5731 (class Sized_relobj::local_got_offset_list): Remove.
5732 (class Sized_relobj::Output_sections): Redeclare from base class.
5733 (class Sized_relobj::do_for_all_local_got_entries): New function.
5734 (class Sized_relobj::write_local_symbols): Add offset parameter.
5735 (class Sized_relobj::local_symbol_offset_): Update comment.
5736 (class Sized_relobj::local_dynsym_offset_): Update comment.
5737 * options.cc (Input_arguments::add_file): Remove const.
5738 * options.h (Input_file_argument::Input_file_argument):
5739 Initialize arg_serial_ (all constructors).
5740 (Input_file_argument::set_arg_serial): New function.
5741 (Input_file_argument::arg_serial): New function.
5742 (Input_file_argument::arg_serial_): New data member.
5743 (Input_arguments::Input_arguments): Initialize file_count_.
5744 (Input_arguments::add_file): Remove const.
5745 (Input_arguments::number_of_input_files): New function.
5746 (Input_arguments::file_count_): New data member.
5747 (Command_line::number_of_input_files): Call
5748 Input_arguments::number_of_input_files.
5749 * output.cc (Output_segment_headers::Output_segment_headers):
5751 (Output_section::Input_section::current_data_size): New function.
5752 (Output_section::Output_section): Initialize new data members.
5753 (Output_section::add_input_section): Don't do merge sections for
5754 an incremental link; allocate space from free list for an
5756 (Output_section::add_output_section_data): Allocate space from
5757 free list for an incremental update.
5758 (Output_section::update_data_size): New function.
5759 (Output_section::set_fixed_layout): New function.
5760 (Output_section::reserve): New function.
5761 (Output_segment::set_section_addresses): Remove const.
5762 (Output_segment::set_section_list_addresses): Remove const; allocate
5763 space from free list for an incremental update.
5764 (Output_segment::set_offset): Adjust size of RELRO segment for an
5766 * output.h (Output_data::current_data_size): Move here from
5768 (Output_data::pre_finalize_data_size): New function.
5769 (Output_data::update_data_size): New function.
5770 (Output_section_headers::update_data_size): new function.
5771 (Output_section_data_build::current_data_size): Move to Output_data.
5772 (Output_data_strtab::update_data_size): New function.
5773 (Output_section::current_data_size): Move to Output_data.
5774 (Output_section::set_fixed_layout): New function.
5775 (Output_section::has_fixed_layout): New function.
5776 (Output_section::reserve): New function.
5777 (Output_section::update_data_size): New function.
5778 (Output_section::has_fixed_layout_): New data member.
5779 (Output_section::free_list_): New data member.
5780 (Output_segment::set_section_addresses): Remove const.
5781 (Output_segment::set_section_list_addresses): Remove const.
5782 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5784 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5786 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5787 parameter when calling Add_symbols constructor; store argument
5788 serial number for members of a lib group.
5789 (Add_symbols::locks): Allow case where token == NULL.
5790 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5791 (Read_member::~Read_member): New function.
5792 (Read_member::is_runnable): New function.
5793 (Read_member::locks): New function.
5794 (Read_member::run): New function.
5795 (Check_script::~Check_script): New function.
5796 (Check_script::is_runnable): New function.
5797 (Check_script::locks): New function.
5798 (Check_script::run): New function.
5799 (Check_library::~Check_library): New function.
5800 (Check_library::is_runnable): New function.
5801 (Check_library::locks): New function.
5802 (Check_library::run): New function.
5803 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5804 (Add_symbols::library_): New data member.
5805 (class Read_member): New class.
5806 (class Check_script): New class.
5807 (class Check_library): New class.
5808 * reloc.cc (Read_relocs::is_runnable): Allow case where
5810 (Read_relocs::locks): Likewise.
5811 (Scan_relocs::locks): Likewise.
5812 (Relocate_task::locks): Likewise.
5813 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5815 (Sized_relobj::incremental_relocs_scan): Fix comment.
5816 (Sized_relobj::do_relocate): Pass output file offset to
5817 write_local_symbols.
5818 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5819 from class declaration.
5820 * script.cc (read_input_script): Allocate Script_info; pass
5821 argument serial number to report_script.
5822 * script.h (class Script_info): Move to incremental.h.
5823 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5824 * symtab.h (Symbol_table::add_from_incrobj): New function.
5825 (Symbol_table::set_file_offset): New function.
5827 2011-04-05 Cary Coutant <ccoutant@google.com>
5829 * incremental-dump.cc (dump_incremental_inputs): Change signature
5830 to take a Sized_incremental_binary; change caller. Use readers
5831 in Sized_incremental_binary.
5833 (Sized_incremental_binary::find_incremental_inputs_sections):
5834 Rename do_find_incremental_inputs_sections to this.
5835 (Sized_incremental_binary::setup_readers): New function.
5836 (Sized_incremental_binary::do_check_inputs): Check
5837 has_incremental_info_ flag; move setup code to setup_readers;
5839 (Sized_incremental_binary::do_file_is_unchanged): New function.
5840 (Sized_incremental_binary::do_get_input_reader): New function.
5841 * incremental.h (class Incremental_binary): Move to end of file.
5842 (Incremental_binary::file_is_unchanged): New function.
5843 (Incremental_binary::do_file_is_unchanged): New function.
5844 (Incremental_binary::Input_reader): New class.
5845 (Incremental_binary::get_input_reader): New function.
5846 (class Sized_incremental_binary): Move to end of file.
5847 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5848 input section reader classes.
5849 (Sized_incremental_binary::has_incremental_info): New function.
5850 (Sized_incremental_binary::inputs_reader): New function.
5851 (Sized_incremental_binary::symtab_reader): New function.
5852 (Sized_incremental_binary::relocs_reader): New function.
5853 (Sized_incremental_binary::got_plt_reader): New function.
5854 (Sized_incremental_binary::do_file_is_unchanged): New function.
5855 (Sized_incremental_binary::Sized_input_reader): New class.
5856 (Sized_incremental_binary::get_input_reader): New function.
5857 (Sized_incremental_binary::find_incremental_inputs_sections):
5858 Rename do_find_incremental_inputs_sections to this.
5859 (Sized_incremental_binary::setup_readers): New function.
5860 (Sized_incremental_binary::has_incremental_info_): New data member.
5861 (Sized_incremental_binary::inputs_reader_): New data member.
5862 (Sized_incremental_binary::symtab_reader_): New data member.
5863 (Sized_incremental_binary::relocs_reader_): New data member.
5864 (Sized_incremental_binary::got_plt_reader_): New data member.
5865 (Sized_incremental_binary::current_input_file_): New data member.
5867 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5870 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5873 2011-03-30 Cary Coutant <ccoutant@google.com>
5875 * archive.cc (Archive::include_member): Adjust call to report_object.
5876 (Add_archive_symbols::run): Add script_info to call to
5877 report_archive_begin.
5878 (Lib_group::include_member): Adjust call to report_object.
5879 (Add_lib_group_symbols::run): Adjust call to report_object.
5880 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5881 blocks. Add object count for script input files.
5882 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5883 script_info parameter; change all callers.
5884 (Incremental_inputs::report_object): Add script_info parameter;
5886 (Incremental_inputs::report_script): Store backpointer to
5887 incremental info entry.
5888 (Output_section_incremental_inputs::set_final_data_size): Record
5889 additional information for scripts.
5890 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5891 * incremental.h (Incremental_script_entry::add_object): New function.
5892 (Incremental_script_entry::get_object_count): New function.
5893 (Incremental_script_entry::get_object): New function.
5894 (Incremental_script_entry::objects_): New data member; adjust
5896 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5897 (Incremental_inputs::report_object): Add script_info parameter.
5898 (Incremental_inputs_reader::get_object_count): New function.
5899 (Incremental_inputs_reader::get_object_offset): New function.
5900 * options.cc (Input_arguments::add_file): Return reference to
5902 * options.h (Input_argument::set_script_info): New function.
5903 (Input_argument::script_info): New function.
5904 (Input_argument::script_info_): New data member; adjust all
5906 (Input_file_group::add_file): Return reference to new input argument.
5907 (Input_file_lib::add_file): Likewise.
5908 (Input_arguments::add_file): Likewise.
5909 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5910 * script.cc (Parser_closure::Parser_closure): Add script_info
5911 parameter; adjust all callers.
5912 (Parser_closure::script_info): New function.
5913 (Parser_closure::script_info_): New data member.
5914 (read_input_script): Report scripts earlier to incremental info.
5915 (script_add_file): Set script_info in Input_argument.
5916 (script_add_library): Likewise.
5917 * script.h (Script_options::Script_info): Rewrite class.
5919 2011-03-29 Cary Coutant <ccoutant@google.com>
5921 * archive.cc (Library_base::should_include_member): Move
5922 method here from class Archive.
5923 (Archive::Archive): Initialize base class.
5924 (Archive::should_include_member): Move to base class.
5925 (Archive::do_for_all_unused_symbols): New function.
5926 (Add_archive_symbols::run): Remove redundant access to
5928 (Lib_group::Lib_group): Initialize base class.
5929 (Lib_group::do_filename): New function.
5930 (Lib_group::include_member): Pass pointer to Lib_group to
5932 (Lib_group::do_for_all_unused_symbols): New function.
5933 (Add_lib_group_symbols::run): Report archive information for
5935 * archive.h (class Library_base): New base class.
5936 (class Archive): Derive from Library_base.
5937 (Archive::filename): Move to base class.
5938 (Archive::set_incremental_info): Likewise.
5939 (Archive::incremental_info): Likewise.
5940 (Archive::Should_include): Likewise.
5941 (Archive::should_include_member): Likewise.
5942 (Archive::Armap_entry): Remove.
5943 (Archive::Unused_symbol_iterator): Remove.
5944 (Archive::unused_symbols_begin): Remove.
5945 (Archive::unused_symbols_end): Remove.
5946 (Archive::do_filename): New function.
5947 (Archive::do_get_mtime): New function.
5948 (Archive::do_for_all_unused_symbols): New function.
5949 (Archive::task_): Move to base class.
5950 (Archive::incremental_info_): Likewise.
5951 (class Lib_group): Derive from Library_base.
5952 (Lib_group::do_filename): New function.
5953 (Lib_group::do_get_mtime): New function.
5954 (Lib_group::do_for_all_unused_symbols): New function.
5955 (Lib_group::task_): Move to base class.
5956 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5958 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5960 * incremental.cc (Incremental_inputs::report_archive_begin):
5961 Use Library_base; call library's get_mtime; add incremental inputs
5962 entry before members.
5963 (class Unused_symbol_visitor): New class.
5964 (Incremental_inputs::report_archive_end): Use Library_base; use
5965 visitor class to record unused symbols; don't add incremental inputs
5966 entry after members.
5967 (Incremental_inputs::report_object): Use Library_base.
5969 (Incremental_archive_entry::Incremental_archive_entry): Remove
5970 unused Archive parameter.
5971 (Incremental_inputs::report_archive_begin): Use Library_base.
5972 (Incremental_inputs::report_archive_end): Likewise.
5973 (Incremental_inputs::report_object): Likewise.
5974 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5976 * object.h (Object::for_all_global_symbols): New function.
5977 (Object::do_for_all_global_symbols): New function.
5978 (Sized_relobj::do_for_all_global_symbols): New function.
5979 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5981 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5984 2011-03-27 Ian Lance Taylor <iant@google.com>
5986 * archive.cc (Archive::interpret_header): Return -1 if something
5987 goes wrong. Change callers accordingly.
5989 2011-03-25 Cary Coutant <ccoutant@google.com>
5991 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5992 * testsuite/Makefile.in: Regenerate.
5994 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
5996 * plugin.cc (get_view): New.
5997 (Plugin::load): Pass get_view to the plugin.
5998 (Plugin_manager::get_view): New.
6000 2011-03-21 Ian Lance Taylor <iant@google.com>
6002 * testsuite/final_layout.sh: Rewrite to not use dc.
6003 * testsuite/relro_test.sh: Fail if dc is not present.
6005 2011-03-21 Sriraman Tallam <tmsriram@google.com>
6007 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6009 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6010 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6012 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6013 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6015 2011-03-14 Ian Lance Taylor <iant@google.com>
6017 * script-sections.cc (Sort_output_sections::script_compare):
6018 Rename from is_before, change return type.
6019 (Sort_output_sections::operator()): Adjust accordingly.
6021 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6024 * testsuite/odr_violation2.cc: Add comment to make all error line
6025 numbers double digits.
6026 * testsuite/debug_msg.sh: Adjust expected errors.
6028 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6030 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6031 but mark earlier ones as non-canonical
6032 (offset_to_iterator): Update search target and example
6033 (do_addr2line): Return extra lines in a vector*
6034 (format_file_lineno): Extract from do_addr2line
6035 (one_addr2line): Add vector* out-param
6036 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6037 when a lineno entry appeared last for its instruction
6038 (Dwarf_line_info): Add vector* out-param
6039 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6040 * symtab.cc (Odr_violation_compare): Include the lineno in the
6042 (linenos_from_loc): New. Combine the canonical line for an
6043 address with its other lines.
6044 (True_if_intersect): New. Helper functor to make
6045 std::set_intersection a query.
6046 (detect_odr_violations): Compare sets of lines instead of just
6047 one line for each function. This became less deterministic, but
6048 has fewer false positives.
6049 * symtab.h: Declarations.
6050 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6051 mix an optimized and non-optimized object in the same binary
6052 (odr_violation2.so): Same.
6053 * testsuite/Makefile.in: Regenerate from Makefile.am.
6054 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6055 * testsuite/debug_msg.sh: Update line numbers and add
6057 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6058 non-optimized context.
6059 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6060 isn't inlined, and use OdrDerived in an optimized context.
6061 * testsuite/odr_header1.h: Defines OdrDerived, where
6062 optimization will change the
6063 first-instruction-in-the-destructor's file and line number.
6064 * testsuite/odr_header2.h: Defines OdrBase.
6066 2011-03-09 Ian Lance Taylor <iant@google.com>
6068 * fileread.cc (File_read::clear_views): Don't delete the whole
6071 2011-03-08 Ian Lance Taylor <iant@google.com>
6074 * fileread.cc: #include <climits>.
6075 (GOLD_IOV_MAX): Define.
6076 (File_read::read_multiple): Limit number of entries by iov_max.
6077 * fileread.h (class File_read): Always set max_readv_entries to
6080 2011-03-07 Ian Lance Taylor <iant@google.com>
6083 * options.h (class General_options): Add -dy and -dn.
6085 2011-03-02 Cary Coutant <ccoutant@google.com>
6087 * testsuite/script_test_9.t: Add TLS segment.
6089 2011-03-02 Simon Baldwin <simonb@google.com>
6091 * configure.ac: Add check for gnu_indirect_function support in
6092 the toolchain building binutils.
6093 * configure: Rebuild.
6095 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
6097 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6098 plugin only symbols.
6099 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6100 in plugin files as not needed in the symbol table.
6102 2011-02-11 Sriraman Tallam <tmsriram@google.com>
6104 * output.cc (Output_section::add_input_section): Delay fill
6105 generation for section ordering.
6107 2011-02-09 Ian Lance Taylor <iant@google.com>
6110 * object.h (class Sized_relobj): Remove clear_local_symbols.
6111 * reloc.cc (Sized_relobj::do_relocate): Don't call
6112 clear_local_symbols.
6114 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
6116 * plugin.cc (is_visible_from_outside): Return true for symbols
6119 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6121 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6124 2011-02-02 Sriraman Tallam <tmsriram@google.com>
6126 * icf.h (is_section_foldable_candidate): Change type of parameter
6128 * icf.cc (Icf::find_identical_sections): Change type of local variable
6129 section_name to be std::string.
6130 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6132 2011-01-25 Ian Lance Taylor <iant@google.com>
6134 * script.cc (script_add_extern): Rewrite to use
6135 add_symbol_reference.
6137 2011-01-25 Doug Kwan <dougkwan@google.com>
6139 * icf.cc (get_section_contents): Always lock section's object.
6141 2011-01-24 Ian Lance Taylor <iant@google.com>
6143 * options.h (class General_options): Accept
6144 --no-detect-odr-violations.
6146 2011-01-24 Ian Lance Taylor <iant@google.com>
6148 * version.cc (version_string): Bump to 1.11.
6150 2011-01-24 Ian Lance Taylor <iant@google.com>
6152 * plugin.cc (class Plugin_rescan): Define new class.
6153 (Plugin_manager::claim_file): Set any_claimed_.
6154 (Plugin_manager::save_archive): New function.
6155 (Plugin_manager::save_input_group): New function.
6156 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6158 (Plugin_manager::new_undefined_symbol): New function.
6159 (Plugin_manager::rescan): New function.
6160 (Plugin_manager::rescannable_defines): New function.
6161 (Plugin_manager::add_input_file): Set any_added_.
6162 * plugin.h (class Plugin_manager): define new fields rescannable_,
6163 undefined_symbols_, any_claimed_, and any_added_. Declare
6164 Plugin_rescan as friend. Declare new functions.
6165 (Plugin_manager::Rescannable): Define type.
6166 (Plugin_manager::Rescannable_list): Define type.
6167 (Plugin_manager::Undefined_symbol_list): Define type.
6168 (Plugin_manager::Plugin_manager): Initialize new fields.
6169 * archive.cc (Archive::defines_symbol): New function.
6170 (Add_archive_symbols::run): Pass archive to plugins if any.
6171 * archive.h (class Archive): Declare defines_symbol.
6172 * readsyms.cc (Input_group::~Input_group): New function.
6173 (Finish_group::run): Pass input_group to plugins if any.
6174 * readsyms.h (class Input_group): Declare destructor.
6175 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6178 2011-01-10 Ian Lance Taylor <iant@google.com>
6180 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6182 (Layout::set_segment_offsets): Reset increase_relro before calling
6183 set_section_addresses a second time.
6185 2011-01-04 Cary Coutant <ccoutant@google.com>
6187 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6188 sections before NOBITS sections.
6190 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6192 * version.cc (print_version): Update copyright to 2011.
6194 2010-12-23 Cary Coutant <ccoutant@google.com>
6196 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6197 of OS to this->add. Add OD parameter to second form of the function.
6199 2010-12-20 Ian Lance Taylor <iant@google.com>
6201 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6202 second of two consecutive entries with same offset.
6204 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6206 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6207 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6208 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6209 to avoid unneeded links against $(LDADD).
6210 * testsuite/Makefile.in: Regenerate.
6212 2010-12-15 Ian Lance Taylor <iant@google.com>
6215 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6216 for R_X86_64_32 and R_X86_64_PC32.
6217 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6218 ver_matching_def_pic.o.
6219 (ver_matching_def_pic.o): New target.
6221 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6223 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6224 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6225 Move definition before File_read::View member definitions.
6226 (File_read::View::~View): Initialize and hold lock before
6227 updating current_mapped_bytes.
6229 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6231 * dwarf_reader.cc: Remove outdated comment.
6232 * gold-threads.cc: Fix typo in error message.
6233 * archive.cc: Fix typos in comments.
6234 * archive.h: Likewise.
6235 * arm-reloc-property.cc: Likewise.
6236 * arm-reloc-property.h: Likewise.
6237 * arm-reloc.def: Likewise.
6239 * attributes.h: Likewise.
6240 * cref.cc: Likewise.
6241 * ehframe.cc: Likewise.
6242 * fileread.h: Likewise.
6244 * i386.cc: Likewise.
6246 * incremental.h: Likewise.
6247 * int_encoding.cc: Likewise.
6248 * layout.h: Likewise.
6249 * main.cc: Likewise.
6250 * merge.h: Likewise.
6251 * object.cc: Likewise.
6252 * object.h: Likewise.
6253 * options.cc: Likewise.
6254 * readsyms.cc: Likewise.
6255 * reduced_debug_output.cc: Likewise.
6256 * reloc.cc: Likewise.
6257 * script-sections.cc: Likewise.
6258 * sparc.cc: Likewise.
6259 * symtab.h: Likewise.
6260 * target-reloc.h: Likewise.
6261 * target.cc: Likewise.
6262 * target.h: Likewise.
6263 * timer.cc: Likewise.
6264 * timer.h: Likewise.
6265 * x86_64.cc: Likewise.
6267 2010-12-09 Cary Coutant <ccoutant@google.com>
6269 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6271 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6272 parameter; change all callers.
6273 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6274 * options.h (warn_execstack): New option.
6276 2010-12-07 Doug Kwan <dougkwan@google.com>
6278 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6279 like function call relocations.
6281 2010-12-07 Ian Lance Taylor <iant@google.com>
6283 * archive.cc (Archive::get_elf_object_for_member): Permit
6284 punconfigured to be NULL.
6285 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6286 (Archive::include_member): Pass NULL to get_elf_object_for_member
6287 if we searched for the archive and this is the first included
6290 2010-12-01 Ian Lance Taylor <iant@google.com>
6292 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6293 track_relocs_type_ field.
6294 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6295 Set track_relocs_type_.
6296 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6297 contents when using RELA relocs.
6298 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6300 * reloc.cc (Track_relocs::next_addend): New function.
6301 * reloc.h (class Track_relocs): Declare next_addend.
6303 2010-12-01 Ian Lance Taylor <iant@google.com>
6305 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6308 2010-12-01 Ian Lance Taylor <iant@google.com>
6310 * README: Update compilers known to work and fail.
6312 2010-11-23 Matthias Klose <doko@ubuntu.com>
6314 * configure.in: For --enable-gold, handle value `default' instead of
6315 `both*'. Always install ld as ld.bfd, install as ld if gold is
6317 * configure: Regenerate.
6319 2010-11-18 Doug Kwan <dougkwan@google.com>
6321 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6322 and right_alignment to be zero. Store result alignment only if it is
6323 greater than existing alignment.
6325 2010-11-16 Cary Coutant <ccoutant@google.com>
6328 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6329 Check for ".zdebug_line".
6331 2010-11-16 Doug Kwan <dougkwan@google.com>
6332 Cary Coutant <ccoutant@google.com>
6334 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6335 by reference; adjust all callers.
6336 * output.cc (Output_segment::set_section_addresses): Adjust references
6337 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6339 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6340 end at page boundary.
6342 2010-11-16 Cary Coutant <ccoutant@google.com>
6345 * layout.cc (Layout::choose_output_section): Transform names of
6346 compressed sections even when using a script with a SECTIONS clause.
6347 (Layout::output_section_name): Remove code to transform
6348 compressed debug section names.
6349 * output.cc (Output_section::add_input_section): Use uncompressed
6350 section size when tracking input sections.
6352 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6354 * symtab.h (Symbol::NON_PIC_REF): Remove.
6355 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6356 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6357 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6358 (Symbol::use_plt_offset): Take a flags argument and pass it
6359 directly to needs_dynamic_reloc. Restrict check for undefined
6360 weak symbols to function calls.
6361 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6362 (Target_arm::Scan::global): Use it.
6363 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6364 (Target_arm::Relocate::relocate): Likewise.
6365 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6366 parameter with an r_type parameter. Use get_reference_flags
6368 (Target_arm::Relocate::relocate): Update accordingly.
6369 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6370 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6371 (Target_i386::Scan::global): Likewise.
6372 (Target_i386::Relocate::relocate): Likewise.
6373 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6374 parameter with an r_type parameter. Use get_reference_flags
6376 (Target_i386::Relocate::relocate): Update accordingly.
6377 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6378 (Target_powerpc::Scan::global): Use it.
6379 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6380 (Target_powerpc::Relocate::relocate): Likewise.
6381 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6382 (Target_sparc::Scan::global): Use it.
6383 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6384 (Target_sparc::Relocate::relocate): Likewise.
6385 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6386 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6387 (Target_x86_64::Scan::global): Likewise.
6388 (Target_x86_64::Relocate::relocate): Likewise.
6390 2010-11-08 Doug Kwan <dougkwan@google.com>
6391 Cary Coutant <ccoutant@google.com>
6393 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6394 (Arm_exidx_merge_section::section_contents_): New data member.
6395 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6396 (Arm_input_section::~Arm_input_section): De-allocate memory.
6397 (Arm_input_section::original_contents_): New data member.
6398 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6399 in parameters instead of calling Object::section_contents without
6401 (Arm_output_section::group_section): New parameter TASK. Pass it
6402 to callees that need locking objects.
6403 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6404 to lock EXIDX input sections. Fix a formatting issue. Call
6405 Arm_exidx_merged_section::build_contents to create merged section
6407 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6408 to lock object of stub table owner.
6409 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6410 TEXT_SIZE to initialize data member TEXT_SIZE_.
6411 (Arm_exidx_input_section::addralign): Fix typo in comment.
6412 (Arm_exidx_input_section::text_size): New method.
6413 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6414 that require locking objects. Lock objects before scanning for stubs
6415 and updating local symbols.
6416 (Arm_input_section<big_endian>::init): Copy contents of original
6418 (Arm_input_section<big_endian>::do_write): Use saved contents of
6419 original input section instead of calling Object::section_contents
6421 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6422 size without calling Object::section_size().
6423 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6424 for size. Allocate a buffer for merged EXIDX entries.
6425 (Arm_exidx_merged_section::build_contents): New method.
6426 (Arm_exidx_merged_section::do_write): Move merge section contents
6427 building code to Arm_exidx_merged_section::build_contetns. Write
6428 out contetns in buffer instead of building it on the fly.
6429 (Arm_relobj::make_exidx_input_section): Also pass text section size
6430 to Arm_exidx_input_section constructor.
6431 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6432 (Arm_dynobj::do_read_symbols): Fix memory leak.
6433 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6434 * target.h: (class Task): Add forward declaration.
6435 (Target::relax): Add new parameter TASK and pass it to
6437 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6439 2010-11-05 Cary Coutant <ccoutant@google.com>
6442 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6443 object when reading from the file.
6444 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6446 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6447 when reading section contents.
6448 (get_section_contents): Likewise.
6449 (icf::find_identical_sections): Likewise.
6450 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6451 object when reading from the file.
6452 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6453 the object when doing deferred section layout.
6455 2010-11-03 Nick Clifton <nickc@redhat.com>
6458 * script.h (class Symbol_assignment: name): New member. Returns
6459 the name of the symbol.
6460 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6461 Returns true if the given symbol name is on the list of
6462 assignments wating to be processed.
6463 * archive.cc (should_incldue_member): If the symbol is undefined,
6464 check to see if it is on the list of symbols pending assignment.
6466 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6468 * script-sections.cc (Script_sections::find_memory_region): Check
6469 for a NULL output section pointer.
6471 2010-10-29 Doug Kwan <dougkwan@google.com>
6473 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6474 Output_section::add_relaxed_input_section.
6475 * output.cc (Output_section::add_relaxed_input_section): Add new
6476 arguments LAYOUT and NAME. Set section order index.
6477 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6478 Copy section order index.
6479 * output.h (Output_section::add_relaxed_input_section): Add new
6480 arguments LAYOUT and NAME.
6482 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6484 * testsuite/Makefile.am: Move gcctestdir/ld rule to
6485 NATIVE_OR_CROSS_LINKER.
6486 * testsuite/Makefile.in: Regenerate.
6488 2010-10-20 Doug Kwan <dougkwan@google.com>
6490 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6491 without SHF_LINK_ORDER flags.
6492 * layout.cc (Layout::choose_output_section): Do not filter
6493 SHF_LINK_ORDER flag in a relocatable link.
6495 2010-10-17 Cary Coutant <ccoutant@google.com>
6497 * output.h (Output_segment::set_section_addresses): Change function
6498 signature. Update all callers.
6499 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6501 (Output_segment::set_section_addresses): Align after last TLS
6502 section. Add padding before last relro section instead of after.
6504 2010-10-17 Doug Kwan <dougkwan@google.com>
6506 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6507 GOT output section to be writable.
6509 2010-10-14 Cary Coutant <ccoutant@google.com>
6511 * debug.h (DEBUG_INCREMENTAL): New flag.
6512 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6513 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6515 * incremental.cc (report_command_line): Ignore all forms of
6517 * layout.cc (Layout::Layout): Check parameters for incremental link
6519 * options.cc (General_options::parse_incremental): New function.
6520 (General_options::parse_no_incremental): New function.
6521 (General_options::parse_incremental_full): New function.
6522 (General_options::parse_incremental_update): New function.
6523 (General_options::incremental_mode_): New data member.
6524 (General_options::finalize): Check incremental_mode_.
6525 * options.h (General_options): Update help text for --incremental.
6526 Add --no-incremental, --incremental-full, --incremental-update.
6527 (General_options::Incremental_mode): New enum type.
6528 (General_options::incremental_mode): New function.
6529 (General_options::incremental_mode_): New data member.
6530 * parameters.cc (Parameters::incremental_mode_): New data member.
6531 (Parameters::set_options): Set incremental_mode_.
6532 (Parameters::set_incremental_full): New function.
6533 (Parameters::incremental): New function.
6534 (Parameters::incremental_update): New function.
6535 (set_parameters_incremental_full): New function.
6536 * parameters.h (Parameters::set_incremental_full): New function.
6537 (Parameters::incremental): New function.
6538 (Parameters::incremental_update): New function.
6539 (Parameters::incremental_mode_): New data member.
6540 (set_parameters_incremental_full): New function.
6541 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6542 incremental link mode.
6543 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6544 (Sized_relobj::do_relocate_sections): Likewise.
6545 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6547 * testsuite/Makefile.in: Regenerate.
6548 * testsuite/incremental_test.sh: Filter all forms of --incremental.
6550 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6552 * script-sections.h (class Script_sections): Make
6553 Sections_elements typedef public.
6554 * script-sections.cc (class Sort_output_sections): Add elements_
6555 field. Add constructor which sets it; change all callers.
6556 (Sort_output_sections::is_before): New function.
6557 (Sort_output_sections::operator()): Call is_before.
6558 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6560 * testsuite/script_test_10.sh: New test. Test script section
6562 * testsuite/script_test_10.t: Likewise.
6563 * testsuite/script_test_10.s: Likewise.
6564 * testsuite/Makefile.am: Wrap the cross linker tests and the
6565 common tests into NATIVE_OR_CROSS_LINKER.
6566 (check_SCRIPTS): Add script_test_10.sh.
6567 (check_DATA): Add script_test_10.stdout.
6568 (script_test_10.o, script_test_10): New targets.
6569 (script_test_10.stdout): New target.
6570 * configure, testsuite/Makefile.in: Regenerate.
6572 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6574 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6575 error for the deprecated relocations.
6576 (Target_arm::Scan::global): Likewise.
6577 (Target_arm::Relocate::relocate): Likewise.
6579 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6581 * fileread.cc (Input_file::find_file): Initialize *found_name
6582 and *namep when using the fallback search for case 4.
6584 2010-10-11 Cary Coutant <ccoutant@google.com>
6586 * options.h (class General_options): Redefine -z lazy as an alias for
6587 the negation of -z now.
6589 2010-10-11 Ian Lance Taylor <iant@google.com>
6591 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6594 2010-10-06 Nick Clifton <nickc@redhat.com>
6596 * script-sections.cc(class Memory_region): Remove
6597 current_lma_offset_ field. Rename current_vma_offset_ to
6598 current_offset_. Add last_section_ field.
6599 (Memory_region::get_current_vma_address): Rename to
6600 get_current_address.
6601 (Memory_region::get_current_lma_address): Delete.
6602 (Memory_region::increment_vma_offset): Rename to
6604 (Memory_region::increment_lma_offset): Delete.
6605 (Memory_region::attributes_compatible): New method. Returns
6606 true if the provided section is compatible with the region.
6607 (Memory_region::get_last_section): New method. Returns the last
6608 section to use the region.
6609 (Memory_region::set_last_section): New method. Stores the last
6610 section to use the region.
6611 (Script_sections::block_in_region): New method. Returns true if
6612 a block of memory is contained within a region.
6613 (Script_sections::find_memory_region): New method. Locates a
6614 memory region to be used to set a VMA or LMA address.
6615 (Output_section_definition::set_section_addresses): Add code to
6616 check for addresses set by memory regions.
6617 (Output_segment::set_section_addresses): Remove memory region
6619 (Script_sections::create_segment): Add a warning if a header
6620 segment is created outside of any region.
6621 * script-sections.h (class Script_sections): Add prototypes for
6622 find_memory_region and block_in_region methods.
6623 * testsuite/memory_test.s: Use .long instead of .word.
6624 * testsuite/memory_test.t: Add some more output sections.
6625 * testsuite/memory_test.sh: Update expected output.
6627 2010-10-02 Doug Kwan <dougkwan@google.com>
6629 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6630 defintion to symtab.h
6631 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6632 declaration to defintion.
6634 2010-10-01 Nick Clifton <nickc@redhat.com>
6636 * expression.cc (eval): Replace dummy argument with NULL.
6637 (eval_maybe_dot): Check for a NULL result section pointer.
6638 (Symbol_expression::value): Likewise.
6639 (Dot_expression::value): Likewise.
6640 (BINARY_EXPRESSION): Likewise.
6641 (Max_expression::value): Likewise.
6642 (Min_expression::value): Likewise.
6643 (Absolute_expression::value): Likewise.
6644 (Addr_expression::value_from_output_section): Likewise.
6645 (Loaddddr_expression::value_from_output_section): Likewise.
6646 (Segment_start_expression::value): Likewise.
6647 * script-sections.cc
6648 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6650 (Sections_elememt_dot_assignment::set_section_addresses):
6652 (Output_data_expression::do_write_to_buffer): Likewise.
6653 (Output_section_definition::finalize_symbols): Likewise.
6654 (Output_section_definition::set_section_addresses): Likewise.
6656 2010-09-30 Doug Kwan <dougkwan@google.com>
6658 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6660 2010-09-28 Sriraman Tallam <tmsriram@google.com>
6662 * target.h (Target::can_icf_inline_merge_sections): New virtual
6664 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6666 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6668 * icf.cc (get_section_contents): Inline merge sections only when
6671 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6673 * configure: Regenerate.
6675 2010-09-17 Ian Lance Taylor <iant@google.com>
6677 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
6678 * testsuite/Makefile.am (memory_test.o): New target.
6679 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6681 * testsuite/Makefile.in: Rebuild.
6683 2010-09-17 Doug Kwan <dougkwan@google.com>
6685 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6686 defintion if relocation uses GOT entries of the symbol.
6687 * testsuite/icf_safe_test.sh: Fix test.
6688 * testsuite/icf_safe_so_test.sh: Fix test.
6690 2010-09-16 Cary Coutant <ccoutant@google.com>
6692 * script_sections.cc (class Memory_region): Remove "NULL" from
6693 vector initializations.
6695 2010-09-15 Cary Coutant <ccoutant@google.com>
6697 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6698 Resolve forwarding symbols.
6700 2010-09-15 Doug Kwan <dougkwan@google.com>
6702 * gold/testsuite/script_test_3.t: Add ARM special sections.
6703 * gold/testsuite/script_test_4.t: Same.
6704 * gold/testsuite/script_test_5.t: Same.
6705 * gold/testsuite/script_test_6.t: Same.
6706 * gold/testsuite/script_test_7.t: Same.
6707 * gold/testsuite/script_test_7.t: Same.
6708 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6710 2010-09-14 Cary Coutant <ccoutant@google.com>
6712 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6713 (Target_x86_64::Relocate::relocate_tls): Replace check for
6714 saw_tls_block_reloc_ with test for executable section.
6716 2010-09-12 Cary Coutant <ccoutant@google.com>
6718 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6719 position-independent executables to shared libraries need dynamic
6721 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6722 position-independent executables.
6723 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6724 * testsuite/Makefile.in: Regenerate.
6726 2010-09-10 Nick Clifton <nickc@redhat.com>
6729 * testsuite/memory_test.t: Discard any sections that are not
6732 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6735 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6736 "This::" to work around a bug in gcc 4.2.
6738 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6740 2010-09-09 Rafael Espindola <espindola@google.com>
6742 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6743 sections with different PF_X flags in the same segment.
6744 (Layout::find_first_load_seg): Search all segments to find the first
6746 * options.h (rosegment): New.
6748 2010-09-08 Rafael Espindola <espindola@google.com>
6750 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
6752 2010-09-08 Doug Kwan <dougkwan@google.com>
6754 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6755 (Arm_relobj::do_relocate_sections): Add new parameter for output
6756 file to match the parent.
6757 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6758 of local symbols instead of input values. Update code to track
6759 changes in gold::relocate_section.
6760 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6761 (Sized_relobj::compute_final_local_value_internal): New methods.
6762 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6763 body into private version of Sized_relobj::compute_final_local_value.
6764 Call the inline method.
6765 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6766 merged symbol value if there is one.
6767 (Symbol_value::has_output_value): New method defintiion.
6768 (Sized_relobj::Compute_final_local_value_status): New enum type.
6769 (Sized_relobj::compute_final_local_value): New methods.
6770 (Sized_relobj::compute_final_local_value_internal): New methods.
6771 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6772 and arm_cortex_a8.sh.
6773 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6774 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6776 * Makefile.in: Regenerate.
6777 * testsuite/arm_bl_out_of_range.s: Update test.
6778 * testsuite/thumb_bl_out_of_range.s: Ditto.
6779 * testsuite/thumb_blx_out_of_range.s: Ditto.
6780 * testsuite/arm_branch_out_of_range.sh: New file.
6781 * testsuite/arm_cortex_a8.sh: Ditto.
6782 * testsuite/arm_cortex_a8_b.s: Ditto.
6783 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6784 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6785 * testsuite/arm_cortex_a8_bl.s: Ditto.
6786 * testsuite/arm_cortex_a8_blx.s: Ditto.
6787 * testsuite/arm_cortex_a8_local.s: Ditto.
6788 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6789 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6791 2010-09-08 Rafael Espindola <espindola@google.com>
6793 * Makefile.am (memory_test.stdout): Run readelf with -W.
6794 * Makefile.in: Regenerate.
6795 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6798 2010-09-08 Rafael Espindola <espindola@google.com>
6800 * script-sections.cc (Script_sections::add_memory_region): Convert
6801 field precision to int.
6802 * script.cc (script_set_section_region, script_set_section_region):
6803 Convert field precision to int.
6805 2010-09-08 Rafael Espindola <espindola@google.com>
6807 * arm.cc (do_finalize_sections): Create the __exidx_start and
6808 __exdix_end symbols even when the section is missing.
6810 2010-09-08 Nick Clifton <nickc@redhat.com>
6812 * README: Remove claim that MEMORY is not supported.
6813 * expression.cc (script_exp_function_origin)
6814 (script_exp_function_length): Move from here to ...
6815 * script.cc: ... here.
6816 (script_set_section_region, script_add_memory)
6817 (script_parse_memory_attr, script_include_directive): New
6819 * script-sections.cc
6820 (class Memory_region): New class.
6821 (class Output_section_definition): Add set_memory_region,
6822 set_section_vma, set_section_lma and get_section_name methods.
6823 (class Script_Sections): Add add_memory_region,
6824 find_memory_region, find_memory_region_origin,
6825 find_memory_region_length and set_memory_region methods.
6826 Have set_section_addresses method walk the list of set memory
6828 Extend the print methos to display memory regions.
6829 * script-sections.h: Add prototypes for new methods.
6830 Add enum for MEMORY region attributes.
6831 * yyscript.y: Add support for parsing MEMORY regions.
6832 * script-c.h: Add prototypes for new functions.
6833 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6834 * testsuite/Makefile.in: Regenerate.
6835 * testsuite/memory_test.sh: New script.
6836 * testsuite/memory_test.s: New assembler source file.
6837 * testsuite/memory_test.t: New linker script.
6839 2010-08-27 Doug Kwan <dougkwan@google.com>
6841 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6842 reference override an existing dynamic weak reference.
6843 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6844 * testsuite/Makefile.in: Regenerate.
6845 * testsuite/dyn_weak_ref.sh: New file.
6846 * testsuite/dyn_weak_ref_1.c: Ditto.
6847 * testsuite/dyn_weak_ref_2.c: Ditto.
6849 2010-08-27 Ian Lance Taylor <iant@google.com>
6851 * incremental.h (class Incremental_input_entry): Add virtual
6854 2010-08-27 Ian Lance Taylor <iant@google.com>
6856 * testsuite/start_lib_test_3.c: Mark t3 as used.
6858 2010-08-27 Nick Clifton <nickc@redhat.com>
6860 * options.cc (version_script): Fix small typo in previous
6863 2010-08-25 Nick Clifton <nickc@redhat.com>
6865 * archive.cc: Formatting fixes: Remove whitespace between
6866 typename and following asterisk. Remove whitespace between
6867 function name and opening parenthesis.
6868 * archive.h: Likewise.
6870 * attributes.cc: Likewise.
6871 * attributes.h: Likewise.
6872 * common.cc: Likewise.
6873 * copy-relocs.cc: Likewise.
6874 * dirsearch.h: Likewise.
6875 * dynobj.cc: Likewise.
6876 * ehframe.cc: Likewise.
6877 * ehframe.h: Likewise.
6878 * expression.cc: Likewise.
6879 * fileread.cc: Likewise.
6880 * fileread.h: Likewise.
6882 * gold-threads.cc: Likewise.
6883 * gold.cc: Likewise.
6884 * i386.cc: Likewise.
6886 * incremental-dump.cc: Likewise.
6887 * incremental.cc: Likewise.
6888 * layout.cc: Likewise.
6889 * layout.h: Likewise.
6890 * main.cc: Likewise.
6891 * merge.cc: Likewise.
6892 * merge.h: Likewise.
6893 * object.cc: Likewise.
6894 * object.h: Likewise.
6895 * options.cc: Likewise.
6896 * options.h: Likewise.
6897 * output.cc: Likewise.
6898 * output.h: Likewise.
6899 * plugin.cc: Likewise.
6900 * plugin.h: Likewise.
6901 * powerpc.cc: Likewise.
6902 * reloc.cc: Likewise.
6903 * script-c.h: Likewise.
6904 * script-sections.cc: Likewise.
6905 * script.cc: Likewise.
6906 * stringpool.cc: Likewise.
6907 * symtab.cc: Likewise.
6908 * symtab.h: Likewise.
6909 * target.cc: Likewise.
6910 * timer.cc: Likewise.
6911 * timer.h: Likewise.
6912 * version.cc: Likewise.
6913 * x86_64.cc: Likewise.
6915 2010-08-24 Nick Clifton <nickc@redhat.com>
6918 * layout.cc (segment_precedes): Sort segments by their physical
6919 addresses, if they have been set.
6921 2010-08-23 Cary Coutant <ccoutant@google.com>
6923 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6925 (Lib_group::include_member): Unlock object after deleting its
6927 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6930 2010-08-19 Neil Vachharajani <nvachhar@google.com>
6931 Cary Coutant <ccoutant@google.com>
6933 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6934 constructor, and set_blocker.
6935 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6937 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6938 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6939 * testsuite/Makefile.am (start_lib_test): New test case.
6940 * testsuite/Makefile.in: Regenerate.
6941 * testsuite/start_lib_test_main.c: New file.
6942 * testsuite/start_lib_test_1.c: New file.
6943 * testsuite/start_lib_test_2.c: New file.
6944 * testsuite/start_lib_test_3.c: New file.
6946 2010-08-19 Ian Lance Taylor <iant@google.com>
6948 * Makefile.in: Rebuild with automake 1.11.1.
6949 * aclocal.m4: Likewise.
6950 * testsuite/Makefile.in: Likewise.
6952 2010-08-19 Ian Lance Taylor <iant@google.com>
6955 * i386.cc (class Output_data_plt_i386): Update declarations.
6956 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6957 local_ifuncs_ fields.
6958 (Target_i386::do_plt_section_for_global): New function.
6959 (Target_i386::do_plt_section_for_local): New function.
6960 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6961 parameter; change all callers. Initialize global_ifuncs_ and
6962 local_ifuncs_. If doing a static link define __rel_iplt_start and
6964 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6965 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6966 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6968 (Target_i386::make_plt_section): New function, broken out of
6969 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6970 (Target_i386::make_plt_entry): Call make_plt_section.
6971 (Target_i386::make_local_ifunc_plt_entry): New function.
6972 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6973 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6974 R_386_IRELATIVE to switch.
6975 (Target_i386::Scan::global): Likewise.
6976 (Target_i386::Relocate::relocate): Likewise.
6977 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6979 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6980 (Target_x86_64::do_plt_section_for_global): New function.
6981 (Target_x86_64::do_plt_section_for_local): New function.
6982 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6983 parameter; change all callers. If doing a static link define
6984 __rela_iplt_start and __rela_iplt_end.
6985 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6986 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6987 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6989 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6990 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6992 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6993 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6994 R_X86_64_IRELATIVE to switch.
6995 (Target_x86_64::Scan::global): Likewise.
6996 (Target_x86_64::Relocate::relocate): Likewise.
6997 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
6999 * target.h (class Target): Add plt_section_for_global and
7000 plt_section_for_local functions. Add do_plt_section_for_global
7001 and do_plt_section_for_local virtual functions.
7002 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7003 clarifying comments.
7004 (Symbol::use_plt_offset): Handle IFUNC symbol.
7005 * object.cc (Sized_relobj::Sized_relobj): Initialize
7007 (Sized_relobj::local_has_plt_offset): New function.
7008 (Sized_relobj::local_plt_offset): New function.
7009 (Sized_relobj::set_local_plt_offset): New function.
7010 (Sized_relobj::do_count): Handle IFUNC symbol.
7011 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7012 a bit away from input_shndx_ field. Add set_is_func_symbol and
7013 is_ifunc_symbol functions.
7014 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7015 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7016 local_plt_offsets_ field.
7017 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7018 * output.h (class Output_section_data): Add non-const
7019 output_section function.
7020 (class Output_data_got): Update declarations.
7021 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7022 Add use_plt_offset parameter to global and local constructors.
7023 Change all callers. Change local_sym_index_ field to 31 bits.
7024 Change GSYM_CODE and CONSTANT_CODE accordingly.
7025 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7026 doing a static link don't set sh_link field.
7027 (Output_data_got::Got_entry::write): Use PLT offset if
7029 (Output_data_got::add_global_plt): New function.
7030 (Output_data_got::add_local_plt): New function.
7031 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7032 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7033 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7034 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7035 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7037 * testsuite/ifunc-sel.h: New file.
7038 * testsuite/ifuncmain1.c: New file.
7039 * testsuite/ifuncmain1vis.c: New file.
7040 * testsuite/ifuncmod1.c: New file.
7041 * testsuite/ifuncdep2.c: New file.
7042 * testsuite/ifuncmain2.c: New file.
7043 * testsuite/ifuncmain3.c: New file.
7044 * testsuite/ifuncmod3.c: New file.
7045 * testsuite/ifuncmain4.c: New file.
7046 * testsuite/ifuncmain5.c: New file.
7047 * testsuite/ifuncmod5.c: New file.
7048 * testsuite/ifuncmain6pie.c: New file.
7049 * testsuite/ifuncmod6.c: New file.
7050 * testsuite/ifuncmain7.c: New file.
7051 * configure, testsuite/Makefile.in: Rebuild.
7053 2010-08-18 Ian Lance Taylor <iant@google.com>
7056 (Output_section_incremental_inputs::write_input_files): Add cast
7057 to avoid signed/unsigned comparison warning.
7058 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7060 2010-08-12 Cary Coutant <ccoutant@google.com>
7062 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7064 2010-08-13 Ian Lance Taylor <iant@google.com>
7066 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7068 2010-08-12 Cary Coutant <ccoutant@google.com>
7069 Doug Kwan <dougkwan@google.com>
7071 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7072 defintion overrides non-weak undef, remember that the original undef
7074 * symtab.cc (Symbol_table::sized_write_global): For undef without
7075 an original weak binding, set binding to global in output.
7076 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7077 * testsuite/Makefile.in: Regenerate.
7078 * testsuite/strong_ref_weak_def.sh: New file.
7079 * testsuite/strong_ref_weak_def_1.c: Ditto.
7080 * testsuite/strong_ref_weak_def_2.c: Ditto.
7082 2010-08-12 Cary Coutant <ccoutant@google.com>
7084 * testsuite/incremental_test.sh: Rewrite.
7085 * testsuite/incremental_test_1.c: Rewrite.
7086 * testsuite/incremental_test_2.c: Rewrite.
7088 2010-08-12 Cary Coutant <ccoutant@google.com>
7090 * arm.cc (Target_arm::got_size): Add const.
7091 (Target_arm::got_entry_count): New function.
7092 (Target_arm::plt_entry_count): New function.
7093 (Target_arm::first_plt_entry_offset): New function.
7094 (Target_arm::plt_entry_size): New function.
7095 (Output_data_plt_arm::entry_count): New function.
7096 (Output_data_plt_arm::first_plt_entry_offset): New function.
7097 (Output_data_plt_arm::get_plt_entry_size): New function.
7098 * i386.cc (Target_i386::got_size): Add const.
7099 (Target_i386::got_entry_count): New function.
7100 (Target_i386::plt_entry_count): New function.
7101 (Target_i386::first_plt_entry_offset): New function.
7102 (Target_i386::plt_entry_size): New function.
7103 (Output_data_plt_i386::entry_count): New function.
7104 (Output_data_plt_i386::first_plt_entry_offset): New function.
7105 (Output_data_plt_i386::get_plt_entry_size): New function.
7106 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7107 find_incremental_inputs_sections. Dump incremental_got_plt section.
7108 * incremental.cc: Include target.h.
7109 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7110 parameter. Adjust all callers. Find incremental_got_plt section.
7111 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7113 (Output_section_incremental_inputs::set_final_data_size): Calculate
7114 size of incremental_got_plt section.
7115 (Output_section_incremental_inputs::do_write): Write the
7116 incremental_got_plt section.
7117 (Got_plt_view_info): New struct.
7118 (Local_got_offset_visitor): New class.
7119 (Global_got_offset_visitor): New class.
7120 (Global_symbol_visitor_got_plt): New class.
7121 (Output_section_incremental_inputs::write_got_plt): New function.
7122 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7123 Add parameter. Adjust all callers.
7124 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7125 (Incremental_inputs::got_plt_section): New function.
7126 (Incremental_inputs::got_plt_section_): New data member.
7127 (Incremental_got_plt_reader): New class.
7128 * layout.cc (Layout::create_incremental_info_sections): Add the
7129 incremental_got_plt section.
7130 * object.h (Got_offset_list::get_list): New function.
7131 (Got offset_list::for_all_got_offsets): New function.
7132 (Sized_relobj::local_got_offset_list): New function.
7133 * powerpc.cc (Target_powerpc::got_size): Add const.
7134 (Target_powerpc::got_entry_count): New function.
7135 (Target_powerpc::plt_entry_count): New function.
7136 (Target_powerpc::first_plt_entry_offset): New function.
7137 (Target_powerpc::plt_entry_size): New function.
7138 (Output_data_plt_powerpc::entry_count): New function.
7139 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7140 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7141 * sparc.cc (Target_sparc::got_size): Add const.
7142 (Target_sparc::got_entry_count): New function.
7143 (Target_sparc::plt_entry_count): New function.
7144 (Target_sparc::first_plt_entry_offset): New function.
7145 (Target_sparc::plt_entry_size): New function.
7146 (Output_data_plt_sparc::entry_count): New function.
7147 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7148 (Output_data_plt_sparc::get_plt_entry_size): New function.
7149 * symtab.h (Symbol::got_offset_list): New function.
7150 (Symbol_table::for_all_symbols): New function.
7151 * target.h (Sized_target::got_entry_count): New function.
7152 (Sized_target::plt_entry_count): New function.
7153 (Sized_target::plt_entry_size): New function.
7154 * x86_64.cc (Target_x86_64::got_size): Add const.
7155 (Target_x86_64::got_entry_count): New function.
7156 (Target_x86_64::plt_entry_count): New function.
7157 (Target_x86_64::first_plt_entry_offset): New function.
7158 (Target_x86_64::plt_entry_size): New function.
7159 (Output_data_plt_x86_64::entry_count): New function.
7160 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7161 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7163 2010-08-12 Cary Coutant <ccoutant@google.com>
7165 * archive.cc: Include incremental.h.
7166 (Archive::Archive): Initialize incremental_info_.
7167 (Archive::include_member): Record archive members in incremental info.
7168 (Add_archive_symbols::run): Record begin and end of an archive in
7170 (Lib_group::include_member): Record objects in incremental info.
7171 * archive.h (Incremental_archive_entry): Forward declaration.
7172 (Archive::set_incremental_info): New member function.
7173 (Archive::incremental_info): New member function.
7174 (Archive::Unused_symbol_iterator): New class.
7175 (Archive::unused_symbols_begin): New member function.
7176 (Archive::unused_symbols_end): New member function.
7177 (Archive::incremental_info_): New data member.
7178 * incremental-dump.cc (find_input_containing_global): New function.
7179 (dump_incremental_inputs): Dump new incremental info sections.
7180 * incremental.cc: Include symtab.h.
7181 (Output_section_incremental_inputs): New class.
7182 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7183 new incremental info sections.
7184 (Sized_incremental_binary::do_check_inputs): Likewise.
7185 (Incremental_inputs::report_archive): Remove.
7186 (Incremental_inputs::report_archive_begin): New function.
7187 (Incremental_inputs::report_archive_end): New function.
7188 (Incremental_inputs::report_object): New function.
7189 (Incremental_inputs::finalize_inputs): Remove.
7190 (Incremental_inputs::report_input_section): New function.
7191 (Incremental_inputs::report_script): Rewrite.
7192 (Incremental_inputs::finalize): Do nothing but finalize string table.
7193 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7194 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7195 (Incremental_inputs::create_data_sections): New function.
7196 (Incremental_inputs::relocs_entsize): New function.
7197 (Output_section_incremental_inputs::set_final_data_size): New function.
7198 (Output_section_incremental_inputs::do_write): New function.
7199 (Output_section_incremental_inputs::write_header): New function.
7200 (Output_section_incremental_inputs::write_input_files): New function.
7201 (Output_section_incremental_inputs::write_info_blocks): New function.
7202 (Output_section_incremental_inputs::write_symtab): New function.
7203 * incremental.h (Incremental_script_entry): Forward declaration.
7204 (Incremental_object_entry): Forward declaration.
7205 (Incremental_archive_entry): Forward declaration.
7206 (Incremental_inputs): Forward declaration.
7207 (Incremental_inputs_header_data): Remove.
7208 (Incremental_inputs_header): Remove.
7209 (Incremental_inputs_header_write): Remove.
7210 (Incremental_inputs_entry_data): Remove.
7211 (Incremental_inputs_entry): Remove.
7212 (Incremental_inputs_entry_write): Remove.
7213 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7214 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7215 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7216 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7218 (Incremental_input_entry): New class.
7219 (Incremental_script_entry): New class.
7220 (Incremental_object_entry): New class.
7221 (Incremental_archive_entry): New class.
7222 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7223 (Incremental_inputs::report_inputs): Remove.
7224 (Incremental_inputs::report_archive): Remove.
7225 (Incremental_inputs::report_archive_begin): New function.
7226 (Incremental_inputs::report_archive_end): New function.
7227 (Incremental_inputs::report_object): Change prototype.
7228 (Incremental_inputs::report_input_section): New function.
7229 (Incremental_inputs::report_script): Change prototype.
7230 (Incremental_inputs::get_reloc_count): New function.
7231 (Incremental_inputs::set_reloc_count): New function.
7232 (Incremental_inputs::create_data_sections): New function.
7233 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7234 (Incremental_inputs::inputs_section): New function.
7235 (Incremental_inputs::symtab_section): New function.
7236 (Incremental_inputs::relocs_section): New function.
7237 (Incremental_inputs::get_stringpool): Add const.
7238 (Incremental_inputs::command_line): Add const.
7239 (Incremental_inputs::inputs): Remove.
7240 (Incremental_inputs::command_line_key): New function.
7241 (Incremental_inputs::input_file_count): New function.
7242 (Incremental_inputs::input_files): New function.
7243 (Incremental_inputs::relocs_entsize): New function.
7244 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7245 (Incremental_inputs::finalize_inputs): Remove.
7246 (Incremental_inputs::Input_info): Remove.
7247 (Incremental_inputs::lock_): Remove.
7248 (Incremental_inputs::inputs_): Change type.
7249 (Incremental_inputs::inputs_map_): Remove.
7250 (Incremental_inputs::current_object_entry_): New data member.
7251 (Incremental_inputs::inputs_section_): New data member.
7252 (Incremental_inputs::symtab_section_): New data member.
7253 (Incremental_inputs::relocs_section_): New data member.
7254 (Incremental_inputs::reloc_count_): New data member.
7255 (Incremental_inputs_reader): New class.
7256 (Incremental_symtab_reader): New class.
7257 (Incremental_relocs_reader): New class.
7258 * layout.cc (Layout::finalize): Move finalization of incremental info
7259 and creation of incremental info sections to follow finalization of
7260 symbol table. Set offsets for postprocessing sections.
7261 (Layout::create_incremental_info_sections): Call
7262 Incremental_inputs::create_data_sections. Add incremental symtab
7263 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7264 sections to layout after input sections.
7265 * layout.h (struct Timespec): Forward declaration.
7266 (Layout::incremental_inputs): Add const.
7267 (Layout::create_incremental_info_sections): Add parameter.
7268 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7269 * object.cc: Include incremental.h.
7270 (Relobj::finalize_incremental_relocs): New function.
7271 (Sized_relobj::do_layout): Record input sections in incremental info.
7272 * object.h (Object::output_section): New function.
7273 (Object::output_section_offset): Moved from Relobj.
7274 (Object::get_incremental_reloc_base): New function.
7275 (Object::get_incremental_reloc_count): New function.
7276 (Object::do_output_section): New function.
7277 (Object::do_output_section_offset): Moved from Relobj.
7278 (Object::do_get_incremental_reloc_base): New function.
7279 (Object::do_get_incremental_reloc_count): New function.
7280 (Object::Object): Initialize new data members.
7281 (Relobj::output_section): Renamed do_output_section and moved to
7283 (Relobj::output_section_offset): Moved to Object.
7284 (Relobj::do_get_incremental_reloc_base): New function.
7285 (Relobj::do_get_incremental_reloc_count): New function.
7286 (Relobj::allocate_incremental_reloc_counts): New function.
7287 (Relobj::count_incremental_reloc): New function.
7288 (Relobj::finalize_incremental_relocs): New function.
7289 (Relobj::next_incremental_reloc_index): New function.
7290 (Relobj::reloc_counts_): New data member.
7291 (Relobj::reloc_bases_): New data member.
7292 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7293 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7294 (Sized_relobj::incremental_relocs_scan): New function.
7295 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7296 (Sized_relobj::incremental_relocs_write): New function.
7297 (Sized_relobj::incremental_relocs_write_reltype): New function.
7298 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7300 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7301 archives and object files elsewhere.
7302 (Add_symbols::run): Report object files here.
7303 (Finish_group::run): Report end of archive at end of group.
7304 * reloc.cc: Include layout.h, incremental.h.
7305 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7306 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7307 (Sized_relobj::incremental_relocs_scan): New function.
7308 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7309 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7310 (Sized_relobj::incremental_relocs_write): New function.
7311 (Sized_relobj::incremental_relocs_write_reltype): New function.
7312 * script.cc (read_input_script): Rewrite test for incremental link.
7313 Change call to Incremental_inputs::report_script.
7314 * symtab.h (Symbol_table::first_global_index): New function.
7315 (Symbol_table::output_count): New function.
7317 2010-08-12 Doug Kwan <dougkwan@google.com>
7319 * arm.cc (Target_arm::merge_object_attributes): Check command line
7320 options --no-wchar-size-warning and --no-enum-size-warning.
7321 * options.h (General_options): Add ld-compatible options
7322 --no-enum-size-warning and --no-wchar-size-warning.
7324 2010-08-04 Ian Lance Taylor <iant@google.com>
7326 * x86_64.cc (Target_x86_64::Scan::local): Use
7327 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7328 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7329 (Target_x86_64::Scan::global): Likewise.
7330 (Target_x86_64::Relocate::relocate): Likewise.
7331 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7334 2010-08-03 Cary Coutant <ccoutant@google.com>
7336 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7337 to reserve space in merged_strings vector. Keep total input size
7339 (Output_merge_string::do_print_merge_stats): Print total input size.
7340 * merge.h (Output_merge_string): Add input_size_ field.
7341 * stringpool.cc (Stringpool_template::string_length): Move
7342 implementations out of Stringpool_template class and place in
7344 * stringpool.h (string_length): Move out of Stringpool_template.
7346 2010-08-03 Ian Lance Taylor <iant@google.com>
7349 * layout.cc (relaxation_loop_body): If address of load segment is
7350 set, adjust address to include headers if possible.
7352 2010-08-03 Ian Lance Taylor <iant@google.com>
7354 * version.cc (version_string): Bump to 1.10.
7356 2010-08-03 Ian Lance Taylor <iant@google.com>
7359 * layout.h (enum Output_section_order): Define.
7360 (class Layout): Update declarations.
7361 * layout.cc (Layout::get_output_section): Add order parameter.
7362 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7363 is_first_non_relro parameters. Change all callers.
7364 (Layout::choose_output_section): Likewise.
7365 (Layout::add_output_section_data): Likewise.
7366 (Layout::make_output_section): Likewise. Set order.
7367 (Layout::default_section_order): New function.
7368 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7369 * output.cc (Output_section::Output_section): Initialize order_.
7370 Don't initialize deleted fields.
7371 (Output_segment::Output_segment): Don't initialize deleted
7373 (Output_segment::add_output_section_to_load): New function
7374 replacing add_output_section. Change all callers to call this or
7375 add_output_section_to_nonload.
7376 (Output_segment::add_output_section_to_nonload): New function.
7377 (Output_segment::remove_output_section): Rewrite.
7378 (Output_segment::add_initial_output_data): Likewise.
7379 (Output_segment::has_any_data_sections): Likewise.
7380 (Output_segment::is_first_section_relro): Likewise.
7381 (Output_segment::maximum_alignment): Likewise.
7382 (Output_segment::has_dynamic_reloc): New function replacing
7383 dynamic_reloc_count. Change all callers.
7384 (Output_segment::has_dynamic_reloc_list): New function replacing
7385 dynamic_reloc_count_list. Change all callers.
7386 (Output_segment::set_section_addresses): Rewrite.
7387 (Output_segment::set_offset): Rewrite.
7388 (Output_segment::find_first_and_last_list): Remove.
7389 (Output_segment::set_tls_offsets): Rewrite.
7390 (Output_segment::first_section_load_address): Likewise.
7391 (Output_segment::output_section_count): Likewise.
7392 (Output_segment::section_with_lowest_load_address): Likewise.
7393 (Output_segment::write_section_headers): Likewise.
7394 (Output_segment::print_sections_to_map): Likewise.
7395 * output.h (class Output_data): Remove dynamic_reloc_count_
7396 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7397 (Output_data::add_dynamic_reloc): Rewrite.
7398 (Output_data::has_dynamic_reloc): New function.
7399 (Output_data::dynamic_reloc_count): Remove.
7400 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7401 is_last_relro_, is_first_non_relro_, is_interp_,
7402 is_dynamic_linker_section_ fields. Add order and set_order
7403 functions. Remove is_relro_local, set_is_relro_local,
7404 is_last_relro, set_is_last_relro, is_first_non_relro,
7405 set_is_first_non_relro functions, is_interp, set_is_interp,
7406 is_dynamic_linker_section, and set_is_dynamic_linker_section
7408 (class Output_segment): Change Output_data_list from std::list to
7409 std:;vector. Add output_lists_ field. Remove output_data_ and
7410 output_bss_ fields. Update declarations.
7412 2010-08-02 Ian Lance Taylor <iant@google.com>
7414 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7415 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7416 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7418 2010-08-02 Ian Lance Taylor <iant@google.com>
7421 * script.cc (Script_options::Script_options): Initialize
7422 symbol_definitions_ and symbol_references_.
7423 (Script_options::add_symbol_assignment): Update
7424 symbol_definitions_ and symbol_references_.
7425 (Script_options::add_symbol_reference): New function.
7426 (script_symbol): New function.
7427 * script.h (class Script_options): Add symbol_definitions_ and
7428 symbol_references_ fields.
7429 (Script_options::referenced_const_iterator): New type.
7430 (Script_options::referenced_begin): New function.
7431 (Script_options::referenced_end): New function.
7432 (Script_options::is_referenced): New function.
7433 (Script_options::any_unreferenced): New function.
7434 * script-c.h (script_symbol): Declare.
7435 * yyscript.y (exp): Call script_symbol.
7436 * symtab.cc: Include "script.h".
7437 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7438 Change all callers. Check symbols referenced by scripts.
7439 (Symbol_table::add_undefined_symbols_from_command_line): Add
7440 layout parameter. Change all callers.
7441 (Symbol_table::do_add_undefined_symbols_from_command_line):
7442 Likewise. Break out loop body. Check symbols referenced by
7444 (Symbol_table::add_undefined_symbol_from_command_line): New
7445 function broken out of
7446 do_add_undefined_symbols_from_command_line.
7447 * symtab.h (class Symbol_table): Update declarations.
7448 * archive.cc: Include "layout.h".
7449 (Archive::should_include_member): Add layout parameter. Change
7450 all callers. Check for symbol mentioned in expression.
7451 * archive.h (class Archive): Update declaration.
7452 * object.cc (Sized_relobj::do_should_include_member): Add layout
7454 * object.h (Object::should_include_member): Add layout parameter.
7456 (Object::do_should_include_member): Add layout parameter.
7457 (class Sized_relobj): Update declaration.
7458 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7460 * dynobj.h (class Sized_dynobj): Update declaration.
7461 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7463 * plugin.h (class Sized_pluginobj): Update declaration.
7465 2010-08-02 Ian Lance Taylor <iant@google.com>
7468 * output.cc (Output_segment::set_offset): Search for the first and
7469 last sections rather than assuming that the list is in order.
7470 (Output_segment::find_first_and_last_list): New function.
7471 * output.h (class Output_segment): Update declarations.
7472 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7473 (relro_strip_test_SOURCES): New variable.
7474 (relro_strip_test_DEPENDENCIES): New variable.
7475 (relro_strip_test_LDFLAGS): New variable.
7476 (relro_strip_test_LDADD): New variable.
7477 (relro_strip_test.so): New target.
7479 2010-08-02 Ian Lance Taylor <iant@google.com>
7481 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7482 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7483 (Target_i386::got_tlsdesc_section): New function.
7484 (Target_i386::got_section): Create space for GOT entries for
7485 TLSDESC relocations.
7486 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7488 (Target_i386::Scan::global): Likewise.
7489 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7491 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7492 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7493 (Target_x86_64::got_tlsdesc_section): New function.
7494 (Target_x86_64::got_section): Create space for GOT entries for
7495 TLSDESC relocations.
7496 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7498 (Target_x86_64::Scan::global): Likewise.
7499 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7502 2010-08-02 Ian Lance Taylor <iant@google.com>
7504 * testsuite/final_layout.sh: Use dc to convert from hex to
7507 2010-07-29 Sriraman Tallam <tmsriram@google.com>
7509 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7510 paramter to the call to gold::gc_process_relocs.
7511 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7512 paramter to the call to gold::gc_process_relocs.
7513 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7514 parameter to the call to gold::gc_process_relocs.
7515 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7516 template parameter to the call to gold::gc_process_relocs.
7517 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7518 paramter to the call to gold::gc_process_relocs.
7519 * gc.h (get_embedded_addend_size): New function.
7520 (gc_process_relocs): Save the size of the reloc for use by ICF.
7521 * icf.cc (get_section_contents): Get the addend from the text section
7522 for SHT_REL relocation sections.
7523 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7524 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7525 * int_encoding.h (read_from_pointer): New overloaded function.
7526 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7527 * testsuite/icf_sht_rel_addend_test.sh: New file.
7528 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7529 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7531 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7533 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7534 * Makefile.in: Regenerate.
7535 * testsuite/Makefile.in: Regenerate.
7537 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7539 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7540 * gold/testsuite/debug_msg.cc: Likewise.
7541 * gold/testsuite/odr_violation1.cc
7542 * gold/testsuite/odr_violation2.cc
7544 2010-07-21 Cary Coutant <ccoutant@google.com>
7546 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7547 string, and length fields.
7548 (Output_merge_string::Merged_strings_list): New type.
7549 (Output_merge_string::Merged_strings_lists): New typedef.
7550 (Output_merge_string): Replace merged_strings_ with
7551 merged_strings_lists_.
7552 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7553 Merged_strings_list per input object and section. Don't store pointer
7554 to the string. Don't store length with each merged string entry.
7555 (Output_merge_string::finalize_merged_data): Loop over list of merged
7556 strings lists. Recompute length of each merged string.
7558 2010-07-15 Cary Coutant <ccoutant@google.com>
7560 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7563 2010-07-14 Ian Lance Taylor <iant@google.com>
7565 * descriptors.cc (Descriptors::open): Report correct name in error
7568 2010-07-13 Doug Kwan <dougkwan@google.com>
7570 * arm.cc (Arm_input_section::Arm_input_section): For a
7571 SHT_ARM_EXIDX section, always keeps the input sections.
7572 (Arm_input_section::set_exidx_section_link): New method.
7573 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7574 has_errors_ to false.
7575 (Arm_exidx_input_section::has_errors,
7576 Arm_exidx_input_section::set_has_errors): New methods.
7577 (Arm_exidx_input_section::has_errors_): New data member.
7578 (Arm_relobj::get_exidx_shndx_list): New method.
7579 (Arm_output_section::append_text_sections_to_list): Do not skip
7580 section without SHF_EXECINSTR.
7581 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7583 (Arm_relobj::make_exidx_input_section): Add new parameter for text
7584 section header. Make error messages more verbose. Check for
7585 a non-executable section linked to an EXIDX section.
7586 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7587 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7588 check that there is no deferred EXIDX section if we exit early.
7589 Instead of not making an EXIDX section in case of an error, make one
7590 and set the has_errors flag of it.
7591 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7592 in a relocatable link.
7593 (Target_arm::do_relax): Look for the EXIDX output section instead of
7594 assuming that it is called .ARM.exidx.
7595 (Target_arm::fix_exidx_coverage): Add a new parameter for input
7596 section list. Do not check for SHF_EXECINSTR section flags but
7597 skip any input section with errors.
7598 * output.cc (Output_section::Output_section): Initialize
7599 always_keeps_input_sections_ to false.
7600 (Output_section::add_input_section): Check for
7601 always_keeps_input_sections_.
7602 * output.h (Output_section::always_keeps_input_sections,
7603 Output_section::set_always_keeps_input_sections): New methods.
7604 (Output_section::always_keeps_input_sections): New data member.
7606 2010-07-13 Rafael Espindola <espindola@google.com>
7608 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7609 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7611 2010-07-13 Philip Herron <herron.philip@googlemail.com>
7612 Ian Lance Taylor <iant@google.com>
7614 * output.h (Output_section_lookup_maps::add_merge_section):
7615 Correct check of whether value was inserted.
7616 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7617 (Output_section_lookup_maps::add_relaxed_input_section):
7619 * arm.cc (Target_arm::got_section): Remove used local os.
7620 * i386.cc (Target_i386::got_section): Likewise.
7621 * x86_64.cc (Target_x86_64::got_section): Likewise.
7622 * sparc.cc (Target_sparc::got_section): Likewise.
7623 (Target_sparc::relocate): Remove unused local have_got_offset.
7624 * powerpc.cc (Target_powerpc::relocate): Likewise.
7626 2010-07-13 Ian Lance Taylor <iant@google.com>
7628 * compressed_output.cc (zlib_decompress): Fix signature in
7631 * archive.cc (Archive::include_member): Unlock an external member
7632 of a thin archive. Don't bother to delete an object we know is
7635 2010-07-12 Cary Coutant <ccoutant@google.com>
7637 * compressed_output.cc (zlib_decompress): New function.
7638 (get_uncompressed_size): New function.
7639 (decompress_input_section): New function.
7640 * compressed_output.h (get_uncompressed_size): New function.
7641 (decompress_input_section): New function.
7642 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7643 Handle compressed debug sections.
7644 * layout.cc (is_compressed_debug_section): New function.
7645 (Layout::output_section_name): Map compressed section names to
7647 * layout.h (is_compressed_debug_section): New function.
7648 (is_debug_info_section): Recognize compressed debug sections.
7649 * merge.cc: Include compressed_output.h.
7650 (Output_merge_data::do_add_input_section): Handle compressed
7652 (Output_merge_string::do_add_input_section): Handle compressed
7654 * object.cc: Include compressed_output.h.
7655 (Sized_relobj::Sized_relobj): Initialize new data members.
7656 (build_compressed_section_map): New function.
7657 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7658 * object.h (Object::section_is_compressed): New method.
7659 (Object::do_section_is_compressed): New method.
7660 (Sized_relobj::Compressed_section_map): New type.
7661 (Sized_relobj::do_section_is_compressed): New method.
7662 (Sized_relobj::compressed_sections_): New data member.
7663 * output.cc (Output_section::add_input_section): Handle compressed
7665 * reloc.cc: Include compressed_output.h.
7666 (Sized_relobj::write_sections): Handle compressed debug sections.
7668 2010-07-08 Cary Coutant <ccoutant@google.com>
7670 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7671 weak when resolving to a dynamic def.
7672 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7673 for weak undef/dynamic def cases. Adjust callers.
7674 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7675 undef_binding_weak_.
7676 (Symbol_table::sized_write_globals): Adjust symbol binding.
7677 (Symbol_table::sized_write_symbol): Add binding parameter.
7678 * symtab.h (Symbol::set_undef_binding): New method.
7679 (Symbol::is_undef_binding_weak): New method.
7680 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7681 (Symbol_table::should_override): Add new parameter.
7682 (Symbol_table::sized_write_symbol): Add new parameter.
7684 * testsuite/weak_undef_file1.cc: Add new test case.
7685 * testsuite/weak_undef_file2.cc: Fix header comment.
7686 * testsuite/weak_undef_test.cc: Add new test case.
7688 2010-06-29 Doug Kwan <dougkwan@google.com>
7690 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7691 Initialize USE_SYMBOL_.
7692 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7694 (Arm_reloc_property::uses_symbol_): New data member declaration.
7695 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7696 uses symbol value and symbol is undefined but not weakly undefined.
7698 2010-06-28 Rafael Espindola <espindola@google.com>
7700 * plugin.cc (Plugin::load): Use dlerror.
7702 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7704 * symtab.cc (detect_odr_violations): When reporting an ODR
7705 violation, report an object where the symbol is defined.
7707 2010-06-25 Doug Kwan <dougkwan@google.com>
7709 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7710 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7712 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7713 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7714 target hook to detect function points.
7715 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7716 * icf.h (Icf::check_section_for_function_pointers): Change type of
7717 parameter SECTION_NAME to const reference to std::string. Use
7718 target hook to determine if section may have unsafe pointers.
7719 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7722 2010-06-21 Rafael Espindola <espindola@google.com>
7724 * fileread.cc (Input_file::find_fie): New
7725 (Input_file::open): Use Input_file::find_fie.
7726 * fileread.h (Input_file::find_fie): New
7727 * plugin.cc (set_extra_library_path): New.
7728 (Plugin::load): Add set_extra_library_path to the transfer vector.
7729 (Plugin_manager::set_extra_library_path): New.
7730 (Plugin_manager::add_input_file): Use the extra search path if set.
7731 (set_extra_library_path(): New.
7732 * plugin.h (Plugin_manager): Add set_extra_library_path and
7735 2010-06-19 Cary Coutant <ccoutant@google.com>
7737 * layout.cc (gdb_sections): Add .debug_types.
7738 (lines_only_debug_sections): Likewise.
7740 2010-06-18 Rafael Espindola <espindola@google.com>
7742 * plugin.cc (add_input_file,add_input_library)
7743 (Plugin_manager::add_input_file): Make filename arguments const.
7744 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7747 2010-06-16 Doug Kwan <dougkwan@google.com>
7749 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7750 .ARM.attributes section if we have not merged any input
7751 attributes sections.
7753 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7755 * arm.cc: Allow combining objects with no EABI version
7758 2010-06-15 Rafael Espindola <espindola@google.com>
7760 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7762 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7764 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7765 (struct iovec): Correct !HAVE_READV definition.
7767 2010-06-10 Cary Coutant <ccoutant@google.com>
7769 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7770 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7772 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7775 * symtab.h (Symbol::is_placeholder): New member function.
7776 * target-reloc.h (relocate_section): Check for placeholder symbols.
7778 * testsuite/Makefile.am (plugin_test_8): New test.
7779 (plugin_test_9): New test.
7780 * testsuite/Makefile.in: Regenerate.
7782 2010-06-09 Nick Clifton <nickc@redhat.com>
7784 * yyscript.y (input_list_element): Allow strings prefixed with
7785 the '-' character. Treat these as libraries.
7786 * script.cc (script_add_library): New function. Adds a library
7787 specified by "-l<name>" found in an input script.
7788 * script-c.h: Add prototype for script_add_library.
7790 2010-06-07 Doug Kwan <dougkwan@google.com>
7792 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7793 Restrict stub-group size to be within long conditional branch
7794 range when working around cortex-A8 erratum.
7796 2010-06-07 Damien Diederen <dd@crosstwine.com>
7798 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7801 2010-06-03 Sriraman Tallam <tmsriram@google.com>
7805 (Output_section::Input_section_sort_entry::compare_section_ordering):
7806 Change to return non-zero correctly.
7807 (Output_section::Input_section_sort_section_order_index_compare
7808 ::operator()): Change to fix ambiguity in comparisons.
7810 2010-06-01 Sriraman Tallam <tmsriram@google.com>
7812 * gold.h (is_wildcard_string): New function.
7813 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7814 (Layout::layout_eh_frame): Ditto.
7815 (Layout::find_section_order_index): New method.
7816 (Layout::read_layout_from_file): New method.
7817 * layout.h (Layout::find_section_order_index): New method.
7818 (Layout::read_layout_from_file): New method.
7819 (Layout::input_section_position_): New private member.
7820 (Layout::input_section_glob_): New private member.
7821 * main.cc (main): Call read_layout_from_file here.
7822 * options.h (--section-ordering-file): New option.
7823 * output.cc (Output_section::input_section_order_specified_): New
7825 (Output_section::Output_section): Initialize new member.
7826 (Output_section::add_input_section): Add new parameter.
7827 Keep input sections when --section-ordering-file is used.
7828 (Output_section::set_final_data_size): Sort input sections when
7829 section ordering file is specified.
7830 (Output_section::Input_section_sort_entry): Add new parameter.
7832 (Output_section::Input_section_sort_entry::compare_section_ordering):
7834 (Output_section::Input_section_sort_compare::operator()): Change to
7835 consider section_order_index.
7836 (Output_section::Input_section_sort_init_fini_compare::operator()):
7837 Change to consider section_order_index.
7838 (Output_section::Input_section_sort_section_order_index_compare
7839 ::operator()): New method.
7840 (Output_section::sort_attached_input_sections): Change to sort
7841 according to section order when specified.
7842 (Output_section::add_input_section<32, true>): Add new parameter.
7843 (Output_section::add_input_section<64, true>): Add new parameter.
7844 (Output_section::add_input_section<32, false>): Add new parameter.
7845 (Output_section::add_input_section<64, false>): Add new parameter.
7846 * output.h (Output_section::add_input_section): Add new parameter.
7847 (Output_section::input_section_order_specified): New
7849 (Output_section::set_input_section_order_specified): New method.
7850 (Input_section::Input_section): Initialize section_order_index_.
7851 (Input_section::section_order_index): New method.
7852 (Input_section::set_section_order_index): New method.
7853 (Input_section::section_order_index_): New member.
7854 (Input_section::Input_section_sort_section_order_index_compare): New
7856 (Output_section::input_section_order_specified_): New member.
7857 * script-sections.cc (is_wildcard_string): Delete and move modified
7859 (Output_section_element_input::Output_section_element_input): Modify
7860 call to is_wildcard_string.
7861 (Output_section_element_input::Input_section_pattern
7862 ::Input_section_pattern): Ditto.
7863 (Output_section_element_input::Output_section_element_input): Ditto.
7864 * testsuite/Makefile.am (final_layout): New test case.
7865 * testsuite/Makefile.in: Regenerate.
7866 * testsuite/final_layout.cc: New file.
7867 * testsuite/final_layout.sh: New file.
7869 2010-06-01 Rafael Espindola <espindola@google.com>
7871 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7873 2010-06-01 Rafael Espindola <espindola@google.com>
7875 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7876 visibility of symbols.
7878 2010-05-27 Doug Kwan <dougkwan@google.com>
7880 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7881 from start of output section instead of address for a local symbol
7882 in a merged or relaxed section when doing a relocatable link.
7884 2010-05-26 Rafael Espindola <espindola@google.com>
7887 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7888 adding sections the garbage collector removed.
7889 * gold/testsuite/Makefile.am: Add test.
7890 * gold/testsuite/Makefile.in: Regenerate.
7891 * gold/testsuite/plugin_test_7.sh: New.
7892 * gold/testsuite/plugin_test_7_1.c: New.
7893 * gold/testsuite/plugin_test_7_2.c: New.
7895 2010-05-26 Rafael Espindola <espindola@google.com>
7897 * script-sections.cc (Output_section_definition::set_section_addresses):
7898 Check for --section-start.
7900 2010-05-26 Doug Kwan <dougkwan@google.com>
7902 * arm.cc (Arm_scan_relocatable_relocs): New class.
7903 (Target_arm::relocate_special_relocatable): New method.
7904 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7905 (Arm_relocate_functions::thumb_branch_common): Same.
7906 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7907 instead of Default_scan_relocatable_relocs.
7908 * target-reloc.h (relocate_for_relocatable): Let target handle
7909 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7910 * target.h (Sized_target::relocate_special_relocatable): New method.
7912 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7914 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7916 2010-05-23 Doug Kwan <dougkwan@google.com>
7918 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7920 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7921 with a direct branch, not a conditional branch, to a stub.
7922 * merge.cc (Output_merge_base::record_input_section): New method
7924 (Output_merge_data::do_add_input_section): Record input section if
7925 keeps-input-sections flag is set.
7926 (Output_merge_string::do_add_input_section): Ditto.
7927 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7928 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7930 (Output_merge_base::keeps_input_sections,
7931 Output_merge_base::set_keeps_input_sections,
7932 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7934 (Output_merge_base::Input_sections): New type declaration.
7935 (Output_merge_base::input_sections_begin,
7936 Output_merge_base::input_sections_end,
7937 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7938 (Output_merge_base::bool keeps_input_sections_,
7939 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7940 Output_merge_base::input_sections_): New data members.
7941 (Output_merge_data::do_set_keeps_input_sections): New method
7943 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7944 * output.cc (Output_section::Input_section::relobj): Move method
7945 defintion from class declaration to here and handle merge sections.
7946 (Output_section::Input_section::shndx): Ditto.
7947 (Output_section::Output_section): Remove initializations of removed
7948 data members and initialize new data member LOOKUP_MAPS_.
7949 (Output_section::add_input_section): Set keeps-input-sections flag
7950 for a newly created merge output section as appropriate. Adjust code
7951 to use Output_section_lookup_maps class.
7952 (Output_section::add_relaxed_input_section): Adjst code for lookup
7953 maps code refactoring.
7954 (Output_section::add_merge_input_section): Add a new parameter
7955 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7956 class. If adding input section to a newly created merge output
7957 section fails, remove the new merge section.
7958 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
7959 Adjust code for use of the Output_section_lookup_maps class.
7960 (Output_section::find_merge_section): Ditto.
7961 (Output_section::build_lookup_maps): New method defintion.
7962 (Output_section::find_relaxed_input_section): Adjust code to use
7963 Output_section_lookup_maps class.
7964 (Output_section::get_input_sections): Export merge sections. Adjust
7965 code to use Output_section_lookup_maps class.
7966 (Output_section:::add_script_input_section): Adjust code to use
7967 Output_section_lookup_maps class. Update lookup maps for merge
7969 (Output_section::discard_states): Use Output_section_lookup_maps.
7970 (Output_section::restore_states): Same.
7971 * output.h (Merge_section_properties): Move class defintion out of
7973 (Output_section_lookup_maps): New class.
7974 (Output_section::Input_section::is_merge_section): New method
7976 (Output_section::Input_section::relobj): Move defintion out of class
7977 defintion. Declare method only.
7978 (Output_section::Input_section::shndx): Ditto.
7979 (Output_section::Input_section::output_merge_base): New method defintion.
7980 (Output_section::Input_section::u2_.pomb): New union field.
7981 (Output_section::Merge_section_by_properties_map,
7982 Output_section::Output_section_data_by_input_section_map,
7983 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7985 (Output_section::add_merge_input_section): Add new parameter
7986 KEEPS_INPUT_SECTIONS.
7987 (Output_section::build_lookup_maps): New method declaration.
7988 (Output_section::merge_section_map_,
7989 Output_section::merge_section_by_properties_map_,
7990 Output_section::relaxed_input_section_map_,
7991 Output_section::is_relaxed_input_section_map_valid_): Remove data
7993 (Output_section::lookup_maps_): New data member.
7995 2010-05-21 Doug Kwan <dougkwan@google.com>
7998 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
7999 avoid a compilation error.
8001 2010-05-19 Rafael Espindola <espindola@google.com>
8003 * script-sections.cc (Output_section_definition::allocate_to_segment):
8004 Update the phdrs_list even when the output section is NULL.
8005 * testsuite/Makefile.am: Add test.
8006 * testsuite/Makefile.in: Regenerate.
8007 * testsuite/script_test_9.cc: New.
8008 * testsuite/script_test_9.sh: New.
8009 * testsuite/script_test_9.t: New.
8011 2010-05-19 Doug Kwan <dougkwan@google.com>
8013 * arm.cc (Arm_input_section::original_size): New method.
8014 (Arm_input_section::do_addralign): Add a cast.
8015 (Arm_input_section::do_output_offset): Remove static cast.
8016 (Arm_input_section::original_addralign,
8017 Arm_input_section::original_size_): Change type to uint32_t.
8018 (Arm_input_section::init): Add safe casts for section alignment
8020 (Arm_input_section::set_final_data_size): Do not set address and
8021 offset of stub table.
8022 (Arm_output_section::fix_exidx_coverage): Change use of of
8023 Output_section::Simple_input_section to that of
8024 Output_section::Input_section.
8025 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8026 except for the first pass.
8027 * output.cc (Output_section::get_input_sections): Change type of
8028 input_sections to std::list<Input_section>.
8029 (Output_section::add_script_input_section): Rename from
8030 Output_section::add_simple_input_section. Change type of SIS
8031 parameter from Simple_input_section to Input_section.
8032 * output.h (Output_section::Simple_input_section): Remove class.
8033 (Output_section::Input_section): Change class visibility to public.
8034 (Output_section::Input_section::addralign): Use stored alignments
8035 for special input sections if set.
8036 (Output_section::Input_section::set_addralign): New method.
8037 (Output_section::get_input_sections): Change parameter type from
8038 list of Simple_input_section to list of Input_section.
8039 (Output_section::add_script_input_section): Rename from
8040 Output_section::add_simple_input_section. Change first parameter's
8041 type from Simple_input_section to Input_section and remove the
8042 second and third parameters.
8043 * script-sections.cc (Input_section::Input_section_list): Change
8044 type to list of Output_section::Input_section/
8045 (Input_section_info::Input_section_info): Change parameter type of
8046 INPUT_SECTION to Output_section::Input_section.
8047 (Input_section_info::input_section): Change return type.
8048 (Input_section_info::input_section_): Change type to
8049 Output_section::Input_section.
8050 (Output_section_element_input::set_section_addresses): Adjust code
8051 to use Output_section::Input_section instead of
8052 Output_section::Simple_input_section. Adjust code for renaming
8053 of Output_section::add_simple_input_section.
8054 (Orphan_output_section::set_section_addresses): Ditto.
8056 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8058 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8059 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8061 2010-05-18 Rafael Espindola <espindola@google.com>
8063 * options.cc (General_options::finalize): Handle -nostdlib.
8064 * options.h (nostdlib): New option.
8065 * script.cc (script_add_search_dir): Handle -nostdlib.
8067 2010-05-12 Doug Kwan <dougkwan@google.com>
8069 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8070 attributes section only if there no attributes section after merging.
8071 (Target_arm::merge_object_attributes): Move value of
8072 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
8073 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8074 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8075 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8076 and arm_attr_merge_7.stdout.
8077 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8078 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8079 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8080 arm_attr_merge_7b.o): New rules.
8081 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8083 * testsuite/Makefile.in: Regenerate.
8084 * testsuite/arm_attr_merge.sh: New file.
8085 * testsuite/arm_attr_merge_[67][ab].s: Same.
8087 2010-05-05 Nick Clifton <nickc@redhat.com>
8089 * po/es.po: Updated Spanish translation.
8091 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8093 * Makefile.am (install-exec-local): Properly install gold as
8094 default cross linker.
8095 * Makefile.in: Regenerated.
8097 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8098 Nick Clifton <nickc@redhat.com>
8100 * configure.ac (install_as_default): Define and set to false
8101 unless --enable-gold or --enable-gold=both/gold has been
8103 * configure: Regenerate.
8105 * Makefile.am (install-exec-local): Install the executable as
8106 'ld.gold'. If install_as_default is true then also install it as
8108 * Makefile.in: Regenerated.
8110 2010-04-24 Ian Lance Taylor <iant@google.com>
8112 * layout.cc (Layout::layout_reloc): In relocatable link don't
8113 combine reloc sections for grouped sections.
8115 2010-04-23 Sriraman Tallam <tmsriram@google.com>
8117 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8118 sections that are not ordinary to icf.
8119 * icf.cc (get_section_contents): Handle relocation pointing to section
8120 with no object or shndx information.
8121 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8122 * testsuite/Makefile.in: Regenerate.
8123 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8124 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8126 2010-04-22 Ian Lance Taylor <iant@google.com>
8128 * expression.cc (Expression::Expression_eval_info): Add
8129 result_alignment_pointer field.
8130 (Expression::eval_with_dot): Add result_alignment_pointer
8131 parameter. Change all callers.
8132 (Expression::eval_maybe_dot): Likewise.
8133 (class Binary_expression): Add alignment_pointer parameter to
8134 left_value and right_value. Change all callers.
8135 (BINARY_EXPRESSION): Set result alignment.
8136 (class Trinary_expression): Add alignment_pointer parameter to
8137 arg2_value and arg3_value. Change all callers.
8138 (Trinary_cond::value): Set result alignment.
8139 (Max_expression::value, Min_expression::value): Likewise.
8140 (Align_expression::value): Likewise.
8141 * script-sections.cc (class Sections_element): Add dot_alignment
8142 parameter to set_section_addresses virtual function. Update
8144 (class Output_section_element): Likewise.
8145 (Script_sections::create_segments): Add dot_alignment parameter.
8147 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8148 (Script_sections::set_phdrs_clause_addresses): Likewise.
8149 * script-sections.h: Update declarations.
8150 * script.h: Update declarations.
8151 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8153 * testsuite/script_test_3.t: Set large alignment.
8154 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8155 segment has expected alignment.
8157 2010-04-22 Nick Clifton <nickc@redhat.com>
8159 * po/gold.pot: Updated by the Translation project.
8160 * po/vi.po: Updated Vietnamese translation.
8162 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8164 * testsuite/Makefile.am (check_PROGRAMS): Add
8165 icf_virtual_function_folding_test.
8166 * testsuite/Makefile.in: Regenerated.
8168 2010-04-15 Andrew Haley <aph@redhat.com>
8170 * options.h (merge_exidx_entries): New option.
8171 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8172 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8173 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8174 (Target_arm::merge_exidx_entries): New function.
8175 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8176 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8177 to Arm_exidx_fixup constructor.
8178 Add new arg, merge_exidx_entries.
8179 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8180 Arm_output_section::fix_exidx_coverage.
8182 2010-04-18 Sriraman Tallam <tmsriram@google.com>
8184 * icf.cc (get_section_contents): Check for preemptible functions.
8185 Ignore addend when appropriate.
8186 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8188 (add_from_relobj): Check for section folded.
8189 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8190 * symtab.h (should_add_dynsym_entry): Add new parameter.
8191 * target-reloc.h (scan_relocs): Check for section folded.
8192 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8193 Check reloc types for function pointers in shared objects.
8194 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8196 (icf_preemptible_functions_test): New test case.
8197 (icf_string_merge_test): New test case.
8198 * testsuite.Makefile.in: Regenerate.
8199 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8200 bar_glob. Refactor code.
8201 * testsuite/icf_preemptible_functions_test.cc: New file.
8202 * testsuite/icf_preemptible_functions_test.sh: New file.
8203 * testsuite/icf_string_merge_test.cc: New file.
8204 * testsuite/icf_string_merge_test.sh: New file.
8205 * testsuite/icf_virtual_function_folding_test.cc: New file.
8206 * testsuite/icf_virtual_function_folding_test.sh: New file.
8208 2010-04-14 Doug Kwan <dougkwan@google.com>
8210 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8211 for local symbol recounting if we remove a section due to ICF.
8212 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8213 there are no regular objects in input.
8215 2010-04-13 Doug Kwan <dougkwan@google.com>
8217 * arm.cc (Arm_input_section::set_final_data_size): Compute
8218 accurate final data size instead of using current data size.
8220 2010-04-09 Doug Kwan <dougkwan@google.com>
8222 * layout.cc (Layout::choose_output_section): Handle script section
8224 (Layout::make_output_section_for_script): Add section type parameter.
8225 Handle script section types.
8226 * layout.h (Layout::make_output_section_for_script): Add section
8228 * output.cc (Output_section::Output_section): Initialize data member
8230 (Output_section::do_reset_address_and_file_offset): Do not set address
8231 to 0 if section is a NOLOAD section.
8232 * output.h (Output_section::is_noload): New method.
8233 (Output_section::set_is_noload): Ditto.
8234 (Output_section::is_noload_): New data member.
8235 * script-c.h (Script_section_type): New enum type.
8236 (struct Parser_output_section_header): Add new file section_type.
8237 * script-sections.cc (Sections_element::output_section_name): Add
8238 parameter for returning script section type.
8239 (Output_section_definition::output_section_name): Ditto.
8240 (Output_section_definition::section_type)P; New method.
8241 (Output_section_definiton::script_section_type_name): Ditto.
8242 (Output_section_definition::script_section_type_): New data member.
8243 (Output_section_definition::Output_section_definition): Initialize
8244 data member Output_section_definition::script_section_type_.
8245 (Output_section_definition::create_sections): Pass script section type
8246 to Layout::make_output_section_for_script.
8247 (Output_section_definition::output_section_name): Return script
8248 section type to caller.
8249 (Output_section_definition::set_section_address): Do not advance
8250 dot value and load address if section type is NOLOAD. Set address
8251 of NOLOAD sections regardless of section flags.
8252 (Output_section_definition::print): Print section type if it is
8253 not SCRIPT_SECTION_TYPE_NONE.
8254 (Output_section_definition::section_type): New method.
8255 (Output_section_definition::script_section_type_name): Ditto.
8256 (Script_sections::output_section_name): Add new parameter
8257 PSECTION_TYPE for returning script section type. Pass it to
8258 section elements. Handle discard sections.
8259 (Sort_output_sections::operator()): Handle NOLOAD sections.
8260 * script-sections.h (Script_sections::Section_type): New enum type.
8261 (Script_sections::output_section_name): Add a new parameter for
8262 returning script section type.
8263 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8265 * yyscript.y (union): Add new field SECTION_TYPE.
8266 (COPY, DSECT, INFO, NOLOAD): New tokens.
8267 (opt_address_and_section_type): Change type to output_section_header.
8268 (section_type): New non-terminal
8269 (section_header): Handle section type.
8270 (opt_address_and_section_type): Return section type value.
8272 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8274 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8275 * testsuite/plugin_common_test_2.c (foo): Likewise.
8277 2010-04-08 Doug Kwan <dougkwan@google.com>
8279 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8281 * output.cc (Output_section::add_merge_input_section): Simplify
8282 code and return status of Output_merge_base::add_input_section.
8283 Update merge section map only if Output_merge_base::add_input_section
8286 2010-04-07 Doug Kwan <dougkwan@google.com>
8288 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8289 if section is marked as containing instructions but has no mapping
8291 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8292 correct section index.
8293 (Arm_relobj::find_linked_text_section): Ditto.
8295 2010-04-07 Cary Coutant <ccoutant@google.com>
8297 * archive.cc (include_member): Destroy Read_symbols_data object before
8299 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8300 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8301 (Read_symbols_data::~Read_symbols_data) New destructor.
8302 (Section_relocs::Section_relocs) New constructor.
8303 (Section_relocs::~Section_relocs) New destructor.
8304 (Read_relocs_data::Read_relocs_data) New constructor.
8305 (Read_relocs_data::~Read_relocs_data) New destructor.
8306 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8307 pointers to NULL after deleting.
8309 2010-04-07 Doug Kwan <dougkwan@google.com>
8311 * arm.cc: Replace "endianity" with "endianness" in comments.
8312 (Arm_exidx_cantunwind): Ditto.
8313 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8314 (Arm_relobj::merge_flags_and_attributes): New method.
8315 (Arm_relobj::merge_flags_and_attributes_): New data member.
8316 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8317 (Arm_relobj::scan_sections_for_stubs): Ditto.
8318 (Arm_relobj::do_read_symbols): Check to see if we really want to
8319 merge processor-specific flags and attributes. Exit early if
8320 an object is empty except for section names and the undefined symbol.
8321 (Target_arm::do_finalize_sections): Move check for ELF format to
8322 Arm_relobj::do_read_symbols. Merge processor specific flags and
8323 attributes from a regular object only when we have determined that
8324 it is aapropriate. Do not create an .ARM.attributes section in
8325 output if there is no regular input object.
8326 (Target_arm::merge_processor_specific_flags): Check
8327 --warn-mismatch before printing any error.
8328 (Target_arm::merge_object_attributes): Ditto.
8329 * gold.cc (queue_middle_tasks): Handle the case in which there is
8330 no regular object in input.
8331 * options.cc (General_options::parse_EB): New method.
8332 (General_options::parse_EL): Same.
8333 (General_options::General_options): Initialize endianness_.
8334 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8336 (General_options::Endianness): New enum.
8337 (General_options::endianness): New method.
8338 (General_options::endianness_): New data member.
8339 * parameters.cc (Parameters::set_options): Check target endianness.
8340 (Parameters::set_target_once): Ditto.
8341 (Parameters::check_target_endianness): New method.
8342 (parameters_force_valid_target): If either -EL or -EB is specified,
8343 use it to define endianness of default target.
8344 * parameters.h (Parameters::check_target_endianness): New method
8346 * target.h (class Target): Change "endianity" to "endianness"
8349 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8351 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8352 * configure: Regenerate.
8353 * Makefile.in: Regenerate.
8354 * testsuite/Makefile.in: Regenerate.
8356 2010-04-06 Cary Coutant <ccoutant@google.com>
8359 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8360 prevailing definitions of common symbols.
8361 * testsuite/plugin_test_6.sh: New test case.
8362 * testsuite/plugin_common_test_1.c: New test case.
8363 * testsuite/plugin_common_test_2.c: New test case.
8364 * testsuite/Makefile.am (plugin_test_6): New test case.
8365 * testsuite/Makefile.in: Regenerate.
8367 2010-04-06 Nick Clifton <nickc@redhat.com>
8369 * po/vi.po: New Vietnamese translation.
8371 2010-03-30 Doug Kwan <dougkwan@google.com>
8373 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8375 2010-03-25 Doug Kwan <dougkwan@google.com>
8377 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8378 to avoid a conversion warning on a 32-bit host.
8380 2010-03-24 Ian Lance Taylor <iant@google.com>
8382 * testsuite/script_test_3.t: Add a TLS segment.
8383 * testsuite/Makefile.am (check_PROGRAMS): Add
8384 tls_phdrs_script_test.
8385 (tls_phdrs_script_test_SOURCES): Define.
8386 (tls_phdrs_script_test_DEPENDENCIES): Define.
8387 (tls_phdrs_script_test_LDFLAGS): Define.
8388 (tls_phdrs_script_test_LDADD): Define.
8389 * testsuite/Makefile.in: Rebuild.
8391 2010-03-23 Cary Coutant <ccoutant@google.com>
8393 * fileread.cc (find_or_make_view): Fix comment.
8395 2010-03-23 Ian Lance Taylor <iant@google.com>
8397 * script-sections.cc (class Orphan_section_placement): Define
8398 PLACE_TLS and PLACE_TLS_BSS.
8399 (Orphan_section_placement::Orphan_section_placement): Initialize
8401 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8402 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8403 (tls_script_test_SOURCES): Define.
8404 (tls_script_test_DEPENDENCIES): Define.
8405 (tls_script_test_LDFLAGS): Define.
8406 (tls_script_test_LDADD): Define.
8407 * testsuite/Makefile.in: Rebuild.
8409 2010-03-22 Doug Kwan <dougkwan@google.com>
8411 * arm.cc (Arm_relocate_functions::abs8,
8412 Arm_relocate_functions::abs16): Use correct check for overflow
8413 specified in the ARM ELF specs.
8414 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8415 target of a BLX instruction specially.
8416 (Reloc_stub::stub_type_for_reloc): Ditto.
8417 (Relocate::relocate): Use symbolic names instead of numeric relocation
8418 codes to report error.
8419 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8421 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8422 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8423 thumb2_blx_out_of_range.stdout
8424 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8425 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8426 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8427 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8428 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8429 thumb2_blx_in_range, thumb2_blx_in_range.o,
8430 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8431 thumb2_blx_out_of_range.o): New rules.
8432 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
8433 thumb2_blx_in_range and thumb2_blx_out_of_range.
8434 * testsuite/Makefile.in: Regenerate.
8435 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8436 * testsuite/thumb_blx_in_range.s: New file.
8437 * testsuite/thumb_blx_out_of_range.s: New file.
8439 2010-03-22 Rafael Espindola <espindola@google.com>
8441 * archive.cc (Should_include): Move to archive.h.
8442 (should_include_member): Make it a member of Archive.
8444 (Add_lib_group_symbols): New.
8445 * archive.h: Include options.h.
8446 (Archive_member): Moved from Archive.
8447 (Should_include): Moved from archive.cc.
8449 (Add_lib_group_symbols): New.
8450 * dynobj.cc (do_should_include_member): New.
8451 * dynobj.h (do_should_include_member): New.
8452 * gold.cc (queue_initial_tasks): Update call to queue.
8453 * main.cc (main): Print lib group stats.
8454 * object.cc (do_should_include_member): New.
8455 * object.h: Include archive.h.
8456 (Object::should_include_member): New.
8457 (Object::do_should_include_member): New.
8458 (Sized_relobj::do_should_include_member): New.
8459 * options.cc (General_options::parse_start_lib): New.
8460 (General_options::parse_end_lib): New.
8461 (Input_arguments::add_file): Handle lib groups.
8462 (Input_arguments::start_group): Check we are not in a lib.
8463 (Input_arguments::start_lib): New.
8464 (Input_arguments::end_lib): New.
8465 * options.h (General_options): Add start_lib and end_lib.
8466 (Input_argument::lib_): New.
8467 (Input_argument::lib): New.
8468 (Input_argument::is_lib): New.
8469 (Input_file_lib): New.
8470 (Input_arguments::in_lib_): New.
8471 (Input_arguments::in_lib): New.
8472 (Input_arguments::start_lib): New.
8473 (Input_arguments::end_lib_): New.
8474 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8475 in unused members as preempted.
8476 (Sized_pluginobj::do_should_include_member): New.
8477 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8478 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8480 (Read_symbols::do_whole_lib_group): New.
8481 (Read_symbols::do_lib_group): New.
8482 (Read_symbols::do_read_symbols): Handle lib groups.
8483 (Read_symbols::get_name): Handle lib groups.
8484 * readsyms.h (Read_symbols): Add an archive member pointer.
8485 (Read_symbols::do_whole_lib_group): New.
8486 (Read_symbols::do_lib_group): New.
8487 (Read_symbols::member_): New.
8488 * script.cc (read_input_script): Update call to queue_soon.
8490 2010-03-19 Doug Kwan <dougkwan@google.com>
8492 * arm.cc (Stub_table::Stub_table): Initialize new data members
8493 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8494 (Stub_table::add_reloc_stub): Assign stub offset and update
8495 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8496 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8498 (Stub_table::update_data_size_and_addralign): Use
8499 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8500 instead of going over all reloc stubs.
8501 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
8502 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8503 Stringpool_template::offset_ to size of Stringpool_char.
8504 (Stringpool_template::new_key_offset): Remove code to initialize
8505 Stringpool_template::offset_.
8506 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8507 Stringpool_template::offset_ to zero.
8509 2010-03-15 Doug Kwan <dougkwan@google.com>
8511 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8513 (Stringpool_template::new_key_offset): New method.
8514 (Stringpool_template::add_string): Assign offsets when adding new
8516 (Stringpool_template::set_string_offsets): Do not set string offsets
8517 when not optimizing.
8518 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8520 (Chunked_vector::clear): Clear size_.
8521 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8522 (Chunked_vector::size): Return size_.
8523 (Chunked_vector::push_back): Use size_ to find insert position.
8524 (Chunked_vector::size_): New data member.
8525 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8526 (Stringpool_template::new_key_offset): New method declaration.
8527 (Stringpool_template::offset_): New data member.
8529 2010-03-15 Rafael Espindola <espindola@google.com>
8531 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8532 Add_symbols' constructor.
8533 * readsyms.h (Add_symbols): Remove the input_group member.
8535 2010-03-10 Ian Lance Taylor <iant@google.com>
8537 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8538 target to ask whether a reference to a symbol requires a stack
8540 * target.h (Target::is_call_to_non_split): New function.
8541 (Target::do_is_call_to_non_split): Declare virtual function.
8542 * target.cc: Include "symtab.h".
8543 (Target::do_is_call_to_non_split): New function.
8544 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8546 2010-03-10 Cary Coutant <ccoutant@google.com>
8548 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8549 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8550 (File_read::open[2]): Add whole_file_view_ to list of views.
8551 (File_read::make_view): Remove test of whole_file_view_.
8552 (File_read::find_or_make_view): Create whole_file_view_ if
8554 (File_read::clear_views): Replace bool parameter with enum;
8555 adjust all callers. Don't delete views with permanent data;
8556 do delete cached views and views from archives if
8557 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8558 if clearing the corresponding view.
8559 * fileread.h (File_read::Clear_views_mode): New enum.
8560 (File_read::View::is_permanent_view): New method.
8561 (File_read::clear_views): Replace bool parameter
8562 with enum; adjust all callers.
8563 * options.h (General_options): Change keep_files_mapped option;
8564 add map_whole_files.
8565 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8567 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8570 2010-03-10 David S. Miller <davem@davemloft.net>
8572 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8574 2010-03-09 Sriraman Tallam <tmsriram@google.com>
8576 * icf.cc (get_section_contents): Add '@' marker after processing the
8579 2010-03-08 Doug Kwan <dougkwan@google.com>
8581 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8582 due to a conversion warning.
8583 (Arm_relobj::update_output_local_symbol_count): Check for local
8584 symbol with unset output index.
8586 2010-03-05 Ian Lance Taylor <iant@google.com>
8588 * options.h (class General_options): Add --spare-dynamic-tags.
8589 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8590 --spare-dynamic-tags.
8592 2010-03-05 Ian Lance Taylor <iant@google.com>
8594 * incremental.cc: Include "libiberty.h".
8596 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8598 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8599 function, is_info_ member.
8600 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8601 (Versions::Versions): Update caller.
8602 (Versions::define_base_version): Likewise.
8603 (Versions::add_def): Likewise.
8605 2010-03-03 Sriraman Tallam <tmsriram@google.com>
8607 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8608 (Scan::possible_function_pointer_reloc): New function.
8609 (Scan::local_reloc_may_be_function_pointer): Change to call
8610 possible_function_pointer_reloc.
8611 (Scan::global_reloc_may_be_function_pointer): Ditto.
8612 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8613 relocations in ".data.rel.ro._ZTV" section.
8614 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8615 * testsuite/icf_safe_so_test.cc: Ditto.
8616 * testsuite/icf_safe_test.cc: Ditto.
8617 * testsuite/icf_safe_test.sh: Ditto.
8619 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8620 Ian Lance Taylor <iant@google.com>
8622 * target-reloc.h (relocate_section): Check the symbol table index
8623 for -1U before setting the local symbol index.
8624 (scan_relocatable_relocs): If copying the relocation, record that
8625 the local symbol is required.
8626 * object.h (Symbol_value::is_output_symtab_index_set): New
8628 (Symbol_value::may_be_discarded_from_output_symtab): New
8630 (Symbol_value::has_output_symtab_entry): New function.
8631 (Symbol_value::needs_output_symtab_entry): Remove.
8632 (Symbol_value::output_symtab_index): Make sure the symbol index is
8634 (Symbol_value::set_output_symtab_index): Make sure the symbol
8635 index is not set. Make sure the new index is valid.
8636 (Symbol_value::set_must_have_output_symtab_entry): New function.
8637 (Symbol_value::has_output_dynsym_entry): New function.
8638 (Symbol_value::set_output_dynsym_index): Make sure the new index
8640 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8641 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8642 local symbol if permitted.
8643 (Sized_relobj::do_finalize_local_symbols): Call
8644 is_output_symtab_index_set rather than needs_output_symtab_entry.
8645 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8646 rather than needs_output_symtab_entry. Call
8647 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8648 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8649 is_output_symtab_index_set rather than needs_output_symtab_entry.
8650 * testsuite/discard_locals_relocatable_test.c: New file.
8651 * testsuite/discard_locals_test.sh: Test -r.
8652 * testsuite/Makefile.am (check_DATA): Add
8653 discard_locals_relocatable_test1.syms,
8654 discard_local_relocatable_test2.syms.
8655 (MOSTLYCLEANFILES): Likewise. Also add
8656 discard_locals_relocatable_test1.lout and
8657 discard_locals_relocatable_test2.out.
8658 (discard_locals_relocatable_test1.syms): New target.
8659 (discard_locals_relocatable_test.o): New target.
8660 (discard_locals_relocatable_test1.out): New target.
8661 (discard_locals_relocatable_test2.syms): New target.
8662 (discard_locals_relocatable_test2.out): New target.
8663 (various): Add missing ../ld-new dependencies.
8664 * testsuite/Makefile.in: Rebuild.
8666 2010-03-03 Nick Clifton <nickc@redhat.com>
8668 * po/fi.po: New Finnish translation.
8670 2010-03-01 Doug Kwan <dougkwan@google.com>
8672 * layout.cc (Layout::Layout): Force section types of .init_array*,
8673 .preinit_array* and .fini_array* sections.
8674 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8675 Fix check of return value of std::string::find.().
8676 (Output_section::Input_section_sort_compare::operator()): Remove
8677 comment about .init_array.
8678 (Output_section::Input_section_sort_init_fini_compare::operator()):
8680 (Output_section::sort_attached_input_sections): Handle .init_array
8681 and .fini_array specially.
8682 * output.h (Output_section::Inut_section_sort_compare): Update
8684 (Output_section::Input_section_sort_init_fini_compare): New struct.
8686 2010-02-26 Doug Kwan <dougkwan@google.com>
8688 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8689 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8690 * testsuite/debug_msg.sh: Avoid matching source line number for
8691 use of global variable undef_int.
8693 2010-02-26 Doug Kwan <dougkwan@google.com>
8695 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8696 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8697 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8698 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8699 * options.cc (General_options::General_options): Initialize member
8701 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8702 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8703 and rm_no_fix_v4bx.stdout
8704 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8705 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8706 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8707 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8708 and arm_no_fix_v4bx.
8709 * Makefile.in: Regenerate.
8710 * testsuite/arm_fix_v4bx.s: New file.
8711 * testsuite/arm_fix_v4bx.sh: Ditto.
8713 2010-02-24 Doug Kwan <dougkwan@google.com>
8715 * arm.cc (Target_arm::got_section): Make the .got section the first
8716 non RELRO section in the data segment.
8717 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8718 suffixes of section names.
8720 2010-02-24 Doug Kwan <dougkwan@google.com>
8722 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8723 flags and attributes merging if an input file is a binary file.
8724 * fileread.cc (Input_file::open): Record format of original file.
8725 * fileread.h (Input_file::Format): New enum type.
8726 (Input_file::Input_file): Initialize data member format_.
8727 (Input_file::format): New method definition.
8728 (Input_file::format_):: New data member.
8730 2010-02-24 Doug Kwan <dougkwan@google.com>
8732 * arm.cc (Arm_output_data_got): New class.
8733 (ARM_TCB_SIZE): New constant
8734 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8735 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8736 If user uses a script with a SECTIONS clause, issue only a warning
8737 for a misplaced EXIDX input section. Otherwise, issue an error.
8738 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
8740 (Target_arm::got_mode_index_entry): Handle static linking.
8741 (Target_arm::Scan::local): Ditto.
8742 (Target_arm::Scan::global): Ditto.
8743 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8744 all incorrectly implemented relocations.
8745 (Target_arm::fix_exidx_coverage): Pass layout to
8746 Arm_output_section::fix_exidx_coverage.
8747 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8748 from ".ARM.exidx." and ".ARM.extab.".
8750 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8752 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8753 section if it does not already exist.
8754 * attributes.cc (Attributes_section_data::Attributes_section_data):
8755 Don't crash if size is zero.
8757 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8758 Ian Lance Taylor <iant@google.com>
8760 * gold.cc (queue_middle_tasks): If no input files were opened,
8762 * workqueue.h (Task_function::Task_function): Assert that there is
8765 2010-02-22 Doug Kwan <dougkwan@google.com>
8767 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8768 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8769 types to avoid warnings due to different uint64_t implementations
8772 2010-02-21 Doug Kwan <dougkwan@google.com>
8774 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8775 handling of the maximum backward branch offset.
8776 (Arm_relocate_functions::thumb_branch_common): Ditto.
8777 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8778 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
8779 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
8780 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8781 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8782 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8783 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8784 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8785 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8786 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8787 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8788 thumb2_bl_out_of_range.o): New rules.
8789 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8790 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8791 thumb2_bl_out_of_range
8792 * testsuite/Makefile.in: Regenerate.
8793 * testsuite/arm_bl_in_range.s: New file.
8794 * testsuite/arm_bl_out_of_range.s: Ditto.
8795 * testsuite/arm_branch_in_range.sh: Ditto.
8796 * testsuite/arm_branch_range.t: Ditto.
8797 * testsuite/thumb2_branch_range.t: Ditto.
8798 * testsuite/thumb_bl_in_range.s: Ditto.
8799 * testsuite/thumb_bl_out_of_range.s: Ditto.
8800 * testsuite/thumb_branch_range.t: Ditto.
8802 2010-02-20 Sriraman Tallam <tmsriram@google.com>
8804 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8805 Add reloc offset information.
8806 * icf.cc (get_section_contents): Change iterators to point to the new
8807 vectors. Add reloc offset information to the contents.
8808 * icf.h (Icf::Sections_reachable_info): New typedef.
8809 (Icf::Sections_reachable_list): New typedef.
8810 (Icf::Offset_info): New typedef.
8811 (Icf::Reloc_info): New struct typedef.
8812 (Icf::Reloc_info_list): New typedef.
8813 (Icf::symbol_reloc_list): Delete method.
8814 (Icf::addend_reloc_list): Delete method.
8815 (Icf::section_reloc_list): Delete method.
8816 (Icf::reloc_info_list): New method.
8817 (Icf::reloc_info_list_): New member.
8819 2010-02-19 Doug Kwan <dougkwan@google.com>
8821 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8822 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8823 * arm.cc (Arm_relocation_functions): New forward declaration.
8824 (Target_arm::Target_arm): Initialize new data members
8825 got_mod_index_offset_ and tls_base_symbol_defined_.
8826 (Target_arm::Relocate::relocate_tls): New method.
8827 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8828 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8830 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
8831 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8832 (Target_arm::got_mod_index_offset_,
8833 Target_arm::tls_base_symbol_defined_): New data members.
8834 (Target_arm::Scan::local, Target::Scan::global,
8835 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8838 2010-02-18 Doug Kwan <dougkwan@google.com>
8840 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8841 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8842 text section as a parameter becuase some broken tools may not set
8843 the link in section header.
8844 (Target_arm::has_got_section): New method.
8845 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8846 without any mapping symbol as data only. Remove warning.
8847 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8848 link in its section header, try to discover the link by inspecting the
8849 REL31 relocation at the beginning of the section.
8850 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8852 (Target_arm::Scan::global): Treat any reference to the symbol
8853 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8855 2010-02-12 Sriraman Tallam <tmsriram@google.com>
8857 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8858 (Scan::global_reloc_may_be_function_pointer): New function.
8859 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8860 (Scan::global_reloc_may_be_function_pointer): New function.
8861 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8862 (Scan::global_reloc_may_be_function_pointer): New function.
8863 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8864 (Scan::global_reloc_may_be_function_pointer): New function.
8865 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8866 (Scan::global_reloc_may_be_function_pointer): New function.
8867 (Scan::possible_function_pointer_reloc): New function.
8868 (Target_x86_64::can_check_for_function_pointers): New function.
8869 * gc.h (gc_process_relocs): Scan relocation types to determine if
8870 function pointers were taken for targets that support it.
8871 * icf.cc (Icf::find_identical_sections): Include functions for
8872 folding in safe ICF whose pointer is not taken.
8873 * icf.h (Secn_fptr_taken_set): New typedef.
8874 (fptr_section_id_): New member.
8875 (section_has_function_pointers): New function.
8876 (set_section_has_function_pointers): New function.
8877 (check_section_for_function_pointers): New function.
8878 * options.h: Fix comment for safe ICF option.
8879 * target.h (can_check_for_function_pointers): New function.
8880 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8881 Modify icf_safe_test for X86-64.
8882 * testsuite/Makefile.in: Regenerate.
8883 * testsuite/icf_safe_so_test.cc: New file.
8884 * testsuite/icf_safe_so_test.sh: New file.
8885 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8886 (main): Change to take pointer to function kept_func_3.
8887 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8888 folding is done correctly for X86-64.
8890 2010-02-12 David S. Miller <davem@davemloft.net>
8892 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8893 is_symbolless parameter.
8894 (Output_reloc<SHT_REL>::is_symbolless): New.
8895 (Output_reloc<SHT_REL>::is_symbolless_): New.
8896 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8897 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8898 (Output_reloc<SHT_RELA>::is_symbolless): New.
8899 (Output_data_reloc::add_global): Handle is_symbolless.
8900 (Output_data_reloc::add_global_relative): Likewise.
8901 (Output_data_reloc::add_local): Likewise.
8902 (Output_data_reloc::add_local_relative): Likewise.
8903 (Output_data_reloc::add_symbolless_global_addend): New.
8904 (Output_data_reloc::add_symbolless_local_addend): New.
8905 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8907 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8908 instead of ->is_relative_
8909 (Output_reloc::write): Likewise.
8910 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8911 (Output_reloc::write_rel): Simplify.
8913 * sparc.cc (Target_sparc::Scan::local): Use
8914 ->add_symbolless_local_addend as needed.
8915 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8916 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8917 based upon relocation offset.
8919 2010-02-11 Doug Kwan <dougkwan@google.com>
8921 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8922 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8923 beginning of function.
8924 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8925 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8926 parameter is_32bit in calls to should_apply_static_reloc.
8927 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8928 (check_DATA): Add arm_abs_global.stdout.
8929 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8930 arm_abs_global.stdout): New rules.
8931 (MOSTLLYCLEANFILES): Add arm_abs_global
8932 * Makefile.in: Regenerate.
8933 * testsuite/arm_abs_global.s: New file.
8934 * testsuite/arm_abs_global.sh: Ditto.
8935 * testsuite/arm_abs_lib.s: Ditto.
8937 2010-02-11 Ian Lance Taylor <iant@google.com>
8939 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8941 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8942 Allocate_commons_task first.
8943 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8944 task, rather than symtab_lock_.
8945 (Gc_process_relocs::~Gc_process_relocs): New function.
8946 (Gc_process_relocs::is_runnable): Check this_blocker_.
8947 (Gc_process_relocs::locks): Use next_blocker_ rather than
8949 (Scan_relocs::~Scan_relocs): New function.
8950 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8952 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8954 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8955 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8956 constructor accordingly.
8957 (class Gc_process_relocs): Likewise.
8958 (class Scan_relocs): Likewise.
8959 * common.h (class Allocate_commons_task): Remove symtab_lock_
8960 field, and corresponding constructor parameter.
8961 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8963 (Allocate_commons_task::locks): Likewise.
8965 2010-02-11 Ian Lance Taylor <iant@google.com>
8967 * gold-threads.h (class Once): Define.
8968 (class Initialize_lock): Rewrite as child of Once.
8969 * gold-threads.cc (class Once_initialize): Define.
8970 (once_pointer_control): New static variable.
8971 (once_pointer, once_arg): New static variables.
8972 (c_run_once): New static function.
8973 (Once::Once, Once::run_once, Once::internal_run): New functions.
8974 (class Initialize_lock_once): Remove.
8975 (initialize_lock_control): Remove.
8976 (initialize_lock_pointer): Remove.
8977 (initialize_lock_once): Remove.
8978 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8979 (Initialize_lock::initialize): Rewrite.
8980 (Initialize_lock::do_run_once): New function.
8981 * archive.cc (Archive::interpret_header): Only clear name if it is
8983 * fileread.cc: Include "gold-threads.h"
8984 (file_counts_lock): New static variable.
8985 (file_counts_initialize_lock): Likewise.
8986 (File_read::release): Only increment counts when using --stats.
8987 Use a lock around the increment.
8988 * parameters.cc (class Set_parameters_target_once): Define.
8989 (set_parameters_target_once): New static variable.
8990 (Parameters::Parameters): Move here from parameters.h.
8991 (Parameters::set_target): Rewrite.
8992 (Parameters::set_target_once): New function.
8993 (Parameters::clear_target): Move here and rewrite.
8994 * parameters.h (class Parameters): Update declarations. Add
8995 set_parameters_target_once_ field.
8996 (Parameters::Parameters): Move to parameters.cc.
8997 (Parameters::clear_target): Likewise.
8998 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9000 (Start_group::~Start_group): New function.
9001 (Start_group::is_runnable): New function.
9002 (Start_group::locks, Start_group::run): New functions.
9003 (Finish_group::run): Change saw_undefined to size_t.
9004 * readsyms.h (class Start_group): Define.
9005 (class Finish_group): Change saw_undefined_ field to size_t.
9006 (Finish_group::Finish_group): Remove saw_undefined and
9007 this_blocker parameters. Change all callers.
9008 (Finish_group::set_saw_undefined): New function.
9009 (Finish_group::set_blocker): New function.
9010 * symtab.h (class Symbol_table): Change saw_undefined to return
9011 size_t. Change saw_undefined_ field to size_t.
9012 * target-select.cc (Set_target_once::do_run_once): New function.
9013 (Target_selector::Target_selector): Initialize set_target_once_
9014 field. Don't initialize lock_ and initialize_lock_ fields.
9015 (Target_selector::instantiate_target): Rewrite.
9016 (Target_selector::set_target): New function.
9017 * target-select.h (class Set_target_once): Define.
9018 (class Target_selector): Update declarations. Make
9019 Set_target_once a friend. Remove lock_ and initialize_lock_
9020 fields. Add set_target_once_ field.
9022 2010-02-10 Ian Lance Taylor <iant@google.com>
9024 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9026 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9027 (queue_middle_tasks): Add all blockers before queueing any tasks.
9028 (queue_final_tasks): Likewise.
9029 * token.h (Task_token::add_blockers): New function.
9030 * object.h (Input_objects::number_of_relobjs): New function.
9032 2010-02-10 Ian Lance Taylor <iant@google.com>
9034 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9035 shared, not if not position independent.
9036 * x86_64.cc (Relocate::relocate_tls): Likewise.
9037 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9038 (tls_pie_pic_test): New target.
9039 * testsuite/Makefile.in: Rebuild.
9041 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9042 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9043 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9044 * testsuite/Makefile.in: Rebuild.
9046 2010-02-09 David S. Miller <davem@davemloft.net>
9048 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9049 R_SPARC_RELATIVE using ->add_local_relative().
9050 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9052 * output.h (Output_data_dynamic::add_section_size): New method
9053 that takes two Output_data objects.
9054 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9055 entry param. Handle it in initializers.
9056 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9057 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9058 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9060 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9061 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9062 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9063 for dynrel_includes_plt.
9064 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9065 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9066 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9068 (Target_sparc::do_finalize_sections): Update to pass true for
9069 dynrel_includes_plt.
9070 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9071 output before .rela.plt
9072 (Target_powerpc::do_finalize_sections): Update to pass true for
9073 dynrel_includes_plt when 32-bit.
9075 2010-02-08 Doug Kwan <dougkwan@google.com>
9077 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9079 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9080 Arm_relobj::scan_section_for_cortex_a8_stubs,
9081 Arm_relobj::do_relocation_section): Instead of calling
9082 Output_section::output_address, use faster
9083 Arm_relobj::simple_input_section_output_address.
9085 2010-02-08 David S. Miller <davem@davemloft.net>
9087 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9088 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9089 relocation helper function.
9091 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9092 just like R_SPARC_GOT{10,13,22}.
9093 (Target_sparc::Scan::local): Likewise.
9094 (Target_sparc::Relocate:relocate): Likewise.
9096 2010-02-06 Ian Lance Taylor <iant@google.com>
9098 * configure.ac: Rewrite targetobjs duplicate removal code to use
9099 only shell constructs.
9100 * configure: Rebuild.
9102 2010-02-05 Doug Kwan <dougkwan@google.com>
9105 * arm.cc (Arm_relobj::section_is_scannable): New method.
9106 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9107 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9109 2010-02-04 Doug Kwan <dougkwan@google.com>
9112 * arm-reloc-property.cc (cstdio): Include.
9113 * configure.ac (targetobjs): Remove duplicates.
9114 * configure: Regenerate.
9115 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9116 big and little endian version for a given address size.
9118 2010-02-03 Doug Kwan <dougkwan@google.com>
9120 * arm-reloc-property.cc
9121 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9123 * arm-reloc-property.h
9124 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9125 New method definition.
9126 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9128 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9130 (GOT_PREL): Change implemented to Y.
9131 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9132 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9133 (Arm_relocate_functions::movw_abs_nc): Remove method.
9134 (Arm_relocate_functions::movt_abs): Ditto.
9135 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9136 (Arm_relocate_functions::thm_movt_abs): Ditto.
9137 (Arm_relocate_functions::movw_rel_nc): Ditto.
9138 (Arm_relocate_functions::movw_rel): Ditto.
9139 (Arm_relocate_functions::movt_rel): Ditto.
9140 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9141 (Arm_relocate_functions:thm_movw_rel): Ditto.
9142 (Arm_relocate_functions:thm_movt_rel): Ditto.
9143 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9144 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9145 New method definitions.
9146 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9147 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9148 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9149 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9150 (Target_arm::Relocate::relocate): Check for non-static or
9151 unimplemented relocation code and exit early. Change calls to
9152 Target_arm::reloc_uses_thumb_bit and
9153 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9154 instead. Refactor code to handle similar relocations to increase
9155 code sharing. Remove check for unsupported relocation code in switch
9157 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9158 relocation property table to find out size. Change error message to
9159 print out the name of a relocation code instead of the numeric value.
9160 (Target_arm::scan_reloc_for_stub): Use relocation property table
9161 instead of calling Target_arm::reloc_uses_thumb_bit().
9163 2010-02-02 Doug Kwan <dougkwan@google.com>
9165 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9166 types of relaxed input section.
9168 2010-02-02 Doug Kwan <dougkwan@google.com>
9170 * Makefile.am (HFILES): Add arm-reloc-property.h.
9172 (TARGETSOURCES): Add arm-reloc-property.cc
9173 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
9174 (libgold_a_SOURCES): $(DEFFILES)
9175 * Makefile.in: Regenerate.
9176 * arm-reloc-property.cc: New file.
9177 * arm-reloc-property.h: New file.
9178 * arm-reloc.def: New file.
9179 * arm.cc: Update comments.
9180 (arm-reloc-property.h): New included header.
9181 (arm_reloc_property_table): New global variable.
9182 (Target_arm::do_select_as_default_target): New method definition.
9183 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9184 arm-reloc-property to targ_extra_obj.
9185 * parameters.cc (set_parameters_target): Call
9186 Target::select_as_default_target().
9187 * target.h (Target::select_as_default_target): New method definition.
9188 (Target::do_select_as_default_target): Same.
9190 2010-02-01 Doug Kwan <dougkwan@google.com>
9192 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9193 first_output_text_section_.
9194 (Arm_exidx_fixup::first_output_text_section): New method definition.
9195 (Arm_exidx_fixup::first_output_text_section_): New data member.
9196 (Arm_exidx_fixup::process_exidx_section): Record the first text
9197 output section seen.
9198 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9199 and entsize in output section header.
9201 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9203 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9204 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9205 (Arm_relocate_functions::thm_alu11): New Method.
9206 (Arm_relocate_functions::thm_pc8): New Method.
9207 (Arm_relocate_functions::thm_pc12): New Method.
9208 (Target_arm::Scan::local): Handle the relocations.
9209 (Target_arm::Scan::global): Likewise.
9210 (Target_arm::Relocate::relocate): Likewise.
9211 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9213 2010-01-29 Doug Kwan <dougkwan@google.com>
9215 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9216 of relocation types as ld.
9218 2010-01-29 Doug Kwan <dougkwan@google.com>
9220 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9222 (Arm_relocate_functions::thumb_branch_common): Ditto.
9223 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9224 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9225 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9226 Arm_relocate_functions::jump24): Remove.
9227 (Target_arm::Relocate::relocate): Adjust code to call
9228 Arm_relocation_functions::arm_branch_common and
9229 Arm_relocation_functions::thumb_branch_common instead of their removed
9230 wrappers. Merge switch-cases together to reduce source code size.
9232 2010-01-29 Doug Kwan <dougkwan@google.com>
9234 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9235 output_local_symbol_count_needs_update_.
9236 (Arm_relobj::output_local_symbol_count_needs_update,
9237 Arm_relobj::set_output_local_symbol_count_needs_update,
9238 Arm_relobj::update_output_local_symbol_count): New methods.
9239 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9241 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9242 of pointed function as in a R_ARM_PREL31 relocation.
9243 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9244 for output local symbol count updating.
9245 (Target_arm::do_relax): Update output local symbol counts in objects
9247 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9249 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9251 * arm.cc: Added support for the ARM relocations:
9252 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9253 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9254 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9256 (Arm_relocate_functions::movw_rel): New method.
9257 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9258 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9260 (Arm_relocate_functions::thm_movw_rel): New method.
9261 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9263 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9265 (Target_arm::Scan::global): Likewise.
9266 (Target_arm::Relocate::relocate): Likewise.
9267 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9270 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9272 * arm.cc: Added support for ARM group relocations.
9273 (Target_arm::reloc_needs_sym_origin): New method.
9274 (Arm_relocate_functions::calc_grp_kn): New method.
9275 (Arm_relocate_functions::calc_grp_residual): New method.
9276 (Arm_relocate_functions::calc_grp_gn): New method.
9277 (Arm_relocate_functions::arm_grp_alu): New Method.
9278 (Arm_relocate_functions::arm_grp_ldr): New Method.
9279 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9280 (Arm_relocate_functions::arm_grp_ldc): New Method.
9281 (Target_arm::Scan::local): Handle the ARM group relocations.
9282 (Target_arm::Scan::global): Likewise.
9283 (Target_arm::Relocate::relocate): Likewise.
9284 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9287 2010-01-26 Doug Kwan <dougkwan@google.com>
9289 * arm.cc (set): Include.
9290 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9292 (Arm_output_section::Text_section_list): New type.
9293 (Arm_output_section::append_text_sections_to_list): New method.
9294 (Arm_output_section::fix_exidx_coverage): Ditto.
9295 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
9296 (Arm_relobj::convert_input_section_to_relaxed_section): Use
9297 Relobj::set_section_offset() instead of
9298 Sized_relobj::invalidate_section_offset().
9299 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
9300 parameter for section headers. Ignore relocation sections for
9301 unallocated sections and EXIDX sections.
9302 (Target_arm::fix_exidx_coverage): New method.
9303 (Target_arm::output_section_address_less_than): New type.
9304 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9305 linked text section instead of the EXIDX section.
9306 (Arm_output_section::create_stub_group): Add an assertion to check
9307 that this is not an EXIDX output section.
9308 (Arm_output_section::append_text_sections_to_list): New method.
9309 (Arm_output_section::fix_exidx_coverage): Ditto.
9310 (Arm_relobj::scan_sections_for_stubs): Adjust call to
9311 Arm_relobj::section_needs_reloc_stub_scanning.
9312 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9314 (Target_arm::fix_exidx_coverage): New method.
9315 * object.h (Relobj::set_output_section): New method.
9316 (Sized_relobj::invalidate_section_offset): Remove method.
9317 (Sized_relobj::do_invalidate_section_offset): Remove method.
9318 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9320 2010-01-25 Doug Kwan <dougkwan@google.com>
9322 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9323 Fix warning due to signed and unsigned comparison on a 32-bit host.
9325 2010-01-22 Doug Kwan <dougkwan@google.com>
9327 * arm.cc (Target_arm::do_relax): Record an output section for section
9328 offset adjustment it contains any stub table that has changed.
9329 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9330 offsets in an output section if necessary.
9331 * output.cc (Output_section::Output_section): Initialize
9332 section_offsets_need_adjustments_.
9333 (Output_section::add_input_section_for_script): Renamed to
9334 Output_section::add_simple_input_section.
9335 (Output_section::save_states): Add a comment.
9336 (Output_section::discard_states): New method defintion.
9337 (Output_section::adjust_section_offsets): Same.
9338 * output.h (Output_section::add_input_section_for_script): Renamed to
9339 Output_section::add_simple_input_section.
9340 (Output_section::discard_states): New method declaration.
9341 (Output_section::adjust_section_offsets): Same.
9342 (Output_section::section_offsets_need_adjustment,
9343 Output_section::set_section_offsets_need_adjustment): New method
9345 (Output_section::section_offsets_need_adjustment_): New data member.
9346 * script-sections.cc
9347 (Output_section_element_input::set_section_address): Adjust code for
9348 renaming of Output_section::add_input_section_for_script.
9349 (Orphan_output_section::set_section_address): Same.
9351 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9353 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9354 Fix_v4bx enum values .
9355 * gold/options.h (General_options): New option definitions.
9356 (General_options::fix_v4bx): New method.
9357 (General_options::Fix_v4bx): New enum.
9358 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9359 (General_options::parse_fix_v4bx_interworking): New method.
9361 2010-01-22 Doug Kwan <dougkwan@google.com>
9363 * arm.cc (Arm_exidx_fixup): New class.
9365 2010-01-21 Doug Kwan <dougkwan@google.com>
9367 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9369 (Arm_exidx_section_offset_map): New type.
9371 2010-01-21 Doug Kwan <dougkwan@google.com>
9373 * arm.cc (Arm_exidx_input_section): New class.
9374 (Arm_relobj::exidx_input_section_by_link,
9375 Arm_relobj::exidx_input_section_by_shndx,
9376 Arm_relobj::make_exidx_input_section): New methods.
9377 (read_arm_attributes_section): Remove.
9378 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9379 information about them.
9380 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9383 2010-01-20 Doug Kwan <dougkwan@google.com>
9385 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9386 Input_section_specifier to Section_id.
9387 (Target_arm::new_arm_input_section: Adjust code for change of key
9389 (Target_arm::find_arm_input_section): Ditto.
9390 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9391 (Section_id): Remove.
9392 (Garbage_collection::Section_id_hash): Remove.
9393 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9394 (Section_id): Remove.
9395 (Icf::Section_id_hash): Remove.
9396 * object.h (Section_id, Const_section_id, Section_id_hash,
9397 Const_section_id_hash): New type definitions.
9398 * output.cc (Output_section::add_relaxed_input_section): Change to
9399 use Const_section_id instead of Input_section_specifier as key type.
9400 (Output_section::add_merge_input_section): Ditto.
9401 (Output_section::build_relaxation_map): Change to use Section_id
9402 instead of Input_section_specifier as key type.
9403 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9405 (Output_section::convert_input_sections_to_relaxed_sections): Change
9406 to use Const_section_id instead of Input_section_specifier as key type.
9407 (Output_section::find_merge_section): Ditto.
9408 (Output_section::find_relaxed_input_section): Ditto.
9409 * output.h (Input_section_specifier): Remove class.
9410 (Output_section::Output_section_data_by_input_section_map): Change
9411 key type to Const_section_id.
9412 (Output_section::Output_relaxed_input_section_by_input_section_map):
9414 (Output_section::Relaxation_map): Change key type to Section_id.
9416 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9418 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9419 (class Arm_v4bx_stub): New class.
9420 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9421 (Stub_factory::make_arm_v4bx_stub): New method.
9422 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9423 (Stub_table::empty): Handle v4bx stubs.
9424 (Stub_table::add_arm_v4bx_stub): New method.
9425 (Stub_table::find_arm_v4bx_stub): New method.
9426 (Arm_relocate_functions::v4bx): New method.
9427 (Target_arm::fix_v4bx): New method.
9428 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9429 (Stub_table::relocate_stubs): Likewise.
9430 (Stub_table::do_write): Likewise.
9431 (Stub_table::update_data_size_and_addralign): Likewise.
9432 (Stub_table::finalize_stubs): Likewise.
9433 (Target_arm::Scan::local): Likewise.
9434 (Target_arm::Scan::global): Likewise.
9435 (Target_arm::do_finalize_sections): Likewise.
9436 (Target_arm::Relocate::relocate): Likewise.
9437 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9439 (Target_arm::scan_reloc_for_stub): Likewise.
9440 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9442 2010-01-19 Ian Lance Taylor <iant@google.com>
9444 * output.cc (Output_section_headers::do_sized_write): Write large
9445 segment count to sh_info field.
9446 (Output_file_header::do_sized_write): For large segment count,
9447 write PN_XNUM to e_phnum field.
9449 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9451 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9452 (Arm_relocate_functions::thm_jump8): New function.
9453 (Arm_relocate_functions::thm_jump11): New function.
9454 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9456 (Target_arm::Scan::global): Likewise.
9457 (Target_arm::Relocate::relocate): Likewise.
9458 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9461 2010-01-14 Doug Kwan <dougkwan@google.com>
9463 * arm.cc (map, utility): Include headers.
9464 (Target_arm::apply_cortex_a8_workaround): New method.
9465 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9466 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9467 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9468 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9469 the --[no-]fix-cortex-a8 command line options.
9470 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9471 (Target_arm::relocate_stub): Use addend in instruction template.
9472 * options.h (DEFINE_bool): Set the user-set flag.
9473 (General_options): Add --[no-]-fix-cortex options.
9474 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
9475 : Update fast look-up map after conversion.
9477 2010-01-14 Sriraman Tallam <tmsriram@google.com>
9479 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9480 in the first pass of do_layout.
9482 2010-01-13 Doug Kwan <dougkwan@google.com>
9484 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9485 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9486 apparent compiler problem of not folding static constant integral
9487 data members of elfcpp::Elf_sizes<32>.
9489 2010-01-13 Doug Kwan <dougkwan@google.com>
9491 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9492 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9493 Arm_relobj::scan_section_for_cortex_a8_erratum,
9494 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9495 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9496 sections to scan for relocation stubs into a new method
9497 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9498 relocation and Cortex-A8 stub scanning.
9499 (Target_arm::do_relax): Force stubs to be after stubbed sections
9500 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
9501 the beginning of a new relaxation pass. Update a comment.
9502 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9504 2010-01-12 Ian Lance Taylor <iant@google.com>
9506 * target-reloc.h (visibility_error): New inline function.
9507 (relocate_section): Call visibility_error.
9508 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9509 (MOSTLYCLEANFILES): Likewise.
9510 (protected_4_pic.o, protected_3.err): New targets.
9511 * testsuite/protected_4.cc: New file.
9513 2010-01-12 Doug Kwan <dougkwan@google.com>
9515 * arm.cc (Cortex_a8_reloc): New class.
9516 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9517 and cortex_a8_relocs_info_.
9518 (Target_arm::fix_cortex_a8): New method definition.
9519 (Target_arm::Cortex_a8_relocs_info): New type.
9520 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9521 New data member declarations.
9522 (Target_arm::scan_reloc_for_stub): Record information about
9523 relocations for THUMB branches that might be exempted from the
9524 Cortex-A8 workaround.
9525 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9526 at the beginning of a relaxation pass.
9528 2010-01-12 Doug Kwan <dougkwan@google.com>
9530 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9531 (Arm_relobj::Mapping_symbol_position,
9532 Arm_reloj::Mapping_symbol_position_less,
9533 Arm_relobj::Mapping_symbols_info): New types.
9534 (Target_arm::is_mapping_symbol_name): New method definition.
9535 (Arm_relobj::do_count_local_symbols): Save information about mapping
9538 2010-01-11 Doug Kwan <dougkwan@google.com>
9540 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9541 Arm_relocate_functions::thumb32_branch_upper,
9542 Arm_relocate_functions::thumb32_branch_lower,
9543 Arm_relocate_functions::thumb32_cond_branch_offset,
9544 Arm_relocate_functions::thumb32_cond_branch_upper,
9545 Arm_relocate_functions::thumb32_cond_branch_lower,
9546 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9547 branch offset encoding.
9548 (Arm_relocate_functions::thumb_branch_common): Use new branch
9549 offset encoding methods to avoid code duplication.
9550 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9551 (Stub_addend_reader::operator()): Use new branch encoding method
9552 to avoid code duplication.
9554 2010-01-11 Doug Kwan <dougkwan@google.com>
9556 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9557 (Target_arm::do_finalize_sections): Define special EXIDX section
9558 symbols only if referenced.
9559 * gc.h (Garbage_collection::add_reference): New method.
9560 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9563 2010-01-11 Ian Lance Taylor <iant@google.com>
9565 * script.cc (Version_script_info::build_expression_list_lookup):
9566 Change complaing about duplicate wildcard match from error to
9569 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9571 (Version_script_info::Version_script_info): Initialize globs_,
9572 default_version_, default_is_global_, and exact_. Don't
9573 initialize globals_ or locals_.
9574 (Version_script_info::build_lookup_tables): Build local symbols
9576 (Version_script_info::unquote): New function.
9577 (Version_script_info::add_exact_match): New function.
9578 (Version_script_info::build_expression_list_lookup): Remove lookup
9579 parameter. Add is_global parameter. Change all callers. Handle
9580 wildcard pattern specially. Unquote pattern. Call
9582 (Version_script_info::get_name_to_match): New function.
9583 (Version_script_info::get_symbol_version): New function.
9584 (Version_script_info::get_symbol_version_helper): Remove.
9585 (Version_script_info::check_unmatched_names): Call unquote.
9586 * script.h (class Version_script_info): Change get_symbol_version
9587 to be non-inline and add is_global parameter; change all callers.
9588 Rewrite symbol_is_local. Update declarations. Define struct
9589 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9590 Remove globals_ and locals_ members. Add exact_, globs_,
9591 default_version_, is_global_.
9592 (Version_script_info::Glob): Remove pattern, add expression and
9593 is_global. Update constructor. Change all callers.
9594 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9596 (Versions::symbol_section_contents): If a symbol is undefined, or
9597 defined in a dynamic object, set the version index to
9599 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9601 (Symbol_table::add_from_pluginobj): Likewise.
9602 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9604 2010-01-11 Doug Kwan <dougkwan@google.com>
9606 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9607 (incremental_dump_LDADD): Add linking option for libintl.
9608 * Makefile.in: Regenerate.
9610 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9613 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9615 * testsuite/Makefile.in: Regenerated.
9617 2010-01-10 Doug Kwan <dougkwan@google.com>
9619 * options.h (DEFINE_var): Use parentheses around argument varname__
9620 in macro body to avoid any unintended subsequent substitutions.
9622 2010-01-10 Ian Lance Taylor <iant@google.com>
9624 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9625 candidates before doing symbol resolution.
9627 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9628 ODR candidates if only one is weak.
9630 2010-01-08 Ian Lance Taylor <iant@google.com>
9632 * script.cc (Version_script_info::build_expression_list_lookup):
9633 Don't warn about ambiguous version, just record the ambiguity.
9634 (Version_script_info::get_symbol_version_helper): Give error if
9635 version is ambiguous.
9637 2010-01-08 Doug Kwan <dougkwan@google.com>
9639 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
9640 prev_data_size_ and prev_addralign_. Remove initializer for
9641 deleted data member has_been_changed_.
9642 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9643 to determine if the table is empty.
9644 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9646 (Stub_table::add_reloc_stub): Define method in class definition
9647 instead of just declaring it there.
9648 (Stub_table::add_cortex_a8_stub): New method definition.
9649 (Stub_table::update_data_size_and_addralign): Ditto.
9650 (Stub_table::finalize_stubs): Ditto.
9651 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9652 (Stub_table::do_addralign_): Return address alignment in the
9653 (Stub_table::do_reset_address_and_file_offset): Define method in
9654 class definition instead of declaring it there. Set current data
9655 size to be the data size of the previous pass.
9656 (Stub_table::set_final_data_size): Use current data size as the
9658 (Stub_table::relocate_stub): Change parameter type of stub from
9659 Reloc_stub pointer to Stub pointer.
9660 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9661 (Stub_table::Cortex_a8_stub_list): New typedef.
9662 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9663 Stub_table::prev_addralign_): New data member.
9664 (Arm_relobj::Arm_relobj): Initialize data member
9665 section_has_cortex_a8_workaround_.
9666 (Arm_relobj::section_has_cortex_a8_workaround,
9667 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9669 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9671 (Target_arm::relocate_stub): Change parameter type of stub from
9672 Reloc_stub pointer to Stub pointer.
9673 (Insn_template::size, Insn_template::alignment): Handle
9674 THUMB16_SPECIAL_TYPE.
9675 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9676 Stub_table::update_data_size_and_addralign,
9677 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9679 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9680 (Stub_table::do_write): Ditto.
9681 (Target_arm::do_relax): Adjust code for changes in Stub_table.
9683 2010-01-08 Ian Lance Taylor <iant@google.com>
9686 * symtab.h (class Symbol): Remove fields is_target_special_ and
9687 has_plt_offset_. Add field is_defined_in_discarded_section_.
9688 (Symbol::is_defined_in_discarded_section): New function.
9689 (Symbol::set_is_defined_in_discarded_section): New function.
9690 (Symbol::has_plt_offset): Rewrite.
9691 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9692 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9693 Don't initialize is_target_special_ or has_plt_offset_.
9694 Initialize is_defined_in_discarded_section_.
9695 (Symbol_table::add_from_relobj): If appropriate, set
9696 is_defined_in_discarded_section.
9697 * resolve.cc (Symbol::override_base_with_special): Don't test
9698 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9699 * target-reloc.h (relocate_section): Do special handling for
9700 symbols defined in discarded sections for global symbols as well
9703 2010-01-08 Ian Lance Taylor <iant@google.com>
9705 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9706 the SHT_SYMTAB case.
9708 2010-01-08 Ian Lance Taylor <iant@google.com>
9710 * object.cc (Sized_relobj::do_layout): Don't get confused if
9711 layout_eh_frame returns NULL.
9713 2010-01-08 Ian Lance Taylor <iant@google.com>
9716 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9717 dynamic symbol table, use the normal symbol table.
9718 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9721 2010-01-08 Ian Lance Taylor <iant@google.com>
9724 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9727 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9729 * version.cc (print_version): Change to "Copyright 2010".
9731 2010-01-08 Ian Lance Taylor <iant@google.com>
9735 * i386.cc (class Target_i386): Change return type of plt_section
9737 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9738 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9739 tls_desc_rel_ field.
9740 (Output_data_plt_i386::rel_tls_desc): New function.
9741 (Target_i386::rel_tls_desc_section): New function.
9742 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9743 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9744 R_386_TLS_DESC reloc in rel_tls_desc_section.
9745 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9746 Define struct Tlsdesc_info.
9747 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9748 (Target_x86_64::do_reloc_symbol_index): New function.
9749 (Target_x86_64::add_tlsdesc_info): New function.
9750 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9751 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9753 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9755 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9756 (Target_x86_64::rela_tlsdesc_section): New function.
9757 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9759 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9760 (Target_x86_64::do_reloc_addend): New function.
9761 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9762 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9763 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9764 (Output_reloc::type): New function.
9765 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9766 (Output_reloc::is_target_specific): New function.
9767 (Output_reloc::target_arg): New function.
9768 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9769 absolute relocs and target specific relocs.
9770 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9771 add_target_specific.
9772 (class Output_data_reloc) [SHT_RELA]: Likewise.
9773 * output.cc (Output_reloc::Output_reloc): Add four new versions
9774 for absolute relocs and target specific relocs.
9775 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9776 (Output_reloc::get_symbol_index): Likewise.
9777 (Output_reloc::local_section_offset): Check that local_sym_index_
9778 is not TARGET_CODE or 0.
9779 (Output_reloc::symbol_value): Likewise.
9780 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9782 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9783 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9785 * layout.cc (add_target_dynamic_tags): Use output section for
9786 DT_PLTRELSZ and DT_JMPREL.
9788 2010-01-07 Ian Lance Taylor <iant@google.com>
9791 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9793 (class Output_data_reloc_generic): Define.
9794 (class Output_data_reloc_base): Change base class to
9795 Output_data_reloc_generic. Change add() method to call
9796 bump_relative_reloc_count for a relative reloc. Remove
9798 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9800 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9801 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9803 * layout.h (class Layout): Update declaration.
9805 2010-01-07 Ian Lance Taylor <iant@google.com>
9807 * output.h (class Output_data): Add const version of
9808 output_section and do_output_section.
9809 (class Output_section_data): Add const version of
9811 (class Output_section): Likewise.
9812 * layout.cc (Layout::add_target_dynamic_tags): New function.
9813 * layout.h (class Layout): Update declarations.
9814 * arm.cc (Target_arm::do_finalize_sections): Use
9815 add_target_dynamic_tags.
9816 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9817 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9818 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9819 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9821 2010-01-07 Ian Lance Taylor <iant@google.com>
9824 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9827 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9828 Ian Lance Taylor <iant@google.com>
9831 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9832 Xindex::read_symtab_xindex.
9834 2010-01-07 Doug Kwan <dougkwan@google.com>
9836 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9837 (Insn_template::thumb16_bcond_insn): New method declaration.
9838 (Insn_template): Fix spelling.
9839 (Stub::thumb16_special): New method declaration.
9840 (Stub::do_write): Define virtual method which was previously pure
9842 (Stub::do_thumb16_special): New method declaration.
9843 (Stub::do_fixed_endian_write): New template member.
9844 (Reloc_stub::do_write): Remove.
9845 (Reloc_stub::do_fixed_endian_write): Remove.
9846 (Cortex_a8_stub): New class definition.
9847 (Stub_factory::make_cortex_a8_stub): New method definition.
9848 (Stub_factory::Stub_factory): Add missing static storage class
9849 qualifier for elf32_arm_stub_a8_veneer_blx.
9851 2010-01-07 Ian Lance Taylor <iant@google.com>
9854 * options.h (class General_options): Add --warn-unresolved-symbols
9855 and --error-unresolved-symbols.
9856 * errors.cc (Errors::undefined_symbol): Implement
9857 --warn-unresolved-symbols.
9859 * options.h (class General_options): Add -z text and -z textoff.
9860 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9862 2010-01-06 Sriraman Tallam <tmsriram@google.com>
9864 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9865 (Garbage_collection::cident_sections): New function.
9866 (Garbage_collection::add_cident_section): New function.
9867 (Garbage_collection::cident_sections_): New member.
9868 (gc_process_relocs): Add references to sections whose names are C
9870 * gold.h (cident_section_start_prefix): New constant.
9871 (cident_section_stop_prefix): New constant.
9872 (is_cident): New function.
9873 * layout.cc (Layout::define_section_symbols): Replace string constants
9874 with the newly defined constants.
9875 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9877 * testsuite/Makefile.am: Add gc_orphan_section_test.
9878 * testsuite/Makefile.in: Regenerate.
9879 * testsuite/gc_orphan_section_test.cc: New file.
9880 * testsuite/gc_orphan_section_test.sh: New file.
9882 2010-01-06 Ian Lance Taylor <iant@google.com>
9885 * options.h (class General_options): Add --warn-shared-textrel.
9886 * layout.cc (Layout::finish_dynamic_section): Implement
9887 --warn-shared-textrel.
9890 * options.h (class General_options): Add --warn-multiple-gp.
9892 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9894 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9895 $(THREADSLIB) and $(LIBDL).
9896 * Makefile.in: Rebuild.
9898 2010-01-06 Ian Lance Taylor <iant@google.com>
9901 * options.cc (General_options::parse_section_start): New function.
9902 (General_options::section_start): New function.
9903 (General_options::General_options): Initialize all members.
9904 * options.h: Include <map>
9905 (class General_options): Add --section-start. Add section_starts_
9907 * layout.cc (Layout::attach_allocated_section_to_segment): If
9908 --section-start was used, set the address of the segment. Remove
9909 local sort_sections.
9910 (Layout::relaxation_loop_body): If the address of the load segment
9911 has been set by --section-start, don't use it.
9912 * output.h (Output_segment::update_flags_for_output_section): New
9914 * output.cc (Output_segment::add_output_section): Call
9915 update_flags_for_output_section.
9917 2010-01-05 Ian Lance Taylor <iant@google.com>
9920 * options.h (class General_options): Add --undefined-version.
9921 * script.cc (struct Version_expression): Add was_matched_by_symbol
9923 (Version_script_info::matched_symbol): New function.
9924 (Version_script_info::get_symbol_version_helper): Call
9926 (Version_script_info::check_unmatched_names): New function.
9927 * script.h (class Version_script_info): Update declarations.
9928 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9930 * options.h (class General_options): Use DEFINE_bool_alias for
9931 allow_multiple_definition.
9932 * resolve.cc (Symbol_table::should_override): Don't test
9933 allow_multiple_definition.
9936 * options.h (class General_options): Add --cref.
9937 * main.cc (main): Print cref table if --cref. Don't close mapfile
9938 until after printing cref table.
9939 * cref.cc: Include "symtab.h".
9940 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9941 (Cref_table_compare::operator()): New function.
9942 (Cref_inputs::gather_cref): New function.
9943 (filecol): New static const.
9944 (Cref_inputs::print_cref): New function.
9945 (Cref::print_cref): New function.
9946 * cref.h: Include <cstdio>.
9947 (class Cref): Update declarations.
9948 * mapfile.h (Mapfile::file): New function.
9949 * object.h (class Object): Define Symbols. Declare virtual
9950 do_get_global_symbols.
9951 (Object::get_global_symbols): New function.
9952 * object.cc (Input_objects::add_object): Pass object to cref_ if
9954 (Input_objects::archive_start): Likewise.
9955 (Input_objects::archive_stop): Likewise.
9956 (Input_objects::print_cref): New function.
9957 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9958 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9960 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9962 * plugin.h (class Sized_pluginobj): Update declarations.
9964 2010-01-05 Ian Lance Taylor <iant@google.com>
9966 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9967 to is_default_version. Rename insdef to insdefault.
9968 (Symbol_table::add_from_relobj): Rename def to is_default_version
9969 and local to is_forced_local.
9970 (Symbol_table::add_from_pluginobj): Likewise.
9971 (Symbol_table::add_from_dynobj): Likewise.
9972 (Symbol_table::define_special_symbol): Rename insdef to
9975 2010-01-04 Ian Lance Taylor <iant@google.com>
9978 * options.h (class General_options): Add
9979 --allow-multiple-definition and -z muldefs.
9980 * resolve.cc (Symbol_table::should_override): Don't warn about a
9981 multiple symbol definition if --allow-multiple-definition or -z
9985 * options.h (class General_options): Add --add-needed and
9986 --copy-dt-needed-entries. Tweak --as-needed help entry.
9987 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9988 error if --copy-dt-needed-entries aka --add-needed is used and
9989 would cause a change in behaviour.
9992 * options.h (class General_options): Add -G as a short version of
9993 --shared. Add no-op options -assert, -g, and -i.
9995 2010-01-04 Sriraman Tallam <tmsriram@google.com>
9997 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
9998 check for .text or .gnu.linkonce.t sections.
9999 * icf.cc (Icf::find_identical_sections): Ditto.
10000 Change the detection for mangled function name within the section
10002 * icf.h (is_section_foldable_candidate): New function.
10004 2009-12-30 Ian Lance Taylor <iant@google.com>
10007 * options.h (class General_options): Permit two dashes with
10008 --retain-symbols-file.
10010 2009-12-30 Ian Lance Taylor <iant@google.com>
10013 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10014 don't put the file header and segment headers in the text
10018 * common.cc (Sort_commons::operator()): Stabilize sort when both
10020 (Symbol_table::do_allocate_commons_list): When allocating common
10021 symbols, skip a symbol which is no longer common.
10022 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10023 an object before checking its type.
10024 * testsuite/common_test_2.c: New file.
10025 * testsuite/common_test_3.c: New file.
10026 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10027 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10028 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10029 (common_test_2_pic.o, common_test_2.so): New targets.
10030 (common_test_3_pic.o, common_test_3.so): New targets.
10031 * testsuite/Makefile.in: Rebuild.
10034 * script.cc (read_input_script): If we see a new SECTIONS clause,
10035 and we have added an input section, give an error.
10036 * layout.h (class Layout): Add have_added_input_section function.
10037 Add have_added_input_section_ field.
10038 * layout.cc (Layout::Layout): Initialize
10039 have_added_input_section_.
10040 (Layout::layout): Set have_added_input_section_.
10041 (Layout::layout_eh_frame): Likewise.
10043 2009-12-30 Ian Lance Taylor <iant@google.com>
10046 * options.h (class General_options): Add --sort-common option.
10047 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10048 * common.cc (Sort_common): Add sort_order parameter to
10049 constructor. Add sort_order_ field.
10050 (Sort_commons::operator): Check sort_order_.
10051 (Symbol_table::allocate_commons): Determine the sort order.
10052 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10053 Change all callers.
10054 (Symbol_table::do_allocate_commons_list): Likewise.
10056 2009-12-30 Ian Lance Taylor <iant@google.com>
10059 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10060 symbols from this object, don't change the visibility of an
10062 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10064 2009-12-30 Ian Lance Taylor <iant@google.com>
10067 * script.h (class Version_script_info): Define Language enum.
10068 Update declarations. Define Glob, Exact, and Lookup types. Add
10069 new fields globals_, locals_, and is_finalized_.
10070 * script.cc: Various formatting fixes.
10071 (class Parser_closure): Change language_stack_ from a vector of
10072 std::string to one of Version_script_info::Language. Adjust all
10074 (class Lazy_demangler): Remove.
10075 (struct Version_expression): Change language from std::string to
10076 Version_script_info::Language.
10077 (Version_script_info::Version_script_info): New function.
10078 (Version_script_info::~Version_script_info): Don't call clear.
10079 (Version_script_info::finalize): New function.
10080 (Version_script_info::build_lookup_tables): New function.
10081 (Version_script_info::build_expression_list_lookup): New
10083 (Version_script_info::get_symbol_version_helper): Rewrite to use
10085 (Version_script_info::print_expression_list): Adjust to use
10086 Version_script_info::Language.
10087 (script_push_lex_into_version_mode): Check that the version script
10088 has not been finalized.
10089 (version_script_push_lang): Change language string to
10090 Version_script_info::Language.
10091 * options.cc (Command_line::version_script): New function.
10092 * options.h (class General_options): Add finalize_dynamic_list
10093 function. Change version_script from declaration to definition.
10094 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10095 * testsuite/version_script.map: Remove duplicate def of foo.
10096 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10097 version_script.map.
10098 * testsuite/Makefile.in: Rebuild.
10100 2009-12-30 Ian Lance Taylor <iant@google.com>
10103 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10104 if the input symbol index is 0, make the output symbol index 0.
10106 2009-12-30 Ian Lance Taylor <iant@google.com>
10109 * options.h (class General_options): Add -x/--discard-all.
10110 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10111 --discard-all. If the local symbol needs a dynamic entry, check
10112 that before handling --discard-locals.
10114 2009-12-30 Ian Lance Taylor <iant@google.com>
10117 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10119 (Output_segment::add_output_section): Don't change the flags if
10120 the type is PT_TLS.
10123 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10124 GNU hash table if they need a dynamic value. Otherwise, don't add
10125 them if they are defined in a dynamic object or are forced local.
10127 2009-12-29 Ian Lance Taylor <iant@google.com>
10130 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10131 .gnu.hash table for a 32-bit target.
10134 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10135 regular and a dynamic object only needs a dynamic symbol table
10136 entry if it is externally visible.
10139 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10140 constructor. Add global_offset_table_ field.
10141 (Target_i386::got_section): Set global_offset_table_.
10142 (Target_i386::do_finalize_sections): Set global_offset_table_
10144 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10145 in constructor. Add global_offset_table_ field.
10146 (Target_x86_64::got_section): Set global_offset_table_.
10147 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10150 * layout.cc (Layout::Layout): Initialize increase_relro_.
10151 (Layout::get_output_section): Add is_relro, is_last_relro, and
10152 is_first_non_relro parameters. Change all callers.
10153 (Layout::choose_output_section): Likewise.
10154 (Layout::add_output_section_data): Likewise.
10155 (Layout::make_output_section): Likewise.
10156 (Layout::set_segment_offsets): Clear increase_relro when using a
10158 * layout.h (class Layout): Add increase_relro method. Add
10159 increase_relro_ field. Update declarations.
10160 * output.cc (Output_section::Output_section): Initialize
10161 is_last_relro_ and is_first_non_relro_.
10162 (Output_segment::add_output_section): Group relro sections is
10163 do_sort is true. Handle is_last_relro and is_first_non_relro.
10164 (Output_segment::maximum_alignment): Remove relro handling.
10165 (Output_segment::set_section_addresses): Add increase_relro
10166 parameter. Change all callers. Add initial alignment to align
10167 relro sections on separate page. Remove old relro handling.
10168 (Output_segment::set_section_list_addresses): Remove in_relro
10169 parameter. Change all callers.
10170 (Output_segment::set_offset): Add increase parameter. Change all
10171 callers. Remove old relro handling.
10172 * output.h (class Output_section): Add new methods: is_last_relro,
10173 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10174 Add is_last_relro_ and is_first_non_relro_ fields.
10175 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10176 Create separate .got.plt section. Call increase_relro.
10177 * x86_64.cc (Target_x86_64::got_section): Likewise.
10178 * testsuite/relro_script_test.t: Add .got.plt.
10181 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10182 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10183 (Layout::finalize): Call set_dynamic_symbol_size.
10184 (Layout::set_dynamic_symbol_size): New function.
10185 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10186 set_dynamic_symbol_size.
10189 * output.h (class Output_section): Add is_entsize_zero_ field.
10190 * output.cc (Output_section::Output_section): Initialize
10192 (Output_section::set_entsize): If two different entsizes are
10193 requested, force it to zero.
10194 (Output_section::add_input_section): Set flags for .debug_str
10195 before updating section flags. Set entsize.
10196 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10197 and SHF_STRING if all input sections have those flags.
10199 2009-12-29 Rafael Espindola <espindola@google.com>
10201 * main.cc (main): Fix the sys time reporting.
10202 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10205 2009-12-29 Sriraman Tallam <tmsriram@google.com>
10207 * options.cc (General_options::parse_version): Allow -v to exit
10208 without an error if there is nothing to link.
10210 2009-12-29 Ian Lance Taylor <iant@google.com>
10212 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10213 using a version of gcc before 4.1.
10214 * configure: Rebuild.
10216 2009-12-28 Chris Demetriou <cgd@google.com>
10218 * attributes.cc (Output_attributes_section_data::do_write): Use
10219 std::vector::front rather than std::vector::data.
10221 2009-12-28 Ian Lance Taylor <iant@google.com>
10223 * symtab.h (class Symbol_table): Add enum Defined.
10224 * resolve.cc (Symbol_table::should_override): Add defined
10225 parameter. Change all callers. Test whether object is NULL
10226 before calling a method on it.
10227 (Symbol_table::report_resolve_problem): Add defined parameter.
10228 Change all callers.
10229 (Symbol_table::should_override_with_special): Likewise.
10230 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10231 parameter. Change all callers.
10232 (Symbol_table::do_define_in_output_data): Likewise.
10233 (Symbol_table::define_in_output_segment): Likewise.
10234 (Symbol_table::do_define_in_output_segment): Likewise.
10235 (Symbol_table::define_as_constant): Likewise.
10236 (Symbol_table::do_define_as_constant): Likewise.
10237 * script.h (class Symbol_assignment): Add is_defsym parameter to
10238 constructor; change all callers.
10239 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10240 parameter. Change all callers. Add is_defsym_ field.
10241 (class Parser_closure): Add parsing_defsym parameter to
10242 constructor; change all callers. Add parsing_defsym accessor
10243 function. Add parsing_defsym_ field.
10245 2009-12-28 Ian Lance Taylor <iant@google.com>
10247 * gold.cc (queue_middle_tasks): Fix formatting.
10248 * object.cc (Relobj::is_section_name_included): Likewise.
10250 2009-12-23 Ian Lance Taylor <iant@google.com>
10252 * i386.cc (Target_i386::do_calls_non_split): Recognize
10253 -fsplit-stack prologue for a function with a static chain.
10254 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10255 -fsplit-stack prologue when using %r11.
10257 2009-12-21 Sriraman Tallam <tmsriram@google.com>
10259 * options.cc (General_options::parse_version): Make -v continue and do
10260 the link like GNU ld does.
10262 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
10264 * Makefile.am (CCFILES): Add timer.cc.
10265 (HFILES): Add timer.h.
10266 * configure.ac: Check for sysconf and times.
10267 * main.cc: include timer.h.
10268 (main): Use Timer instead of get_run_time.
10271 * workqueue.cc: include timer.h.
10272 (Workqueue::find_and_run_task):
10273 Report user, sys and wall time.
10274 * Makefile.in: Regenerate.
10275 * config.in: Regenerate.
10276 * configure: Regenerate.
10278 2009-12-16 Doug Kwan <dougkwan@google.com>
10280 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10282 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10283 relaxed input sections.
10284 * output.cc (Output_section::find_relaxed_input_section): Change
10285 return type to Output_relaxed_input_section pointer. Adjust code
10286 for new type of relaxed_input_section_map_.
10287 * output.h (Output_section::find_relaxed_input_section): Change
10288 return type to Output_relaxed_input_section pointer.
10289 (Output_section::Output_relaxed_input_section_by_input_section_map):
10291 (Output_section::relaxed_input_section_map_): Change type to
10292 Output_section::Output_relaxed_input_section_by_input_section_map.
10293 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10296 2009-12-15 Ian Lance Taylor <iant@google.com>
10298 * layout.cc (Layout::create_shstrtab): Only write out after input
10299 sections if we are compressing debug sections.
10301 2009-12-15 Ian Lance Taylor <iant@google.com>
10303 * archive.cc (Archive::add_symbols): Only look up a symbol without
10304 a version if there is, in fact, a version.
10306 2009-12-14 Ian Lance Taylor <iant@google.com>
10308 Revert -Wshadow changes, all changes from:
10309 2009-12-11 Doug Kwan <dougkwan@google.com>
10310 2009-12-11 Nick Clifton <nickc@redhat.com>
10311 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10313 2009-12-11 Doug Kwan <dougkwan@google.com>
10315 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10317 * attributes.cc (Object_attribute::size): Ditto.
10318 (Attributes_section_data::size): Ditto.
10319 (Attributes_section_data::Attributes_section_data): Ditto.
10320 (Output_attributes_section_data::do_write): Ditto.
10321 * attributes.h (Object_attribute::set_type): Ditto.
10322 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10324 2009-12-11 Nick Clifton <nickc@redhat.com>
10326 * archive.cc: Fix shadowed variable warnings.
10327 * arm.cc: Likewise.
10328 * compressed_output.cc: Likewise.
10329 * compressed_output.h: Likewise.
10330 * configure: Likewise.
10331 * dwarf_reader.cc: Likewise.
10332 * dynobj.cc: Likewise.
10333 * dynobj.h: Likewise.
10334 * ehframe.cc: Likewise.
10335 * ehframe.h: Likewise.
10336 * errors.cc: Likewise.
10337 * expression.cc: Likewise.
10338 * fileread.cc: Likewise.
10339 * fileread.h: Likewise.
10340 * freebsd.h: Likewise.
10341 * i386.cc: Likewise.
10342 * icf.cc: Likewise.
10343 * incremental.h: Likewise.
10344 * layout.cc: Likewise.
10345 * layout.h: Likewise.
10346 * mapfile.cc: Likewise.
10347 * merge.cc: Likewise.
10348 * merge.h: Likewise.
10349 * object.cc: Likewise.
10350 * object.h: Likewise.
10351 * options.h: Likewise.
10352 * output.cc: Likewise.
10353 * output.h: Likewise.
10354 * parameters.cc: Likewise.
10355 * plugin.cc: Likewise.
10356 * powerpc.cc: Likewise.
10357 * reduced_debug_output.cc: Likewise.
10358 * reduced_debug_output.h: Likewise.
10359 * reloc.cc: Likewise.
10360 * reloc.h: Likewise.
10361 * resolve.cc: Likewise.
10362 * script-sections.cc: Likewise.
10363 * script.cc: Likewise.
10364 * script.h: Likewise.
10365 * sparc.cc: Likewise.
10366 * symtab.cc: Likewise.
10367 * symtab.h: Likewise.
10368 * target-select.cc: Likewise.
10369 * target-select.h: Likewise.
10370 * token.h: Likewise.
10371 * workqueue.cc: Likewise.
10372 * workqueue.h: Likewise.
10373 * x86_64.cc: Likewise.
10375 2009-12-10 Doug Kwan <dougkwan@google.com>
10377 * arm.cc (attributes.h): New include.
10378 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10379 (Arm_relobj::~Arm_relobj): Delete object pointed by
10380 attributes_section_data_.
10381 (Arm_relobj::attributes_section_data): New method definition.
10382 (Arm_relobj::attributes_section_data_): New data member declaration.
10383 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10384 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10385 attributes_section_data_.
10386 (Arm_dynobj::attributes_section_data): New method definition.
10387 (Arm_dynobj::attributes_section_data_): New data member declaration.
10388 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10389 initialization value of may_use_blx_ to false.
10390 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
10391 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10392 object attributes to compute results instead of hard-coding.
10393 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10394 Target_arm::get_secondary_compatible_arch,
10395 Target_arm::set_secondary_compatible_arch
10396 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10397 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10398 New method declarations.
10399 (Target_arm::get_aeabi_object_attribute): New method definition.
10400 (Target_arm::attributes_section_data_): New data member declaration.
10401 (read_arm_attributes_section): New template definition.
10402 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10403 (Arm_dynobj::do_read_symbols): Ditto.
10404 (Target_arm::do_finalize_sections): Merge attributes sections from
10405 input. Check for BLX use after attributes section merging.
10406 Fix __exidx_start and __exidx_end visibility. Create an
10407 .ARM.attributes section if necessary.
10408 (Target_arm::get_secondary_compatible_arch,
10409 Target_arm::set_secondary_compatible_arch,
10410 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10411 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
10412 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
10413 New method definitions.
10415 2009-12-09 Ian Lance Taylor <iant@google.com>
10417 * plugin.cc (Plugin::load): Don't cast from void* to a function
10420 2009-12-09 Ian Lance Taylor <iant@google.com>
10422 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10423 information fields.
10425 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10427 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10428 Replace two_file_shared_1.so with two_file_shared_2.so.
10429 * testsuite/Makefile.in: Regenerated.
10431 2009-12-08 Doug Kwan <dougkwan@google.com>
10433 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10434 (HFILES): Add attributes.h and int_encoding.h.
10435 * Makefile.in: Regenerate.
10436 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10437 function definitions to int_encoding.cc
10438 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10439 prototypes to int_encoding.h
10440 * reduced_debug_output.cc (int_encoding.h): New include.
10441 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10442 function definitions to int_encoding.cc
10443 (insert_into_vector, read_from_pointer): Move template definitions to
10445 * attributes.cc: New file.
10446 * attributes.h: New file.
10447 * int_encoding.cc: New file.
10448 * int_encoding.h: New file.
10450 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
10453 * incremental-dump.cc (dump_incremental_inputs): New.
10454 (main): Use dump_incremental_inputs.
10456 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10459 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10460 checking elfcpp::STT_FUNC.
10461 (Target_i386::Relocate::relocate): Likewise.
10462 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10464 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10465 symbols from shared libraries into normal FUNC symbols.
10467 * symtab.h (Symbol): Add is_func and use it.
10469 2009-12-05 Doug Kwan <dougkwan@google.com>
10471 * arm.cc (Target_arm::arm_info): Initialize new fields
10472 attributes_section and attributes_vendor.
10473 * i386.cc (Target_i386::i386_info): Same.
10474 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10475 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10476 fields attributes_section and attributes_vendor.
10477 * sparc.cc (Target_sparc::sparc_info): Same.
10478 * target.h (Target::attributes_section, Target::attributes_vendor,
10479 Target::is_attributes_section, Target::attribute_arg_type,
10480 Target::attributes_order): New method definitions.
10481 (Target::Target_info::attributes_section,
10482 Target::Target_info::attributes_vendor): New fields.
10483 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10484 virtual method definitions.
10485 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10486 attributes_section and attributes_vendor.
10487 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10489 2009-12-05 Doug Kwan <dougkwan@google.com>
10491 * arm.cc: Update comments about interworking and stub generation.
10492 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10493 considered as non-PIC.
10494 (Arm_relocate_functions::base_abs): Fix formatting.
10495 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10496 of function to use GOT entry address instead of offset.
10497 (Target_arm::Scan::global): Issue an error if a symbol would need a
10498 PLT does not get one because it is untyped. Remove code to create
10499 dynamic symbols for relative branches.
10500 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10501 takes unsigned integer instead of boolean.
10503 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10505 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10506 (two_file_test_LDADD): Likewise.
10507 (common_test_1_LDADD): Likewise.
10508 (exception_test_LDADD) Likewise.
10509 (weak_test_LDADD): Likewise.
10510 (many_sections_test_LDADD): Likewise.
10511 (initpri1_LDADD): Likewise.
10512 (script_test_1_LDADD): Likewise.
10513 (script_test_2_LDADD): Likewise.
10514 (justsyms_LDADD): Likewise.
10515 (binary_test_LDADD): Likewise.
10516 (large_LDADD): Likewise.
10517 * testsuite/Makefile.in: Regenerated.
10519 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
10521 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10522 (Symbol_table::override_with_special): Likewise.
10523 (Symbol_table::add_from_object): Likewise.
10525 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10527 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10528 Don't set the data_offset twice.
10530 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10532 * testsuite/Makefile.in: Regenerate.
10534 2009-12-03 Doug Kwan <dougkwan@google.com>
10536 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10537 (Target_arm::do_finalize_sections): Add parameter for symbol table
10538 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10539 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10540 parameter for symbol table pointer.
10541 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10542 an additional parameter for a pointer to symbol table.
10543 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10544 parameter for a symbol table pointer.
10545 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10546 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10548 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10549 parameter for a symbol table pointer.
10551 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
10553 * incremental.cc (Incremental_inputs_header)
10554 (Incremental_inputs_header_write, Incremental_inputs_entry)
10555 (Incremental_inputs_entry_write): Move ...
10556 * incremental.h (Incremental_inputs_header)
10557 (Incremental_inputs_header_write, Incremental_inputs_entry)
10558 (Incremental_inputs_entry_write): here.
10560 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10562 * incremental.cc (make_sized_incremental_binary): Set the target.
10563 Error if it is incompatible.
10564 * output.h (Output_file): Add filename method.
10566 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10568 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10569 from the get_* methods.
10571 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10573 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10574 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10575 Write 0 for the data_offset of scripts.
10577 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10579 * testsuite/Makefile.am: Add the incremental_test.sh test.
10580 * testsuite/incremental_test.sh: New.
10581 * testsuite/incremental_test_1.c: New.
10582 * testsuite/incremental_test_2.c: New.
10584 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
10586 * incremental-dump.cc (main): Fix typos.
10588 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
10591 * incremental-dump.cc (main): Use llu to print 64 bit values.
10593 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10594 H.J. Lu <hongjiu.lu@intel.com>
10596 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10598 (incremental_dump_LDADD): Likewise.
10599 * Makefile.in: Regenerated.
10601 2009-11-25 Doug Kwan <dougkwan@google.com>
10605 2009-11-25 Doug Kwan <dougkwan@google.com>
10607 * arm.cc (Target_arm::Target_arm): Move method definition
10608 outside of class definition. Add code to handle
10609 --target1-rel, --target1-abs and --target2= options.
10610 (Target_arm::get_reloc_reloc_type): Change method to be
10611 non-static and const.
10612 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10613 New data member declaration.
10614 (Target_arm::Scan::local, Target_arm::Scan::global,
10615 Target_arm::Relocate::relocate,
10616 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10617 Adjust call to Target_arm::get_real_reloc_type.
10618 (Target_arm::get_real_reloc_type): Use command line options
10619 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10620 * options.h (--target1-rel, --target1-abs, --target2): New
10623 2009-11-25 Doug Kwan <dougkwan@google.com>
10625 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10626 class definition. Add code to handle --target1-rel, --target1-abs
10627 and --target2= options.
10628 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10630 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10631 member declaration.
10632 (Target_arm::Scan::local, Target_arm::Scan::global,
10633 Target_arm::Relocate::relocate,
10634 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10635 call to Target_arm::get_real_reloc_type.
10636 (Target_arm::get_real_reloc_type): Use command line options to
10637 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10638 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10641 2009-11-25 Doug Kwan <dougkwan@google.com>
10643 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10644 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10645 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10647 (Arm_relocate_functions::thm_call): Replace body with a call to
10648 Arm_relocate_functions::thumb_branch_common.
10649 (Arm_relocate_functions::thm_jump24,
10650 Arm_relocate_functions::thm_xpc22): New method definitions.
10651 (Arm_relocate_functions::thumb_branch_common): New method definition.
10652 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10654 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10655 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10657 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10659 * Makefile.am: Build incremental-dump
10660 * Makefile.in: Regenerate.
10661 * incremental-dump.cc: New.
10662 * incremental.cc (Incremental_inputs_header_data,
10663 Incremental_inputs_entry_data): Move to incremental.h
10664 * incremental.h: (Incremental_inputs_header_data,
10665 Incremental_inputs_entry_data): Move from incremental.cc
10667 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10669 * incremental.cc (Incremental_inputs_header,
10670 Incremental_inputs_header_write, Incremental_inputs_entry,
10671 Incremental_inputs_entry_write): Add a typedef with the data type.
10673 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10675 * incremental.cc (Incremental_inputs_header,
10676 Incremental_inputs_header_write, Incremental_inputs_entry,
10677 Incremental_inputs_entry_write): Update comment about which
10678 type has the filed descriptions.
10680 2009-11-15 Doug Kwan <dougkwan@google.com>
10682 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10683 (Arm_relocate_functions::arm_branch_common): Change method defintion
10684 in class definition to a method declaration and update list of formal
10686 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10687 Arm_relocation_functions::jump24): Adjust call to
10688 Arm_relocate_functions::arm_branch_common. Update list of formal
10690 (Arm_relocate_functions::xpc25): New method definition.
10691 (Arm_relocate_functions::arm_branch_common): Move method defintion
10692 out from class definition. Use stubs for mode-switching and extending
10694 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10695 specially. Change code to enable use of stubs in ARM branches.
10697 2009-11-10 Doug Kwan <dougkwan@google.com>
10699 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10700 in method declaration.
10701 (Target_arm::relocate_stub): New method declaration.
10702 (Target_arm::default_target): Change to return a pointer instead of
10704 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10705 Target_arm::default_target.
10706 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10708 (Target_arm::relocate_section): Adjust view.
10709 (Target_arm::relocate_stub): New method definition.
10711 2009-11-10 Doug Kwan <dougkwan@google.com>
10713 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10715 * incremental.cc (open_incremental_binary): Initialized local
10716 variables to avoid warnings.
10717 * object.cc (make_elf_object): Ditto.
10718 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10721 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10724 * testsuite/plugin_test.c: Include "config.h".
10726 2009-11-09 Doug Kwan <dougkwan@google.com>
10728 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10729 (arm_symbol_value): Remove.
10730 (Arm_relocate_functions::arm_branch_common,
10731 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10732 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10733 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10734 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10735 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10736 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10737 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10738 Arm_relocate_functions::thm_mobw_abs_nc,
10739 Arm_relocate_functions::thm_mov_abs,
10740 Arm_relocate_functions::movw_prel_nc,
10741 Arm_relocate_functions::thm_movt_abs,
10742 Arm_relocate_functions::movt_prel,
10743 Arm_relocate_functions::thm_movw_prel_nc,
10744 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10745 (Target_arm::Relocate::relocate): Only decompose address into two
10746 parts if relocation type uses the thumb-bit and pass the actual
10747 bit instead of a flag indicating that the thumb-bit is used. Adjust
10748 calls to methods in Arm_relocate_functions for this change.
10750 2009-11-08 Ian Lance Taylor <iant@google.com>
10753 * reloc.cc: Instantiate
10754 Sized_relobj::initialize_input_to_output_maps and
10755 Sized_relobj:free_input_to_output_maps.
10757 2009-11-06 Ian Lance Taylor <iant@google.com>
10760 * defstd.cc (in_segment): Set only_if_ref true for "end".
10762 2009-11-06 Doug Kwan <dougkwan@google.com>
10764 * arm.cc (class Reloc_stub): Correct a comment.
10765 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10766 (Target_arm::scan_section_for_stubs): New method declaration.
10767 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10768 Change methods from private to protected.
10769 (Target_arm::do_may_relax): New method definition.
10770 (Target_arm::do_relax, Target_arm::group_sections,
10771 Target_arm::scan_reloc_for_stub,
10772 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10773 (Target_arm::arm_input_section_map_): New data member declaration.
10774 (Target_arm::scan_reloc_for_stub,
10775 Target_arm::scan_reloc_section_for_stubs,
10776 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10777 Target_arm::do_relax): New method definitions.
10779 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10781 * configure.ac: Check for (struct stat)::st_mtim
10782 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10783 * config.in: Regenerate.
10784 * configure: Regenerate.
10786 2009-11-05 Ian Lance Taylor <iant@google.com>
10789 * output.cc (Output_segment::add_output_section): Add missing
10792 2009-11-04 Ian Lance Taylor <iant@google.com>
10795 * object.h (class Object): Add is_needed and set_is_needed
10796 methods. Add is_needed_ field. Make bool fields into bitfields.
10797 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10798 defined in a dynamic object and referenced by a regular object,
10799 set is_needed for the dynamic object.
10800 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10801 if the file is marked with as_needed and it is not needed.
10803 2009-11-04 Ian Lance Taylor <iant@google.com>
10806 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10807 tags if data is discarded by linker script.
10808 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10809 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10810 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10811 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10813 2009-11-04 Ian Lance Taylor <iant@google.com>
10815 * layout.cc (Layout::get_output_section): Add is_interp and
10816 is_dynamic_linker_section parameters. Change all callers.
10817 (Layout::choose_output_section): Likewise.
10818 (Layout::make_output_section): Likewise.
10819 (Layout::add_output_section_data): Add is_dynamic_linker_section
10820 parameter. Change all callers.
10821 * layout.h (class Layout): Update declarations.
10822 * output.h (class Output_section): Add is_interp, set_is_interp,
10823 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10824 Add is_interp_, is_dynamic_linker_section_ fields. Change
10825 generate_code_fills_at_write_ to a bitfield.
10826 * output.cc (Output_section::Output_sections): Initialize new
10828 (Output_segment::add_output_section): Add do_sort parameter.
10829 Change all callers.
10831 2009-11-03 Ian Lance Taylor <iant@google.com>
10834 * options.h (class General_options): Add --warn-common.
10835 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10836 merging two common symbols.
10837 (Symbol_table::should_override): Handle --warn-common when merging
10838 a common symbol with a defined symbol. Use report_resolve_problem
10839 for multiple definitions.
10840 (Symbol_table::report_resolve_problem): New function.
10841 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10843 2009-11-03 Doug Kwan <dougkwan@google.com>
10845 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10847 (Target_arm::stub_factory): New method definition.
10848 (Target_arm::new_arm_input_section,
10849 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10850 Target_arm::reloc_uses_thumb_bit): New method declarations.
10851 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
10852 New type definitions.
10853 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10854 member declarations.
10855 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10856 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10857 New method definitions.
10859 2009-11-03 Ian Lance Taylor <iant@google.com>
10861 * options.h (class General_options): Add --warn_constructors.
10863 2009-11-03 Ian Lance Taylor <iant@google.com>
10866 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10867 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10869 2009-11-03 Ian Lance Taylor <iant@google.com>
10872 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10873 --msgid-bugs-address.
10874 (install-pdf): New target.
10875 (install-data_yes): Look up one directory to find mkinstalldirs.
10877 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10879 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10882 2009-10-30 Doug Kwan <dougkwan@google.com>
10884 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10886 2009-10-30 Doug Kwan <dougkwan@google.com>
10888 * arm.cc (Stub_addend_reader): New struct template definition
10889 and partial specializations.
10890 (Stub_addend_reader::operator()): New method definition for a
10891 partially specialized template.
10893 2009-10-30 Doug Kwan <dougkwan@google.com>
10895 * arm.cc (Arm_relobj::processor_specific_flags): New method
10897 (Arm_relobj::do_read_symbols): New method declaration.
10898 (Arm_relobj::processor_specific_flags_): New data member declaration.
10899 (Arm_dynobj): New class definition.
10900 (Target_arm::do_finalize_sections): Add input_objects parameter.
10901 (Target_arm::do_adjust_elf_header): New method declaration.
10902 (Target_arm::are_eabi_versions_compatible,
10903 (Target_arm::merge_processor_specific_flags): New method declaration.
10904 (Target_arm::do_make_elf_object): New overloaded method definitions
10906 (Arm_relobj::do_read_symbols): New method definition.
10907 (Arm_dynobj::do_read_symbols): Ditto.
10908 (Target_arm::do_finalize_sections): Add input_objects parameters.
10909 Merge processor-specific flags from all input objects.
10910 (Target_arm::are_eabi_versions_compatible,
10911 Target_arm::merge_processor_specific_flags,
10912 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10913 New method definitions.
10914 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10915 Input_objects pointer type parameter.
10916 * layout.cc (Layout::finalize): Pass input objects to target's.
10917 finalize_sections function.
10918 * output.cc (Output_file_header::do_sized_write): Set ELF file
10919 header's processor-specific flags.
10920 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10921 Input_objects pointer type parameter.
10922 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10923 * target.h (Input_objects): New forward class declaration.
10924 (Target::processor_specific_flags,
10925 Target::are_processor_specific_flags_sect): New method definitions.
10926 (Target::finalize_sections): Add input_objects parameter.
10927 (Target::Target): Initialize processor_specific_flags_ and
10928 are_processor_specific_flags_set_.
10929 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10931 (Target::set_processor_specific_flags): New method definition.
10932 (Target::processor_specific_flags_,
10933 Target::are_processor_specific_flags_set_): New data member
10935 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10936 Input_objects pointer type parameter.
10938 2009-10-30 Doug Kwan <dougkwan@google.com>
10940 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10942 2009-10-28 Ian Lance Taylor <iant@google.com>
10944 * object.h (class Relobj): Drop options parameter from
10945 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10946 do_scan_relocs, do_relocate. Change all callers.
10947 (class Sized_relobj): Drop options parameters from
10948 do_gc_process_relocs, do_scan_relocs, do_relocate,
10949 do_relocate_sections, relocate_sections, emit_relocs_scan,
10950 emit_relocs_scan_reltype. Change all callers.
10951 (struct Relocate_info): Remove options field and all references to
10953 * reloc.h (class Read_relocs): Remove options constructor
10954 parameter and options_ field. Change all callers.
10955 (class Gc_process_relocs, class Scan_relocs): Likewise.
10956 (class Relocate_task): Likewise.
10957 * target-reloc.h (scan_relocs): Remove options parameter. Change
10959 (scan_relocatable_relocs): Likewise.
10960 * target.h (class Sized_target): Remove options parameter from
10961 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10963 * gc.h (gc_process_relocs): Remove options parameter. Change all
10965 * arm.cc: Update functions to remove options parameters.
10966 * i386.cc: Likewise.
10967 * powerpc.cc: Likewise.
10968 * sparc.cc: Likewise.
10969 * x86_64.cc: Likewise.
10970 * testsuite/testfile.cc: Likewise.
10972 2009-10-28 Doug Kwan <dougkwan@google.com>
10974 * arm.cc (Arm_relobj): New class definition.
10975 (Arm_relobj::scan_sections_for_stubs,
10976 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10977 New method definitions.
10979 2009-10-28 Cary Coutant <ccoutant@google.com>
10981 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10982 (Plugin::cleanup_done_): New member.
10983 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10984 (Plugin_manager::cleanup_done_): Remove.
10985 (Plugin_manager::add_input_file): Edit error message.
10986 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10987 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10989 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10991 * fileread.cc: (File_read::View::~View): Use the new
10992 data_ownership_ filed.
10993 (File_read::~File_read): Dispose the new whole_file_view_.
10994 (File_read::open): Mmap the whole file if needed.
10995 (File_read::open): Use whole_file_view_ instead of contents_.
10996 (File_read::find_view): Use whole_file_view_ if applicable.
10997 (File_read::do_read): Use whole_file_view_ instead of contents_.
10998 (File_read::make_view): Use whole_file_view_ instead of contents_,
10999 update File_read::View::View call.
11000 (File_read::find_or_make_view): Update File_read::View::View
11002 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11004 (File_read::View::Data_ownership): New enum.
11005 (File_read::View::View): Replace bool mapped_ with Data_ownership
11007 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11008 (File_read::View::data_ownership_): New field.
11009 (File_read::contents_): Remove (replaced by whole_file_view_).
11010 (File_read::whole_file_view_): New field.
11011 * options.h (class General_options): Add --keep-files-mapped.
11013 2009-10-27 Cary Coutant <ccoutant@google.com>
11015 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11016 * testsuite/Makefile.am (plugin_test_5): New test case.
11017 * testsuite/Makefile.in: Regenerate.
11019 2009-10-25 Doug Kwan <dougkwan@google.com>
11021 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11022 from private to protected to allow access by child class.
11023 (Sized_relobj::do_relocate_sections): New method declaration.
11024 (Sized_relobj::relocate_sections): Virtualize.
11025 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
11026 Sized_relobj::relocate_sections. Instantiate template explicitly
11027 for different target sizes and endianity.
11029 2009-10-24 Doug Kwan <dougkwan@google.com>
11031 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11032 (Arm_input_section::as_arm_input_section): New method.
11033 (Arm_output_section): New class definition.
11034 (Arm_output_section::create_stub_group,
11035 Arm_output_section::group_sections): New method definitions.
11037 2009-10-22 Doug Kwan <dougkwan@google.com>
11039 * arm.cc (Arm_input_section): New class definition.
11040 (Arm_input_section::init, Arm_input_section:do_write,
11041 Arm_input_section::set_final_data_size,
11042 Arm_input_section::do_reset_address_and_file_offset): New method
11045 2009-10-21 Doug Kwan <dougkwan@google.com>
11047 * arm.cc (Stub_table, Arm_input_section): New forward class
11049 (Stub_table): New class defintion.
11050 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11051 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11052 New method definition.
11054 2009-10-21 Doug Kwan <dougkwan@google.com>
11056 * arm.cc: Update copyright comments.
11057 (Target_arm): New forward class template declaration.
11058 (Arm_address): New type.
11059 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11060 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11061 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11063 (Insn_template): Same.
11064 (DEF_STUBS): New macro.
11065 (Stub_type): New enum type.
11066 (Stub_template): New class definition.
11068 (Reloc_stub): Same.
11069 (Stub_factory): Same.
11070 (Target_arm::Target_arm): Initialize may_use_blx_ and
11071 should_force_pic_veneer_.
11072 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11073 Target_arm::should_force_pic_veneer,
11074 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11075 Target_arm::using_thumb_only, Target_arm:;default_target): New
11077 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11078 New data member declarations.
11079 (Insn_template::size, Insn_template::alignment): New method defintions.
11080 (Stub_template::Stub_template): New method definition.
11081 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11082 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11083 (Stub_factory::Stub_factory): New method definition.
11084 * gold.h (string_hash): New template.
11085 * output.h (Input_section_specifier::hash_value): Use
11087 (Input_section_specifier::string_hash): Remove.
11088 * stringpool.cc (Stringpool_template::string_hash): Use
11091 2009-10-20 Doug Kwan <dougkwan@google.com>
11093 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11094 symbols of relaxed input sections.
11095 * output.h (Output_section::find_relaxed_input_section): Make
11098 2009-10-16 Doug Kwan <dougkwan@google.com>
11100 * dynobj.cc (Versions::Versions): Initialize version_script_.
11101 Only insert base version symbol definition for a shared object
11102 if version script defines any version versions.
11103 (Versions::define_base_version): New method definition.
11104 (Versions::add_def): Check that base version is not needed.
11105 (Versions::add_need): Define base version lazily.
11106 * dynobj.h (Versions::define_base_version): New method declaration.
11107 (Versions::needs_base_version_): New data member declaration.
11108 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11109 (check_DATA): Add no_version_test.stdout.
11110 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11112 * testsuite/Makefile.in: Regenerate.
11113 * testsuite/no_version_test.c: New file.
11114 * testsuite/no_version_test.sh: Ditto.
11116 2009-10-16 Doug Kwan <dougkwan@google.com>
11118 * expression.cc (class Segment_start_expression): New class definition.
11119 (Segment_start_expression::value): New method definition.
11120 (script_exp_function_segment_start): Return a new
11121 Segment_start_expression.
11122 * gold/script-c.h (script_saw_segment_start_expression): New function
11124 * script-sections.cc (Script_sections::Script_sections): Initialize
11125 SAW_SEGMENT_START_EXPRESSION_ to false.
11126 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11127 and -Tbbs options to specify section addresses if given in
11128 command line and no SEGMENT_START expression is seen in a script.
11129 * script-sections.h (Script_sections::saw_segment_start_expression,
11130 Script_sections::set_saw_segment_start_expression): New method
11132 (Script_sections::saw_segment_start_expression_): New data member
11134 * script.cc (script_saw_segment_start_expression): New function.
11135 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11136 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11137 script_test_7.sh and script_test_8.sh.
11138 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11139 script_test_8.stdout.
11140 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11141 (script_test_6, script_test_6.stdout, script_test_7,
11142 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11143 * Makefile.in: Regenerate.
11144 * testsuite/script_test_6.sh: New file.
11145 * testsuite/script_test_6.t: Same.
11146 * testsuite/script_test_7.sh: Same.
11147 * testsuite/script_test_7.t: Same.
11148 * testsuite/script_test_8.sh: Same.
11150 2009-10-16 Doug Kwan <dougkwan@google.com>
11152 * output.cc (Output_segment::set_section_list_address): Cast
11153 expressions to unsigned long long type to avoid format warnings.
11155 2009-10-15 Ian Lance Taylor <iant@google.com>
11157 * script.cc (Script_options::add_symbol_assignment): Always add a
11158 dot assignment to script_sections_.
11159 * script-sections.cc (Script_sections::add_dot_assignment):
11160 Initialize if necessary.
11162 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11163 program headers with no load segment if there is a linker script.
11165 * layout.cc (Layout::set_segment_offsets): Align the file offset
11166 to the segment aligment for -N or -n with no load segment.
11167 * output.cc (Output_segment::add_output_section): Don't crash if
11168 the first section is a TLS section.
11169 (Output_segment::set_section_list_addresses): Print an error
11170 message if the address moves backward in a linker script.
11171 * script-sections.cc
11172 (Output_section_element_input::set_section_addresses): Don't
11173 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11174 (Orphan_output_section::set_section_addresses): Likewise.
11176 2009-10-15 Doug Kwan <dougkwan@google.com>
11178 * layout.cc (Layout::finish_dynamic_section): Generate tags
11179 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11180 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11181 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11183 2009-10-14 Ian Lance Taylor <iant@google.com>
11185 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11187 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11188 data_shdr fields of relinfo.
11189 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11190 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11191 R_386_TLS_LDO_32, adjust based on section flags.
11192 (Target_i386::Relocate::fix_up_ldo): Remove.
11194 2009-10-13 Ian Lance Taylor <iant@google.com>
11196 Add support for -pie.
11197 * options.h (class General_options): Add -pie and
11199 (General_options::output_is_position_independent): Test -pie.
11200 (General_options::output_is_executable): Return true if not shared
11201 and not relocatable.
11202 (General_options::output_is_pie): Remove.
11203 * options.cc (General_options::finalize): Reject incompatible uses
11205 * gold.cc (queue_middle_tasks): A -pie link is not static.
11206 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11207 * symtab.cc (Symbol::final_value_is_known): Return false if
11208 output_is_position_independent.
11209 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11210 output_is_position_independent.
11211 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11212 output_is_position_independent.
11213 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11214 output_is_position_independent.
11215 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11217 (basic_pie_test.o, basic_pie_test): New targets.
11218 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11219 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11220 (two_file_pie_test): New target.
11221 * testsuite/Makefile.in: Rebuild.
11222 * README: Remove note saying that -pie is not supported.
11224 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11226 * options.h (class General_options): Add -init and -fini.
11227 * layout.cc (Layout::finish_dynamic_section): Emit
11228 given init and fini functions.
11230 2009-10-13 Sriraman Tallam <tmsriram@google.com>
11232 * gc.h (gc_process_relocs): Check if icf is enabled using new
11234 * gold.cc (queue_initial_tasks): Likewise.
11235 (queue_middle_tasks): Likewise.
11236 * object.cc (do_layout): Likewise.
11237 * symtab.cc (is_section_folded): Likewise.
11238 * main.cc (main): Likewise.
11239 * reloc.cc (Read_relocs::run): Likewise.
11240 (Sized_relobj::do_scan_relocs): Likewise.
11241 * icf.cc (is_function_ctor_or_dtor): New function.
11242 (Icf::find_identical_sections): Check if function is ctor or dtor when
11243 safe icf is chosen.
11244 * options.h (General_options::icf): Change option to be an enum.
11245 (Icf_status): New enum.
11246 (icf_enabled): New method.
11247 (icf_safe_folding): New method.
11248 (set_icf_status): New method.
11249 (icf_status_): New variable.
11250 * (options.cc) (General_options::finalize): Set icf_status_.
11251 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11252 icf_test and icf_keep_unique_test to use the --icf enum flag.
11253 * testsuite/icf_safe_test.sh: New file.
11254 * testsuite/icf_safe_test.cc: New file.
11256 2009-10-12 Sriraman Tallam <tmsriram@google.com>
11258 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11259 includes to gc.h and icf.h.
11260 * arm.cc: Include gc.h.
11261 * gold.cc: Likewise.
11262 * i386.cc: Likewise.
11263 * powerpc.cc: Likewise.
11264 * sparc.cc: Likewise.
11265 * x86_64.cc: Likewise.
11266 * gc.h: Include icf.h.
11268 2009-10-11 Ian Lance Taylor <iant@google.com>
11270 * plugin.cc: Include "gold.h" before other header files.
11272 2009-10-10 Chris Demetriou <cgd@google.com>
11274 * options.h (Input_file_argument::Input_file_type): New enum.
11275 (Input_file_argument::is_lib_): Replace with...
11276 (Input_file_argument::type_): New member.
11277 (Input_file_argument::Input_file_argument): Take Input_file_type
11278 'type' rather than boolean 'is_lib' as second argument.
11279 (Input_file_argument::is_lib): Use type_.
11280 (Input_file_argument::is_searched_file): New function.
11281 (Input_file_argument::may_need_search): Handle is_searched_file.
11282 * options.cc (General_options::parse_library): Support -l:filename.
11283 (General_options::parse_just_symbols): Update for Input_file_argument
11285 (Command_line::process): Likewise.
11286 * archive.cc (Archive::get_file_and_offset): Likewise.
11287 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11288 * script.cc (read_script_file, script_add_file): Likewise.
11289 * fileread.cc (Input_file::Input_file): Likewise.
11290 (Input_file::will_search_for): Handle is_searched_file.
11291 (Input_file::open): Likewise.
11292 * readsyms.cc (Read_symbols::get_name): Likewise.
11293 * testsuite/Makefile.am (searched_file_test): New test.
11294 * testsuite/Makefile.in: Regenerate.
11295 * testsuite/searched_file_test.cc: New file.
11296 * testsuite/searched_file_test_lib.cc: New file.
11298 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11299 Ian Lance Taylor <iant@google.com>
11301 * descriptor.cc: Include <cstdio> and "binary-io.h".
11302 (Descriptors::open): Open the files in binary mode always.
11303 * script.cc (Lex::get_token): Treat \r as whitespace.
11305 2009-10-09 Ian Lance Taylor <iant@google.com>
11307 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11309 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11310 Ian Lance Taylor <iant@google.com>
11312 * configure.ac: Check for readv function also.
11313 * fileread.cc (readv): Define if not HAVE_READV.
11314 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11316 * config.in: Regenerate.
11317 * configure: Regenerate.
11319 2009-10-09 Doug Kwan <dougkwan@google.com>
11321 * layout.cc (Layout::make_output_section): Call target hook to make
11322 ordinary output section.
11323 (Layout::finalize): Adjust parameter list of call the
11324 Target::may_relax().
11325 * layout.h (class Layout::section_list): New method.
11326 * merge.h (Output_merge_base::entsize): Change visibility to public.
11327 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11329 (Output_merge_string::do_is_string): New method.
11330 * object.cc (Sized_relobj::do_setup): renamed from
11331 Sized_relobj::set_up.
11332 * object.h (Sized_relobj::adjust_shndx,
11333 Sized_relobj::initializ_input_to_output_maps,
11334 Sized_relobj::free_input_to_output_maps): Change visibilities to
11336 (Sized_relobj::setup): Virtualize.
11337 (Sized_relobj::do_setup): New method declaration.
11338 (Sized_relobj::invalidate_section_offset,
11339 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11340 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11341 * options.cc (parse_int): New function.
11342 * options.h (parse_int): New declaration.
11343 (DEFINE_int): New macro.
11344 (stub_group_size): New option.
11345 * output.cc (Output_section::Output_section): Initialize memebers
11346 merge_section_map_, merge_section_by_properties_map_,
11347 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11348 (Output_section::add_input_section): Handled deferred code-fill
11349 generation and remove an old comment.
11350 (Output_section::add_relaxed_input_section): New method definition.
11351 (Output_section::add_merge_input_section): Use merge section by
11352 properties map to speed to search. Update merge section maps
11354 (Output_section::build_relaxation_map): New method definition.
11355 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11357 (Output_section::relax_input_section): Renamed to
11358 Output_section::convert_input_sections_to_relaxed_sections and change
11359 interface to take a vector of pointers to relaxed sections.
11360 (Output_section::find_merge_section,
11361 Output_section::find_relaxed_input_section): New method definitions.
11362 (Output_section::is_input_address_mapped,
11363 Output_section::output_offset, Output_section::output_address):
11364 Use output section data maps to speed up searching.
11365 (Output_section::find_starting_output_address): Add comments.
11366 (Output_section::do_write,
11367 Output_section::write_to_postprocessing_buffer): Do code-fill
11368 generation as appropriate.
11369 (Output_section::get_input_sections): Invalidate relaxed input section
11371 (Output_section::restore_states): Adjust type of checkpoint .
11372 Invalidate relaxed input section map.
11373 * output.h (Output_merge_base): New class declaration.
11374 (Input_section_specifier): New class defintion.
11375 (class Output_relaxed_input_section) Change base class to
11376 Output_section_data_build.
11377 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11378 base class initializer.
11379 (Output_section::add_relaxed_input_section): New method declaration.
11380 (Output_section::Input_section): Change visibility to protected.
11381 (Output_section::Input_section::relobj,
11382 Output_section::Input_section::shndx): Handle relaxed input sections.
11383 Output_section::input_sections) Change visibility to protected. Also
11384 define overload to return a non-const pointer.
11385 (Output_section::Merge_section_properties): New class defintion.
11386 (Output_section::Merge_section_by_properties_map,
11387 Output_section::Output_section_data_by_input_section_map,
11388 Output_section::Relaxation_map): New types.
11389 (Output_section::relax_input_section): Rename method to
11390 Output_section::convert_input_sections_to_relaxed_sections and change
11391 interface to take a vector of relaxed section pointers.
11392 (Output_section::find_merge_section,
11393 Output_section::find_relaxed_input_section,
11394 Output_section::build_relaxation_map,
11395 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11396 New method declarations.
11397 (Output_section::merge_section_map_
11398 Output_section::merge_section_by_properties_map_,
11399 Output_section::relaxed_input_section_map_,
11400 Output_section::is_relaxed_input_section_map_valid_,
11401 Output_section::generate_code_fills_at_write_): New data members.
11402 * script-sections.cc
11403 (Output_section_element_input::set_section_addresses): Call
11404 current_data_size and addralign methods of relaxed input sections.
11405 (Orphan_output_section::set_section_addresses): Call current_data_size
11406 and addralign methods of relaxed input sections.
11407 * symtab.cc (Symbol_table::compute_final_value): Extract template
11408 from the body of Symbol_table::sized_finalize_symbol.
11409 (Symbol_table::sized_finalized_symbol): Call
11410 Symbol_table::compute_final_value.
11411 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11412 (Symbol_table::compute_final_value): New templated method declaration.
11413 * target.cc (Target::do_make_output_section): New method defintion.
11414 * target.h (Target::make_output_section): New method declaration.
11415 (Target::relax): Add more parameters for input objects, symbol table
11416 and layout. Adjust call to do_relax.
11417 (Target::do_make_output_section): New method declaration.
11418 (Target::do_relax): Add parameters for input objects, symbol table
11421 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11423 * pread.c: Include stdio.h.
11425 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11427 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11430 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11432 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11433 Change read_shndx type to unsigned int.
11434 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11436 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11437 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11438 Change read_shndx type to unsigned int.
11439 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11441 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11442 * layout.cc (Layout::create_symtab_sections): Cast the result of
11443 local_symcount * symsize to off_t in the gold_assert.
11445 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11447 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11448 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11450 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11451 (Arm_relocate_functions::thm_abs5): New function.
11452 (Arm_relocate_functions::abs12): New function.
11453 (Arm_relocate_functions::abs16): New function.
11454 (Arm_relocate_functions::base_abs): New function.
11455 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11456 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11457 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11459 (Scan::global): Likewise.
11460 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11461 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11462 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11463 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11466 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11468 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11469 (Arm_relocate_functions::movt_prel): New function.
11470 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11471 (Arm_relocate_functions::thm_movt_prel): New function.
11472 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11473 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11474 (Scan::global, Relocate::relocate): Likewise.
11475 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11477 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11479 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11480 Incremental_checker.
11481 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11483 (class Incremental_inputs_header): New class.
11484 (Incremental_inputs_header_writer): Edit comment.
11485 (Incremental_inputs_entry): New class.
11486 (Incremental_inputs_entry_writer): Edit comment.
11487 (Sized_incremental_binary::do_find_incremental_inputs_section):
11488 Add *strtab_shndx parameter, fill it.
11489 (Sized_incremental_binary::do_check_inputs): New method.
11490 (Incremental_checker::can_incrementally_link_output_file): Use
11491 Sized_incremental_binary::check_inputs.
11492 (Incremental_inputs::report_command_line): Save command line in
11495 (Incremental_binary::find_incremental_inputs_section): New
11497 (Incremental_binary::do_find_incremental_inputs_section): Add
11498 strtab_shndx parameter.
11499 (Incremental_binary::do_check_inputs): New pure virtual method.
11500 (Sized_incremental_binary::do_check_inputs): Declare.
11501 (Incremental_checker::Incremental_checker): Add incremental_inputs
11502 parameter, use it to initialize incremental_inputs_.
11503 (Incremental_checker::incremental_inputs_): New field.
11504 (Incremental_checker::command_line): New method.
11505 (Incremental_checker::inputs): New method.
11506 (Incremental_checker::command_line_): New field.
11508 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11510 * incremental.cc: Include <cstdarg> and "target-select.h".
11511 (vexplain_no_incremental): New function.
11512 (explain_no_incremental): New function.
11513 (Incremental_binary::error): New method.
11514 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11516 (make_sized_incremental_binary): New function.
11517 (open_incremental_binary): New function.
11518 (can_incrementally_link_file): Add checks if output is ELF and has
11520 * incremental.h: Include "elfcpp_file.h" and "output.h".
11521 (Incremental_binary): New class.
11522 (Sized_incremental_binary): New class.
11523 (open_incremental_binary): Declare.
11524 * object.cc (is_elf_object): Use
11525 elfcpp::Elf_recognizer::is_elf_file.
11526 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11527 * output.h (Output_file::filesize): New method.
11529 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11531 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11533 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11534 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11536 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11538 (Arm_relocate_functions::movw_abs_nc): New function.
11539 (Arm_relocate_functions::movt_abs): New function.
11540 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11541 (Arm_relocate_functions::thm_movt_abs): New function.
11542 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11543 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11544 (Scan::global): Likewise.
11545 (Relocate::relocate): Likewise.
11546 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11548 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11550 * arm.cc (Arm_relocate_functions::got_prel) New function.
11551 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11552 (Relocate::relocate): Likewise.
11553 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11555 2009-10-06 Ian Lance Taylor <iant@google.com>
11557 * options.h (class General_options): Define
11558 split_stack_adjust_size parameter.
11559 * object.h (class Object): Add uses_split_stack_ and
11560 has_no_split_stack_ fields. Add uses_split_stack and
11561 has_no_split_stack accessor functions. Declare
11562 handle_split_stack_section.
11563 (class Reloc_symbol_changes): Define.
11564 (class Sized_relobj): Define Function_offsets. Declare
11565 split_stack_adjust, split_stack_adjust_reltype, and
11567 * object.cc (Object::handle_split_stack_section): New function.
11568 (Sized_relobj::do_layout): Call handle_split_stack_section.
11569 * dynobj.cc (Sized_dynobj::do_layout): Call
11570 handle_split_stack_section.
11571 * reloc.cc (Sized_relobj::relocate_sections): Call
11572 split_stack_adjust for executable sections in split_stack
11573 objects. Pass reloc_map to relocate_section.
11574 (Sized_relobj::split_stack_adjust): New function.
11575 (Sized_relobj::split_stack_adjust_reltype): New function.
11576 (Sized_relobj::find_functions): New function.
11577 * target-reloc.h: Include "object.h".
11578 (relocate_section): Add reloc_symbol_changes parameter. Change
11580 * target.h (class Target): Add calls_non_split method. Declare
11581 do_calls_non_split virtual method. Declare match_view and
11583 * target.cc: Include "elfcpp.h".
11584 (Target::do_calls_non_split): New function.
11585 (Target::match_view): New function.
11586 (Target::set_view_to_nop): New function.
11587 * gold.cc (queue_middle_tasks): Give an error if mixing
11588 split-stack and non-split-stack objects with -r.
11589 * i386.cc (Target_i386::relocate_section): Add
11590 reloc_symbol_changes parameter.
11591 (Target_i386::do_calls_non_split): New function.
11592 * x86_64.cc (Target_x86_64::relocate_section): Add
11593 reloc_symbol_changes parameter.
11594 (Target_x86_64::do_calls_non_split): New function.
11595 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11597 * powerpc.cc (Target_powerpc::relocate_section): Add
11598 reloc_symbol_changes parameter.
11599 * sparc.cc (Target_sparc::relocate_section): Add
11600 reloc_symbol_changes parameter.
11601 * configure.ac: Call AM_CONDITIONAL for the default target.
11602 * configure: Rebuild.
11603 * testsuite/Makefile.am (TEST_AS): New variable.
11604 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11605 (check_DATA): Add split_i386 and split_x86_64 files.
11606 (SPLIT_DEFSYMS): Define.
11607 (split_i386_[1234n].o): New targets.
11608 (split_i386_[124]): New targets.
11609 (split_i386_[1234r].stdout): New targets.
11610 (split_x86_64_[1234n].o): New targets.
11611 (split_x86_64_[124]): New targets.
11612 (split_x86_64_[1234r].stdout): New targets.
11613 (MOSTLYCLEANFILES): Add new executables.
11614 * testsuite/split_i386.sh: New file.
11615 * testsuite/split_x86_64.sh: New file.
11616 * testsuite/split_i386_1.s: New file.
11617 * testsuite/split_i386_2.s: New file.
11618 * testsuite/split_i386_3.s: New file.
11619 * testsuite/split_i386_4.s: New file.
11620 * testsuite/split_i386_n.s: New file.
11621 * testsuite/split_x86_64_1.s: New file.
11622 * testsuite/split_x86_64_2.s: New file.
11623 * testsuite/split_x86_64_3.s: New file.
11624 * testsuite/split_x86_64_4.s: New file.
11625 * testsuite/split_x86_64_n.s: New file.
11626 * testsuite/testfile.cc (Target_test): Update relocation_section
11628 * testsuite/Makefile.in: Rebuild.
11630 2009-10-06 Ian Lance Taylor <iant@google.com>
11632 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11633 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11634 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11635 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11636 the address on ldo_addrs_.
11637 (Target_i386::Relocate::fix_up_ldo): New function.
11639 2009-10-06 Rafael Espindola <espindola@google.com>
11641 * plugin.cc (add_input_library): New.
11642 (Plugin::load): Add add_input_library to tv.
11643 (Plugin_manager::add_input_file): Add the is_lib argument.
11644 (add_input_file): Update call to Plugin_manager::add_input_file.
11645 (add_input_library): New.
11646 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11648 2009-09-30 Doug Kwan <dougkwan@google.com>
11650 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11651 symbol and call Symbol::may_need_copy_reloc to determine if
11652 a copy reloc is needed.
11653 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11654 nocopyreloc is given in command line.
11655 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11656 given in command line.
11657 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11658 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11659 of the removed Target_i386::may_need_copy_reloc.
11660 * options.h (copyreloc): New option with default value false.
11661 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11662 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11663 instead of the removed Target_powerpc::may_need_copy_reloc.
11664 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11665 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11666 instead of the removed Target_sparc::may_need_copy_reloc.
11667 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11668 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11669 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11670 instead of the removed Target_x86_64::may_need_copy_reloc.
11672 2009-09-30 Ian Lance Taylor <iant@google.com>
11674 * object.h (class Object): Remove target_ field, and target,
11675 sized_target, and set_target methods.
11676 (Object::sized_target): Remove.
11677 (class Sized_relobj): Update declarations. Remove sized_target.
11678 * object.cc (Sized_relobj::setup): Remove target parameter.
11679 Change all callers.
11680 (Input_objects::add_object): Don't do anything with the target.
11681 (make_elf_sized_object): Add punconfigured parameter. Change all
11682 callers. Set or test parameter target.
11683 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11684 Change all callers.
11685 * parameters.cc (Parameters::set_target): Change parameter type to
11687 (Parameters::default_target): Remove.
11688 (set_parameters_target): Change parameter type to be non-const.
11689 (parameters_force_valid_target): New function.
11690 (parameters_clear_target): New function.
11691 * parameters.h (class Parameters): Update declarations. Remove
11692 default_target method. Add sized_target and clear_target
11693 methods. Change target_ to be non-const.
11694 (set_parameters_target): Update declaration.
11695 (parameters_force_valid_target): Declare.
11696 (parameters_clear_target): Declare.
11697 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11698 as NULL if we aren't searching.
11699 (Add_symbols::run): Don't check for compatible target.
11700 * fileread.cc (Input_file::open_binary): Call
11701 parameters_force_valid_target.
11702 * gold.cc (queue_middle_tasks): Likewise.
11703 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11704 set_target on object.
11705 * dynobj.h (class Sized_dynobj): Update declarations.
11706 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11707 make_elf_object returns NULL.
11708 (Archive::include_member): Don't check whether object target is
11710 * output.cc (Output_section::add_input_section): Get target from
11712 (Output_section::relax_input_section): Likewise.
11713 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11715 (Sized_relobj::do_scan_relocs): Likewise.
11716 (Sized_relobj::relocate_sections): Likewise.
11717 * resolve.cc (Symbol_table::resolve): Likewise.
11718 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11719 parameter. Change all callers.
11720 (Symbol_table::add_from_object): Get target from parameters.
11721 (Symbol_table::add_from_relobj): Don't check object target.
11722 (Symbol_table::add_from_dynobj): Likewise.
11723 (Symbol_table::define_special_symbol): Get target from
11725 * symtab.h (class Symbol_table): Update declaration.
11726 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11727 parameter. Change all callers. Clear parameter target.
11728 (Binary_test): Test target here.
11729 * testsuite/object_unittest.cc (gold_testsuite): Remove
11730 target_test_pointer parameter. Change all callers.
11731 (Object_test): Test target here.
11733 2009-09-26 Ian Lance Taylor <iant@google.com>
11735 * testsuite/initpri1.c: Don't try to use constructor priorities if
11736 compiling with gcc before 4.3.
11738 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11740 * testsuite/retain_symbols_file_test.sh (check_present): Change
11741 output file name to retain_symbols_file_test.stdout.
11742 (check_absent): Likewise.
11744 2009-09-18 Craig Silverstein <csilvers@google.com>
11746 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11747 * options.cc: Include <cerrno> and <fstream>.
11748 (General_options::finalize): Parse -retain-symbols-file tag.
11749 * options.h: New flag.
11750 (General_options): New method should_retain_symbol, new
11751 variable symbols_to_retain.
11752 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11753 should_retain_symbol map.
11754 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11755 * testsuite/Makefile.in: Regenerate.
11756 * testsuite/retain_symbols_file_test.sh: New file.
11758 2009-09-18 Nick Clifton <nickc@redhat.com>
11760 * po/es.po: Updated Spanish translation.
11762 2009-09-17 Doug Kwan <dougkwan@google.com>
11764 * debug.h (DEBUG_RELAXATION): New constant.
11765 (DEBUG_ALL): Add DEBUG_RELAXATION.
11766 (debug_string_to_enum): Add relaxation debug option.
11768 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11769 Layout::Relaxation_debug_check::read_sections,
11770 Layout::Relaxation_debug_check::read_sections): New method definitions.
11771 (Layout::Layout): Initialize data members
11772 record_output_section_data_from_scrips_,
11773 script_output_section_data_list_ and relaxation_debug_check_.
11774 (Layout::save_segments, Layout::restore_segments,
11775 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11776 Layout::relaxation_loop_body): New method definitions.
11777 (Layout::finalize): Support relaxation. Move section layout code to
11778 Layout::relaxation_loop_body.
11779 (Layout::set_asection_address_from_script): Move code for orphan
11780 section placement out.
11781 (Layout::place_orphan_sections_in_script): New method definition.
11782 * layout.h (Output_segment_headers, Output_file_header):
11783 New forward class declarations.
11784 (Layout::~Layout): Define.
11785 (Layout::new_output_section_data_from_script): New method definition.
11786 (Layout::place_orphan_sections_in_script): New method declaration.
11787 (Layout::Segment_states): New type declaration.
11788 (Layout::save_segments, Layout::restore_segments,
11789 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11790 Layout::relaxation_loop_body): New method declarations.
11791 (Layout::Output_section_data_list): New type declaration.
11792 (Layout::Relaxation_debug_check): New class definition.
11793 (Layout::record_output_section_data_from_script_,
11794 Layout::script_output_section_data_list_, Layout::segment_states_,
11795 Layout::relaxation_debug_check_): New data members.
11796 * output.cc: (Output_section_headers::do_size): New method definition.
11797 (Output_section_headers::Output_section_headers): Move size
11798 computation to Output_section_headers::do_size.
11799 (Output_segment_headers::do_size): New method definition.
11800 (Output_file_header::Output_file_header): Move size computation to
11801 Output_file_header::do_size and call it.
11802 (Output_file_header::do_size): New method definition.
11803 (Output_data_group::Output_data_group): Adjust call to
11804 Output_section_data.
11805 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11806 (Output_symtab_xindex::do_write): Add array bound check.
11807 (Output_section::Input_section::print_to_mapfile): Handle
11808 RELAXED_INPUT_SECTION_CODE.
11809 (Output_section::Output_section): Initialize data member checkpoint_.
11810 (Output_section::~Output_section): Delete checkpoint object pointed
11812 (Output_section::add_input_section): Always add an Input_section if
11814 (Output_section::add_merge_input_section): Add assert.
11815 (Output_section::relax_input_section): New method definition.
11816 (Output_section::set_final_data_size): Set load address to zero for
11817 an unallocated section.
11818 (Output_section::do_address_and_file_offset_have_reset_values):
11819 New method definition.
11820 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11821 Handle relaxed input section.
11822 (Output_section::sort_attached_input_sections): Checkpoint input
11823 section list lazily.
11824 (Output_section::get_input_sections): Change type of input_sections to
11825 list of Simple_input_section pointers. Checkpoint input section list
11826 lazily. Also handle relaxed input sections.
11827 (Output_section::add_input_section_for_script): Take a reference to
11828 a Simple_input_section object instead of Relobj pointer and section
11829 index as parameter. Handle relaxed input sections.
11830 (Output_section::save_states, Output_section::restore_states): New
11831 method definitions.
11832 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11833 (Output_data::is_data_size_fixed): New method definition.
11834 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11836 (Output_data::address_and_file_offset_have_reset_values): New method
11838 (Output_data::do_address_and_file_offset_have_reset_values): New method
11840 (Output_data::set_data_size): Check that data size is not fixed.
11841 (Output_data::fix_data_size): New method definition.
11842 (Output_data::is_data_size_fixed_): New data member.
11843 (Output_section_headers::set_final_data_size): New method definition.
11844 (Output_section_headers::do_size): New method declaration.
11845 (Output_segment_headers::set_final_data_size): New method definition.
11846 (Output_segment_headers::do_size): New method declaration.
11847 (Output_file_header::set_final_data_size)::New method definition.
11848 (Output_file_header::do_size)::New method declaration.
11849 (Output_section_data::Output_section_data): Add new parameter
11850 is_data_size_fixed and use it to fix data size.
11851 (Output_data_const::Output_data_const): Adjust call to base class
11852 constructor and fix data size.
11853 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11854 base class constructor and fix data size.
11855 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11856 base class constructor and fix data size.
11857 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11858 class constructor and fix data size.
11859 (Output_data_group::set_final_data_size): New method definition.
11860 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11861 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11862 class constructor and fix data size.
11863 (Output_relaxed_input_section): New class definition.
11864 (Output_section::Simple_input_section): New class definition.
11865 (Output_section::get_input_sections): Adjust parameter list.
11866 (Output_section::add_input_section_for_script): Same.
11867 (Output_section::save_states, Output_section::restore_states,
11868 Output_section::do_address_and_file_offset_have_reset_values,
11869 (Output_section::Input_section::Input_section): Handle
11870 RELAXED_INPUT_SECTION_CODE. Add new overload for
11871 Output_relaxed_input_section.
11872 (Output_section::Input_section::is_input_section,
11873 Output_section::Input_section::set_output_section): Handle relaxed
11875 (Output_section::Input_section::is_relaxed_input_section,
11876 Output_section::Input_section::output_section_data,
11877 Output_section::Input_section::relaxed_input_section): New method
11879 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11881 (Output_section::Input_section::u1_): Update comments.
11882 (Output_section::Input_section::u2_): Add new union member poris.
11883 (Output_section::Checkpoint_output_section): New classs definition.
11884 (Output_section::relax_input_section): New method declaration.
11885 (Output_section::checkpoint_): New data member.
11886 (Output_segment): Update comments.
11887 (Output_segment::Output_segment): Un-privatize copy constructor.
11888 (Output_segment::operator=): Un-privatize.
11889 * script-sections.cc (Output_section_element::Input_section_list):
11890 Change element type to Output_section::Simple_input_section.
11891 (Output_section_element_dot_assignment::set_section_addresses):
11892 Register output section data for relaxation clean up.
11893 (Output_data_exression::Output_data_expression): Adjust call to base
11894 constructor to fix data size.
11895 (Output_section_element_data::set_section_addresses): Register
11896 Output_data_expression object for relaxation clean up.
11897 (struct Input_section_info): Replace Relobj pointer and section index
11898 pair with Output_section::Simple_input_section and Convert struct to a
11900 (Input_section_sorter::operator()): Adjust access to
11901 Input_section_info data member to use accessors.
11902 (Output_section_element_input::set_section_addresses): Use layout
11903 parameter. Adjust code to use Output_section::Simple_input_section
11904 and Input_secction_info classes. Register filler for relaxation
11906 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11907 and section index pair with Output_section::Simple_input_section
11908 class. Adjust code accordingly.
11909 (Phdrs_element::release_segment): New method definition.
11910 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11912 (Script_sections::release_segments): New method definition.
11913 * gold/script-sections.h (Script_sections::release_segments): New
11914 method declaration.
11915 * gold/target.h (Target::may_relax, Target::relax,
11916 Target::do_may_relax, Target::do_relax): New method definitions.
11918 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11920 * arm.cc (has_signed_unsigned_overflow): New function.
11921 (Arm_relocate_functions::abs8): New function.
11922 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11923 (Target_arm::Scan::global): Likewise.
11924 (Target_arm::relocate::relocate): Likewise.
11925 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11928 2009-09-16 Cary Coutant <ccoutant@google.com>
11930 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11931 * testsuite/Makefile.in: Regenerate.
11933 2009-09-11 Nick Clifton <nickc@redhat.com>
11935 * po/gold.pot: Updated by the Translation project.
11937 2009-09-08 Cary Coutant <ccoutant@google.com>
11939 * output.cc (Output_file::open): Add execute permission to empty file.
11940 * testsuite/Makefile.am (permission_test): New test.
11941 * testsuite/Makefile.in: Regenerate.
11943 2009-09-02 Ian Lance Taylor <iant@google.com>
11945 * output.cc (Output_file::resize): Call map_no_anonymous rather
11948 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11950 * gold.cc: Include "incremental.h".
11951 (queue_initial_tasks): Call Incremental_checker methods.
11952 * incremental.cc: Include "output.h".
11953 (Incremental_checker::can_incrementally_link_output_file): New
11955 * incremental.h (Incremental_checker): New class.
11957 * output.cc (Output_file::open_for_modification): New method.
11958 (Output_file::map_anonymous): Changed return type to bool. Record
11959 map in base_ field.
11960 (Output_file::map_no_anonymous): New method, broken out of map.
11961 (Output_file::map): Use map_no_anonymous and map_anonymous.
11962 * output.h (class Output_file): Update declarations.
11964 2009-08-24 Cary Coutant <ccoutant@google.com>
11966 * options.h (Command_line::Pre_options): New class.
11967 (Command_line::pre_options): New member.
11968 * options.cc (gold::options::ready_to_register): New variable.
11969 (One_option::register_option): Do nothing if not registering options.
11970 Assert if same short option registered twice.
11971 (General_options::General_options): Turn off option registration when
11973 (Command_line::Pre_options::Pre_options): New constructor.
11975 2009-08-24 Cary Coutant <ccoutant@google.com>
11977 * options.h (General_options::no_keep_memory): Remove incorrect
11980 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11982 * Makefile.am (am__skiplex, am__skipyacc): New.
11983 * Makefile.in: Regenerate.
11985 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11987 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11988 (INCLUDES): ... this.
11989 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11990 (AM_CPPFLAGS): Renamed from ...
11991 (INCLUDE): ... this.
11992 * Makefile.in, testsuite/Makefile.in: Regenerate.
11994 * Makefile.in: Regenerate.
11995 * aclocal.m4: Likewise.
11996 * config.in: Likewise.
11997 * configure: Likewise.
11998 * testsuite/Makefile.in: Likewise.
12000 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12001 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12002 * Makefile.in: Regenerate.
12003 * testsuite/Makefile.in: Regenerate.
12005 2009-08-19 Cary Coutant <ccoutant@google.com>
12007 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12008 symbols in shared libraries overridden by hidden or internal symbols
12009 in the main program.
12011 2009-08-19 Chris Demetriou <cgd@google.com>
12013 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12014 checking source file names in error messages.
12016 2009-08-18 Doug Kwan <dougkwan@google.com>
12018 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12019 an elcpp::Ehdr as parameter. Adjust call to set_target.
12020 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12021 an elfcpp::Ehdr as parameter.
12022 * object.cc (Object::set_target): Remove the version that looks up
12023 a target and sets it.
12024 (Sized_relobj::setup): Take a Target object instead of
12025 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12026 (make_elf_sized_object): Find target and ask target to
12027 make an ELF object.
12028 * object.h: (Object::set_target): Remove the version that looks up
12029 a target and sets it.
12030 (Sized_relobj::setup): Take a Target object instead of
12031 an elfcpp:Ehdr as parameter.
12032 * target.cc: Include dynobj.h.
12033 (Target::do_make_elf_object_implementation): New.
12034 (Target::do_make_elf_object): New.
12035 * target.h (Target::make_elf_object): New template declaration.
12036 (Target::do_make_elf_object): New method declarations.
12037 (Target::do_make_elf_object_implementation): New template declaration.
12039 2009-08-14 Ian Lance Taylor <iant@google.com>
12041 * gold.h (FUNCTION_NAME): Define.
12042 (gold_unreachable): Use FUNCTION_NAME.
12044 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12046 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12047 symbol in the --keep-unique list is not found.
12049 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12051 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12052 been maked as --keep-unique.
12053 (Icf::unfold_section): New function.
12054 * icf.h (Icf::unfold_section): New function.
12055 * options.h (General_options::keep_unique): New option.
12056 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12057 * testsuite/Makefile.in: Regenerate.
12058 * testsuite/icf_keep_unique_test.sh: New file.
12059 * testsuite/icf_keep_unique_test.cc: New file.
12061 2009-08-12 Cary Coutant <ccoutant@google.com>
12064 * resolve.cc (Symbol_table::resolve): Check for references from
12065 dynamic objects to hidden and internal symbols.
12066 * testsuite/Makefile.am (hidden_test.sh): New test.
12067 * testsuite/Makefile.in: Regenerate.
12068 * testsuite/hidden_test.sh: New script.
12069 * testsuite/hidden_test_1.c: New test source.
12070 * testsuite/hidden_test_main.c: New test source.
12072 2009-08-11 Doug Kwan <dougkwan@google.com>
12074 * arm.cc: Update comments.
12075 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12076 segment to locate the .ARM.exidx section if present.
12078 2009-08-09 Doug Kwan <dougkwan@google.com>
12080 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12083 2009-08-07 Sriraman Tallam <tmsriram@google.com>
12084 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12087 2009-08-06 Sriraman Tallam <tmsriram@google.com>
12089 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12090 valid tls_segment only for non-debug-section relocations.
12091 * testsuite/Makefile.am: Add gc_tls_test.
12092 * testsuite/Makefile.in: Regenerate.
12093 * testsuite/gc_tls_test.cc: New file.
12094 * testsuite/gc_tls_test.sh: New file.
12096 2009-08-05 Sriraman Tallam <tmsriram@google.com>
12098 * icf.cc: New file.
12100 * Makefile.am (CCFILES): Add icf.cc.
12101 (HFILES): Add icf.h
12102 * Makefile.in: Regenerate.
12103 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12104 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12105 section, symbol and addend information for the relocs.
12106 * gold.cc (queue_middle_tasks): Call identical code folding.
12107 * gold.h: Add defines for multimap.
12108 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12109 to the call of finalize_local_symbols.
12110 * main.cc (main): Create object of class Icf.
12111 * object.cc (Sized_relobj::do_layout): Allow this function to be
12112 called twice during icf.
12113 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12114 to sections marked as identical by icf.
12115 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12117 (Sized_relobj::do_section_entsize): New function.
12118 * object.h (Object::section_entsize): New function.
12119 (Object::do_section_entsize): New pure virtual function.
12120 (Relobj::finalize_local_symbols): Add new parameter.
12121 (Relobj::do_section_entsize): New function.
12122 * options.h (General_options::icf): New option.
12123 (General_options::icf_iterations): New option.
12124 (General_options::print_icf_sections): New option.
12125 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12126 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12127 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12129 * symtab.cc (Symbol_table::is_section_folded): New function.
12130 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12131 to sections marked as identical by icf.
12132 * symtab.h (Symbol_table::set_icf): New function.
12133 (Symbol_table::icf): New function.
12134 (Symbol_table::is_section_folded): New function.
12135 (Symbol_table::icf_): New data member.
12136 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12137 * testsuite/Makefile.am: Add commands to build icf_test.
12138 * testsuite/Makefile.in: Regenerate.
12139 * testsuite/icf_test.sh: New file.
12140 * testsuite/icf_test.cc: New file.
12142 2009-07-24 Chris Demetriou <cgd@google.com>
12144 * layout.cc (is_compressible_debug_section): Fix incorrect
12145 comment about compressed section names.
12147 2009-07-20 Ian Lance Taylor <ian@airs.com>
12150 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12152 2009-07-16 Ian Lance Taylor <iant@google.com>
12155 * layout.h: #include <map>.
12156 (class Kept_section): Change from struct to class. Add accessors
12157 and setters. Add section size to Comdat_group mapping. Change
12158 Comdat_group to std::map. Add is_comdat_ field. Add
12159 linkonce_size field in union.
12160 (class Layout): Update declaration of find_or_add_kept_section.
12161 Don't declare find_kept_object.
12162 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12163 parameter. Add object, shndx, is_comdat, and is_group_name
12164 parameters. Change all callers. Adjust for new Kept_section.
12165 (Layout::find_kept_object): Remove.
12166 * object.cc (Sized_relobj::include_section_group): Update use of
12167 Kept_section. Rename secnum to shndx. Only record
12168 Kept_comdat_section if sections are the same size.
12169 (Sized_relobj::include_linkonce_section): Update use of
12170 Kept_section. Only record Kept_comdat_section if sections are the
12171 same size. Set size of linkonce section.
12172 (Sized_relobj::map_to_kept_section): Update call to
12173 get_kept_comdat_section.
12174 * object.h (class Sized_relobj): Rename fields in
12175 Kept_comdat_section to drop trailing underscores; change object
12176 field to Relobj*. Change Kept_comdat_section_table to store
12177 struct rather than pointer.
12178 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12179 Add kept_object and kept_shndx parameters. Change all callers.
12180 (Sized_relobj::get_kept_comdat_section): Change return type to
12181 bool. Add kept_object and kept_shndx parameters. Change all
12183 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12184 Layout::find_or_add_kept_section.
12186 2009-07-09 Ian Lance Taylor <iant@google.com>
12188 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12189 Reserve space in the hash table.
12191 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12193 * fileread.cc (File_read::get_mtime): New method.
12194 * fileread.h (Timespec): New structure.
12195 (File_read::get_mtime): New method.
12196 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12197 Renamed from timestamp_nsec.
12198 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12200 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
12202 (Incremental_inputs::report_archive): Save mtime; style fix.
12203 (Incremental_inputs::report_obejct): Save mtime; style fix.
12204 (Incremental_inputs::report_script): Save mtime; style fix.
12205 (Incremental_inputs::finalize_inputs): Style fix.
12206 (Incremental_inputs::finalize): Style fix.
12207 (Incremental_inputs::create_input_section_data): Store inputs
12209 * incremental.h (Incremental_inputs::report_script): Add mtime
12211 (Incremental_inputs::Input_info::Input_info): Intialize only one
12213 (Incremental_inputs::Input_info::archive): Move to nameless
12215 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12216 (Incremental_inputs::Input_info::script): Move to nameless union.
12217 (Incremental_inputs::mtime): New field.
12218 * script.cc (read_input_script): Pass file mtime to
12220 * script.h (Script_info::inputs): Style fix.
12222 2009-07-01 Ian Lance Taylor <ian@airs.com>
12224 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12227 2009-06-24 Ian Lance Taylor <iant@google.com>
12230 * layout.cc (Layout::choose_output_section): If we find an
12231 existing section, update the flags.
12232 (Layout::create_notes): New function, broken out of
12234 (Layout::finalize): Don't create note sections.
12235 (Layout::create_note): Don't crash if linker script discards
12237 (Layout::create_gold_note): Likewise.
12238 (Layout::create_build_id): Likewise. Don't set
12239 after_input_sections on the section.
12240 (Layout::create_executable_stack_info): Remove target parameter.
12242 * layout.h (class Layout): Declare create_notes. Update
12243 declaration of create_executable_stack_info.
12244 * gold.cc (queue_middle_tasks): Call create_notes.
12245 * output.cc (Output_section::update_flags_for_input_section): Move
12246 here from output.h. If SHF_ALLOC flag is newly set, mark address
12248 * output.h (Output_data::mark_address_invalid): New function.
12249 (class Output_section): Only declare, not define,
12250 update_flags_for_input_section. Remove set_flags.
12252 2009-06-24 Ian Lance Taylor <iant@google.com>
12254 * script-sections.cc (Output_section_definition::
12255 set_section_addresses): Rename shadowing local load_address to
12258 2009-06-24 Ian Lance Taylor <iant@google.com>
12261 * reloc.cc (relocate_sections): Skip empty relocation sections.
12263 2009-06-23 Ian Lance Taylor <iant@google.com>
12266 * layout.cc (Layout::create_note): Use choose_output_section
12267 rather than make_output_section.
12269 2009-06-23 Ian Lance Taylor <iant@google.com>
12272 * options.cc (General_options::parse_V): Set printed_version_.
12273 (General_options::General_options): Initialize printed_version_.
12274 * options.h (class General_options): Add printed_version_ field.
12275 * gold.cc (queue_initial_tasks): If there are no input files,
12276 don't give a fatal error if we printed the version information.
12277 (queue_middle_tasks): If using -r with a shared object, give a
12278 fatal error rather than an ordinary error.
12280 2009-06-23 Ian Lance Taylor <iant@google.com>
12283 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12284 (Layout::make_output_section): Set have_stabstr_section_ if we see
12285 a .stab*str section.
12286 (Layout::finalize): Call link_stabs_sections.
12287 (Layout::link_stabs_sections): New file.
12288 * layout.h (class Layout): Add have_stabstr_section_ field.
12289 Declare link_stabs_sections.
12291 2009-06-23 Doug Kwan <dougkwan@google.com>
12293 * Makefile.am (libgold_a_LIBADD): New.
12294 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
12295 * Makefile.in: Regenerate.
12296 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12297 * configure: Regenerate.
12298 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12299 * fileread.cc: Include sys/state.h
12300 * gold.h: Declare memmem and strndup if found missing.
12301 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12303 2009-06-23 Ian Lance Taylor <iant@google.com>
12305 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12306 * configure: Rebuild.
12308 2009-06-23 Ian Lance Taylor <iant@google.com>
12311 * object.cc (Object::section_contents): Don't try to get a view if
12312 the section has length zero.
12313 (Object::handle_gnu_warning_section): If the section is empty, use
12314 the name of the section as the warning.
12316 2009-06-23 Ian Lance Taylor <iant@google.com>
12319 * stringpool.h (class Stringpool_template): Add optimize_ field.
12320 (Stringpool_template::set_optimize): New function.
12321 * stringpool.cc (Stringpool_template::Stringpool_template):
12322 Initialize optimize_ field.
12323 (Stringpool_template::set_string_offsets): Test local optimize
12324 fild rather than parameter.
12325 * layout.cc (Layout::Layout): Call set_optimize on the section
12328 2009-06-22 Ian Lance Taylor <iant@google.com>
12331 * yyscript.y: Parse TARGET.
12332 * script.cc (script_set_target): New function.
12333 * script-c.h (script_set_target): Declare.
12334 * options.cc (General_options::string_to_object_format): Rename
12335 from string_to_object_format in anonymous namespace. Change
12337 * options.h (class General_options): Declare
12338 string_to_object_format.
12340 2009-06-22 Ian Lance Taylor <iant@google.com>
12342 * script-sections.cc (Script_sections::create_segments): Don't put
12343 program headers in a PT_LOAD segment if -n or -N.
12345 2009-06-22 Ian Lance Taylor <iant@google.com>
12348 * options.h (class General_options): Add -z lazy and -z now. Sort
12349 -z options into alphabetical order.
12350 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12352 2009-06-21 Ian Lance Taylor <iant@google.com>
12354 * layout.cc (Layout::make_output_section): Call
12355 Target::new_output_section.
12356 (Layout::attach_allocated_section_to_segment): Put large section
12357 sections in a separate load segment with the large segment flag
12359 (Layout::segment_precedes): Sort large data segments after other
12361 (align_file_offset): New static function.
12362 (Layout::set_segment_offsets): Use align_file_offset.
12363 * output.h (class Output_section): Add is_small_section_ and
12364 is_large_section_ fields.
12365 (Output_section::is_small_section): New function.
12366 (Output_section::set_is_small_section): New function.
12367 (Output_section::is_large_section): New function.
12368 (Output_section::set_is_large_section): New function.
12369 (Output_section::is_large_data_section): New function.
12370 (class Output_segment): Add is_large_data_segment_ field.
12371 (Output_segment::is_large_data_segment): New function.
12372 (Output_segment::set_is_large_data_segment): New function.
12373 * output.cc (Output_section::Output_section): Initialize new
12375 (Output_segment::Output_segment): Likewise.
12376 (Output_segment::add_output_section): Add assertion that large
12377 data sections always go in large data segments. Force small data
12378 sections to the end of the list of data sections. Force small BSS
12379 sections to the start of the list of BSS sections. For large BSS
12380 sections to the end of the list of BSS sections.
12381 * symtab.h (class Symbol): Declare is_common_shndx.
12382 (Symbol::is_defined): Check Symbol::is_common_shndx.
12383 (Symbol::is_common): Likewise.
12384 (class Symbol_table): Define enum Commons_section_type. Update
12385 declarations. Add small_commons_ and large_commons_ fields.
12386 * symtab.cc (Symbol::is_common_shndx): New function.
12387 (Symbol_table::Symbol_table): Initialize new fields.
12388 (Symbol_table::add_from_object): Put small and large common
12389 symbols in the right list.
12390 (Symbol_table::sized_finalized_symbol): Check
12391 Symbol::is_common_shndx.
12392 (Symbol_table::sized_write_globals): Likewise.
12393 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12394 common symbol lists. Don't call do_allocate_commons_list if the
12396 (Symbol_table::do_allocate_commons_list): Remove is_tls
12397 parameter. Add comons_section_type parameter. Change all
12398 callers. Handle small and large common symbols.
12399 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12400 Symbol::is_common_shndx.
12401 * resolve.cc (symbol_to_bits): Likewise.
12402 * target.h (Target::small_common_shndx): New function.
12403 (Target::small_common_section_flags): New function.
12404 (Target::large_common_shndx): New function.
12405 (Target::large_common_section_flags): New function.
12406 (Target::new_output_section): New function.
12407 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12408 small_common_section_flags, and large_common_section_flags
12410 (Target::do_new_output_section): New virtual function.
12411 * arm.cc (Target_arm::arm_info): Initialize new fields.
12412 * i386.cc (Target_i386::i386_info): Likewise.
12413 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12415 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12416 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12417 (Target_x86_64::do_new_output_section): New function.
12418 * configure.ac: Define conditional MCMODEL_MEDIUM.
12419 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12420 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12421 (large_LDFLAGS): Define.
12422 * testsuite/large.c: New file.
12423 * testsuite/testfile.cc (Target_test::test_target_info):
12424 Initialize new fields.
12425 * configure, testsuite/Makefile.in: Rebuild.
12427 2009-06-05 Doug Kwan <dougkwan@google.com>
12429 * Makefile.am (CCFILES): Add target.cc.
12430 * Makefile.in: Regenerate.
12431 * i386.cc (class Target_i386): Define new virtual method to
12432 override do_is_local_label_name in parent.
12433 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12434 local symbols if --discard-locals or -X is given.
12435 * options.h (class General_options): Declare new options
12436 '--discard-locals' and '-X' for discarding locals.
12437 * target.h (class Target): Define new methods is_local_label_name.
12438 Declare new virtual method do_is_local_label_name.
12439 * target.cc: New file.
12440 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12441 (check_SCRIPTS): Add discard_locals_test.sh.
12442 (check_DATA): Add discard_local_tests.syms.
12443 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12444 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12445 * testsuite/Makefile.in: Regenerate.
12446 * testsuite/discard_locals_test.c: New file.
12447 * testsuite/discard_locals_test.sh: Same.
12449 2009-06-05 Doug Kwan <dougkwan@google.com>
12451 * object.cc (Sized_relobj::Sized_relobj): Initialize
12452 discarded_eh_frame_shndx_ to -1U.
12453 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12455 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12456 a discarded .eh_frame section.
12457 (Sized_relobj::do_finalize_local_symbols): Ditto.
12458 * object.h (class Sized_relobj): Declare new member
12459 discarded_eh_frame_shndx_.
12460 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12461 (local_labels_test.o, local_labels_test): New rules.
12462 * testsuite/Makefile.in: Regenerate.
12464 2009-06-04 Doug Kwan <dougkwan@google.com>
12466 * layout.cc (Layout::section_name_mapping): Add mapping for
12467 special ARM sections.
12469 2009-06-03 Doug Kwan <dougkwan@google.com>
12471 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12472 (utils::has_overflow): Same.
12474 2009-06-03 Ian Lance Taylor <iant@google.com>
12476 * layout.cc (Layout::section_name_mapping): New array, replacing
12477 Layout::linkonce_mapping.
12478 (Layout::section_name_mapping_count): New variable, replacing
12479 Layout::linkonce_mapping_count.
12480 (Layout::linkonce_output_name): Remove.
12481 (Layout::output_section_name): Rewrite.
12482 * layout.h (class Layout): Rename Linkonce_mapping to
12483 Section_name_mapping, linkonce_mapping to section_name_mapping,
12484 linkonce_mapping_count to section_name_mapping_count. Don't
12485 declare linkonce_output_name.
12487 2009-06-03 Doug Kwan <dougkwan@google.com>
12489 * gold/arm.cc (namespace utils): New.
12490 (Target_arm::reloc_is_non_pic): Define new method.
12491 (class Arm_relocate_functions): New.
12492 (Target_arm::Relocate::relocate): Handle relocation types used by
12495 2009-06-03 Ian Lance Taylor <iant@google.com>
12497 * arm.cc (Target_arm::scan::global): Use || instead of |.
12499 2009-06-02 Doug Kwan <dougkwan@google.com>
12501 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12502 issued_non_pic_error_.
12503 (class Target_arm::Scan): Declare new method check_non_pic.
12504 Define new method symbol_needs_plt_entry.
12505 Declare new data member issued_non_pic_error_.
12506 (class Target_arm::Relocate): Declare new method
12507 should_apply_static_reloc.
12508 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12509 (Target_arm::Scan::check_non_pic): Define new method.
12510 (Target_arm::Scan::local): Handle a small subset of reloc types used
12512 (Target_arm::Scan::local): Same.
12513 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12515 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12517 * incremental.cc (Incremental_inputs::report_command_line): Filter
12518 out --incremental-* options.
12520 2009-05-29 Doug Kwan <dougkwan@google.com>
12522 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12524 (class Target_arm): Update comment.
12525 (Target_arm::Target_arm): Initialize new data members GOT_,
12526 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12527 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12528 and Target_arm::rel_dyn_section.
12529 Declare new_enum Target_arm::Got_type.
12530 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12532 Update commments for member do_dynsym_value.
12533 (Target_arm::got_size, Target_arm::plt_section,
12534 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12535 new methods inside class defintion.
12536 (Target_arm::got_section): Define new method.
12537 (Target_arm::rel_dyn_section): Same.
12538 (Output_data_plt_arm): New template class.
12539 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12540 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12541 (Output_data_plt_arm::add_entry): Same.
12542 (Output_data_plt_arm::first_plt_entry): Define new
12543 static data member for PLT instruction template.
12544 (Output_data_plt_arm::plt_entry): Same.
12545 (Output_data_plt_arm::do_write): Define new method.
12546 (Target_arm::make_plt_entry): Same.
12547 (Target_arm::do_finalize_sections): Same.
12548 (Target_arm::do_dynsym_value): Same.
12550 2009-05-28 Doug Kwan <dougkwan@google.com>
12552 * Makefile.am (TARGETSOURCES): Add arm.cc.
12553 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12554 * Makefile.in: Regenerate.
12555 * arm.cc: New file.
12556 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12558 2009-05-26 Doug Kwan <dougkwan@google.com>
12560 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12561 (General_options::check_excluded_libs): Strip off directories in
12562 archive name before matching like GNU ld does.
12563 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12564 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12565 (exclude_libs_test_LDFLAGS): Add linker option
12566 -Wl,--exclude-libs,libexclude_libs_test_3
12567 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12568 an explicit archive without using -l.
12569 (alt/libexclude_libs_test_3.a): New make rule.
12570 * testsuite/Makefile.in: Regenerate.
12571 * testsuite/exclude_libs_test.c : Declare lib3_default().
12573 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12574 * exclude_libs_test_3.c: New file.
12576 2009-05-26 Nick Clifton <nickc@redhat.com>
12578 * po/id.po: New Indonesian translation.
12579 * po/gold.pot: Updated template file.
12581 2009-05-22 Sriraman Tallam <tmsriram@google.com>
12583 * testsuite/Makefile.am: Add -ffunction-sections to compile
12584 gc_comdat_test files. Add -Wl,--gc-sections to build
12586 * testsuite/Makefile.in: Regenerate.
12587 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12589 2009-05-21 Sriraman Tallam <tmsriram@google.com>
12591 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12592 kept comdat section was garbage collected.
12593 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12594 * testsuite/Makefile.in: Regenerate.
12595 * testsuite/gc_comdat_test.sh: New file.
12596 * testsuite/gc_comdat_test_1.cc: New file.
12597 * testsuite/gc_comdat_test_2.cc: New file.
12599 2009-05-19 Doug Kwan <dougkwan@google.com>
12601 * archive.cc (Archive::Archive): Move constructor from archive.h
12602 to here. Initialize no_export_.
12603 (Archive::get_elf_object_for_member): Set no_export flag of object.
12604 * archive.h (Archive::Archive): Move constructor body to
12606 (Archive::no_export): New method.
12607 (Archive::no_export_): New field.
12608 * object.h (Object::Object): Initialize no_export_ to false.
12609 (Object::no_export, Object::set_no_export): New methods.
12610 (Object::no_export_): New field.
12611 * options.cc (General_options::parse_exclude_libs): New method.
12612 (General_options::check_excluded_libs) Same.
12613 * options.h (exclude_libs): New option.
12614 (General_options::check_excluded_libs): New method declaration.
12615 (General_options::excluded_libs_): New field.
12616 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12617 default or protected visibility if an object has no-export flag set.
12618 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12619 (check_SCRIPTS): Add exclude_libs_test.sh.
12620 (check_DATA): Add exclude_libs_test.syms.
12621 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12622 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12623 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12624 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12625 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12626 libexclude_libs_test_2.a): New rules.
12627 * testsuite/Makefile.in: Regenerate.
12628 * testsuite/exclude_libs_test.c: New file.
12629 * testsuite/exclude_libs_test.sh: Ditto.
12630 * testsuite/exclude_libs_test_1.c: Ditto.
12631 * testsuite/exclude_libs_test_2.c: Ditto.
12633 2009-05-15 Ian Lance Taylor <iant@google.com>
12635 * configure.ac: Check for declarations for cases where libiberty.h
12636 checks HAVE_DECL_xxx.
12637 * configure, config.in: Rebuild.
12639 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12641 * gold.h (Incremental_argument_list): Remove (invalid) forward
12643 * incremental.cc (Incremental_inputs::report_achive): New method.
12644 (Incremental_inputs::report_object): New method.
12645 (Incremental_inputs::report_script): New method.
12646 (Incremental_inputs::finalize_inputs): New method.
12647 (Incremental_inputs::finalize): Call finalize_inputs().
12648 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12649 Create inputs entries.
12650 * incremental.h (Incremental_input_type): New enum.
12651 (Incremental_inputs::Incremental_input): Initialize new fields.
12652 (Incremental_inputs::report_inputs): New method.
12653 (Incremental_inputs::report_achive): New method.
12654 (Incremental_inputs::report_object): New method.
12655 (Incremental_inputs::report_script): New method.
12656 (Incremental_inputs::finalize_inputs): New method.
12657 (Incremental_inputs::Input_info): New struct.
12658 (Incremental_inputs::Input_info_map): New typedef.
12659 (Incremental_inputs::lock_): New field.
12660 (Incremental_inputs::Inputs_): New field.
12661 (Incremental_inputs::Inputs_map): New field.
12662 * main.cc (main): Call Incremental_input::report_inputs.
12663 * options.h (Input_argument_list): Typedef moved from
12665 (Input_file_group::Files): Remove, use ::Input_argument_list.
12666 (Input_file_group::Input_argument_list): Remove, use
12667 ::Input_argument_list.
12668 * plugin.cc (Plugin_manager::add_input_file): Add error in
12670 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12672 * script.cc (read_input_script): Call
12673 Incremental_input::report_script.
12674 * script.h (Script_info): New class.
12676 2009-04-27 Ian Lance Taylor <iant@google.com>
12678 * x86_64.cc (do_adjust_output_section): Set entsize to
12681 2009-04-23 Elliott Hughes <enh@google.com>
12683 * output.cc (Output_file::close): After short writes, continue
12684 writing from the correct offset in the buffer being written.
12686 2009-04-23 Chris Demetriou <cgd@google.com>
12688 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12689 * configure: Regenerate.
12690 * config.in: Regenerate.
12691 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12692 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12694 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12696 * incremental.cc (Incremental_inputs_header_data): Renamed from
12697 Incremental_input_header_data.
12698 (Incremental_inputs_header_data::data_size): New field.
12699 (Incremental_inputs_header_data::put_input_file_count): Renamed
12700 from input_file_count.
12701 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12702 from command_line_offset.
12703 (Incremental_inputs_header_data::put_reserved): Renamed from
12705 (Incremental_inputs_entry_data): Renamed from
12706 Incremental_input_entry_data.
12707 (Incremental_inputs_entry_data::data_size): New field.
12708 (Incremental_inputs::report_command_line): New method.
12709 (Incremental_inputs::finalize): New method.
12710 (Incremental_inputs::create_incremental_inputs_data): New method.
12711 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12712 * incremental.h: New file.
12713 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
12714 (Layout::finalize): Create incremental inputs section in
12715 incremental builds.
12716 (Layout::create_incremental_info_sections): New method.
12717 * layout.h (Layout::incremental_inputs): New method.
12718 (Layout::create_incremental_info_sections): New method.
12719 (Layout::incremental_inputs_): New field.
12720 * main.cc (main): Notify Incremental_input of the command line.
12722 2009-04-01 Ian Lance Taylor <iant@google.com>
12723 Mikolaj Zalewski <mikolajz@google.com>
12725 * gold.h (reserve_unordered_map): Define, three versions, one for
12726 each version of Unordered_map.
12727 * layout.cc (Layout::Layout): Remove options parameter. Add
12728 number_of_input_files parameter. Don't initialize options_.
12729 Initialize number_of_input_files_ and resized_signatures_. Move
12730 sections_are_attached_.
12731 (Layout::layout_group): Reserve space for group_signatures_.
12732 (Layout::find_or_add_kept_section): Change name parameter to be a
12733 reference. Resize signatures_ map when it gets large enough.
12734 (Layout::layout_eh_frame): Use parameters->options() instead of
12736 (Layout::make_output_section): Likewise.
12737 (Layout::attach_allocated_section_to_segment): Likewise.
12738 (Layout::finalize, Layout::create_executable_stack): Likewise.
12739 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12740 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12741 * layout.h (class Layout): Update declarations. Remove options_
12742 field. Add number_of_input_files_ and resized_signatures_
12743 fields. Move sections_are_attached_ field.
12744 * main.cc (main): Pass number of input files to Layout
12745 constructor. Don't pass options.
12747 2009-03-30 Ian Lance Taylor <iant@google.com>
12749 * ffsll.c (ffsll): Correct implementation.
12751 2009-03-27 Ian Lance Taylor <iant@google.com>
12753 * ffsll.c: New file.
12754 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12755 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12756 * ftruncate.c (ftruncate): Declare before definition.
12757 * mremap.c (mremap): Likewise.
12758 * pread.c (pread): Likewise.
12759 * configure, Makefile.in, config.in: Rebuild.
12761 * mremap.c: New file.
12762 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12763 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12764 (mremap): Declare if HAVE_MREMAP is not defined.
12765 * configure, Makefile.in, config.in: Rebuild.
12767 2009-03-27 Cary Coutant <ccoutant@google.com>
12769 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12770 position independent.
12771 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12772 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12774 2009-03-24 Cary Coutant <ccoutant@google.com>
12776 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12778 (needs_dynamic_reloc): Likewise.
12780 2009-03-24 Ian Lance Taylor <iant@google.com>
12782 * yyscript.y (file_cmd): Recognize EXTERN.
12783 (extern_name_list, extern_name_list_body): New nonterminals.
12784 * script.cc (script_add_extern): Define.
12785 * script-c.h (script_add_extern): Declare.
12787 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
12789 * object.cc (is_elf_object): Define.
12790 * object.h (is_elf_object): Declare.
12791 * archive.cc (Archive::get_elf_object_for_member): Call
12793 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
12795 2009-03-24 Elliott Hughes <enh@google.com>
12797 * output.cc (Output_file::map_anonymous): Define.
12798 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12799 try an anonymous one. Report the size if the mmap fails.
12800 * output.h (class Output_file): Declare map_anonymous.
12802 2009-03-24 Ian Lance Taylor <iant@google.com>
12804 * target-select.cc (instantiate_target): Don't acquire the lock if
12805 the instantiated_target_ field has already been set.
12807 2009-03-23 Ian Lance Taylor <iant@google.com>
12809 * gold-threads.h (class Initialize_lock): Define.
12810 * gold-threads.cc (class Initialize_lock_once): Define.
12811 (initialize_lock_control): New static variable.
12812 (initialize_lock_pointer): New static variable.
12813 (initialize_lock_once): New static function.
12814 (Initialize_lock::Initialize_lock): Define.
12815 (Initialize_lock::initialize): Define.
12816 * target-select.h: Include "gold-threads.h".
12817 (class Target_selector): Add lock_ and initialize_lock_ fields.
12818 Don't define instantiate_target, just declare it.
12819 * target-select.cc (Target_selector::Target_selector): Initialize
12821 (Target_selector::instantiate_target): Define.
12822 * descriptors.h: Include "gold-threads.h".
12823 (class Descriptors): Add initialize_lock_ field.
12824 * descriptors.cc (Descriptors::Descriptors): Initialize new
12826 (Descriptors::open): Use initialize_lock_ field
12827 * errors.h (class Errors): Add initialize_lock_ field.
12828 * errors.cc (Errors::Errors): Initialize new field.
12829 (Errors::initialize_lock): Use initialize_lock_ field.
12830 * powerpc.cc (class Target_selector_powerpc): Remove
12831 instantiated_target_ field. In do_recognize call
12832 instantiate_target rather than do_instantiate_target. In
12833 do_instantiate_target just allocate a new target.
12834 * sparc.cc (class Target_selector_sparc): Likewise.
12836 * freebsd.h: New file.
12837 * i386.cc: Include "freebsd.h".
12838 (Target_i386): Derive from Target_freebsd rather than
12840 (Target_selector_i386): Derive from Target_selector_freebsd rather
12841 than Target_selector.
12842 * x86_64.cc: Include "freebsd.h".
12843 (Target_x86_64): Derive from Target_freebsd rather than
12845 (Target_selector_x86_64): Derive from Target_selector_freebsd
12846 rather than Target_selector.
12847 * target.h (class Target): Add adjust_elf_header and
12848 do_adjust_elf_header.
12849 * output.cc (Output_file_header:: do_sized_write): Call target
12850 adjust_elf_header routine.
12851 * configure.tgt: Set targ_osabi.
12852 * configure.ac: Define GOLD_DEFAULT_OSABI.
12853 * parameters.cc (Parameters::default_target): Pass
12854 GOLD_DEFAULT_OSABI to select_target.
12855 * target-select.h (class Target_selector): Make instantiate_target
12856 protected rather than private.
12857 * Makefile.am (HFILES): Add freebsd.h.
12858 * configure, Makefile.in, config.in: Rebuild.
12860 * merge.cc (do_add_input_section): Correct pend value. Change
12861 message about last entry not being null terminated from error to
12864 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12866 * incremental.cc: New file.
12867 * Makefile.am (CCFILES): Add incremental.cc.
12868 * Makefile.in: Rebuild.
12870 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12872 * layout.cc (Layout::output_section_name): Preserve names
12873 of '.note.' sections.
12875 2009-03-19 Ian Lance Taylor <iant@google.com>
12877 * descriptors.cc (Descriptors::open): Check that the options are
12878 valid before using them.
12880 2009-03-18 Ian Lance Taylor <iant@google.com>
12882 * script-sections.h: Include <list>.
12883 (class Script_sections): Change Sections_elements from std::vector
12884 to std::list. Typedef public Elements_iterator. Add
12885 orphan_section_placement_, data_segment_align_start_, and
12886 saw_data_segment_align_ fields. Remove data_segment_align_index_
12888 * script-sections.cc (class Orphan_section_placement): New class.
12889 (class Sections_element): Add virtual functions is_relro and
12890 orphan_section_init. Remove virtual function place_orphan_here.
12891 (class Output_section_definition): Add is_relro and
12892 orphan_section_init. Remove place_orphan_here.
12893 (class Orphan_output_section): Likewise.
12894 (Script_sections::Script_sections): Update for field changes.
12895 (Script_sections::data_segment_align): Set saw_data_segment_align_
12896 and data_segment_align_start_, not data_segment_align_index.
12897 (Script_sections::data_segment_relro_end): Check
12898 saw_data_segment_align_. Use data_segment_align_start_ rather
12899 than data_segment_align_index_.
12900 (Script_sections::place_orphan): Rewrite to use
12901 Orphan_section_placement.
12903 2009-03-17 Ian Lance Taylor <iant@google.com>
12905 * archive.cc (Archive::add_symbols): Check for a version attached
12906 to the symbol name in the archive map.
12907 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12908 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12909 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12910 (ver_test_11.a): New target.
12911 * testsuite/Makefile.in: Rebuild.
12913 * configure.ac: Check for chsize and posix_fallocate. Replace
12915 * ftruncate.c: New file, from gnulib.
12916 * output.cc (posix_fallocate): Define dummy version if not
12917 HAVE_POSIX_FALLOCATE.
12918 (Output_file::map): Call posix_fallocate rather than lseek and
12920 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12921 * configure, Makefile.in, config.in: Rebuild.
12923 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
12925 * layout.h (Layout::create_note): Add section_name parameter.
12926 * layout.cc (Layout::create_note): Likewise.
12927 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
12929 2009-03-17 Ian Lance Taylor <iant@google.com>
12931 * descriptors.cc: Include "options.h".
12932 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12933 (Descriptors::open): Always use O_CLOEXEC when opening a new
12934 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12935 then set FD_CLOEXEC.
12937 * sparc.cc (class Target_sparc): Add has_got_section.
12938 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12939 make sure we have a GOT section.
12941 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12942 (Target_sparc::Scan::local): Likewise.
12943 (Target_sparc::Scan::global): Likewise.
12944 (Target_sparc::Relocate::relocate): Likewise.
12945 (Target_sparc::Relocate::relocate_tls): Likewise.
12947 * symtab.cc (Symbol_table::define_default_version): New function,
12948 broken out of add_from_object.
12949 (Symbol_table::add_from_object): Call define_default_version.
12950 (Symbol_table::define_special_symbol): Add resolve_oldsym
12951 parameter. Change all callers. If the version for a symbol comes
12952 from a version script, resolve it with the symbol with the same
12953 name with no version. Also add the symbol without a version if
12955 (do_define_in_output_data): If resolving with oldsym, don't delete
12957 (do_define_in_output_segment): Likewise.
12958 (do_define_as_constant): Likewise.
12959 * symtab.h (class Symbol_table): Update declarations.
12961 2009-03-13 Ian Lance Taylor <iant@google.com>
12963 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12964 (Read_symbols::requeue): New function.
12965 (Read_symbols::do_read_symbols): If make_elf_object fails because
12966 the target type is not configured, and the file was searched for,
12967 issue a warning and retry with the next directory.
12968 (Add_symbols::run): If the file has an incompatible format, and
12969 it was searched for, requeue the Read_symbols task. On error,
12970 release the object.
12971 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12972 dirindex parameter to constructor. Change all callers. Declare
12973 incompatible_warning and requeue.
12974 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12975 input_argument_ and input_group_ fields. Add them to
12976 constructor. Change all callers.
12977 (class Read_script): Add dirindex_ field. Add it to constructor.
12978 Change all callers.
12979 * archive.cc (Archive::setup): Remove input_objects parameter.
12980 Change all callers.
12981 (Archive::get_file_and_offset): Likewise.
12982 (Archive::read_all_symbols): Likewise.
12983 (Archive::read_symbols): Likewise.
12984 (Archive::get_elf_object_for_member): Remove input_objects
12985 parameter. Add punconfigured parameter. Change all callers.
12986 (Archive::add_symbols): Change return type to bool. Check return
12987 value of include_member.
12988 (Archive::include_all_members): Likewise.
12989 (Archive::include_member): Change return type to bool. Return
12990 false if first included object has incompatible target. Set
12991 included_member_ field.
12992 (Add_archive_symbols::run): If add_symbols returns false, requeue
12994 * archive.h (class Archive): Add included_member_ field.
12995 Initialize it in constructor. Add input_file and searched_for
12996 methods. Update declarations.
12997 (class Add_archive_symbols): Add dirpath_, dirindex_, and
12998 input_argument_ fields. Add them to constructor. Change all
13000 * script.cc: Include "target-select.h".
13001 (class Parser_closure): Add skip_on_incompatible_target_ and
13002 found_incompatible_target_ fields. Add
13003 skip_on_incompatible_target parameter to constructor. Change all
13004 callers. Add methods skip_on_incompatible_target,
13005 clear_skip_on_incompatible_target, found_incompatible_target, and
13006 set_found_incompatible_target.
13007 (read_input_script): Add dirindex parameter. Change all callers.
13008 If parser finds an incompatible target, requeue Read_symbols
13010 (script_set_symbol): Clear skip_on_incompatible_target in
13012 (script_add_assertion, script_parse_option): Likewise.
13013 (script_start_sections, script_add_phdr): Likewise.
13014 (script_check_output_format): New function.
13015 * script.h (read_input_script): Update declaration.
13016 * script-c.h (script_check_output_format): Declare.
13017 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13018 (ignore_cmd): Remove OUTPUT_FORMAT.
13019 * fileread.cc (Input_file::Input_file): Add explicit this.
13020 (Input_file::will_search_for): New function.
13021 (Input_file::open): Add pindex parameter. Change all callers.
13022 * fileread.h (class Input_file): Add input_file_argument method.
13023 Declare will_search_for. Update declarations.
13024 * object.cc (make_elf_object): Add punconfigured parameter.
13025 Change all callers.
13026 * object.h (class Object): Make input_file public. Add
13027 searched_for method.
13028 (make_elf_object): Update declaration.
13029 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13031 * dirsearch.h (class Dirsearch): Update declaration.
13032 * options.h (class General_options): Add --warn-search-mismatch.
13033 * parameters.cc (Parameters::is_compatible_target): New function.
13034 * parameters.h (class Parameters): Declare is_compatible_target.
13035 * workqueue.cc (Workqueue::add_blocker): New function.
13036 * workqueue.h (class Workqueue): Declare add_blocker.
13038 * fileread.cc (Input_file::open): Remove options parameter.
13039 Change all callers.
13040 (Input_file::open_binary): Likewise.
13041 * script.cc (read_input_script): Likewise.
13042 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13043 options parameter from constructor. Change all callers.
13044 (class Read_script): Likewise.
13045 * fileread.h (class Input_file): Update declarations.
13046 * script.h (read_input_script): Update declaration.
13048 2009-03-10 Nick Clifton <nickc@redhat.com>
13050 * po/es.po: New Spanish translation.
13052 2009-03-06 Cary Coutant <ccoutant@google.com>
13054 * options.cc (parse_short_option): Keep dash_z from registering itself.
13056 2009-03-03 Ian Lance Taylor <iant@google.com>
13059 * target-reloc.h (relocate_section): Pass output_section to
13061 * i386.cc (Target_i386::should_apply_static_reloc): Add
13062 output_section parameter. Change all callers.
13063 (Target_i386::Relocate::relocate): Add output_section parameter.
13064 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13065 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13066 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13067 * testsuite/two_file_shared.sh: New script.
13068 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13069 (check_DATA): Add two_file_shared.dbg.
13070 (two_file_shared.dbg): New target.
13071 * testsuite/Makefile.in: Rebuild.
13073 2009-03-01 Ian Lance Taylor <iant@google.com>
13075 * configure.ac: Check for byteswap.h.
13076 * configure: Rebuild.
13077 * config.in: Rebuild.
13079 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13081 * layout.cc (Layout::find_or_add_kept_section): New function.
13082 (Layout::add_comdat): Removed.
13083 * layout.h (struct Kept_section): Move out of class Layout.
13084 Remove trailing underscores from field names. Add group_sections
13085 field. Rename group_ field to is_group. Change all uses.
13086 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13087 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13088 comdat_groups_ field.
13089 (Sized_relobj::include_section_group): Use
13090 find_or_add_kept_section and Kept_section::group_sections.
13091 (Sized_relobj::include_linkonce_section): Likewise.
13092 * object.cc (class Sized_relobj): Don't define Comdat_group or
13093 Comdat_group_table. Remove find_comdat_group and
13094 add_comdat_group. Remove comdat_groups_ field.
13095 * plugin.cc (include_comdat_group): Use
13096 Layout::find_or_add_kept_section.
13098 2009-02-28 Ian Lance Taylor <iant@google.com>
13100 * README: --gc-sections and map files are now supported. Document
13101 some build requirements.
13104 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13105 relocatable link set the value of the section symbol to zero.
13106 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13107 relocatable link don't include the section address in the local
13110 2009-02-27 Ian Lance Taylor <iant@google.com>
13113 * options.h (class Search_directory): Add is_system_directory.
13114 (class General_options): Declare is_in_system_directory.
13115 * options.cc (get_relative_sysroot): Make static.
13116 (get_default_sysroot): Make static.
13117 (General_optoins::is_in_system_directory): New function.
13118 * fileread.cc (Input_file::is_in_system_directory): New function.
13119 * fileread.h (class Input_file): Declare is_in_system_directory.
13120 * object.h (class Object): Add is_in_system_directory.
13121 (class Input_objects): Remove system_library_directory_ field.
13122 * object.cc (Input_objects::add_object): Don't set
13123 system_library_directory_.
13124 (input_objects::found_in_system_library_directory): Remove.
13125 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13126 parameter. Change all callers.
13127 (Symbol_table::sized_write_globals): Likewise.
13128 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13129 Call Object::is_in_system_directory.
13130 * symtab.h (class Symbol_table): Update declarations.
13133 * descriptors.h (Open_descriptor): Add is_on_stack field.
13134 * descriptors.cc (Descriptors::open): If the descriptor is on the
13135 top of the stack, remove it. Initialize is_on_stack field.
13136 (Descriptors::release): Only add pod to stack if it is not on the
13138 (Descriptors::close_some_descriptor): Clear stack_next and
13139 is_on_stack fields.
13142 * output.cc (Output_section::find_starting_output_address): Rename
13143 from starting_output_address; add PADDR parameter; change return
13145 * output.h (class Output_section): Declare
13146 find_starting_output_address instead of starting_output_address.
13147 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13148 section symbol for which we can't find a merge section.
13151 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13152 hidden or internal, force the symbol to be local.
13153 * resolve.cc (Symbol::override_visibility): Define.
13154 (Symbol::override_base): Use override_visibility.
13155 (Symbol_table::resolve): Likewise.
13156 (Symbol::override_base_with_special): Likewise.
13157 (Symbol_table::override_with_special): If the visibility is hidden
13158 or internal, force the symbol to be local.
13159 * symtab.h (class Symbol): Add set_visibility and
13160 override_visibility.
13161 * testsuite/ver_test_1.sh: New file.
13162 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13163 (check_DATA): Add ver_test_1.syms.
13164 (ver_test_1.syms): New target.
13165 * testsuite/Makefile.in: Rebuild.
13167 2009-02-25 Cary Coutant <ccoutant@google.com>
13169 * layout.cc (Layout::choose_output_section): Don't rename sections
13170 when using a linker script that has a SECTIONS clause.
13171 * Makefile.in: Regenerate.
13173 * testsuite/Makefile.am (script_test_5.sh): New test case.
13174 * testsuite/Makefile.in: Regenerate.
13175 * testsuite/script_test_5.cc: New file.
13176 * testsuite/script_test_5.sh: New file.
13177 * testsuite/script_test_5.t: New file.
13179 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
13181 * archive.cc (Archive::include_member): Update calls to add_symbols.
13182 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13183 the Layout argument.
13184 * dynobj.h (do_add_symbols): Add the Layout argument.
13185 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13187 * object.h (Object::add_symbols): Add the Layout argument.
13188 (Object::do_add_symbols): Add the Layout argument.
13189 (Sized_relobj::do_add_symbols): Add the Layout argument.
13190 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13191 Unify the two versions.
13192 (Add_plugin_symbols): Remove.
13193 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13194 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13195 (Add_plugin_symbols): Remove.
13196 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13197 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13198 (Add_symbols::run): Make it work with Pulginobj.
13200 2009-02-06 Ian Lance Taylor <iant@google.com>
13202 * object.cc (Sized_relobj::do_layout): Make info message start
13203 with lower case letter.
13205 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13207 * binary.cc: Fix file comment.
13209 * options.h (enum Incremental_disposition): Define.
13210 (class General_options): Add new options: --incremental,
13211 --incremental_changed, --incremental_unchanged,
13212 --incremental_unknown. Add incremental_disposition_ and
13213 implicit_incremental_ fields.
13214 (General_options::incremental_disposition): New function.
13215 (class Position_dependent_options): Add incremental_disposition
13217 (Position_dependent_options::copy_from_options): Set incremental
13219 * options.cc (General_options::parse_incremental_changed): New
13221 (General_options::parse_incremental_unchanged): New function.
13222 (General_options::parse_incremental_unknown): New function.
13223 (General_options::General_options): Initialize new fields
13224 incremental_disposition_ and implicit_incremental_.
13225 (General_options::finalize): Check for uasge of --incremental-*
13226 without --incremental.
13228 2009-02-06 Chris Demetriou <cgd@google.com>
13230 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13231 pointer and to report location as the file name associated with
13233 (gold_undefined_symbol_at_location): New function to replace the
13234 old gold_undefined_symbol functionality.
13235 * target-reloc.h (relocate_section): Update to use
13236 gold_undefined_symbol_at_location.
13237 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13238 Call gold_undefined_symbol function rather than gold_error.
13239 * errors.h (Errors::undefined_symbol): Take location as a
13240 string, rather than calculating it from a relocation.
13241 * errors.cc (Errors::fatal): Print "fatal error:" before the
13243 (Errors::error, Errors::error_at_location): Print "error: "
13244 before the formatted message.
13245 (Errors::undefined_symbol): Take location as a string, rather
13246 than calculating it from a relocation.
13247 (gold_undefined_symbol_at_location): New function akin to
13248 old gold_undefined_symbol, calculates location from relocation.
13249 (gold_undefined_symbol): Change to take only a Symbol pointer
13250 and to report location as the file name associated with the symbol.
13251 * testsuite/debug_msg.sh: Update for changed error messages.
13252 * testsuite/undef_symbol.sh: Likewise.
13254 2009-02-04 Duncan Sands <baldrick@free.fr>
13257 * reduced_debug_output.h
13258 (Output_reduced_debug_abbrev_section::failed): Use format for
13260 (Output_reduced_debug_info_section::faild): Likewise.
13262 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13264 * script.cc (Lazy_demangler): New class.
13265 (Version_script_info::get_symbol_version_helper): Demangle a
13268 2009-01-29 Cary Coutant <ccoutant@google.com>
13270 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13272 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13274 2009-01-28 Ian Lance Taylor <iant@google.com>
13276 * version.cc (version_string): Bump to 1.9.
13278 * gold.h: Include <cstring> and <stdint.h>.
13279 * version.cc: Include <cstdio>.
13280 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13282 * reduced_debug_output.cc (insert_into_vector): Rename from
13283 Insert_into_vector; change all callers. Use Swap_unaligned to
13284 avoid aliasing issue; remove union since it is unnecessary.
13286 2009-01-27 Sriraman Tallam <tmsriram@google.com>
13288 * Makefile.am (CCFILES): Add gc.cc.
13289 (HFILES): Add gc.h.
13290 * Makefile.in: Regenerate.
13291 * gold.cc (Gc_runner): New class.
13292 (queue_initial_tasks): Call garbage collection related tasks
13293 when corresponding options are invoked.
13294 (queue_middle_gc_tasks): New function.
13295 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13296 processed early before laying out sections during garbage collection.
13297 * gold.h (queue_middle_gc_tasks): New function.
13298 (is_prefix_of): Move from "layout.cc".
13299 * i386.cc (Target_i386::gc_process_relocs): New function.
13300 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13301 * main.cc (main): Create object of class "Garbage_collection".
13302 * object.cc (Relobj::copy_symbols_data): New function.
13303 (Relobj::is_section_name_included): New function.
13304 (Sized_relobj::do_layout): Allow this function to be called twice
13305 during garbage collection and defer layout of section during the
13307 * object.h (Relobj::get_symbols_data): New function.
13308 (Relobj::is_section_name_included): New function.
13309 (Relobj::copy_symbols_data): New function.
13310 (Relobj::set_symbols_data): New function.
13311 (Relobj::get_relocs_data): New function.
13312 (Relobj::set_relocs_data): New function.
13313 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13314 (Relobj::gc_process_relocs): New function.
13315 (Relobj::do_gc_process_relocs): New pure virtual function.
13316 (Relobj::sd_): New data member.
13317 (Sized_relobj::is_output_section_offset_invalid): New function.
13318 (Sized_relobj::do_gc_process_relocs): New function.
13319 * options.h (General_options::gc_sections): Modify to not be a no-op.
13320 (General_options::print_gc_sections): New option.
13321 * plugin.cc (Plugin_finish::run): Remove function call to
13322 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13323 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13324 * reloc.cc (Read_relocs::run): Add task to process relocs and
13325 determine unreferenced sections when doing garbage collection.
13326 (Gc_process_relocs): New class.
13327 (Sized_relobj::do_gc_process_relocs): New function.
13328 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13329 sections that are garbage collected.
13330 * reloc.h (Gc_process_relocs): New class.
13331 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13332 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13333 symbols whose corresponding sections are garbage collected.
13334 (Symbol_table::Symbol_table): Add new parameter for the garbage
13336 (Symbol_table::gc_mark_undef_symbols): New function.
13337 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13338 (Symbol_table::gc_mark_dyn_syms): New function.
13339 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13341 (Symbol_table::add_from_object): Likewise.
13342 (Symbol_table::add_from_relobj): When building shared objects, do not
13343 treat externally visible symbols as garbage.
13344 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13345 table information for static and relocatable links.
13346 * symtab.h (Symbol_table::set_gc): New function.
13347 (Symbol_table::gc): New function.
13348 (Symbol_table::gc_mark_undef_symbols): New function.
13349 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13350 (Symbol_table::gc_mark_dyn_syms): New function.
13351 (Symbol_table::gc_): New data member.
13352 * target.h (Sized_target::gc_process_relocs): New pure virtual
13354 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13355 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13357 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13359 * options.h (General_options::gc_sections): Define as a no-op for now.
13360 (General_options::no_keep_memory): Ditto.
13361 (General_options::Bshareable): Define.
13362 * options.cc (General_options::finalize): Honor -Bshareable.
13364 2009-01-20 Andreas Schwab <schwab@suse.de>
13366 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13367 read the value in the contents, since we don't use it. Use the
13368 template endianness when writing.
13369 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13371 2009-01-19 Andreas Schwab <schwab@suse.de>
13373 * configure.tgt (powerpc64-*): Fix targ_obj.
13375 2009-01-15 Ian Lance Taylor <iant@google.com>
13377 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13378 local symbols when stripping all symbols.
13380 2009-01-14 Cary Coutant <ccoutant@google.com>
13382 * output.cc (Output_reloc): Add explicit instantiations.
13384 2009-01-14 Cary Coutant <ccoutant@google.com>
13386 * archive.cc (Archive::get_elf_object_for_member): Remove call
13387 to File_read::claim_for_plugin.
13388 * descriptors.cc (Descriptors::open): Remove reference to
13390 (Descriptors::claim_for_plugin): Remove.
13391 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13392 (Descriptors::is_claimed): Remove.
13393 (claim_descriptor_for_plugin): Remove.
13394 * fileread.cc (File_read::claim_for_plugin): Remove.
13395 * fileread.h (File_read::claim_for_plugin): Remove.
13396 (File_read::descriptor): Reopen descriptor if necessary.
13397 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13398 (Plugin_manager::all_symbols_read): Add task parameter. Change
13400 (Plugin_manager::get_input_file): New function.
13401 (Plugin_manager::release_input_file): New function.
13402 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13403 corresponding data member.
13404 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13405 and pass to base constructor. Change all callers.
13406 (get_input_file, release_input_file): New functions.
13407 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13408 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13409 (Plugin_manager::all_symbols_read): Add task parameter.
13410 (Plugin_manager::get_input_file): New function.
13411 (Plugin_manager::release_input_file): New function.
13412 (Plugin_manager::task_): New data member.
13413 (Pluginobj::Pluginobj): Add filesize parameter.
13414 (Pluginobj::filename): New function.
13415 (Pluginobj::descriptor): New function.
13416 (Pluginobj::filesize): New function.
13417 (Pluginobj::filesize_): New data member.
13418 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13419 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13420 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13422 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13423 with archive libraries.
13424 * testsuite/Makefile.in: Regenerate.
13425 * testsuite/plugin_test.c (struct sym_info): New type.
13426 (get_input_file, release_input_file): New static variables.
13427 (onload): Capture new transfer vector entries.
13428 (claim_file_hook): Stop reading at end of file according to filesize.
13429 Factor out parsing of readelf output into separate function.
13430 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13431 APIs and get the source file name from the symbol table. Convert
13432 source file name to corresponding object file name. Print info
13433 message when adding new input files.
13434 (parse_readelf_line): New function.
13435 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13436 * testsuite/plugin_test_2.sh: Likewise.
13437 * testsuite/plugin_test_3.sh: Likewise.
13438 * testsuite/plugin_test_4.sh: New test case.
13440 2009-01-07 Ian Lance Taylor <iant@google.com>
13442 * version.cc (version_string): Bump to 1.8.
13444 2008-12-23 Cary Coutant <ccoutant@google.com>
13446 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13447 * plugin.cc (Plugin_manager::finish): Rename as
13448 layout_deferred_objects. Move cleanup to separate function.
13449 (Plugin_manager::cleanup): New function.
13450 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13452 * plugin.h (Plugin_manager::finish): Rename as
13453 layout_deferred_objects.
13454 (Plugin_manager::cleanup): New function.
13455 (Plugin_manager::cleanup_done): New field.
13457 2008-12-23 Cary Coutant <ccoutant@google.com>
13459 * plugin.cc (is_visible_from_outside): New function.
13460 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13461 so we don't return "IR only" status for exported symbols or -r links.
13463 * testsuite/Makefile.am (plugin_test_3): New test case.
13464 * testsuite/Makefile.in: Regenerate.
13465 * testsuite/plugin_test_3.sh: New file.
13467 2008-12-22 Cary Coutant <ccoutant@google.com>
13469 * object.cc (Sized_relobj::layout_section): New function.
13470 (Sized_relobj::do_layout): Defer layout of input sections until after
13471 plugin has provided replacement files.
13472 (Sized_relobj::do_layout_deferred_sections): New function.
13473 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13474 (Relobj::layout_deferred_sections): New function.
13475 (Relobj::do_layout_deferred_sections): New function.
13476 (Sized_relobj::do_layout_deferred_sections): New function.
13477 (Sized_relobj::layout_section): New function.
13478 (Sized_relobj::Deferred_layout): New structure.
13479 (Sized_relobj::deferred_layout_): New field.
13480 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13481 Change all callers. Layout deferred sections.
13482 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13484 (Plugin_hook::run): Move code from do_plugin_hook inline.
13485 (Plugin_hook::do_plugin_hook): Remove.
13486 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13487 (Plugin_manager::finish): Renamed, was cleanup.
13488 (Plugin_manager::should_defer_layout): New function.
13489 (Plugin_manager::add_deferred_layout_object): New function.
13490 (Plugin_manager::Deferred_layout_list): New type.
13491 (Plugin_manager::deferred_layout_objects_): New field.
13492 (Plugin_hook::do_plugin_hook): Remove.
13494 2008-12-17 Ian Lance Taylor <iant@google.com>
13496 * options.h (class General_options): Add --no case for
13499 2008-12-16 Cary Coutant <ccoutant@google.com>
13501 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13503 (Plugin_manager::claim_file): Create plugin object even if
13504 plugin did not call the add_symbols callback.
13505 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13506 asking for more symbols than were added.
13507 * testsuite/Makefile.am (plugin_test_1): Add test case with
13509 (empty.syms): New target.
13510 * testsuite/Makefile.in: Regenerate.
13511 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13512 message. Don't call add_symbols if no globals.
13513 (all_symbols_read_hook): Don't provide replacement for empty
13516 2008-12-12 Ian Lance Taylor <iant@google.com>
13518 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13519 r_type == 0 for a local symbol with r_sym == 0.
13520 (scan_relocatable_relocs): Pass r_sym to
13521 local_non_section_strategy.
13522 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13525 * configure.ac: Update test for TLS descriptors: they are
13526 supported as of glibc 2.9.
13527 * configure: Rebuild.
13529 2008-12-11 Ian Lance Taylor <iant@google.com>
13532 * target-reloc.h (Default_scan_relocatable_relocs): For each
13533 function, map r_type == 0 to RELOC_DISCARD.
13535 2008-12-10 Cary Coutant <ccoutant@google.com>
13537 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13538 object to override a kept COMDAT group from a plugin object.
13540 2008-12-09 Ian Lance Taylor <iant@google.com>
13543 * yyscript.y (file_cmd): Handle INPUT.
13545 * testsuite/initpri1.c: Change all declarations to be full
13546 prototypes by adding void, to avoid compiler warnings.
13548 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
13550 * options.cc (General_options::parse_plugin_opt): New.
13551 (General_options::add_plugin): The argument now is just the filename.
13552 (General_options::add_plugin_option): New.
13553 * options.h (plugin_opt): New.
13554 (add_plugin): Change argument name.
13555 (add_plugin_option): New.
13556 * plugin.cc (Plugin::load): Don't parse the plugin option.
13557 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13558 (Plugin::add_option): New.
13559 (Plugin::args_): Change type.
13560 (Plugin::filename_): New.
13561 (Plugin_manager::add_plugin_option): New.
13562 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13563 * testsuite/Makefile.in: Regenerate.
13565 2008-12-05 Cary Coutant <ccoutant@google.com>
13567 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13568 Handle --strip-lto-sections option.
13569 * options.h (strip_lto_sections): New option.
13571 2008-12-01 Cary Coutant <ccoutant@google.com>
13573 * plugin.cc (ld_plugin_message): Change format parameter to const.
13574 Fix mismatch between new[] and delete.
13576 2008-11-14 Cary Coutant <ccoutant@google.com>
13578 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13581 2008-11-05 Craig Silverstein <csilvers@google.com>
13583 * options.cc (General_options::parse_dynamic_list): New function.
13584 * options.h (General_options): New flags dynamic_list,
13585 dynamic_list_data, dynamic_list_cpp_new, and
13586 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13587 (General_options::in_dynamic_list): New function.
13588 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13589 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13590 (Lex::can_continue_name): Likewise.
13592 (read_script_file): New parameter script_options.
13593 (read_dynamic_list): New function.
13594 (Script_options::define_dynamic_list): New function.
13595 (dynamic_list_keyword_parsecodes): New variable.
13596 (dynamic_list_keywords): New variable.
13597 * script.h (Script_options::define_dynamic_list): New function
13599 (read_dynamic_list): New function prototype.
13600 * symtab.cc (strprefix): New macro.
13601 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13602 dynamic_list_data, dynamic_list_cpp_new, and
13603 dynamic_list_cpp_typeinfo.
13604 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13605 (dynamic_list_expr): New rule.
13606 (dynamic_list_nodes): Likewise.
13607 (dynamic_list_node): Likewise.
13608 * testsuite/Makefile.am (dynamic_list): New test.
13609 * testsuite/Makefile.in: Regenerated.
13610 * testsuite/dynamic_list.t: New file.
13611 * testsuite/dynamic_list.sh: New file.
13613 2008-11-05 Craig Silverstein <csilvers@google.com>
13615 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13616 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13617 (t11_last): Likewise.
13618 * testsuite/ver_test_6.c (main): Likewise.
13620 2008-10-07 Cary Coutant <ccoutant@google.com>
13622 * options.c (General_options::finalize): Add check for -static and
13624 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13627 2008-10-02 Cary Coutant <ccoutant@google.com>
13629 * plugin.cc (make_sized_plugin_object): Fix conditional
13630 compilation to work when not all targets are enabled.
13632 2008-09-29 Cary Coutant <ccoutant@google.com>
13634 * archive.cc (Archive::get_file_and_offset): Use filename instead
13635 of name to get library path.
13636 (Archive::include_member): Unlock external member of a thin archive.
13638 * testsuite/Makefile.am (TEST_AR): New variable.
13639 (thin_archive_test_1): New test.
13640 (thin_archive_test_2): New test.
13641 * testsuite/Makefile.in: Regenerate.
13642 * testsuite/thin_archive_main.cc: New file.
13643 * testsuite/thin_archive_test_1.cc: New file.
13644 * testsuite/thin_archive_test_2.cc: New file.
13645 * testsuite/thin_archive_test_3.cc: New file.
13646 * testsuite/thin_archive_test_4.cc: New file.
13648 2008-09-29 Cary Coutant <ccoutant@google.com>
13650 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13651 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13653 (Sized_relobj::do_finalize_local_symbols): Likewise.
13654 (Sized_relobj::map_to_kept_section): Likewise.
13655 * object.h (Sized_relobj::invalid_address): New constant.
13656 (Sized_relobj::do_output_section_offset): Check for invalid_address
13658 * output.cc (Output_reloc::local_section_offset): Use constant
13659 invalid_address instead of -1U.
13660 (Output_reloc::get_address): Likewise.
13661 (Output_section::output_address): Change -1U to -1ULL.
13662 * output.h (Output_reloc::invalid_address): New constant.
13663 * reloc.cc (Sized_relobj::write_sections): Use constant
13664 invalid_address instead of -1U.
13665 (Sized_relobj::relocate_sections): Likewise.
13666 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13667 values for merge sections.
13668 * target-reloc.h (relocate_for_relocatable): Use constant
13669 invalid_address instead of -1U.
13671 2008-09-19 Cary Coutant <ccoutant@google.com>
13673 Add plugin functionality for link-time optimization (LTO).
13674 * configure.ac (plugins): Add --enable-plugins option.
13675 * configure: Regenerate.
13676 * config.in: Regenerate.
13677 * Makefile.am (LIBDL): New variable.
13678 (CCFILES): Add plugin.cc.
13679 (HFILES): Add plugin.h.
13680 (ldadd_var): Add LIBDL.
13681 * Makefile.in: Regenerate.
13683 * archive.cc: Include "plugin.h".
13684 (Archive::setup): Don't preread archive symbols when using a plugin.
13685 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13686 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13688 (Archive::include_member): Add symbols from plugin objects.
13689 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13690 * descriptors.cc (Descriptors::open): Check for file descriptors
13691 abandoned by plugins.
13692 (Descriptors::claim_for_plugin): New function.
13693 * descriptors.h (Descriptors::claim_for_plugin): New function.
13694 (Open_descriptor::is_claimed): New field.
13695 (claim_descriptor_for_plugin): New function.
13696 * fileread.cc (File_read::claim_for_plugin): New function.
13697 * fileread.h (File_read::claim_for_plugin): New function.
13698 (File_read::descriptor): New function.
13699 * gold.cc: Include "plugin.h".
13700 (queue_initial_tasks): Add task to call plugin hooks for generating
13702 * main.cc: Include "plugin.h".
13703 (main): Load plugin libraries.
13704 * object.h (Pluginobj): Declare.
13705 (Object::pluginobj): New function.
13706 (Object::do_pluginobj): New function.
13707 (Object::set_target): New function.
13708 * options.cc: Include "plugin.h".
13709 (General_options::parse_plugin): New function.
13710 (General_options::General_options): Initialize plugins_ field.
13711 (General_options::add_plugin): New function.
13712 * options.h (Plugin_manager): Declare.
13713 (General_options): Add --plugin option.
13714 (General_options::has_plugins): New function.
13715 (General_options::plugins): New function.
13716 (General_options::add_plugin): New function.
13717 (General_options::plugins_): New field.
13718 * plugin.cc: New file.
13719 * plugin.h: New file.
13720 * readsyms.cc: Include "plugin.h".
13721 (Read_symbols::do_read_symbols): Check for archive before checking
13722 for ELF file. Call plugin hooks to claim files.
13723 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13724 from a real object file; force override when processing replacement
13726 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13727 (Symbol::init_base_object): Likewise.
13728 (Symbol::init_base_output_data): Likewise.
13729 (Symbol::init_base_output_segment): Likewise.
13730 (Symbol::init_base_constant): Likewise.
13731 (Symbol::init_base_undefined): Likewise.
13732 (Symbol::output_section): Assert that object is not a plugin.
13733 (Symbol_table::add_from_pluginobj): New function.
13734 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13736 (Symbol_table::sized_write_globals): Likewise.
13737 (Symbol_table::add_from_pluginobj): Instantiate template.
13738 * symtab.h (Sized_pluginobj): Declare.
13739 (Symbol::in_real_elf): New function.
13740 (Symbol::set_in_real_elf): New function.
13741 (Symbol::in_real_elf_): New field.
13742 (Symbol_table::add_from_pluginobj): New function.
13744 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13745 (LIBDL): New variable.
13746 (LDADD): Add LIBDL.
13747 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13748 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13749 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13750 (MOSTLYCLEANFILES): Likewise.
13751 * testsuite/Makefile.in: Regenerate.
13752 * testsuite/plugin_test.c: New file.
13753 * testsuite/plugin_test_1.sh: New file.
13754 * testsuite/plugin_test_2.sh: New file.
13756 2008-09-16 Ian Lance Taylor <iant@google.com>
13758 * target-reloc.h (relocate_section): Check whether a symbol is
13759 defined by the ABI before reporting an undefined symbol error.
13760 * target.h (Target::is_defined_by_abi): Make parameter const.
13761 (Target::do_is_defined_by_abi): Likewise.
13762 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13763 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13764 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13765 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13766 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13767 * testsuite/Makefile.in: Rebuild.
13769 * fileread.cc (make_view): Add casts to avoid warning.
13771 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13773 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13774 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13776 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13778 * options.h (General_options::output_is_executable): New.
13779 (General_options::output_is_pie): New.
13780 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13781 for shared libraries.
13782 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13784 2008-09-11 Chris Demetriou <cgd@google.com>
13786 * options.h (origin): New -z option.
13787 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13788 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13791 2008-09-05 Cary Coutant <ccoutant@google.com>
13793 * fileread.cc (File_read::make_view): Add check for attempt to map
13794 beyond end of file.
13796 2008-09-05 Cary Coutant <ccoutant@google.com>
13798 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13799 explicit instantiations.
13801 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13804 * options.cc (General_options::finalize): Allow undefined symbols
13805 in shlibs if linking -shared.
13808 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13809 symbols as not needing a dynsym entry.
13811 2008-08-20 Craig Silverstein <csilvers@google.com>
13813 * fileread.cc (File_read::open): Do not lock the file unless it
13814 was successfully opened.
13816 2008-08-14 Cary Coutant <ccoutant@google.com>
13818 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13819 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13820 * testsuite/tls_test.cc (struct int128): 128-bit struct
13821 for testing TLS relocs with non-zero addend.
13822 (v12): New TLS variable.
13824 (t_last): Add check for v12.
13825 * testsuite/tls_test.h (t12): New function.
13826 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13828 2008-08-13 Ian Lance Taylor <iant@google.com>
13830 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13831 set tls_segment_ or relro_segment_.
13832 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13834 * output.h (Output_section::clear_is_relro): New function.
13835 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13836 sections specially even when output_data_ is empty.
13837 (Output_segment::maximum_alignment): When first section is relro,
13838 only force alignment for PT_LOAD segments.
13839 * script.cc (script_data_segment_align): New function.
13840 (script_data_segment_relro_end): New function.
13841 * script-c.h (script_data_segment_align): Declare.
13842 (script_data_segment_relro_end): Declare.
13843 * script-sections.h (class Script_sections): Declare
13844 data_segment_align and data_segment_relro_end. Add fields
13845 segment_align_index_ and saw_relro_end_.
13846 * script-sections.cc (class Sections_element): Add set_is_relro
13847 virtual function. Add new bool* parameter to place_orphan_here.
13848 Add get_output_section virtual function.
13849 (class Output_section_definition): Add set_is_relro. Add new
13850 bool* parameter to place_orphan_here. Add get_output_section.
13851 Add is_relro_ field.
13852 (Output_section_definition::Output_section_definition): Initialize
13853 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13854 and is_relro_ fields.
13855 (Output_section_definition::place_orphan_here): Add is_relro
13857 (Output_section_definition::set_section_addresses): Set relro for
13859 (Output_section_definition::alternate_constraint): Likewise.
13860 (class Orphan_output_section): Add new bool* parameter to
13861 place_orphan_here. Add get_output_section.
13862 (Orphan_output_section::place_orphan_here): Add is_relro
13864 (Script_sections::Script_sections): Initialize
13865 data_segment_align_index_ and saw_relro_end_.
13866 (Script_sections::data_segment_align): New function.
13867 (Script_sections::data_segment_relro_end): New function.
13868 (Script_sections::place_orphan): Set or clear is_relro.
13869 (Script_sections::set_section_addresses): Force alignment of first
13871 * yyscript.y (exp): Call script_data_segment_align and
13872 script_data_segment_relro_end.
13873 * testsuite/relro_script_test.t: New file.
13874 * testsuite/relro_test.cc (using_script): Declare.
13875 (t1, t2): Test using_script.
13876 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13877 (relro_script_test_SOURCES): Define.
13878 (relro_script_test_DEPENDENCIES): Define.
13879 (relro_script_test_LDFLAGS): Define.
13880 (relro_script_test_LDADD): Define.
13881 (relro_script_test.so): New target.
13882 * testsuite/Makefile.in: Rebuild.
13884 2008-08-06 Cary Coutant <ccoutant@google.com>
13886 * archive.cc (Archive::total_archives, Archive::total_members)
13887 (Archive::total_members_loaded): New variables.
13888 (Archive::setup): Add parameter. Add option to preread
13890 (Archive::read_armap): Add counter.
13891 (Archive::get_file_and_offset): New function.
13892 (Archive::get_elf_object_for_member): New function.
13893 (Archive::read_all_symbols): New function.
13894 (Archive::read_symbols): New function.
13895 (Archive::add_symbols): Add counters.
13896 (Archive::include_all_members): Use armap to find members if it's
13898 (Archive::include_member): Skip reading symbols if already read.
13899 Factored code into Archive::get_file_and_offset and
13900 Archive::get_elf_object_for_member. Changed call to
13901 Mapfile::report_include_archive_member.
13902 (Archive::print_stats): New function.
13903 * archive.h: Declare Object and Read_symbols_data classes.
13904 (Archive::Archive): Add initializers for new members.
13905 (Archive::setup): Add parameter.
13906 (Archive::print_stats): New function.
13907 (Archive::total_archives, Archive::total_members)
13908 (Archive::total_members_loaded): New variables.
13909 (Archive::get_file_and_offset): New function.
13910 (Archive::get_elf_object_for_member): New function.
13911 (Archive::read_all_symbols): New function.
13912 (Archive::read_symbols): New function.
13913 (Archive::Archive_member): New class.
13914 (Archive::members_): New member.
13915 (Archive::num_members_): New member.
13916 * main.cc: Include archive.h.
13917 (main): Call Archive::print_stats.
13918 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13919 archive parameter; member_name is now the fully-decorated name.
13920 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13921 * options.h: (General_options): Add --preread-archive-symbols option.
13922 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13925 2008-08-04 Ian Lance Taylor <iant@google.com>
13927 * symtab.h (Symbol::use_plt_offset): New function.
13928 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13929 * powerpc.cc (Relocate::relocate): Likewise.
13930 * sparc.cc (Relocate::relocate): Likewise.
13931 * x86_64.cc (Relocate::relocate): Likewise.
13932 * testsuite/weak_plt.sh: New test.
13933 * testsuite/weak_plt_main.cc: New test.
13934 * testsuite/weak_plt_shared.cc: New test.
13935 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13936 (check_PROGRAMS): Add weak_plt.
13937 (check_DATA): Add weak_plt_shared.so.
13938 (weak_plt_main_pic.o, weak_plt): New targets.
13939 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13940 * testsuite/Makefile.in: Rebuild.
13942 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13944 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13945 * testsuite/Makefile.in: Rebuild.
13947 2008-08-04 Alan Modra <amodra@bigpond.net.au>
13949 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13950 * Makefile.in: Regenerate.
13951 * po/POTFILES.in: Regenerate.
13953 2008-07-29 Ian Lance Taylor <iant@google.com>
13955 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13956 symbols before other symbols.
13957 * testsuite/script_test_2.cc (test_addr): Declare.
13958 (test_addr_alias): Declare.
13959 (main): Check that test_addr and test_addr_alias have the right
13961 * testsuite/script_test_2.t: Define test_addr_alias and
13964 2008-07-24 Ian Lance Taylor <iant@google.com>
13967 * descriptors.cc: New file.
13968 * descriptors.h: New file.
13969 * gold-threads.h (class Hold_optional_lock): New class.
13970 * fileread.cc: Include "descriptors.h".
13971 (File_read::~File_read): Release descriptor rather than closing
13973 (File_read::open) [file]: Call open_descriptor rather than open.
13974 Set is_descriptor_opened_.
13975 (File_read::open) [memory]: Assert that descriptor is not open.
13976 (File_read::reopen_descriptor): New function.
13977 (File_read::release): Release descriptor.
13978 (File_read::do_read): Make non-const. Reopen descriptor.
13979 (File_read::read): Make non-const.
13980 (File_read::make_view): Reopen descriptor.
13981 (File_read::do_readv): Likewise.
13982 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13983 Update declarations.
13984 * layout.cc: Include "descriptors.h".
13985 (Layout::create_build_id): Use open_descriptor rather than open.
13986 * output.cc: Include "descriptors.h".
13987 (Output_file::open): Use open_descriptor rather than open.
13988 * archive.cc (Archive::const_iterator): Change Archive to be
13990 (Archive::begin, Archive::end): Make non-const.
13991 (Archive::count_members): Likewise.
13992 * archive.h (class Archive): Update declarations.
13993 * object.h (Object::read): Make non-const.
13994 * Makefile.am (CCFILES): Add descriptors.cc.
13995 (HFILES): Add descriptors.h.
13996 * Makefile.in: Rebuild.
13999 * gold.h: Always include <clocale>. Add Solaris workarounds
14000 following code in binutils/sysdep.h.
14003 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14004 this->eh_frame_hdr_ is NULL before using it.
14006 * dynobj.cc (Versions::Versions): Update comment.
14008 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14009 the base version name.
14011 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14012 array size plus one.
14013 (Stringpool_template::set_string_offsets): Subtract one from key
14014 before using it as an array index.
14015 (Stringpool_template::get_offset_with_length): Likewise.
14016 (Stringpool_template::write_to_buffer): Likewise.
14017 * stringpool.h (Stringpool_template::get_offset_from_key):
14020 2008-07-23 Ian Lance Taylor <iant@google.com>
14023 * object.h (Merged_symbol_value::value): Do our best to handle a
14027 * script.cc (Version_script_info::get_versions): Don't add empty
14028 version tag to return value.
14029 (Version_script_info::get_symbol_version_helper): Change return
14030 type to bool. Add pversion parameter. Change all callers.
14031 (script_register_vers_node): Don't require a non-NULL tag.
14032 * script.h (class Version_script_info): Update declarations.
14033 (Version_script_info::get_symbol_version): Change return type to
14034 bool. Add version parameter. Change all callers.
14035 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14036 handling. Handle an empty version from a version script.
14037 (Symbol_table::define_special_symbol): Likewise.
14038 * testsuite/ver_test_10.script: New file.
14039 * testsuite/ver_test_10.sh: New file.
14040 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14041 (check_DATA): Add ver_test_10.syms.
14042 (ver_test_10.syms, ver_test_10.so): New target.
14043 * testsuite/Makefile.in: Rebuild.
14045 2008-07-23 Simon Baldwin <simonb@google.com>
14047 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14048 to zero for undefined symbols from dynamic libraries.
14050 2008-07-23 Ian Lance Taylor <iant@google.com>
14052 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14053 Change all callers.
14054 * symtab.h (class Symbol_table): Update declaration.
14055 * testsuite/ver_test_9.cc: New file.
14056 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14057 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14058 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14059 (ver_test_9.so, ver_test_9.o): New targets.
14060 * testsuite/Makefile.in: Rebuild.
14062 2008-07-22 Ian Lance Taylor <iant@google.com>
14064 * options.h (class General_options): Define --check-sections.
14065 * layout.cc (Layout::set_segment_offsets): Handle
14068 * options.h (class General_options): Define -n/--nmagic and
14070 * options.cc (General_options::finalize): For -n/--nmagic or
14071 -N/--omagic, set -static.
14072 * layout.cc (Layout::attach_allocated_section_to_segment): If
14073 -N/--omagic, don't put read-only and read-write sections in
14074 different segments.
14075 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14076 finding a read-only segment.
14077 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14078 don't set the minimum segment alignment to the common page size,
14079 and don't set the file offset to the address modulo the page size.
14080 * script-sections.cc (Script_sections::create_segments): If
14081 -n/--omagic, don't put read-only and read-write sections in
14082 different segments.
14084 * cref.cc: New file.
14085 * cref.h: New file.
14086 * options.h (class General_options): Add --print-symbol-counts.
14087 * main.cc (main): Issue defined symbol report if requested.
14088 * archive.cc (Archive::interpret_header): Make into a const member
14090 (Archive::add_symbols): Call Input_objects::archive_start and
14092 (Archive::const_iterator): Define new class.
14093 (Archive::begin, Archive::end): New functions.
14094 (Archive::include_all_members): Rewrite to use iterator.
14095 (Archive::count_members): New function.
14096 * archive.h (class Archive): Update declarations.
14097 (Archive::filename): New function.
14098 * object.cc: Include "cref.h".
14099 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14100 (Sized_relobj::do_get_global_symbol_counts): New function.
14101 (Input_objects::add_object): Add object to cross-referencer.
14102 (Input_objects::archive_start): New function.
14103 (Input_objects::archive_stop): New function.
14104 (Input_objects::print_symbol_counts): New function.
14105 * object.h: Declare Cref and Archive.
14106 (Object::get_global_symbol_counts): New function.
14107 (Object::do_get_global_symbol_counts): New pure virtual function.
14108 (class Sized_relobj): Add defined_count_ field. Update
14110 (class Input_objects): Add cref_ field. Update constructor.
14111 Update declarations.
14112 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14114 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14116 (Sized_dynobj::do_get_global_symbol_counts): New function.
14117 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14118 defined_count_. Update declarations. Define Symbols typedef.
14119 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14120 parameter. Change all callers.
14121 (Symbol_table::add_from_dynobj): Add sympointers and defined
14122 parameters. Change all callers.
14123 * symtab.h (class Symbol_table): Update declarations.
14124 * Makefile.am (CCFILES): Add cref.cc.
14125 (HFILES): Add cref.h.
14126 * Makefile.in: Rebuild.
14128 2008-07-22 Simon Baldwin <simonb@google.com>
14130 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14131 to zero when writing undefined symbols.
14133 2008-07-22 Ian Lance Taylor <iant@google.com>
14135 * output.cc (Output_section::add_input_section): Don't try to
14136 merge empty merge sections.
14138 2008-07-21 Craig Silverstein <csilvers@google.com>
14140 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14141 Include symbol version in error message.
14143 2008-07-20 Chris Demetriou <cgd@google.com>
14145 * configure.ac (gold_cv_c_random_seed): New configured variable.
14146 (RANDOM_SEED_CFLAGS): New substituted variable.
14147 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14148 * configure: Rebuild.
14149 * Makefile.in: Likewise.
14150 * testsuite/Makefile.in: Likewise.
14152 2008-07-18 Ian Lance Taylor <iant@google.com>
14154 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14155 where we see NAME/NULL and NAME/VERSION as separate symbols.
14156 * testsuite/ver_test_main.cc (main): Call t4.
14157 (t4, t4_2a): Define.
14158 * testsuite/ver_test_2.cc (t4_2): Define.
14159 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14160 * testsuite/ver_test_4.cc (t4_2a): Define.
14161 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14162 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14164 2008-07-17 Ian Lance Taylor <iant@google.com>
14166 * dynobj.cc (Versions::add_def): If we give an error about a
14167 missing version, go ahead and create the version anyhow.
14169 2008-07-10 Ian Lance Taylor <iant@google.com>
14171 Handle output sections with more than 0x7fffffff bytes.
14172 * object.h (class Relobj): Change map_to_output_ to
14173 output_sections_, and just keep a section pointer. Change all
14174 uses. Move comdat group support to Sized_relobj.
14175 (Relobj::is_section_specially_mapped): Remove.
14176 (Relobj::output_section): Remove poff parameter. Change all
14178 (Relobj::output_section_offset): New function.
14179 (Relobj::set_section_offset): Rewrite.
14180 (Relobj::map_to_output): Remove.
14181 (Relobj::output_sections): New function.
14182 (Relobj::do_output_section_offset): New pure virtual function.
14183 (Relobj::do_set_section_offset): Likewise.
14184 (class Sized_relobj): Add section_offsets_ field. Add comdat
14185 group support from Relobj. Update declarations.
14186 (Sized_relobj::get_output_section_offset): New function.
14187 (Sized_relobj::do_output_section_offset): New function.
14188 (Sized_relobj::do_set_section_offset): New function.
14189 * object.cc (Relobj::output_section_address): Remove.
14190 (Sized_relobj::Sized_relobj): Initialize new fields.
14191 (Sized_relobj::include_section_group): Cast find_kept_object to
14193 (Sized_relobj::include_linkonce_section): Likewise.
14194 (Sized_relobj::do_layout): Use separate arrays for output section
14196 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14198 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14199 output_sections and section_offsets.
14200 (Sized_relobj::write_local_symbols): Likewise.
14201 (map_to_kept_section): Compute output address directly.
14202 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14203 output_sections and section_offsets.
14204 (Sized_relobj::write_sections): Likewise.
14205 (Sized_relobj::relocate_sections): Likewise.
14206 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14207 * output.h (class Output_reloc): Update declarations. Change
14208 u2_.relobj to Sized_relobj*.
14209 (class Output_data_reloc): Change add functions to use
14211 * output.cc (Output_reloc::Output_reloc): Change relobj to
14213 (Output_reloc::local_section_offset): Change return type to
14214 Elf_Addr. Use get_output_section_offset.
14215 (Output_reloc::get_address): Likewise.
14216 (Output_section::is_input_address_mapped): Don't call
14217 is_section_specially_mapped.
14218 (Output_section::output_offset): Likewise.
14219 (Output_section::output_address): Likewise.
14220 (Output_section::starting_output_address): Likewise.
14221 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14222 parameter to Sized_relobj*.
14223 (Copy_relocs::need_copy_reloc): Likewise.
14224 (Copy_relocs::save): Likewise.
14225 * copy-relocs.h (class Copy_relocs): Update declarations.
14226 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14227 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14228 * target-reloc.h (relocate_for_relocatable): Change
14229 offset_in_output_section type to Elf_Addr. Change code that uses
14231 * layout.cc (Layout::layout): Always set *off.
14232 * mapfile.cc (Mapfile::print_input_section): Use
14233 output_section_offset.
14234 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14236 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14237 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14238 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14240 2008-07-03 Ian Lance Taylor <iant@google.com>
14242 * layout.cc (Layout::include_section): Do not discard unrecognized
14243 SHT_STRTAB sections.
14245 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14247 * script.cc (Lex::can_continue_name): Make '?' allowable in
14248 version-script names.
14249 * testsuite/version_script.map: Change glob pattern to use '?'
14251 2008-06-30 Manish Singh <yosh@gimp.org>
14254 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14257 2008-06-30 Ian Lance Taylor <iant@google.com>
14261 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14262 versions]: Don't try to read the value in the contents, since we
14263 don't use it. Use the template endianness when writing.
14265 2008-06-25 Cary Coutant <ccoutant@google.com>
14267 * fileread.cc (File_read::make_view): Assert on zero-length view.
14268 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14269 symbol table when there are no symbols to read.
14271 2008-06-23 Craig Silverstein <csilvers@google.com>
14273 * version.cc (version_string): Bump to 1.7
14275 2008-06-18 Craig Silverstein <csilvers@google.com>
14277 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14278 constant 0xFFFF to type Valtype.
14279 (Powerpc_relocate_functions::rel16_ha): Likewise.
14281 2008-06-17 Ian Lance Taylor <iant@google.com>
14283 * output.h (Output_section::Input_section): Initialize p2align_ to
14284 zero for Output_section_data constructors.
14285 (Output_section::Input_section::addralign): If not an input
14286 section, return the alignment of the Output_section_data.
14287 * testsuite/copy_test.cc: New file.
14288 * testsuite/copy_test_1.cc: New file.
14289 * testsuite/copy_test_2.cc: New file.
14290 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14291 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14292 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14293 (copy_test_1_pic.o, copy_test_1.so): New targets.
14294 (copy_test_2_pic.o, copy_test_2.so): New targets.
14295 * testsuite/Makefile.in: Rebuild.
14297 * script-sections.cc (Script_sections::place_orphan): Initialize
14298 local variable exact.
14300 2008-06-13 David Edelsohn <edelsohn@gnu.org>
14302 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14304 2008-06-12 David Edelsohn <edelsohn@gnu.org>
14305 David S. Miller <davem@davemloft.net>
14307 * powerpc.cc: New file.
14308 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14309 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14310 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14311 * Makefile.in: Rebuild.
14313 2008-06-09 Ian Lance Taylor <iant@google.com>
14315 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14317 (throwing, orig_terminate): New static variables.
14318 (terminate_handler): New static function.
14319 (t2): Set terminate handler.
14321 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14324 * binary.cc (Binary_to_elf::sized_convert): Fix .data
14327 2008-05-30 Cary Coutant <ccoutant@google.com>
14329 * archive.cc (Archive::include_all_members) Correct to step
14330 over symbol table and extended name table in thin archives.
14332 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14335 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14338 2008-05-28 Caleb Howe <cshowe@google.com>
14340 * reduced_debug_output.cc: New file.
14341 * reduced_debug_output.h: New file.
14342 * options.h (class General_options): Add --strip-debug-non-line.
14343 * options.cc (General_options::finalize): Add strip_debug_non_line
14344 to the strip heirarchy.
14345 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14347 * layout.cc: Include "reduced_debug_output.h".
14348 (Layout::Layout): Initialize new fields.
14349 (line_only_debug_sections): New static array.
14350 (is_lines_only_debug_sections): New static inline function.
14351 (Layout::include_section): Handle --strip-debug-non-line.
14352 (Layout::make_output_section): If --strip-debug-non-line, build
14353 new output sections for .debug_abbrev and .debug_info.
14354 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14355 gold. Warn about possible overflow.
14356 (read_signed_LEB_128): Likewise.
14357 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14358 (read_signed_LEB_128): Declare.
14359 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14360 (HFILES): Add reduced_debug_output.h.
14361 * Makefile.in: Rebuild.
14363 2008-05-21 Ian Lance Taylor <iant@google.com>
14365 * mapfile.cc: New file.
14366 * mapfile.h: New file.
14367 * options.h (class General_options): Add -M/--print-map and -Map.
14368 * options.cc (General_options::finalize): Make -M equivalent to
14370 * main.cc: Include <cstdio> and "mapfile.h".
14371 (main): Open mapfile if requested.
14372 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14373 constructor. Change caller.
14374 (queue_initial_tasks): Add mapfile parameter. Change caller.
14375 (queue_middle_tasks): Likewise.
14376 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14378 * archive.cc: Include "mapfile.h".
14379 (Archive::add_symbols): Add mapfile parameter. Change all
14380 callers. Pass mapfile, symbol, and reason to include_member.
14381 (Archive::include_all_members): Add mapfile parameter. Change all
14383 (Archive::include_member): Add mapfile, sym, and why parameters.
14384 Change all callers. Report inclusion to map file.
14385 * archive.h: Include "fileread.h".
14386 (class Archive): Update declarations.
14387 (Archive::file): New const method.
14388 (class Add_archive_symbols): Add mapfile_ field. Update
14389 constructor. Change all callers.
14390 * readsyms.h (class Read_symbols): Likewise.
14391 (class Finish_group): Likewise.
14392 (class Read_script): Likewise.
14393 * common.cc: Include "mapfile.h".
14394 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14396 (Symbol_table::do_allocate_commons): Likewise.
14397 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14398 symbol allocation to mapfile.
14399 * common.h (class Allocate_commons_task): Add mapfile_ field.
14400 Update constructor. Change all callers.
14401 * symtab.h (class Symbol_table): Update declarations.
14402 * layout.cc: Include "mapfile.h".
14403 (Layout_task_runner::run): Print information to mapfile.
14404 (Layout::create_gold_note): Change Output_data_fixed_space to
14405 Output_data_zero_fill.
14406 (Layout::create_build_id): Likewise.
14407 (Layout::print_to_mapfile): New function.
14408 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14409 constructor. Change caller.
14410 (class Layout): Declare print_to_mapfile.
14411 * output.cc (Output_section::Input_section::print_to_mapfile): New
14413 (Output_section::add_input_section): If producing a map, always
14414 add to input_sections_ list.
14415 (Output_section::do_print_to_mapfile): New function.
14416 (Output_segment::print_sections_to_mapfile): New function.
14417 (Output_segment::print_section_list_to_mapfile): New function.
14418 * output.h: Include "mapfile.h".
14419 (Output_data::print_to_mapfile): New function.
14420 (Output_data::do_print_to_mapfile): New virtual function.
14421 (Output_segment_headers::do_print_to_mapfile): New function.
14422 (Output_file_header::do_print_to_mapfile): New function.
14423 (Output_data_const::do_print_to_mapfile): New function.
14424 (class Output_data_const_buffer): Add map_name_ field. Update
14425 constructor. Change all callers. Add do_print_to_mapfile
14427 (class Output_data_fixed_space): Likewise.
14428 (class Output_data_space): Likewise.
14429 (class Output_data_zero_fill): New class.
14430 (Output_data_strtab::do_print_to_mapfile): New function.
14431 (Output_data_reloc_base::do_print_to_mapfile): New function.
14432 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14433 (Output_data_group::do_print_to_mapfile): New function.
14434 (Output_data_got::do_print_to_mapfile): New function.
14435 (Output_data_dynamic::do_print_to_mapfile): New function.
14436 (Output_symtab_xindex::do_print_to_mapfile): New function.
14437 (class Output_section): Declare do_print_to_mapflie. Declare
14438 print_to_mapfile in Input_section.
14439 (class Output_segment): Declare new functions.
14440 * object.h (Sized_relobj::symbol_count): New function.
14441 * script-sections.cc
14442 (Output_section_element_dot_assignment::set_section_addresses):
14443 Change Output_data_fixed_space to Output_data_zero_fill.
14444 (Output_data_expression::do_print_to_mapfile): New function.
14445 * script.cc (read_input_script): Add mapfile parameter. Change
14447 * script.h (read_input_script): Update declaration.
14448 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14449 (Eh_frame::do_print_to_mapfile): New function.
14450 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14451 (Output_merge_string::do_print_to_mapfile): New function.
14452 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14454 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14456 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14458 * Makefile.am (CCFILES): Add mapfile.cc.
14459 (HFILES): Add mapfile.h.
14460 * Makefile.in: Rebuild.
14462 2008-05-19 Ian Lance Taylor <iant@google.com>
14464 * options.h (class General_options): Add -z relro.
14465 * layout.cc (Layout::Layout): Initialize relro_segment_.
14466 (Layout::add_output_section_data): Return the output section.
14467 (Layout::make_output_section): Rcognize relro sections and mark
14468 them appropriately.
14469 (Layout::attach_allocated_section_to_segment): Put relro sections
14470 in a PT_GNU_RELRO segment.
14471 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14473 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14475 (Layout::linkonce_mapping): Map d.rel.ro.local to
14476 .data.rel.ro.local.
14477 (Layout::output_section_name): Us .data.rel.ro.local for any
14478 section which begins with that.
14479 * layout.h (class Layout): Update add_output_section_data
14480 declaration. Add relro_segment_ field.
14481 * output.cc (Output_section::Output_section): Initialize is_relro_
14482 and is_relro_local_ fields.
14483 (Output_segment::add_output_section): Group relro sections.
14484 (Output_segment::is_first_section_relro): New function.
14485 (Output_segment::maximum_alignment): If there is a relro section,
14486 align the segment to the common page size.
14487 (Output_segment::set_section_addresses): Track whether we are
14488 looking at relro sections. If the last section is a relro
14489 section, align to the common page size.
14490 (Output_segment::set_section_list_addresses): Add in_relro
14491 parameter. Change all callers. Align to the page size when
14492 moving from relro to non-relro section.
14493 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14495 * output.h (class Output_section): Add is_relro_ and
14496 is_relro_local_ fields.
14497 (Output_section::is_relro): New function.
14498 (Output_section::set_is_relro): New function.
14499 (Output_section::is_relro_local): New function.
14500 (Output_section::set_is_relro_local): New function.
14501 (class Output_segment): Update declarations.
14502 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14503 * sparc.cc (Target_sparc::got_section): Likewise.
14504 * x86_64.cc (Target_x86_64::got_section): Likewise.
14505 * testsuite/relro_test_main.cc: New file.
14506 * testsuite/relro_test.cc: New file.
14507 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14508 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14509 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14510 (relro_test.so, relro_test_pic.o): New targets.
14511 * testsuite/Makefile.in: Rebuild.
14513 2008-05-16 Ian Lance Taylor <iant@google.com>
14515 * output.cc (Output_segment::add_output_section): Remove front
14517 * output.h (class Output_segment): Remove
14518 add_initial_output_section and overloaded add_output_section.
14519 Update declaration of remaining add_output_section.
14520 * layout.cc (Layout::create_interp): Call add_output_section
14521 rather than add_initial_output_section.
14522 (Layout::finish_dynamic_section): Likewise.
14524 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14525 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14526 know the dynamic type.
14527 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14528 field. Initialize it in constructor.
14529 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14530 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14531 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14534 * output.cc (Output_reloc::get_address): Change return type to
14536 * output.h (class Output_reloc): Update get_address declaration.
14537 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14538 for section addresses.
14540 2008-05-09 Ian Lance Taylor <iant@google.com>
14543 * gold.cc (gold_nomem): Use return value of write.
14545 2008-05-08 Ian Lance Taylor <iant@google.com>
14547 * symtab.c (Symbol::init_base_output_data): Add version
14548 parameter. Change all callers.
14549 (Symbol::init_base_output_segment): Likewise.
14550 (Symbol::init_base_constant): Likewise.
14551 (Symbol::init_base_undefined): Likewise.
14552 (Sized_symbol::init_output_data): Likewise.
14553 (Sized_symbol::init_output_segment): Likewise.
14554 (Sized_symbol::init_constant): Likewise.
14555 (Sized_symbol::init_undefined): Likewise.
14556 (Symbol_table::do_define_in_output_data): If the new symbol has a
14557 version, mark it as the default.
14558 (Symbol_table::do_define_in_output_segment): Likewise.
14559 (Symbol_table::do_define_as_constant): Likewise.
14560 * symtab.h (class Symbol): Update declarations.
14561 (class Sized_symbol): Likewise.
14562 * resolve.cc (Symbol::override_version): New function.
14563 (Symbol::override_base): Call override_version.
14564 (Symbol::override_base_with_special): Likewise.
14565 * testsuite/ver_script_8.script: New file.
14566 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14567 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14568 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14569 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14571 2008-05-06 Ian Lance Taylor <iant@google.com>
14574 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14576 (class General_options): Remove existing --undefined, and add
14577 --no-undefined instead. Add new --undefined as synonym for -u.
14578 * archive.cc (Archive::add_symbols): Check whether symbol was
14580 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14581 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14582 all uses. Add IS_UNDEFINED. Update declarations to split
14583 different versions of init_base. Declare init_base_undefined.
14584 (Symbol::is_defined): Handle IS_UNDEFINED.
14585 (Symbol::is_undefined): Likewise.
14586 (Symbol::is_weak_undefined): Call is_undefined.
14587 (Symbol::is_absolute): Handle IS_CONSTANT.
14588 (class Sized_symbol): Update declarations to split different
14589 versions of init. Declare init_undefined.
14590 (class Symbol_table): Declare new functions.
14591 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14592 Change all callers.
14593 (Symbol::init_base_output_data): Likewise.
14594 (Symbol::init_base_output_segment): Likewise.
14595 (Symbol::init_base_constant): Likewise.
14596 (Symbol::init_base_undefined): New function.
14597 (Sized_symbol::init_object): Rename from init. Change all
14599 (Sized_symbol::init_output_data): Likewise.
14600 (Sized_symbol::init_output_segment): Likewise.
14601 (Sized_symbol::init_constant): Likewise.
14602 (Sized_symbol::init_undefined): New function.
14603 (Symbol_table::add_undefined_symbols_from_command_line): New
14605 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14607 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14608 (Symbol::output_section): Likewise.
14609 (Symbol::set_output_section): Likewise.
14610 (Symbol_table::sized_finalize_symbol): Likewise.
14611 (Symbol_table::sized_write_globals): Likewise.
14612 * resolve.cc (Symbol_table::should_override): Likewise.
14613 (Symbol::override_base_with_special): Likewise.
14615 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14616 symbol, change it to have default visibility.
14617 * testsuite/protected_1.cc: New file.
14618 * testsuite/protected_2.cc: New file.
14619 * testsuite/protected_3.cc: New file.
14620 * testsuite/protected_main_1.cc: New file.
14621 * testsuite/protected_main_2.cc: New file.
14622 * testsuite/protected_main_3.cc: New file.
14623 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14624 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14625 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14626 (protected_1.so): New target.
14627 (protected_1_pic.o, protected_2_pic.o): New targets.
14628 (protected_3_pic.o): New target.
14629 (check_PROGRAMS): Add protected_2.
14630 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14631 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14632 * testsuite/Makefile.in: Rebuild.
14634 * options.h (DEFINE_var): Add set_user_set_##varname__.
14635 (DEFINE_bool_alias): New macro.
14636 (class General_options): Define -Bstatic using DEFINE_bool_alias
14637 rather than DEFINE_special. Add --undefined as an alias for -z
14639 * options.cc (General_options::parse_Bstatic): Remove.
14641 * options.h (class General_options): Add --fatal-warnings.
14642 * main.cc (main): Implement --fatal-warnings.
14643 * errors.h (Errors::warning_count): New function.
14645 * options.h (class General_options): Add -Bsymbolic-functions.
14646 * symtab.h (Symbol::is_preemptible): Check for
14647 -Bsymbolic-functions.
14649 2008-05-05 Ian Lance Taylor <iant@google.com>
14651 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14652 as noVARNAME rather than no-VARNAME.
14653 (class General_options): Add option -z combreloc.
14654 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14656 (Output_reloc::sort_before) [SHT_REL]: New function.
14657 (Output_reloc::sort_before) [SHT_RELA]: New function.
14658 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14659 Sort_relocs_comparison.
14660 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14661 parameter. Change all callers.
14662 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14663 sort_relocs parameter. Change all callers.
14664 * output.cc (Output_reloc::get_address): New function, broken out
14666 (Output_reloc::write_rel): Call it.
14667 (Output_reloc::compare): New function.
14668 (Output_data_reloc_base::do_write): Optionally sort relocs.
14670 * configure.ac: If targ_extra_obj is set, link it in.
14671 * configure.tgt: Initialize all variables.
14672 (x86_64*): Set targ_extra_obj and targ_extra_size.
14673 * configure: Rebuild.
14675 * object.cc (Sized_relobj::include_section_group): Adjust section
14676 indexes read from group data. Build vector to pass to
14678 * layout.cc (Layout::layout_group): Add flags and shndxes
14679 parameters. Remove contents parameter. Change caller. Update
14680 explicit instantiations.
14681 * layout.h (class Layout): Update layout_group declaration.
14682 * output.cc (Output_data_group::Output_data_group): Add flags and
14683 input_shndxes parameters. Remove contents parameter. Change
14685 (Output_data_group::do_write): Change input_sections_ to
14687 * output.h (class Output_data_group): Update constructor
14688 declaration. Rename input_sections_ to input_shndxes_.
14689 * testsuite/many_sections_test.cc: Add template.
14691 2008-04-30 Cary Coutant <ccoutant@google.com>
14693 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14695 * layout.cc (Layout::include_section): Refactored check for debug
14697 (Layout::add_comdat): Add new parameters. Change type
14698 of signature parameter. Add object and shndx to signatures table.
14699 (Layout::find_kept_object): New function.
14700 * layout.h: Include <cstring>.
14701 (Layout::is_debug_info_section): New function.
14702 (Layout::add_comdat): Add new parameters.
14703 (Layout::find_kept_object): New function.
14704 (Layout::Kept_section): New struct.
14705 (Layout::Signatures): Change type of map range.
14706 * object.cc (Relobj::output_section_address): New function.
14707 (Sized_relobj::include_section_group): Add new parameters. Change
14708 calls to Layout::add_comdat. Change to build table of kept comdat
14709 groups and table mapping discarded sections to kept sections.
14710 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14711 (Sized_relobj::do_layout): Change calls to include_section_group and
14712 include_linkonce_section.
14713 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14714 value to zero when section is discarded.
14715 (Sized_relobj::map_to_kept_section): New function.
14716 * object.h (Relobj::output_section_address): New function.
14717 (Relobj::Comdat_group): New type.
14718 (Relobj::find_comdat_group): New function.
14719 (Relobj::Comdat_group_table): New type.
14720 (Relobj::Kept_comdat_section): New type.
14721 (Relobj::Kept_comdat_section_table): New type.
14722 (Relobj::add_comdat_group): New function.
14723 (Relobj::set_kept_comdat_section): New function.
14724 (Relobj::get_kept_comdat_section): New function.
14725 (Relobj::comdat_groups_): New field.
14726 (Relobj::kept_comdat_sections_): New field.
14727 (Symbol_value::input_value): Update comment.
14728 (Sized_relobj::map_to_kept_section) New function.
14729 (Sized_relobj::include_linkonce_section): Add new parameter.
14730 * target-reloc.h (Comdat_behavior): New type.
14731 (get_comdat_behavior): New function.
14732 (relocate_section): Add code to map a discarded section to the
14733 corresponding kept section when applying a relocation.
14735 2008-04-30 Craig Silverstein <csilvers@google.com>
14737 * dwarf_reader.cc (next_generation_count): New static var.
14738 (Addr2line_cache_entry): New struct.
14739 (addr2line_cache): New static var.
14740 (Dwarf_line_info::one_addr2line): Added caching.
14741 (Dwarf_line_info::clear_addr2line_cache): New function.
14742 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14743 cache-size parameter.
14744 (Dwarf_line_info::one_addr2line_cache): New function.
14745 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14746 new cache-size argument to one_addr2line(), and clear cache.
14748 2008-04-28 Cary Coutant <ccoutant@google.com>
14750 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14751 R_386_PC8 relocations.
14753 2008-04-23 Ian Lance Taylor <iant@google.com>
14755 * object.cc (Sized_relobj::include_section_group): Check for
14756 invalid section group.
14758 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14761 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14762 than read for file header.
14763 * archive.cc (Archive::include_member): Likewise.
14765 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
14767 * aclocal.m4: Regenerate.
14768 * configure: Regenerate.
14770 2008-04-19 Ian Lance Taylor <iant@google.com>
14772 * version.cc (version_string): Bump to 1.6.
14774 * testsuite/Makefile.am (many_sections_r_test): New target.
14775 (many_sections_r_test_SOURCES): Remove.
14776 (many_sections_r_test_DEPENDENCIES): Remove.
14777 (many_sections_r_test_LDFLAGS): Remove.
14778 (many_sections_r_test_LDADD): Remove.
14780 * object.cc (Sized_relobj::do_add_symbols): Always pass
14781 local_symbol_count_ to add_from_relobj.
14783 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14784 every thousand variables.
14785 * testsuite/Makefile.in: Rebuild.
14787 * object.cc (Xindex::initialize_symtab_xindex): New function.
14788 (Xindex::read_symtab_xindex): New function.
14789 (Xindex::sym_xindex_to_shndx): New function.
14790 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14792 (Sized_relobj::do_initialize_xindex): New function.
14793 (Sized_relobj::do_read_symbols): Adjust section links.
14794 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14795 parameter. Change all callers.
14796 (Sized_relobj::include_section_group): Adjust section links and
14797 symbol section indexes.
14798 (Sized_relobj::do_layout): Adjust section links.
14799 (Sized_relobj::do_count_local_symbols): Adjust section links and
14800 symbol section indexes.
14801 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14802 ordinary and special symbols.
14803 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14804 dynsym_xindex parameters. Change all callers. Adjust section
14805 links. Use SHN_XINDEX when needed.
14806 (Sized_relobj::get_symbol_location_info): Adjust section links.
14807 Don't get fooled by special symbols.
14808 * object.h (class Xindex): Define.
14809 (class Object): Add xindex_ parameter. Declare virtual functoin
14810 do_initialize_xindex.
14811 (Object::adjust_sym_shndx): New function.
14812 (Object::set_xindex): New protected function.
14813 (class Symbol_value): Add is_ordinary_shndx_ field.
14814 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14815 (Symbol_value::value): Assert ordinary section.
14816 (Symbol_value::initialize_input_to_output_map): Likewise.
14817 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14818 Change all callers.
14819 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14821 (class Sized_relobj): Update declarations.
14822 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14823 parameter. Change all callers.
14824 (Sized_relobj::adjust_shndx): New function.
14825 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14827 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14828 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14829 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14830 (Sized_dynobj::read_dynsym_section): Adjust section links.
14831 (Sized_dynobj::read_dynamic): Likewise.
14832 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14834 (Sized_dynobj::do_initialize_xindex): New function.
14835 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14836 do_initialize_xindex.
14837 (Sized_dynobj::adjust_shndx): New function.
14838 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14839 dynsym_xindex_ fields.
14840 (Layout::finalize): Add a call to set_section_indexes before
14841 creating the symtab sections.
14842 (Layout::set_section_indexes): Don't do anything if the section
14843 already has a section index.
14844 (Layout::create_symtab_sections): Add shnum parameter. Change
14845 caller. Create .symtab_shndx section if needed.
14846 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14848 (Layout::allocated_output_section_count): New function.
14849 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14851 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14852 fields. Update declarations.
14853 (Layout::symtab_xindex): New function.
14854 (Layout::dynsym_xindex): New function.
14855 (class Write_symbols_task): Add layout_ field.
14856 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14858 * output.cc (Output_section_headers::Output_section_headers): Add
14859 shstrtab_section parameter. Change all callers.
14860 (Output_section_headers::do_sized_write): Store overflow values
14861 for section count and section string table section index in
14862 section header zero.
14863 (Output_file_header::do_sized_write): Check for overflow of
14864 section count and section string table section index.
14865 (Output_symtab_xindex::do_write): New function.
14866 (Output_symtab_xindex::endian_do_write): New function.
14867 * output.h (class Output_section_headers): Add shstrtab_section_.
14868 Update declarations.
14869 (class Output_symtab_xindex): Define.
14870 (Output_section::has_out_shndx): New function.
14871 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14873 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14874 Change all callers.
14875 (Sized_symbol::init): Likewise.
14876 (Symbol::output_section): Check for ordinary symbol.
14877 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14878 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14880 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14881 Change all callers. Simplify handling of symbols from sections
14882 not included in the link.
14883 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14885 (Weak_alias_sorter::operator()): Assert that symbols are
14887 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14889 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14890 parameters. Change all callers.
14891 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14892 symbol distinction. Use SHN_XINDEX when needed.
14893 (Symbol_table::write_section_symbol): Add symtab_xindex
14894 parameter. Change all callers.
14895 (Symbol_table::sized_write_section_symbol): Likewise. Use
14896 SHN_XINDEX when needed.
14897 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14899 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14900 (Symbol::is_defined): Check is_ordinary.
14901 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14902 (Symbol::is_absolute, Symbol::is_common): Likewise.
14903 (class Sized_symbol): Update declarations.
14904 (class Symbol_table): Update declarations.
14905 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14906 parameters. Change all callers.
14907 (Sized_symbol::override): Likewise.
14908 (Symbol_table::override): Likewise.
14909 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14910 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14911 is_ordinary, and orig_st_shndx parameters. Change all callers.
14912 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14913 to be in an ordinary section.
14914 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14915 object and is_ordinary parameters. Change all callers.
14916 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14917 Change all callers. Don't add undefined or non-ordinary symbols
14919 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14920 Change all callers.
14921 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14923 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14924 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14925 (Sized_relobj::relocate_sections): Likewise.
14926 * target-reloc.h (scan_relocs): Adjust section symbol index.
14927 (scan_relocatable_relocs): Likewise.
14928 * i386.cc (Scan::local): Check for ordinary symbols.
14929 * sparc.cc (Scan::local): Likewise.
14930 * x86_64.cc (Scan::local): Likewise.
14931 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14932 to symbol_section_and_value.
14933 * testsuite/many_sections_test.cc: New file.
14934 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14935 (check_PROGRAMS): Add many_sections_test.
14936 (many_sections_test_SOURCES): Define.
14937 (many_sections_test_DEPENDENCIES): Define.
14938 (many_sections_test_LDFLAGS): Define.
14939 (BUILT_SOURCES): Add many_sections_define.h.
14940 (many_sections_define.h): New target.
14941 (BUILT_SOURCES): Add many_sections_check.h.
14942 (many_sections_check.h): New target.
14943 (check_PROGRAMS): Add many_sections_r_test.
14944 (many_sections_r_test_SOURCES): Define.
14945 (many_sections_r_test_DEPENDENCIES): Define.
14946 (many_sections_r_test_LDFLAGS): Define.
14947 (many_sections_r_test_LDADD): Define.
14948 (many_sections_r_test.o): New target.
14949 * testsuite/Makefile.in: Rebuild.
14951 2008-04-17 Cary Coutant <ccoutant@google.com>
14953 * errors.cc (Errors::info): New function.
14954 (gold_info): New function.
14955 * errors.h (Errors::info): New function.
14956 * gold.h (gold_info): New function.
14957 * object.cc (Input_objects::add_object): Print trace output.
14958 * options.cc (options::parse_set): New function.
14959 (General_options::parse_wrap): Deleted.
14960 (General_options::General_options): Deleted initializer.
14961 * options.h (options::String_set): New typedef.
14962 (options::parse_set): New function.
14963 (DEFINE_set): New macro.
14964 (General_options::wrap): Changed to use DEFINE_set. Changed
14965 callers of any_wrap_symbols and is_wrap_symbol.
14966 (General_options::trace, General_options::trace_symbol):
14968 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14969 (General_options::wrap_symbols_): Deleted.
14970 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14972 2008-04-17 David S. Miller <davem@davemloft.net>
14974 * options.cc (General_options::parse_V): New function.
14975 * options.h: Add entries for -V and -Qy.
14977 2008-04-17 Ian Lance Taylor <iant@google.com>
14979 * common.cc (Symbol_table::allocate_commons): Remove options
14980 parameter. Change caller.
14981 (Symbol_table::do_allocate_commons): Remove options parameter.
14982 Change caller. Just call do_allocate_commons_list twice.
14983 (Symbol_table::do_allocate_commons_list): New function, broken out
14984 of do_allocate_commons.
14985 * common.h (class Allocate_commons_task): Remove options_ field.
14986 Update constructor.
14987 * symtab.cc (Symbol_table::Symbol_table): Initialize
14989 (Symbol_table::add_from_object): Put TLS common symbols on
14991 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14992 which are IN_OUTPUT_DATA.
14993 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14994 allocate_commons and do_allocate_commons declarations. Declare
14995 do_allocate_commons_list.
14996 * gold.cc (queue_middle_tasks): Update creation of
14997 Allocate_commons_task to not pass options.
14998 * testsuite/Makefile.am (INCLUDES): Add -I.. .
14999 (TLS_TEST_C_FLAGS): New variable.
15000 (tls_test_c_pic.o): New target.
15001 (tls_test_shared.so): Link in tls_test_c_pic.o.
15002 (tls_test_c_pic_ie.o): New target.
15003 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15004 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15005 (tls_test_c.o): New target.
15006 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15007 (tls_pic_test_LDADD): Likewise.
15008 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15009 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15010 (tls_test_c_gnu2.o): New target.
15011 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15013 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15014 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15015 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15016 * testsuite/tls_test.cc: Include "config.h".
15017 (t_last): Call t11_last.
15018 * testsuite/tls_test.h (t11, t11_last): Declare.
15019 * testsuite/tls_test_c.c: New file.
15020 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15021 * configure.ac: Check for OpenMP support.
15022 * configure, config.in, Makefile.in: Rebuild.
15023 * testsuite/Makefile.in: Rebuild.
15025 2008-04-16 Cary Coutant <ccoutant@google.com>
15027 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15028 (Target_i386::tls_base_symbol_defined_): New field.
15029 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15030 (Target_i386::Scan::global): Likewise.
15031 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15032 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15033 (Target_x86_64::tls_base_symbol_defined_): New field.
15034 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15035 (Target_x86_64::Scan::global): Likewise.
15037 2008-04-16 Cary Coutant <ccoutant@google.com>
15039 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15040 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15041 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15042 building shared libraries.
15043 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15044 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15045 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15046 * testsuite/Makefile.in: Rebuild.
15047 * testsuite/weak_undef.h: New file.
15048 * testsuite/weak_undef_file1.cc: Add extra test cases.
15049 * testsuite/weak_undef_file2.cc: Likewise.
15050 * testsuite/weak_undef_test.cc: Likewise.
15052 2008-04-16 David S. Miller <davem@davemloft.net>
15054 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15055 Add issued_non_pic_error_ field. Declare check_non_pic.
15056 (Target_sparc::Scan::check_non_pic): New function.
15057 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15058 (Target_sparc::Scan::global): Likewise.
15060 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15061 * configure: Rebuild.
15063 * options.h (DEFINE_enable): New macro.
15064 (new_dtags): New enable option.
15065 (initfirst, interpose, loadfltr, nodefaultlib,
15066 nodelete, nodlopen, nodump): New -z options.
15067 * layout.cc (Layout:finish_dynamic_section): If new
15068 dtags enabled, emit DT_RUNPATH. Also, emit a
15069 DT_FLAGS_1 containing any specified -z flags.
15071 2008-04-16 Ian Lance Taylor <iant@google.com>
15073 * copy-relocs.cc: New file.
15074 * copy-relocs.h: New file.
15075 * reloc.cc: Remove Copy_relocs code.
15076 * reloc.h: Likewise.
15077 * reloc-types.h (struct Reloc_types) [both versions]: Add
15078 get_reloc_addend_noerror.
15079 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15080 variants of add_global which take an addend which must be zero.
15081 * i386.cc: Include "copy-relocs.h".
15082 (class Target_i386): Change type of copy_relocs_ to variable,
15083 update initializer.
15084 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15085 Change all callers.
15086 (Target_i386::do_finalize_sections): Change handling of
15088 * sparc.cc: Include "copy-relocs.h".
15089 (class Target_sparc): Change type of copy_relocs_ to variable,
15090 update initializer.
15091 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15092 Change all callers.
15093 (Target_sparc::do_finalize_sections): Change handling of
15095 * x86_64.cc: Include "copy-relocs.h".
15096 (class Target_x86_64): Change type of copy_relocs_ to variable,
15097 update initializer.
15098 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15099 class. Change all callers.
15100 (Target_x86_64::do_finalize_sections): Change handling of
15102 * Makefile.am (CCFILES): Add copy-relocs.cc.
15103 (HFILES): Add copy-relocs.h.
15105 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15107 * testsuite/script_test_4.sh: Permit leading zeroes.
15109 2008-04-15 Ian Lance Taylor <iant@google.com>
15111 * script-sections.cc (Script_sections::create_segments): Use
15112 header_size_adjustment even when there is enough room for the
15114 * testsuite/script_test_4.sh: New file.
15115 * testsuite/script_test_4.t: New file.
15116 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15117 (check_DATA): Add script_test_4.stdout.
15118 (MOSTLYCLEANFILES): Likewise.
15119 (script_test_4): New target.
15120 (script_test_4.stdout): New target.
15121 * testsuite/Makefile.in: Rebuild.
15123 * sparc.cc: Add definitions for Output_data_plt_sparc class
15126 2008-04-14 David S. Miller <davem@davemloft.net>
15128 * sparc.cc: New file.
15129 * Makefile.am (TARGETSOURCES): Add sparc.cc
15130 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15131 * configure.tgt: Document targ_extra_size and
15132 targ_extra_big_endian. Add entries for sparc-* and
15134 * configure.ac: Handle targ_extra_size and
15135 targ_extra_big_endian.
15136 * Makefile.in: Rebuild.
15137 * configure: Likewise.
15138 * po/POTFILES.in: Likewise.
15139 * po/gold.pot: Likewise.
15141 2008-04-14 Ian Lance Taylor <iant@google.com>
15143 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15144 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15145 in the name/type/flags to section mapping. Don't call
15146 allocate_output_section.
15147 (Layout::choose_output_section): Change parameter from adjust_name
15148 to is_input_section. Don't permit input sections after sections
15149 are attached to segments. Don't call allocate_output_section.
15150 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15151 not write_enable_output_section.
15152 (Layout::make_output_section): Don't push to
15153 unattached_section_list_ nor call attach_to_segment. Call
15154 attach_section_to_segment if sections are attached.
15155 (Layout::attach_sections_to_segments): New function.
15156 (Layout::attach_section_to_segment): New function.
15157 (Layout::attach_allocated_section_to_segment): Rename from
15158 attach_to_segment. Remove flags parameter.
15159 (Layout::allocate_output_section): Remove function.
15160 (Layout::write_enable_output_section): Remove function.
15161 * layout.h (class Layout): Update for above changes. Add new
15162 field sections_are_attached_.
15163 * output.h (Output_section::update_flags_for_input_section): New
15165 * output.cc (Output_section::add_input_section): Call
15166 update_flags_for_input_section.
15167 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15169 2008-04-11 Cary Coutant <ccoutant@google.com>
15171 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15172 thought unnecessary.
15173 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15175 2008-04-11 Ian Lance Taylor <iant@google.com>
15177 * output.h (class Output_section_data): Remove inline definition
15179 * output.cc (Output_section_data::set_addralign): New function.
15181 2008-04-11 Cary Coutant <ccoutant@google.com>
15183 Add support for TLS descriptors for i386 and x86_64.
15184 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15185 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15186 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15188 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15189 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15190 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15192 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15193 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15194 Fix problem with initial-exec relocations.
15195 (Target_i386::Relocate::relocate_tls): Likewise.
15196 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15198 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15199 support for section-plus-offset dynamic table entries.
15200 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15201 (Output_data_dynamic::Dynamic_entry): Add support for
15202 section-plus-offset dynamic table entries.
15203 (Output_data_dynamic::Classification): Likewise.
15204 (Output_data_dynamic::classification_): Renamed offset_.
15205 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15206 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15207 (Target_x86_64::make_plt_section): New function.
15208 (Target_x86_64::reserve_tlsdesc_entries): New function.
15209 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15210 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15211 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15212 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15213 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15214 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15215 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15216 add extra PLT entry for TLS descriptors.
15217 (Output_data_plt_x86_64::got_): New field.
15218 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15219 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15221 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15223 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15224 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15225 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15226 R_386_TLS_DESC_CALL relocations.
15227 (Target_x86_64::Scan::global): Likewise.
15228 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15229 for TLS descriptors.
15230 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15231 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15232 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15233 GD-to-IE relaxation.
15234 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15235 and TLS_DESCRIPTORS.
15236 * Makefile.in: Rebuild.
15237 * configure: Rebuild.
15238 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15239 (tls_test_shared2.so): New target.
15240 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15241 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15242 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15243 (tls_shared_gd_to_ie_test_LDADD): New variable.
15244 (tls_shared_gnu2_gd_to_ie_test): New target.
15245 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15247 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15248 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15249 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15250 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15251 (tls_shared_gnu2_test): New target.
15252 (tls_test_gnu2_shared.so): New target.
15253 (tls_shared_gnu2_test_SOURCES): New variable.
15254 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15255 (tls_shared_gnu2_test_LDFLAGS): New variable.
15256 (tls_shared_gnu2_test_LDADD): New variable.
15257 * testsuite/Makefile.in: Rebuild.
15258 * testsuite/Makefile.
15260 2008-04-11 Ian Lance Taylor <iant@google.com>
15262 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15264 * testsuite/Makefile.in: Rebuild.
15266 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15268 * testsuite/script_test_2.cc (main): Adjust test.
15270 2008-04-11 David S. Miller <davem@davemloft.net>
15271 Ian Lance Taylor <iant@google.com>
15273 * options.h (General_options): Add entries for '-Y' and
15275 * options.cc (General_options:finalize): If -Y was used, add those
15276 entries to the library path instead of the default "/lib" and
15279 2008-04-11 David S. Miller <davem@davemloft.net>
15281 * testsuite/justsyms.t: Start at 0x100.
15282 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
15283 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15285 * testsuite/script_test_2.cc: Adjust string and section length
15288 2008-04-09 Ian Lance Taylor <iant@google.com>
15291 * script-sections.cc (Sections_element::allocate_to_segment): Add
15293 (Output_section_definition::allocate_to_segment): Likewise.
15294 (Orphan_output_section::allocate_to_segment): Likewise.
15295 (Script_sections::attach_sections_using_phdrs_clause): Don't
15296 propagate non-PT_LOAD segments to orphan sections.
15297 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15298 readelf rather than objdump.
15299 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15300 .interp section and PT_INTERP segment are the same size.
15301 * testsuite/Makefile.in: Rebuild.
15303 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15304 aliases for symbols defined in the same object.
15305 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15306 (weak_alias_test_SOURCES): New variable.
15307 (weak_alias_test_DEPENDENCIES): New variable.
15308 (weak_alias_test_LDFLAGS): New variable.
15309 (weak_alias_test_LDADD): New variable.
15310 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15311 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15312 (weak_alias_test_3.o): New target.
15313 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15314 * testsuite/weak_alias_test_main.cc: New file.
15315 * testsuite/weak_alias_test_1.cc: New file.
15316 * testsuite/weak_alias_test_2.cc: New file.
15317 * testsuite/weak_alias_test_3.cc: New file.
15319 2008-04-08 Ian Lance Taylor <iant@google.com>
15321 * options.h (class General_options): Add --noinhibit-exec option.
15322 * main.cc (main): Check --noinhibit-exec.
15324 * options.h (class General_options): Define --wrap as a special
15325 option. Add wrap_symbols_ field.
15326 (General_options::any_wrap_symbols): New function.
15327 (General_options::is_wrap_symbol): New function.
15328 * options.cc (General_options::parse_wrap): New function.
15329 (General_options::General_options): Initialize wrap_symbols_.
15330 * symtab.cc (Symbol_table::wrap_symbol): New function.
15331 (Symbol_table::add_from_object): Handle --wrap.
15332 * symtab.h (class Symbol_table): Declare wrap_symbol.
15333 * target.h (Target::wrap_char): New function.
15334 (Target::Target_info): Add wrap_char field.
15335 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15336 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15337 * testsuite/testfile.cc (Target_test::test_target_info):
15340 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15343 * layout.h (class Layout): Add added_eh_frame_data_ field.
15344 * layout.cc (Layout::Layout): Initialize new field.
15345 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15346 output section until we find a section we merged successfully.
15347 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15348 that the size be non-zero.
15350 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15353 2008-04-08 Craig Silverstein <csilvers@google.com>
15355 * configure.ac: Export new conditional variable HAVE_ZLIB.
15356 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15358 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15359 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15361 2008-04-07 Ian Lance Taylor <iant@google.com>
15363 * version.cc (version_string): Set to "1.5".
15365 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15366 Add issued_non_pic_error_ field. Declare check_non_pic.
15367 (Target_x86_64::Scan::check_non_pic): New function.
15368 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15369 (Target_x86_64::Scan::global): Likewise.
15371 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15372 addend parameter. Change caller. Handle merge sections.
15373 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15374 Address to Addend. Don't add in the result of
15375 local_section_offset, pass down the addend and use the returned
15377 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15378 Update declarations of local_section_offset and symbol_value.
15379 * testsuite/two_file_test_1.cc (t18): New function.
15380 * testsuite/two_file_test_2.cc (f18): New function.
15381 * testsuite/two_file_test_main.cc (main): Call t18.
15382 * testsuite/two_file_test.h (t18, f18): Declare.
15384 * configure.ac: Don't test for objdump, c++filt, or readelf.
15385 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15387 (TEST_READELF): New variable.
15388 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15389 (check_PROGRAMS): Add two_file_strip_test.
15390 (two_file_strip_test): New target.
15391 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15392 (two_file_same_shared_strip_test_SOURCES): New variable.
15393 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15394 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15395 (two_file_same_shared_strip_test_LDADD): New variable.
15396 (two_file_shared_strip.so): New target.
15397 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15398 (ver_test_5.syms, ver_test_7.syms): Likewise.
15399 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15400 (strip_test_3.stdout): Use TEST_OBJDUMP.
15401 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15403 2008-04-04 Cary Coutant <ccoutant@google.com>
15405 * symtab.h (Symbol::is_weak_undefined): New function.
15406 (Symbol::is_strong_undefined): New function.
15407 (Symbol::is_absolute): New function.
15408 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15409 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15411 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15412 (weak_undef_test): New target.
15413 * testsuite/Makefile.in: Rebuild.
15414 * testsuite/weak_undef_file1.cc: New file.
15415 * testsuite/weak_undef_file2.cc: New file.
15416 * testsuite/weak_undef_test.cc: New file.
15418 2008-04-03 Craig Silverstein <csilvers@google.com>
15420 * compressed_output.h (class Output_compressed_section): Use
15422 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15424 (zlib_compressed_suffix): Removed.
15425 (Output_compressed_section::set_final_data_size): Use unsigned
15427 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15428 Fix linker invocation.
15429 (flagstest_o_specialfile_and_compress_debug_sections):
15431 * testsuite/Makefile.in: Regenerated.
15433 2008-04-02 David S. Miller <davem@davemloft.net>
15435 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15436 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15438 2008-04-02 Craig Silverstein <csilvers@google.com>
15442 2008-04-02 Ian Lance Taylor <iant@google.com>
15444 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15445 parameters. Update for new key type to views_. Change all
15447 (File_read::read): Adjust for byteshift in returned view.
15448 (File_read::add_view): New function, broken out of
15449 find_and_make_view.
15450 (File_read::make_view): New function, broken out of
15451 find_and_make_view.
15452 (File_read::find_or_make_view): Add offset and aligned
15453 parameters. Rewrite accordingly. Change all callers.
15454 (File_read::get_view): Add offset and aligned parameters. Adjust
15455 for byteshift in return value.
15456 (File_read::get_lasting_view): Likewise.
15457 * fileread.h (class File_read): Update declarations.
15458 (class File_read::View): Add byteshift_ field. Add byteshift to
15459 constructor. Add byteshift method.
15460 * archive.h (Archive::clear_uncached_views): New function.
15461 (Archive::get_view): Add aligned parameter. Change all callers.
15462 * object.h (Object::get_view): Add aligned parameter. Change all
15464 (Object::get_lasting_view): Likewise.
15466 * fileread.cc (File_read::release): Don't call clear_views if
15467 there are multiple objects.
15468 * fileread.h (File_read::clear_uncached_views): New function.
15469 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15472 2008-03-31 Cary Coutant <ccoutant@google.com>
15474 Add thin archive support.
15475 * archive.cc (Archive::armagt): New const.
15476 (Archive::setup): Remove task parameter and calls to unlock.
15477 (Archive::unlock_nested_archives): New function.
15478 (Archive::read_header): Add nested_off parameter. Change
15480 (Archive::interpret_header): Likewise.
15481 (Archive::include_all_members): Change to handle thin
15483 (Archive::include_member): Likewise.
15484 * archive.h (Archive::Archive): Add new parameters and
15486 (Archive::armagt): New const.
15487 (Archive::setup): Remove task parameter.
15488 (Archive::unlock_nested_archives): New function.
15489 (Archive::read_header): Add nested_off parameter.
15490 (Archive::interpret_header): Likewise.
15491 (Archive::Nested_archive_table): New typedef.
15492 (Archive::is_thin_archive_): New field.
15493 (Archive::nested_archives_): New field.
15494 (Archive::options_): New field.
15495 (Archive::dirpath_): New field.
15496 (Archive::task_): New field.
15497 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15498 for thin archives. Pass additional parameters to
15499 Archive::Archive. Unlock the archive file after calling
15502 2008-03-29 Ian Lance Taylor <iant@google.com>
15504 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15505 version symbol to be local.
15506 * testsuite/ver_test_4.sh: New file.
15507 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15508 (check_DATA): Add ver_test_4.syms.
15509 (ver_test_4.syms): New target.
15510 * testsuite/Makefile.in: Rebuild.
15513 (Output_section::Input_section_sort_entry::has_priority): New
15515 (Output_section::Input_section_sort_entry::match_file_name): New
15517 (Output_section::Input_section_sort_entry::match_section_name):
15519 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15521 (Output_section::Input_section_sort_entry::match_section_file):
15523 (Output_section::Input_section_sort_compare::operator()): Rewrite
15524 using new Input_section_sort_entry functions. Sort crtbegin and
15525 crtend first. Sort sections with no priority before sections with
15527 * testsuite/initpri1.c (d3): Check j != 4.
15528 (cd5): New constructor/destructor function.
15529 (main): Check j != 2.
15531 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15532 new symbol when resolving, don't call set_is_default.
15533 * testsuite/ver_test_7.cc: New file.
15534 * testsuite/ver_test_7.sh: New file.
15535 * testsuite/Makefile.am (ver_test_7.so): New target.
15536 (ver_test_7.o): New target.
15537 (check_SCRIPTS): Add ver_test_7.sh.
15538 (check_DATA): Add ver_test_7.syms.
15539 (ver_test_7.syms): New target.
15541 2008-03-28 Ian Lance Taylor <iant@google.com>
15543 * layout.cc (Layout::layout): If we see an input section with a
15544 name that needs sorting, set the must_sort flag for the output
15546 (Layout::make_output_section): If the name of the output section
15547 indicates that it might require sorting, set the may_sort flag.
15548 * output.h (Output_section::may_sort_attached_input_sections): New
15550 (Output_section::set_may_sort_attached_input_sections): New
15552 (Output_section::must_sort_attached_input_sections): New
15554 (Output_section::set_must_sort_attached_input_sections): New
15556 (class Output_section): Declare Input_section_sort_entry. Define
15557 Input_section_sort_compare. Declare
15558 sort_attached_input_sections. Add new fields:
15559 may_sort_attached_input_sections_,
15560 must_sort_attached_input_sections_,
15561 attached_input_sections_are_sorted_.
15562 * output.cc (Output_section::Output_section): Initialize new
15564 (Output_section::add_input_section): Add an entry to
15565 input_sections_ if may_sort or must_sort are true.
15566 (Output_section::set_final_data_size): Call
15567 sort_attached_input_sections if necessary.
15568 (Output_section::Input_section_sort_entry): Define new class.
15569 (Output_section::Input_section_sort_compare::operator()): New
15571 (Output_section::sort_attached_input_sections): New function.
15572 * configure.ac: Check whether the compiler supports constructor
15573 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15574 * testsuite/initpri1.c: New file.
15575 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15576 CONSTRUCTOR_PRIORITY.
15577 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15578 (initpri1_LDFLAGS): New variable.
15579 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15581 2008-03-27 Ian Lance Taylor <iant@google.com>
15583 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15584 * testsuite/common_test_1.c: New file.
15585 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15586 (common_test_1_SOURCES): New variable.
15587 (common_test_1_DEPENDENCIES): New variable.
15588 (common_test_1_LDFLAGS): New variable.
15590 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15591 and commons_ correctly when NAME/VERSION does not override
15593 * testsuite/ver_test_6.c: New file.
15594 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15595 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15596 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15598 2008-03-26 Ian Lance Taylor <iant@google.com>
15600 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15601 of an undefined symbol from a version script.
15602 * testsuite/Makefile.am (ver_test_5.so): New target.
15603 (ver_test_5.o): New target.
15604 (check_SCRIPTS): Add ver_test_5.sh.
15605 (check_DATA): Add ver_test_5.syms.
15606 (ver_test_5.syms): New target.
15607 * testsuite/ver_test_5.cc: New file.
15608 * testsuite/ver_test_5.script: New file.
15609 * testsuite/ver_test_5.sh: New file.
15610 * Makefile.in, testsuite/Makefile.in: Rebuild.
15613 Fix problems building gold with gcc 4.3.0.
15614 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15615 (gold_error_at_location, gold_warning_at_location): Use it.
15616 * configure.ac: Check whether we can compile and use a template
15617 function with a printf attribute.
15618 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15619 when jumping over bytes.
15620 * object.cc: Instantiate Object::read_section_data.
15621 * debug.h: Include <cstring>
15622 * dwarf_reader.cc: Include <algorithm>
15623 * main.cc: Include <cstring>.
15624 * options.cc: Include <cstring>.
15625 * output.cc: Include <cstring>.
15626 * script.cc: Include <cstring>.
15627 * script.h: Include <string>.
15628 * symtab.cc: Include <cstring> and <algorithm>.
15629 * target-select.cc: Include <cstring>.
15630 * version.cc: Include <string>.
15631 * testsuite/testmain.cc: Include <cstdlib>.
15632 * configure, config.in: Rebuild.
15634 2008-03-25 Ian Lance Taylor <iant@google.com>
15636 * options.cc: Include "../bfd/bfdver.h".
15637 (options::help): Print bug reporting address.
15639 * version.cc (print_version): Adjust output for current value of
15640 BFD_VERSION_STRING.
15644 * options.cc (options::help): Print list of supported targets.
15645 * target-select.h: Include <vector>.
15646 (class Target_selector): Make machine_, size_, and is_big_endian_
15647 fields const. Add bfd_name_ and instantiated_target_ fields.
15648 (Target_selector::Target_selector): Add bfd_name parameter.
15649 (Target_selector::recognize): Make non-virtual, call
15651 (Target_selector::recognize_by_name): Make non-virtual, call
15652 do_recognize_by_name.
15653 (Target_selector::supported_names): New function.
15654 (Target_selector::bfd_name): New function.
15655 (Target_selector::do_instantiate_target): New pure virtual
15657 (Target_selector::do_recognize): New virtual function.
15658 (Target_selector::do_recognize_by_name): New virtual function.
15659 (Target_selector::instantiate_target): New private function.
15660 (supported_target_names): Declare.
15661 * target-select.cc (Target_selector::Target_selector): Update for
15662 new parameter and fields.
15663 (select_target_by_name): Check that the name matches before
15664 calling recognize_by_name.
15665 (supported_target_names): New function.
15666 * i386.cc (class Target_selector_i386): Update Target_selector
15667 constructor call. Remove recognize and recognize_by_name. Add
15668 do_instantiate_target.
15669 * x86_64.cc (class Target_selector_x86_64): Likewise.
15670 * testsuite/testfile.cc (class Target_selector_test): Update for
15671 changes to Target_selector.
15673 * README: Rewrite, with some notes on unsupported features.
15675 2008-03-24 Cary Coutant <ccoutant@google.com>
15677 * i386.cc (Target_i386::Got_type): New enum declaration.
15678 (Target_i386::Scan::local): Updated callers of Output_data_got
15680 (Target_i386::Scan::global): Likewise.
15681 (Target_i386::Relocate::relocate): Likewise.
15682 (Target_i386::Relocate::relocate_tls): Likewise.
15683 * object.h (Got_offset_list): New class.
15684 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15685 (Sized_relobj::local_got_offset): Likewise.
15686 (Sized_relobj::set_local_got_offset): Likewise.
15687 (Sized_relobj::local_has_tls_got_offset): Removed.
15688 (Sized_relobj::local_tls_got_offset): Removed.
15689 (Sized_relobj::set_local_tls_got_offset): Removed.
15690 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15691 * output.cc (Output_data_got::add_global): Added got_type parameter.
15692 (Output_data_got::add_global_with_rel): Likewise.
15693 (Output_data_got::add_global_with_rela): Likewise.
15694 (Output_data_got::add_global_pair_with_rel): New function.
15695 (Output_data_got::add_global_pair_with_rela): New function.
15696 (Output_data_got::add_local): Added got_type parameter.
15697 (Output_data_got::add_local_with_rel): Likewise.
15698 (Output_data_got::add_local_with_rela): Likewise.
15699 (Output_data_got::add_local_pair_with_rel): New function.
15700 (Output_data_got::add_local_pair_with_rela): New function.
15701 (Output_data_got::add_global_tls): Removed.
15702 (Output_data_got::add_global_tls_with_rel): Removed.
15703 (Output_data_got::add_global_tls_with_rela): Removed.
15704 (Output_data_got::add_local_tls): Removed.
15705 (Output_data_got::add_local_tls_with_rel): Removed.
15706 (Output_data_got::add_local_tls_with_rela): Removed.
15707 * output.h (Output_data_got::add_global): Added got_type parameter.
15708 (Output_data_got::add_global_with_rel): Likewise.
15709 (Output_data_got::add_global_with_rela): Likewise.
15710 (Output_data_got::add_global_pair_with_rel): New function.
15711 (Output_data_got::add_global_pair_with_rela): New function.
15712 (Output_data_got::add_local): Added got_type parameter.
15713 (Output_data_got::add_local_with_rel): Likewise.
15714 (Output_data_got::add_local_with_rela): Likewise.
15715 (Output_data_got::add_local_pair_with_rel): New function.
15716 (Output_data_got::add_local_pair_with_rela): New function.
15717 (Output_data_got::add_global_tls): Removed.
15718 (Output_data_got::add_global_tls_with_rel): Removed.
15719 (Output_data_got::add_global_tls_with_rela): Removed.
15720 (Output_data_got::add_local_tls): Removed.
15721 (Output_data_got::add_local_tls_with_rel): Removed.
15722 (Output_data_got::add_local_tls_with_rela): Removed.
15723 * resolve.cc (Symbol::override_base_with_special): Removed
15724 reference to has_got_offset_ field.
15725 * symtab.cc (Symbol::init_fields): Replaced initialization
15726 of got_offset_ with got_offsets_. Removed initialization
15728 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
15729 (Symbol::got_offset): Likewise.
15730 (Symbol::set_got_offset): Likewise.
15731 (Symbol::has_tls_got_offset): Removed.
15732 (Symbol::tls_got_offset): Removed.
15733 (Symbol::set_tls_got_offset): Removed.
15734 (Symbol::got_offset_): Removed.
15735 (Symbol::tls_mod_got_offset_): Removed.
15736 (Symbol::tls_pair_got_offset_): Removed.
15737 (Symbol::got_offsets_): New field.
15738 (Symbol::has_got_offset): Removed.
15739 (Symbol::has_tls_mod_got_offset): Removed.
15740 (Symbol::has_tls_pair_got_offset): Removed.
15741 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15742 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15744 (Target_x86_64::Scan::global): Likewise.
15745 (Target_x86_64::Relocate::relocate): Likewise.
15746 (Target_x86_64::Relocate::relocate_tls): Likewise.
15748 2008-03-25 Ben Elliston <bje@au.ibm.com>
15750 * yyscript.y: Fix spelling error in comment.
15752 2008-03-24 Ian Lance Taylor <iant@google.com>
15754 * options.h (class General_options): Define build_id option.
15755 * layout.h (class Layout): Declare write_build_id, create_note,
15756 create_build_id. Add build_id_note_ member.
15757 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15758 "libiberty.h", "md5.h", "sha1.h".
15759 (Layout::Layout): Initialize eh_frame_data_,
15760 eh_frame_hdr_section_, and build_id_note_.
15761 (Layout::finalize): Call create_build_id.
15762 (Layout::create_note): New function, broken out of
15763 Layout::create_gold_note.
15764 (Layout::create_gold_note): Call create_note.
15765 (Layout::create_build_id): New function.
15766 (Layout::write_build_id): New function.
15767 (Close_task_runner::run): Call write_build_id.
15769 * x86_64.cc: Correct license to GPLv3.
15771 2008-03-23 Ian Lance Taylor <iant@google.com>
15773 * options.cc: Include "demangle.h".
15774 (parse_optional_string): New function.
15775 (parse_long_option): Handle takes_optional_argument.
15776 (parse_short_option): Update dash_z initializer. Handle
15777 takes_optional_argument.
15778 (General_options::General_options): Initialize do_demangle_.
15779 (General_options::finalize): Set do_demangle_. Handle demangling
15781 * options.h (parse_optional_string): Declare.
15782 (struct One_option): Add optional_arg field. Update constructor.
15783 Update call constructor calls. Add takes_optional_argument
15785 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15786 (DEFINE_optional_string): Define.
15787 (General_options::demangle): Change from DEFINE_bool to
15788 DEFINE_optional_string.
15789 (General_options::no_demangle): New function.
15790 (General_options::do_demangle): New function.
15791 (General_options::set_do_demangle): New function.
15792 (General_options::execstack_status_): Move definition to end of
15794 (General_options::static_): Likewise.
15795 (General_options::do_demangle_): New field.
15796 * object.cc (big_endian>::get_symbol_location_info): Call
15797 Options::do_demangle, not Options::demangle.
15798 * symtab.cc (demangle): Likewise.
15800 2008-03-22 Ian Lance Taylor <iant@google.com>
15802 * gold.h: Include <cstddef> and <sys/types.h>
15803 * options.h: Include <cstring>.
15805 2008-03-21 Ian Lance Taylor <iant@google.com>
15807 * Added source code to GNU binutils.
15809 Copyright (C) 2008-2014 Free Software Foundation, Inc.
15811 Copying and distribution of this file, with or without modification,
15812 are permitted in any medium without royalty provided the copyright
15813 notice and this notice are preserved.
15819 version-control: never