1 2014-07-08 Cary Coutant <ccoutant@google.com>
3 * expression.cc (struct Expression::Expression_eval_info): Add
4 new fields type_pointer, vis_pointer, and nonvis_pointer.
5 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
6 nonvis_pointer parameters. Adjust all calls.
7 (Symbol_expression::value): Update type, visibility, and nonvis bits
9 * script.cc (Symbol_assignment::sized_finalize): Update type,
10 visibility, and remaining st_other bits for new symbol.
11 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
12 vis_pointer, and nonvis_pointer parameters.
13 * symtab.h (Symbol::set_type): New method.
15 * testsuite/Makefile.am (defsym_test): New test.
16 * testsuite/Makefile.in: Regenerate.
17 * testsuite/defsym_test.c: New file.
18 * testsuite/defsym_test.sh: New file.
20 2014-07-08 Cary Coutant <ccoutant@google.com>
23 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
24 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
25 (Sized_dynobj::base_read_symbols): ...new method.
26 * object.h (Sized_relobj_file::base_read_symbols): New method.
27 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
28 (Sized_relobj_file::base_read_symbols): ...new method.
29 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
30 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
31 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
33 2014-07-04 Alan Modra <amodra@gmail.com>
35 * po/POTFILES.in: Regenerate.
37 2014-07-02 Jing Yu <jingyu@google.com>
39 * aarch64.cc: New file
40 * Makefile.am (TARGETSOURCES): Add aarch64.cc
41 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
42 * Makefile.in: Regenerate.
43 * configure.tgt: Add entries for aarch64*.
44 * configure.ac: Likewise.
45 * configure: Likewise.
47 2014-06-27 Alan Modra <amodra@gmail.com>
49 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
51 2014-06-24 Cary Coutant <ccoutant@google.com>
53 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
55 (Dwo_file::sized_read_unit_index): Likewise.
57 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
60 * Makefile.am (TARGETSOURCES): Add mips.cc
61 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
62 * configure.tgt: Add entries for mips*.
63 * configure.ac: Likewise.
64 * Makefile.in: Regenerate.
65 * configure: Likewise.
67 2014-06-09 Cary Coutant <ccoutant@google.com>
69 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
70 unit_length is within section bounds.
72 2014-06-09 Cary Coutant <ccoutant@google.com>
75 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
78 2014-06-07 Alan Modra <amodra@gmail.com>
80 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
82 2014-06-06 Cary Coutant <ccoutant@google.com>
84 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
85 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
86 (Dwarf_pubnames_table::read_header): Likewise.
87 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
90 2014-06-05 Joel Brobecker <brobecker@adacore.com>
92 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
93 * Makefile.in, configure: Regenerate.
95 2014-06-03 Alan Modra <amodra@gmail.com>
97 * powerpc.cc (addis_12_2): Define.
98 (Stub_table::do_write): Support fusion on ELFv2 stubs.
100 2014-06-03 Alan Modra <amodra@gmail.com>
102 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
105 2014-06-02 Alan Modra <amodra@gmail.com>
107 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
108 Only ignore relocs on ELFv1.
109 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
111 2014-05-30 Cary Coutant <ccoutant@google.com>
113 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
114 * testsuite/Makefile.in: Regenerate.
115 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
117 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
120 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
121 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
123 2014-05-15 Alan Modra <amodra@gmail.com>
125 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
126 Compare FDE contents with DW_CFA_nop rather than 0.
128 2014-05-13 Sriraman Tallam <tmsriram@google.com>
130 * symtab.h (may_need_copy_reloc): Remove check for position independent
132 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
133 position independence before pc absolute may_need_copy_reloc call.
134 Add check for executable output befor pc relative may_need_copy_reloc
140 * powerpc.cc: Add check for no position independence before
141 may_need_copy_reloc calls.
142 * testsuite/pie_copyrelocs_test.cc: New file.
143 * testsuite/pie_copyrelocs_shared_test.cc: New file.
144 * Makefile.am (pie_copyrelocs_test): New test.
145 * Makefile.in: Regenerate.
147 2014-05-08 Martin Liška <mliska@suse.cz>
149 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
151 2014-05-06 Cary Coutant <ccoutant@google.com>
154 * i386.cc (Output_data_got_plt_i386): New class.
155 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
156 parameter. Change all callers.
157 (Output_data_plt_i386::layout_): Remove.
158 (Output_data_plt_i386::got_plt_): Change type.
159 (Target_i386::got_plt_): Change type. Change all references.
160 (Target_i386::got_section): Create instance of new class.
161 (Output_data_got_plt_i386::do_write): New function.
162 * x86_64.cc (Output_data_got_plt_x86_64): New class.
163 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
164 parameter. Change all callers.
165 (Output_data_plt_x86_64::layout_): Remove.
166 (Output_data_plt_x86_64::got_plt_): Change type.
167 (Target_x86_64::got_plt_): Change type. Change all references.
168 (Target_x86_64::got_section): Create instance of new class.
169 (Output_data_got_plt_x86_64::do_write): New function.
170 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
171 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
174 2014-05-05 Cary Coutant <ccoutant@google.com>
176 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
177 if we have pubnames/pubtypes.
179 2014-05-02 Cary Coutant <ccoutant@google.com>
181 * defstd.cc (in_segment): Define __ehdr_start here...
182 * layout.cc (Layout::finalize): ...Instead of here. Set the
183 output segment when known.
184 * resolve.cc (Symbol::override_base_with_special): Remember
185 the original binding.
186 * symtab.cc (Symbol::set_output_segment): New function.
187 (Symbol::set_undefined): New function.
188 * symtab.h (Symbol::is_weak_undefined): Check original undef
190 (Symbol::is_strong_undefined): New function.
191 (Symbol::set_output_segment): New function.
192 (Symbol::set_undefined): New function.
193 * target-reloc.h (is_strong_undefined): Remove.
194 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
195 Check for hidden undefs.
196 (relocate_section): Call Symbol::is_strong_undefined.
198 * testsuite/Makefile.am (ehdr_start_test_1)
199 (ehdr_start_test_2, ehdr_start_test_3)
200 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
201 * testsuite/Makefile.in: Regenerate.
202 * testsuite/ehdr_start_def.cc: New source file.
203 * testsuite/ehdr_start_test.cc: New source file.
204 * testsuite/ehdr_start_test.t: New linker script.
205 * testsuite/ehdr_start_test_4.sh: New shell script.
207 2014-04-23 Cary Coutant <ccoutant@google.com>
210 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
212 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
214 * layout.cc (Layout::include_section): Allow a target to decide
215 whether to include a section.
216 * target.h (Target::should_include_section): New function.
217 (Target::do_should_include_section): New function.
219 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
221 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
223 (Copy_relocs::emit): ... here.
224 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
225 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
226 (Copy_reloc_entry::entries_): Change from private to protected.
228 2014-04-02 Sriraman Tallam <tmsriram@google.com>
230 * icf.cc (get_section_contents): Replace copies of reloc
231 vectors with const references.
233 2014-04-02 Cary Coutant <ccoutant@google.com>
235 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
236 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
237 * configure: Regenerate.
238 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
239 -fno-use-linker-plugin.
240 (LINK1, CXXLINK1): Add it to the link command.
241 * testsuite/Makefile.in: Regenerate.
243 2014-03-12 Alan Modra <amodra@gmail.com>
245 * Makefile.in: Regenerate.
247 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
249 * symtab.h (Symbol::set_nonvis): New function.
251 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
253 * symtab.cc (Sized_symbol<32>::init_output_data):
254 Instantiate the template.
255 (Sized_symbol<64>::init_output_data): Likewise.
257 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
259 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
260 adjust dynamic symbol value.
261 * target.h (Target::adjust_dyn_symbol): New function.
262 (Target::do_adjust_dyn_symbol): New function.
264 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
266 * output.cc (Output_data_dynamic::Dynamic_entry::write):
267 Get the value of DYNAMIC_CUSTOM dynamic entry.
268 * output.h (Output_data_dynamic::add_custom): New function.
269 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
271 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
272 * target.h (Target::dynamic_tag_custom_value): New function.
273 (Target::do_dynamic_tag_custom_value): New function.
275 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
277 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
279 * target.h (Target::has_custom_set_dynsym_indexes): New function.
280 (Target::do_has_custom_set_dynsym_indexes): New function.
281 (Target::set_dynsym_indexes): New function.
282 (Target::do_set_dynsym_indexes): New function.
284 2014-03-07 Alan Modra <amodra@gmail.com>
286 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
287 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
288 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
289 (Powerpc_relocate_functions::has_overflow_bitfield,
290 overflowed): Use the above.
291 (Target_powerpc::Relocate::relocate): Correct overflow checking
292 for a number of relocations. Modify overflow test for 16-bit
293 fields in instructions to signed/unsigned according to whether
294 the field takes a signed or unsigned value.
296 2014-03-05 Alan Modra <amodra@gmail.com>
298 Update copyright years.
300 2014-03-05 Alan Modra <amodra@gmail.com>
302 * powerpc.cc (Target_powerpc::Scan::local, global): Support
303 R_PPC64_ADDR64_LOCAL.
304 (Target_powerpc::Relocate::relocate): Likewise.
306 2014-03-03 Alan Modra <amodra@gmail.com>
308 * dwp.cc (print_version): Update copyright year to current.
310 2014-02-10 Alan Modra <amodra@gmail.com>
312 * po/gold.pot: Regenerate.
314 2014-02-06 Cary Coutant <ccoutant@google.com>
316 Fix problem where -u is ignored when a weak undef is seen.
318 * archive.cc (Library_base::should_include_member): Reorder
319 code to check for -u option if a weak undef has already been seen.
320 * testsuite/Makefile.am (weak_undef_test_2): New test case.
321 * testsuite/Makefile.in: Regenerate.
322 * testsuite/weak_undef_file3.cc: New file.
323 * testsuite/weak_undef_file4.cc: New file.
324 * testsuite/weak_undef_test_2.cc: New file.
326 2014-02-05 Cary Coutant <ccoutant@google.com>
328 Fix issues with gold undefined symbol diagnostics.
331 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
333 * target-reloc.h (is_strong_undefined): New function.
334 (relocate_section): Move undef vtable symbol check from here.
335 Check for is_strong_undefined.
337 2014-02-05 Cary Coutant <ccoutant@google.com>
339 Fix problems with the --dynamic-list option.
342 * options.cc (General_options::parse_dynamic_list):
343 Set have_dynamic_list_.
344 (General_options::General_options): Initialize have_dynamic_list_.
345 (General_options::finalize): Turn off -Bsymbolic and
346 -Bsymbolic-functions if --dynamic-list provided.
347 * options.h (General_options::have_dynamic_list): New function.
348 (General_options::have_dynamic_list_): New data member.
349 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
353 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
354 in --dynamic-list, mark it.
356 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
357 (dynamic_list_2): New test case.
358 * testsuite/Makefile.in: Regenerate.
359 * testsuite/dynamic_list_2.cc: New file.
360 * testsuite/dynamic_list_2.t: New file.
361 * testsuite/dynamic_list_lib1.cc: New file.
362 * testsuite/dynamic_list_lib2.cc: New file.
363 * testsuite/gc_dynamic_list_test.c: New file.
364 * testsuite/gc_dynamic_list_test.sh: New file.
365 * testsuite/gc_dynamic_list_test.t: New file.
367 2014-01-28 Cary Coutant <ccoutant@google.com>
369 Add .gdb_index version 7 support.
371 * gold/dwarf_reader.cc: include <utility> (for make_pair).
372 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
374 (Dwarf_ranges_table::read_ranges_table): Likewise.
375 (Dwarf_pubnames_table::read_section): Check for GNU-style
376 sections, and for compressed debug sections.
377 (Dwarf_pubnames_table::read_header): Compute end address of table.
378 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
379 for end of list by offset, not by offset == 0.
380 (Dwarf_info_reader::do_read_string_table): Check for compressed
382 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
383 Initialize new data members.
384 (Dwarf_pubnames_table::next_name): return flag_byte.
385 (Dwarf_pubnames_table::end_of_table_): New data member.
386 (Dwarf_pubnames_table::is_gnu_style_): New data member.
387 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
388 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
389 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
390 read skeleton type unit DIEs.
391 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
392 (Gdb_index::do_write): Write flag_byte.
393 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
394 (Gdb_index::Cu_vector): Store flags along with cu indexes.
395 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
396 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
398 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
400 * version.cc (print_version): Update copyright year to 2014.
402 2013-12-19 Dimitry Andric <dimitry@andric.com>
404 * stringpool.cc (Stringpool_template::reserve): Add
405 HAVE_UNORDERED_MAP case.
406 * stringpool.cc (Stringpool_template::print_stats): Likewise.
408 2013-12-18 Cary Coutant <ccoutant@google.com>
410 * configure.ac: Check for <unordered_set> and <unordered_map>.
411 * config.in: Regenerate.
412 * configure: Regenerate.
413 * system.h: Use <unordered_set> and <unordered_map> if available.
415 2013-12-10 Roland McGrath <mcgrathr@google.com>
417 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
418 with $(INSTALL_PROGRAM_ENV).
419 * Makefile.in: Regenerate.
421 2013-11-22 Cary Coutant <ccoutant@google.com>
423 * configure.ac: Add check for which library is needed for
425 * configure: Regenerate.
427 2013-11-22 Cary Coutant <ccoutant@google.com>
429 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
431 * testsuite/Makefile.in: Regenerate.
433 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
435 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
436 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
437 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
438 (Target_x86_64<size>::Scan::local): Likewise.
439 (Target_x86_64<size>::Scan::global): Likewise.
440 (Target_x86_64<size>::Relocate::relocate): Likewise.
441 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
443 (Target_x86_64<size>::Scan::check_non_pic(): Handle
446 * testsuite/Makefile.am (check_PROGRAMS): Add
447 exception_x86_64_bnd_test.
448 (exception_x86_64_bnd_test_SOURCES): New macro.
449 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
450 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
451 (exception_x86_64_bnd_test_LDADD): Likewise.
452 (exception_x86_64_bnd_1.o): New rule.
453 (exception_x86_64_bnd_2.o): Likewise.
454 * testsuite/Makefile.in: Regenerated.
456 2013-11-15 Alan Modra <amodra@gmail.com>
458 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
460 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
461 Only call ppc64_local_entry_offset for 64-bit. Restrict
462 symval_for_branch lookup to ELFv1.
463 (Stub_table::add_plt_call_entry): Use unsigned int off.
464 (Output_data_glink::Address, invalid_address): New.
465 (Output_data_glink::add_eh_frame): Move out of line. Add
467 (Output_data_glink::add_global_entry, find_global_entry,
468 global_entry_address): New functions.
469 (Output_data_glink::global_entry_stubs_, end_branch_table_,
470 ge_size): New variables.
471 (Output_data_glink::set_final_data_size): Add global entry
473 (Output_data_glink::do_write): Write global entry stubs.
474 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
475 parameter. Return true for ELFv2. Adjust callers.
476 (Target_powerpc::Scan::local, global): Restrict opd lookup to
477 ELFv1. Similarly for ifunc and dynamic relocation processing
478 specific to ELFv1. Recognize that symbols are defined on
479 their plt entries for ELFv2.
480 (Target_powerpc::symval_for_branch): Assert if called for
482 (Target_powerpc::Relocate::relocate): Use global entry plt
483 stub for symbol value if such exists on ELFv2.
484 (Target_powerpc::Relocate::relocate): Don't call
485 symval_for_branch when ELFv2. Do adjust for local entry
487 (Target_powerpc::do_dynsym_value): Set symbols to global entry
489 (Target_powerpc::do_plt_address_for_global): Similarly.
491 2013-11-14 Cary Coutant <ccoutant@google.com>
493 Revert patch -- this did not fix the problem, and there is
496 2013-11-14 Cary Coutant <ccoutant@google.com>
499 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
500 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
501 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
502 updating fde_offsets_.
503 (Eh_frame_hdr::lock_): New data member.
505 2013-11-14 Cary Coutant <ccoutant@google.com>
507 * dwp.cc (Dwo_file_entry): New type.
508 (File_list): Use Dwo_file_entry.
509 (Dwo_file::verify): New function.
510 (Dwo_file::verify_dwo_list): New function.
511 (Dwo_file::sized_verify_dwo_list): New function.
512 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
514 (Dwp_options): New enum type.
515 (dwp_options): Add --verify-only.
518 * dwp.h (gold_info): Add declaration.
520 2013-11-14 Cary Coutant <ccoutant@google.com>
523 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
524 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
525 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
526 updating fde_offsets_.
527 (Eh_frame_hdr::lock_): New data member.
529 2013-11-06 Cary Coutant <ccoutant@google.com>
532 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
533 before reloc sections.
535 2013-11-04 Alan Modra <amodra@gmail.com>
537 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
538 (Symbol::needs_dynamic_reloc): Test new flag.
539 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
540 (Target_powerpc::Scan::get_reference_flags): Add target param.
541 Return FUNC_DESC_ABI for 64-bit ELFv1.
542 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
544 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
545 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
547 2013-10-31 Cary Coutant <ccoutant@google.com>
549 Restore support for dwp v2 DWARF package file format.
551 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
552 tu_length parameter. Adjust all callers.
553 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
554 * dwp.cc: Include dwarf.h.
555 (Section_bounds): New struct type.
556 (Unit_set): New struct type.
557 (Dwo_file::Dwo_file): Initialize new data member.
558 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
559 Combine and rename to...
560 (Dwo_file::read_unit_index): ...this.
561 (Dwo_file::sized_read_compunit_index)
562 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
563 (Dwo_file::sized_read_unit_index): ...this.
564 (Dwo_file::copy_section): Remove section_name, is_str_offsets
565 parameters; add section_id parameter.
566 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
567 (Dwo_file::add_unit_set): ...this.
568 (Dwo_file::shndx_map_): Remove.
569 (Dwo_file::sect_offsets_): New data member.
570 (Dwp_output_file::Dwp_output_file): Initialize new data members.
571 (Dwp_output_file::add_section): Rename to...
572 (Dwp_output_file::add_contribution): ...this.
573 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
574 (Dwp_output_file::add_tu_set): Likewise.
575 (Dwp_output_file::Contribution): New type.
576 (Dwp_output_file::Section::contributions): New data member.
577 (Dwp_output_file::Cu_or_tu_set): Remove.
578 (Dwp_output_file::Section::Section): New ctor.
579 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
580 (Dwp_output_file::Dwp_index::Section_table): New type.
581 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
582 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
584 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
585 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
586 (Dwp_output_file::Dwp_index::section_table): New member function.
587 (Dwp_output_file::Dwp_index::section_table_end): New member function.
588 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
589 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
590 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
591 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
592 (Dwp_output_file::Dwp_index::section_table_): New data member.
593 (Dwp_output_file::Dwp_index::section_mask_): New data member.
594 (Dwp_output_file::add_output_section): New member function.
595 (Dwp_output_file::write_new_section): New member function.
596 (Dwp_output_file::write_contributions): New member function.
597 (Dwp_output_file::section_id_map_): New data member.
598 (class Dwo_id_info_reader): Remove.
599 (class Unit_reader): New class.
600 (get_dwarf_section_name): New function.
601 (Dwo_file::read_executable): Adjust initializations of class data.
602 (Dwo_file::read): Add support for v2 package file format.
603 (Dwo_file::read_unit_index): Likewise.
604 (Dwo_file::sized_read_unit_index): Likewise.
605 (Dwo_file::copy_section): Likewise.
606 (Dwo_file::add_unit_set): Likewise.
607 (Dwp_output_file::add_output_section): Likewise.
608 (Dwp_output_file::add_contribution): Likewise.
609 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
611 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
613 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
615 (Dwp_output_file::initialize): Remove unused function.
616 (Dwp_output_file::finalize): Add support for v2 package file format.
617 (Dwp_output_file::write_index): Likewise.
618 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
621 2013-10-31 Cary Coutant <ccoutant@google.com>
623 * configure.ac: Fix check for -fmerge-constants.
624 * configure.ac: Regenerate.
626 2013-10-30 Roland McGrath <mcgrathr@google.com>
628 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
629 Correct 9-byte nop sequence to match what the assembler generates.
631 2013-10-30 Alan Modra <amodra@gmail.com>
633 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
634 ppc64_local_entry_offset, ppc64_local_entry_offset,
635 do_read_symbols): New functions.
636 (Powerpc_relobj::e_flags_, st_other_): New vars.
637 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
638 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
639 (Powerpc_relobj::e_flags_): New var.
640 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
641 and adjust for ELFv2.
642 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
643 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
644 (Powerpc_dynobj::do_find_special_sections): Likewise.
645 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
646 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
647 to ELFv2 local entry.
648 (Target_powerpc::do_relax): No thread safe barriers needed for
650 (Output_data_plt_powerpc::initial_plt_entry_size_,
651 plt_entry_size): Delete. Replace all uses with
652 first_plt_entry_offset() and plt_entry_size().
653 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
654 reserved_size parm. Update callers.
655 (Output_data_plt_powerpc::entry_count): Update.
656 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
657 and use Target_powerpc::first_plt_entry_offset().
658 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
659 rename to plt_entry_size.
660 (Output_data_plt_powerpc::add_ifunc_entry,
661 add_local_ifunc_entry): Adjust reloc for ELFv2.
662 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
663 (glink_eh_frame_fde_64v2): New.
664 (Stub_table::plt_call_size): Support ELFv2 sizing.
665 (Output_data_glink::add_eh_frame): Use the new FDE.
666 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
667 (Stub_table::do_write): Write ELFv2 stubs and glink.
668 (Target_powerpc::Relocate::relocate): Replaces nop after call
669 with ld 2,24(1) and adjust local offset destination for ELFv2.
671 2013-10-30 Alan Modra <amodra@gmail.com>
673 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
674 (Target_powerpc::Scan::global, local): Likewise.
675 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
676 on all ppc64 @h and @ha relocs.
678 2013-10-14 Alan Modra <amodra@gmail.com>
680 * output.h (Output_data_got::add_constant): Tidy.
681 (Output_data_got::add_constant_pair): New function.
682 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
683 methods used so as to first call reserve_ent().
685 2013-10-11 Roland McGrath <mcgrathr@google.com>
687 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
688 add_got_entry and add_got_entry_pair.
690 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
691 (HAVE_PUBNAMES): Likewise.
692 * configure: Regenerate.
694 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
695 * testsuite/Makefile.in: Regenerate.
697 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
698 Remove const from declaration.
699 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
700 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
701 * output.h (Output_file_header): Remove const from member target_
702 and corresponding constructor argument.
703 * output.cc (Output_file_header::Output_file_header): Update prototype.
704 (Output_file_header::do_sized_write): Use this->target_ in place
705 of parameters()->target().
707 * testsuite/undef_symbol.cc (Foo::get_a): New method.
709 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
710 * configure: Regenerate.
711 * Makefile.in: Regenerate.
712 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
713 * testsuite/merge_string_literals_2.c: Likewise.
714 * testsuite/Makefile.am
715 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
716 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
717 literal -fmerge-constants.
718 * testsuite/Makefile.in: Regenerate.
720 * i386.cc (Target_i386): Remove unused member dynbss_.
721 * arm.cc (Target_arm): Likewise.
722 * powerpc.cc (Target_powerpc): Likewise.
723 * sparc.cc (Target_sparc): Likewise.
724 * tilegx.cc (Target_tilegx): Likewise.
725 * x86_64.cc (Target_x86_64): Likewise.
726 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
727 type_signature_, type_offset_.
728 * plugin.h (Plugin_hook): Remove unused member layout_.
729 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
731 (Read_member): Remove unused members input_objects_, symtab_,
733 (Check_library): Remove unused member symtab_.
734 * archive.h (Lib_group): Remove unused member lib_.
735 * archive.cc (Lib_group::Lib_group): Update initializer.
736 * incremental.h (Incremental_binary): Remove unused member target_.
737 (Incremental_script_entry): Removed unused member script_.
738 * layout.h (Write_symbols_task): Remove unused member input_objects_.
739 * icf.h (Icf): Remove unused member num_tracked_relocs.
741 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
742 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
744 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
746 * archive.h: Use struct rather than class for forward declaration
747 of Read_symbols_data.
749 2013-10-07 Cary Coutant <ccoutant@google.com>
752 * testsuite/Makefile.am (icf_test): Fix dependencies.
753 (icf_safe_test): Likewise.
754 (icf_safe_so_test): Likewise.
755 (large_symbol_alignment): Add empty _LDADD rule.
756 * testsuite/Makefile.in: Regenerate.
758 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
761 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
762 relocation for R_X86_64_32 on x32.
764 2013-08-27 Roland McGrath <mcgrathr@google.com>
766 * output.cc (Output_segment::set_section_addresses): Take new
767 Target* argument. If target->isolate_execinstr() and the segment
768 is executable and starts at a target->abi_pagesize() boundary,
769 pad its end out to a target->abi_pagesize() boundary with code fill.
770 * output.h (Output_segment::set_section_addresses): Update decl.
771 * layout.h (Layout::check_output_data_for_reset_values): Take new
772 argument RELAX_OUTPUTS.
773 (Layout): New member relax_output_list_.
774 (Layout::add_relax_output): New method.
775 * layout.cc (Layout::Layout): Update constructor.
776 (Layout::reset_relax_output): New method.
777 (Layout::clean_up_after_relaxation): Call it.
778 (Layout::prepare_for_relaxation): Update caller.
779 (Layout::set_segment_offsets): Update callers of set_section_addresses.
780 Call reset_relax_output before re-processing segments for
781 isolate_execinstr case.
782 (Layout::write_data): Handle relax_output_list_.
783 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
784 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
786 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
789 * object.h: Fix typos.
791 2013-08-16 Roland McGrath <mcgrathr@google.com>
793 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
794 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
796 2013-08-07 Cary Coutant <ccoutant@google.com>
798 Revert support for v2 DWP files:
800 2013-03-01 Cary Coutant <ccoutant@google.com>
802 Add dwp support for v2 DWARF package file format.
803 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
804 tu_length parameter. Adjust all callers.
805 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
806 * dwp.cc: Include dwarf.h.
807 (Section_bounds): New struct type.
808 (Unit_set): New struct type.
809 (Dwo_file::Dwo_file): Initialize new data member.
810 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
811 Combine and rename to...
812 (Dwo_file::read_unit_index): ...this.
813 (Dwo_file::sized_read_compunit_index)
814 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
815 (Dwo_file::sized_read_unit_index): ...this.
816 (Dwo_file::copy_section): Remove section_name, is_str_offsets
817 parameters; add section_id parameter.
818 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
819 (Dwo_file::add_unit_set): ...this.
820 (Dwo_file::shndx_map_): Remove.
821 (Dwo_file::sect_offsets_): New data member.
822 (Dwp_output_file::Dwp_output_file): Initialize new data members.
823 (Dwp_output_file::add_section): Rename to...
824 (Dwp_output_file::add_contribution): ...this.
825 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
826 (Dwp_output_file::add_tu_set): Likewise.
827 (Dwp_output_file::Contribution): New type.
828 (Dwp_output_file::Section::contributions): New data member.
829 (Dwp_output_file::Cu_or_tu_set): Remove.
830 (Dwp_output_file::Section::Section): New ctor.
831 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
832 (Dwp_output_file::Dwp_index::Section_table): New type.
833 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
834 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
836 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
837 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
838 (Dwp_output_file::Dwp_index::section_table): New member function.
839 (Dwp_output_file::Dwp_index::section_table_end): New member function.
840 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
841 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
842 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
843 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
844 (Dwp_output_file::Dwp_index::section_table_): New data member.
845 (Dwp_output_file::Dwp_index::section_mask_): New data member.
846 (Dwp_output_file::add_output_section): New member function.
847 (Dwp_output_file::write_new_section): New member function.
848 (Dwp_output_file::write_contributions): New member function.
849 (Dwp_output_file::section_id_map_): New data member.
850 (class Dwo_id_info_reader): Remove.
851 (class Unit_reader): New class.
852 (get_dwarf_section_name): New function.
853 (Dwo_file::read_executable): Adjust initializations of class data.
854 (Dwo_file::read): Add support for v2 package file format.
855 (Dwo_file::read_unit_index): Likewise.
856 (Dwo_file::sized_read_unit_index): Likewise.
857 (Dwo_file::copy_section): Likewise.
858 (Dwo_file::add_unit_set): Likewise.
859 (Dwp_output_file::add_output_section): Likewise.
860 (Dwp_output_file::add_contribution): Likewise.
861 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
863 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
865 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
867 (Dwp_output_file::initialize): Remove unused function.
868 (Dwp_output_file::finalize): Add support for v2 package file format.
869 (Dwp_output_file::write_index): Likewise.
870 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
873 2013-07-31 Cary Coutant <ccoutant@google.com>
875 * object.cc (Sized_relobj::do_output_section_address): New function.
876 (Sized_relobj): Instantiate explicitly.
877 * object.h (Object::output_section_address): New function.
878 (Object::do_output_section_address): New function.
879 (Sized_relobj::do_output_section_address): New function.
880 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
882 2013-07-30 Cary Coutant <ccoutant@google.com>
883 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
885 * parameters.cc (Parameters::entry): Return target-specific entry
887 * target.h (Target::entry_symbol_name): New function.
888 (Target_info::entry_symbol_name): New data member.
890 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
891 * i386.cc (Target_i386::i386_info): Likewise.
892 (Target_i386_nacl::i386_nacl_info): Likewise.
893 * sparc.cc (Target_sparc::sparc_info): Likewise.
894 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
895 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
896 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
897 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
899 2013-07-22 Sterling Augustine <saugustine@google.com>
901 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
902 Convert parameter shndx to local variable. Add parameters symtab
903 and symtab_size. Scan over section names. Find relocation
904 section corresponding to current section. Create and initialize
905 reloc_mapper_ and reloc_type_.
906 (Dwarf_pubnames_table::read_header): Add assertion. Change
907 unit_length to off_t. Initialize member unit_length_. Fill in field
909 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
910 Initialize new fields unit_length_ and cu_offset_.
911 (Dwarf_pubnames_table::read_section): Update prototype.
912 (Dwarf_pubnames_table::cu_offset): New member function.
913 (Dwarf_pubnames_table::subsection_size): Likewise.
914 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
916 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
917 member functions public.
918 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
919 Update comment. Rework logic. Move repeated parts to...
920 (Gdb_index_info_reader::read_pubtable): ...here. New function.
921 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
922 pubtypes_table_, and stmt_list_offset.
923 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
924 Gdb_index::find_pubtype_offset,
925 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
926 (Gdb_index::pubnames_read): Update prototype and rework logic.
927 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
929 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
930 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
931 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
932 Gdb_index::map_pubtable_to_dies):
934 (Gdb_index::pubnames_read): Update declaration.
935 (Gdb_index::Pubname_offset_map): New type.
936 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
937 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
938 Gdb_index::stmt_list_offset): Declare.
939 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
940 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
941 Gdb_index::pubtypes_offset_): Remove.
943 2013-07-19 Roland McGrath <mcgrathr@google.com>
945 * options.h (General_options): Add -Trodata-segment option.
946 * parameters.cc (Parameters::check_rodata_segment): New function.
947 (Parameters::set_target_once): Call it.
948 * parameters.h (Parameters): Declare it (private member function).
949 * layout.cc (load_seg_unusable_for_headers): New function, broken
950 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
951 then validate rodata segment rather than text segment.
952 (relaxation_loop_body): Call that.
953 (is_text_segment): New function. Don't admit a non-executable
954 segment if TARGET->isolate_execinstr().
955 (set_segment_offsets): Call it. Honor -Trodata-segment option.
957 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
960 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
961 * nacl.h (Sniff_file::View::View): Request aligned view.
963 2013-07-11 Cary Coutant <ccoutant@google.com>
965 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
966 correct BRLT entry size.
968 2013-07-03 Alan Modra <amodra@gmail.com>
970 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
973 2013-07-01 Cary Coutant <ccoutant@google.com>
975 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
977 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
978 (Dwarf_ranges_table::lookup_reloc): New function.
979 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
981 (Dwarf_ranges_table::lookup_reloc): New function.
982 (Dwarf_ranges_table::reloc_type_): New data member.
984 2013-06-27 Jing Yu <jingyu@google.com>
987 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
989 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
990 (Target_powerpc::do_relax): Call the above.
992 2013-06-27 Cary Coutant <ccoutant@google.com>
994 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
995 on garbage collected .opd section.
997 2013-06-27 Alan Modra <amodra@gmail.com>
999 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1001 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1002 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1004 2013-06-14 Cary Coutant <ccoutant@google.com>
1006 * resolve.cc (Symbol::override_base): Don't override st_type
1007 from plugin placeholder symbols.
1008 (Symbol_table::resolve): Likewise.
1009 (Symbol_table::should_override): Don't complain about TLS mismatch
1010 if the TO symbol is a plugin placeholder.
1011 * testsuite/Makefile.am (plugin_test_tls): New test.
1012 * testsuite/Makefile.in: Regenerate.
1013 * testsuite/plugin_test_tls.sh: New test script.
1014 * testsuite/two_file_test_2_tls.cc: New test source.
1015 * testsuite/two_file_test_tls.cc: New test source.
1017 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1019 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1020 the maximum segment alignment is larger than the page size.
1021 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1022 correctly aligns the symbols with large alignemnt.
1023 * testsuite/Makefile.in: Regenerate.
1024 * testsuite/large_symbol_alignment.cc: New file.
1026 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1027 Sriraman Tallam <tmsriram@google.com>
1029 * options.h (sort_section): New option.
1030 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1031 Rename from Input_section_sort_section_name_special_ordering_compare.
1032 (Input_section_sort_section_name_compare): New struct.
1033 * output.cc (Output_section::Input_section_sort_section_name_compare::
1034 operator()): New function.
1035 (Output_section::sort_attached_input_sections): Use new sort function
1036 for .text if --sort-section=name is specified.
1037 * layout.cc (Layout::make_output_section):
1038 Add sorting by name when --sort-section=name is specified.
1039 * testsuite/Makefile.am (text_section_grouping): Test option
1040 --sort-section=name.
1041 * testsuite/Makefile.in: Regenerate.
1042 * testsuite/section_sorting_name.cc: New file.
1043 * testsuite/section_sorting_name.sh: New file.
1045 2013-05-21 Cary Coutant <ccoutant@google.com>
1047 * symtab.h (Symbol::is_cxx_vtable): New function.
1048 * target-reloc.h (relocate_section): Check for vtable symbol.
1049 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1050 * testsuite/Makefile.in: Regenerate.
1051 * testsuite/missing_key_func.cc: New test source.
1052 * testsuite/missing_key_func.sh: New test script.
1054 2013-05-21 Cary Coutant <ccoutant@google.com>
1056 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1057 type of enclosing symbol.
1058 (Relocate_info::location): Check symbol type when describing symbol.
1059 * object.h (Symbol_location_info): Remove unused line_number;
1060 add enclosing_symbol_type.
1061 * testsuite/debug_msg.sh: Adjust expected output.
1063 2013-05-13 Cary Coutant <ccoutant@google.com>
1065 * configure.ac: Export DEFAULT_TARGET.
1066 * configure: Regenerate.
1067 * Makefile.in: Regenerate.
1068 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1069 * testsuite/Makefile.in: Regenerate.
1070 * testsuite/debug_msg.sh: Delete duplicate tests.
1071 Don't check undef_int error message match for powerpc where the
1072 source file and line number aren't available.
1074 2013-05-10 Roland McGrath <mcgrathr@google.com>
1076 * options.h (General_options): Add --rosegment-gap option.
1077 * options.cc (finalize): --rosegment-gap implies --rosegment.
1078 * layout.cc (set_segment_offsets): Let user option override
1079 target->rosegment_gap().
1081 2013-05-10 Roland McGrath <mcgrathr@google.com>
1083 * options.h (General_options): Remove leading space from help
1084 messages for -nostdlib and --rosegment.
1086 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1089 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1091 2013-05-03 Alan Modra <amodra@gmail.com>
1093 * merge.cc (Output_merge_string::do_add_input_section): Correct
1094 scan for number of strings. Rename vars to avoid shadowing.
1095 Include missing terminator in input_size_.
1097 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1099 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1100 Restore empty string handling.
1102 2013-05-01 Cary Coutant <ccoutant@google.com>
1104 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1105 uninitialized warning.
1107 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1109 * output.cc (Output_section::add_merge_input_section): Allow
1110 to merge sections if the alignment is more than character size.
1111 * merge.h (Output_merge_string::Output_merge_string): Remove
1113 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1114 only not-null strings. Check the alignment of strings.
1116 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1117 alignment as the argument.
1118 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1119 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1120 Align non-zero length strings according to the addralign_.
1121 (Stringpool_template<Stringpool_char>::set_string_offsets):
1122 Updating offsets according to the given alignment.
1123 * testsuite/Makefile.am (text_section_grouping): Test if string
1124 literals are getting merged.
1125 * testsuite/Makefile.in: Regenerate.
1126 * testsuite/merge_string_literals_1.c: New file.
1127 * testsuite/merge_string_literals_2.c: Ditto.
1128 * testsuite/merge_string_literals.sh: Ditto.
1130 2013-04-26 Ian Lance Taylor <iant@google.com>
1132 * target-reloc.h (relocate_section): If the reloc offset is out of
1133 range, pass VIEW as NULL to relocate.relocate.
1134 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1135 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1136 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1137 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1138 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1139 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1141 2013-04-26 Geoff Pike <gpike@chromium.org>
1143 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1144 * layout.cc (Hash_task): New class.
1145 (Layout::queue_build_id_tasks): New function.
1146 (Layout::write_build_id): Handle single-thread portion of build ID
1147 computation. (In some cases, all of it is single-threaded.) Replace
1148 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1149 functionality in fewer lines of code.
1150 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1151 * options.h (General_options): make "--build-id" default to tree
1152 rather than sha1. Add two new options related to --build-id=tree:
1153 --build-id-chunk-size-for-treehash and
1154 --build-id-min-file-size-for-treehash.
1155 * Makefile.am: add testing of --build-id=tree and related new options
1156 (these tests will be invoked by "make check").
1157 * Makefile.in: Regenerate.
1159 2013-04-25 Alan Modra <amodra@gmail.com>
1161 * configure.tgt: Add powerpcle and powerpc64le.
1163 2013-04-22 Alan Modra <amodra@gmail.com>
1166 * layout.cc (Layout::segment_precedes): Allow more than one
1167 segment with the same type and flags.
1169 2013-04-15 Cary Coutant <ccoutant@google.com>
1171 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1172 allocate space in file for BSS sections.
1174 2013-04-15 Cary Coutant <ccoutant@google.com>
1176 * script-sections.cc (Orphan_output_section): Reset address
1177 to zero after each orphaned section for relocatable links.
1179 2013-04-15 Cary Coutant <ccoutant@google.com>
1181 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1182 section starting address for relocatable link.
1183 * testsuite/Makefile.am (script_test_11): New test.
1184 * testsuite/Makefile.in: Regenerate.
1185 * testsuite/script_test_11.c: New source file.
1186 * testsuite/script_test_11.t: New linker script.
1188 2013-04-13 Alan Modra <amodra@gmail.com>
1190 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1191 owner when sections are not adjacent and exceed group size.
1192 (Target_powerpc::group_sections): Handle corner case.
1193 (Target_powerpc::Branch_info::make_stub): Handle case where
1194 stub table doesn't exist due to branches in non-exec sections.
1195 (Target_powerpc::Relocate::relocate): Likewise.
1197 2013-04-11 Alan Modra <amodra@gmail.com>
1200 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1201 .branch_lt to match bfd ld. Adjust comments throughout file.
1203 2013-04-04 Ian Lance Taylor <iant@google.com>
1206 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1207 sections before checking whether they are included in the link.
1209 2013-03-29 Sriraman Tallam <tmsriram@google.com>
1211 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1212 object before calling the plugin claim_file handler. Pass the elf
1213 object of the archive to the plugin. Delete the elf object if the
1214 plugin claims the file.
1216 2013-03-21 Alan Modra <amodra@gmail.com>
1218 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1219 segment when omagic.
1221 2013-03-21 Alan Modra <amodra@gmail.com>
1223 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1225 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1226 uninitialized" warning.
1228 2013-03-20 Alan Modra <amodra@gmail.com>
1230 * symtab.h (Symbol::clear_version): New function.
1231 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1232 is_needed by weak references. Clear version for symbols defined
1233 in as-needed objects that are not needed.
1235 2013-03-15 Alan Modra <amodra@gmail.com>
1237 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1238 static and public. Add report_err param. Return false for data refs.
1239 (Target_powerpc::rela_dyn_section): New overloaded function.
1240 (Target_powerpc::plt_, iplt_): Elucidate.
1241 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1242 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1243 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1244 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1245 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1246 push_branch and make_plt_entry for ifunc syms when
1247 reloc_needs_plt_for_ifunc.
1248 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1249 for ifunc unless reloc_needs_plt_for_ifunc.
1251 2013-03-15 Alan Modra <amodra@gmail.com>
1253 * gc.h (gc_process_relocs): Don't look through function descriptors.
1254 * icf.cc (get_section_contents): Do so here instead.
1256 2013-03-13 Alan Modra <amodra@gmail.com>
1258 * powerpc.cc (is_branch_reloc): Forward declare.
1259 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1260 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1261 false for 64-bit, true for 32-bit non-branch relocs.
1262 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1263 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1265 (icf_safe_test): Generate linker map file as well as nm output.
1266 (icf_safe_so_test): Likewise.
1267 * testsuite/Makefile.in: Regenerate.
1268 * testsuite/icf_test.sh: Parse linker map file to determine
1270 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1271 * testsuite/icf_safe_so_test.sh: Likewise.
1272 (X86_32_or_ARM_specific_safe_fold): Merge into..
1273 (arch_specific_safe_fold): ..this.
1274 (X86_64_specific_safe_fold): Delete unused function.
1276 2013-03-12 Alan Modra <amodra@gmail.com>
1278 * gc.h (gc_process_relocs): Look through function descriptors
1279 to determine shndx, symvalue and addend used by ICF. Tidy
1280 variable duplication.
1282 2013-03-11 Alan Modra <amodra@gmail.com>
1284 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1285 * layout.cc (Layout_task_runner::run): ..to here.
1286 * symtab.h (struct Symbol_location): Extract from..
1287 (class Symbol_table): ..here.
1288 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1289 * target.h (class Target): Add function_location and
1290 do_function_location functions.
1291 (class Sized_target): Add do_function_location.
1292 * object.h (class Sized_relobj_file): Move find_shdr..
1293 (class Object): ..to here.
1294 * object.cc: Likewise. Update to suit. Instantiate.
1295 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1296 * powerpc.cc (class Powerpc_dynobj): New.
1297 (Target_powerpc::do_function_location): New function.
1298 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1299 (Powerpc_dynobj::do_read_symbols): New function.
1300 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1302 2013-03-08 Ian Lance Taylor <iant@google.com>
1304 * options.cc (General_options::string_to_object_format): Accept
1307 2013-03-08 Alan Modra <amodra@gmail.com>
1309 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1310 pointer to Post_fde.
1311 (struct Post_fde): Move definition to here..
1312 * ehframe.cc (struct Post_fde): ..from here.
1313 (Cie::write): Don't alloc Post_fde.
1314 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1316 2013-03-07 Alan Modra <amodra@gmail.com>
1318 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1319 relocation referencing .LC0.
1320 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1322 2013-03-07 Alan Modra <amodra@gmail.com>
1324 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1325 always_inline. Add assembly for powerpc to avoid GOT.
1327 2013-03-07 Alan Modra <amodra@gmail.com>
1329 * testsuite/script_test_10.sh: Don't test .bss section
1332 2013-03-06 Alan Modra <amodra@gmail.com>
1334 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1335 (Target_powerpc::symval_for_branch): Add symtab param. Update
1336 all callers. Handle folded sections.
1337 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1339 (Global_symbol_visitor_opd::operator()): Likewise.
1341 2013-03-04 Alan Modra <amodra@gmail.com>
1343 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1344 * testsuite/Makefile.in: Regenerate.
1346 2013-03-01 Cary Coutant <ccoutant@google.com>
1348 Add dwp support for v2 DWARF package file format.
1349 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1350 tu_length parameter. Adjust all callers.
1351 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1352 * dwp.cc: Include dwarf.h.
1353 (Section_bounds): New struct type.
1354 (Unit_set): New struct type.
1355 (Dwo_file::Dwo_file): Initialize new data member.
1356 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1357 Combine and rename to...
1358 (Dwo_file::read_unit_index): ...this.
1359 (Dwo_file::sized_read_compunit_index)
1360 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1361 (Dwo_file::sized_read_unit_index): ...this.
1362 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1363 parameters; add section_id parameter.
1364 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1365 (Dwo_file::add_unit_set): ...this.
1366 (Dwo_file::shndx_map_): Remove.
1367 (Dwo_file::sect_offsets_): New data member.
1368 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1369 (Dwp_output_file::add_section): Rename to...
1370 (Dwp_output_file::add_contribution): ...this.
1371 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1372 (Dwp_output_file::add_tu_set): Likewise.
1373 (Dwp_output_file::Contribution): New type.
1374 (Dwp_output_file::Section::contributions): New data member.
1375 (Dwp_output_file::Cu_or_tu_set): Remove.
1376 (Dwp_output_file::Section::Section): New ctor.
1377 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1378 (Dwp_output_file::Dwp_index::Section_table): New type.
1379 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1380 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1382 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1383 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1384 (Dwp_output_file::Dwp_index::section_table): New member function.
1385 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1386 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1387 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1388 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1389 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1390 (Dwp_output_file::Dwp_index::section_table_): New data member.
1391 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1392 (Dwp_output_file::add_output_section): New member function.
1393 (Dwp_output_file::write_new_section): New member function.
1394 (Dwp_output_file::write_contributions): New member function.
1395 (Dwp_output_file::section_id_map_): New data member.
1396 (class Dwo_id_info_reader): Remove.
1397 (class Unit_reader): New class.
1398 (get_dwarf_section_name): New function.
1399 (Dwo_file::read_executable): Adjust initializations of class data.
1400 (Dwo_file::read): Add support for v2 package file format.
1401 (Dwo_file::read_unit_index): Likewise.
1402 (Dwo_file::sized_read_unit_index): Likewise.
1403 (Dwo_file::copy_section): Likewise.
1404 (Dwo_file::add_unit_set): Likewise.
1405 (Dwp_output_file::add_output_section): Likewise.
1406 (Dwp_output_file::add_contribution): Likewise.
1407 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1409 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1411 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1413 (Dwp_output_file::initialize): Remove unused function.
1414 (Dwp_output_file::finalize): Add support for v2 package file format.
1415 (Dwp_output_file::write_index): Likewise.
1416 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1419 2013-03-01 Cary Coutant <ccoutant@google.com>
1421 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1422 function into class definition in header file.
1423 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1424 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1426 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1428 2013-02-28 Alan Modra <amodra@gmail.com>
1430 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1431 * target.cc (Target::do_plt_fde_location): New function.
1432 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1433 accessor function, and constructor param.
1434 (struct Post_fde, Post_fdes): Declare.
1435 (Cie::write): Add post_fdes param.
1436 * ehframe.cc (Fde::write): Use plt_fde_location.
1437 (struct Post_fde): Define.
1438 (Cie::write): Stash FDEs added post merge mapping.
1439 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1440 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1441 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1443 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1444 (Target_powerpc::has_glink): New function.
1445 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1446 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1447 glink_eh_frame_fde_32, default_fde): New data.
1448 (Stub_table::eh_frame_added_): New var.
1449 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1451 (Stub_table::add_eh_frame): New function.
1452 (Output_data_glink::add_eh_frame): New function.
1453 (Target_powerpc::make_glink_section): Call add_eh_frame.
1455 2013-02-15 Ian Lance Taylor <iant@google.com>
1457 * options.h (DEFINE_uint64_alias): Define.
1458 (class General_options): Add -Ttext-segment as an alias for
1461 2013-02-15 Alan Modra <amodra@gmail.com>
1463 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1464 (Stub_table::do_write): ..here, two places.
1465 (Stub_table::plt_call_size): Use it here too.
1467 2013-02-11 Ian Lance Taylor <iant@google.com>
1469 * descriptors.cc (Descriptors::close_all): New function.
1470 * descriptors.h (class Descriptors): Declare close_all.
1471 (close_all_descriptors): New inline function.
1472 * plugin.cc: Include "descriptors.h".
1473 (Plugin_manager::cleanup): Call close_all_descriptors.
1475 2013-02-06 Alan Modra <amodra@gmail.com>
1477 * README: Update coding style link.
1479 2013-01-28 Cary Coutant <ccoutant@google.com>
1481 * dwp.cc (File_list): New typedef.
1482 (Dwo_name_info_reader): New class.
1483 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1484 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1485 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1486 (Dwo_file::read_executable): New function.
1487 (Dwo_file::read): Move common setup code to ...
1488 (Dwo_file::make_object): ... here.
1489 (dwp_options): Add --exec/-e.
1493 2013-01-24 Sriraman Tallam <tmsriram@google.com>
1495 * layout.cc (Layout::layout): Check for option text_reorder.
1496 (Layout::make_output_section): Ditto.
1497 * options.h (text_reorder): New option.
1498 * output.cc (Input_section_sort_compare): Remove special ordering
1501 Input_section_sort_section_name_special_ordering_compare::
1502 operator()): New function.
1503 (Output_section::sort_attached_input_sections): Use new sort function
1505 * output.h (Input_section_sort_section_name_special_ordering_compare):
1507 * testsuite/Makefile.am (text_section_grouping): Test option
1509 * testsuite/Makefile.in: Regenerate.
1510 * testsuite/text_section_grouping.sh: Check order of functions without
1511 default text reordering.
1513 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1515 * options.h (General_options): Change default to true for new_dtags.
1517 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1519 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1520 when enable_new_dtags is false. Only add DT_RUNPATH when
1521 enable_new_dtags is true.
1523 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1525 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1526 used in declaration and definition consistent.
1527 (Target_powerpc::symval_for_branch): Ditto.
1529 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1531 * testsuite/plugin_final_layout.cc: Fix comment.
1533 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1535 * layout.cc (Layout::layout): Do not do default sorting for
1536 text sections when section ordering is specified.
1537 (make_output_section): Ditto.
1538 * testsuite/plugin_final_layout.cc: Name the function sections
1539 to catch reordering issues.
1541 2013-01-15 Alan Modra <amodra@gmail.com>
1543 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1546 2013-01-15 Alan Modra <amodra@gmail.com>
1548 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1549 * testsuite/Makefile.in: Regenerate.
1551 2013-01-14 Alan Modra <amodra@gmail.com>
1553 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1554 * testsuite/Makefile.in: Regenerate.
1556 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1559 Fix mingw gold build with plugins enabled
1560 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1561 * configure.ac: Export DLOPEN_LIBS and add headers check.
1562 * plugin.cc: Handle non-dlfcn case.
1563 * Makefile.in: Regenerate.
1564 * config.in: Regenerate.
1565 * configure: Regenerate.
1566 * testsuite/Makefile.in: Regenerate.
1568 2013-01-09 Sriraman Tallam <tmsriram@google.com>
1570 * output.h (sort_attached_input_sections): Change to be public.
1571 * script-sections.cc
1572 (Output_section_definition::set_section_addresses): Sort
1573 attached input sections according to section order before linker
1574 script assigns section addresses.
1575 (Orphan_output_section::set_section_addresses): Sort
1576 attached input sections according to section order before linker
1577 script assigns section addresses.
1578 * Makefile.am (final_layout.sh): Use a simple linker script to
1579 check if section ordering still works.
1580 * Makefile.in: Regenerate.
1582 2013-01-09 Ben Cheng <bccheng@google.com>
1584 * arm.cc (Target_arm::attributes_accept_div): New function.
1585 (Target_arm::attributes_forbid_div): New function.
1586 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1587 attribute using the same new functions as what bfd/elf32_arm.c
1590 2013-01-07 Cary Coutant <ccoutant@google.com>
1593 * output.cc (Output_section::add_input_section): For incremental
1594 updates, don't track input sections that are allocated from patch
1597 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1598 Ian Lance Taylor <iant@google.com>
1601 * configure.ac (--enable-ld): Removed.
1602 (install_as_default): Set to yes only for --enable-gold=default
1604 * configure: Regenerated.
1606 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1608 * options.h (General_options): Add -fuse-ld= for GCC linker
1609 option compatibility.
1611 2013-01-04 Cary Coutant <ccoutant@google.com>
1613 * configure.ac: Fix typo restoring CXXFLAGS.
1614 * configure: Regenerate.
1616 2013-01-04 Cary Coutant <ccoutant@google.com>
1618 * testsuite/Makefile.am (CXXLINK_S): New macro.
1619 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1620 * testsuite/Makefile.in: Regenerate.
1622 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1624 * version.cc (print_version): Update copyright year to 2013.
1626 2012-12-20 Ian Lance Taylor <iant@google.com>
1628 * layout.cc (Layout::special_ordering_of_input_section): New
1630 (Layout::layout): If input section requires special ordering, must
1631 sort input sections.
1632 (Layout::make_output_section): May sort .text input sections.
1633 (Layout::is_section_name_prefix_grouped): Remove.
1634 * layout.h (class Layout): Declare
1635 special_ordering_of_input_section. Don't declare
1636 is_section_name_prefix_grouped.
1637 * output.cc (Output_section::add_input_section): Revert last
1639 (Output_section::Input_section_sort::match_file_name): Don't crash
1640 if called on output section data.
1641 (Output_section::Input_section_sort_compare): Sort based on
1643 (Output_section::Input_section_sort_section_order_index_compare):
1645 (Output_section::sort_attached_input_sections): Likewise.
1647 2012-12-18 Sriraman Tallam <tmsriram@google.com>
1649 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
1650 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1651 * output.cc (Output_section::add_input_section): Check if section
1652 name contains special prefix. Keep input sections to sort such
1654 (Output_section::Input_section_sort_section_order_index_compare
1655 ::operator()): Group sections according to prefixes.
1656 (Output_section::sort_attached_input_sections): Add condition to
1657 Input_section_entry constructor call.
1658 * testsuite/Makefile.am (text_section_grouping): New test.
1659 * testsuite/Makefile.in: Regenerate.
1660 * testsuite/text_section_grouping.cc: New file.
1661 * testsuite/text_section_grouping.sh: New file.
1663 2012-12-17 Nick Clifton <nickc@redhat.com>
1665 * Makefile.am: Add copyright notice.
1668 * configure.ac: Likewise.
1669 * ftruncate.c: Likewise.
1670 * Makefile.in: Regenerate.
1672 2012-12-14 Cary Coutant <ccoutant@google.com>
1674 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1675 --no-as-needed flag.
1676 (exception_separate_shared_12_test): Likewise.
1677 (incremental_copy_test): Likewise.
1678 * testsuite/Makefile.in: Regenerate.
1680 2012-12-14 Cary Coutant <ccoutant@google.com>
1682 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1683 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1685 2012-12-12 Alan Modra <amodra@gmail.com>
1687 * powerpc.cc (class Track_tls): New.
1688 (class Relocate, class Scan): Inherit Track_tls.
1689 (Target_powerpc::Scan::local, global): Track tls optimization
1690 and avoid creating plt entry for __tls_get_addr if all uses
1692 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1694 2012-12-12 Alan Modra <amodra@gmail.com>
1696 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1697 Replace no_toc_optimize with toc_optimize.
1698 * output.h (Output_section::input_sections): Provide non-const variant.
1699 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1700 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1702 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1703 (class Sort_toc_sections): New.
1704 (Target_powerpc::do_finalize_sections): Sort toc sections.
1705 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1707 2012-12-10 Roland McGrath <mcgrathr@google.com>
1709 * testsuite/binary_unittest.cc (read_all): New function.
1710 (Sized_binary_test): Use it instead of ::read.
1711 * fileread.cc (do_read): Don't assume pread always reads the whole
1712 amount in a single call.
1714 2012-12-10 Alan Modra <amodra@gmail.com>
1716 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1717 Set EM_PPC64 or EM_PPC here.
1718 (Target_selector_powerpc::do_recognize): Delete.
1720 2012-12-10 Alan Modra <amodra@gmail.com>
1722 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1724 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1726 2012-12-07 Roland McGrath <mcgrathr@google.com>
1728 * testsuite/binary_unittest.cc (Sized_binary_test):
1729 Use open_descriptor rather than ::open.
1731 2012-12-07 Alan Modra <amodra@gmail.com>
1733 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1734 typedef and invalid_address constant.
1735 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1736 instantiate constants.
1738 2012-12-06 Roland McGrath <mcgrathr@google.com>
1740 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1741 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1742 * aclocal.m4: Regenerate.
1743 * configure: Regenerate.
1744 * Makefile.in: Regenerate.
1745 * testsuite/Makefile.in: Regenerate.
1747 2012-12-07 Alan Modra <amodra@gmail.com>
1749 * options.h (General_options): Add no_toc_optimize.
1750 * powerpc.cc (ok_lo_toc_insn): New function.
1751 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1753 2012-12-06 Alan Modra <amodra@gmail.com>
1755 * options.h (General_options): Add plt_align, plt_static_chain,
1756 plt_thread_safe. Update stub_group_size help text.
1757 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1758 for new plt_thread_safe_ var.
1759 (use_plt_offset): Correct comments.
1760 (Target_powerpc::do_relax): Look for thread creation symbols to
1761 determine default plt_thread_safe value. Clear plt call stubs
1762 as well as branch stubs each iteration.
1763 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1765 (l, hi, ha, write_insn): Move earlier.
1766 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1767 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1769 (Stub_table::update_size): Adjust.
1770 (Stub_table::prev_size, set_prev_size): Delete.
1771 (Stub_table::stub_align): Let --plt-align affect result.
1772 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1773 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1774 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1775 (Stub_table::do_write): Support more stub variants.
1777 2012-12-04 Alan Modra <amodra@gmail.com>
1779 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1780 (Target_powerpc::do_define_standard_symbols): New function.
1782 2012-12-03 Alan Modra <amodra@gmail.com>
1784 * output.h: Formatting, whitespace.
1786 2012-12-03 Alan Modra <amodra@gmail.com>
1788 * layout.h (Layout::get_executable_sections): Declare.
1789 * layout.cc (Layout::get_executable_sections): New function.
1790 * arm.cc (Target_arm::group_sections): Use it.
1791 (Arm_output_section::group_sections): Delete now redundant test.
1792 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1793 param to handle relative relocs.
1794 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1795 (Output_data_reloc::add_absolute): Adjust.
1796 (Output_data_reloc::add_relative): New function.
1797 (Output_data::reset_data_size): New function.
1798 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1799 (Output_section::set_addralign): New function.
1800 (Output_section::checkpoint_set_addralign): New function.
1801 (Output_section::clear_section_offsets_need_adjustment): New function.
1802 (Output_section::input_sections): Make public.
1803 * powerpc.cc (class Output_data_brlt_powerpc): New.
1804 (class Stub_table, class Stub_control): New.
1805 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1806 stub_table_, set_stub_table, stub_table): New vectors and accessor
1808 (Target_powerpc::do_may_relax, do_relax, push_branch,
1809 new_stub_table, stub_tables, brlt_section, group_sections,
1810 add_branch_lookup_table, find_branch_lookup_table,
1811 write_branch_lookup_table, make_brlt_section): New functions.
1812 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1813 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1814 branch_info_): New vars.
1815 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1816 make call stubs here.
1817 (Output_data_glink): Remove all call stub handling from this class.
1818 (Target_powerpc::Scan::local, global): Save interesting branch
1819 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1820 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1821 functions on final link.
1822 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1823 Handle long branch destinations too.
1824 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1825 do_plt_address_for_local): Adjust lookup of plt call stubs.
1827 2012-11-30 Alan Modra <amodra@gmail.com>
1829 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1830 relocs against protected symbols when building 32-bit shared libs.
1832 2012-11-30 Alan Modra <amodra@gmail.com>
1834 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1835 param. Call got_section() to make .got. Update all callers
1836 and their callers and so on.
1838 2012-11-30 Alan Modra <amodra@gmail.com>
1840 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1841 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1842 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1843 value if it already exists.
1845 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1848 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1850 2012-11-14 Roland McGrath <mcgrathr@google.com>
1852 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1853 than bfc instruction for data sandboxing.
1855 2012-11-08 Alan Modra <amodra@gmail.com>
1857 * po/POTFILES.in: Regenerate.
1859 2012-11-05 Alan Modra <amodra@gmail.com>
1861 * configure.ac: Apply 2012-09-10 change to config.in here.
1862 * configure: Regenerate.
1864 2012-11-05 Alan Modra <amodra@gmail.com>
1866 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1867 (struct Opd_ent): Use "Address" rather than "Offset".
1868 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1869 (Target_powerpc::got_section): Make public.
1870 (Target_powerpc::scan_relocs): Move code setting symbols..
1871 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1872 Create _SDA_BASE_ only when referenced.
1874 2012-11-02 Roland McGrath <mcgrathr@google.com>
1876 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1879 2012-11-01 Roland McGrath <mcgrathr@google.com>
1881 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1882 for offset_in_output_section parameter.
1883 (Sized_target::relocate_special_relocatable): Likewise.
1884 * arm.cc (Target_arm::relocate_relocs): Likewise.
1885 (Target_arm::relocate_special_relocatable): Likewise.
1886 * i386.cc (Target_i386::relocate_relocs): Likewise.
1887 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1888 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1889 * target-reloc.h (relocate_relocs): Likewise.
1890 * testsuite/testfile.cc (Target_test): Likewise.
1891 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1892 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1894 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1895 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1897 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1898 parameter, which is unused in the [!F_SETFD] case.
1900 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1901 SYMNDX to off_t before comparing it to this->data_size().
1902 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1903 * incremental.cc (Output_section_incremental_inputs::do_write):
1904 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1906 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1908 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1910 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1911 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1914 2012-10-29 Cary Coutant <ccoutant@google.com>
1916 * dwp.cc (usage): Add file and exit status parameters;
1917 add --help and --version options.
1918 (print_version): New function.
1919 (main): Add --help and --version options.
1921 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1923 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1924 final_layout_sequence.txt.
1925 * testsuite/Makefile.in: Regenerated.
1927 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1929 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1930 COMPILE generated by automake.
1932 (CXXCOMPILE1): Likewise.
1933 (CXXLINK1): Likewise.
1934 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1936 (CXXCOMPILE): Likewise.
1937 (CXXLINK): Likewise.
1938 * testsuite/Makefile.in: Regenerated.
1940 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1942 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1943 on bad fwrite return.
1945 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1947 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1950 2012-10-23 Cary Coutant <ccoutant@google.com>
1952 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1953 * testsuite/Makefile.in: Regenerate.
1954 * testsuite/dwp_test.h: New source file.
1955 * testsuite/dwp_test_1.cc: New source file.
1956 * testsuite/dwp_test_1.s: New source file.
1957 * testsuite/dwp_test_1.sh: New source file.
1958 * testsuite/dwp_test_1b.cc: New source file.
1959 * testsuite/dwp_test_1b.s: New source file.
1960 * testsuite/dwp_test_2.cc: New source file.
1961 * testsuite/dwp_test_2.s: New source file.
1962 * testsuite/dwp_test_2.sh: New source file.
1963 * testsuite/dwp_test_main.cc: New source file.
1964 * testsuite/dwp_test_main.s: New source file.
1966 2012-10-23 Cary Coutant <ccoutant@google.com>
1968 * dwp.h: New header file.
1969 * dwp.cc: New source file.
1970 * gold.h: Move shared declarations to system.h.
1971 * system.h: New header file.
1972 * Makefile.am: Add dwp.
1973 * Makefile.in: Regenerate.
1975 2012-10-23 Cary Coutant <ccoutant@google.com>
1977 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1978 Dwarf_info_reader::read_from_pointer.
1979 (Dwarf_pubnames_table::read_header): Likewise.
1980 (Dwarf_pubnames_table::next_name): Likewise.
1981 (Dwarf_die::read_attributes): Likewise.
1982 (Dwarf_die::skip_attributes): Likewise.
1983 (Dwarf_info_reader::read_from_pointer): New function template.
1984 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1985 (Dwarf_pubnames_table): Likewise.
1986 (Dwarf_info_reader::read_from_pointer): New function template.
1987 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1988 Dwarf_pubnames_table ctor.
1990 2012-10-23 Cary Coutant <ccoutant@google.com>
1992 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1994 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1996 (Dwarf_info_reader::set_abbrev_shndx): New method.
1997 (Dwarf_info_reader::abbrev_shndx_): New data member.
1999 2012-10-23 Cary Coutant <ccoutant@google.com>
2001 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2002 from object, not parameters.
2003 (Dwarf_info_reader::parse): Likewise.
2004 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2005 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2006 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2009 2012-10-23 Cary Coutant <ccoutant@google.com>
2011 * fileread.cc (Input_file::Input_file): New constructor.
2012 * fileread.h (class Input_file): Add new constructor.
2014 2012-10-18 Alan Modra <amodra@gmail.com>
2017 * object.cc (Relobj::is_section_name_included): Also match
2018 .sdata personality section.
2020 2012-10-18 Alan Modra <amodra@gmail.com>
2022 * target-reloc.h (class Default_comdat_behavior): New, package up..
2023 (get_comdat_behaviour): ..this.
2024 (relocate_section): Add Relocate_comdat_behavior template arg,
2025 adjust code to suit.
2026 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2027 (Target_arm::scan_reloc_section): Likewise.
2028 * i386.cc (Target_i386::relocate_section): Likewise.
2029 * sparc.cc (Target_sparc::relocate_section): Likewise.
2030 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2031 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2032 * powerpc.cc (class Relocate_comdat_behavior): New.
2033 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2034 gold::relocate_section with new template arg.
2036 2012-10-18 Alan Modra <amodra@gmail.com>
2038 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2039 dynamic relocs for GOT_TPREL got entries, without symbol if
2041 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2042 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2043 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2045 2012-10-17 Alan Modra <amodra@gmail.com>
2048 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2050 2012-10-16 Sriraman Tallam <tmsriram@google.com>
2052 * layout.cc (Layout::include_section): Keep sections marked
2053 SHF_EXCLUDE when doing relocatable links.
2055 2012-10-16 Alan Modra <amodra@gmail.com>
2057 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2058 (Target_powerpc::do_finalize_sections): Call it.
2059 (Output_data_save_res): New class and supporting functions.
2060 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2061 normal symbols defined in object files.
2063 2012-10-12 Alan Modra <amodra@gmail.com>
2065 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2066 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2067 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2068 section if scan_opd_relocs not yet called.
2069 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2071 2012-10-12 Alan Modra <amodra@gmail.com>
2073 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2074 add_local_ifunc_entry): Revert last change.
2075 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2077 2012-10-05 Alan Modra <amodra@gmail.com>
2079 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2080 do_plt_address_for_global): New functions.
2081 (Output_data_got_powerpc::do_write): Don't segfault when linking
2083 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2084 add_local_ifunc_entry): Return true on adding entry..
2085 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2086 glink->add_entry call. Remove unused symtab param. Adjust calls.
2087 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2088 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2089 set up symbols here.
2090 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2091 syms here. Do so even when no .iplt. Don't segfault when linking
2093 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2094 new variants without reloc param.
2095 (Glink_sym_ent::Glink_sym_ent): Likewise.
2096 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2097 reloc when refs will resolve to plt call stub.
2098 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2099 R_PPC_PLTREL24 to resolve locally.
2100 (Target_powerpc::Scan::global): Correct ifunc handling.
2101 (Target_powerpc::Relocate::relocate): Correct local sym glink
2102 lookup. Don't destroy "value" when we have a plt call stub,
2103 and when checking plt call validity.
2104 (Target_powerpc::do_dynsym_value): Simplify.
2106 2012-10-05 Alan Modra <amodra@gmail.com>
2108 * i386.cc (Output_data_plt_i386::address_for_global,
2109 address_for_local): Add plt offset to returned value. Adjust uses.
2110 * sparc.cc (Output_data_plt_sparc::address_for_global,
2111 address_for_local): Likewise.
2112 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2113 address_for_local): Likewise.
2114 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2115 address_for_local): Likewise.
2116 * target.h (Target::plt_address_for_global, plt_address_for_local):
2118 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2119 (Output_data_got::Got_entry::write): Nor here.
2120 * output.h: Comment fix.
2122 2012-10-02 Jiong Wang <jiwang@tilera.com>
2124 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2125 global_offset_table_ value for larget got.
2126 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2128 2012-09-29 Alan Modra <amodra@gmail.com>
2130 * powerpc.cc (Target_powerpc::iplt_): New output section.
2131 (Target_powerpc::iplt_section, make_iplt_section,
2132 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2133 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2134 Target_powerpc::plt_entry_count): Count iplt entries too.
2135 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2136 reloc section in constructor. New params.
2137 (Target_powerpc::make_plt_section): Create reloc section here instead.
2138 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2140 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2141 (Output_data_glink::add_entry, find_entry): New functions to
2142 deal with local syms.
2143 (Glink_sym_ent): Add support for local syms.
2144 (Output_data_glink::do_write): Handle ifunc plt entries.
2145 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2146 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2147 (Target_powerpc::Relocate::relocate): Likewise.
2148 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2150 2012-09-25 Alan Modra <amodra@gmail.com>
2152 * object.h (Sized_relobj_file::adjust_local_symbol,
2153 do_adjust_local_symbol): New functions.
2154 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2155 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2156 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2157 and irregular opd entry spacing.
2158 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2159 (Global_symbol_visitor_opd): New functor.
2160 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2161 on deleted opd entries.
2163 2012-09-15 Jiong Wang <jiwang@tilera.com>
2165 * tilegx.cc: New file.
2166 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2167 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2168 * configure.tgt: Add entries for tilegx*.
2169 * configure.ac: Likewise.
2170 * Makefile.in: Rebuild.
2171 * configure: Likewise.
2172 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2175 2012-09-13 Alan Modra <amodra@gmail.com>
2177 * target-reloc.h (scan_relocs): Call scan.local for relocs
2178 against symbols in discarded sections. Pass is_discarded
2180 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2181 Add is_discarded param.
2182 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2183 is_discarded to flag opd entry as discarded. Don't emit dyn
2184 relocs on such entries.
2185 (Target_powerpc::Scan::global): Similarly detect and handle
2187 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2188 opd_ent_. Update all uses.
2189 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2190 (Target_powerpc::relocate_section): Zero out discarded opd
2193 2012-09-12 Ian Lance Taylor <iant@google.com>
2196 * output.cc: Rename Output_data_got template parameter from size
2197 to got_size for all functions. Compile all variants of
2199 (Output_data_got::Got_entry::write): Correct use of size for
2200 symbol value. Use local_is_tls rather than casting to
2202 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2203 (class Sized_relobj_file): Add do_local_is_tls.
2204 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2206 2012-09-11 Alan Modra <amodra@gmail.com>
2209 * layout.cc (Layout::set_segment_offsets): When using
2210 common-page-size alignment, ensure we are on a new max-page-size
2212 * output.cc (Output_segment::set_section_addresses): Use
2213 abi_pagesize, not common_pagesize for relro boundary.
2214 (Output_segment::set_offset): Likewise.
2216 2012-09-11 Alan Modra <amodra@gmail.com>
2218 * output.h (Output_data_got::add_global_tls, add_local_tls,
2219 add_local_tls_pair): New functions.
2220 (Output_data_got::add_local_pair_with_rel): Remove second
2221 reloc param. Expand comment.
2222 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2223 use_plt_or_tls_offset_, similarly for constructor param.
2224 (Output_data_got::Got_entry::write): Add got_index param.
2225 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2226 add_local_tls_pair): New functions.
2227 (Output_data_got::Got_entry::write): Handle tls symbols
2228 with use_plt_or_tls_offset_ set specially.
2229 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2230 (Output_data_got::do_write): Replace iterator with index, pass
2231 index to entry write function.
2232 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2233 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2234 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2236 * i386.cc (Target_i386::Scan::local): Likewise.
2237 * sparc.cc (Target_sparc::Scan::local): Likewise.
2238 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2239 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2240 do_tls_offset_for_global): New functions.
2241 (Target_powerpc::Scan::local): Correct TLS relocations and got
2243 (Target_powerpc::Scan::global): Don't emit unnecessary
2244 dynamic relocations on TLS GOT entries.
2246 2012-09-10 Matthias Klose <doko@ubuntu.com>
2248 * config.in: Disable sanity check for kfreebsd.
2250 2012-09-10 Sterling Augustine <saugustine@google.com>
2252 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2253 (Gdb_index::pubtypes_read): New parameter.
2254 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2256 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2259 2012-09-09 Alan Modra <amodra@gmail.com>
2261 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2262 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2263 * gc.h (gc_process_relocs): Call target gc_add_reference.
2264 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2265 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2266 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2268 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2269 to cater for when we don't need code offset. Update use.
2270 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2271 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2272 set_opd_valid): New functions.
2273 (Target_powerpc::do_gc_add_reference): New function.
2274 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2276 (Target_powerpc::do_gc_mark_symbol): New function.
2278 2012-09-06 Cary Coutant <ccoutant@google.com>
2280 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2281 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2282 (Dwarf_die::skip_attributes): Likewise.
2283 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2284 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2286 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2288 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2290 * testsuite/script_test_3.t: Add .got.plt output section
2292 * testsuite/script_test_4.t: Likewise.
2294 2012-09-05 Alan Modra <amodra@gmail.com>
2296 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2297 update all uses and lose "enum" when using type.
2299 2012-09-05 Alan Modra <amodra@gmail.com>
2301 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2302 * configure: Regenerate.
2303 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2304 (plugin_final_layout.stdout): Likewise.
2305 (memory_test): Set page sizes to 0x1000.
2306 * testsuite/Makefile.in: Regenerate.
2307 * testsuite/discard_locals_test.sh: Add FIXME comment.
2308 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2309 * testsuite/pr14265.t: Add .got output section statement.
2310 * testsuite/script_test_2.t: Likewise.
2311 * testsuite/script_test_3.t: Likewise.
2312 * testsuite/script_test_4.t: Likewise.
2313 * testsuite/script_test_5.t: Likewise.
2314 * testsuite/script_test_6.t: Likewise.
2315 * testsuite/script_test_7.t: Likewise.
2316 * testsuite/script_test_9.t: Likewise.
2318 2012-09-05 Alan Modra <amodra@gmail.com>
2320 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2321 (Powerpc_relocate_functions::Status): New typedef.
2322 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2323 (Target_powerpc::Scan::local): Handle REL64.
2324 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2325 for REL32 and REL64.
2326 (Target_powerpc::symval_for_branch): New function, extracted from..
2327 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2328 checks. Report overflow errors.
2330 2012-09-05 Alan Modra <amodra@gmail.com>
2332 * object.h (Sized_relobj_file::emit_relocs): Delete.
2333 (Sized_relobj_file::emit_relocs_reltype): Delete.
2334 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2335 relocate_relocs for --emit-relocs.
2336 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2337 * output.h: Update comment.
2338 (Output_segment::first_section): New function.
2339 (Output_segment::first_section_load_address): Use first_section.
2340 * output.cc (Output_segment::first_section): New function extracted..
2341 (Output_segment::first_section_load_address): ..from here. Delete.
2342 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2343 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2344 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2345 adjust call to target.h function.
2346 * i386.cc (Target_i386): Likewise.
2347 * sparc.cc (Target_sparc): Likewise.
2348 * x86_64.cc (Target_x86_64): Likewise.
2349 * powerpc.cc (Target_powerpc): Likewise.
2350 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2351 first tls section has section symbol for optimised local dynamic
2353 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2354 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2356 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2357 Rename to relocate_relocs. Update error message.
2359 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2361 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2364 2012-08-31 Alan Modra <amodra@gmail.com>
2366 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2367 (Powerpc_relobj::toc_base_offset): New stub function.
2368 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2369 got_mod_index_offset to tlsld_got_offset. Update all refs.
2370 (Target_powerpc::Relocate::enum skip_tls): New.
2371 (Target_powerpc::call_tls_get_addr_): New var.
2372 (Target_powerpc::is_branch_reloc): Move to file scope.
2373 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2374 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2376 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2377 (powerpc_info): Correct common_pagesize for ppc64.
2378 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2379 (Powerpc_relocate_functions): Add overflow check enums and functions.
2380 Add non-shift version of rela, rela_ua. Delete all rel public
2381 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2382 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2383 addr16_ha3, addr14 functions.
2384 (Output_data_got_powerpc::add_constant_pair): New function.
2385 (Output_data_got_powerpc::got_base_offset): Likewise.
2386 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2387 (instruction constants): Sort, add some more.
2388 (Output_data_glink::do_write): Add and use Address typedef. Use
2389 object->toc_base_offset() stub for 64-bit.
2390 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2391 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2392 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2393 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2394 Always treat .opd relocs as against locally defined symbol.
2395 Correct condition for RELATIVE relocs.
2396 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2397 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2398 for 32-bit syms with a plt entry. Correct ppc64 toc base
2399 calculations. Handle TLS relocs, and more. Add overflow
2400 checking and adjust for Powerpc_relocate_functions changes.
2401 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2402 Reinstate --emit-relocs code with FIXME.
2404 2012-08-30 Alan Modra <amodra@gmail.com>
2406 * layout.cc (Layout::set_segment_offsets): Set p_align to
2407 abi_pagesize, not common_pagesize.
2408 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2409 to determine whether file header can go in segment.
2411 2012-08-30 Alan Modra <amodra@gmail.com>
2413 * output.h (Output_reloc::Output_reloc <output section>): Add
2414 is_relative param. Adjust calls.
2415 (Output_reloc::add_output_section_relative): New functions.
2416 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2418 (Output_reloc::symbol_value): Handle SECTION_CODE.
2420 2012-08-24 Sriraman Tallam <tmsriram@google.com>
2422 * gold.cc (queue_middle_tasks): Call layout again when unique
2423 segments for sections is desired.
2424 * layout.cc (Layout::Layout): Initialize new members.
2425 (Layout::get_output_section_flags): New function.
2426 (Layout::choose_output_section): Call get_output_section_flags.
2427 (Layout::layout): Make output section for mapping to a unique segment.
2428 (Layout::insert_section_segment_map): New function.
2429 (Layout::attach_allocated_section_to_segment): Make unique segment for
2430 output sections marked so.
2431 (Layout::segment_precedes): Check for unique segments when sorting.
2432 * layout.h (Layout::Unique_segment_info): New struct.
2433 (Layout::Section_segment_map): New typedef.
2434 (Layout::insert_section_segment_map): New function.
2435 (Layout::get_output_section_flags): New function.
2436 (Layout::is_unique_segment_for_sections_specified): New function.
2437 (Layout::set_unique_segment_for_sections_specified): New function.
2438 (Layout::unique_segment_for_sections_specified_): New member.
2439 (Layout::section_segment_map_): New member.
2440 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2441 Rename is_gc_pass_one to is_pass_one.
2442 Rename is_gc_pass_two to is_pass_two.
2443 Rename is_gc_or_icf to is_two_pass.
2444 Check for which pass based on whether symbols data is present.
2445 Make it two pass when unique segments for sections is desired.
2446 * output.cc (Output_section::Output_section): Initialize new
2448 * output.h (Output_section::is_unique_segment): New function.
2449 (Output_section::set_is_unique_segment): New function.
2450 (Output_section::is_unique_segment_): New member.
2451 (Output_section::extra_segment_flags): New function.
2452 (Output_section::set_extra_segment_flags): New function.
2453 (Output_section::extra_segment_flags_): New member.
2454 (Output_section::segment_alignment): New function.
2455 (Output_section::set_segment_alignment): New function.
2456 (Output_section::segment_alignment_): New member.
2457 (Output_segment::Output_segment): Initialize is_unique_segment_.
2458 (Output_segment::is_unique_segment): New function.
2459 (Output_segment::set_is_unique_segment): New function.
2460 (Output_segment::is_unique_segment_): New member.
2461 * plugin.cc (allow_unique_segment_for_sections): New function.
2462 (unique_segment_for_sections): New function.
2463 (Plugin::load): Add new functions to transfer vector.
2464 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2465 * Makefile.in: Regenerate.
2466 * testsuite/plugin_final_layout.sh: Check if unique segment
2467 functionality works.
2468 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2470 (allow_unique_segment_for_sections): New global.
2471 (unique_segment_for_sections): New global.
2472 (claim_file_hook): Call allow_unique_segment_for_sections.
2473 (all_symbols_read_hook): Call unique_segment_for_sections.
2475 2012-08-22 Cary Coutant <ccoutant@google.com>
2477 * layout.cc (Layout::include_section): Don't assert on GROUP
2478 sections with --emit-relocs.
2480 2012-08-21 Cary Coutant <ccoutant@google.com>
2482 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2483 if --export-dynamic-symbol names an undef symbol.
2485 2012-08-18 Alan Modra <amodra@gmail.com>
2487 * powerpc.cc: Formatting and white space.
2488 (Powerpc_relobj): Rename got2_section_ to special_.
2489 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2490 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2491 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2492 (Target_powerpc): Add Address typedef and invalid_address. Use
2494 (Target_powerpc::is_branch_reloc): New function.
2495 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2496 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2497 for dst_mask, value and addend.
2498 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2499 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2500 (Output_data_glink::do_write): Correct toc base. Don't try to use
2501 uint16_t for 24-bit offset. Use get_output_section_offset and
2503 (Target_powerpc::Scan::local): Handle more relocs.
2504 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2505 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2506 Plug in toc restoring insn after plt calls. Translate branches
2507 to function descriptor symbols to corresponding entry point.
2508 (Target_powerpc::relocate_for_relocatable): Check return from
2509 get_output_section_offset.
2510 * symtab.h: Comment typo.
2512 2012-08-14 Ian Lance Taylor <iant@google.com>
2514 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2515 unsupported_relocal_local to call unsupported_reloc_global.
2517 2012-08-14 Nick Clifton <nickc@redhat.com>
2520 * script-sections.cc (Sections_element::output_section_name): Add
2521 keep return parameter.
2522 (Output_section_element::match_name): Add keep return parameter.
2523 Return the value of the keep_ member.
2524 * script-sections.h (class Output_section): Update
2525 output_section_name prototype.
2526 * layout.cc (Layout::keep_input_section): New public member
2528 (Layout::choose_output_section): Pass keep parameter to
2529 output_section_name.
2530 * layout.h (class Layout): Add keep_input_section.
2531 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2533 * testsuite/Makefile.am: Add a test.
2534 * testsuite/Makefile.in: Regenerate.
2535 * testsuite/pr14265.c: Source file for the test.
2536 * testsuite/pr14265.t: Linker script for the test.
2537 * testsuite/pr14265.sh: Shell script for the test.
2539 2012-08-14 Alan Modra <amodra@gmail.com>
2541 * target.h (Target::output_section_name): New function.
2542 (Target::do_output_section_name): New function.
2543 * layout.cc (Layout::choose_output_section): Call the above.
2544 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2546 2012-08-14 Alan Modra <amodra@gmail.com>
2548 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2549 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2550 for replace_constant call.
2551 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2552 (Output_data_glink::do_print_to_mapfile): New function.
2553 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2554 (Target_powerpc::Relocate::relocate): Likewise.
2556 2012-08-14 Alan Modra <amodra@gmail.com>
2558 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2559 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2560 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2561 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2562 all references to shndx_. Handle special case for R_PPC_PLTREL24
2564 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2565 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2566 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2568 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2569 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2571 2012-08-12 Alan Modra <amodra@gmail.com>
2573 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2574 (glink insn constants): Use uint32_t.
2575 (Output_data_glink::add_entry): Use insert, not [] operator.
2577 2012-08-11 Alan Modra <amodra@gmail.com>
2579 * object.h (Sized_relobj_file::find_shdr): New function.
2580 (Sized_relobj_file::find_special_sections): New function.
2581 * object.cc (Sized_relobj_file::find_shdr): New function.
2582 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2583 (Sized_relobj_file::find_special_sections): New function, split out..
2584 (Sized_relobj_file::do_read_symbols): ..from here.
2585 * output.h (Output_data_got::replace_constant): New function.
2586 (Output_data_got::num_entries): New function.
2587 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2588 (Output_data_got::got_offset): Protected rather than private.
2589 (Output_data_got::replace_got_entry): New function.
2590 * output.cc (Output_data_got::replace_got_entry): New function.
2591 * powerpc.cc (class Powerpc_relobj): New.
2592 (class Powerpc_relocate_functions): Delete all psymval variants or
2593 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2594 Implement _ha functions using corresponding _hi function.
2595 (Powerpc_relobj::find_special_sections): New function.
2596 (Target_powerpc::do_make_elf_object): New function.
2597 (class Output_data_got_powerpc): New.
2598 (class Output_data_glink): New.
2599 (class Powerpc_scan_relocatable_reloc): New.
2600 Many more changes througout file.
2602 2012-08-09 Nick Clifton <nickc@redhat.com>
2604 * po/vi.po: Updated Vietnamese translation.
2606 2012-08-07 Ian Lance Taylor <iant@google.com>
2608 * layout.cc (Layout::add_target_dynamic_tags): If
2609 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2612 2012-07-30 Nick Clifton <nickc@redhat.com>
2614 * po/gold.pot: Updated template.
2615 * po/es.po: Updated Spanish translation.
2617 2012-07-18 Cary Coutant <ccoutant@google.com>
2620 * configure.ac: Add check for -gpubnames support.
2621 * configure: Regenerate.
2622 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2623 support; force -gno-pubnames.
2624 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2626 (gdb_index_test_4): New test.
2627 * testsuite/Makefile.in: Regenerate.
2628 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2629 * testsuite/gdb_index_test_2.sh: Likewise.
2630 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2631 * testsuite/gdb_index_test_4.sh: New script.
2632 * testsuite/gdb_index_test_comm.sh: New script with common code;
2633 don't look for space after colon.
2635 2012-07-16 Sriraman Tallam <tmsriram@google.com>
2637 * gold.cc (queue_middle_tasks): Update function order only after
2638 deferred objects due to plugins are processed.
2640 2012-07-11 Ian Lance Taylor <iant@google.com>
2642 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2643 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2644 (Target_arm::scan_reloc_for_stub): Likewise.
2645 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2646 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2647 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2648 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2649 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2651 2012-07-10 Dodji Seketeli <dodji@redhat.com>
2652 Ian Lance Taylor <iant@google.com>
2655 * configure.ac: Test whether std::tr1::hash<off_t> works.
2656 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2658 * output.h (class Output_fill): Add virtual destructor.
2659 * configure, config.in: Rebuild.
2661 2012-06-22 Roland McGrath <mcgrathr@google.com>
2663 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2665 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2667 * plugin.cc (Plugin::load): Handle position independent executables.
2669 2012-06-06 Cary Coutant <ccoutant@google.com>
2671 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2673 (lines_only_debug_sections): Likewise.
2674 (gdb_fast_lookup_sections): New static array.
2675 (is_gdb_debug_section): Rename formal parameter.
2676 (is_lines_only_debug_section): Likewise.
2677 (is_gdb_fast_lookup_section): New function.
2678 (Layout::include_section): Check for ".zdebug_" prefix; pass
2679 section name suffix to is_gdb_debug_section, et al.; check for
2680 fast-lookup sections when building .gdb_index.
2681 * options.h (--strip-debug-gdb): Update GDB version number.
2683 2012-06-06 Cary Coutant <ccoutant@google.com>
2685 * configure.ac: Add check for fallocate.
2686 * configure: Regenerate.
2687 * config.in: Regenerate.
2689 * options.h (class General_options): Add --mmap-output-file and
2690 --posix-fallocate options.
2691 * output.cc: (posix_fallocate): Remove; replace with...
2692 (gold_fallocate): New function.
2693 (Output_file::map_no_anonymous): Call gold_fallocate.
2694 (Output_file::map): Check --mmap-output-file option.
2696 2012-06-05 Jing Yu <jingyu@google.com>
2698 * gold.h (textdomain): Add do {} to empty while(0).
2699 (bindtextdomain): Likewise.
2701 2012-06-04 Cary Coutant <ccoutant@google.com>
2703 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2706 2012-05-25 Sriraman Tallam <tmsriram@google.com>
2708 * symtab.cc (Symbol_table::define_special_symbol):
2709 Initialize *poldsym to prevent uninitialized variable errors.
2711 2012-05-23 Cary Coutant <ccoutant@google.com>
2713 * layout.cc (Layout::section_name_mapping): Add rules to handle
2714 exact match on .data.rel.ro.local or .data.rel.ro.
2715 (Layout::output_section_name): Check for exact matches.
2717 2012-05-23 Cary Coutant <ccoutant@google.com>
2719 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2722 2012-05-22 Cary Coutant <ccoutant@google.com>
2724 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2725 object before exporting symbol.
2727 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2729 * testsuite/tls_test.cc: Include "config.h" first.
2730 * testsuite/tls_test_c.c: Likewise.
2732 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
2733 Nick Clifton <nickc@redhat.com>
2736 * configure.in: Add check that sysdep.h has been included before
2737 any system header files.
2738 * configure: Regenerate.
2739 * config.in: Regenerate.
2741 2012-05-14 Cary Coutant <ccoutant@google.com>
2743 * layout.cc (Layout::make_output_section): Mark .tdata section
2745 * testsuite/relro_test.cc: Add a TLS variable.
2747 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2750 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2751 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2754 2012-05-08 Cary Coutant <ccoutant@google.com>
2756 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2757 (lines_only_debug_sections): Likewise.
2759 2012-05-02 Roland McGrath <mcgrathr@google.com>
2761 * nacl.cc: New file.
2763 * Makefile.am (CCFILES, HFILES): Add them.
2764 * Makefile.in: Regenerate.
2765 * i386.cc (Output_data_plt_i386_nacl): New class.
2766 (Output_data_plt_i386_nacl_exec): New class.
2767 (Output_data_plt_i386_nacl_dyn): New class.
2768 (Target_i386_nacl): New class.
2769 (Target_selector_i386_nacl): New class.
2770 (target_selector_i386): Use it instead of Target_selector_i386.
2771 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2772 (Target_x86_64_nacl): New class.
2773 (Target_selector_x86_64_nacl): New class.
2774 (target_selector_x86_64, target_selector_x32): Use it instead of
2775 Target_selector_x86_64.
2776 * arm.cc (Output_data_plt_arm_nacl): New class.
2777 (Target_arm_nacl): New class.
2778 (Target_selector_arm_nacl): New class.
2779 (target_selector_arm, target_selector_armbe): Use it instead of
2780 Target_selector_arm.
2782 * target-select.cc (select_target): Take new Input_file* and off_t
2783 arguments, pass them on to recognize method of selector.
2784 * object.cc (make_elf_sized_object): Update caller.
2785 * parameters.cc (parameters_force_valid_target): Likewise.
2786 * incremental.cc (make_sized_incremental_binary): Likewise.
2787 * target-select.h: Update decl.
2788 (Target_selector::recognize): Take new Input_file* argument,
2789 pass it on to do_recognize.
2790 (Target_selector::do_recognize): Take new Input_file* argument.
2791 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2792 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2793 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2794 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2796 * target.h (Target::Target_info): New members isolate_execinstr
2798 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2799 * arm.cc (Target_arm::arm_info): Update initializer.
2800 * i386.cc (Target_i386::i386_info): Likewise.
2801 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2802 * sparc.cc (Target_sparc::sparc_info): Likewise.
2803 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2804 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2805 * layout.cc (Layout::attach_allocated_section_to_segment):
2806 Take new const Target* argument. If target->isolate_execinstr(), act
2808 (Layout::find_first_load_seg): Take new const Target* argument;
2809 if target->isolate_execinstr(), reject PF_X segments.
2810 (Layout::relaxation_loop_body): Update caller.
2811 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2812 reset file offset to zero when we hit LOAD_SEG, and then do a second
2813 loop over the segments before LOAD_SEG to reassign offsets after
2814 addresses have been determined. Handle target->rosegment_gap().
2815 (Layout::attach_section_to_segment): Take new const Target* argument;
2816 pass it to attach_allocated_section_to_segment.
2817 (Layout::make_output_section): Update caller.
2818 (Layout::attach_sections_to_segments): Take new const Target* argument;
2819 pass it to attach_section_to_segment.
2820 * gold.cc (queue_middle_tasks): Update caller.
2821 * layout.h (Layout): Update method decls with new arguments.
2823 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2824 Target_info pointer to use.
2825 (Target_arm::do_make_data_plt): New virtual method.
2826 (Target_arm::make_data_plt): New method that calls it.
2827 (Target_arm::make_plt_entry): Use it.
2828 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2829 for the section alignment.
2830 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2832 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2833 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2835 (Output_data_plt_arm::get_plt_entry_size): Call it.
2836 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2837 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2838 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2840 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2841 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2842 method instead of sizeof(plt_entry).
2843 (Output_data_plt_arm::add_entry): Likewise.
2844 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2845 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2847 (Target_arm::plt_entry_size): Likewise.
2848 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2850 (Output_data_plt_arm_standard): ... here, new class.
2851 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2852 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2853 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2855 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2856 Take additional argument for the PLT entry size.
2857 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2858 Use get_plt_entry_size method rather than plt_entry_size variable.
2859 (Output_data_plt_x86_64::reserve_slot): Likewise.
2860 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2861 (Output_data_plt_x86_64::add_entry): Likewise.
2862 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2863 (Output_data_plt_x86_64::address_for_global): Likewise.
2864 (Output_data_plt_x86_64::address_for_local): Likewise.
2865 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2866 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2867 Make method non-static.
2868 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2870 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2871 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2872 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2873 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2875 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2876 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2878 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2879 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2881 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2882 (Output_data_plt_x86_64::plt_entry_size)
2883 (Output_data_plt_x86_64::first_plt_entry)
2884 (Output_data_plt_x86_64::plt_entry)
2885 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2886 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2887 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2888 (Output_data_plt_x86_64_standard): ... here, new class.
2889 (Target_x86_64::Target_x86_64): Take optional argument for the
2890 Target_info pointer to use.
2891 (Target_x86_64::do_make_data_plt): New virtual method.
2892 (Target_x86_64::make_data_plt): New method to call it.
2893 (Target_x86_64::init_got_plt_for_update): Use that.
2894 Call this->plt_->add_eh_frame method here.
2895 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2896 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2897 rather than static method.
2898 (Target_x86_64::plt_entry_size): Likewise.
2899 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2900 rather than plt_entry_size variable. Move guts of PLT filling to...
2901 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2902 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2903 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2905 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2906 additional argument for the section alignment.
2907 Don't do add_eh_frame_for_plt here.
2908 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2909 non-static. Use get_plt_entry_size method rather than plt_entry_size
2911 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2913 (Output_data_plt_i386::get_plt_entry_size): Call it.
2914 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2915 (Output_data_plt_i386::add_eh_frame): New method to call it.
2916 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2918 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2919 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2921 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2922 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2923 method instead of plt_entry_size.
2924 (Output_data_plt_i386::plt_entry_size)
2925 (Output_data_plt_i386::plt_eh_frame_fde_size)
2926 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2927 (Output_data_plt_i386_standard): ... here, new class.
2928 (Output_data_plt_i386_exec): New class.
2929 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2930 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2931 (Output_data_plt_i386::exec_plt_entry): Move to ...
2932 (Output_data_plt_i386_exec::plt_entry): ... here.
2933 (Output_data_plt_i386_dyn): New class.
2934 (Output_data_plt_i386::first_plt_entry): Move to ...
2935 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2936 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2937 (Output_data_plt_i386_dyn::plt_entry): ... here.
2938 (Target_i386::Target_i386): Take optional argument for the Target_info
2940 (Target_i386::do_make_data_plt): New virtual method.
2941 (Target_i386::make_data_plt): New method to call it.
2942 (Target_i386::make_plt_section): Use that.
2943 Call this->plt_->add_eh_frame method here.
2944 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2945 rather than plt_entry_size variable.
2946 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2947 (Output_data_plt_i386::address_for_local): Likewise.
2948 (Output_data_plt_i386::do_write): Likewise.
2949 Move guts of PLT filling to...
2950 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2951 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2952 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2953 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2955 2012-05-01 Cary Coutant <ccoutant@google.com>
2957 * dwarf_reader.cc (Dwarf_die::read_attributes)
2958 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2959 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2960 * reduced_debug_output.cc
2961 (Output_reduced_debug_info_section::get_die_end): Remove
2962 DW_FORM_GNU_ref_index. Add default case.
2964 2012-04-26 Mark Wielaard <mjw@redhat.com>
2966 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2967 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2968 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2969 DW_AT_high_pc as offset from DW_AT_low_pc.
2971 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2972 * testsuite/Makefile.in: Regenerate.
2973 * testsuite/gdb_index_test_3.c: New test source file.
2974 * testsuite/gdb_index_test_3.sh: New test source file.
2976 2012-04-25 Ian Lance Taylor <iant@google.com>
2978 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2980 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2981 as a class, not a struct.
2982 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2983 (Target_arm::apply_cortex_a8_workaround): Likewise.
2984 * gc.h: Declare Reloc_types as a struct, not a class.
2985 * object.h: Declare Symbols_data as a struct.
2986 * reloc.h: Declare Read_relocs_data as a struct.
2987 * target.h: Declare Relocate_info as a struct.
2989 2012-04-24 David S. Miller <davem@davemloft.net>
2991 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2992 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2995 2012-04-24 Cary Coutant <ccoutant@google.com>
2997 * incremental-dump.cc (find_input_containing_global): Replace
2998 magic number with symbolic constant.
2999 (dump_incremental_inputs): Update version number.
3000 * incremental.cc (Output_section_incremental_inputs): Update version
3001 number; import symbolic constants from Incremental_inputs_reader.
3002 (Incremental_inputs::create_data_sections): Align relocations
3003 section correctly for 64-bit targets.
3004 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3005 constants; add padding.
3006 (Output_section_incremental_inputs::write_header): Add assert for
3008 (Output_section_incremental_inputs::write_input_files): Add assert
3009 for input_entry_size.
3010 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3011 add assert for object_info_size, input_section_entry_size,
3012 global_sym_entry_size.
3013 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3014 for data structure sizes; use them.
3015 (Incremental_input_entry_reader): Import symbolic constants from
3016 Incremental_inputs_reader; use them.
3018 2012-04-23 David S. Miller <davem@davemloft.net>
3020 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3022 (Target_sparc::Target_sparc): Initialize new fields.
3023 (Target_sparc::do_make_elf_object): New function.
3024 (Target_sparc::do_adjust_elf_header): New function.
3026 2012-04-23 Cary Coutant <ccoutant@google.com>
3028 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3029 CU range table of gdb index.
3031 2012-04-20 David S. Miller <davem@davemloft.net>
3033 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3036 2012-04-16 David S. Miller <davem@davemloft.net>
3038 * sparc.cc (Target_sparc::got_address): New function.
3039 (Sparc_relocate_functions::gdop_hix22): New function.
3040 (Sparc_relocate_functions::gdop_lox10): New function.
3041 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3043 (Target_sparc::Scan::local): Likewise if the global symbol is not
3044 preemptible and is not IFUNC.
3045 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3046 transformations for local and non-preemptible non-IFUNC global
3049 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3050 writing out 64-bit part of ranges.
3052 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3053 -fpic and -fpie respectively.
3054 * Makefile.in: Regenerate.
3056 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3057 (Target_sparc::Target_sparc): Initialize new field.
3058 (Target_sparc::do_plt_section_for_global): New function.
3059 (Target_sparc::do_plt_section_for_local): New function.
3060 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3061 (Target_sparc::make_plt_section): New function, broken out of
3062 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3063 (Target_sparc::make_plt_entry): Call make_plt_section.
3064 (Target_sparc::make_local_ifunc_plt_entry): New function.
3065 (Target_sparc::rela_ifunc_section): New function.
3066 (Target_sparc::plt_section): Remove const.
3067 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3068 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3069 and ifunc_count_ fields.
3070 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3071 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3072 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3073 (Output_data_plt_sparc::rela_ifunc): New function.
3074 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3075 (Output_data_plt_sparc::has_ifunc_section): New function.
3076 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3077 (Output_data_plt_sparc::address_for_global): New function.
3078 (Output_data_plt_sparc::address_for_local): New function.
3079 (Output_data_plt_sparc::plt_index_to_offset): New function.
3080 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3082 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3084 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3085 R_SPARC_JMP_IREL to switch.
3086 (Target_sparc::Scan::check_non_pic): Likewise.
3087 (Target_sparc::Scan::local): Handle IFUNC symbols.
3088 (Target_sparc::Scan::local): Likewise.
3089 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3090 and plt_address_for_local.
3091 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3092 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3094 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3095 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3096 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3097 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3099 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3100 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3102 * sparc.cc (Target_sparc::Scan::global): Likewise.
3103 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3105 2012-04-16 Cary Coutant <ccoutant@google.com>
3107 * archive.cc (Library_base::should_include_member): Check for
3108 --export-dynamic-symbol.
3109 * options.h (class General_options): Add --export-dynamic-symbol.
3110 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3111 --export-dynamic-symbol.
3112 (Symbol_table::gc_mark_undef_symbols): Likewise.
3113 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3115 2012-04-12 David S. Miller <davem@davemloft.net>
3117 * sparc.cc (Reloc::wdisp10): New relocation method.
3118 (Reloc::h34): Likewise.
3119 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3120 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3122 (Target_sparc::Scan::local): Likewise.
3123 (Target_sparc::Scan::global): Likewise.
3124 (Target_sparc::Relocate::relocate): Likewise.
3126 2012-04-09 Cary Coutant <ccoutant@google.com>
3128 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3131 2012-04-06 Ian Lance Taylor <iant@google.com>
3133 * timer.cc: #include <unistd.h>.
3135 2012-04-06 Roland McGrath <mcgrathr@google.com>
3137 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3138 * config.in: Regenerate.
3139 * configure: Regenerate.
3141 2012-04-05 Nick Clifton <nickc@redhat.com>
3143 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3144 (AM_LC_MESSAGES): Add.
3145 * aclocal.m4: Regenerate.
3146 * config.in: Regenerate.
3147 * configure: Regenerate.
3149 2012-03-21 Cary Coutant <ccoutant@google.com>
3151 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3152 * Makefile.in: Regenerate.
3153 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3154 (Sized_elf_reloc_mapper::symbol_section): New function.
3155 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3156 (make_elf_reloc_mapper): New function.
3157 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3158 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3159 (Dwarf_abbrev_table::do_get_abbrev): New function.
3160 (Dwarf_ranges_table::read_ranges_table): New function.
3161 (Dwarf_ranges_table::read_range_list): New function.
3162 (Dwarf_pubnames_table::read_section): New function.
3163 (Dwarf_pubnames_table::read_header): New function.
3164 (Dwarf_pubnames_table::next_name): New function.
3165 (Dwarf_die::Dwarf_die): New function.
3166 (Dwarf_die::read_attributes): New function.
3167 (Dwarf_die::skip_attributes): New function.
3168 (Dwarf_die::set_name): New function.
3169 (Dwarf_die::set_linkage_name): New function.
3170 (Dwarf_die::attribute): New function.
3171 (Dwarf_die::string_attribute): New function.
3172 (Dwarf_die::int_attribute): New function.
3173 (Dwarf_die::uint_attribute): New function.
3174 (Dwarf_die::ref_attribute): New function.
3175 (Dwarf_die::child_offset): New function.
3176 (Dwarf_die::sibling_offset): New function.
3177 (Dwarf_info_reader::check_buffer): New function.
3178 (Dwarf_info_reader::parse): New function.
3179 (Dwarf_info_reader::do_parse): New function.
3180 (Dwarf_info_reader::do_read_string_table): New function.
3181 (Dwarf_info_reader::lookup_reloc): New function.
3182 (Dwarf_info_reader::get_string): New function.
3183 (Dwarf_info_reader::visit_compilation_unit): New function.
3184 (Dwarf_info_reader::visit_type_unit): New function.
3185 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3186 Sized_elf_reloc_mapper.
3187 (Sized_dwarf_line_info::symbol_section): Remove function.
3188 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3189 (Sized_dwarf_line_info::read_line_mappings): Remove object
3190 parameter, adjust callers.
3191 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3192 * dwarf_reader.h: Include <sys/types.h>.
3193 (class Track_relocs): Remove forward declaration.
3194 (class Elf_reloc_mapper): New class.
3195 (class Sized_elf_reloc_mapper): New class.
3196 (class Dwarf_abbrev_table): New class.
3197 (class Dwarf_range_list): New class.
3198 (class Dwarf_ranges_table): New class.
3199 (class Dwarf_pubnames_table): New class.
3200 (class Dwarf_die): New class.
3201 (class Dwarf_info_reader): New class.
3202 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3203 (Sized_dwarf_line_info::symbol_section): Remove member function.
3204 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3206 * gdb-index.cc: New source file.
3207 * gdb-index.h: New source file.
3208 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3209 and .debug_types sections, call Layout::add_to_gdb_index.
3210 (Sized_relobj_incr::do_section_name): Implement.
3211 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3212 return type; Implement.
3213 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3215 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3216 parameter list and return type.
3217 (Sized_incr_dynobj::do_section_contents): Likewise.
3218 * layout.cc: Include gdb-index.h.
3219 (Layout::Layout): Initialize gdb_index_data_.
3220 (Layout::init_fixed_output_section): Check for .gdb_index section.
3221 (Layout::add_to_gdb_index): New function. Instantiate.
3222 * layout.h: Add forward declaration for class Gdb_index.
3223 (Layout::add_to_gdb_index): New member function.
3224 (Layout::gdb_index_data_): New data member.
3225 * main.cc: Include gdb-index.h.
3226 (main): Print statistics for gdb index.
3227 * object.cc (Object::section_contents): Move code into
3228 do_section_contents.
3229 (need_decompressed_section): Check for sections needed when building
3231 (build_compressed_section_map): Likewise.
3232 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3234 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3235 sections; call Layout::add_to_gdb_index.
3236 (Sized_relobj_file::do_decompressed_section_contents): Call
3237 do_section_contents directly.
3238 * object.h (Object::do_section_contents): Adjust parameter list and
3240 (Object::do_decompressed_section_contents): Call do_section_contents
3242 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3244 * options.h (class General_options): Add --gdb-index option.
3245 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3246 list and return type.
3247 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3248 * reloc.h (Track_relocs::checkpoint): New function.
3249 (Track_relocs::reset): New function.
3251 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3253 * testsuite/Makefile.in: Regenerate.
3254 * testsuite/gdb_index_test.cc: New test source file.
3255 * testsuite/gdb_index_test_1.sh: New test source file.
3256 * testsuite/gdb_index_test_2.sh: New test source file.
3258 2012-03-19 Doug Kwan <dougkwan@google.com>
3260 * arm.cc (Target_arm::do_define_standard_symbols): New method.
3261 (Target_arm::do_finalize_sections): Remove code which defines
3262 __exidx_start and __exidx_end. Make symbol table parameter
3263 anonymous as it is not used.
3264 * gold.cc (queue_middle_tasks): Call target hook to define any
3265 target-specific symbols.
3266 * target.h (Target::define_standard_symbols): New method.
3267 (Target::do_define_standard_symbols): Same.
3268 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3269 * testsuite/Makefile.in: Regenerate.
3270 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3272 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3273 relocations are generated for __exidx_start and __exidx_end.
3275 2012-03-16 Doug Kwan <dougkwan@google.com>
3277 * testsuite/Makefile.am: Disable test initpri3b.
3278 * testsuite/Makefile.in: Regenerate.
3280 2012-03-15 Doug Kwan <dougkwan@google.com>
3282 * arm.cc (Target_arm::got_section): Make .got section read-only
3285 2012-03-15 Ian Lance Taylor <iant@google.com>
3288 * layout.cc (Layout::make_output_section): Correctly mark
3289 SHT_INIT_ARRAY, et. al., as relro.
3291 2012-03-14 Doug Kwan <dougkwan@google.com>
3293 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3294 dynamic relocations for protected symbols in shared objects.
3296 2012-03-13 Ian Lance Taylor <iant@google.com>
3298 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3299 keep the larger alignment.
3301 2012-03-12 Cary Coutant <ccoutant@google.com>
3303 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3304 handling of DW_LNE_define_file.
3306 2012-03-12 Cary Coutant <ccoutant@google.com>
3308 * reduced_debug_output.cc
3309 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3312 2012-02-29 Cary Coutant <ccoutant@google.com>
3314 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3316 2012-02-29 Cary Coutant <ccoutant@google.com>
3318 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3319 Call Object::decompressed_section_contents.
3320 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3322 (Sized_dwarf_line_info::buffer_start_): New data member.
3323 * merge.cc (Output_merge_data::do_add_input_section): Call
3324 Object::decompressed_section_contents.
3325 (Output_merge_string::do_add_input_section): Likewise.
3326 * object.cc (need_decompressed_section): New function.
3327 (build_compressed_section_map): Decompress sections needed later.
3328 (Sized_relobj_file::do_decompressed_section_contents): New function.
3329 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3330 * object.h (Object::decompressed_section_contents): New function.
3331 (Object::discard_decompressed_sections): New function.
3332 (Object::do_decompressed_section_contents): New function.
3333 (Object::do_discard_decompressed_sections): New function.
3334 (Compressed_section_info): New type.
3335 (Compressed_section_map): Include decompressed section contents.
3336 (Sized_relobj_file::do_decompressed_section_contents): New function.
3337 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3339 2012-02-16 Cary Coutant <ccoutant@google.com>
3341 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3342 * testsuite/Makefile.in: Regenerate.
3344 2012-02-14 Cary Coutant <ccoutant@google.com>
3346 * options.cc (General_options::finalize): Disallow -pie and -static.
3348 2012-02-03 Doug Kwan <dougkwan@google.com>
3350 * arm.cc (Arm_relocate_functions::abs8,
3351 Arm_relocate_functions::abs16): Use
3352 Bits::has_signed_unsigned_overflow32.
3353 (Arm_relocate_functions::thm_abs8): Correct range of
3355 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3358 2012-02-02 Doug Kwan <dougkwan@google.com>
3360 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3361 position independent outputs, not just shared objects.
3363 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3365 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3366 * configure: Regenerated.
3368 2012-01-27 Ian Lance Taylor <iant@google.com>
3370 * reloc.h (Bits): New class with static functions, copied from
3371 namespace utils in arm.cc.
3372 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3375 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3377 * incremental.cc (write_info_blocks): Correct relocation offset.
3379 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3381 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3382 (Relocate::tls_gd_to_le): Likewise.
3384 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3386 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3388 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3390 * configure.ac: Check if -mcmodel=medium works.
3391 * configure: Regenerated.
3393 2012-01-24 Cary Coutant <ccoutant@google.com>
3395 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3397 (read_unsigned_LEB_128_x): ... this new function.
3398 (read_signed_LEB_128): Replaced with inline definition and ...
3399 (read_signed_LEB_128_x): ... this new function.
3400 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3401 (read_unsigned_LEB_128): Add inline definition.
3402 (read_signed_LEB_128_x): New function.
3403 (read_signed_LEB_128): Add inline definition.
3404 * testsuite/Makefile.am (leb128_unittest): New unit test.
3405 * testsuite/Makefile.in: Regenerate.
3406 * testsuite/leb128_unittest.cc: New unit test.
3408 2012-01-23 Ian Lance Taylor <iant@google.com>
3411 * i386.cc (Target_i386::do_code_fill): When using a jmp
3412 instruction, pad with nop instructions.
3413 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3415 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3417 * x86_64.cc (gc_process_relocs): Add typename on types used in
3419 (scan_relocs): Likewise.
3420 (relocate_section): Likewise.
3421 (apply_relocation): Likewise.
3423 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3425 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3426 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3429 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3431 * x86_64.cc: Initial support for x32.
3433 2012-01-03 Cary Coutant <ccoutant@google.com>
3435 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3436 Use abstract base class for GOT.
3437 * gold/output.h (class Output_data_got_base): New abstract base class.
3438 (class Output_data_got): Derive from new base class, adjust ctors.
3439 (Output_data_got::reserve_slot): Make virtual; rename to
3440 do_reserve_slot; Adjust callers.
3441 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3442 pointer to abstract base class.
3443 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3445 2011-12-18 Ian Lance Taylor <iant@google.com>
3447 * object.h (Relobj::local_symbol_value): New function.
3448 (Relobj::local_plt_offset): New function.
3449 (Relobj::local_has_got_offset): New function.
3450 (Relobj::local_got_offset): New function.
3451 (Relobj::set_local_got_offset): New function.
3452 (Relobj::do_local_symbol_value): New pure virtual function.
3453 (Relobj::do_local_plt_offset): Likewise.
3454 (Relobj::do_local_has_got_offset): Likewise.
3455 (Relobj::do_local_got_offset): Likewise.
3456 (Relobj::do_set_local_got_offset): Likewise.
3457 (Sized_relobj::do_local_has_got_offset): Rename from
3458 local_has_got_offset.
3459 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3460 (Sized_relobj::do_set_local_got_offset): Rename from
3461 set_local_got_offset.
3462 (Sized_relobj_file::do_local_plt_offset): Rename from
3464 (Sized_relobj_file::do_local_symbol_value): New function.
3465 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3467 * output.cc (Output_data_got::Got_entry::write): Change object to
3468 Relobj. Use local_symbol_value.
3469 (Output_data_got::add_global_with_rel): Change rel_dyn to
3470 Output_data_reloc_generic*. Use add_global_generic.
3471 (Output_data_got::add_global_with_rela): Remove. Change all
3472 callers to use add_global_with_rel.
3473 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3474 Output_data_reloc_generic*. Use add_global_generic.
3475 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3476 callers to use add_global_pair_with_rel.
3477 (Output_data_got::add_local): Change object to Relobj*.
3478 (Output_data_got::add_local_plt): Likewise.
3479 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3480 change rel_dyn to Output_data_reloc_generic*. Use
3482 (Output_data_got::add_local_with_rela): Remove. Change all
3483 callers to use all_local_with_rel.
3484 (Output_data_got::add_local_pair_with_rel): Change object to
3485 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3486 add_output_section_generic.
3487 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3488 callers to use add_local_pair_with_rel.
3489 (Output_data_got::reserve_local): Change object to Relobj*.
3490 * output.h: (class Output_data_reloc_generic): Add pure virtual
3491 declarations for add_global_generic, add_local_generic,
3492 add_output_section_generic.
3493 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3494 functions for Output_data_reloc_generic. Update declarations for
3495 changes listed in output.cc.
3496 (class Output_data_got): Change template parameter to got_size.
3497 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3498 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3500 (Sized_relobj_incr::do_local_plt_offset): New function.
3501 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3504 2011-12-17 Cary Coutant <ccoutant@google.com>
3506 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3507 * resolve.cc (Symbol_table::resolve): Likewise.
3508 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3510 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3512 2011-12-16 Ian Lance Taylor <iant@google.com>
3514 * output.h (Output_data_reloc_generic::add): Only call
3515 add_dynamic_reloc if this is a dynamic reloc section.
3517 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3520 * target-reloc.h (apply_relocation): Replace <64, false> with
3523 2011-11-25 Nick Clifton <nickc@redhat.com>
3525 * po/it.po: New Italian translation.
3527 2011-11-17 Sterling Augustine <saugustine@google.com>
3529 * script.cc (script_include_directive): Implement.
3530 (read_script_file): New local variables name and search_path. Update
3531 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3532 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3533 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3535 2011-11-11 Sterling Augustine <saugustine@google.com>
3537 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3538 (file_or_sections_cmd): Likewise.
3540 2011-11-11 Doug Kwan <dougkwan@google.com>
3542 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3543 if --just-symbols is given.
3545 2011-11-10 Doug Kwan <dougkwan@google.com>
3548 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3549 when processing data relocs.
3550 * reloc.h (Relocate_functions::rel_unaligned): New method.
3551 (Relocate_functions::pcrel_unaligned): Ditto.
3552 (Relocate_functions::rel32_unaligned): Ditto.
3553 (Relocate_functions::pcrel32_unaligned): Ditto.
3555 2011-11-09 Doug Kwan <dougkwan@google.com>
3558 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3559 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3560 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3561 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3562 (Relocate_functions::rel_unaligned): New.
3563 (Relocate_functions::rel32_unaligned): New.
3564 * target-reloc.h (relocate_for_relocatable): Add code to handle
3565 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3566 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3567 arm_unaligned_reloc_r): New targets.
3568 * testsuite/Makefile.in: Regenerate.
3569 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3572 2011-11-02 Ian Lance Taylor <iant@google.com>
3574 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3576 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3577 * options.cc (General_options::finalize): Use library search path
3578 from configure script if specified. If not native and no sysroot,
3579 only search TOOLLIBDIR.
3580 * options.h (Search_directory::Search_directory): Change name to
3582 (General_options::add_to_library_path_with_sysroot): Change arg to
3584 * configure, Makefile.in, config.in: Rebuild.
3586 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3588 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3589 we are working around the ARM1176 Erratum.
3590 * options.h (General_options::fix_arm1176): Add option.
3591 * testsuite/Makefile.am: Add testcases, and keep current ones
3593 * testsuite/Makefile.in: Regenerate.
3594 * testsuite/arm_fix_1176.s: New file.
3595 * testsuite/arm_fix_1176.sh: Likewise.
3597 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3599 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3601 (Target_arm::may_use_blx): Remove method.
3602 (Target_arm::set_may_use_blx): Likewise.
3603 (Target_arm::may_use_v4t_interworking): New method.
3604 (Target_arm::may_use_v5t_interworking): Likewise.
3605 (Target_arm::may_use_blx_): Remove member variable.
3606 (Arm_relocate_functions::arm_branch_common): Check for v5T
3608 (Arm_relocate_functions::thumb_branch_common): Likewise.
3609 (Reloc_stub::stub_type_for_reloc): Likewise.
3610 (Target_arm::do_finalize_sections): Correct interworking checks.
3611 * testsuite/Makefile.am: Add new tests.
3612 * testsuite/Makefile.in: Regenerate.
3613 * testsuite/arm_farcall_arm_arm.s: New test.
3614 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3615 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3616 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3617 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3618 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3619 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3620 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3622 2011-10-31 Cary Coutant <ccoutant@google.com>
3625 * expression.cc (Expression::eval_with_dot): Add
3626 is_section_dot_assignment parameter.
3627 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3628 absolute and assigning to dot within a section.
3629 * script-sections.cc
3630 (Output_section_element_assignment::set_section_addresses): Pass
3631 dot_section to set_if_absolute.
3632 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3633 as is_section_dot_assignment flag to eval_with_dot.
3634 (Output_section_element_dot_assignment::set_section_addresses):
3636 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3637 parameter. Also set value if relative to dot_section; set the
3638 symbol's output_section.
3639 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3640 parameter. Adjust all callers.
3641 (Expression::eval_maybe_dot): Likewise.
3642 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3644 * testsuite/script_test_2.t: Test assignment of an absolute value
3645 to dot within an output section element.
3647 2011-10-31 Cary Coutant <ccoutant@google.com>
3649 * options.h (class General_options): Add --[no-]gnu-unique options.
3650 * symtab.cc (Symbol_table::sized_write_globals): Convert
3651 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3653 2011-10-31 Cary Coutant <ccoutant@google.com>
3656 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3657 unnecessary assertion.
3658 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3660 2011-10-31 Sriraman Tallam <tmsriram@google.com>
3662 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3664 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3666 Change to just keep the section associated with symbol.
3667 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3668 they are externally visible and --export-dynamic is turned on.
3669 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3671 2011-10-19 Ian Lance Taylor <iant@google.com>
3674 * script-sections.cc
3675 (Output_section_element_dot_assignment::needs_output_section): New
3678 2011-10-19 Ian Lance Taylor <iant@google.com>
3681 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3682 --section-start option was seen.
3683 * options.h (General_options::any_section_start): New function.
3685 2011-10-18 David S. Miller <davem@davemloft.net>
3688 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3689 member to track relocation locations that have moved during TLS
3690 reloc optimizations.
3691 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3692 (Target_sparc::Relocate::relocate): Adjust view down by 4
3693 bytes if it matches reloc_adjust_addr_.
3694 (Target_sparc::Relocate::relocate_tls): Always move the
3695 __tls_get_addr call delay slot instruction forward 4 bytes when
3696 performing relaxation.
3698 2011-10-18 Cary Coutant <ccoutant@google.com>
3700 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3701 (Output_file::map_no_anonymous): Check for non-zero
3702 return code from posix_fallocate.
3704 2011-10-17 Cary Coutant <ccoutant@google.com>
3707 * plugin.cc (is_visible_from_outside): Check for symbols
3708 referenced from dynamic objects.
3709 * resolve.cc (Symbol_table::resolve): Don't count references
3710 from dynamic objects as references from real ELF files.
3711 * testsuite/plugin_test_2.sh: Adjust expected result.
3713 2011-10-17 Cary Coutant <ccoutant@google.com>
3715 * gold.cc: Include timer.h.
3716 (queue_middle_tasks): Stamp time.
3717 (queue_final_tasks): Likewise.
3718 * main.cc (main): Store timer in parameters. Print timers
3720 * parameters.cc (Parameters::Parameters): Initialize timer_.
3721 (Parameters::set_timer): New function.
3722 (set_parameters_timer): New function.
3723 * parameters.h (Parameters::set_timer): New function.
3724 (Parameters::timer): New function.
3725 (Parameters::timer_): New data member.
3726 (set_parameters_timer): New function.
3727 * timer.cc (Timer::stamp): New function.
3728 (Timer::get_pass_time): New function.
3729 * timer.h (Timer::stamp): New function.
3730 (Timer::get_pass_time): New function.
3731 (Timer::pass_times_): New data member.
3733 2011-10-17 Cary Coutant <ccoutant@google.com>
3735 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3736 task for members of lib groups.
3738 2011-10-17 Cary Coutant <ccoutant@google.com>
3741 * fileread.cc (File_read::find_view): Add assert.
3742 (File_read::make_view): Move bounds check (replace with assert)...
3743 (File_read::find_or_make_view): ... to here.
3745 2011-10-12 Cary Coutant <ccoutant@google.com>
3747 * output.cc (Output_file::open_base_file): Handle case where
3748 ::read returns less than requested size.
3750 2011-10-10 Cary Coutant <ccoutant@google.com>
3752 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
3753 Initialize defined_count_.
3754 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3755 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3756 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3757 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3758 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
3759 * incremental.h (Sized_relobj_incr::defined_count_): New data
3761 (Sized_incr_dynobj::defined_count_): New data member.
3762 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
3763 Return zeroes instead of internal error.
3765 2011-10-10 Cary Coutant <ccoutant@google.com>
3768 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
3769 (Output_reloc::symbol_value): Return PLT offset if flag is set.
3770 * output.h (class Output_reloc): Add use_plt_offset flag.
3771 (Output_reloc::type_): Adjust size of bit field.
3772 (Output_reloc::use_plt_offset_): New bit field.
3773 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3774 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3775 flag. Adjust all callers.
3776 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
3777 creating RELATIVE relocations.
3779 2011-10-10 Nick Clifton <nickc@redhat.com>
3781 * po/es.po: Updated Spanish translation.
3782 * po/fi.po: Updated Finnish translation.
3784 2011-10-03 Diego Novillo <dnovillo@google.com>
3786 * options.cc (parse_uint): Fix dereference of RETVAL.
3788 2011-09-29 Sriraman Tallam <tmsriram@google.com>
3790 * layout.h (section_order_map_): New member.
3791 (get_section_order_map): New member function.
3792 * output.cc (Output_section::add_input_section): Check for patterns
3793 only when --section-ordering-file is specified.
3794 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3795 output_sections have been formed.
3796 * layout.cc (Layout_Layout): Initialize section_order_map_.
3797 * plugin.cc (update_section_order): Store order in order_map. Do not
3799 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3800 * testsuite/Makefile.in: Regenerate.
3801 * testsuite/plugin_section_order.c: New file.
3802 * testsuite/plugin_final_layout.cc: New file.
3803 * testsuite/plugin_final_layout.sh: New file.
3805 2011-09-29 Cary Coutant <ccoutant@google.com>
3807 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3809 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
3810 symbols during incremental update.
3811 (Symbol_table::add_from_dynobj): Likewise.
3813 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3814 Ian Lance Taylor <iant@google.com>
3816 * symtab.cc (Symbol_table::define_special_symbol): Always
3817 canonicalize version string.
3819 2011-09-26 Cary Coutant <ccoutant@google.com>
3821 * gold.cc (queue_initial_tasks): Move option checks ...
3822 * options.cc (General_options::finalize): ... to here. Disable
3823 some options; make others fatal.
3825 2011-09-26 Cary Coutant <ccoutant@google.com>
3828 * plugin.cc (get_symbols_v2): New function.
3829 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3830 (is_referenced_from_outside): New function.
3831 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3832 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3833 (get_symbols): Pass version parameter.
3834 (get_symbols_v2): New function.
3835 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3837 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3838 (onload): Add LDPT_GET_SYMBOLS_V2.
3839 (all_symbols_read_hook): Use get_symbols_v2; check for
3840 LDPR_PREVAILING_DEF_IRONLY_EXP.
3841 * testsuite/plugin_test_3.sh: Update expected results.
3843 2011-09-23 Simon Baldwin <simonb@google.com>
3845 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3846 configuration options.
3847 * configure: Regenerate.
3848 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3849 * Makefile.in: Regenerate.
3850 * testsuite/Makefile.in: Regenerate.
3852 2011-09-19 Sriraman Tallam <tmsriram@google.com>
3854 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3856 2011-09-19 Cary Coutant <ccoutant@google.com>
3858 * incremental.cc (can_incremental_update): Fix typo in comment.
3859 * incremental.h (can_incremental_update): Likewise.
3861 2011-09-18 Cary Coutant <ccoutant@google.com>
3863 * incremental.cc (can_incremental_update): New function.
3864 * incremental.h (can_incremental_update): New function.
3865 * layout.cc (Layout::init_fixed_output_section): Call it.
3866 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3867 * object.cc (Sized_relobj_file::do_layout): Call
3868 can_incremental_update.
3870 2011-09-13 Cary Coutant <ccoutant@google.com>
3872 * configure.ac: Check for glibc support for gnu_indirect_function
3873 support with static linking, setting automake conditional
3875 * Makefile.in: Regenerate.
3876 * configure: Regenerate.
3878 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3879 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3881 * testsuite/Makefile.in: Regenerate.
3883 2011-09-13 Cary Coutant <ccoutant@google.com>
3885 * incremental.cc (Sized_relobj_incr::do_layout): Call
3886 report_comdat_group for kept comdat sections.
3887 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3888 * testsuite/Makefile.in: Regenerate.
3889 * testsuite/incr_comdat_test_1.cc: New source file.
3890 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3891 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3892 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3894 2011-09-13 Ian Lance Taylor <iant@google.com>
3896 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3897 variable external_symbols_offset.
3899 2011-09-12 Ian Lance Taylor <iant@google.com>
3901 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3902 triggered if object has no symbols.
3904 2011-09-09 David S. Miller <davem@davemloft.net>
3906 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3907 (Output_fill_debug_line::do_write): Likewise.
3909 2011-08-29 Cary Coutant <ccoutant@google.com>
3911 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3912 casts to match formatting specs.
3913 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3915 2011-08-26 Cary Coutant <ccoutant@google.com>
3917 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3918 remaining hole size when allocating.
3919 (Layout::make_output_section): Set fill methods for debug sections.
3920 * layout.h (Free_list::Free_list_node): Move from private to
3922 (Free_list::set_min_hole_size): New function.
3923 (Free_list::begin, Free_list::end): New functions.
3924 (Free_list::min_hole_): New data member.
3925 * output.cc: Include dwarf.h.
3926 (Output_fill_debug_info::do_minimum_hole_size): New function.
3927 (Output_fill_debug_info::do_write): New function.
3928 (Output_fill_debug_line::do_minimum_hole_size): New function.
3929 (Output_fill_debug_line::do_write): New function.
3930 (Output_section::Output_section): Initialize new data member.
3931 (Output_section::set_final_data_size): Ensure patch space is larger
3932 than minimum hole size.
3933 (Output_section::do_write): Fill holes in debug sections.
3934 * output.h (Output_fill): New class.
3935 (Output_fill_debug_info): New class.
3936 (Output_fill_debug_line): New class.
3937 (Output_section::set_free_space_fill): New function.
3938 (Output_section::free_space_fill_): New data member.
3939 * testsuite/Makefile.am (incremental_test_3): Add
3940 --incremental-patch option.
3941 (incremental_test_4): Likewise.
3942 (incremental_test_5): Likewise.
3943 (incremental_test_6): Likewise.
3944 (incremental_copy_test): Likewise.
3945 (incremental_common_test_1): Likewise.
3946 * testsuite/Makefile.in: Regenerate.
3948 2011-08-26 Nick Clifton <nickc@redhat.com>
3950 * po/es.po: Updated Spanish translation.
3952 2011-08-01 Cary Coutant <ccoutant@google.com>
3954 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3955 * gold/testsuite/Makefile.in: Regenerate.
3956 * gold/testsuite/justsyms_exec.c: New source file.
3957 * gold/testsuite/justsyms_lib.c: New source file.
3959 2011-08-01 Cary Coutant <ccoutant@google.com>
3961 * layout.cc (Layout::set_segment_offsets): Don't realign text
3962 segment if -Ttext was specified.
3963 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3965 * object.h (Sized_relobj_file::e_type): New function.
3966 (Sized_relobj_file::e_type_): New data member.
3967 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3968 base address for ET_EXEC files.
3969 * target.cc (Target::do_make_elf_object_implementation): Allow
3970 ET_EXEC files with --just-symbols option.
3972 2011-07-28 Cary Coutant <ccoutant@google.com>
3974 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3975 Add thread_number parameter.
3976 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3977 * workqueue-threads.cc
3978 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3979 current thread if its thread number is greater than desired thread
3981 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3982 Add thread_number parameter.
3983 (Workqueue::should_cancel_thread): Likewise.
3984 (Workqueue::find_runnable_or_wait): Pass thread_number to
3985 should_cancel_thread.
3986 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3989 2011-07-22 Sriraman Tallam <tmsriram@google.com>
3991 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3992 only after checking if it cannot be forced local.
3993 * symtab.h (is_externally_visible): Check if the symbol is not forced
3996 2011-07-15 Ian Lance Taylor <iant@google.com>
3998 * options.h (class General_options): Add --print-output-format.
3999 Move -EL next to -EB, for better --help output.
4000 * target-select.cc: Include <cstdio>, "options.h", and
4002 (Target_selector::do_target_bfd_name): New function.
4003 (print_output_format): New function.
4004 * target-select.h (class Target_selector): Update declarations.
4005 (Target_selector::target_bfd_name): New function.
4006 (print_output_format): Declare.
4007 * main.cc: Include "target-select.h".
4008 (main): Handle --print-output-format.
4009 * gold.cc: Include "target-select.h".
4010 (queue_initial_tasks): Handle --print-output-format when there are
4012 * parameters.cc (parameters_force_valid_target): Give a better
4013 error message if -EB/-EL does not match target.
4014 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4017 2011-07-15 Ian Lance Taylor <iant@google.com>
4019 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4020 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4021 (Output_data_plt_i386::do_write): Write address of .dynamic
4022 section to first entry in .got.plt section.
4023 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4024 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4026 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4027 section to first entry in .got.plt section.
4028 * layout.h (Layout::dynamic_section): New function.
4030 2011-07-13 Sriraman Tallam <tmsriram@google.com>
4032 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4034 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4035 input_section_position_, and input_section_glob_.
4036 (read_layout_from_file): Call function section_ordering_specified.
4037 * layout.h (is_section_ordering_specified): New function.
4038 (section_ordering_specified): New function.
4039 (section_ordering_specified_): New boolean member.
4040 * main.cc(main): Call load_plugins after layout object is defined.
4041 * output.cc (Output_section::add_input_section): Use
4042 function section_ordering_specified to check if section ordering is
4044 * output.cc (Output_section::add_relaxed_input_section): Use
4045 function section_ordering_specified to check if section ordering is
4047 (Output_section::update_section_layout): New function.
4048 (Output_section::sort_attached_input_sections): Check if input section
4050 * output.h (Output_section::update_section_layout): New function.
4051 * plugin.cc (get_section_count): New function.
4052 (get_section_type): New function.
4053 (get_section_name): New function.
4054 (get_section_contents): New function.
4055 (update_section_order): New function.
4056 (allow_section_ordering): New function.
4057 (Plugin::load): Add the new interfaces to the transfer vector.
4058 (Plugin_manager::load_plugins): New parameter.
4059 (Plugin_manager::all_symbols_read): New parameter.
4060 (Plugin_manager::claim_file): New parameter. Save the elf object for
4062 (Plugin_manager::get_elf_object): New function.
4063 (Plugin_manager::get_view): Change to directly use the bool to check
4064 if get_view is called from claim_file_hook.
4065 * plugin.h (input_objects): New function
4066 (Plugin__manager::load_plugins): New parameter.
4067 (Plugin_manager::claim_file): New parameter.
4068 (Plugin_manager::get_elf_object): New function.
4069 (Plugin_manager::in_claim_file_handler): New function.
4070 (Plugin_manager::in_claim_file_handler_): New member.
4071 (layout): New function.
4072 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4073 handler with an extra parameter. Make the elf object before calling
4075 * testsuite/plugin_test.c (get_section_count): New function pointer.
4076 (get_section_type): New function pointer.
4077 (get_section_name): New function pointer.
4078 (get_section_contents): New function pointer.
4079 (update_section_order): New function pointer.
4080 (allow_section_ordering): New function pointer.
4081 (onload): Check if the new interfaces exist.
4083 2011-07-13 Ian Lance Taylor <iant@google.com>
4085 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4087 * x86_64.cc (Target_x86_64::got_section): Likewise.
4088 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4089 (relro_now_test_SOURCES): New variable.
4090 (relro_now_test_DEPENDENCIES): New variable.
4091 (relro_now_test_LDFLAGS): New variable.
4092 (relro_now_test_LDADD): New variable.
4093 (relro_now_test.so): New target.
4094 * testsuite/Makefile.in: Rebuild.
4096 2011-07-12 Ian Lance Taylor <iant@google.com>
4099 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4100 GLOB_DAT relocation rather than a RELATIVE relocation for a
4101 protected symbol when creating a shared library.
4102 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4103 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4104 * testsuite/protected_main_1.cc (main): Test that protected
4105 function has same address.
4107 2011-07-11 Ian Lance Taylor <iant@google.com>
4110 * options.h (class General_options): Add -Bgroup.
4111 * options.cc (General_options::finalize): If -Bgroup is set,
4112 default to --unresolved-symbols=report-all.
4113 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4114 * target-reloc.h (issue_undefined_symbol_error): Handle
4115 --unresolved-symbols=report-all.
4117 2011-07-08 Ian Lance Taylor <iant@google.com>
4120 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4121 if linker script discards key sections.
4122 (Layout::create_dynamic_symtab): Likewise.
4123 (Layout::assign_local_dynsym_offsets): Likewise.
4124 (Layout::sized_create_version_sections): Likewise.
4125 (Layout::create_interp): Likewise.
4126 (Layout::finish_dynamic_section): Likewise.
4127 (Layout::set_dynamic_symbol_size): Likewise.
4129 2011-07-08 Ian Lance Taylor <iant@google.com>
4132 * options.h (class General_options): Add --unresolved-symbols.
4133 * target-reloc.h (issue_undefined_symbol_error): Check
4134 --unresolved-symbols. Add comments.
4136 2011-07-08 Ian Lance Taylor <iant@google.com>
4138 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4139 expression more complex.
4141 2011-07-08 Ian Lance Taylor <iant@google.com>
4144 * target-reloc.h (issue_undefined_symbol_error): New inline
4145 function, broken out of relocate_section.
4146 (relocate_section): Call issue_undefined_symbol_error.
4147 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4148 there is no TLS segment if we are about to issue an undefined
4150 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4152 2011-07-08 Ian Lance Taylor <iant@google.com>
4155 * resolve.cc (Symbol_table::should_override): Add fromtype
4156 parameter. Change all callers. Give error when linking together
4157 TLS and non-TLS symbol.
4158 (Symbol_table::should_override_with_special): Add fromtype
4159 parameter. Change all callers.
4160 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4161 there is no TLS segment if we have reported some errors.
4162 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4164 2011-07-08 Ian Lance Taylor <iant@google.com>
4167 * target.h (Target::plt_address_for_global): New function.
4168 (Target::plt_address_for_local): New function.
4169 (Target::plt_section_for_global): Remove.
4170 (Target::plt_section_for_local): Remove.
4171 (Target::do_plt_address_for_global): New virtual function.
4172 (Target::do_plt_address_for_local): New virtual function.
4173 (Target::do_plt_section_for_global): Remove.
4174 (Target::do_plt_section_for_local): Remove.
4175 (Target::register_global_plt_entry): Add Symbol_table and Layout
4177 * output.cc (Output_data_got::Got_entry::write): Use
4178 plt_address_for_global and plt_address_for_local.
4179 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4180 address of output section.
4181 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4182 got_irelative_, and irelative_count_ fields. Update
4184 (Output_data_plt_i386::has_irelative_section): New function.
4185 (Output_data_plt_i386::entry_count): Add irelative_count_.
4186 (Output_data_plt_i386::set_final_data_size): Likewise.
4187 (class Target_i386): Add got_irelative_ and rel_irelative_
4188 fields. Update declarations.
4189 (Target_i386::Target_i386): Initialize new fields.
4190 (Target_i386::do_plt_address_for_global): New function replacing
4191 do_plt_section_for_global.
4192 (Target_i386::do_plt_address_for_local): New function replacing
4193 do_plt_section_for_local.
4194 (Target_i386::got_section): Create got_irelative_.
4195 (Target_i386::rel_irelative_section): New function.
4196 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4197 fields. Don't define __rel_iplt_{start,end}.
4198 (Output_data_plt_i386::add_entry): Add symtab and layout
4199 parameters. Change all callers. Use different PLT and GOT for
4201 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4202 layout parameters. Change all callers. Use different PLT and
4204 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4205 (Output_data_plt_i386::rel_irelative): New function.
4206 (Output_data_plt_i386::address_for_global): New function.
4207 (Output_data_plt_i386::address_for_local): New function.
4208 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4209 IRELATIVE GOT when changing IFUNC GOT entries.
4210 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4212 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4213 if we didn't create an IRELATIVE GOT.
4214 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4215 plt_address_for_local.
4216 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4217 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4218 got_irelative_, and irelative_count_ fields. Update
4220 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4221 Initialize new fields. Remove symtab parameter. Change all
4223 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4225 (Output_data_plt_x86_64::has_irelative_section): New function.
4226 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4227 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4228 fields. Update declarations.
4229 (Target_x86_64::Target_x86_64): Initialize new fields.
4230 (Target_x86_64::do_plt_address_for_global): New function replacing
4231 do_plt_section_for_global.
4232 (Target_x86_64::do_plt_address_for_local): New function replacing
4233 do_plt_section_for_local.
4234 (Target_x86_64::got_section): Create got_irelative_.
4235 (Target_x86_64::rela_irelative_section): New function.
4236 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4237 all callers. Don't create __rel_iplt_{start,end}.
4238 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4239 parameters. Change all callers. Use different PLT and GOT for
4241 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4242 layout parameters. Change all callers. Use different PLT and
4244 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4245 parameters. Change all callers. Use different PLT and GOT for
4247 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4248 (Output_data_plt_x86_64::rela_irelative): New function.
4249 (Output_data_plt_x86_64::address_for_global): New function.
4250 (Output_data_plt_x86_64::address_for_local): New function.
4251 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4252 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4253 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4254 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4256 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4258 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4259 symbols if we didn't create an IRELATIVE GOT.
4260 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4261 plt_address_for_local.
4262 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4263 * testsuite/ifuncvar1.c: New test file.
4264 * testsuite/ifuncvar2.c: New test file.
4265 * testsuite/ifuncvar3.c: New test file.
4266 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4267 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4268 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4269 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4270 * testsuite/Makefile.in: Rebuild.
4272 2011-07-07 Cary Coutant <ccoutant@google.com>
4274 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4275 (two_file_test_1_ndebug.o): Likewise.
4276 (two_file_test_1b_ndebug.o): Likewise.
4277 (two_file_test_2_ndebug.o): Likewise.
4278 (two_file_test_main_ndebug.o): Likewise.
4279 (incremental_test_2): Link with no-debug versions.
4281 2011-07-06 Cary Coutant <ccoutant@google.com>
4283 * gold/incremental.cc
4284 (Output_section_incremental_inputs::write_info_blocks): Check for
4285 hidden and internal symbols.
4287 2011-07-06 Cary Coutant <ccoutant@google.com>
4289 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4290 Check disposition for startup file.
4291 (Incremental_inputs::report_command_line): Ignore
4292 --incremental-startup-unchanged option.
4293 * options.cc (General_options::parse_incremental_startup_unchanged):
4295 (General_options::General_options): Initialize new data member.
4296 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4297 (General_options): Add --incremental-startup-unchanged option.
4298 (General_options::incremental_startup_disposition): New function.
4299 (General_options::incremental_startup_disposition_): New data member.
4301 2011-07-06 Cary Coutant <ccoutant@google.com>
4303 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4304 input file index to Script_info ctor.
4305 (Sized_incremental_binary::do_file_has_changed): Find the
4306 command-line argument for files named in scripts.
4307 * incremental.h (Script_info::Script_info): New ctor
4308 with input file index.
4309 (Script_info::input_file_index): New function.
4310 (Script_info::input_file_index_): New data member.
4311 (Incremental_binary::get_library): Add const.
4312 (Incremental_binary::get_script_info): Add const.
4313 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4314 * testsuite/Makefile.am (incremental_test_5): New test case.
4315 (incremental_test_6): New test case.
4316 * testsuite/Makefile.in: Regenerate.
4318 2011-07-06 Cary Coutant <ccoutant@google.com>
4320 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4321 debug output when command lines differ.
4323 2011-07-06 Cary Coutant <ccoutant@google.com>
4325 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4326 --incremental-patch option.
4327 * layout.cc (Free_list::allocate): Extend allocation beyond original
4329 (Layout::make_output_section): Mark sections that should get
4331 * options.cc (parse_percent): New function.
4332 * options.h (parse_percent): New function.
4333 (DEFINE_percent): New macro.
4334 (General_options): Add --incremental-patch option.
4335 * output.cc (Output_section::Output_section): Initialize new data
4337 (Output_section::add_input_section): Print section name when out
4339 (Output_section::add_output_section_data): Likewise.
4340 (Output_section::set_final_data_size): Add patch space when
4341 doing --incremental-full.
4342 (Output_section::do_reset_address_and_file_offset): Remove patch
4344 (Output_segment::set_section_list_addresses): Print debug output
4345 only if --incremental-update.
4346 * output.h (Output_section::set_is_patch_space_allowed): New function.
4347 (Output_section::is_patch_space_allowed_): New data member.
4348 (Output_section::patch_space_): New data member.
4349 * parameters.cc (Parameters::incremental_full): New function.
4350 * parameters.h (Parameters::incremental_full): New function
4351 * testsuite/Makefile.am (incremental_test_2): Add test for
4352 --incremental-patch option.
4353 * testsuite/Makefile.in: Regenerate.
4354 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4355 (t18): Remove function body.
4357 2011-07-05 Doug Kwan <dougkwan@google.com>
4360 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4361 Arm_Address type for relocation result.
4362 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4364 (Arm_relocate_functions::abs32): Use unaligned access.
4365 (Arm_relocate_functions::rel32): Ditto.
4366 (Arm_relocate_functions::prel31): Ditto.
4367 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4368 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4369 static data relocations.
4370 * testsuite/Makefile.in: Regnerate.
4371 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4373 2011-07-05 Ian Lance Taylor <iant@google.com>
4376 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4377 symbols if necessary.
4378 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4380 2011-07-05 Ian Lance Taylor <iant@google.com>
4383 * resolve.cc (Symbol::override_base_with_special): Simply override
4384 version with special symbol version, ignoring previous version.
4386 2011-07-05 Ian Lance Taylor <iant@google.com>
4388 * object.cc (Sized_relobj_file::include_section_group): Add
4389 information to comment about signature location.
4391 2011-07-02 Ian Lance Taylor <iant@google.com>
4394 * options.h (class General_options): Add -f and -F.
4395 * options.cc (General_options::finalize): Fatal error if -f/-F
4396 are used without -shared.
4397 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4399 2011-07-02 Ian Lance Taylor <iant@google.com>
4401 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4403 2011-07-01 Ian Lance Taylor <iant@google.com>
4407 * resolve.cc (Symbol::override_base_with_special): Don't override
4408 the version if the overriding symbol has a different name.
4409 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4410 all callers. If we give an error about an undefined version,
4411 define the base version if necessary.
4412 * dynobj.h (class Versions): Update declaration.
4413 * testsuite/weak_alias_test_5.cc: New file.
4414 * testsuite/weak_alias_test.script: New file.
4415 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4416 and versioned_alias have the right value, and call t2.
4417 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4418 weak_alias_test_5.so.
4419 (weak_alias_test_LDADD): Likewise.
4420 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4421 * testsuite/Makefile.in: Rebuild.
4423 2011-07-01 Ian Lance Taylor <iant@google.com>
4426 * options.h (class General_options): Support -z notext.
4427 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4429 (two_file_shared_nonpic.so): Likewise.
4430 (two_file_shared_mixed.so): Likewise.
4431 (two_file_shared_mixed_1.so): Likewise.
4432 (weak_undef_lib_nonpic.so): Likewise.
4433 (alt/weak_undef_lib_nonpic.so): Likewise.
4434 (tls_test_shared_nonpic.so): Likewise.
4435 * testsuite/Makefile.in: Rebuild.
4437 2011-07-01 Ian Lance Taylor <iant@google.com>
4440 * configure.ac: Test whether static linking works, setting
4441 the automake conditional HAVE_STATIC.
4442 * testsuite/Makefile.am: Disable tests using -static if
4443 HAVE_STATIC is not true.
4444 * configure, testsuite/Makefile.in: Rebuild.
4446 2011-07-01 Ian Lance Taylor <iant@google.com>
4449 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4450 Assert if we see DW_EH_PE_indirect.
4451 * target.h (Target::ehframe_datarel_base): New function.
4452 (Target::do_ehframe_datarel_base): New target function.
4453 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4454 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4457 2011-07-01 Ian Lance Taylor <iant@google.com>
4460 * options.h (class General_options): Add
4461 --ld-generated-unwind-info.
4462 * ehframe.cc (Fde::write): Add address parameter. Change all
4463 callers. If associated with PLT, fill in address and size.
4464 (Cie::set_output_offset): Only add merge mapping if there is an
4466 (Cie::write): Add address parameter. Change all callers.
4467 (Eh_frame::add_ehframe_for_plt): New function.
4468 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4469 input_offset_ fields into union u_, with new plt field.
4470 (Fde::Fde): Adjust for new union field.
4471 (Fde::Fde) [Output_data version]: New constructor.
4472 (Fde::add_mapping): Only add merge mapping if there is an object.
4473 (class Cie): Update declarations.
4474 (class Eh_frame): Declare add_ehframe_for_plt.
4475 * layout.cc (Layout::layout_eh_frame): Break out code into
4476 make_eh_frame_section, and call it.
4477 (Layout::make_eh_frame_section): New function.
4478 (Layout::add_eh_frame_for_plt): New function.
4479 * layout.h (class Layout): Update declarations.
4480 * merge.cc (Merge_map::add_mapping): Add assertion.
4481 * i386.cc: Include "dwarf.h".
4482 (class Output_data_plt_i386): Make first_plt_entry,
4483 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4484 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4485 and plt_eh_frame_fde.
4486 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4487 boundary. Call add_eh_frame_for_plt if appropriate.
4488 * x86_64.cc: Include "dwarf.h".
4489 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4490 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4491 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4492 and plt_eh_frame_fde.
4493 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4496 2011-06-29 Ian Lance Taylor <iant@google.com>
4499 * object.cc (Sized_relobj_file::layout_section): Change shdr
4500 parameter to be const.
4501 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4503 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4504 appropriate. Call layout_eh_frame_section.
4505 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4507 * object.h (class Sized_relobj_file): Update declarations.
4509 2011-06-29 Ian Lance Taylor <iant@google.com>
4512 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4514 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4516 2011-06-29 Ian Lance Taylor <iant@google.com>
4519 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4521 * layout.cc (Layout::layout_eh_frame): Likewise.
4523 2011-06-29 Ian Lance Taylor <iant@google.com>
4526 * layout.cc (Layout::symtab_section_shndx): New function.
4527 * layout.h (class Layout): Declare symtab_section_shndx.
4528 * output.cc (Output_section::write_header): Call it.
4530 2011-06-29 Ian Lance Taylor <iant@google.com>
4533 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4534 symbols which are not used in a relocation.
4536 2011-06-28 Ian Lance Taylor <iant@google.com>
4539 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4540 script create indistinguishable segments.
4541 (Layout::set_segment_offsets): Use stable_sort when sorting
4542 segments. Pass this to Compare_segments constructor.
4543 * layout.h (class Layout): Make segment_precedes non-static.
4544 (class Compare_segments): Change from struct to class. Add
4545 layout_ field. Add constructor.
4546 * script-sections.cc
4547 (Script_sections::attach_sections_using_phdrs_clause): Rename
4548 local orphan to is_orphan. Don't report failure to put empty
4549 section in segment. On attachment failure, report name of
4550 section, and attach to first PT_LOAD segment.
4552 2011-06-28 Ian Lance Taylor <iant@google.com>
4555 * target-select.cc (Target_selector::Target_selector): Add
4556 emulation parameter. Change all callers.
4557 (select_target_by_bfd_name): Rename from select_target_by_name.
4559 (select_target_by_emulation): New function.
4560 (supported_emulation_names): New function.
4561 * target-select.h (class Target_selector): Add emulation_ field.
4562 Update declarations.
4563 (Target_selector::recognize_by_bfd_name): Rename from
4564 recognize_by_name. Change all callers.
4565 (Target_selector::supported_bfd_names): Rename from
4566 supported_names. Change all callers.
4567 (Target_selector::recognize_by_emulation): New function.
4568 (Target_selector::supported_emulations): New function.
4569 (Target_selector::emulation): New function.
4570 (Target_selector::do_recognize_by_bfd_name): Rename from
4571 do_recognize_by_name. Change all callers.
4572 (Target_selector::do_supported_bfd_names): Rename from
4573 do_supported_names. Change all callers.
4574 (Target_selector::do_recognize_by_emulation): New function.
4575 (Target_selector::do_supported_emulations): New function.
4576 (select_target_by_bfd_name): Change name in declaration.
4577 (select_target_by_emulation): Declare.
4578 (supported_emulation_names): Declare.
4579 * parameters.cc (parameters_force_valid_target): Try to find
4580 target based on emulation from -m option.
4581 * options.h (class General_options): Change doc string for -m.
4582 * options.cc (help): Print emulations.
4583 (General_options::parse_V): Likewise.
4584 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4585 Add emulation parameter. Change all callers.
4587 2011-06-28 Ian Lance Taylor <iant@google.com>
4589 * target.h (class Target): Add osabi_ field.
4590 (Target::osabi): New function.
4591 (Target::set_osabi): New function.
4592 (Target::Target): Initialize osabi_.
4593 (Target::do_adjust_elf_header): Make pure virtual.
4594 (Sized_target::do_adjust_elf_header): Declare.
4595 * target.cc (Sized_target::do_adjust_elf_header): New function.
4596 (class Sized_target): Instantiate all versions.
4597 * freebsd.h (class Target_freebsd): Remove.
4598 (Target_selector_freebsd::do_recognize): Call set_osabi on
4600 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4601 (Target_selector_freebsd::set_osabi): Remove.
4602 * i386.cc (class Target_i386): Inherit from Sized_target rather
4603 than Target_freebsd.
4604 * x86_64.cc (class Target_x86_64): Likewise.
4606 2011-06-28 Ian Lance Taylor <iant@google.com>
4608 * target.h (Target::can_check_for_function_pointers): Rewrite.
4610 (Target::can_icf_inline_merge_sections): Likewise.
4611 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4612 (Target::Target_info): Add can_icf_inline_merge_sections field.
4613 (Target::do_can_check_for_function_pointers): New virtual
4615 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4616 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4617 from can_check_for_function_pointers, move in file.
4618 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4619 section_may_have_icf_unsafe_poineters, move in file.
4620 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4621 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4622 Rename from can_check_for_function_pointers, move in file.
4623 (Target_i386::can_icf_inline_merge_sections): Remove.
4624 (Target_i386::i386_info): Initialize
4625 can_icf_inline_merge_sections.
4626 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4627 Initialize can_icf_inline_merge_sections.
4628 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4629 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4630 Rename from can_check_for_function_pointers, move in file.
4631 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4632 (Target_x86_64::x86_64_info): Initialize
4633 can_icf_inline_merge_sections.
4634 * testsuite/testfile.cc (Target_test::test_target_info):
4636 * icf.cc (get_section_contents): Correct formatting.
4638 2011-06-27 Ian Lance Taylor <iant@google.com>
4640 * symtab.cc (Symbol::versioned_name): New function.
4641 (Symbol_table::add_to_final_symtab): Use versioned_name when
4643 (Symbol_table::sized_write_symbol): Likewise.
4644 * symtab.h (class Symbol): Declare versioned_name.
4645 * stringpool.h (class Stringpool_template): Add variant of add
4646 which takes a std::basic_string.
4647 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4648 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4649 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4650 (ver_test_12.o): New target.
4651 * testsuite/Makefile.in: Rebuild.
4653 2011-06-27 Doug Kwan <dougkwan@google.com>
4655 * arm.cc (Arm_relocate_functions::thm_jump8,
4656 Arm_relocate_functions::thm_jump11): Use a wider signed
4657 type to compute offset.
4658 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4660 * testsuite/Makefile.in: Regenerate.
4661 * testsuite/arm_branch_in_range.sh: Check test results of
4662 arm_thm_jump11 and arm_thm_jump8.
4663 * testsuite/arm_thm_jump11.s: New test source file.
4664 * testsuite/arm_thm_jump11.t: New linker script.
4665 * testsuite/arm_thm_jump8.s: New test source file.
4666 * testsuite/arm_thm_jump8.t: New linker script.
4668 2011-06-24 Ian Lance Taylor <iant@google.com>
4670 * layout.cc: Include "object.h".
4671 (ctors_sections_in_init_array): New static variable.
4672 (Layout::is_ctors_in_init_array): New function.
4673 (Layout::layout): Add entry to ctors_sections_in_init_array if
4675 * layout.h (class Layout): Declare is_ctors_in_init_array.
4676 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4677 is_ctors_reverse_view is set.
4678 (Sized_relobj_file::write_sections): Add layout parameter. Change
4679 all callers. Set is_ctors_reverse_view field of View_size.
4680 (Sized_relobj_file::reverse_words): New function.
4681 * object.h (Sized_relobj_file::View_size): Add
4682 is_ctors_reverse_view field.
4683 (class Sized_relobj_file): Update declarations.
4684 * testsuite/initpri3.c: New test.
4685 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4687 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4688 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4689 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4690 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4691 * testsuite/Makefile.in: Rebuild.
4693 2011-06-24 Cary Coutant <ccoutant@google.com>
4695 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4696 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4697 (debug_msg_cdebug.err): New targets.
4698 * testsuite/Makefile.in: Regenerate.
4699 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4700 Fix checks for link with shared library.
4702 2011-06-24 Doug Kwan <dougkwan@google.com>
4704 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4705 skip empty text sections.
4706 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4708 2011-06-22 Ian Lance Taylor <iant@google.com>
4711 * options.h (class General_options): Add --ctors-in-init-array.
4712 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4713 friends as SHT_PROGBITS for merging sections.
4714 (Layout::layout): Remove special handling of .init_array and
4715 friends. Don't sort if doing relocatable link. Sort for .ctors
4716 and .dtors if ctors_in_init_array.
4717 (Layout::make_output_section): Force correct section types for
4718 .init_array and friends. Don't sort if doing relocatable link,
4719 Don't sort .ctors and .dtors if ctors_in_init_array.
4720 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4721 (Layout::output_section_name): Add relobj parameter. Change all
4722 callers. Handle .ctors. and .dtors. in code rather than table.
4723 Handle .ctors and .dtors if ctors_in_init_array.
4724 (Layout::match_file_name): New function, moved from output.cc.
4725 * layout.h (class Layout): Update declarations.
4726 * output.cc: Include "layout.h".
4727 (Input_section_sort_entry::get_priority): New function.
4728 (Input_section_sort_entry::match_file_name): Just call
4729 Layout::match_file_name.
4730 (Output_section::Input_section_sort_init_fini_compare::operator()):
4731 Handle .ctors and .dtors. Sort by explicit priority rather than
4733 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4734 * testsuite/initpri2.c: New test.
4735 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4736 (check_PROGRAMS): Add initpri2.
4737 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4738 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4739 * configure, testsuite/Makefile.in: Rebuild.
4741 2011-06-19 Ian Lance Taylor <iant@google.com>
4744 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4745 .interp section to a PT_INTERP segment even if we have seen a
4746 --dynamic-linker option. Don't do it if we have seen a PHDRS
4747 clause in a linker script.
4748 (Layout::finalize): Don't create a .interp section if we've
4749 already create a PT_INTERP segment.
4750 (Layout::create_interp): Always call choose_output_section (revert
4751 patch of 2011-06-17). Don't create PT_INTERP segment.
4752 * script-sections.cc
4753 (Script_sections::create_note_and_tls_segments): Add a .interp
4754 section to a PT_INTERP segment even if we have seen a
4755 --dynamic-linker option.
4757 2011-06-18 Ian Lance Taylor <iant@google.com>
4759 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4760 merely because a non-PT_LOAD segment has a dynamic reloc.
4762 2011-06-18 Ian Lance Taylor <iant@google.com>
4764 * layout.cc (Layout::finish_dynamic_section): Don't create
4765 DT_FLAGS entry if not needed.
4767 2011-06-18 Ian Lance Taylor <iant@google.com>
4770 * layout.cc (Layout::layout_eh_frame): Correct handling of
4771 writable .eh_frame section.
4773 2011-06-17 Ian Lance Taylor <iant@google.com>
4776 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4777 symbol is redefined with the exact same object and value.
4779 2011-06-17 Ian Lance Taylor <iant@google.com>
4782 * layout.h (class Layout): Add interp_segment_ field.
4783 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4784 (Layout::attach_allocated_section_to_segment): If making shared
4785 library, put .interp section in PT_INTERP segment.
4786 (Layout::finalize): Also call create_interp if -dynamic-linker
4788 (Layout::create_interp): Assert that there is no PT_INTERP
4789 segment. If not using a SECTIONS clause, use make_output_section.
4790 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4791 * script-sections.cc
4792 (Script_sections::create_note_and_tls_segments): If making shared
4793 library, put .interp section in PT_INTERP segment.
4795 2011-06-17 Ian Lance Taylor <iant@google.com>
4797 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4798 when making a shared library.
4800 2011-06-17 Ian Lance Taylor <iant@google.com>
4802 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4803 parameter. Change all callers. Don't issue warning about PC32
4804 against locally defined symbol.
4806 2011-06-16 Ian Lance Taylor <iant@google.com>
4808 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4809 occurs in same object.
4811 2011-06-14 Alan Modra <amodra@gmail.com>
4813 * po/POTFILES.in: Regenerate.
4815 2011-06-09 Ian Lance Taylor <iant@google.com>
4817 * script-sections.cc
4818 (Orphan_output_section::set_section_addresses): For a relocatable
4819 link set address to 0.
4821 2011-06-09 Cary Coutant <ccoutant@google.com>
4824 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4825 used with --compress-debug-sections.
4826 * gold/object.cc (Sized_relobj_file::do_layout): Report
4827 uncompressed size of compressed input sections.
4829 2011-06-08 Cary Coutant <ccoutant@google.com>
4832 * testsuite/two_file_test_2_v1.cc: Change initialization of
4833 v2 to keep it in .data.
4835 2011-06-07 Cary Coutant <ccoutant@google.com>
4837 * common.cc (Symbol_table::do_allocate_commons_list): Call
4839 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4840 (Errors::fallback): New function.
4841 (gold_fallback): New function.
4842 * errors.h (Errors::fallback): New function.
4843 * gold.cc (gold_exit): Change status parameter to enum; adjust
4845 (queue_initial_tasks): Call gold_fallback.
4846 * gold.h: Include cstdlib.
4847 (Exit_status): New enum type.
4848 (gold_exit): Change status parameter to enum.
4849 (gold_fallback): New function.
4850 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4851 (Layout::create_symtab_sections): Likewise.
4852 (Layout::create_shdrs): Likewise.
4853 * main.cc (main): Adjust call to gold_exit.
4854 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4855 (Output_data_got::add_got_entry_pair): Likewise.
4856 (Output_section::add_input_section): Likewise.
4857 (Output_section::add_output_section_data): Likewise.
4858 (Output_segment::set_section_list_addresses): Likewise.
4859 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4861 2011-06-07 Cary Coutant <ccoutant@google.com>
4863 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4864 for incremental links.
4865 * output.cc (Output_segment::set_section_list_addresses): Remove
4866 FIXME and test for TLS or BSS.
4868 2011-06-07 Cary Coutant <ccoutant@google.com>
4870 * testsuite/Makefile.am: Add incremental_copy_test,
4871 incremental_common_test_1.
4872 * testsuite/Makefile.in: Regenerate.
4873 * testsuite/common_test_1_v1.c: New source file.
4874 * testsuite/common_test_1_v2.c: New source file.
4875 * testsuite/copy_test_v1.cc: New source file.
4877 2011-06-07 Cary Coutant <ccoutant@google.com>
4879 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4880 update, allocate common from bss section's free list.
4881 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4882 linker-defined symbols.
4883 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4884 Skip GOT and PLT entries that are no longer referenced.
4885 (Output_section_incremental_inputs::write_info_blocks): Mark
4886 linker-defined symbols.
4887 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4888 * output.cc (Output_section::allocate): New function.
4889 * output.h (Output_section::allocate): New function.
4890 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4891 linker-defined symbols.
4892 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4893 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4894 (Symbol::init_base_output_data): Likewise.
4895 (Symbol::init_base_output_segment): Likewise.
4896 (Symbol::init_base_constant): Likewise.
4897 (Sized_symbol::init_output_data): Likewise.
4898 (Sized_symbol::init_output_segment): Likewise.
4899 (Sized_symbol::init_constant): Likewise.
4900 (Symbol_table::do_define_in_output_data): Likewise.
4901 (Symbol_table::do_define_in_output_segment): Likewise.
4902 (Symbol_table::do_define_as_constant): Likewise.
4903 * symtab.h (Symbol::is_predefined): New function.
4904 (Symbol::init_base_output_data): Add is_predefined parameter.
4905 (Symbol::init_base_output_segment): Likewise.
4906 (Symbol::init_base_constant): Likewise.
4907 (Symbol::is_predefined_): New data member.
4908 (Sized_symbol::init_output_data): Add is_predefined parameter.
4909 (Sized_symbol::init_output_segment): Likewise.
4910 (Sized_symbol::init_constant): Likewise.
4911 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4913 2011-06-07 Cary Coutant <ccoutant@google.com>
4915 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4916 instead of emit_copy_reloc.
4917 (Copy_relocs::emit_copy_reloc): Refactor.
4918 (Copy_relocs::make_copy_reloc): New function.
4919 (Copy_relocs::add_copy_reloc): Remove.
4920 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4922 (Copy_relocs::make_copy_reloc): New function.
4923 (Copy_relocs::add_copy_reloc): Remove.
4924 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4925 unchanged input files.
4926 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4927 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4928 Reserve BSS space for COPY relocations.
4929 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4930 (Output_section_incremental_inputs::write_info_blocks): Record
4931 whether a symbol is copied from a shared object.
4932 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4933 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4934 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4935 (Incremental_input_entry_reader::get_output_symbol_index): Add
4937 (Incremental_binary::emit_copy_relocs): New function.
4938 (Incremental_binary::do_emit_copy_relocs): New function.
4939 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4941 (Sized_incremental_binary::add_copy_reloc): New function.
4942 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4943 (Sized_incremental_binary::Copy_reloc): New struct.
4944 (Sized_incremental_binary::Copy_relocs): New typedef.
4945 (Sized_incremental_binary::copy_relocs_): New data member.
4946 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4947 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4948 * target.h (Sized_target::emit_copy_reloc): New function.
4949 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4951 2011-06-02 Cary Coutant <ccoutant@google.com>
4954 * gold/archive.cc (Archive::Archive): Initialize new data member.
4955 (Archive::include_all_members): Return if archive has already been
4957 * gold/archive.h (Archive::include_all_members_): New data member.
4959 2011-06-02 Nick Clifton <nickc@redhat.com>
4961 * dynobj.h: Fix spelling mistake in comment.
4962 * output.cc: Likewise.
4964 2011-05-31 Doug Kwan <dougkwan@google.com>
4968 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
4969 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4970 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4971 redundant arm_exidx_test.so.
4972 * testsuite/Makefile.in: Regenerate.
4973 (check_SCRIPTS): Add pr12826.sh
4974 (check_DATA): Add pr12826.stdout
4975 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4976 * testsuite/pr12826.sh: New file.
4977 * testsuite/pr12826_1.s: Ditto.
4978 * testsuite/pr12826_1.s: Ditto.
4980 2011-05-30 Ian Lance Taylor <iant@google.com>
4982 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4985 2011-05-29 Ian Lance Taylor <iant@google.com>
4988 * testsuite/Makefile.am: Use different file name for two_file_test
4989 temporary file for each incremental test.
4990 * testsuite/Makefile.in: Rebuild.
4992 2011-05-29 Ian Lance Taylor <iant@google.com>
4994 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4995 binary input file is empty.
4997 2011-05-27 Ian Lance Taylor <iant@google.com>
4999 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5000 (ver_test_9.so): Likewise.
5001 * testsuite/Makefile.in: Rebuild.
5003 2011-05-26 Cary Coutant <ccoutant@google.com>
5005 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5006 * incremental.cc (Incremental_inputs::report_input_section): Fix
5007 comment, indentation.
5008 (Incremental_inputs::report_comdat_group): New function.
5009 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5010 of data for incremental input file entry.
5011 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5012 group count, COMDAT group signatures.
5013 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5014 an unchanged input file.
5015 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5016 Initialize new data member.
5017 (Incremental_object_entry::add_comdat_group): New function.
5018 (Incremental_object_entry::get_comdat_group_count): New function.
5019 (Incremental_object_entry::get_comdat_signature_key): New function.
5020 (Incremental_object_entry::groups_): New data member.
5021 (Incremental_inputs::report_comdat_group): New function.
5022 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5023 data for incremental input file entry.
5024 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5025 (Incremental_input_entry_reader::get_input_section): Adjust size of
5026 data for incremental input file entry.
5027 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5028 (Incremental_input_entry_reader::get_comdat_group_signature): New
5030 * object.cc (Sized_relobj::include_section_group): Report kept
5031 COMDAT groups for incremental links.
5033 2011-05-24 David Meyer <pdox@google.com>
5035 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5036 with name parameter. Add found_name parameter.
5037 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5038 * dirsearch.h (class Dirsearch): Update declaration.
5040 2011-05-24 Ian Lance Taylor <iant@google.com>
5042 * archive.cc (Library_base::should_include_member): Pull in object
5043 from archive if it defines the entry symbol.
5044 * parameters.cc (Parameters::entry): New function.
5045 * parameters.h (class Parameters): Declare entry.
5046 * output.h (class Output_file_header): Remove entry_ field.
5047 * output.cc (Output_file_header::Output_file_header): Remove entry
5048 parameter. Change all callers.
5049 (Output_file_header::entry): Use parameters->entry.
5050 * gold.cc (queue_middle_tasks): Likewise.
5051 * plugin.cc (Plugin_hook::run): Likewise.
5053 2011-05-24 Cary Coutant <ccoutant@google.com>
5055 * gold.cc (queue_initial_tasks): Pass incremental base filename
5056 to Output_file::open_base_file; don't print error message.
5057 * incremental-dump.cc (main): Adjust call to
5058 Output_file::open_for_modification.
5059 * incremental-dump.cc (main): Likewise.
5060 * incremental.cc (Incremental_inputs::report_command_line):
5061 Ignore --incremental-base option when comparing command lines.
5062 Ignore parameter when given as separate argument.
5063 * options.h (class General_options): Add --incremental-base.
5064 * output.cc (Output_file::Output_file):
5065 (Output_file::open_base_file): Add base_name and writable parameters;
5066 read base file into new file; print error message here.
5067 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5069 * output.h (Output_file::open_for_modification): Rename to...
5070 (Output_file::open_base_file): ...this; add base_name and
5071 writable parameters; adjust all callers.
5072 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5074 * testsuite/Makefile.am (incremental_test_4): Test
5076 * testsuite/Makefile.in: Regenerate.
5078 2011-05-24 Cary Coutant <ccoutant@google.com>
5080 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5082 * testsuite/Makefile.in: Regenerate.
5083 * testsuite/two_file_test_1_v1.cc: New test source file.
5084 * testsuite/two_file_test_1b_v1.cc: New test source file.
5085 * testsuite/two_file_test_2_v1.cc: New test source file.
5087 2011-05-24 Cary Coutant <ccoutant@google.com>
5089 * dynobj.h (Dynobj::do_dynobj): New function.
5090 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5091 flag and soname for shared objects.
5092 * incremental.cc (Incremental_inputs::report_object): Make
5093 either Incremental_object_entry or Incremental_dynobj_entry; add
5094 soname to string table.
5095 (Incremental_inputs::report_input_section): Add assertion.
5096 (Output_section_incremental_inputs::set_final_data_size): Adjust
5097 type of input file entry for shared libraries; adjust size of
5098 shared library info entry.
5099 (Output_section_incremental_inputs::write_input_files): Write
5100 as_needed flag for shared libraries.
5101 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5102 of input file entry for shared libraries; write soname.
5103 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5104 soname from incremental info.
5105 * incremental.h (enum Incremental_input_flags): Add
5106 INCREMENTAL_INPUT_AS_NEEDED.
5107 (Incremental_input_entry::Incremental_input_entry): Initialize new
5109 (Incremental_input_entry::set_as_needed): New function.
5110 (Incremental_input_entry::as_needed): New function.
5111 (Incremental_input_entry::do_dynobj_entry): New function.
5112 (Incremental_input_entry::as_needed_): New data member.
5113 (Incremental_object_entry::Incremental_object_entry): Don't check
5115 (Incremental_object_entry::do_type): Likewise.
5116 (class Incremental_dynobj_entry): New class.
5117 (Incremental_input_entry_reader::as_needed): New function.
5118 (Incremental_input_entry_reader::get_soname): New function.
5119 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5120 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5121 size of shared library info entry.
5122 * layout.cc (Layout::finish_dynamic_section): Don't test for
5123 incremental link when adding DT_NEEDED entries.
5124 * object.h (Object::Object): Initialize new data member.
5125 (Object::dynobj): New function.
5126 (Object::set_as_needed): New function.
5127 (Object::as_needed): New function.
5128 (Object::do_dynobj): New function.
5129 (Object::as_needed_): New data member.
5131 2011-05-24 Cary Coutant <ccoutant@google.com>
5133 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5134 info; adjust display of GOT entries.
5135 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5136 vector of input objects; remove file_status_.
5137 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5138 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5139 got_plt reader; call target hooks to reserve GOT entries.
5140 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5141 of input file info header and GOT info entry.
5142 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5144 (Got_plt_view_info::got_descriptor): Remove.
5145 (Got_plt_view_info::sym_index): New data member.
5146 (Got_plt_view_info::input_index): New data member.
5147 (Local_got_offset_visitor::visit): Write input file index.
5148 (Global_got_offset_visitor::visit): Write 0 for input file index.
5149 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5150 with sym_index and input_index.
5151 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5152 incremental info GOT entry; replace got_descriptor with input_index.
5153 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5154 map from input file index to object.
5155 (Sized_relobj_incr::do_layout): Replace direct data member reference
5156 with accessor function.
5157 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5158 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5159 Adjust size of input file info header.
5160 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5161 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5162 (Incremental_input_entry_reader::get_input_section): Adjust size of
5163 input file info header.
5164 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5165 of incremental info GOT entry.
5166 (Incremental_got_plt_reader::get_got_desc): Remove.
5167 (Incremental_got_plt_reader::get_got_symndx): New function.
5168 (Incremental_got_plt_reader::get_got_input_index): New function.
5169 (Sized_incremental_binary::Sized_incremental_binary): Remove
5170 file_status_; add input_objects_.
5171 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5172 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5173 (Sized_incremental_binary::file_is_unchanged): Remove.
5174 (Sized_incremental_binary::set_input_object): New function.
5175 (Sized_incremental_binary::input_object): New function.
5176 (Sized_incremental_binary::file_status_): Remove.
5177 (Sized_incremental_binary::input_objects_): New data member.
5178 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5180 (Sized_relobj_incr::invalid_address): Move to base class.
5181 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5183 (Sized_relobj_incr::do_output_section_offset): Likewise.
5184 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5185 (Sized_relobj_incr::section_offsets_): Likewise.
5186 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5188 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5189 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5190 with accessor function.
5191 (Sized_relobj_file::do_layout): Likewise.
5192 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5193 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5194 (Sized_relobj_file::compute_final_local_value): Replace refs to
5195 section_offsets_ with accessor function.
5196 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5197 * object.h (Relobj::Relobj): Initialize new data members.
5198 (Relobj::add_dyn_reloc): New function.
5199 (Relobj::first_dyn_reloc): New function.
5200 (Relobj::dyn_reloc_count): New function.
5201 (Relobj::first_dyn_reloc_): New data member.
5202 (Relobj::dyn_reloc_count_): New data member.
5203 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5205 (Sized_relobj::Address): New typedef.
5206 (Sized_relobj::invalid_address): Move here from child class.
5207 (Sized_relobj::Sized_relobj): Initialize new data members.
5208 (Sized_relobj::sized_relobj): New function.
5209 (Sized_relobj::is_output_section_offset_invalid): Move here from
5211 (Sized_relobj::get_output_section_offset): Likewise.
5212 (Sized_relobj::local_has_got_offset): Likewise.
5213 (Sized_relobj::local_got_offset): Likewise.
5214 (Sized_relobj::set_local_got_offset): Likewise.
5215 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5216 (Sized_relobj::clear_got_offsets): New function.
5217 (Sized_relobj::section_offsets): Move here from child class.
5218 (Sized_relobj::do_output_section_offset): Likewise.
5219 (Sized_relobj::do_set_section_offset): Likewise.
5220 (Sized_relobj::Local_got_offsets): Likewise.
5221 (Sized_relobj::local_got_offsets_): Likewise.
5222 (Sized_relobj::section_offsets_): Likewise.
5223 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5225 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5227 (Sized_relobj_file::sized_relobj): New function
5228 (Sized_relobj_file::local_has_got_offset): Move to base class.
5229 (Sized_relobj_file::local_got_offset): Likewise.
5230 (Sized_relobj_file::set_local_got_offset): Likewise.
5231 (Sized_relobj_file::get_output_section_offset): Likewise.
5232 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5233 (Sized_relobj_file::do_output_section_offset): Likewise.
5234 (Sized_relobj_file::do_set_section_offset): Likewise.
5235 (Sized_relobj_file::Local_got_offsets): Likewise.
5236 (Sized_relobj_file::local_got_offsets_): Likewise.
5237 (Sized_relobj_file::section_offsets_): Likewise.
5238 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5240 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5241 (Output_reloc::get_symbol_index): Likewise.
5242 (Output_reloc::local_section_offset): Likewise.
5243 (Output_reloc::get_address): Likewise.
5244 (Output_reloc::symbol_value): Likewise.
5245 (Output_data_got::reserve_slot): Move to class definition.
5246 (Output_data_got::reserve_local): New function.
5247 (Output_data_got::reserve_slot_for_global): Remove.
5248 (Output_data_got::reserve_global): New function.
5249 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5250 (all constructors, two instantiations).
5251 (Output_reloc::get_relobj): New function (two instantiations).
5252 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5253 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5254 (Output_data_reloc::add_global): Adjust type of relobj.
5255 (Output_data_reloc::add_global_relative): Likewise.
5256 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5257 (Output_data_reloc::add_local): Likewise.
5258 (Output_data_reloc::add_local_relative): Likewise.
5259 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5260 (Output_data_reloc::add_local_section): Likewise.
5261 (Output_data_reloc::add_output_section): Likewise.
5262 (Output_data_reloc::add_absolute): Likewise.
5263 (Output_data_reloc::add_target_specific): Likewise.
5264 (Output_data_got::reserve_slot): Move definition here.
5265 (Output_data_got::reserve_local): New function.
5266 (Output_data_got::reserve_global): New function.
5267 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5268 section_offsets_ with accessor function.
5269 (Sized_relobj_file::write_sections): Likewise.
5270 (Sized_relobj_file::do_relocate_sections): Likewise.
5271 * target.h (Sized_target::reserve_local_got_entry): New function.
5272 (Sized_target::reserve_global_got_entry): New function.
5273 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5274 (Target_x86_64::reserve_global_got_entry): New function.
5275 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5277 2011-05-23 Cary Coutant <ccoutant@google.com>
5279 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5280 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5281 bit when checking got_type.
5282 * incremental.cc (Sized_incremental_binary::setup_readers):
5283 Store symbol table and string table locations; initialize bit vector
5284 of file status flags.
5285 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5287 (Sized_incremental_binary::do_process_got_plt): New function.
5288 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5289 (Output_section_incremental_inputs::set_final_data_size): Record
5290 file index for each input file.
5291 (Output_section_incremental_inputs::write_got_plt): Store file index
5292 instead of input entry offset for each GOT entry.
5294 (Incremental_input_entry::Incremental_input_entry): Initialize new
5296 (Incremental_input_entry::set_offset): Store file index.
5297 (Incremental_input_entry::get_file_index): New function.
5298 (Incremental_input_entry::file_index_): New data member.
5299 (Incremental_binary::process_got_plt): New function.
5300 (Incremental_binary::do_process_got_plt): New function.
5301 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5303 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5304 (Sized_incremental_binary::set_file_is_unchanged): New function.
5305 (Sized_incremental_binary::file_is_unchanged): New function.
5306 (Sized_incremental_binary::do_process_got_plt): New function.
5307 (Sized_incremental_binary::file_status_): New data member.
5308 (Sized_incremental_binary::main_symtab_loc_): New data member.
5309 (Sized_incremental_binary::main_strtab_loc_): New data member.
5310 * output.cc (Output_data_got::Got_entry::write): Add case
5312 (Output_data_got::add_global): Call add_got_entry.
5313 (Output_data_got::add_global_plt): Likewise.
5314 (Output_data_got::add_global_with_rel): Likewise.
5315 (Output_data_got::add_global_with_rela): Likewise.
5316 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5317 (Output_data_got::add_global_pair_with_rela): Likewise.
5318 (Output_data_got::add_local): Call add_got_entry.
5319 (Output_data_got::add_local_plt): Likewise.
5320 (Output_data_got::add_local_with_rel): Likewise.
5321 (Output_data_got::add_local_with_rela): Likewise.
5322 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5323 (Output_data_got::add_local_pair_with_rela): Likewise.
5324 (Output_data_got::reserve_slot): New function.
5325 (Output_data_got::reserve_slot_for_global): New function.
5326 (Output_data_got::add_got_entry): New function.
5327 (Output_data_got::add_got_entry_pair): New function.
5328 (Output_section::add_output_section_data): Edit FIXME.
5330 (Output_section_data_build::Output_section_data_build): New
5331 constructor with size parameter.
5332 (Output_data_space::Output_data_space): Likewise.
5333 (Output_data_got::Output_data_got): Initialize new data member; new
5334 constructor with size parameter.
5335 (Output_data_got::add_constant): Call add_got_entry.
5336 (Output_data_got::reserve_slot): New function.
5337 (Output_data_got::reserve_slot_for_global): New function.
5338 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5339 (Output_data_got::add_got_entry): New function.
5340 (Output_data_got::add_got_entry_pair): New function.
5341 (Output_data_got::free_list_): New data member.
5342 * target.h (Sized_target::init_got_plt_for_update): New function.
5343 (Sized_target::register_global_plt_entry): New function.
5344 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5345 Initialize new data member; call init; add constructor with PLT count.
5346 (Output_data_plt_x86_64::init): New function.
5347 (Output_data_plt_x86_64::add_relocation): New function.
5348 (Output_data_plt_x86_64::reserve_slot): New function.
5349 (Output_data_plt_x86_64::free_list_): New data member.
5350 (Target_x86_64::init_got_plt_for_update): New function.
5351 (Target_x86_64::register_global_plt_entry): New function.
5352 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5353 incremental updates.
5354 (Output_data_plt_x86_64::add_relocation): New function.
5355 * testsuite/object_unittest.cc (Object_test): Set default options.
5357 2011-05-16 Ian Lance Taylor <iant@google.com>
5359 * options.h (class General_options): Make -i a synonym for -r.
5361 2011-05-16 Ian Lance Taylor <iant@google.com>
5363 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5365 2011-05-10 Cary Coutant <ccoutant@google.com>
5367 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5370 2011-05-06 Ian Lance Taylor <iant@google.com>
5372 * layout.cc (Layout::layout): If the output section flags change,
5373 update the ordering.
5375 2011-04-25 Cary Coutant <ccoutant@google.com>
5377 * incremental-dump.cc (dump_incremental_inputs): Print local
5378 symbol info for each input file.
5380 (Output_section_incremental_inputs::set_final_data_size): Add local
5381 symbol info to input file entries in incremental info.
5382 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5383 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5384 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5385 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5387 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5388 (Sized_incr_relobj::do_relocate): Write the local symbols.
5389 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5390 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5391 Adjust size of input file header.
5392 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5393 (Incremental_inputs_reader::get_local_symbol_count): New function.
5394 (Incremental_inputs_reader::get_input_section): Adjust size of input
5396 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5397 (Sized_incr_relobj::This): New typedef.
5398 (Sized_incr_relobj::sym_size): New const data member.
5399 (Sized_incr_relobj::Local_symbol): New struct.
5400 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5401 (Sized_incr_relobj::do_local_symbol_offset): New function.
5402 (Sized_incr_relobj::local_symbol_count_): New data member.
5403 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5404 (Sized_incr_relobj::local_symbol_index_): New data member.
5405 (Sized_incr_relobj::local_symbol_offset_): New data member.
5406 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5407 (Sized_incr_relobj::local_symbols_): New data member.
5408 * object.h (Relobj::output_local_symbol_count): New function.
5409 (Relobj::local_symbol_offset): New function.
5410 (Relobj::do_output_local_symbol_count): New function.
5411 (Relobj::do_local_symbol_offset): New function.
5412 (Sized_relobj::do_output_local_symbol_count): New function.
5413 (Sized_relobj::do_local_symbol_offset): New function.
5415 2011-04-22 Vladimir Simonov <sv@sw.ru>
5417 * descriptors.cc (set_close_on_exec): New function.
5418 (Descriptors::open): Use set_close_on_exec.
5419 * output.cc (S_ISLNK): Define if not defined.
5421 2011-04-22 Cary Coutant <ccoutant@google.com>
5423 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5425 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5426 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5427 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5429 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5430 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5431 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5433 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5435 (Incremental_binary::apply_incremental_relocs): New function.
5436 (Incremental_binary::do_apply_incremental_relocs): New function.
5437 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5439 (Sized_incremental_binary::add_global_symbol): New function.
5440 (Sized_incremental_binary::global_symbol): New function.
5441 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5442 (Sized_incremental_binary::symbol_map_): New data member.
5443 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5444 * target.h (Sized_target::apply_relocation): New function.
5445 * target-reloc.h (apply_relocation): New function.
5446 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5448 2011-04-22 Doug Kwan <dougkwan@google.com>
5450 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5451 flag of a SHT_ARM_EXIDX section.
5452 * testsuite/Makefile.am (arm_exidx_test): New test rules.
5453 * testsuite/Makefile.in: Regenerate.
5454 * testsuite/arm_exidx_test.s: New file.
5455 * testsuite/arm_exidx_test.sh: Same.
5457 2011-04-20 Cary Coutant <ccoutant@google.com>
5460 * archive.h (Incremental_archive_entry::Archive_member):
5461 Initialize arg_serial_ (second constructor).
5463 2011-04-17 Ian Lance Taylor <iant@google.com>
5465 * object.cc (Relocate_info::location): Simplify location string.
5466 * errors.cc (Errors::error_at_location): Don't print program
5468 (Errors::warning_at_location): Likewise.
5469 (Errors::undefined_symbol): Likewise.
5470 * testsuite/debug_msg.sh: Update accordingly.
5472 2011-04-14 Cary Coutant <ccoutant@google.com>
5474 * gold/layout.cc (Layout::symtab_section_offset): New function.
5475 * gold/layout.h (Layout::symtab_section_offset): New function.
5476 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5478 2011-04-12 Ian Lance Taylor <iant@google.com>
5480 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5481 with MREMAP_MAYMOVE.
5482 * output.h (class Output_file): Add map_is_allocated_ field.
5483 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5484 not available, provide stubs. If mremap is not available, #define
5486 (MREMAP_MAYMOVE): Define if not defined.
5487 (Output_file::Output_file): Initialize map_is_allocated_.
5488 (Output_file::resize): Check map_is_allocated_.
5489 (Output_file::map_anonymous): If mmap fails, use malloc.
5490 (Output_file::unmap): Don't do anything for an anonymous map.
5491 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5492 is not available, provide stubs.
5493 (File_read::View::~View): Use free rather than delete[].
5494 (File_read::make_view): Use malloc rather than new[]. If mmap
5496 (File_read::find_or_make_view): Use malloc rather than new[].
5497 * gold.h: Remove HAVE_REMAP code.
5498 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5499 exists. Rename mremap to gold_mremap. If mmap is not available
5501 * configure, config.in: Rebuild.
5503 2011-04-11 Ian Lance Taylor <iant@google.com>
5505 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5506 initialize local variable v.
5508 2011-04-11 Cary Coutant <ccoutant@google.com>
5510 * archive.cc (Archive::include_member): Adjust call to
5512 (Add_archive_symbols::run): Track argument serial numbers.
5513 (Lib_group::include_member): Likewise.
5514 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5515 * archive.h (Incremental_archive_entry::Archive_member):
5516 Initialize arg_serial_.
5517 (Archive_member::arg_serial_): New data member.
5518 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5519 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5521 (Sized_dynobj::do_for_all_local_got_entries): New function.
5522 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5524 * fileread.cc (get_mtime): New function.
5525 * fileread.h (get_mtime): New function.
5526 * gold.cc (queue_initial_tasks): Check for incremental update.
5527 (process_incremental_input): New function.
5528 (queue_middle_tasks): Don't force valid target for incremental
5530 * incremental-dump.cc (find_input_containing_global): Adjust
5531 size of symbol info entry.
5532 (dump_incremental_inputs): Dump argument serial number and
5533 in_system_directory flag; bias shndx by 1; print symbol names
5534 when dumping per-file symbol lists; use new symbol info readers.
5536 (Output_section_incremental_inputs:update_data_size): New function.
5537 (Sized_incremental_binary::setup_readers): Setup input readers
5538 for each input file; build maps for files added from libraries
5540 (Sized_incremental_binary::check_input_args): New function.
5541 (Sized_incremental_binary::do_check_inputs): Build map of argument
5542 serial numbers to input arguments.
5543 (Sized_incremental_binary::do_file_has_changed): Rename
5544 do_file_is_unchanged to this; compare file modification times.
5545 (Sized_incremental_binary::do_init_layout): New function.
5546 (Sized_incremental_binary::do_reserve_layout): New function.
5547 (Sized_incremental_binary::do_get_input_reader): Remove.
5548 (Sized_incremental_binary::get_symtab_view): New function.
5549 (Incremental_checker::can_incrementally_link_output_file): Remove.
5550 (Incremental_inputs::report_command_line): Exclude --debug options.
5551 (Incremental_inputs::report_archive_begin): Add parameter; track
5552 argument serial numbers; don't put input file entry for archive
5553 before archive members.
5554 (Incremental_inputs::report_archive_end): Put input file entry
5555 for archive after archive members.
5556 (Incremental_inputs::report_object): Add parameter; track argument
5557 serial numbers and in_system_directory flag.
5558 (Incremental_inputs::report_script): Add parameter; track argument
5560 (Output_section_incremental_inputs::set_final_data_size): Adjust
5561 size of symbol info entry; check for forwarding symbols.
5562 (Output_section_incremental_inputs::write_input_files): Write
5563 in_system_directory flag and argument serial number.
5564 (Output_section_incremental_inputs::write_info_blocks): Map section
5565 indices between incremental info and original input file; store
5566 input section index for each symbol.
5567 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5568 change operator() to visit().
5569 (class Global_got_offset_visitor): Likewise.
5570 (class Global_symbol_visitor_got_plt):
5571 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5573 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5574 (Sized_incr_relobj::do_read_symbols): New function.
5575 (Sized_incr_relobj::do_layout): New function.
5576 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5577 (Sized_incr_relobj::do_add_symbols): New function.
5578 (Sized_incr_relobj::do_should_include_member): New function.
5579 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5580 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5581 (Sized_incr_relobj::do_section_size): New function.
5582 (Sized_incr_relobj::do_section_name): New function.
5583 (Sized_incr_relobj::do_section_contents): New function.
5584 (Sized_incr_relobj::do_section_flags): New function.
5585 (Sized_incr_relobj::do_section_entsize): New function.
5586 (Sized_incr_relobj::do_section_address): New function.
5587 (Sized_incr_relobj::do_section_type): New function.
5588 (Sized_incr_relobj::do_section_link): New function.
5589 (Sized_incr_relobj::do_section_info): New function.
5590 (Sized_incr_relobj::do_section_addralign): New function.
5591 (Sized_incr_relobj::do_initialize_xindex): New function.
5592 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5593 (Sized_incr_relobj::do_read_relocs): New function.
5594 (Sized_incr_relobj::do_gc_process_relocs): New function.
5595 (Sized_incr_relobj::do_scan_relocs): New function.
5596 (Sized_incr_relobj::do_count_local_symbols): New function.
5597 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5598 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5599 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5600 (Sized_incr_relobj::do_relocate): New function.
5601 (Sized_incr_relobj::do_set_section_offset): New function.
5602 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5603 (Sized_incr_dynobj::do_read_symbols): New function.
5604 (Sized_incr_dynobj::do_layout): New function.
5605 (Sized_incr_dynobj::do_add_symbols): New function.
5606 (Sized_incr_dynobj::do_should_include_member): New function.
5607 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5608 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5609 (Sized_incr_dynobj::do_section_size): New function.
5610 (Sized_incr_dynobj::do_section_name): New function.
5611 (Sized_incr_dynobj::do_section_contents): New function.
5612 (Sized_incr_dynobj::do_section_flags): New function.
5613 (Sized_incr_dynobj::do_section_entsize): New function.
5614 (Sized_incr_dynobj::do_section_address): New function.
5615 (Sized_incr_dynobj::do_section_type): New function.
5616 (Sized_incr_dynobj::do_section_link): New function.
5617 (Sized_incr_dynobj::do_section_info): New function.
5618 (Sized_incr_dynobj::do_section_addralign): New function.
5619 (Sized_incr_dynobj::do_initialize_xindex): New function.
5620 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5621 (make_sized_incremental_object): New function.
5622 (Incremental_library::copy_unused_symbols): New function.
5623 (Incremental_library::do_for_all_unused_symbols): New function.
5624 * incremental.h (enum Incremental_input_flags): New type.
5625 (class Incremental_checker): Remove.
5626 (Incremental_input_entry::Incremental_input_entry): Add argument
5628 (Incremental_input_entry::arg_serial): New function.
5629 (Incremental_input_entry::set_is_in_system_directory): New function.
5630 (Incremental_input_entry::is_in_system_directory): New function.
5631 (Incremental_input_entry::arg_serial_): New data member.
5632 (Incremental_input_entry::is_in_system_directory_): New data member.
5633 (class Script_info): Move here from script.h.
5634 (Script_info::Script_info): Add filename parameter.
5635 (Script_info::filename): New function.
5636 (Script_info::filename_): New data member.
5637 (Incremental_script_entry::Incremental_script_entry): Add argument
5639 (Incremental_object_entry::Incremental_object_entry): Likewise.
5640 (Incremental_object_entry::add_input_section): Build list of input
5641 sections with map to original shndx.
5642 (Incremental_object_entry::get_input_section_index): New function.
5643 (Incremental_object_entry::shndx_): New data member.
5644 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5645 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5646 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5648 (Incremental_inputs::report_archive_begin): Likewise.
5649 (Incremental_inputs::report_object): Likewise.
5650 (Incremental_inputs::report_script): Likewise.
5651 (class Incremental_global_symbol_reader): New class.
5652 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5653 and store flags and input file type.
5654 (Incremental_input_entry_reader::arg_serial): New function.
5655 (Incremental_input_entry_reader::type): Extract type from flags.
5656 (Incremental_input_entry_reader::is_in_system_directory): New function.
5657 (Incremental_input_entry_reader::get_input_section_count): Call
5658 accessor function for type.
5659 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5660 function for type; adjust size of global symbol entry.
5661 (Incremental_input_entry_reader::get_global_symbol_count): Call
5662 accessor function for type.
5663 (Incremental_input_entry_reader::get_object_count): Likewise.
5664 (Incremental_input_entry_reader::get_object_offset): Likewise.
5665 (Incremental_input_entry_reader::get_member_count): Likewise.
5666 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5667 (Incremental_input_entry_reader::get_member_offset): Likewise.
5668 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5669 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5670 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5671 (Incremental_input_entry_reader::get_global_symbol_reader): New
5673 (Incremental_input_entry_reader::get_output_symbol_index): New
5675 (Incremental_input_entry_reader::type_): Remove.
5676 (Incremental_input_entry_reader::flags_): New data member.
5677 (Incremental_inputs_reader::input_file_offset): New function.
5678 (Incremental_inputs_reader::input_file_index): New function.
5679 (Incremental_inputs_reader::input_file): Call input_file_offset.
5680 (Incremental_inputs_reader::input_file_at_offset): New function.
5681 (Incremental_relocs_reader::get_r_type): Reformat.
5682 (Incremental_relocs_reader::get_r_shndx): Reformat.
5683 (Incremental_relocs_reader::get_r_offset): Reformat.
5684 (Incremental_relocs_reader::data): New function.
5685 (Incremental_binary::Incremental_binary): Initialize new data members.
5686 (Incremental_binary::check_inputs): Add cmdline parameter.
5687 (Incremental_binary::file_is_unchanged): Remove.
5688 (Input_reader::arg_serial): New function.
5689 (Input_reader::get_unused_symbol_count): New function.
5690 (Input_reader::get_unused_symbol): New function.
5691 (Input_reader::do_arg_serial): New function.
5692 (Input_reader::do_get_unused_symbol_count): New function.
5693 (Input_reader::do_get_unused_symbol): New function.
5694 (Incremental_binary::input_file_count): New function.
5695 (Incremental_binary::get_input_reader): Change signature to use
5696 index instead of filename.
5697 (Incremental_binary::file_has_changed): New function.
5698 (Incremental_binary::get_input_argument): New function.
5699 (Incremental_binary::get_library): New function.
5700 (Incremental_binary::get_script_info): New function.
5701 (Incremental_binary::init_layout): New function.
5702 (Incremental_binary::reserve_layout): New function.
5703 (Incremental_binary::output_file): New function.
5704 (Incremental_binary::do_check_inputs): New function.
5705 (Incremental_binary::do_file_is_unchanged): Remove.
5706 (Incremental_binary::do_file_has_changed): New function.
5707 (Incremental_binary::do_init_layout): New function.
5708 (Incremental_binary::do_reserve_layout): New function.
5709 (Incremental_binary::do_input_file_count): New function.
5710 (Incremental_binary::do_get_input_reader): Change signature.
5711 (Incremental_binary::input_args_map_): New data member.
5712 (Incremental_binary::library_map_): New data member.
5713 (Incremental_binary::script_map_): New data member.
5714 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5716 (Sized_incremental_binary::output_section): New function.
5717 (Sized_incremental_binary::inputs_reader): Add const.
5718 (Sized_incremental_binary::symtab_reader): Add const.
5719 (Sized_incremental_binary::relocs_reader): Add const.
5720 (Sized_incremental_binary::got_plt_reader): Add const.
5721 (Sized_incremental_binary::get_symtab_view): New function.
5722 (Sized_incremental_binary::Inputs_reader): New typedef.
5723 (Sized_incremental_binary::Input_entry_reader): New typedef.
5724 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5725 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5726 (Sized_incremental_binary::do_file_has_changed): New function.
5727 (Sized_incremental_binary::do_init_layout): New function.
5728 (Sized_incremental_binary::do_reserve_layout): New function.
5729 (Sized_input_reader::Inputs_reader): Remove.
5730 (Sized_input_reader::Input_entry_reader): Remove.
5731 (Sized_input_reader::do_arg_serial): New function.
5732 (Sized_input_reader::do_get_unused_symbol_count): New function.
5733 (Sized_input_reader::do_get_unused_symbol): New function.
5734 (Sized_incremental_binary::do_input_file_count): New function.
5735 (Sized_incremental_binary::do_get_input_reader): Change signature;
5736 use index instead of filename.
5737 (Sized_incremental_binary::section_map_): New data member.
5738 (Sized_incremental_binary::input_entry_readers_): New data member.
5739 (class Sized_incr_relobj): New class.
5740 (class Sized_incr_dynobj): New class.
5741 (make_sized_incremental_object): New function.
5742 (class Incremental_library): New class.
5743 * layout.cc (Free_list::num_lists): New static data member.
5744 (Free_list::num_nodes): New static data member.
5745 (Free_list::num_removes): New static data member.
5746 (Free_list::num_remove_visits): New static data member.
5747 (Free_list::num_allocates): New static data member.
5748 (Free_list::num_allocate_visits): New static data member.
5749 (Free_list::init): New function.
5750 (Free_list::remove): New function.
5751 (Free_list::allocate): New function.
5752 (Free_list::dump): New function.
5753 (Free_list::print_stats): New function.
5754 (Layout_task_runner::run): Resize output file for incremental updates.
5755 (Layout::Layout): Initialize new data members.
5756 (Layout::set_incremental_base): New function.
5757 (Layout::init_fixed_output_section): New function.
5758 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5759 incremental updates.
5760 (Layout::create_gold_note): Do not create gold note section for
5761 incremental updates.
5762 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5763 for incremental updates.
5764 (Layout::set_section_offsets): For incremental updates, allocate space
5766 (Layout::create_symtab_sections): Layout with offsets relative to
5767 start of section; for incremental updates, allocate space from free
5769 (Layout::create_shdrs): For incremental updates, allocate space from
5771 (Layout::finish_dynamic_section): For incremental updates, do not
5772 check --as-needed (fixed in subsequent patch).
5773 * layout.h (class Free_list): New class.
5774 (Layout::set_incremental_base): New function.
5775 (Layout::incremental_base): New function.
5776 (Layout::init_fixed_output_section): New function.
5777 (Layout::allocate): New function.
5778 (Layout::incremental_base_): New data member.
5779 (Layout::free_list_): New data member.
5780 * main.cc (main): Print Free_list statistics.
5781 * object.cc (Relobj::finalize_incremental_relocs): Add
5782 clear_counts parameter; clear counts only when clear_counts is set.
5783 (Sized_relobj::Sized_relobj): Initialize new base class.
5784 (Sized_relobj::do_layout): Don't report special sections.
5785 (Sized_relobj::do_for_all_local_got_entries): New function.
5786 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5787 symtab_off to all symbol table offsets.
5788 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5789 * object.h (class Got_offset_list): Move to top of file.
5790 (Object::Object): Allow case where input_file == NULL.
5791 (Object::~Object): Likewise.
5792 (Object::input_file): Assert that input_file != NULL.
5793 (Object::lock): Allow case where input_file == NULL.
5794 (Object::unlock): Likewise.
5795 (Object::is_locked): Likewise.
5796 (Object::token): Likewise.
5797 (Object::release): Likewise.
5798 (Object::is_incremental): New function.
5799 (Object::get_mtime): New function.
5800 (Object::for_all_local_got_entries): New function.
5801 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5802 (Object::set_is_in_system_directory): New function.
5803 (Object::is_in_system_directory): New function.
5804 (Object::do_is_incremental): New function.
5805 (Object::do_get_mtime): New function.
5806 (Object::do_for_all_local_got_entries): New function.
5807 (Object::is_in_system_directory_): New data member.
5808 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5809 (class Sized_relobj_base): New class.
5810 (class Sized_relobj): Derive from Sized_relobj_base.
5811 (class Sized_relobj::Symbols): Redeclare from base class.
5812 (class Sized_relobj::local_got_offset_list): Remove.
5813 (class Sized_relobj::Output_sections): Redeclare from base class.
5814 (class Sized_relobj::do_for_all_local_got_entries): New function.
5815 (class Sized_relobj::write_local_symbols): Add offset parameter.
5816 (class Sized_relobj::local_symbol_offset_): Update comment.
5817 (class Sized_relobj::local_dynsym_offset_): Update comment.
5818 * options.cc (Input_arguments::add_file): Remove const.
5819 * options.h (Input_file_argument::Input_file_argument):
5820 Initialize arg_serial_ (all constructors).
5821 (Input_file_argument::set_arg_serial): New function.
5822 (Input_file_argument::arg_serial): New function.
5823 (Input_file_argument::arg_serial_): New data member.
5824 (Input_arguments::Input_arguments): Initialize file_count_.
5825 (Input_arguments::add_file): Remove const.
5826 (Input_arguments::number_of_input_files): New function.
5827 (Input_arguments::file_count_): New data member.
5828 (Command_line::number_of_input_files): Call
5829 Input_arguments::number_of_input_files.
5830 * output.cc (Output_segment_headers::Output_segment_headers):
5832 (Output_section::Input_section::current_data_size): New function.
5833 (Output_section::Output_section): Initialize new data members.
5834 (Output_section::add_input_section): Don't do merge sections for
5835 an incremental link; allocate space from free list for an
5837 (Output_section::add_output_section_data): Allocate space from
5838 free list for an incremental update.
5839 (Output_section::update_data_size): New function.
5840 (Output_section::set_fixed_layout): New function.
5841 (Output_section::reserve): New function.
5842 (Output_segment::set_section_addresses): Remove const.
5843 (Output_segment::set_section_list_addresses): Remove const; allocate
5844 space from free list for an incremental update.
5845 (Output_segment::set_offset): Adjust size of RELRO segment for an
5847 * output.h (Output_data::current_data_size): Move here from
5849 (Output_data::pre_finalize_data_size): New function.
5850 (Output_data::update_data_size): New function.
5851 (Output_section_headers::update_data_size): new function.
5852 (Output_section_data_build::current_data_size): Move to Output_data.
5853 (Output_data_strtab::update_data_size): New function.
5854 (Output_section::current_data_size): Move to Output_data.
5855 (Output_section::set_fixed_layout): New function.
5856 (Output_section::has_fixed_layout): New function.
5857 (Output_section::reserve): New function.
5858 (Output_section::update_data_size): New function.
5859 (Output_section::has_fixed_layout_): New data member.
5860 (Output_section::free_list_): New data member.
5861 (Output_segment::set_section_addresses): Remove const.
5862 (Output_segment::set_section_list_addresses): Remove const.
5863 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5865 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5867 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5868 parameter when calling Add_symbols constructor; store argument
5869 serial number for members of a lib group.
5870 (Add_symbols::locks): Allow case where token == NULL.
5871 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5872 (Read_member::~Read_member): New function.
5873 (Read_member::is_runnable): New function.
5874 (Read_member::locks): New function.
5875 (Read_member::run): New function.
5876 (Check_script::~Check_script): New function.
5877 (Check_script::is_runnable): New function.
5878 (Check_script::locks): New function.
5879 (Check_script::run): New function.
5880 (Check_library::~Check_library): New function.
5881 (Check_library::is_runnable): New function.
5882 (Check_library::locks): New function.
5883 (Check_library::run): New function.
5884 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5885 (Add_symbols::library_): New data member.
5886 (class Read_member): New class.
5887 (class Check_script): New class.
5888 (class Check_library): New class.
5889 * reloc.cc (Read_relocs::is_runnable): Allow case where
5891 (Read_relocs::locks): Likewise.
5892 (Scan_relocs::locks): Likewise.
5893 (Relocate_task::locks): Likewise.
5894 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5896 (Sized_relobj::incremental_relocs_scan): Fix comment.
5897 (Sized_relobj::do_relocate): Pass output file offset to
5898 write_local_symbols.
5899 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5900 from class declaration.
5901 * script.cc (read_input_script): Allocate Script_info; pass
5902 argument serial number to report_script.
5903 * script.h (class Script_info): Move to incremental.h.
5904 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5905 * symtab.h (Symbol_table::add_from_incrobj): New function.
5906 (Symbol_table::set_file_offset): New function.
5908 2011-04-05 Cary Coutant <ccoutant@google.com>
5910 * incremental-dump.cc (dump_incremental_inputs): Change signature
5911 to take a Sized_incremental_binary; change caller. Use readers
5912 in Sized_incremental_binary.
5914 (Sized_incremental_binary::find_incremental_inputs_sections):
5915 Rename do_find_incremental_inputs_sections to this.
5916 (Sized_incremental_binary::setup_readers): New function.
5917 (Sized_incremental_binary::do_check_inputs): Check
5918 has_incremental_info_ flag; move setup code to setup_readers;
5920 (Sized_incremental_binary::do_file_is_unchanged): New function.
5921 (Sized_incremental_binary::do_get_input_reader): New function.
5922 * incremental.h (class Incremental_binary): Move to end of file.
5923 (Incremental_binary::file_is_unchanged): New function.
5924 (Incremental_binary::do_file_is_unchanged): New function.
5925 (Incremental_binary::Input_reader): New class.
5926 (Incremental_binary::get_input_reader): New function.
5927 (class Sized_incremental_binary): Move to end of file.
5928 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5929 input section reader classes.
5930 (Sized_incremental_binary::has_incremental_info): New function.
5931 (Sized_incremental_binary::inputs_reader): New function.
5932 (Sized_incremental_binary::symtab_reader): New function.
5933 (Sized_incremental_binary::relocs_reader): New function.
5934 (Sized_incremental_binary::got_plt_reader): New function.
5935 (Sized_incremental_binary::do_file_is_unchanged): New function.
5936 (Sized_incremental_binary::Sized_input_reader): New class.
5937 (Sized_incremental_binary::get_input_reader): New function.
5938 (Sized_incremental_binary::find_incremental_inputs_sections):
5939 Rename do_find_incremental_inputs_sections to this.
5940 (Sized_incremental_binary::setup_readers): New function.
5941 (Sized_incremental_binary::has_incremental_info_): New data member.
5942 (Sized_incremental_binary::inputs_reader_): New data member.
5943 (Sized_incremental_binary::symtab_reader_): New data member.
5944 (Sized_incremental_binary::relocs_reader_): New data member.
5945 (Sized_incremental_binary::got_plt_reader_): New data member.
5946 (Sized_incremental_binary::current_input_file_): New data member.
5948 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5951 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5954 2011-03-30 Cary Coutant <ccoutant@google.com>
5956 * archive.cc (Archive::include_member): Adjust call to report_object.
5957 (Add_archive_symbols::run): Add script_info to call to
5958 report_archive_begin.
5959 (Lib_group::include_member): Adjust call to report_object.
5960 (Add_lib_group_symbols::run): Adjust call to report_object.
5961 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5962 blocks. Add object count for script input files.
5963 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5964 script_info parameter; change all callers.
5965 (Incremental_inputs::report_object): Add script_info parameter;
5967 (Incremental_inputs::report_script): Store backpointer to
5968 incremental info entry.
5969 (Output_section_incremental_inputs::set_final_data_size): Record
5970 additional information for scripts.
5971 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5972 * incremental.h (Incremental_script_entry::add_object): New function.
5973 (Incremental_script_entry::get_object_count): New function.
5974 (Incremental_script_entry::get_object): New function.
5975 (Incremental_script_entry::objects_): New data member; adjust
5977 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5978 (Incremental_inputs::report_object): Add script_info parameter.
5979 (Incremental_inputs_reader::get_object_count): New function.
5980 (Incremental_inputs_reader::get_object_offset): New function.
5981 * options.cc (Input_arguments::add_file): Return reference to
5983 * options.h (Input_argument::set_script_info): New function.
5984 (Input_argument::script_info): New function.
5985 (Input_argument::script_info_): New data member; adjust all
5987 (Input_file_group::add_file): Return reference to new input argument.
5988 (Input_file_lib::add_file): Likewise.
5989 (Input_arguments::add_file): Likewise.
5990 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5991 * script.cc (Parser_closure::Parser_closure): Add script_info
5992 parameter; adjust all callers.
5993 (Parser_closure::script_info): New function.
5994 (Parser_closure::script_info_): New data member.
5995 (read_input_script): Report scripts earlier to incremental info.
5996 (script_add_file): Set script_info in Input_argument.
5997 (script_add_library): Likewise.
5998 * script.h (Script_options::Script_info): Rewrite class.
6000 2011-03-29 Cary Coutant <ccoutant@google.com>
6002 * archive.cc (Library_base::should_include_member): Move
6003 method here from class Archive.
6004 (Archive::Archive): Initialize base class.
6005 (Archive::should_include_member): Move to base class.
6006 (Archive::do_for_all_unused_symbols): New function.
6007 (Add_archive_symbols::run): Remove redundant access to
6009 (Lib_group::Lib_group): Initialize base class.
6010 (Lib_group::do_filename): New function.
6011 (Lib_group::include_member): Pass pointer to Lib_group to
6013 (Lib_group::do_for_all_unused_symbols): New function.
6014 (Add_lib_group_symbols::run): Report archive information for
6016 * archive.h (class Library_base): New base class.
6017 (class Archive): Derive from Library_base.
6018 (Archive::filename): Move to base class.
6019 (Archive::set_incremental_info): Likewise.
6020 (Archive::incremental_info): Likewise.
6021 (Archive::Should_include): Likewise.
6022 (Archive::should_include_member): Likewise.
6023 (Archive::Armap_entry): Remove.
6024 (Archive::Unused_symbol_iterator): Remove.
6025 (Archive::unused_symbols_begin): Remove.
6026 (Archive::unused_symbols_end): Remove.
6027 (Archive::do_filename): New function.
6028 (Archive::do_get_mtime): New function.
6029 (Archive::do_for_all_unused_symbols): New function.
6030 (Archive::task_): Move to base class.
6031 (Archive::incremental_info_): Likewise.
6032 (class Lib_group): Derive from Library_base.
6033 (Lib_group::do_filename): New function.
6034 (Lib_group::do_get_mtime): New function.
6035 (Lib_group::do_for_all_unused_symbols): New function.
6036 (Lib_group::task_): Move to base class.
6037 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6039 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6041 * incremental.cc (Incremental_inputs::report_archive_begin):
6042 Use Library_base; call library's get_mtime; add incremental inputs
6043 entry before members.
6044 (class Unused_symbol_visitor): New class.
6045 (Incremental_inputs::report_archive_end): Use Library_base; use
6046 visitor class to record unused symbols; don't add incremental inputs
6047 entry after members.
6048 (Incremental_inputs::report_object): Use Library_base.
6050 (Incremental_archive_entry::Incremental_archive_entry): Remove
6051 unused Archive parameter.
6052 (Incremental_inputs::report_archive_begin): Use Library_base.
6053 (Incremental_inputs::report_archive_end): Likewise.
6054 (Incremental_inputs::report_object): Likewise.
6055 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6057 * object.h (Object::for_all_global_symbols): New function.
6058 (Object::do_for_all_global_symbols): New function.
6059 (Sized_relobj::do_for_all_global_symbols): New function.
6060 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6062 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6065 2011-03-27 Ian Lance Taylor <iant@google.com>
6067 * archive.cc (Archive::interpret_header): Return -1 if something
6068 goes wrong. Change callers accordingly.
6070 2011-03-25 Cary Coutant <ccoutant@google.com>
6072 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6073 * testsuite/Makefile.in: Regenerate.
6075 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
6077 * plugin.cc (get_view): New.
6078 (Plugin::load): Pass get_view to the plugin.
6079 (Plugin_manager::get_view): New.
6081 2011-03-21 Ian Lance Taylor <iant@google.com>
6083 * testsuite/final_layout.sh: Rewrite to not use dc.
6084 * testsuite/relro_test.sh: Fail if dc is not present.
6086 2011-03-21 Sriraman Tallam <tmsriram@google.com>
6088 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6090 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6091 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6093 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6094 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6096 2011-03-14 Ian Lance Taylor <iant@google.com>
6098 * script-sections.cc (Sort_output_sections::script_compare):
6099 Rename from is_before, change return type.
6100 (Sort_output_sections::operator()): Adjust accordingly.
6102 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6105 * testsuite/odr_violation2.cc: Add comment to make all error line
6106 numbers double digits.
6107 * testsuite/debug_msg.sh: Adjust expected errors.
6109 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6111 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6112 but mark earlier ones as non-canonical
6113 (offset_to_iterator): Update search target and example
6114 (do_addr2line): Return extra lines in a vector*
6115 (format_file_lineno): Extract from do_addr2line
6116 (one_addr2line): Add vector* out-param
6117 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6118 when a lineno entry appeared last for its instruction
6119 (Dwarf_line_info): Add vector* out-param
6120 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6121 * symtab.cc (Odr_violation_compare): Include the lineno in the
6123 (linenos_from_loc): New. Combine the canonical line for an
6124 address with its other lines.
6125 (True_if_intersect): New. Helper functor to make
6126 std::set_intersection a query.
6127 (detect_odr_violations): Compare sets of lines instead of just
6128 one line for each function. This became less deterministic, but
6129 has fewer false positives.
6130 * symtab.h: Declarations.
6131 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6132 mix an optimized and non-optimized object in the same binary
6133 (odr_violation2.so): Same.
6134 * testsuite/Makefile.in: Regenerate from Makefile.am.
6135 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6136 * testsuite/debug_msg.sh: Update line numbers and add
6138 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6139 non-optimized context.
6140 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6141 isn't inlined, and use OdrDerived in an optimized context.
6142 * testsuite/odr_header1.h: Defines OdrDerived, where
6143 optimization will change the
6144 first-instruction-in-the-destructor's file and line number.
6145 * testsuite/odr_header2.h: Defines OdrBase.
6147 2011-03-09 Ian Lance Taylor <iant@google.com>
6149 * fileread.cc (File_read::clear_views): Don't delete the whole
6152 2011-03-08 Ian Lance Taylor <iant@google.com>
6155 * fileread.cc: #include <climits>.
6156 (GOLD_IOV_MAX): Define.
6157 (File_read::read_multiple): Limit number of entries by iov_max.
6158 * fileread.h (class File_read): Always set max_readv_entries to
6161 2011-03-07 Ian Lance Taylor <iant@google.com>
6164 * options.h (class General_options): Add -dy and -dn.
6166 2011-03-02 Cary Coutant <ccoutant@google.com>
6168 * testsuite/script_test_9.t: Add TLS segment.
6170 2011-03-02 Simon Baldwin <simonb@google.com>
6172 * configure.ac: Add check for gnu_indirect_function support in
6173 the toolchain building binutils.
6174 * configure: Rebuild.
6176 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
6178 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6179 plugin only symbols.
6180 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6181 in plugin files as not needed in the symbol table.
6183 2011-02-11 Sriraman Tallam <tmsriram@google.com>
6185 * output.cc (Output_section::add_input_section): Delay fill
6186 generation for section ordering.
6188 2011-02-09 Ian Lance Taylor <iant@google.com>
6191 * object.h (class Sized_relobj): Remove clear_local_symbols.
6192 * reloc.cc (Sized_relobj::do_relocate): Don't call
6193 clear_local_symbols.
6195 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
6197 * plugin.cc (is_visible_from_outside): Return true for symbols
6200 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6202 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6205 2011-02-02 Sriraman Tallam <tmsriram@google.com>
6207 * icf.h (is_section_foldable_candidate): Change type of parameter
6209 * icf.cc (Icf::find_identical_sections): Change type of local variable
6210 section_name to be std::string.
6211 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6213 2011-01-25 Ian Lance Taylor <iant@google.com>
6215 * script.cc (script_add_extern): Rewrite to use
6216 add_symbol_reference.
6218 2011-01-25 Doug Kwan <dougkwan@google.com>
6220 * icf.cc (get_section_contents): Always lock section's object.
6222 2011-01-24 Ian Lance Taylor <iant@google.com>
6224 * options.h (class General_options): Accept
6225 --no-detect-odr-violations.
6227 2011-01-24 Ian Lance Taylor <iant@google.com>
6229 * version.cc (version_string): Bump to 1.11.
6231 2011-01-24 Ian Lance Taylor <iant@google.com>
6233 * plugin.cc (class Plugin_rescan): Define new class.
6234 (Plugin_manager::claim_file): Set any_claimed_.
6235 (Plugin_manager::save_archive): New function.
6236 (Plugin_manager::save_input_group): New function.
6237 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6239 (Plugin_manager::new_undefined_symbol): New function.
6240 (Plugin_manager::rescan): New function.
6241 (Plugin_manager::rescannable_defines): New function.
6242 (Plugin_manager::add_input_file): Set any_added_.
6243 * plugin.h (class Plugin_manager): define new fields rescannable_,
6244 undefined_symbols_, any_claimed_, and any_added_. Declare
6245 Plugin_rescan as friend. Declare new functions.
6246 (Plugin_manager::Rescannable): Define type.
6247 (Plugin_manager::Rescannable_list): Define type.
6248 (Plugin_manager::Undefined_symbol_list): Define type.
6249 (Plugin_manager::Plugin_manager): Initialize new fields.
6250 * archive.cc (Archive::defines_symbol): New function.
6251 (Add_archive_symbols::run): Pass archive to plugins if any.
6252 * archive.h (class Archive): Declare defines_symbol.
6253 * readsyms.cc (Input_group::~Input_group): New function.
6254 (Finish_group::run): Pass input_group to plugins if any.
6255 * readsyms.h (class Input_group): Declare destructor.
6256 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6259 2011-01-10 Ian Lance Taylor <iant@google.com>
6261 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6263 (Layout::set_segment_offsets): Reset increase_relro before calling
6264 set_section_addresses a second time.
6266 2011-01-04 Cary Coutant <ccoutant@google.com>
6268 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6269 sections before NOBITS sections.
6271 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6273 * version.cc (print_version): Update copyright to 2011.
6275 2010-12-23 Cary Coutant <ccoutant@google.com>
6277 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6278 of OS to this->add. Add OD parameter to second form of the function.
6280 2010-12-20 Ian Lance Taylor <iant@google.com>
6282 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6283 second of two consecutive entries with same offset.
6285 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6287 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6288 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6289 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6290 to avoid unneeded links against $(LDADD).
6291 * testsuite/Makefile.in: Regenerate.
6293 2010-12-15 Ian Lance Taylor <iant@google.com>
6296 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6297 for R_X86_64_32 and R_X86_64_PC32.
6298 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6299 ver_matching_def_pic.o.
6300 (ver_matching_def_pic.o): New target.
6302 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6304 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6305 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6306 Move definition before File_read::View member definitions.
6307 (File_read::View::~View): Initialize and hold lock before
6308 updating current_mapped_bytes.
6310 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6312 * dwarf_reader.cc: Remove outdated comment.
6313 * gold-threads.cc: Fix typo in error message.
6314 * archive.cc: Fix typos in comments.
6315 * archive.h: Likewise.
6316 * arm-reloc-property.cc: Likewise.
6317 * arm-reloc-property.h: Likewise.
6318 * arm-reloc.def: Likewise.
6320 * attributes.h: Likewise.
6321 * cref.cc: Likewise.
6322 * ehframe.cc: Likewise.
6323 * fileread.h: Likewise.
6325 * i386.cc: Likewise.
6327 * incremental.h: Likewise.
6328 * int_encoding.cc: Likewise.
6329 * layout.h: Likewise.
6330 * main.cc: Likewise.
6331 * merge.h: Likewise.
6332 * object.cc: Likewise.
6333 * object.h: Likewise.
6334 * options.cc: Likewise.
6335 * readsyms.cc: Likewise.
6336 * reduced_debug_output.cc: Likewise.
6337 * reloc.cc: Likewise.
6338 * script-sections.cc: Likewise.
6339 * sparc.cc: Likewise.
6340 * symtab.h: Likewise.
6341 * target-reloc.h: Likewise.
6342 * target.cc: Likewise.
6343 * target.h: Likewise.
6344 * timer.cc: Likewise.
6345 * timer.h: Likewise.
6346 * x86_64.cc: Likewise.
6348 2010-12-09 Cary Coutant <ccoutant@google.com>
6350 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6352 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6353 parameter; change all callers.
6354 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6355 * options.h (warn_execstack): New option.
6357 2010-12-07 Doug Kwan <dougkwan@google.com>
6359 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6360 like function call relocations.
6362 2010-12-07 Ian Lance Taylor <iant@google.com>
6364 * archive.cc (Archive::get_elf_object_for_member): Permit
6365 punconfigured to be NULL.
6366 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6367 (Archive::include_member): Pass NULL to get_elf_object_for_member
6368 if we searched for the archive and this is the first included
6371 2010-12-01 Ian Lance Taylor <iant@google.com>
6373 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6374 track_relocs_type_ field.
6375 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6376 Set track_relocs_type_.
6377 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6378 contents when using RELA relocs.
6379 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6381 * reloc.cc (Track_relocs::next_addend): New function.
6382 * reloc.h (class Track_relocs): Declare next_addend.
6384 2010-12-01 Ian Lance Taylor <iant@google.com>
6386 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6389 2010-12-01 Ian Lance Taylor <iant@google.com>
6391 * README: Update compilers known to work and fail.
6393 2010-11-23 Matthias Klose <doko@ubuntu.com>
6395 * configure.in: For --enable-gold, handle value `default' instead of
6396 `both*'. Always install ld as ld.bfd, install as ld if gold is
6398 * configure: Regenerate.
6400 2010-11-18 Doug Kwan <dougkwan@google.com>
6402 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6403 and right_alignment to be zero. Store result alignment only if it is
6404 greater than existing alignment.
6406 2010-11-16 Cary Coutant <ccoutant@google.com>
6409 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6410 Check for ".zdebug_line".
6412 2010-11-16 Doug Kwan <dougkwan@google.com>
6413 Cary Coutant <ccoutant@google.com>
6415 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6416 by reference; adjust all callers.
6417 * output.cc (Output_segment::set_section_addresses): Adjust references
6418 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6420 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6421 end at page boundary.
6423 2010-11-16 Cary Coutant <ccoutant@google.com>
6426 * layout.cc (Layout::choose_output_section): Transform names of
6427 compressed sections even when using a script with a SECTIONS clause.
6428 (Layout::output_section_name): Remove code to transform
6429 compressed debug section names.
6430 * output.cc (Output_section::add_input_section): Use uncompressed
6431 section size when tracking input sections.
6433 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6435 * symtab.h (Symbol::NON_PIC_REF): Remove.
6436 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6437 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6438 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6439 (Symbol::use_plt_offset): Take a flags argument and pass it
6440 directly to needs_dynamic_reloc. Restrict check for undefined
6441 weak symbols to function calls.
6442 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6443 (Target_arm::Scan::global): Use it.
6444 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6445 (Target_arm::Relocate::relocate): Likewise.
6446 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6447 parameter with an r_type parameter. Use get_reference_flags
6449 (Target_arm::Relocate::relocate): Update accordingly.
6450 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6451 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6452 (Target_i386::Scan::global): Likewise.
6453 (Target_i386::Relocate::relocate): Likewise.
6454 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6455 parameter with an r_type parameter. Use get_reference_flags
6457 (Target_i386::Relocate::relocate): Update accordingly.
6458 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6459 (Target_powerpc::Scan::global): Use it.
6460 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6461 (Target_powerpc::Relocate::relocate): Likewise.
6462 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6463 (Target_sparc::Scan::global): Use it.
6464 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6465 (Target_sparc::Relocate::relocate): Likewise.
6466 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6467 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6468 (Target_x86_64::Scan::global): Likewise.
6469 (Target_x86_64::Relocate::relocate): Likewise.
6471 2010-11-08 Doug Kwan <dougkwan@google.com>
6472 Cary Coutant <ccoutant@google.com>
6474 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6475 (Arm_exidx_merge_section::section_contents_): New data member.
6476 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6477 (Arm_input_section::~Arm_input_section): De-allocate memory.
6478 (Arm_input_section::original_contents_): New data member.
6479 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6480 in parameters instead of calling Object::section_contents without
6482 (Arm_output_section::group_section): New parameter TASK. Pass it
6483 to callees that need locking objects.
6484 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6485 to lock EXIDX input sections. Fix a formatting issue. Call
6486 Arm_exidx_merged_section::build_contents to create merged section
6488 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6489 to lock object of stub table owner.
6490 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6491 TEXT_SIZE to initialize data member TEXT_SIZE_.
6492 (Arm_exidx_input_section::addralign): Fix typo in comment.
6493 (Arm_exidx_input_section::text_size): New method.
6494 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6495 that require locking objects. Lock objects before scanning for stubs
6496 and updating local symbols.
6497 (Arm_input_section<big_endian>::init): Copy contents of original
6499 (Arm_input_section<big_endian>::do_write): Use saved contents of
6500 original input section instead of calling Object::section_contents
6502 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6503 size without calling Object::section_size().
6504 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6505 for size. Allocate a buffer for merged EXIDX entries.
6506 (Arm_exidx_merged_section::build_contents): New method.
6507 (Arm_exidx_merged_section::do_write): Move merge section contents
6508 building code to Arm_exidx_merged_section::build_contetns. Write
6509 out contetns in buffer instead of building it on the fly.
6510 (Arm_relobj::make_exidx_input_section): Also pass text section size
6511 to Arm_exidx_input_section constructor.
6512 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6513 (Arm_dynobj::do_read_symbols): Fix memory leak.
6514 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6515 * target.h: (class Task): Add forward declaration.
6516 (Target::relax): Add new parameter TASK and pass it to
6518 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6520 2010-11-05 Cary Coutant <ccoutant@google.com>
6523 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6524 object when reading from the file.
6525 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6527 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6528 when reading section contents.
6529 (get_section_contents): Likewise.
6530 (icf::find_identical_sections): Likewise.
6531 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6532 object when reading from the file.
6533 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6534 the object when doing deferred section layout.
6536 2010-11-03 Nick Clifton <nickc@redhat.com>
6539 * script.h (class Symbol_assignment: name): New member. Returns
6540 the name of the symbol.
6541 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6542 Returns true if the given symbol name is on the list of
6543 assignments wating to be processed.
6544 * archive.cc (should_incldue_member): If the symbol is undefined,
6545 check to see if it is on the list of symbols pending assignment.
6547 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6549 * script-sections.cc (Script_sections::find_memory_region): Check
6550 for a NULL output section pointer.
6552 2010-10-29 Doug Kwan <dougkwan@google.com>
6554 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6555 Output_section::add_relaxed_input_section.
6556 * output.cc (Output_section::add_relaxed_input_section): Add new
6557 arguments LAYOUT and NAME. Set section order index.
6558 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6559 Copy section order index.
6560 * output.h (Output_section::add_relaxed_input_section): Add new
6561 arguments LAYOUT and NAME.
6563 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6565 * testsuite/Makefile.am: Move gcctestdir/ld rule to
6566 NATIVE_OR_CROSS_LINKER.
6567 * testsuite/Makefile.in: Regenerate.
6569 2010-10-20 Doug Kwan <dougkwan@google.com>
6571 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6572 without SHF_LINK_ORDER flags.
6573 * layout.cc (Layout::choose_output_section): Do not filter
6574 SHF_LINK_ORDER flag in a relocatable link.
6576 2010-10-17 Cary Coutant <ccoutant@google.com>
6578 * output.h (Output_segment::set_section_addresses): Change function
6579 signature. Update all callers.
6580 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6582 (Output_segment::set_section_addresses): Align after last TLS
6583 section. Add padding before last relro section instead of after.
6585 2010-10-17 Doug Kwan <dougkwan@google.com>
6587 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6588 GOT output section to be writable.
6590 2010-10-14 Cary Coutant <ccoutant@google.com>
6592 * debug.h (DEBUG_INCREMENTAL): New flag.
6593 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6594 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6596 * incremental.cc (report_command_line): Ignore all forms of
6598 * layout.cc (Layout::Layout): Check parameters for incremental link
6600 * options.cc (General_options::parse_incremental): New function.
6601 (General_options::parse_no_incremental): New function.
6602 (General_options::parse_incremental_full): New function.
6603 (General_options::parse_incremental_update): New function.
6604 (General_options::incremental_mode_): New data member.
6605 (General_options::finalize): Check incremental_mode_.
6606 * options.h (General_options): Update help text for --incremental.
6607 Add --no-incremental, --incremental-full, --incremental-update.
6608 (General_options::Incremental_mode): New enum type.
6609 (General_options::incremental_mode): New function.
6610 (General_options::incremental_mode_): New data member.
6611 * parameters.cc (Parameters::incremental_mode_): New data member.
6612 (Parameters::set_options): Set incremental_mode_.
6613 (Parameters::set_incremental_full): New function.
6614 (Parameters::incremental): New function.
6615 (Parameters::incremental_update): New function.
6616 (set_parameters_incremental_full): New function.
6617 * parameters.h (Parameters::set_incremental_full): New function.
6618 (Parameters::incremental): New function.
6619 (Parameters::incremental_update): New function.
6620 (Parameters::incremental_mode_): New data member.
6621 (set_parameters_incremental_full): New function.
6622 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6623 incremental link mode.
6624 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6625 (Sized_relobj::do_relocate_sections): Likewise.
6626 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6628 * testsuite/Makefile.in: Regenerate.
6629 * testsuite/incremental_test.sh: Filter all forms of --incremental.
6631 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6633 * script-sections.h (class Script_sections): Make
6634 Sections_elements typedef public.
6635 * script-sections.cc (class Sort_output_sections): Add elements_
6636 field. Add constructor which sets it; change all callers.
6637 (Sort_output_sections::is_before): New function.
6638 (Sort_output_sections::operator()): Call is_before.
6639 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6641 * testsuite/script_test_10.sh: New test. Test script section
6643 * testsuite/script_test_10.t: Likewise.
6644 * testsuite/script_test_10.s: Likewise.
6645 * testsuite/Makefile.am: Wrap the cross linker tests and the
6646 common tests into NATIVE_OR_CROSS_LINKER.
6647 (check_SCRIPTS): Add script_test_10.sh.
6648 (check_DATA): Add script_test_10.stdout.
6649 (script_test_10.o, script_test_10): New targets.
6650 (script_test_10.stdout): New target.
6651 * configure, testsuite/Makefile.in: Regenerate.
6653 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6655 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6656 error for the deprecated relocations.
6657 (Target_arm::Scan::global): Likewise.
6658 (Target_arm::Relocate::relocate): Likewise.
6660 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6662 * fileread.cc (Input_file::find_file): Initialize *found_name
6663 and *namep when using the fallback search for case 4.
6665 2010-10-11 Cary Coutant <ccoutant@google.com>
6667 * options.h (class General_options): Redefine -z lazy as an alias for
6668 the negation of -z now.
6670 2010-10-11 Ian Lance Taylor <iant@google.com>
6672 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6675 2010-10-06 Nick Clifton <nickc@redhat.com>
6677 * script-sections.cc(class Memory_region): Remove
6678 current_lma_offset_ field. Rename current_vma_offset_ to
6679 current_offset_. Add last_section_ field.
6680 (Memory_region::get_current_vma_address): Rename to
6681 get_current_address.
6682 (Memory_region::get_current_lma_address): Delete.
6683 (Memory_region::increment_vma_offset): Rename to
6685 (Memory_region::increment_lma_offset): Delete.
6686 (Memory_region::attributes_compatible): New method. Returns
6687 true if the provided section is compatible with the region.
6688 (Memory_region::get_last_section): New method. Returns the last
6689 section to use the region.
6690 (Memory_region::set_last_section): New method. Stores the last
6691 section to use the region.
6692 (Script_sections::block_in_region): New method. Returns true if
6693 a block of memory is contained within a region.
6694 (Script_sections::find_memory_region): New method. Locates a
6695 memory region to be used to set a VMA or LMA address.
6696 (Output_section_definition::set_section_addresses): Add code to
6697 check for addresses set by memory regions.
6698 (Output_segment::set_section_addresses): Remove memory region
6700 (Script_sections::create_segment): Add a warning if a header
6701 segment is created outside of any region.
6702 * script-sections.h (class Script_sections): Add prototypes for
6703 find_memory_region and block_in_region methods.
6704 * testsuite/memory_test.s: Use .long instead of .word.
6705 * testsuite/memory_test.t: Add some more output sections.
6706 * testsuite/memory_test.sh: Update expected output.
6708 2010-10-02 Doug Kwan <dougkwan@google.com>
6710 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6711 defintion to symtab.h
6712 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6713 declaration to defintion.
6715 2010-10-01 Nick Clifton <nickc@redhat.com>
6717 * expression.cc (eval): Replace dummy argument with NULL.
6718 (eval_maybe_dot): Check for a NULL result section pointer.
6719 (Symbol_expression::value): Likewise.
6720 (Dot_expression::value): Likewise.
6721 (BINARY_EXPRESSION): Likewise.
6722 (Max_expression::value): Likewise.
6723 (Min_expression::value): Likewise.
6724 (Absolute_expression::value): Likewise.
6725 (Addr_expression::value_from_output_section): Likewise.
6726 (Loaddddr_expression::value_from_output_section): Likewise.
6727 (Segment_start_expression::value): Likewise.
6728 * script-sections.cc
6729 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6731 (Sections_elememt_dot_assignment::set_section_addresses):
6733 (Output_data_expression::do_write_to_buffer): Likewise.
6734 (Output_section_definition::finalize_symbols): Likewise.
6735 (Output_section_definition::set_section_addresses): Likewise.
6737 2010-09-30 Doug Kwan <dougkwan@google.com>
6739 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6741 2010-09-28 Sriraman Tallam <tmsriram@google.com>
6743 * target.h (Target::can_icf_inline_merge_sections): New virtual
6745 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6747 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6749 * icf.cc (get_section_contents): Inline merge sections only when
6752 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6754 * configure: Regenerate.
6756 2010-09-17 Ian Lance Taylor <iant@google.com>
6758 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
6759 * testsuite/Makefile.am (memory_test.o): New target.
6760 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6762 * testsuite/Makefile.in: Rebuild.
6764 2010-09-17 Doug Kwan <dougkwan@google.com>
6766 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6767 defintion if relocation uses GOT entries of the symbol.
6768 * testsuite/icf_safe_test.sh: Fix test.
6769 * testsuite/icf_safe_so_test.sh: Fix test.
6771 2010-09-16 Cary Coutant <ccoutant@google.com>
6773 * script_sections.cc (class Memory_region): Remove "NULL" from
6774 vector initializations.
6776 2010-09-15 Cary Coutant <ccoutant@google.com>
6778 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6779 Resolve forwarding symbols.
6781 2010-09-15 Doug Kwan <dougkwan@google.com>
6783 * gold/testsuite/script_test_3.t: Add ARM special sections.
6784 * gold/testsuite/script_test_4.t: Same.
6785 * gold/testsuite/script_test_5.t: Same.
6786 * gold/testsuite/script_test_6.t: Same.
6787 * gold/testsuite/script_test_7.t: Same.
6788 * gold/testsuite/script_test_7.t: Same.
6789 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6791 2010-09-14 Cary Coutant <ccoutant@google.com>
6793 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6794 (Target_x86_64::Relocate::relocate_tls): Replace check for
6795 saw_tls_block_reloc_ with test for executable section.
6797 2010-09-12 Cary Coutant <ccoutant@google.com>
6799 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6800 position-independent executables to shared libraries need dynamic
6802 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6803 position-independent executables.
6804 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6805 * testsuite/Makefile.in: Regenerate.
6807 2010-09-10 Nick Clifton <nickc@redhat.com>
6810 * testsuite/memory_test.t: Discard any sections that are not
6813 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6816 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6817 "This::" to work around a bug in gcc 4.2.
6819 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6821 2010-09-09 Rafael Espindola <espindola@google.com>
6823 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6824 sections with different PF_X flags in the same segment.
6825 (Layout::find_first_load_seg): Search all segments to find the first
6827 * options.h (rosegment): New.
6829 2010-09-08 Rafael Espindola <espindola@google.com>
6831 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
6833 2010-09-08 Doug Kwan <dougkwan@google.com>
6835 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6836 (Arm_relobj::do_relocate_sections): Add new parameter for output
6837 file to match the parent.
6838 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6839 of local symbols instead of input values. Update code to track
6840 changes in gold::relocate_section.
6841 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6842 (Sized_relobj::compute_final_local_value_internal): New methods.
6843 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6844 body into private version of Sized_relobj::compute_final_local_value.
6845 Call the inline method.
6846 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6847 merged symbol value if there is one.
6848 (Symbol_value::has_output_value): New method defintiion.
6849 (Sized_relobj::Compute_final_local_value_status): New enum type.
6850 (Sized_relobj::compute_final_local_value): New methods.
6851 (Sized_relobj::compute_final_local_value_internal): New methods.
6852 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6853 and arm_cortex_a8.sh.
6854 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6855 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6857 * Makefile.in: Regenerate.
6858 * testsuite/arm_bl_out_of_range.s: Update test.
6859 * testsuite/thumb_bl_out_of_range.s: Ditto.
6860 * testsuite/thumb_blx_out_of_range.s: Ditto.
6861 * testsuite/arm_branch_out_of_range.sh: New file.
6862 * testsuite/arm_cortex_a8.sh: Ditto.
6863 * testsuite/arm_cortex_a8_b.s: Ditto.
6864 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6865 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6866 * testsuite/arm_cortex_a8_bl.s: Ditto.
6867 * testsuite/arm_cortex_a8_blx.s: Ditto.
6868 * testsuite/arm_cortex_a8_local.s: Ditto.
6869 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6870 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6872 2010-09-08 Rafael Espindola <espindola@google.com>
6874 * Makefile.am (memory_test.stdout): Run readelf with -W.
6875 * Makefile.in: Regenerate.
6876 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6879 2010-09-08 Rafael Espindola <espindola@google.com>
6881 * script-sections.cc (Script_sections::add_memory_region): Convert
6882 field precision to int.
6883 * script.cc (script_set_section_region, script_set_section_region):
6884 Convert field precision to int.
6886 2010-09-08 Rafael Espindola <espindola@google.com>
6888 * arm.cc (do_finalize_sections): Create the __exidx_start and
6889 __exdix_end symbols even when the section is missing.
6891 2010-09-08 Nick Clifton <nickc@redhat.com>
6893 * README: Remove claim that MEMORY is not supported.
6894 * expression.cc (script_exp_function_origin)
6895 (script_exp_function_length): Move from here to ...
6896 * script.cc: ... here.
6897 (script_set_section_region, script_add_memory)
6898 (script_parse_memory_attr, script_include_directive): New
6900 * script-sections.cc
6901 (class Memory_region): New class.
6902 (class Output_section_definition): Add set_memory_region,
6903 set_section_vma, set_section_lma and get_section_name methods.
6904 (class Script_Sections): Add add_memory_region,
6905 find_memory_region, find_memory_region_origin,
6906 find_memory_region_length and set_memory_region methods.
6907 Have set_section_addresses method walk the list of set memory
6909 Extend the print methos to display memory regions.
6910 * script-sections.h: Add prototypes for new methods.
6911 Add enum for MEMORY region attributes.
6912 * yyscript.y: Add support for parsing MEMORY regions.
6913 * script-c.h: Add prototypes for new functions.
6914 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6915 * testsuite/Makefile.in: Regenerate.
6916 * testsuite/memory_test.sh: New script.
6917 * testsuite/memory_test.s: New assembler source file.
6918 * testsuite/memory_test.t: New linker script.
6920 2010-08-27 Doug Kwan <dougkwan@google.com>
6922 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6923 reference override an existing dynamic weak reference.
6924 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6925 * testsuite/Makefile.in: Regenerate.
6926 * testsuite/dyn_weak_ref.sh: New file.
6927 * testsuite/dyn_weak_ref_1.c: Ditto.
6928 * testsuite/dyn_weak_ref_2.c: Ditto.
6930 2010-08-27 Ian Lance Taylor <iant@google.com>
6932 * incremental.h (class Incremental_input_entry): Add virtual
6935 2010-08-27 Ian Lance Taylor <iant@google.com>
6937 * testsuite/start_lib_test_3.c: Mark t3 as used.
6939 2010-08-27 Nick Clifton <nickc@redhat.com>
6941 * options.cc (version_script): Fix small typo in previous
6944 2010-08-25 Nick Clifton <nickc@redhat.com>
6946 * archive.cc: Formatting fixes: Remove whitespace between
6947 typename and following asterisk. Remove whitespace between
6948 function name and opening parenthesis.
6949 * archive.h: Likewise.
6951 * attributes.cc: Likewise.
6952 * attributes.h: Likewise.
6953 * common.cc: Likewise.
6954 * copy-relocs.cc: Likewise.
6955 * dirsearch.h: Likewise.
6956 * dynobj.cc: Likewise.
6957 * ehframe.cc: Likewise.
6958 * ehframe.h: Likewise.
6959 * expression.cc: Likewise.
6960 * fileread.cc: Likewise.
6961 * fileread.h: Likewise.
6963 * gold-threads.cc: Likewise.
6964 * gold.cc: Likewise.
6965 * i386.cc: Likewise.
6967 * incremental-dump.cc: Likewise.
6968 * incremental.cc: Likewise.
6969 * layout.cc: Likewise.
6970 * layout.h: Likewise.
6971 * main.cc: Likewise.
6972 * merge.cc: Likewise.
6973 * merge.h: Likewise.
6974 * object.cc: Likewise.
6975 * object.h: Likewise.
6976 * options.cc: Likewise.
6977 * options.h: Likewise.
6978 * output.cc: Likewise.
6979 * output.h: Likewise.
6980 * plugin.cc: Likewise.
6981 * plugin.h: Likewise.
6982 * powerpc.cc: Likewise.
6983 * reloc.cc: Likewise.
6984 * script-c.h: Likewise.
6985 * script-sections.cc: Likewise.
6986 * script.cc: Likewise.
6987 * stringpool.cc: Likewise.
6988 * symtab.cc: Likewise.
6989 * symtab.h: Likewise.
6990 * target.cc: Likewise.
6991 * timer.cc: Likewise.
6992 * timer.h: Likewise.
6993 * version.cc: Likewise.
6994 * x86_64.cc: Likewise.
6996 2010-08-24 Nick Clifton <nickc@redhat.com>
6999 * layout.cc (segment_precedes): Sort segments by their physical
7000 addresses, if they have been set.
7002 2010-08-23 Cary Coutant <ccoutant@google.com>
7004 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7006 (Lib_group::include_member): Unlock object after deleting its
7008 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7011 2010-08-19 Neil Vachharajani <nvachhar@google.com>
7012 Cary Coutant <ccoutant@google.com>
7014 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7015 constructor, and set_blocker.
7016 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7018 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7019 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7020 * testsuite/Makefile.am (start_lib_test): New test case.
7021 * testsuite/Makefile.in: Regenerate.
7022 * testsuite/start_lib_test_main.c: New file.
7023 * testsuite/start_lib_test_1.c: New file.
7024 * testsuite/start_lib_test_2.c: New file.
7025 * testsuite/start_lib_test_3.c: New file.
7027 2010-08-19 Ian Lance Taylor <iant@google.com>
7029 * Makefile.in: Rebuild with automake 1.11.1.
7030 * aclocal.m4: Likewise.
7031 * testsuite/Makefile.in: Likewise.
7033 2010-08-19 Ian Lance Taylor <iant@google.com>
7036 * i386.cc (class Output_data_plt_i386): Update declarations.
7037 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7038 local_ifuncs_ fields.
7039 (Target_i386::do_plt_section_for_global): New function.
7040 (Target_i386::do_plt_section_for_local): New function.
7041 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7042 parameter; change all callers. Initialize global_ifuncs_ and
7043 local_ifuncs_. If doing a static link define __rel_iplt_start and
7045 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7046 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7047 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7049 (Target_i386::make_plt_section): New function, broken out of
7050 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7051 (Target_i386::make_plt_entry): Call make_plt_section.
7052 (Target_i386::make_local_ifunc_plt_entry): New function.
7053 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7054 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7055 R_386_IRELATIVE to switch.
7056 (Target_i386::Scan::global): Likewise.
7057 (Target_i386::Relocate::relocate): Likewise.
7058 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7060 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7061 (Target_x86_64::do_plt_section_for_global): New function.
7062 (Target_x86_64::do_plt_section_for_local): New function.
7063 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7064 parameter; change all callers. If doing a static link define
7065 __rela_iplt_start and __rela_iplt_end.
7066 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7067 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7068 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7070 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7071 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7073 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7074 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7075 R_X86_64_IRELATIVE to switch.
7076 (Target_x86_64::Scan::global): Likewise.
7077 (Target_x86_64::Relocate::relocate): Likewise.
7078 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7080 * target.h (class Target): Add plt_section_for_global and
7081 plt_section_for_local functions. Add do_plt_section_for_global
7082 and do_plt_section_for_local virtual functions.
7083 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7084 clarifying comments.
7085 (Symbol::use_plt_offset): Handle IFUNC symbol.
7086 * object.cc (Sized_relobj::Sized_relobj): Initialize
7088 (Sized_relobj::local_has_plt_offset): New function.
7089 (Sized_relobj::local_plt_offset): New function.
7090 (Sized_relobj::set_local_plt_offset): New function.
7091 (Sized_relobj::do_count): Handle IFUNC symbol.
7092 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7093 a bit away from input_shndx_ field. Add set_is_func_symbol and
7094 is_ifunc_symbol functions.
7095 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7096 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7097 local_plt_offsets_ field.
7098 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7099 * output.h (class Output_section_data): Add non-const
7100 output_section function.
7101 (class Output_data_got): Update declarations.
7102 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7103 Add use_plt_offset parameter to global and local constructors.
7104 Change all callers. Change local_sym_index_ field to 31 bits.
7105 Change GSYM_CODE and CONSTANT_CODE accordingly.
7106 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7107 doing a static link don't set sh_link field.
7108 (Output_data_got::Got_entry::write): Use PLT offset if
7110 (Output_data_got::add_global_plt): New function.
7111 (Output_data_got::add_local_plt): New function.
7112 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7113 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7114 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7115 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7116 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7118 * testsuite/ifunc-sel.h: New file.
7119 * testsuite/ifuncmain1.c: New file.
7120 * testsuite/ifuncmain1vis.c: New file.
7121 * testsuite/ifuncmod1.c: New file.
7122 * testsuite/ifuncdep2.c: New file.
7123 * testsuite/ifuncmain2.c: New file.
7124 * testsuite/ifuncmain3.c: New file.
7125 * testsuite/ifuncmod3.c: New file.
7126 * testsuite/ifuncmain4.c: New file.
7127 * testsuite/ifuncmain5.c: New file.
7128 * testsuite/ifuncmod5.c: New file.
7129 * testsuite/ifuncmain6pie.c: New file.
7130 * testsuite/ifuncmod6.c: New file.
7131 * testsuite/ifuncmain7.c: New file.
7132 * configure, testsuite/Makefile.in: Rebuild.
7134 2010-08-18 Ian Lance Taylor <iant@google.com>
7137 (Output_section_incremental_inputs::write_input_files): Add cast
7138 to avoid signed/unsigned comparison warning.
7139 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7141 2010-08-12 Cary Coutant <ccoutant@google.com>
7143 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7145 2010-08-13 Ian Lance Taylor <iant@google.com>
7147 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7149 2010-08-12 Cary Coutant <ccoutant@google.com>
7150 Doug Kwan <dougkwan@google.com>
7152 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7153 defintion overrides non-weak undef, remember that the original undef
7155 * symtab.cc (Symbol_table::sized_write_global): For undef without
7156 an original weak binding, set binding to global in output.
7157 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7158 * testsuite/Makefile.in: Regenerate.
7159 * testsuite/strong_ref_weak_def.sh: New file.
7160 * testsuite/strong_ref_weak_def_1.c: Ditto.
7161 * testsuite/strong_ref_weak_def_2.c: Ditto.
7163 2010-08-12 Cary Coutant <ccoutant@google.com>
7165 * testsuite/incremental_test.sh: Rewrite.
7166 * testsuite/incremental_test_1.c: Rewrite.
7167 * testsuite/incremental_test_2.c: Rewrite.
7169 2010-08-12 Cary Coutant <ccoutant@google.com>
7171 * arm.cc (Target_arm::got_size): Add const.
7172 (Target_arm::got_entry_count): New function.
7173 (Target_arm::plt_entry_count): New function.
7174 (Target_arm::first_plt_entry_offset): New function.
7175 (Target_arm::plt_entry_size): New function.
7176 (Output_data_plt_arm::entry_count): New function.
7177 (Output_data_plt_arm::first_plt_entry_offset): New function.
7178 (Output_data_plt_arm::get_plt_entry_size): New function.
7179 * i386.cc (Target_i386::got_size): Add const.
7180 (Target_i386::got_entry_count): New function.
7181 (Target_i386::plt_entry_count): New function.
7182 (Target_i386::first_plt_entry_offset): New function.
7183 (Target_i386::plt_entry_size): New function.
7184 (Output_data_plt_i386::entry_count): New function.
7185 (Output_data_plt_i386::first_plt_entry_offset): New function.
7186 (Output_data_plt_i386::get_plt_entry_size): New function.
7187 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7188 find_incremental_inputs_sections. Dump incremental_got_plt section.
7189 * incremental.cc: Include target.h.
7190 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7191 parameter. Adjust all callers. Find incremental_got_plt section.
7192 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7194 (Output_section_incremental_inputs::set_final_data_size): Calculate
7195 size of incremental_got_plt section.
7196 (Output_section_incremental_inputs::do_write): Write the
7197 incremental_got_plt section.
7198 (Got_plt_view_info): New struct.
7199 (Local_got_offset_visitor): New class.
7200 (Global_got_offset_visitor): New class.
7201 (Global_symbol_visitor_got_plt): New class.
7202 (Output_section_incremental_inputs::write_got_plt): New function.
7203 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7204 Add parameter. Adjust all callers.
7205 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7206 (Incremental_inputs::got_plt_section): New function.
7207 (Incremental_inputs::got_plt_section_): New data member.
7208 (Incremental_got_plt_reader): New class.
7209 * layout.cc (Layout::create_incremental_info_sections): Add the
7210 incremental_got_plt section.
7211 * object.h (Got_offset_list::get_list): New function.
7212 (Got offset_list::for_all_got_offsets): New function.
7213 (Sized_relobj::local_got_offset_list): New function.
7214 * powerpc.cc (Target_powerpc::got_size): Add const.
7215 (Target_powerpc::got_entry_count): New function.
7216 (Target_powerpc::plt_entry_count): New function.
7217 (Target_powerpc::first_plt_entry_offset): New function.
7218 (Target_powerpc::plt_entry_size): New function.
7219 (Output_data_plt_powerpc::entry_count): New function.
7220 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7221 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7222 * sparc.cc (Target_sparc::got_size): Add const.
7223 (Target_sparc::got_entry_count): New function.
7224 (Target_sparc::plt_entry_count): New function.
7225 (Target_sparc::first_plt_entry_offset): New function.
7226 (Target_sparc::plt_entry_size): New function.
7227 (Output_data_plt_sparc::entry_count): New function.
7228 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7229 (Output_data_plt_sparc::get_plt_entry_size): New function.
7230 * symtab.h (Symbol::got_offset_list): New function.
7231 (Symbol_table::for_all_symbols): New function.
7232 * target.h (Sized_target::got_entry_count): New function.
7233 (Sized_target::plt_entry_count): New function.
7234 (Sized_target::plt_entry_size): New function.
7235 * x86_64.cc (Target_x86_64::got_size): Add const.
7236 (Target_x86_64::got_entry_count): New function.
7237 (Target_x86_64::plt_entry_count): New function.
7238 (Target_x86_64::first_plt_entry_offset): New function.
7239 (Target_x86_64::plt_entry_size): New function.
7240 (Output_data_plt_x86_64::entry_count): New function.
7241 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7242 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7244 2010-08-12 Cary Coutant <ccoutant@google.com>
7246 * archive.cc: Include incremental.h.
7247 (Archive::Archive): Initialize incremental_info_.
7248 (Archive::include_member): Record archive members in incremental info.
7249 (Add_archive_symbols::run): Record begin and end of an archive in
7251 (Lib_group::include_member): Record objects in incremental info.
7252 * archive.h (Incremental_archive_entry): Forward declaration.
7253 (Archive::set_incremental_info): New member function.
7254 (Archive::incremental_info): New member function.
7255 (Archive::Unused_symbol_iterator): New class.
7256 (Archive::unused_symbols_begin): New member function.
7257 (Archive::unused_symbols_end): New member function.
7258 (Archive::incremental_info_): New data member.
7259 * incremental-dump.cc (find_input_containing_global): New function.
7260 (dump_incremental_inputs): Dump new incremental info sections.
7261 * incremental.cc: Include symtab.h.
7262 (Output_section_incremental_inputs): New class.
7263 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7264 new incremental info sections.
7265 (Sized_incremental_binary::do_check_inputs): Likewise.
7266 (Incremental_inputs::report_archive): Remove.
7267 (Incremental_inputs::report_archive_begin): New function.
7268 (Incremental_inputs::report_archive_end): New function.
7269 (Incremental_inputs::report_object): New function.
7270 (Incremental_inputs::finalize_inputs): Remove.
7271 (Incremental_inputs::report_input_section): New function.
7272 (Incremental_inputs::report_script): Rewrite.
7273 (Incremental_inputs::finalize): Do nothing but finalize string table.
7274 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7275 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7276 (Incremental_inputs::create_data_sections): New function.
7277 (Incremental_inputs::relocs_entsize): New function.
7278 (Output_section_incremental_inputs::set_final_data_size): New function.
7279 (Output_section_incremental_inputs::do_write): New function.
7280 (Output_section_incremental_inputs::write_header): New function.
7281 (Output_section_incremental_inputs::write_input_files): New function.
7282 (Output_section_incremental_inputs::write_info_blocks): New function.
7283 (Output_section_incremental_inputs::write_symtab): New function.
7284 * incremental.h (Incremental_script_entry): Forward declaration.
7285 (Incremental_object_entry): Forward declaration.
7286 (Incremental_archive_entry): Forward declaration.
7287 (Incremental_inputs): Forward declaration.
7288 (Incremental_inputs_header_data): Remove.
7289 (Incremental_inputs_header): Remove.
7290 (Incremental_inputs_header_write): Remove.
7291 (Incremental_inputs_entry_data): Remove.
7292 (Incremental_inputs_entry): Remove.
7293 (Incremental_inputs_entry_write): Remove.
7294 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7295 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7296 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7297 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7299 (Incremental_input_entry): New class.
7300 (Incremental_script_entry): New class.
7301 (Incremental_object_entry): New class.
7302 (Incremental_archive_entry): New class.
7303 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7304 (Incremental_inputs::report_inputs): Remove.
7305 (Incremental_inputs::report_archive): Remove.
7306 (Incremental_inputs::report_archive_begin): New function.
7307 (Incremental_inputs::report_archive_end): New function.
7308 (Incremental_inputs::report_object): Change prototype.
7309 (Incremental_inputs::report_input_section): New function.
7310 (Incremental_inputs::report_script): Change prototype.
7311 (Incremental_inputs::get_reloc_count): New function.
7312 (Incremental_inputs::set_reloc_count): New function.
7313 (Incremental_inputs::create_data_sections): New function.
7314 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7315 (Incremental_inputs::inputs_section): New function.
7316 (Incremental_inputs::symtab_section): New function.
7317 (Incremental_inputs::relocs_section): New function.
7318 (Incremental_inputs::get_stringpool): Add const.
7319 (Incremental_inputs::command_line): Add const.
7320 (Incremental_inputs::inputs): Remove.
7321 (Incremental_inputs::command_line_key): New function.
7322 (Incremental_inputs::input_file_count): New function.
7323 (Incremental_inputs::input_files): New function.
7324 (Incremental_inputs::relocs_entsize): New function.
7325 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7326 (Incremental_inputs::finalize_inputs): Remove.
7327 (Incremental_inputs::Input_info): Remove.
7328 (Incremental_inputs::lock_): Remove.
7329 (Incremental_inputs::inputs_): Change type.
7330 (Incremental_inputs::inputs_map_): Remove.
7331 (Incremental_inputs::current_object_entry_): New data member.
7332 (Incremental_inputs::inputs_section_): New data member.
7333 (Incremental_inputs::symtab_section_): New data member.
7334 (Incremental_inputs::relocs_section_): New data member.
7335 (Incremental_inputs::reloc_count_): New data member.
7336 (Incremental_inputs_reader): New class.
7337 (Incremental_symtab_reader): New class.
7338 (Incremental_relocs_reader): New class.
7339 * layout.cc (Layout::finalize): Move finalization of incremental info
7340 and creation of incremental info sections to follow finalization of
7341 symbol table. Set offsets for postprocessing sections.
7342 (Layout::create_incremental_info_sections): Call
7343 Incremental_inputs::create_data_sections. Add incremental symtab
7344 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7345 sections to layout after input sections.
7346 * layout.h (struct Timespec): Forward declaration.
7347 (Layout::incremental_inputs): Add const.
7348 (Layout::create_incremental_info_sections): Add parameter.
7349 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7350 * object.cc: Include incremental.h.
7351 (Relobj::finalize_incremental_relocs): New function.
7352 (Sized_relobj::do_layout): Record input sections in incremental info.
7353 * object.h (Object::output_section): New function.
7354 (Object::output_section_offset): Moved from Relobj.
7355 (Object::get_incremental_reloc_base): New function.
7356 (Object::get_incremental_reloc_count): New function.
7357 (Object::do_output_section): New function.
7358 (Object::do_output_section_offset): Moved from Relobj.
7359 (Object::do_get_incremental_reloc_base): New function.
7360 (Object::do_get_incremental_reloc_count): New function.
7361 (Object::Object): Initialize new data members.
7362 (Relobj::output_section): Renamed do_output_section and moved to
7364 (Relobj::output_section_offset): Moved to Object.
7365 (Relobj::do_get_incremental_reloc_base): New function.
7366 (Relobj::do_get_incremental_reloc_count): New function.
7367 (Relobj::allocate_incremental_reloc_counts): New function.
7368 (Relobj::count_incremental_reloc): New function.
7369 (Relobj::finalize_incremental_relocs): New function.
7370 (Relobj::next_incremental_reloc_index): New function.
7371 (Relobj::reloc_counts_): New data member.
7372 (Relobj::reloc_bases_): New data member.
7373 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7374 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7375 (Sized_relobj::incremental_relocs_scan): New function.
7376 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7377 (Sized_relobj::incremental_relocs_write): New function.
7378 (Sized_relobj::incremental_relocs_write_reltype): New function.
7379 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7381 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7382 archives and object files elsewhere.
7383 (Add_symbols::run): Report object files here.
7384 (Finish_group::run): Report end of archive at end of group.
7385 * reloc.cc: Include layout.h, incremental.h.
7386 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7387 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7388 (Sized_relobj::incremental_relocs_scan): New function.
7389 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7390 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7391 (Sized_relobj::incremental_relocs_write): New function.
7392 (Sized_relobj::incremental_relocs_write_reltype): New function.
7393 * script.cc (read_input_script): Rewrite test for incremental link.
7394 Change call to Incremental_inputs::report_script.
7395 * symtab.h (Symbol_table::first_global_index): New function.
7396 (Symbol_table::output_count): New function.
7398 2010-08-12 Doug Kwan <dougkwan@google.com>
7400 * arm.cc (Target_arm::merge_object_attributes): Check command line
7401 options --no-wchar-size-warning and --no-enum-size-warning.
7402 * options.h (General_options): Add ld-compatible options
7403 --no-enum-size-warning and --no-wchar-size-warning.
7405 2010-08-04 Ian Lance Taylor <iant@google.com>
7407 * x86_64.cc (Target_x86_64::Scan::local): Use
7408 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7409 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7410 (Target_x86_64::Scan::global): Likewise.
7411 (Target_x86_64::Relocate::relocate): Likewise.
7412 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7415 2010-08-03 Cary Coutant <ccoutant@google.com>
7417 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7418 to reserve space in merged_strings vector. Keep total input size
7420 (Output_merge_string::do_print_merge_stats): Print total input size.
7421 * merge.h (Output_merge_string): Add input_size_ field.
7422 * stringpool.cc (Stringpool_template::string_length): Move
7423 implementations out of Stringpool_template class and place in
7425 * stringpool.h (string_length): Move out of Stringpool_template.
7427 2010-08-03 Ian Lance Taylor <iant@google.com>
7430 * layout.cc (relaxation_loop_body): If address of load segment is
7431 set, adjust address to include headers if possible.
7433 2010-08-03 Ian Lance Taylor <iant@google.com>
7435 * version.cc (version_string): Bump to 1.10.
7437 2010-08-03 Ian Lance Taylor <iant@google.com>
7440 * layout.h (enum Output_section_order): Define.
7441 (class Layout): Update declarations.
7442 * layout.cc (Layout::get_output_section): Add order parameter.
7443 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7444 is_first_non_relro parameters. Change all callers.
7445 (Layout::choose_output_section): Likewise.
7446 (Layout::add_output_section_data): Likewise.
7447 (Layout::make_output_section): Likewise. Set order.
7448 (Layout::default_section_order): New function.
7449 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7450 * output.cc (Output_section::Output_section): Initialize order_.
7451 Don't initialize deleted fields.
7452 (Output_segment::Output_segment): Don't initialize deleted
7454 (Output_segment::add_output_section_to_load): New function
7455 replacing add_output_section. Change all callers to call this or
7456 add_output_section_to_nonload.
7457 (Output_segment::add_output_section_to_nonload): New function.
7458 (Output_segment::remove_output_section): Rewrite.
7459 (Output_segment::add_initial_output_data): Likewise.
7460 (Output_segment::has_any_data_sections): Likewise.
7461 (Output_segment::is_first_section_relro): Likewise.
7462 (Output_segment::maximum_alignment): Likewise.
7463 (Output_segment::has_dynamic_reloc): New function replacing
7464 dynamic_reloc_count. Change all callers.
7465 (Output_segment::has_dynamic_reloc_list): New function replacing
7466 dynamic_reloc_count_list. Change all callers.
7467 (Output_segment::set_section_addresses): Rewrite.
7468 (Output_segment::set_offset): Rewrite.
7469 (Output_segment::find_first_and_last_list): Remove.
7470 (Output_segment::set_tls_offsets): Rewrite.
7471 (Output_segment::first_section_load_address): Likewise.
7472 (Output_segment::output_section_count): Likewise.
7473 (Output_segment::section_with_lowest_load_address): Likewise.
7474 (Output_segment::write_section_headers): Likewise.
7475 (Output_segment::print_sections_to_map): Likewise.
7476 * output.h (class Output_data): Remove dynamic_reloc_count_
7477 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7478 (Output_data::add_dynamic_reloc): Rewrite.
7479 (Output_data::has_dynamic_reloc): New function.
7480 (Output_data::dynamic_reloc_count): Remove.
7481 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7482 is_last_relro_, is_first_non_relro_, is_interp_,
7483 is_dynamic_linker_section_ fields. Add order and set_order
7484 functions. Remove is_relro_local, set_is_relro_local,
7485 is_last_relro, set_is_last_relro, is_first_non_relro,
7486 set_is_first_non_relro functions, is_interp, set_is_interp,
7487 is_dynamic_linker_section, and set_is_dynamic_linker_section
7489 (class Output_segment): Change Output_data_list from std::list to
7490 std:;vector. Add output_lists_ field. Remove output_data_ and
7491 output_bss_ fields. Update declarations.
7493 2010-08-02 Ian Lance Taylor <iant@google.com>
7495 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7496 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7497 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7499 2010-08-02 Ian Lance Taylor <iant@google.com>
7502 * script.cc (Script_options::Script_options): Initialize
7503 symbol_definitions_ and symbol_references_.
7504 (Script_options::add_symbol_assignment): Update
7505 symbol_definitions_ and symbol_references_.
7506 (Script_options::add_symbol_reference): New function.
7507 (script_symbol): New function.
7508 * script.h (class Script_options): Add symbol_definitions_ and
7509 symbol_references_ fields.
7510 (Script_options::referenced_const_iterator): New type.
7511 (Script_options::referenced_begin): New function.
7512 (Script_options::referenced_end): New function.
7513 (Script_options::is_referenced): New function.
7514 (Script_options::any_unreferenced): New function.
7515 * script-c.h (script_symbol): Declare.
7516 * yyscript.y (exp): Call script_symbol.
7517 * symtab.cc: Include "script.h".
7518 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7519 Change all callers. Check symbols referenced by scripts.
7520 (Symbol_table::add_undefined_symbols_from_command_line): Add
7521 layout parameter. Change all callers.
7522 (Symbol_table::do_add_undefined_symbols_from_command_line):
7523 Likewise. Break out loop body. Check symbols referenced by
7525 (Symbol_table::add_undefined_symbol_from_command_line): New
7526 function broken out of
7527 do_add_undefined_symbols_from_command_line.
7528 * symtab.h (class Symbol_table): Update declarations.
7529 * archive.cc: Include "layout.h".
7530 (Archive::should_include_member): Add layout parameter. Change
7531 all callers. Check for symbol mentioned in expression.
7532 * archive.h (class Archive): Update declaration.
7533 * object.cc (Sized_relobj::do_should_include_member): Add layout
7535 * object.h (Object::should_include_member): Add layout parameter.
7537 (Object::do_should_include_member): Add layout parameter.
7538 (class Sized_relobj): Update declaration.
7539 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7541 * dynobj.h (class Sized_dynobj): Update declaration.
7542 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7544 * plugin.h (class Sized_pluginobj): Update declaration.
7546 2010-08-02 Ian Lance Taylor <iant@google.com>
7549 * output.cc (Output_segment::set_offset): Search for the first and
7550 last sections rather than assuming that the list is in order.
7551 (Output_segment::find_first_and_last_list): New function.
7552 * output.h (class Output_segment): Update declarations.
7553 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7554 (relro_strip_test_SOURCES): New variable.
7555 (relro_strip_test_DEPENDENCIES): New variable.
7556 (relro_strip_test_LDFLAGS): New variable.
7557 (relro_strip_test_LDADD): New variable.
7558 (relro_strip_test.so): New target.
7560 2010-08-02 Ian Lance Taylor <iant@google.com>
7562 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7563 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7564 (Target_i386::got_tlsdesc_section): New function.
7565 (Target_i386::got_section): Create space for GOT entries for
7566 TLSDESC relocations.
7567 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7569 (Target_i386::Scan::global): Likewise.
7570 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7572 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7573 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7574 (Target_x86_64::got_tlsdesc_section): New function.
7575 (Target_x86_64::got_section): Create space for GOT entries for
7576 TLSDESC relocations.
7577 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7579 (Target_x86_64::Scan::global): Likewise.
7580 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7583 2010-08-02 Ian Lance Taylor <iant@google.com>
7585 * testsuite/final_layout.sh: Use dc to convert from hex to
7588 2010-07-29 Sriraman Tallam <tmsriram@google.com>
7590 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7591 paramter to the call to gold::gc_process_relocs.
7592 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7593 paramter to the call to gold::gc_process_relocs.
7594 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7595 parameter to the call to gold::gc_process_relocs.
7596 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7597 template parameter to the call to gold::gc_process_relocs.
7598 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7599 paramter to the call to gold::gc_process_relocs.
7600 * gc.h (get_embedded_addend_size): New function.
7601 (gc_process_relocs): Save the size of the reloc for use by ICF.
7602 * icf.cc (get_section_contents): Get the addend from the text section
7603 for SHT_REL relocation sections.
7604 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7605 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7606 * int_encoding.h (read_from_pointer): New overloaded function.
7607 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7608 * testsuite/icf_sht_rel_addend_test.sh: New file.
7609 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7610 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7612 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7614 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7615 * Makefile.in: Regenerate.
7616 * testsuite/Makefile.in: Regenerate.
7618 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7620 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7621 * gold/testsuite/debug_msg.cc: Likewise.
7622 * gold/testsuite/odr_violation1.cc
7623 * gold/testsuite/odr_violation2.cc
7625 2010-07-21 Cary Coutant <ccoutant@google.com>
7627 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7628 string, and length fields.
7629 (Output_merge_string::Merged_strings_list): New type.
7630 (Output_merge_string::Merged_strings_lists): New typedef.
7631 (Output_merge_string): Replace merged_strings_ with
7632 merged_strings_lists_.
7633 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7634 Merged_strings_list per input object and section. Don't store pointer
7635 to the string. Don't store length with each merged string entry.
7636 (Output_merge_string::finalize_merged_data): Loop over list of merged
7637 strings lists. Recompute length of each merged string.
7639 2010-07-15 Cary Coutant <ccoutant@google.com>
7641 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7644 2010-07-14 Ian Lance Taylor <iant@google.com>
7646 * descriptors.cc (Descriptors::open): Report correct name in error
7649 2010-07-13 Doug Kwan <dougkwan@google.com>
7651 * arm.cc (Arm_input_section::Arm_input_section): For a
7652 SHT_ARM_EXIDX section, always keeps the input sections.
7653 (Arm_input_section::set_exidx_section_link): New method.
7654 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7655 has_errors_ to false.
7656 (Arm_exidx_input_section::has_errors,
7657 Arm_exidx_input_section::set_has_errors): New methods.
7658 (Arm_exidx_input_section::has_errors_): New data member.
7659 (Arm_relobj::get_exidx_shndx_list): New method.
7660 (Arm_output_section::append_text_sections_to_list): Do not skip
7661 section without SHF_EXECINSTR.
7662 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7664 (Arm_relobj::make_exidx_input_section): Add new parameter for text
7665 section header. Make error messages more verbose. Check for
7666 a non-executable section linked to an EXIDX section.
7667 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7668 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7669 check that there is no deferred EXIDX section if we exit early.
7670 Instead of not making an EXIDX section in case of an error, make one
7671 and set the has_errors flag of it.
7672 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7673 in a relocatable link.
7674 (Target_arm::do_relax): Look for the EXIDX output section instead of
7675 assuming that it is called .ARM.exidx.
7676 (Target_arm::fix_exidx_coverage): Add a new parameter for input
7677 section list. Do not check for SHF_EXECINSTR section flags but
7678 skip any input section with errors.
7679 * output.cc (Output_section::Output_section): Initialize
7680 always_keeps_input_sections_ to false.
7681 (Output_section::add_input_section): Check for
7682 always_keeps_input_sections_.
7683 * output.h (Output_section::always_keeps_input_sections,
7684 Output_section::set_always_keeps_input_sections): New methods.
7685 (Output_section::always_keeps_input_sections): New data member.
7687 2010-07-13 Rafael Espindola <espindola@google.com>
7689 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7690 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7692 2010-07-13 Philip Herron <herron.philip@googlemail.com>
7693 Ian Lance Taylor <iant@google.com>
7695 * output.h (Output_section_lookup_maps::add_merge_section):
7696 Correct check of whether value was inserted.
7697 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7698 (Output_section_lookup_maps::add_relaxed_input_section):
7700 * arm.cc (Target_arm::got_section): Remove used local os.
7701 * i386.cc (Target_i386::got_section): Likewise.
7702 * x86_64.cc (Target_x86_64::got_section): Likewise.
7703 * sparc.cc (Target_sparc::got_section): Likewise.
7704 (Target_sparc::relocate): Remove unused local have_got_offset.
7705 * powerpc.cc (Target_powerpc::relocate): Likewise.
7707 2010-07-13 Ian Lance Taylor <iant@google.com>
7709 * compressed_output.cc (zlib_decompress): Fix signature in
7712 * archive.cc (Archive::include_member): Unlock an external member
7713 of a thin archive. Don't bother to delete an object we know is
7716 2010-07-12 Cary Coutant <ccoutant@google.com>
7718 * compressed_output.cc (zlib_decompress): New function.
7719 (get_uncompressed_size): New function.
7720 (decompress_input_section): New function.
7721 * compressed_output.h (get_uncompressed_size): New function.
7722 (decompress_input_section): New function.
7723 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7724 Handle compressed debug sections.
7725 * layout.cc (is_compressed_debug_section): New function.
7726 (Layout::output_section_name): Map compressed section names to
7728 * layout.h (is_compressed_debug_section): New function.
7729 (is_debug_info_section): Recognize compressed debug sections.
7730 * merge.cc: Include compressed_output.h.
7731 (Output_merge_data::do_add_input_section): Handle compressed
7733 (Output_merge_string::do_add_input_section): Handle compressed
7735 * object.cc: Include compressed_output.h.
7736 (Sized_relobj::Sized_relobj): Initialize new data members.
7737 (build_compressed_section_map): New function.
7738 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7739 * object.h (Object::section_is_compressed): New method.
7740 (Object::do_section_is_compressed): New method.
7741 (Sized_relobj::Compressed_section_map): New type.
7742 (Sized_relobj::do_section_is_compressed): New method.
7743 (Sized_relobj::compressed_sections_): New data member.
7744 * output.cc (Output_section::add_input_section): Handle compressed
7746 * reloc.cc: Include compressed_output.h.
7747 (Sized_relobj::write_sections): Handle compressed debug sections.
7749 2010-07-08 Cary Coutant <ccoutant@google.com>
7751 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7752 weak when resolving to a dynamic def.
7753 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7754 for weak undef/dynamic def cases. Adjust callers.
7755 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7756 undef_binding_weak_.
7757 (Symbol_table::sized_write_globals): Adjust symbol binding.
7758 (Symbol_table::sized_write_symbol): Add binding parameter.
7759 * symtab.h (Symbol::set_undef_binding): New method.
7760 (Symbol::is_undef_binding_weak): New method.
7761 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7762 (Symbol_table::should_override): Add new parameter.
7763 (Symbol_table::sized_write_symbol): Add new parameter.
7765 * testsuite/weak_undef_file1.cc: Add new test case.
7766 * testsuite/weak_undef_file2.cc: Fix header comment.
7767 * testsuite/weak_undef_test.cc: Add new test case.
7769 2010-06-29 Doug Kwan <dougkwan@google.com>
7771 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7772 Initialize USE_SYMBOL_.
7773 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7775 (Arm_reloc_property::uses_symbol_): New data member declaration.
7776 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7777 uses symbol value and symbol is undefined but not weakly undefined.
7779 2010-06-28 Rafael Espindola <espindola@google.com>
7781 * plugin.cc (Plugin::load): Use dlerror.
7783 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7785 * symtab.cc (detect_odr_violations): When reporting an ODR
7786 violation, report an object where the symbol is defined.
7788 2010-06-25 Doug Kwan <dougkwan@google.com>
7790 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7791 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7793 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7794 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7795 target hook to detect function points.
7796 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7797 * icf.h (Icf::check_section_for_function_pointers): Change type of
7798 parameter SECTION_NAME to const reference to std::string. Use
7799 target hook to determine if section may have unsafe pointers.
7800 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7803 2010-06-21 Rafael Espindola <espindola@google.com>
7805 * fileread.cc (Input_file::find_fie): New
7806 (Input_file::open): Use Input_file::find_fie.
7807 * fileread.h (Input_file::find_fie): New
7808 * plugin.cc (set_extra_library_path): New.
7809 (Plugin::load): Add set_extra_library_path to the transfer vector.
7810 (Plugin_manager::set_extra_library_path): New.
7811 (Plugin_manager::add_input_file): Use the extra search path if set.
7812 (set_extra_library_path(): New.
7813 * plugin.h (Plugin_manager): Add set_extra_library_path and
7816 2010-06-19 Cary Coutant <ccoutant@google.com>
7818 * layout.cc (gdb_sections): Add .debug_types.
7819 (lines_only_debug_sections): Likewise.
7821 2010-06-18 Rafael Espindola <espindola@google.com>
7823 * plugin.cc (add_input_file,add_input_library)
7824 (Plugin_manager::add_input_file): Make filename arguments const.
7825 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7828 2010-06-16 Doug Kwan <dougkwan@google.com>
7830 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7831 .ARM.attributes section if we have not merged any input
7832 attributes sections.
7834 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7836 * arm.cc: Allow combining objects with no EABI version
7839 2010-06-15 Rafael Espindola <espindola@google.com>
7841 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7843 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7845 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7846 (struct iovec): Correct !HAVE_READV definition.
7848 2010-06-10 Cary Coutant <ccoutant@google.com>
7850 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7851 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7853 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7856 * symtab.h (Symbol::is_placeholder): New member function.
7857 * target-reloc.h (relocate_section): Check for placeholder symbols.
7859 * testsuite/Makefile.am (plugin_test_8): New test.
7860 (plugin_test_9): New test.
7861 * testsuite/Makefile.in: Regenerate.
7863 2010-06-09 Nick Clifton <nickc@redhat.com>
7865 * yyscript.y (input_list_element): Allow strings prefixed with
7866 the '-' character. Treat these as libraries.
7867 * script.cc (script_add_library): New function. Adds a library
7868 specified by "-l<name>" found in an input script.
7869 * script-c.h: Add prototype for script_add_library.
7871 2010-06-07 Doug Kwan <dougkwan@google.com>
7873 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7874 Restrict stub-group size to be within long conditional branch
7875 range when working around cortex-A8 erratum.
7877 2010-06-07 Damien Diederen <dd@crosstwine.com>
7879 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7882 2010-06-03 Sriraman Tallam <tmsriram@google.com>
7886 (Output_section::Input_section_sort_entry::compare_section_ordering):
7887 Change to return non-zero correctly.
7888 (Output_section::Input_section_sort_section_order_index_compare
7889 ::operator()): Change to fix ambiguity in comparisons.
7891 2010-06-01 Sriraman Tallam <tmsriram@google.com>
7893 * gold.h (is_wildcard_string): New function.
7894 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7895 (Layout::layout_eh_frame): Ditto.
7896 (Layout::find_section_order_index): New method.
7897 (Layout::read_layout_from_file): New method.
7898 * layout.h (Layout::find_section_order_index): New method.
7899 (Layout::read_layout_from_file): New method.
7900 (Layout::input_section_position_): New private member.
7901 (Layout::input_section_glob_): New private member.
7902 * main.cc (main): Call read_layout_from_file here.
7903 * options.h (--section-ordering-file): New option.
7904 * output.cc (Output_section::input_section_order_specified_): New
7906 (Output_section::Output_section): Initialize new member.
7907 (Output_section::add_input_section): Add new parameter.
7908 Keep input sections when --section-ordering-file is used.
7909 (Output_section::set_final_data_size): Sort input sections when
7910 section ordering file is specified.
7911 (Output_section::Input_section_sort_entry): Add new parameter.
7913 (Output_section::Input_section_sort_entry::compare_section_ordering):
7915 (Output_section::Input_section_sort_compare::operator()): Change to
7916 consider section_order_index.
7917 (Output_section::Input_section_sort_init_fini_compare::operator()):
7918 Change to consider section_order_index.
7919 (Output_section::Input_section_sort_section_order_index_compare
7920 ::operator()): New method.
7921 (Output_section::sort_attached_input_sections): Change to sort
7922 according to section order when specified.
7923 (Output_section::add_input_section<32, true>): Add new parameter.
7924 (Output_section::add_input_section<64, true>): Add new parameter.
7925 (Output_section::add_input_section<32, false>): Add new parameter.
7926 (Output_section::add_input_section<64, false>): Add new parameter.
7927 * output.h (Output_section::add_input_section): Add new parameter.
7928 (Output_section::input_section_order_specified): New
7930 (Output_section::set_input_section_order_specified): New method.
7931 (Input_section::Input_section): Initialize section_order_index_.
7932 (Input_section::section_order_index): New method.
7933 (Input_section::set_section_order_index): New method.
7934 (Input_section::section_order_index_): New member.
7935 (Input_section::Input_section_sort_section_order_index_compare): New
7937 (Output_section::input_section_order_specified_): New member.
7938 * script-sections.cc (is_wildcard_string): Delete and move modified
7940 (Output_section_element_input::Output_section_element_input): Modify
7941 call to is_wildcard_string.
7942 (Output_section_element_input::Input_section_pattern
7943 ::Input_section_pattern): Ditto.
7944 (Output_section_element_input::Output_section_element_input): Ditto.
7945 * testsuite/Makefile.am (final_layout): New test case.
7946 * testsuite/Makefile.in: Regenerate.
7947 * testsuite/final_layout.cc: New file.
7948 * testsuite/final_layout.sh: New file.
7950 2010-06-01 Rafael Espindola <espindola@google.com>
7952 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7954 2010-06-01 Rafael Espindola <espindola@google.com>
7956 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7957 visibility of symbols.
7959 2010-05-27 Doug Kwan <dougkwan@google.com>
7961 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7962 from start of output section instead of address for a local symbol
7963 in a merged or relaxed section when doing a relocatable link.
7965 2010-05-26 Rafael Espindola <espindola@google.com>
7968 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7969 adding sections the garbage collector removed.
7970 * gold/testsuite/Makefile.am: Add test.
7971 * gold/testsuite/Makefile.in: Regenerate.
7972 * gold/testsuite/plugin_test_7.sh: New.
7973 * gold/testsuite/plugin_test_7_1.c: New.
7974 * gold/testsuite/plugin_test_7_2.c: New.
7976 2010-05-26 Rafael Espindola <espindola@google.com>
7978 * script-sections.cc (Output_section_definition::set_section_addresses):
7979 Check for --section-start.
7981 2010-05-26 Doug Kwan <dougkwan@google.com>
7983 * arm.cc (Arm_scan_relocatable_relocs): New class.
7984 (Target_arm::relocate_special_relocatable): New method.
7985 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7986 (Arm_relocate_functions::thumb_branch_common): Same.
7987 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7988 instead of Default_scan_relocatable_relocs.
7989 * target-reloc.h (relocate_for_relocatable): Let target handle
7990 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7991 * target.h (Sized_target::relocate_special_relocatable): New method.
7993 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7995 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7997 2010-05-23 Doug Kwan <dougkwan@google.com>
7999 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8001 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8002 with a direct branch, not a conditional branch, to a stub.
8003 * merge.cc (Output_merge_base::record_input_section): New method
8005 (Output_merge_data::do_add_input_section): Record input section if
8006 keeps-input-sections flag is set.
8007 (Output_merge_string::do_add_input_section): Ditto.
8008 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8009 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8011 (Output_merge_base::keeps_input_sections,
8012 Output_merge_base::set_keeps_input_sections,
8013 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8015 (Output_merge_base::Input_sections): New type declaration.
8016 (Output_merge_base::input_sections_begin,
8017 Output_merge_base::input_sections_end,
8018 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8019 (Output_merge_base::bool keeps_input_sections_,
8020 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8021 Output_merge_base::input_sections_): New data members.
8022 (Output_merge_data::do_set_keeps_input_sections): New method
8024 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8025 * output.cc (Output_section::Input_section::relobj): Move method
8026 defintion from class declaration to here and handle merge sections.
8027 (Output_section::Input_section::shndx): Ditto.
8028 (Output_section::Output_section): Remove initializations of removed
8029 data members and initialize new data member LOOKUP_MAPS_.
8030 (Output_section::add_input_section): Set keeps-input-sections flag
8031 for a newly created merge output section as appropriate. Adjust code
8032 to use Output_section_lookup_maps class.
8033 (Output_section::add_relaxed_input_section): Adjst code for lookup
8034 maps code refactoring.
8035 (Output_section::add_merge_input_section): Add a new parameter
8036 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8037 class. If adding input section to a newly created merge output
8038 section fails, remove the new merge section.
8039 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
8040 Adjust code for use of the Output_section_lookup_maps class.
8041 (Output_section::find_merge_section): Ditto.
8042 (Output_section::build_lookup_maps): New method defintion.
8043 (Output_section::find_relaxed_input_section): Adjust code to use
8044 Output_section_lookup_maps class.
8045 (Output_section::get_input_sections): Export merge sections. Adjust
8046 code to use Output_section_lookup_maps class.
8047 (Output_section:::add_script_input_section): Adjust code to use
8048 Output_section_lookup_maps class. Update lookup maps for merge
8050 (Output_section::discard_states): Use Output_section_lookup_maps.
8051 (Output_section::restore_states): Same.
8052 * output.h (Merge_section_properties): Move class defintion out of
8054 (Output_section_lookup_maps): New class.
8055 (Output_section::Input_section::is_merge_section): New method
8057 (Output_section::Input_section::relobj): Move defintion out of class
8058 defintion. Declare method only.
8059 (Output_section::Input_section::shndx): Ditto.
8060 (Output_section::Input_section::output_merge_base): New method defintion.
8061 (Output_section::Input_section::u2_.pomb): New union field.
8062 (Output_section::Merge_section_by_properties_map,
8063 Output_section::Output_section_data_by_input_section_map,
8064 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8066 (Output_section::add_merge_input_section): Add new parameter
8067 KEEPS_INPUT_SECTIONS.
8068 (Output_section::build_lookup_maps): New method declaration.
8069 (Output_section::merge_section_map_,
8070 Output_section::merge_section_by_properties_map_,
8071 Output_section::relaxed_input_section_map_,
8072 Output_section::is_relaxed_input_section_map_valid_): Remove data
8074 (Output_section::lookup_maps_): New data member.
8076 2010-05-21 Doug Kwan <dougkwan@google.com>
8079 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8080 avoid a compilation error.
8082 2010-05-19 Rafael Espindola <espindola@google.com>
8084 * script-sections.cc (Output_section_definition::allocate_to_segment):
8085 Update the phdrs_list even when the output section is NULL.
8086 * testsuite/Makefile.am: Add test.
8087 * testsuite/Makefile.in: Regenerate.
8088 * testsuite/script_test_9.cc: New.
8089 * testsuite/script_test_9.sh: New.
8090 * testsuite/script_test_9.t: New.
8092 2010-05-19 Doug Kwan <dougkwan@google.com>
8094 * arm.cc (Arm_input_section::original_size): New method.
8095 (Arm_input_section::do_addralign): Add a cast.
8096 (Arm_input_section::do_output_offset): Remove static cast.
8097 (Arm_input_section::original_addralign,
8098 Arm_input_section::original_size_): Change type to uint32_t.
8099 (Arm_input_section::init): Add safe casts for section alignment
8101 (Arm_input_section::set_final_data_size): Do not set address and
8102 offset of stub table.
8103 (Arm_output_section::fix_exidx_coverage): Change use of of
8104 Output_section::Simple_input_section to that of
8105 Output_section::Input_section.
8106 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8107 except for the first pass.
8108 * output.cc (Output_section::get_input_sections): Change type of
8109 input_sections to std::list<Input_section>.
8110 (Output_section::add_script_input_section): Rename from
8111 Output_section::add_simple_input_section. Change type of SIS
8112 parameter from Simple_input_section to Input_section.
8113 * output.h (Output_section::Simple_input_section): Remove class.
8114 (Output_section::Input_section): Change class visibility to public.
8115 (Output_section::Input_section::addralign): Use stored alignments
8116 for special input sections if set.
8117 (Output_section::Input_section::set_addralign): New method.
8118 (Output_section::get_input_sections): Change parameter type from
8119 list of Simple_input_section to list of Input_section.
8120 (Output_section::add_script_input_section): Rename from
8121 Output_section::add_simple_input_section. Change first parameter's
8122 type from Simple_input_section to Input_section and remove the
8123 second and third parameters.
8124 * script-sections.cc (Input_section::Input_section_list): Change
8125 type to list of Output_section::Input_section/
8126 (Input_section_info::Input_section_info): Change parameter type of
8127 INPUT_SECTION to Output_section::Input_section.
8128 (Input_section_info::input_section): Change return type.
8129 (Input_section_info::input_section_): Change type to
8130 Output_section::Input_section.
8131 (Output_section_element_input::set_section_addresses): Adjust code
8132 to use Output_section::Input_section instead of
8133 Output_section::Simple_input_section. Adjust code for renaming
8134 of Output_section::add_simple_input_section.
8135 (Orphan_output_section::set_section_addresses): Ditto.
8137 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8139 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8140 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8142 2010-05-18 Rafael Espindola <espindola@google.com>
8144 * options.cc (General_options::finalize): Handle -nostdlib.
8145 * options.h (nostdlib): New option.
8146 * script.cc (script_add_search_dir): Handle -nostdlib.
8148 2010-05-12 Doug Kwan <dougkwan@google.com>
8150 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8151 attributes section only if there no attributes section after merging.
8152 (Target_arm::merge_object_attributes): Move value of
8153 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
8154 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8155 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8156 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8157 and arm_attr_merge_7.stdout.
8158 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8159 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8160 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8161 arm_attr_merge_7b.o): New rules.
8162 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8164 * testsuite/Makefile.in: Regenerate.
8165 * testsuite/arm_attr_merge.sh: New file.
8166 * testsuite/arm_attr_merge_[67][ab].s: Same.
8168 2010-05-05 Nick Clifton <nickc@redhat.com>
8170 * po/es.po: Updated Spanish translation.
8172 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8174 * Makefile.am (install-exec-local): Properly install gold as
8175 default cross linker.
8176 * Makefile.in: Regenerated.
8178 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8179 Nick Clifton <nickc@redhat.com>
8181 * configure.ac (install_as_default): Define and set to false
8182 unless --enable-gold or --enable-gold=both/gold has been
8184 * configure: Regenerate.
8186 * Makefile.am (install-exec-local): Install the executable as
8187 'ld.gold'. If install_as_default is true then also install it as
8189 * Makefile.in: Regenerated.
8191 2010-04-24 Ian Lance Taylor <iant@google.com>
8193 * layout.cc (Layout::layout_reloc): In relocatable link don't
8194 combine reloc sections for grouped sections.
8196 2010-04-23 Sriraman Tallam <tmsriram@google.com>
8198 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8199 sections that are not ordinary to icf.
8200 * icf.cc (get_section_contents): Handle relocation pointing to section
8201 with no object or shndx information.
8202 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8203 * testsuite/Makefile.in: Regenerate.
8204 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8205 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8207 2010-04-22 Ian Lance Taylor <iant@google.com>
8209 * expression.cc (Expression::Expression_eval_info): Add
8210 result_alignment_pointer field.
8211 (Expression::eval_with_dot): Add result_alignment_pointer
8212 parameter. Change all callers.
8213 (Expression::eval_maybe_dot): Likewise.
8214 (class Binary_expression): Add alignment_pointer parameter to
8215 left_value and right_value. Change all callers.
8216 (BINARY_EXPRESSION): Set result alignment.
8217 (class Trinary_expression): Add alignment_pointer parameter to
8218 arg2_value and arg3_value. Change all callers.
8219 (Trinary_cond::value): Set result alignment.
8220 (Max_expression::value, Min_expression::value): Likewise.
8221 (Align_expression::value): Likewise.
8222 * script-sections.cc (class Sections_element): Add dot_alignment
8223 parameter to set_section_addresses virtual function. Update
8225 (class Output_section_element): Likewise.
8226 (Script_sections::create_segments): Add dot_alignment parameter.
8228 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8229 (Script_sections::set_phdrs_clause_addresses): Likewise.
8230 * script-sections.h: Update declarations.
8231 * script.h: Update declarations.
8232 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8234 * testsuite/script_test_3.t: Set large alignment.
8235 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8236 segment has expected alignment.
8238 2010-04-22 Nick Clifton <nickc@redhat.com>
8240 * po/gold.pot: Updated by the Translation project.
8241 * po/vi.po: Updated Vietnamese translation.
8243 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8245 * testsuite/Makefile.am (check_PROGRAMS): Add
8246 icf_virtual_function_folding_test.
8247 * testsuite/Makefile.in: Regenerated.
8249 2010-04-15 Andrew Haley <aph@redhat.com>
8251 * options.h (merge_exidx_entries): New option.
8252 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8253 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8254 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8255 (Target_arm::merge_exidx_entries): New function.
8256 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8257 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8258 to Arm_exidx_fixup constructor.
8259 Add new arg, merge_exidx_entries.
8260 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8261 Arm_output_section::fix_exidx_coverage.
8263 2010-04-18 Sriraman Tallam <tmsriram@google.com>
8265 * icf.cc (get_section_contents): Check for preemptible functions.
8266 Ignore addend when appropriate.
8267 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8269 (add_from_relobj): Check for section folded.
8270 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8271 * symtab.h (should_add_dynsym_entry): Add new parameter.
8272 * target-reloc.h (scan_relocs): Check for section folded.
8273 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8274 Check reloc types for function pointers in shared objects.
8275 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8277 (icf_preemptible_functions_test): New test case.
8278 (icf_string_merge_test): New test case.
8279 * testsuite.Makefile.in: Regenerate.
8280 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8281 bar_glob. Refactor code.
8282 * testsuite/icf_preemptible_functions_test.cc: New file.
8283 * testsuite/icf_preemptible_functions_test.sh: New file.
8284 * testsuite/icf_string_merge_test.cc: New file.
8285 * testsuite/icf_string_merge_test.sh: New file.
8286 * testsuite/icf_virtual_function_folding_test.cc: New file.
8287 * testsuite/icf_virtual_function_folding_test.sh: New file.
8289 2010-04-14 Doug Kwan <dougkwan@google.com>
8291 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8292 for local symbol recounting if we remove a section due to ICF.
8293 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8294 there are no regular objects in input.
8296 2010-04-13 Doug Kwan <dougkwan@google.com>
8298 * arm.cc (Arm_input_section::set_final_data_size): Compute
8299 accurate final data size instead of using current data size.
8301 2010-04-09 Doug Kwan <dougkwan@google.com>
8303 * layout.cc (Layout::choose_output_section): Handle script section
8305 (Layout::make_output_section_for_script): Add section type parameter.
8306 Handle script section types.
8307 * layout.h (Layout::make_output_section_for_script): Add section
8309 * output.cc (Output_section::Output_section): Initialize data member
8311 (Output_section::do_reset_address_and_file_offset): Do not set address
8312 to 0 if section is a NOLOAD section.
8313 * output.h (Output_section::is_noload): New method.
8314 (Output_section::set_is_noload): Ditto.
8315 (Output_section::is_noload_): New data member.
8316 * script-c.h (Script_section_type): New enum type.
8317 (struct Parser_output_section_header): Add new file section_type.
8318 * script-sections.cc (Sections_element::output_section_name): Add
8319 parameter for returning script section type.
8320 (Output_section_definition::output_section_name): Ditto.
8321 (Output_section_definition::section_type)P; New method.
8322 (Output_section_definiton::script_section_type_name): Ditto.
8323 (Output_section_definition::script_section_type_): New data member.
8324 (Output_section_definition::Output_section_definition): Initialize
8325 data member Output_section_definition::script_section_type_.
8326 (Output_section_definition::create_sections): Pass script section type
8327 to Layout::make_output_section_for_script.
8328 (Output_section_definition::output_section_name): Return script
8329 section type to caller.
8330 (Output_section_definition::set_section_address): Do not advance
8331 dot value and load address if section type is NOLOAD. Set address
8332 of NOLOAD sections regardless of section flags.
8333 (Output_section_definition::print): Print section type if it is
8334 not SCRIPT_SECTION_TYPE_NONE.
8335 (Output_section_definition::section_type): New method.
8336 (Output_section_definition::script_section_type_name): Ditto.
8337 (Script_sections::output_section_name): Add new parameter
8338 PSECTION_TYPE for returning script section type. Pass it to
8339 section elements. Handle discard sections.
8340 (Sort_output_sections::operator()): Handle NOLOAD sections.
8341 * script-sections.h (Script_sections::Section_type): New enum type.
8342 (Script_sections::output_section_name): Add a new parameter for
8343 returning script section type.
8344 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8346 * yyscript.y (union): Add new field SECTION_TYPE.
8347 (COPY, DSECT, INFO, NOLOAD): New tokens.
8348 (opt_address_and_section_type): Change type to output_section_header.
8349 (section_type): New non-terminal
8350 (section_header): Handle section type.
8351 (opt_address_and_section_type): Return section type value.
8353 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8355 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8356 * testsuite/plugin_common_test_2.c (foo): Likewise.
8358 2010-04-08 Doug Kwan <dougkwan@google.com>
8360 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8362 * output.cc (Output_section::add_merge_input_section): Simplify
8363 code and return status of Output_merge_base::add_input_section.
8364 Update merge section map only if Output_merge_base::add_input_section
8367 2010-04-07 Doug Kwan <dougkwan@google.com>
8369 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8370 if section is marked as containing instructions but has no mapping
8372 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8373 correct section index.
8374 (Arm_relobj::find_linked_text_section): Ditto.
8376 2010-04-07 Cary Coutant <ccoutant@google.com>
8378 * archive.cc (include_member): Destroy Read_symbols_data object before
8380 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8381 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8382 (Read_symbols_data::~Read_symbols_data) New destructor.
8383 (Section_relocs::Section_relocs) New constructor.
8384 (Section_relocs::~Section_relocs) New destructor.
8385 (Read_relocs_data::Read_relocs_data) New constructor.
8386 (Read_relocs_data::~Read_relocs_data) New destructor.
8387 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8388 pointers to NULL after deleting.
8390 2010-04-07 Doug Kwan <dougkwan@google.com>
8392 * arm.cc: Replace "endianity" with "endianness" in comments.
8393 (Arm_exidx_cantunwind): Ditto.
8394 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8395 (Arm_relobj::merge_flags_and_attributes): New method.
8396 (Arm_relobj::merge_flags_and_attributes_): New data member.
8397 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8398 (Arm_relobj::scan_sections_for_stubs): Ditto.
8399 (Arm_relobj::do_read_symbols): Check to see if we really want to
8400 merge processor-specific flags and attributes. Exit early if
8401 an object is empty except for section names and the undefined symbol.
8402 (Target_arm::do_finalize_sections): Move check for ELF format to
8403 Arm_relobj::do_read_symbols. Merge processor specific flags and
8404 attributes from a regular object only when we have determined that
8405 it is aapropriate. Do not create an .ARM.attributes section in
8406 output if there is no regular input object.
8407 (Target_arm::merge_processor_specific_flags): Check
8408 --warn-mismatch before printing any error.
8409 (Target_arm::merge_object_attributes): Ditto.
8410 * gold.cc (queue_middle_tasks): Handle the case in which there is
8411 no regular object in input.
8412 * options.cc (General_options::parse_EB): New method.
8413 (General_options::parse_EL): Same.
8414 (General_options::General_options): Initialize endianness_.
8415 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8417 (General_options::Endianness): New enum.
8418 (General_options::endianness): New method.
8419 (General_options::endianness_): New data member.
8420 * parameters.cc (Parameters::set_options): Check target endianness.
8421 (Parameters::set_target_once): Ditto.
8422 (Parameters::check_target_endianness): New method.
8423 (parameters_force_valid_target): If either -EL or -EB is specified,
8424 use it to define endianness of default target.
8425 * parameters.h (Parameters::check_target_endianness): New method
8427 * target.h (class Target): Change "endianity" to "endianness"
8430 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8432 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8433 * configure: Regenerate.
8434 * Makefile.in: Regenerate.
8435 * testsuite/Makefile.in: Regenerate.
8437 2010-04-06 Cary Coutant <ccoutant@google.com>
8440 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8441 prevailing definitions of common symbols.
8442 * testsuite/plugin_test_6.sh: New test case.
8443 * testsuite/plugin_common_test_1.c: New test case.
8444 * testsuite/plugin_common_test_2.c: New test case.
8445 * testsuite/Makefile.am (plugin_test_6): New test case.
8446 * testsuite/Makefile.in: Regenerate.
8448 2010-04-06 Nick Clifton <nickc@redhat.com>
8450 * po/vi.po: New Vietnamese translation.
8452 2010-03-30 Doug Kwan <dougkwan@google.com>
8454 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8456 2010-03-25 Doug Kwan <dougkwan@google.com>
8458 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8459 to avoid a conversion warning on a 32-bit host.
8461 2010-03-24 Ian Lance Taylor <iant@google.com>
8463 * testsuite/script_test_3.t: Add a TLS segment.
8464 * testsuite/Makefile.am (check_PROGRAMS): Add
8465 tls_phdrs_script_test.
8466 (tls_phdrs_script_test_SOURCES): Define.
8467 (tls_phdrs_script_test_DEPENDENCIES): Define.
8468 (tls_phdrs_script_test_LDFLAGS): Define.
8469 (tls_phdrs_script_test_LDADD): Define.
8470 * testsuite/Makefile.in: Rebuild.
8472 2010-03-23 Cary Coutant <ccoutant@google.com>
8474 * fileread.cc (find_or_make_view): Fix comment.
8476 2010-03-23 Ian Lance Taylor <iant@google.com>
8478 * script-sections.cc (class Orphan_section_placement): Define
8479 PLACE_TLS and PLACE_TLS_BSS.
8480 (Orphan_section_placement::Orphan_section_placement): Initialize
8482 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8483 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8484 (tls_script_test_SOURCES): Define.
8485 (tls_script_test_DEPENDENCIES): Define.
8486 (tls_script_test_LDFLAGS): Define.
8487 (tls_script_test_LDADD): Define.
8488 * testsuite/Makefile.in: Rebuild.
8490 2010-03-22 Doug Kwan <dougkwan@google.com>
8492 * arm.cc (Arm_relocate_functions::abs8,
8493 Arm_relocate_functions::abs16): Use correct check for overflow
8494 specified in the ARM ELF specs.
8495 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8496 target of a BLX instruction specially.
8497 (Reloc_stub::stub_type_for_reloc): Ditto.
8498 (Relocate::relocate): Use symbolic names instead of numeric relocation
8499 codes to report error.
8500 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8502 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8503 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8504 thumb2_blx_out_of_range.stdout
8505 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8506 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8507 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8508 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8509 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8510 thumb2_blx_in_range, thumb2_blx_in_range.o,
8511 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8512 thumb2_blx_out_of_range.o): New rules.
8513 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
8514 thumb2_blx_in_range and thumb2_blx_out_of_range.
8515 * testsuite/Makefile.in: Regenerate.
8516 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8517 * testsuite/thumb_blx_in_range.s: New file.
8518 * testsuite/thumb_blx_out_of_range.s: New file.
8520 2010-03-22 Rafael Espindola <espindola@google.com>
8522 * archive.cc (Should_include): Move to archive.h.
8523 (should_include_member): Make it a member of Archive.
8525 (Add_lib_group_symbols): New.
8526 * archive.h: Include options.h.
8527 (Archive_member): Moved from Archive.
8528 (Should_include): Moved from archive.cc.
8530 (Add_lib_group_symbols): New.
8531 * dynobj.cc (do_should_include_member): New.
8532 * dynobj.h (do_should_include_member): New.
8533 * gold.cc (queue_initial_tasks): Update call to queue.
8534 * main.cc (main): Print lib group stats.
8535 * object.cc (do_should_include_member): New.
8536 * object.h: Include archive.h.
8537 (Object::should_include_member): New.
8538 (Object::do_should_include_member): New.
8539 (Sized_relobj::do_should_include_member): New.
8540 * options.cc (General_options::parse_start_lib): New.
8541 (General_options::parse_end_lib): New.
8542 (Input_arguments::add_file): Handle lib groups.
8543 (Input_arguments::start_group): Check we are not in a lib.
8544 (Input_arguments::start_lib): New.
8545 (Input_arguments::end_lib): New.
8546 * options.h (General_options): Add start_lib and end_lib.
8547 (Input_argument::lib_): New.
8548 (Input_argument::lib): New.
8549 (Input_argument::is_lib): New.
8550 (Input_file_lib): New.
8551 (Input_arguments::in_lib_): New.
8552 (Input_arguments::in_lib): New.
8553 (Input_arguments::start_lib): New.
8554 (Input_arguments::end_lib_): New.
8555 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8556 in unused members as preempted.
8557 (Sized_pluginobj::do_should_include_member): New.
8558 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8559 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8561 (Read_symbols::do_whole_lib_group): New.
8562 (Read_symbols::do_lib_group): New.
8563 (Read_symbols::do_read_symbols): Handle lib groups.
8564 (Read_symbols::get_name): Handle lib groups.
8565 * readsyms.h (Read_symbols): Add an archive member pointer.
8566 (Read_symbols::do_whole_lib_group): New.
8567 (Read_symbols::do_lib_group): New.
8568 (Read_symbols::member_): New.
8569 * script.cc (read_input_script): Update call to queue_soon.
8571 2010-03-19 Doug Kwan <dougkwan@google.com>
8573 * arm.cc (Stub_table::Stub_table): Initialize new data members
8574 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8575 (Stub_table::add_reloc_stub): Assign stub offset and update
8576 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8577 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8579 (Stub_table::update_data_size_and_addralign): Use
8580 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8581 instead of going over all reloc stubs.
8582 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
8583 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8584 Stringpool_template::offset_ to size of Stringpool_char.
8585 (Stringpool_template::new_key_offset): Remove code to initialize
8586 Stringpool_template::offset_.
8587 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8588 Stringpool_template::offset_ to zero.
8590 2010-03-15 Doug Kwan <dougkwan@google.com>
8592 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8594 (Stringpool_template::new_key_offset): New method.
8595 (Stringpool_template::add_string): Assign offsets when adding new
8597 (Stringpool_template::set_string_offsets): Do not set string offsets
8598 when not optimizing.
8599 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8601 (Chunked_vector::clear): Clear size_.
8602 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8603 (Chunked_vector::size): Return size_.
8604 (Chunked_vector::push_back): Use size_ to find insert position.
8605 (Chunked_vector::size_): New data member.
8606 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8607 (Stringpool_template::new_key_offset): New method declaration.
8608 (Stringpool_template::offset_): New data member.
8610 2010-03-15 Rafael Espindola <espindola@google.com>
8612 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8613 Add_symbols' constructor.
8614 * readsyms.h (Add_symbols): Remove the input_group member.
8616 2010-03-10 Ian Lance Taylor <iant@google.com>
8618 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8619 target to ask whether a reference to a symbol requires a stack
8621 * target.h (Target::is_call_to_non_split): New function.
8622 (Target::do_is_call_to_non_split): Declare virtual function.
8623 * target.cc: Include "symtab.h".
8624 (Target::do_is_call_to_non_split): New function.
8625 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8627 2010-03-10 Cary Coutant <ccoutant@google.com>
8629 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8630 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8631 (File_read::open[2]): Add whole_file_view_ to list of views.
8632 (File_read::make_view): Remove test of whole_file_view_.
8633 (File_read::find_or_make_view): Create whole_file_view_ if
8635 (File_read::clear_views): Replace bool parameter with enum;
8636 adjust all callers. Don't delete views with permanent data;
8637 do delete cached views and views from archives if
8638 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8639 if clearing the corresponding view.
8640 * fileread.h (File_read::Clear_views_mode): New enum.
8641 (File_read::View::is_permanent_view): New method.
8642 (File_read::clear_views): Replace bool parameter
8643 with enum; adjust all callers.
8644 * options.h (General_options): Change keep_files_mapped option;
8645 add map_whole_files.
8646 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8648 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8651 2010-03-10 David S. Miller <davem@davemloft.net>
8653 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8655 2010-03-09 Sriraman Tallam <tmsriram@google.com>
8657 * icf.cc (get_section_contents): Add '@' marker after processing the
8660 2010-03-08 Doug Kwan <dougkwan@google.com>
8662 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8663 due to a conversion warning.
8664 (Arm_relobj::update_output_local_symbol_count): Check for local
8665 symbol with unset output index.
8667 2010-03-05 Ian Lance Taylor <iant@google.com>
8669 * options.h (class General_options): Add --spare-dynamic-tags.
8670 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8671 --spare-dynamic-tags.
8673 2010-03-05 Ian Lance Taylor <iant@google.com>
8675 * incremental.cc: Include "libiberty.h".
8677 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8679 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8680 function, is_info_ member.
8681 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8682 (Versions::Versions): Update caller.
8683 (Versions::define_base_version): Likewise.
8684 (Versions::add_def): Likewise.
8686 2010-03-03 Sriraman Tallam <tmsriram@google.com>
8688 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8689 (Scan::possible_function_pointer_reloc): New function.
8690 (Scan::local_reloc_may_be_function_pointer): Change to call
8691 possible_function_pointer_reloc.
8692 (Scan::global_reloc_may_be_function_pointer): Ditto.
8693 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8694 relocations in ".data.rel.ro._ZTV" section.
8695 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8696 * testsuite/icf_safe_so_test.cc: Ditto.
8697 * testsuite/icf_safe_test.cc: Ditto.
8698 * testsuite/icf_safe_test.sh: Ditto.
8700 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8701 Ian Lance Taylor <iant@google.com>
8703 * target-reloc.h (relocate_section): Check the symbol table index
8704 for -1U before setting the local symbol index.
8705 (scan_relocatable_relocs): If copying the relocation, record that
8706 the local symbol is required.
8707 * object.h (Symbol_value::is_output_symtab_index_set): New
8709 (Symbol_value::may_be_discarded_from_output_symtab): New
8711 (Symbol_value::has_output_symtab_entry): New function.
8712 (Symbol_value::needs_output_symtab_entry): Remove.
8713 (Symbol_value::output_symtab_index): Make sure the symbol index is
8715 (Symbol_value::set_output_symtab_index): Make sure the symbol
8716 index is not set. Make sure the new index is valid.
8717 (Symbol_value::set_must_have_output_symtab_entry): New function.
8718 (Symbol_value::has_output_dynsym_entry): New function.
8719 (Symbol_value::set_output_dynsym_index): Make sure the new index
8721 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8722 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8723 local symbol if permitted.
8724 (Sized_relobj::do_finalize_local_symbols): Call
8725 is_output_symtab_index_set rather than needs_output_symtab_entry.
8726 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8727 rather than needs_output_symtab_entry. Call
8728 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8729 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8730 is_output_symtab_index_set rather than needs_output_symtab_entry.
8731 * testsuite/discard_locals_relocatable_test.c: New file.
8732 * testsuite/discard_locals_test.sh: Test -r.
8733 * testsuite/Makefile.am (check_DATA): Add
8734 discard_locals_relocatable_test1.syms,
8735 discard_local_relocatable_test2.syms.
8736 (MOSTLYCLEANFILES): Likewise. Also add
8737 discard_locals_relocatable_test1.lout and
8738 discard_locals_relocatable_test2.out.
8739 (discard_locals_relocatable_test1.syms): New target.
8740 (discard_locals_relocatable_test.o): New target.
8741 (discard_locals_relocatable_test1.out): New target.
8742 (discard_locals_relocatable_test2.syms): New target.
8743 (discard_locals_relocatable_test2.out): New target.
8744 (various): Add missing ../ld-new dependencies.
8745 * testsuite/Makefile.in: Rebuild.
8747 2010-03-03 Nick Clifton <nickc@redhat.com>
8749 * po/fi.po: New Finnish translation.
8751 2010-03-01 Doug Kwan <dougkwan@google.com>
8753 * layout.cc (Layout::Layout): Force section types of .init_array*,
8754 .preinit_array* and .fini_array* sections.
8755 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8756 Fix check of return value of std::string::find.().
8757 (Output_section::Input_section_sort_compare::operator()): Remove
8758 comment about .init_array.
8759 (Output_section::Input_section_sort_init_fini_compare::operator()):
8761 (Output_section::sort_attached_input_sections): Handle .init_array
8762 and .fini_array specially.
8763 * output.h (Output_section::Inut_section_sort_compare): Update
8765 (Output_section::Input_section_sort_init_fini_compare): New struct.
8767 2010-02-26 Doug Kwan <dougkwan@google.com>
8769 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8770 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8771 * testsuite/debug_msg.sh: Avoid matching source line number for
8772 use of global variable undef_int.
8774 2010-02-26 Doug Kwan <dougkwan@google.com>
8776 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8777 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8778 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8779 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8780 * options.cc (General_options::General_options): Initialize member
8782 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8783 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8784 and rm_no_fix_v4bx.stdout
8785 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8786 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8787 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8788 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8789 and arm_no_fix_v4bx.
8790 * Makefile.in: Regenerate.
8791 * testsuite/arm_fix_v4bx.s: New file.
8792 * testsuite/arm_fix_v4bx.sh: Ditto.
8794 2010-02-24 Doug Kwan <dougkwan@google.com>
8796 * arm.cc (Target_arm::got_section): Make the .got section the first
8797 non RELRO section in the data segment.
8798 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8799 suffixes of section names.
8801 2010-02-24 Doug Kwan <dougkwan@google.com>
8803 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8804 flags and attributes merging if an input file is a binary file.
8805 * fileread.cc (Input_file::open): Record format of original file.
8806 * fileread.h (Input_file::Format): New enum type.
8807 (Input_file::Input_file): Initialize data member format_.
8808 (Input_file::format): New method definition.
8809 (Input_file::format_):: New data member.
8811 2010-02-24 Doug Kwan <dougkwan@google.com>
8813 * arm.cc (Arm_output_data_got): New class.
8814 (ARM_TCB_SIZE): New constant
8815 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8816 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8817 If user uses a script with a SECTIONS clause, issue only a warning
8818 for a misplaced EXIDX input section. Otherwise, issue an error.
8819 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
8821 (Target_arm::got_mode_index_entry): Handle static linking.
8822 (Target_arm::Scan::local): Ditto.
8823 (Target_arm::Scan::global): Ditto.
8824 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8825 all incorrectly implemented relocations.
8826 (Target_arm::fix_exidx_coverage): Pass layout to
8827 Arm_output_section::fix_exidx_coverage.
8828 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8829 from ".ARM.exidx." and ".ARM.extab.".
8831 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8833 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8834 section if it does not already exist.
8835 * attributes.cc (Attributes_section_data::Attributes_section_data):
8836 Don't crash if size is zero.
8838 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8839 Ian Lance Taylor <iant@google.com>
8841 * gold.cc (queue_middle_tasks): If no input files were opened,
8843 * workqueue.h (Task_function::Task_function): Assert that there is
8846 2010-02-22 Doug Kwan <dougkwan@google.com>
8848 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8849 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8850 types to avoid warnings due to different uint64_t implementations
8853 2010-02-21 Doug Kwan <dougkwan@google.com>
8855 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8856 handling of the maximum backward branch offset.
8857 (Arm_relocate_functions::thumb_branch_common): Ditto.
8858 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8859 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
8860 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
8861 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8862 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8863 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8864 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8865 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8866 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8867 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8868 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8869 thumb2_bl_out_of_range.o): New rules.
8870 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8871 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8872 thumb2_bl_out_of_range
8873 * testsuite/Makefile.in: Regenerate.
8874 * testsuite/arm_bl_in_range.s: New file.
8875 * testsuite/arm_bl_out_of_range.s: Ditto.
8876 * testsuite/arm_branch_in_range.sh: Ditto.
8877 * testsuite/arm_branch_range.t: Ditto.
8878 * testsuite/thumb2_branch_range.t: Ditto.
8879 * testsuite/thumb_bl_in_range.s: Ditto.
8880 * testsuite/thumb_bl_out_of_range.s: Ditto.
8881 * testsuite/thumb_branch_range.t: Ditto.
8883 2010-02-20 Sriraman Tallam <tmsriram@google.com>
8885 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8886 Add reloc offset information.
8887 * icf.cc (get_section_contents): Change iterators to point to the new
8888 vectors. Add reloc offset information to the contents.
8889 * icf.h (Icf::Sections_reachable_info): New typedef.
8890 (Icf::Sections_reachable_list): New typedef.
8891 (Icf::Offset_info): New typedef.
8892 (Icf::Reloc_info): New struct typedef.
8893 (Icf::Reloc_info_list): New typedef.
8894 (Icf::symbol_reloc_list): Delete method.
8895 (Icf::addend_reloc_list): Delete method.
8896 (Icf::section_reloc_list): Delete method.
8897 (Icf::reloc_info_list): New method.
8898 (Icf::reloc_info_list_): New member.
8900 2010-02-19 Doug Kwan <dougkwan@google.com>
8902 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8903 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8904 * arm.cc (Arm_relocation_functions): New forward declaration.
8905 (Target_arm::Target_arm): Initialize new data members
8906 got_mod_index_offset_ and tls_base_symbol_defined_.
8907 (Target_arm::Relocate::relocate_tls): New method.
8908 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8909 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8911 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
8912 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8913 (Target_arm::got_mod_index_offset_,
8914 Target_arm::tls_base_symbol_defined_): New data members.
8915 (Target_arm::Scan::local, Target::Scan::global,
8916 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8919 2010-02-18 Doug Kwan <dougkwan@google.com>
8921 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8922 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8923 text section as a parameter becuase some broken tools may not set
8924 the link in section header.
8925 (Target_arm::has_got_section): New method.
8926 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8927 without any mapping symbol as data only. Remove warning.
8928 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8929 link in its section header, try to discover the link by inspecting the
8930 REL31 relocation at the beginning of the section.
8931 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8933 (Target_arm::Scan::global): Treat any reference to the symbol
8934 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8936 2010-02-12 Sriraman Tallam <tmsriram@google.com>
8938 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8939 (Scan::global_reloc_may_be_function_pointer): New function.
8940 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8941 (Scan::global_reloc_may_be_function_pointer): New function.
8942 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8943 (Scan::global_reloc_may_be_function_pointer): New function.
8944 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8945 (Scan::global_reloc_may_be_function_pointer): New function.
8946 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8947 (Scan::global_reloc_may_be_function_pointer): New function.
8948 (Scan::possible_function_pointer_reloc): New function.
8949 (Target_x86_64::can_check_for_function_pointers): New function.
8950 * gc.h (gc_process_relocs): Scan relocation types to determine if
8951 function pointers were taken for targets that support it.
8952 * icf.cc (Icf::find_identical_sections): Include functions for
8953 folding in safe ICF whose pointer is not taken.
8954 * icf.h (Secn_fptr_taken_set): New typedef.
8955 (fptr_section_id_): New member.
8956 (section_has_function_pointers): New function.
8957 (set_section_has_function_pointers): New function.
8958 (check_section_for_function_pointers): New function.
8959 * options.h: Fix comment for safe ICF option.
8960 * target.h (can_check_for_function_pointers): New function.
8961 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8962 Modify icf_safe_test for X86-64.
8963 * testsuite/Makefile.in: Regenerate.
8964 * testsuite/icf_safe_so_test.cc: New file.
8965 * testsuite/icf_safe_so_test.sh: New file.
8966 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8967 (main): Change to take pointer to function kept_func_3.
8968 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8969 folding is done correctly for X86-64.
8971 2010-02-12 David S. Miller <davem@davemloft.net>
8973 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8974 is_symbolless parameter.
8975 (Output_reloc<SHT_REL>::is_symbolless): New.
8976 (Output_reloc<SHT_REL>::is_symbolless_): New.
8977 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8978 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8979 (Output_reloc<SHT_RELA>::is_symbolless): New.
8980 (Output_data_reloc::add_global): Handle is_symbolless.
8981 (Output_data_reloc::add_global_relative): Likewise.
8982 (Output_data_reloc::add_local): Likewise.
8983 (Output_data_reloc::add_local_relative): Likewise.
8984 (Output_data_reloc::add_symbolless_global_addend): New.
8985 (Output_data_reloc::add_symbolless_local_addend): New.
8986 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8988 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8989 instead of ->is_relative_
8990 (Output_reloc::write): Likewise.
8991 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8992 (Output_reloc::write_rel): Simplify.
8994 * sparc.cc (Target_sparc::Scan::local): Use
8995 ->add_symbolless_local_addend as needed.
8996 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8997 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8998 based upon relocation offset.
9000 2010-02-11 Doug Kwan <dougkwan@google.com>
9002 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9003 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9004 beginning of function.
9005 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9006 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9007 parameter is_32bit in calls to should_apply_static_reloc.
9008 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9009 (check_DATA): Add arm_abs_global.stdout.
9010 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9011 arm_abs_global.stdout): New rules.
9012 (MOSTLLYCLEANFILES): Add arm_abs_global
9013 * Makefile.in: Regenerate.
9014 * testsuite/arm_abs_global.s: New file.
9015 * testsuite/arm_abs_global.sh: Ditto.
9016 * testsuite/arm_abs_lib.s: Ditto.
9018 2010-02-11 Ian Lance Taylor <iant@google.com>
9020 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9022 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9023 Allocate_commons_task first.
9024 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9025 task, rather than symtab_lock_.
9026 (Gc_process_relocs::~Gc_process_relocs): New function.
9027 (Gc_process_relocs::is_runnable): Check this_blocker_.
9028 (Gc_process_relocs::locks): Use next_blocker_ rather than
9030 (Scan_relocs::~Scan_relocs): New function.
9031 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9033 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9035 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9036 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9037 constructor accordingly.
9038 (class Gc_process_relocs): Likewise.
9039 (class Scan_relocs): Likewise.
9040 * common.h (class Allocate_commons_task): Remove symtab_lock_
9041 field, and corresponding constructor parameter.
9042 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9044 (Allocate_commons_task::locks): Likewise.
9046 2010-02-11 Ian Lance Taylor <iant@google.com>
9048 * gold-threads.h (class Once): Define.
9049 (class Initialize_lock): Rewrite as child of Once.
9050 * gold-threads.cc (class Once_initialize): Define.
9051 (once_pointer_control): New static variable.
9052 (once_pointer, once_arg): New static variables.
9053 (c_run_once): New static function.
9054 (Once::Once, Once::run_once, Once::internal_run): New functions.
9055 (class Initialize_lock_once): Remove.
9056 (initialize_lock_control): Remove.
9057 (initialize_lock_pointer): Remove.
9058 (initialize_lock_once): Remove.
9059 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9060 (Initialize_lock::initialize): Rewrite.
9061 (Initialize_lock::do_run_once): New function.
9062 * archive.cc (Archive::interpret_header): Only clear name if it is
9064 * fileread.cc: Include "gold-threads.h"
9065 (file_counts_lock): New static variable.
9066 (file_counts_initialize_lock): Likewise.
9067 (File_read::release): Only increment counts when using --stats.
9068 Use a lock around the increment.
9069 * parameters.cc (class Set_parameters_target_once): Define.
9070 (set_parameters_target_once): New static variable.
9071 (Parameters::Parameters): Move here from parameters.h.
9072 (Parameters::set_target): Rewrite.
9073 (Parameters::set_target_once): New function.
9074 (Parameters::clear_target): Move here and rewrite.
9075 * parameters.h (class Parameters): Update declarations. Add
9076 set_parameters_target_once_ field.
9077 (Parameters::Parameters): Move to parameters.cc.
9078 (Parameters::clear_target): Likewise.
9079 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9081 (Start_group::~Start_group): New function.
9082 (Start_group::is_runnable): New function.
9083 (Start_group::locks, Start_group::run): New functions.
9084 (Finish_group::run): Change saw_undefined to size_t.
9085 * readsyms.h (class Start_group): Define.
9086 (class Finish_group): Change saw_undefined_ field to size_t.
9087 (Finish_group::Finish_group): Remove saw_undefined and
9088 this_blocker parameters. Change all callers.
9089 (Finish_group::set_saw_undefined): New function.
9090 (Finish_group::set_blocker): New function.
9091 * symtab.h (class Symbol_table): Change saw_undefined to return
9092 size_t. Change saw_undefined_ field to size_t.
9093 * target-select.cc (Set_target_once::do_run_once): New function.
9094 (Target_selector::Target_selector): Initialize set_target_once_
9095 field. Don't initialize lock_ and initialize_lock_ fields.
9096 (Target_selector::instantiate_target): Rewrite.
9097 (Target_selector::set_target): New function.
9098 * target-select.h (class Set_target_once): Define.
9099 (class Target_selector): Update declarations. Make
9100 Set_target_once a friend. Remove lock_ and initialize_lock_
9101 fields. Add set_target_once_ field.
9103 2010-02-10 Ian Lance Taylor <iant@google.com>
9105 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9107 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9108 (queue_middle_tasks): Add all blockers before queueing any tasks.
9109 (queue_final_tasks): Likewise.
9110 * token.h (Task_token::add_blockers): New function.
9111 * object.h (Input_objects::number_of_relobjs): New function.
9113 2010-02-10 Ian Lance Taylor <iant@google.com>
9115 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9116 shared, not if not position independent.
9117 * x86_64.cc (Relocate::relocate_tls): Likewise.
9118 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9119 (tls_pie_pic_test): New target.
9120 * testsuite/Makefile.in: Rebuild.
9122 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9123 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9124 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9125 * testsuite/Makefile.in: Rebuild.
9127 2010-02-09 David S. Miller <davem@davemloft.net>
9129 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9130 R_SPARC_RELATIVE using ->add_local_relative().
9131 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9133 * output.h (Output_data_dynamic::add_section_size): New method
9134 that takes two Output_data objects.
9135 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9136 entry param. Handle it in initializers.
9137 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9138 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9139 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9141 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9142 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9143 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9144 for dynrel_includes_plt.
9145 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9146 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9147 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9149 (Target_sparc::do_finalize_sections): Update to pass true for
9150 dynrel_includes_plt.
9151 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9152 output before .rela.plt
9153 (Target_powerpc::do_finalize_sections): Update to pass true for
9154 dynrel_includes_plt when 32-bit.
9156 2010-02-08 Doug Kwan <dougkwan@google.com>
9158 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9160 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9161 Arm_relobj::scan_section_for_cortex_a8_stubs,
9162 Arm_relobj::do_relocation_section): Instead of calling
9163 Output_section::output_address, use faster
9164 Arm_relobj::simple_input_section_output_address.
9166 2010-02-08 David S. Miller <davem@davemloft.net>
9168 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9169 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9170 relocation helper function.
9172 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9173 just like R_SPARC_GOT{10,13,22}.
9174 (Target_sparc::Scan::local): Likewise.
9175 (Target_sparc::Relocate:relocate): Likewise.
9177 2010-02-06 Ian Lance Taylor <iant@google.com>
9179 * configure.ac: Rewrite targetobjs duplicate removal code to use
9180 only shell constructs.
9181 * configure: Rebuild.
9183 2010-02-05 Doug Kwan <dougkwan@google.com>
9186 * arm.cc (Arm_relobj::section_is_scannable): New method.
9187 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9188 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9190 2010-02-04 Doug Kwan <dougkwan@google.com>
9193 * arm-reloc-property.cc (cstdio): Include.
9194 * configure.ac (targetobjs): Remove duplicates.
9195 * configure: Regenerate.
9196 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9197 big and little endian version for a given address size.
9199 2010-02-03 Doug Kwan <dougkwan@google.com>
9201 * arm-reloc-property.cc
9202 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9204 * arm-reloc-property.h
9205 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9206 New method definition.
9207 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9209 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9211 (GOT_PREL): Change implemented to Y.
9212 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9213 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9214 (Arm_relocate_functions::movw_abs_nc): Remove method.
9215 (Arm_relocate_functions::movt_abs): Ditto.
9216 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9217 (Arm_relocate_functions::thm_movt_abs): Ditto.
9218 (Arm_relocate_functions::movw_rel_nc): Ditto.
9219 (Arm_relocate_functions::movw_rel): Ditto.
9220 (Arm_relocate_functions::movt_rel): Ditto.
9221 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9222 (Arm_relocate_functions:thm_movw_rel): Ditto.
9223 (Arm_relocate_functions:thm_movt_rel): Ditto.
9224 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9225 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9226 New method definitions.
9227 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9228 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9229 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9230 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9231 (Target_arm::Relocate::relocate): Check for non-static or
9232 unimplemented relocation code and exit early. Change calls to
9233 Target_arm::reloc_uses_thumb_bit and
9234 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9235 instead. Refactor code to handle similar relocations to increase
9236 code sharing. Remove check for unsupported relocation code in switch
9238 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9239 relocation property table to find out size. Change error message to
9240 print out the name of a relocation code instead of the numeric value.
9241 (Target_arm::scan_reloc_for_stub): Use relocation property table
9242 instead of calling Target_arm::reloc_uses_thumb_bit().
9244 2010-02-02 Doug Kwan <dougkwan@google.com>
9246 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9247 types of relaxed input section.
9249 2010-02-02 Doug Kwan <dougkwan@google.com>
9251 * Makefile.am (HFILES): Add arm-reloc-property.h.
9253 (TARGETSOURCES): Add arm-reloc-property.cc
9254 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
9255 (libgold_a_SOURCES): $(DEFFILES)
9256 * Makefile.in: Regenerate.
9257 * arm-reloc-property.cc: New file.
9258 * arm-reloc-property.h: New file.
9259 * arm-reloc.def: New file.
9260 * arm.cc: Update comments.
9261 (arm-reloc-property.h): New included header.
9262 (arm_reloc_property_table): New global variable.
9263 (Target_arm::do_select_as_default_target): New method definition.
9264 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9265 arm-reloc-property to targ_extra_obj.
9266 * parameters.cc (set_parameters_target): Call
9267 Target::select_as_default_target().
9268 * target.h (Target::select_as_default_target): New method definition.
9269 (Target::do_select_as_default_target): Same.
9271 2010-02-01 Doug Kwan <dougkwan@google.com>
9273 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9274 first_output_text_section_.
9275 (Arm_exidx_fixup::first_output_text_section): New method definition.
9276 (Arm_exidx_fixup::first_output_text_section_): New data member.
9277 (Arm_exidx_fixup::process_exidx_section): Record the first text
9278 output section seen.
9279 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9280 and entsize in output section header.
9282 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9284 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9285 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9286 (Arm_relocate_functions::thm_alu11): New Method.
9287 (Arm_relocate_functions::thm_pc8): New Method.
9288 (Arm_relocate_functions::thm_pc12): New Method.
9289 (Target_arm::Scan::local): Handle the relocations.
9290 (Target_arm::Scan::global): Likewise.
9291 (Target_arm::Relocate::relocate): Likewise.
9292 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9294 2010-01-29 Doug Kwan <dougkwan@google.com>
9296 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9297 of relocation types as ld.
9299 2010-01-29 Doug Kwan <dougkwan@google.com>
9301 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9303 (Arm_relocate_functions::thumb_branch_common): Ditto.
9304 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9305 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9306 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9307 Arm_relocate_functions::jump24): Remove.
9308 (Target_arm::Relocate::relocate): Adjust code to call
9309 Arm_relocation_functions::arm_branch_common and
9310 Arm_relocation_functions::thumb_branch_common instead of their removed
9311 wrappers. Merge switch-cases together to reduce source code size.
9313 2010-01-29 Doug Kwan <dougkwan@google.com>
9315 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9316 output_local_symbol_count_needs_update_.
9317 (Arm_relobj::output_local_symbol_count_needs_update,
9318 Arm_relobj::set_output_local_symbol_count_needs_update,
9319 Arm_relobj::update_output_local_symbol_count): New methods.
9320 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9322 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9323 of pointed function as in a R_ARM_PREL31 relocation.
9324 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9325 for output local symbol count updating.
9326 (Target_arm::do_relax): Update output local symbol counts in objects
9328 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9330 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9332 * arm.cc: Added support for the ARM relocations:
9333 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9334 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9335 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9337 (Arm_relocate_functions::movw_rel): New method.
9338 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9339 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9341 (Arm_relocate_functions::thm_movw_rel): New method.
9342 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9344 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9346 (Target_arm::Scan::global): Likewise.
9347 (Target_arm::Relocate::relocate): Likewise.
9348 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9351 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9353 * arm.cc: Added support for ARM group relocations.
9354 (Target_arm::reloc_needs_sym_origin): New method.
9355 (Arm_relocate_functions::calc_grp_kn): New method.
9356 (Arm_relocate_functions::calc_grp_residual): New method.
9357 (Arm_relocate_functions::calc_grp_gn): New method.
9358 (Arm_relocate_functions::arm_grp_alu): New Method.
9359 (Arm_relocate_functions::arm_grp_ldr): New Method.
9360 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9361 (Arm_relocate_functions::arm_grp_ldc): New Method.
9362 (Target_arm::Scan::local): Handle the ARM group relocations.
9363 (Target_arm::Scan::global): Likewise.
9364 (Target_arm::Relocate::relocate): Likewise.
9365 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9368 2010-01-26 Doug Kwan <dougkwan@google.com>
9370 * arm.cc (set): Include.
9371 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9373 (Arm_output_section::Text_section_list): New type.
9374 (Arm_output_section::append_text_sections_to_list): New method.
9375 (Arm_output_section::fix_exidx_coverage): Ditto.
9376 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
9377 (Arm_relobj::convert_input_section_to_relaxed_section): Use
9378 Relobj::set_section_offset() instead of
9379 Sized_relobj::invalidate_section_offset().
9380 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
9381 parameter for section headers. Ignore relocation sections for
9382 unallocated sections and EXIDX sections.
9383 (Target_arm::fix_exidx_coverage): New method.
9384 (Target_arm::output_section_address_less_than): New type.
9385 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9386 linked text section instead of the EXIDX section.
9387 (Arm_output_section::create_stub_group): Add an assertion to check
9388 that this is not an EXIDX output section.
9389 (Arm_output_section::append_text_sections_to_list): New method.
9390 (Arm_output_section::fix_exidx_coverage): Ditto.
9391 (Arm_relobj::scan_sections_for_stubs): Adjust call to
9392 Arm_relobj::section_needs_reloc_stub_scanning.
9393 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9395 (Target_arm::fix_exidx_coverage): New method.
9396 * object.h (Relobj::set_output_section): New method.
9397 (Sized_relobj::invalidate_section_offset): Remove method.
9398 (Sized_relobj::do_invalidate_section_offset): Remove method.
9399 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9401 2010-01-25 Doug Kwan <dougkwan@google.com>
9403 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9404 Fix warning due to signed and unsigned comparison on a 32-bit host.
9406 2010-01-22 Doug Kwan <dougkwan@google.com>
9408 * arm.cc (Target_arm::do_relax): Record an output section for section
9409 offset adjustment it contains any stub table that has changed.
9410 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9411 offsets in an output section if necessary.
9412 * output.cc (Output_section::Output_section): Initialize
9413 section_offsets_need_adjustments_.
9414 (Output_section::add_input_section_for_script): Renamed to
9415 Output_section::add_simple_input_section.
9416 (Output_section::save_states): Add a comment.
9417 (Output_section::discard_states): New method defintion.
9418 (Output_section::adjust_section_offsets): Same.
9419 * output.h (Output_section::add_input_section_for_script): Renamed to
9420 Output_section::add_simple_input_section.
9421 (Output_section::discard_states): New method declaration.
9422 (Output_section::adjust_section_offsets): Same.
9423 (Output_section::section_offsets_need_adjustment,
9424 Output_section::set_section_offsets_need_adjustment): New method
9426 (Output_section::section_offsets_need_adjustment_): New data member.
9427 * script-sections.cc
9428 (Output_section_element_input::set_section_address): Adjust code for
9429 renaming of Output_section::add_input_section_for_script.
9430 (Orphan_output_section::set_section_address): Same.
9432 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9434 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9435 Fix_v4bx enum values .
9436 * gold/options.h (General_options): New option definitions.
9437 (General_options::fix_v4bx): New method.
9438 (General_options::Fix_v4bx): New enum.
9439 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9440 (General_options::parse_fix_v4bx_interworking): New method.
9442 2010-01-22 Doug Kwan <dougkwan@google.com>
9444 * arm.cc (Arm_exidx_fixup): New class.
9446 2010-01-21 Doug Kwan <dougkwan@google.com>
9448 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9450 (Arm_exidx_section_offset_map): New type.
9452 2010-01-21 Doug Kwan <dougkwan@google.com>
9454 * arm.cc (Arm_exidx_input_section): New class.
9455 (Arm_relobj::exidx_input_section_by_link,
9456 Arm_relobj::exidx_input_section_by_shndx,
9457 Arm_relobj::make_exidx_input_section): New methods.
9458 (read_arm_attributes_section): Remove.
9459 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9460 information about them.
9461 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9464 2010-01-20 Doug Kwan <dougkwan@google.com>
9466 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9467 Input_section_specifier to Section_id.
9468 (Target_arm::new_arm_input_section: Adjust code for change of key
9470 (Target_arm::find_arm_input_section): Ditto.
9471 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9472 (Section_id): Remove.
9473 (Garbage_collection::Section_id_hash): Remove.
9474 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9475 (Section_id): Remove.
9476 (Icf::Section_id_hash): Remove.
9477 * object.h (Section_id, Const_section_id, Section_id_hash,
9478 Const_section_id_hash): New type definitions.
9479 * output.cc (Output_section::add_relaxed_input_section): Change to
9480 use Const_section_id instead of Input_section_specifier as key type.
9481 (Output_section::add_merge_input_section): Ditto.
9482 (Output_section::build_relaxation_map): Change to use Section_id
9483 instead of Input_section_specifier as key type.
9484 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9486 (Output_section::convert_input_sections_to_relaxed_sections): Change
9487 to use Const_section_id instead of Input_section_specifier as key type.
9488 (Output_section::find_merge_section): Ditto.
9489 (Output_section::find_relaxed_input_section): Ditto.
9490 * output.h (Input_section_specifier): Remove class.
9491 (Output_section::Output_section_data_by_input_section_map): Change
9492 key type to Const_section_id.
9493 (Output_section::Output_relaxed_input_section_by_input_section_map):
9495 (Output_section::Relaxation_map): Change key type to Section_id.
9497 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9499 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9500 (class Arm_v4bx_stub): New class.
9501 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9502 (Stub_factory::make_arm_v4bx_stub): New method.
9503 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9504 (Stub_table::empty): Handle v4bx stubs.
9505 (Stub_table::add_arm_v4bx_stub): New method.
9506 (Stub_table::find_arm_v4bx_stub): New method.
9507 (Arm_relocate_functions::v4bx): New method.
9508 (Target_arm::fix_v4bx): New method.
9509 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9510 (Stub_table::relocate_stubs): Likewise.
9511 (Stub_table::do_write): Likewise.
9512 (Stub_table::update_data_size_and_addralign): Likewise.
9513 (Stub_table::finalize_stubs): Likewise.
9514 (Target_arm::Scan::local): Likewise.
9515 (Target_arm::Scan::global): Likewise.
9516 (Target_arm::do_finalize_sections): Likewise.
9517 (Target_arm::Relocate::relocate): Likewise.
9518 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9520 (Target_arm::scan_reloc_for_stub): Likewise.
9521 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9523 2010-01-19 Ian Lance Taylor <iant@google.com>
9525 * output.cc (Output_section_headers::do_sized_write): Write large
9526 segment count to sh_info field.
9527 (Output_file_header::do_sized_write): For large segment count,
9528 write PN_XNUM to e_phnum field.
9530 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9532 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9533 (Arm_relocate_functions::thm_jump8): New function.
9534 (Arm_relocate_functions::thm_jump11): New function.
9535 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9537 (Target_arm::Scan::global): Likewise.
9538 (Target_arm::Relocate::relocate): Likewise.
9539 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9542 2010-01-14 Doug Kwan <dougkwan@google.com>
9544 * arm.cc (map, utility): Include headers.
9545 (Target_arm::apply_cortex_a8_workaround): New method.
9546 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9547 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9548 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9549 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9550 the --[no-]fix-cortex-a8 command line options.
9551 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9552 (Target_arm::relocate_stub): Use addend in instruction template.
9553 * options.h (DEFINE_bool): Set the user-set flag.
9554 (General_options): Add --[no-]-fix-cortex options.
9555 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
9556 : Update fast look-up map after conversion.
9558 2010-01-14 Sriraman Tallam <tmsriram@google.com>
9560 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9561 in the first pass of do_layout.
9563 2010-01-13 Doug Kwan <dougkwan@google.com>
9565 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9566 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9567 apparent compiler problem of not folding static constant integral
9568 data members of elfcpp::Elf_sizes<32>.
9570 2010-01-13 Doug Kwan <dougkwan@google.com>
9572 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9573 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9574 Arm_relobj::scan_section_for_cortex_a8_erratum,
9575 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9576 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9577 sections to scan for relocation stubs into a new method
9578 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9579 relocation and Cortex-A8 stub scanning.
9580 (Target_arm::do_relax): Force stubs to be after stubbed sections
9581 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
9582 the beginning of a new relaxation pass. Update a comment.
9583 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9585 2010-01-12 Ian Lance Taylor <iant@google.com>
9587 * target-reloc.h (visibility_error): New inline function.
9588 (relocate_section): Call visibility_error.
9589 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9590 (MOSTLYCLEANFILES): Likewise.
9591 (protected_4_pic.o, protected_3.err): New targets.
9592 * testsuite/protected_4.cc: New file.
9594 2010-01-12 Doug Kwan <dougkwan@google.com>
9596 * arm.cc (Cortex_a8_reloc): New class.
9597 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9598 and cortex_a8_relocs_info_.
9599 (Target_arm::fix_cortex_a8): New method definition.
9600 (Target_arm::Cortex_a8_relocs_info): New type.
9601 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9602 New data member declarations.
9603 (Target_arm::scan_reloc_for_stub): Record information about
9604 relocations for THUMB branches that might be exempted from the
9605 Cortex-A8 workaround.
9606 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9607 at the beginning of a relaxation pass.
9609 2010-01-12 Doug Kwan <dougkwan@google.com>
9611 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9612 (Arm_relobj::Mapping_symbol_position,
9613 Arm_reloj::Mapping_symbol_position_less,
9614 Arm_relobj::Mapping_symbols_info): New types.
9615 (Target_arm::is_mapping_symbol_name): New method definition.
9616 (Arm_relobj::do_count_local_symbols): Save information about mapping
9619 2010-01-11 Doug Kwan <dougkwan@google.com>
9621 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9622 Arm_relocate_functions::thumb32_branch_upper,
9623 Arm_relocate_functions::thumb32_branch_lower,
9624 Arm_relocate_functions::thumb32_cond_branch_offset,
9625 Arm_relocate_functions::thumb32_cond_branch_upper,
9626 Arm_relocate_functions::thumb32_cond_branch_lower,
9627 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9628 branch offset encoding.
9629 (Arm_relocate_functions::thumb_branch_common): Use new branch
9630 offset encoding methods to avoid code duplication.
9631 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9632 (Stub_addend_reader::operator()): Use new branch encoding method
9633 to avoid code duplication.
9635 2010-01-11 Doug Kwan <dougkwan@google.com>
9637 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9638 (Target_arm::do_finalize_sections): Define special EXIDX section
9639 symbols only if referenced.
9640 * gc.h (Garbage_collection::add_reference): New method.
9641 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9644 2010-01-11 Ian Lance Taylor <iant@google.com>
9646 * script.cc (Version_script_info::build_expression_list_lookup):
9647 Change complaing about duplicate wildcard match from error to
9650 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9652 (Version_script_info::Version_script_info): Initialize globs_,
9653 default_version_, default_is_global_, and exact_. Don't
9654 initialize globals_ or locals_.
9655 (Version_script_info::build_lookup_tables): Build local symbols
9657 (Version_script_info::unquote): New function.
9658 (Version_script_info::add_exact_match): New function.
9659 (Version_script_info::build_expression_list_lookup): Remove lookup
9660 parameter. Add is_global parameter. Change all callers. Handle
9661 wildcard pattern specially. Unquote pattern. Call
9663 (Version_script_info::get_name_to_match): New function.
9664 (Version_script_info::get_symbol_version): New function.
9665 (Version_script_info::get_symbol_version_helper): Remove.
9666 (Version_script_info::check_unmatched_names): Call unquote.
9667 * script.h (class Version_script_info): Change get_symbol_version
9668 to be non-inline and add is_global parameter; change all callers.
9669 Rewrite symbol_is_local. Update declarations. Define struct
9670 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9671 Remove globals_ and locals_ members. Add exact_, globs_,
9672 default_version_, is_global_.
9673 (Version_script_info::Glob): Remove pattern, add expression and
9674 is_global. Update constructor. Change all callers.
9675 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9677 (Versions::symbol_section_contents): If a symbol is undefined, or
9678 defined in a dynamic object, set the version index to
9680 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9682 (Symbol_table::add_from_pluginobj): Likewise.
9683 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9685 2010-01-11 Doug Kwan <dougkwan@google.com>
9687 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9688 (incremental_dump_LDADD): Add linking option for libintl.
9689 * Makefile.in: Regenerate.
9691 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9694 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9696 * testsuite/Makefile.in: Regenerated.
9698 2010-01-10 Doug Kwan <dougkwan@google.com>
9700 * options.h (DEFINE_var): Use parentheses around argument varname__
9701 in macro body to avoid any unintended subsequent substitutions.
9703 2010-01-10 Ian Lance Taylor <iant@google.com>
9705 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9706 candidates before doing symbol resolution.
9708 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9709 ODR candidates if only one is weak.
9711 2010-01-08 Ian Lance Taylor <iant@google.com>
9713 * script.cc (Version_script_info::build_expression_list_lookup):
9714 Don't warn about ambiguous version, just record the ambiguity.
9715 (Version_script_info::get_symbol_version_helper): Give error if
9716 version is ambiguous.
9718 2010-01-08 Doug Kwan <dougkwan@google.com>
9720 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
9721 prev_data_size_ and prev_addralign_. Remove initializer for
9722 deleted data member has_been_changed_.
9723 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9724 to determine if the table is empty.
9725 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9727 (Stub_table::add_reloc_stub): Define method in class definition
9728 instead of just declaring it there.
9729 (Stub_table::add_cortex_a8_stub): New method definition.
9730 (Stub_table::update_data_size_and_addralign): Ditto.
9731 (Stub_table::finalize_stubs): Ditto.
9732 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9733 (Stub_table::do_addralign_): Return address alignment in the
9734 (Stub_table::do_reset_address_and_file_offset): Define method in
9735 class definition instead of declaring it there. Set current data
9736 size to be the data size of the previous pass.
9737 (Stub_table::set_final_data_size): Use current data size as the
9739 (Stub_table::relocate_stub): Change parameter type of stub from
9740 Reloc_stub pointer to Stub pointer.
9741 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9742 (Stub_table::Cortex_a8_stub_list): New typedef.
9743 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9744 Stub_table::prev_addralign_): New data member.
9745 (Arm_relobj::Arm_relobj): Initialize data member
9746 section_has_cortex_a8_workaround_.
9747 (Arm_relobj::section_has_cortex_a8_workaround,
9748 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9750 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9752 (Target_arm::relocate_stub): Change parameter type of stub from
9753 Reloc_stub pointer to Stub pointer.
9754 (Insn_template::size, Insn_template::alignment): Handle
9755 THUMB16_SPECIAL_TYPE.
9756 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9757 Stub_table::update_data_size_and_addralign,
9758 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9760 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9761 (Stub_table::do_write): Ditto.
9762 (Target_arm::do_relax): Adjust code for changes in Stub_table.
9764 2010-01-08 Ian Lance Taylor <iant@google.com>
9767 * symtab.h (class Symbol): Remove fields is_target_special_ and
9768 has_plt_offset_. Add field is_defined_in_discarded_section_.
9769 (Symbol::is_defined_in_discarded_section): New function.
9770 (Symbol::set_is_defined_in_discarded_section): New function.
9771 (Symbol::has_plt_offset): Rewrite.
9772 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9773 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9774 Don't initialize is_target_special_ or has_plt_offset_.
9775 Initialize is_defined_in_discarded_section_.
9776 (Symbol_table::add_from_relobj): If appropriate, set
9777 is_defined_in_discarded_section.
9778 * resolve.cc (Symbol::override_base_with_special): Don't test
9779 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9780 * target-reloc.h (relocate_section): Do special handling for
9781 symbols defined in discarded sections for global symbols as well
9784 2010-01-08 Ian Lance Taylor <iant@google.com>
9786 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9787 the SHT_SYMTAB case.
9789 2010-01-08 Ian Lance Taylor <iant@google.com>
9791 * object.cc (Sized_relobj::do_layout): Don't get confused if
9792 layout_eh_frame returns NULL.
9794 2010-01-08 Ian Lance Taylor <iant@google.com>
9797 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9798 dynamic symbol table, use the normal symbol table.
9799 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9802 2010-01-08 Ian Lance Taylor <iant@google.com>
9805 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9808 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9810 * version.cc (print_version): Change to "Copyright 2010".
9812 2010-01-08 Ian Lance Taylor <iant@google.com>
9816 * i386.cc (class Target_i386): Change return type of plt_section
9818 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9819 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9820 tls_desc_rel_ field.
9821 (Output_data_plt_i386::rel_tls_desc): New function.
9822 (Target_i386::rel_tls_desc_section): New function.
9823 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9824 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9825 R_386_TLS_DESC reloc in rel_tls_desc_section.
9826 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9827 Define struct Tlsdesc_info.
9828 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9829 (Target_x86_64::do_reloc_symbol_index): New function.
9830 (Target_x86_64::add_tlsdesc_info): New function.
9831 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9832 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9834 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9836 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9837 (Target_x86_64::rela_tlsdesc_section): New function.
9838 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9840 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9841 (Target_x86_64::do_reloc_addend): New function.
9842 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9843 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9844 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9845 (Output_reloc::type): New function.
9846 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9847 (Output_reloc::is_target_specific): New function.
9848 (Output_reloc::target_arg): New function.
9849 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9850 absolute relocs and target specific relocs.
9851 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9852 add_target_specific.
9853 (class Output_data_reloc) [SHT_RELA]: Likewise.
9854 * output.cc (Output_reloc::Output_reloc): Add four new versions
9855 for absolute relocs and target specific relocs.
9856 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9857 (Output_reloc::get_symbol_index): Likewise.
9858 (Output_reloc::local_section_offset): Check that local_sym_index_
9859 is not TARGET_CODE or 0.
9860 (Output_reloc::symbol_value): Likewise.
9861 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9863 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9864 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9866 * layout.cc (add_target_dynamic_tags): Use output section for
9867 DT_PLTRELSZ and DT_JMPREL.
9869 2010-01-07 Ian Lance Taylor <iant@google.com>
9872 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9874 (class Output_data_reloc_generic): Define.
9875 (class Output_data_reloc_base): Change base class to
9876 Output_data_reloc_generic. Change add() method to call
9877 bump_relative_reloc_count for a relative reloc. Remove
9879 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9881 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9882 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9884 * layout.h (class Layout): Update declaration.
9886 2010-01-07 Ian Lance Taylor <iant@google.com>
9888 * output.h (class Output_data): Add const version of
9889 output_section and do_output_section.
9890 (class Output_section_data): Add const version of
9892 (class Output_section): Likewise.
9893 * layout.cc (Layout::add_target_dynamic_tags): New function.
9894 * layout.h (class Layout): Update declarations.
9895 * arm.cc (Target_arm::do_finalize_sections): Use
9896 add_target_dynamic_tags.
9897 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9898 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9899 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9900 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9902 2010-01-07 Ian Lance Taylor <iant@google.com>
9905 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9908 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9909 Ian Lance Taylor <iant@google.com>
9912 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9913 Xindex::read_symtab_xindex.
9915 2010-01-07 Doug Kwan <dougkwan@google.com>
9917 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9918 (Insn_template::thumb16_bcond_insn): New method declaration.
9919 (Insn_template): Fix spelling.
9920 (Stub::thumb16_special): New method declaration.
9921 (Stub::do_write): Define virtual method which was previously pure
9923 (Stub::do_thumb16_special): New method declaration.
9924 (Stub::do_fixed_endian_write): New template member.
9925 (Reloc_stub::do_write): Remove.
9926 (Reloc_stub::do_fixed_endian_write): Remove.
9927 (Cortex_a8_stub): New class definition.
9928 (Stub_factory::make_cortex_a8_stub): New method definition.
9929 (Stub_factory::Stub_factory): Add missing static storage class
9930 qualifier for elf32_arm_stub_a8_veneer_blx.
9932 2010-01-07 Ian Lance Taylor <iant@google.com>
9935 * options.h (class General_options): Add --warn-unresolved-symbols
9936 and --error-unresolved-symbols.
9937 * errors.cc (Errors::undefined_symbol): Implement
9938 --warn-unresolved-symbols.
9940 * options.h (class General_options): Add -z text and -z textoff.
9941 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9943 2010-01-06 Sriraman Tallam <tmsriram@google.com>
9945 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9946 (Garbage_collection::cident_sections): New function.
9947 (Garbage_collection::add_cident_section): New function.
9948 (Garbage_collection::cident_sections_): New member.
9949 (gc_process_relocs): Add references to sections whose names are C
9951 * gold.h (cident_section_start_prefix): New constant.
9952 (cident_section_stop_prefix): New constant.
9953 (is_cident): New function.
9954 * layout.cc (Layout::define_section_symbols): Replace string constants
9955 with the newly defined constants.
9956 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9958 * testsuite/Makefile.am: Add gc_orphan_section_test.
9959 * testsuite/Makefile.in: Regenerate.
9960 * testsuite/gc_orphan_section_test.cc: New file.
9961 * testsuite/gc_orphan_section_test.sh: New file.
9963 2010-01-06 Ian Lance Taylor <iant@google.com>
9966 * options.h (class General_options): Add --warn-shared-textrel.
9967 * layout.cc (Layout::finish_dynamic_section): Implement
9968 --warn-shared-textrel.
9971 * options.h (class General_options): Add --warn-multiple-gp.
9973 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9975 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9976 $(THREADSLIB) and $(LIBDL).
9977 * Makefile.in: Rebuild.
9979 2010-01-06 Ian Lance Taylor <iant@google.com>
9982 * options.cc (General_options::parse_section_start): New function.
9983 (General_options::section_start): New function.
9984 (General_options::General_options): Initialize all members.
9985 * options.h: Include <map>
9986 (class General_options): Add --section-start. Add section_starts_
9988 * layout.cc (Layout::attach_allocated_section_to_segment): If
9989 --section-start was used, set the address of the segment. Remove
9990 local sort_sections.
9991 (Layout::relaxation_loop_body): If the address of the load segment
9992 has been set by --section-start, don't use it.
9993 * output.h (Output_segment::update_flags_for_output_section): New
9995 * output.cc (Output_segment::add_output_section): Call
9996 update_flags_for_output_section.
9998 2010-01-05 Ian Lance Taylor <iant@google.com>
10001 * options.h (class General_options): Add --undefined-version.
10002 * script.cc (struct Version_expression): Add was_matched_by_symbol
10004 (Version_script_info::matched_symbol): New function.
10005 (Version_script_info::get_symbol_version_helper): Call
10007 (Version_script_info::check_unmatched_names): New function.
10008 * script.h (class Version_script_info): Update declarations.
10009 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10011 * options.h (class General_options): Use DEFINE_bool_alias for
10012 allow_multiple_definition.
10013 * resolve.cc (Symbol_table::should_override): Don't test
10014 allow_multiple_definition.
10017 * options.h (class General_options): Add --cref.
10018 * main.cc (main): Print cref table if --cref. Don't close mapfile
10019 until after printing cref table.
10020 * cref.cc: Include "symtab.h".
10021 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10022 (Cref_table_compare::operator()): New function.
10023 (Cref_inputs::gather_cref): New function.
10024 (filecol): New static const.
10025 (Cref_inputs::print_cref): New function.
10026 (Cref::print_cref): New function.
10027 * cref.h: Include <cstdio>.
10028 (class Cref): Update declarations.
10029 * mapfile.h (Mapfile::file): New function.
10030 * object.h (class Object): Define Symbols. Declare virtual
10031 do_get_global_symbols.
10032 (Object::get_global_symbols): New function.
10033 * object.cc (Input_objects::add_object): Pass object to cref_ if
10035 (Input_objects::archive_start): Likewise.
10036 (Input_objects::archive_stop): Likewise.
10037 (Input_objects::print_cref): New function.
10038 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10039 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10041 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10043 * plugin.h (class Sized_pluginobj): Update declarations.
10045 2010-01-05 Ian Lance Taylor <iant@google.com>
10047 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10048 to is_default_version. Rename insdef to insdefault.
10049 (Symbol_table::add_from_relobj): Rename def to is_default_version
10050 and local to is_forced_local.
10051 (Symbol_table::add_from_pluginobj): Likewise.
10052 (Symbol_table::add_from_dynobj): Likewise.
10053 (Symbol_table::define_special_symbol): Rename insdef to
10056 2010-01-04 Ian Lance Taylor <iant@google.com>
10059 * options.h (class General_options): Add
10060 --allow-multiple-definition and -z muldefs.
10061 * resolve.cc (Symbol_table::should_override): Don't warn about a
10062 multiple symbol definition if --allow-multiple-definition or -z
10066 * options.h (class General_options): Add --add-needed and
10067 --copy-dt-needed-entries. Tweak --as-needed help entry.
10068 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10069 error if --copy-dt-needed-entries aka --add-needed is used and
10070 would cause a change in behaviour.
10073 * options.h (class General_options): Add -G as a short version of
10074 --shared. Add no-op options -assert, -g, and -i.
10076 2010-01-04 Sriraman Tallam <tmsriram@google.com>
10078 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10079 check for .text or .gnu.linkonce.t sections.
10080 * icf.cc (Icf::find_identical_sections): Ditto.
10081 Change the detection for mangled function name within the section
10083 * icf.h (is_section_foldable_candidate): New function.
10085 2009-12-30 Ian Lance Taylor <iant@google.com>
10088 * options.h (class General_options): Permit two dashes with
10089 --retain-symbols-file.
10091 2009-12-30 Ian Lance Taylor <iant@google.com>
10094 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10095 don't put the file header and segment headers in the text
10099 * common.cc (Sort_commons::operator()): Stabilize sort when both
10101 (Symbol_table::do_allocate_commons_list): When allocating common
10102 symbols, skip a symbol which is no longer common.
10103 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10104 an object before checking its type.
10105 * testsuite/common_test_2.c: New file.
10106 * testsuite/common_test_3.c: New file.
10107 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10108 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10109 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10110 (common_test_2_pic.o, common_test_2.so): New targets.
10111 (common_test_3_pic.o, common_test_3.so): New targets.
10112 * testsuite/Makefile.in: Rebuild.
10115 * script.cc (read_input_script): If we see a new SECTIONS clause,
10116 and we have added an input section, give an error.
10117 * layout.h (class Layout): Add have_added_input_section function.
10118 Add have_added_input_section_ field.
10119 * layout.cc (Layout::Layout): Initialize
10120 have_added_input_section_.
10121 (Layout::layout): Set have_added_input_section_.
10122 (Layout::layout_eh_frame): Likewise.
10124 2009-12-30 Ian Lance Taylor <iant@google.com>
10127 * options.h (class General_options): Add --sort-common option.
10128 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10129 * common.cc (Sort_common): Add sort_order parameter to
10130 constructor. Add sort_order_ field.
10131 (Sort_commons::operator): Check sort_order_.
10132 (Symbol_table::allocate_commons): Determine the sort order.
10133 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10134 Change all callers.
10135 (Symbol_table::do_allocate_commons_list): Likewise.
10137 2009-12-30 Ian Lance Taylor <iant@google.com>
10140 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10141 symbols from this object, don't change the visibility of an
10143 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10145 2009-12-30 Ian Lance Taylor <iant@google.com>
10148 * script.h (class Version_script_info): Define Language enum.
10149 Update declarations. Define Glob, Exact, and Lookup types. Add
10150 new fields globals_, locals_, and is_finalized_.
10151 * script.cc: Various formatting fixes.
10152 (class Parser_closure): Change language_stack_ from a vector of
10153 std::string to one of Version_script_info::Language. Adjust all
10155 (class Lazy_demangler): Remove.
10156 (struct Version_expression): Change language from std::string to
10157 Version_script_info::Language.
10158 (Version_script_info::Version_script_info): New function.
10159 (Version_script_info::~Version_script_info): Don't call clear.
10160 (Version_script_info::finalize): New function.
10161 (Version_script_info::build_lookup_tables): New function.
10162 (Version_script_info::build_expression_list_lookup): New
10164 (Version_script_info::get_symbol_version_helper): Rewrite to use
10166 (Version_script_info::print_expression_list): Adjust to use
10167 Version_script_info::Language.
10168 (script_push_lex_into_version_mode): Check that the version script
10169 has not been finalized.
10170 (version_script_push_lang): Change language string to
10171 Version_script_info::Language.
10172 * options.cc (Command_line::version_script): New function.
10173 * options.h (class General_options): Add finalize_dynamic_list
10174 function. Change version_script from declaration to definition.
10175 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10176 * testsuite/version_script.map: Remove duplicate def of foo.
10177 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10178 version_script.map.
10179 * testsuite/Makefile.in: Rebuild.
10181 2009-12-30 Ian Lance Taylor <iant@google.com>
10184 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10185 if the input symbol index is 0, make the output symbol index 0.
10187 2009-12-30 Ian Lance Taylor <iant@google.com>
10190 * options.h (class General_options): Add -x/--discard-all.
10191 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10192 --discard-all. If the local symbol needs a dynamic entry, check
10193 that before handling --discard-locals.
10195 2009-12-30 Ian Lance Taylor <iant@google.com>
10198 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10200 (Output_segment::add_output_section): Don't change the flags if
10201 the type is PT_TLS.
10204 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10205 GNU hash table if they need a dynamic value. Otherwise, don't add
10206 them if they are defined in a dynamic object or are forced local.
10208 2009-12-29 Ian Lance Taylor <iant@google.com>
10211 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10212 .gnu.hash table for a 32-bit target.
10215 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10216 regular and a dynamic object only needs a dynamic symbol table
10217 entry if it is externally visible.
10220 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10221 constructor. Add global_offset_table_ field.
10222 (Target_i386::got_section): Set global_offset_table_.
10223 (Target_i386::do_finalize_sections): Set global_offset_table_
10225 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10226 in constructor. Add global_offset_table_ field.
10227 (Target_x86_64::got_section): Set global_offset_table_.
10228 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10231 * layout.cc (Layout::Layout): Initialize increase_relro_.
10232 (Layout::get_output_section): Add is_relro, is_last_relro, and
10233 is_first_non_relro parameters. Change all callers.
10234 (Layout::choose_output_section): Likewise.
10235 (Layout::add_output_section_data): Likewise.
10236 (Layout::make_output_section): Likewise.
10237 (Layout::set_segment_offsets): Clear increase_relro when using a
10239 * layout.h (class Layout): Add increase_relro method. Add
10240 increase_relro_ field. Update declarations.
10241 * output.cc (Output_section::Output_section): Initialize
10242 is_last_relro_ and is_first_non_relro_.
10243 (Output_segment::add_output_section): Group relro sections is
10244 do_sort is true. Handle is_last_relro and is_first_non_relro.
10245 (Output_segment::maximum_alignment): Remove relro handling.
10246 (Output_segment::set_section_addresses): Add increase_relro
10247 parameter. Change all callers. Add initial alignment to align
10248 relro sections on separate page. Remove old relro handling.
10249 (Output_segment::set_section_list_addresses): Remove in_relro
10250 parameter. Change all callers.
10251 (Output_segment::set_offset): Add increase parameter. Change all
10252 callers. Remove old relro handling.
10253 * output.h (class Output_section): Add new methods: is_last_relro,
10254 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10255 Add is_last_relro_ and is_first_non_relro_ fields.
10256 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10257 Create separate .got.plt section. Call increase_relro.
10258 * x86_64.cc (Target_x86_64::got_section): Likewise.
10259 * testsuite/relro_script_test.t: Add .got.plt.
10262 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10263 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10264 (Layout::finalize): Call set_dynamic_symbol_size.
10265 (Layout::set_dynamic_symbol_size): New function.
10266 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10267 set_dynamic_symbol_size.
10270 * output.h (class Output_section): Add is_entsize_zero_ field.
10271 * output.cc (Output_section::Output_section): Initialize
10273 (Output_section::set_entsize): If two different entsizes are
10274 requested, force it to zero.
10275 (Output_section::add_input_section): Set flags for .debug_str
10276 before updating section flags. Set entsize.
10277 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10278 and SHF_STRING if all input sections have those flags.
10280 2009-12-29 Rafael Espindola <espindola@google.com>
10282 * main.cc (main): Fix the sys time reporting.
10283 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10286 2009-12-29 Sriraman Tallam <tmsriram@google.com>
10288 * options.cc (General_options::parse_version): Allow -v to exit
10289 without an error if there is nothing to link.
10291 2009-12-29 Ian Lance Taylor <iant@google.com>
10293 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10294 using a version of gcc before 4.1.
10295 * configure: Rebuild.
10297 2009-12-28 Chris Demetriou <cgd@google.com>
10299 * attributes.cc (Output_attributes_section_data::do_write): Use
10300 std::vector::front rather than std::vector::data.
10302 2009-12-28 Ian Lance Taylor <iant@google.com>
10304 * symtab.h (class Symbol_table): Add enum Defined.
10305 * resolve.cc (Symbol_table::should_override): Add defined
10306 parameter. Change all callers. Test whether object is NULL
10307 before calling a method on it.
10308 (Symbol_table::report_resolve_problem): Add defined parameter.
10309 Change all callers.
10310 (Symbol_table::should_override_with_special): Likewise.
10311 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10312 parameter. Change all callers.
10313 (Symbol_table::do_define_in_output_data): Likewise.
10314 (Symbol_table::define_in_output_segment): Likewise.
10315 (Symbol_table::do_define_in_output_segment): Likewise.
10316 (Symbol_table::define_as_constant): Likewise.
10317 (Symbol_table::do_define_as_constant): Likewise.
10318 * script.h (class Symbol_assignment): Add is_defsym parameter to
10319 constructor; change all callers.
10320 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10321 parameter. Change all callers. Add is_defsym_ field.
10322 (class Parser_closure): Add parsing_defsym parameter to
10323 constructor; change all callers. Add parsing_defsym accessor
10324 function. Add parsing_defsym_ field.
10326 2009-12-28 Ian Lance Taylor <iant@google.com>
10328 * gold.cc (queue_middle_tasks): Fix formatting.
10329 * object.cc (Relobj::is_section_name_included): Likewise.
10331 2009-12-23 Ian Lance Taylor <iant@google.com>
10333 * i386.cc (Target_i386::do_calls_non_split): Recognize
10334 -fsplit-stack prologue for a function with a static chain.
10335 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10336 -fsplit-stack prologue when using %r11.
10338 2009-12-21 Sriraman Tallam <tmsriram@google.com>
10340 * options.cc (General_options::parse_version): Make -v continue and do
10341 the link like GNU ld does.
10343 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
10345 * Makefile.am (CCFILES): Add timer.cc.
10346 (HFILES): Add timer.h.
10347 * configure.ac: Check for sysconf and times.
10348 * main.cc: include timer.h.
10349 (main): Use Timer instead of get_run_time.
10352 * workqueue.cc: include timer.h.
10353 (Workqueue::find_and_run_task):
10354 Report user, sys and wall time.
10355 * Makefile.in: Regenerate.
10356 * config.in: Regenerate.
10357 * configure: Regenerate.
10359 2009-12-16 Doug Kwan <dougkwan@google.com>
10361 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10363 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10364 relaxed input sections.
10365 * output.cc (Output_section::find_relaxed_input_section): Change
10366 return type to Output_relaxed_input_section pointer. Adjust code
10367 for new type of relaxed_input_section_map_.
10368 * output.h (Output_section::find_relaxed_input_section): Change
10369 return type to Output_relaxed_input_section pointer.
10370 (Output_section::Output_relaxed_input_section_by_input_section_map):
10372 (Output_section::relaxed_input_section_map_): Change type to
10373 Output_section::Output_relaxed_input_section_by_input_section_map.
10374 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10377 2009-12-15 Ian Lance Taylor <iant@google.com>
10379 * layout.cc (Layout::create_shstrtab): Only write out after input
10380 sections if we are compressing debug sections.
10382 2009-12-15 Ian Lance Taylor <iant@google.com>
10384 * archive.cc (Archive::add_symbols): Only look up a symbol without
10385 a version if there is, in fact, a version.
10387 2009-12-14 Ian Lance Taylor <iant@google.com>
10389 Revert -Wshadow changes, all changes from:
10390 2009-12-11 Doug Kwan <dougkwan@google.com>
10391 2009-12-11 Nick Clifton <nickc@redhat.com>
10392 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10394 2009-12-11 Doug Kwan <dougkwan@google.com>
10396 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10398 * attributes.cc (Object_attribute::size): Ditto.
10399 (Attributes_section_data::size): Ditto.
10400 (Attributes_section_data::Attributes_section_data): Ditto.
10401 (Output_attributes_section_data::do_write): Ditto.
10402 * attributes.h (Object_attribute::set_type): Ditto.
10403 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10405 2009-12-11 Nick Clifton <nickc@redhat.com>
10407 * archive.cc: Fix shadowed variable warnings.
10408 * arm.cc: Likewise.
10409 * compressed_output.cc: Likewise.
10410 * compressed_output.h: Likewise.
10411 * configure: Likewise.
10412 * dwarf_reader.cc: Likewise.
10413 * dynobj.cc: Likewise.
10414 * dynobj.h: Likewise.
10415 * ehframe.cc: Likewise.
10416 * ehframe.h: Likewise.
10417 * errors.cc: Likewise.
10418 * expression.cc: Likewise.
10419 * fileread.cc: Likewise.
10420 * fileread.h: Likewise.
10421 * freebsd.h: Likewise.
10422 * i386.cc: Likewise.
10423 * icf.cc: Likewise.
10424 * incremental.h: Likewise.
10425 * layout.cc: Likewise.
10426 * layout.h: Likewise.
10427 * mapfile.cc: Likewise.
10428 * merge.cc: Likewise.
10429 * merge.h: Likewise.
10430 * object.cc: Likewise.
10431 * object.h: Likewise.
10432 * options.h: Likewise.
10433 * output.cc: Likewise.
10434 * output.h: Likewise.
10435 * parameters.cc: Likewise.
10436 * plugin.cc: Likewise.
10437 * powerpc.cc: Likewise.
10438 * reduced_debug_output.cc: Likewise.
10439 * reduced_debug_output.h: Likewise.
10440 * reloc.cc: Likewise.
10441 * reloc.h: Likewise.
10442 * resolve.cc: Likewise.
10443 * script-sections.cc: Likewise.
10444 * script.cc: Likewise.
10445 * script.h: Likewise.
10446 * sparc.cc: Likewise.
10447 * symtab.cc: Likewise.
10448 * symtab.h: Likewise.
10449 * target-select.cc: Likewise.
10450 * target-select.h: Likewise.
10451 * token.h: Likewise.
10452 * workqueue.cc: Likewise.
10453 * workqueue.h: Likewise.
10454 * x86_64.cc: Likewise.
10456 2009-12-10 Doug Kwan <dougkwan@google.com>
10458 * arm.cc (attributes.h): New include.
10459 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10460 (Arm_relobj::~Arm_relobj): Delete object pointed by
10461 attributes_section_data_.
10462 (Arm_relobj::attributes_section_data): New method definition.
10463 (Arm_relobj::attributes_section_data_): New data member declaration.
10464 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10465 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10466 attributes_section_data_.
10467 (Arm_dynobj::attributes_section_data): New method definition.
10468 (Arm_dynobj::attributes_section_data_): New data member declaration.
10469 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10470 initialization value of may_use_blx_ to false.
10471 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
10472 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10473 object attributes to compute results instead of hard-coding.
10474 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10475 Target_arm::get_secondary_compatible_arch,
10476 Target_arm::set_secondary_compatible_arch
10477 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10478 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10479 New method declarations.
10480 (Target_arm::get_aeabi_object_attribute): New method definition.
10481 (Target_arm::attributes_section_data_): New data member declaration.
10482 (read_arm_attributes_section): New template definition.
10483 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10484 (Arm_dynobj::do_read_symbols): Ditto.
10485 (Target_arm::do_finalize_sections): Merge attributes sections from
10486 input. Check for BLX use after attributes section merging.
10487 Fix __exidx_start and __exidx_end visibility. Create an
10488 .ARM.attributes section if necessary.
10489 (Target_arm::get_secondary_compatible_arch,
10490 Target_arm::set_secondary_compatible_arch,
10491 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10492 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
10493 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
10494 New method definitions.
10496 2009-12-09 Ian Lance Taylor <iant@google.com>
10498 * plugin.cc (Plugin::load): Don't cast from void* to a function
10501 2009-12-09 Ian Lance Taylor <iant@google.com>
10503 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10504 information fields.
10506 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10508 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10509 Replace two_file_shared_1.so with two_file_shared_2.so.
10510 * testsuite/Makefile.in: Regenerated.
10512 2009-12-08 Doug Kwan <dougkwan@google.com>
10514 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10515 (HFILES): Add attributes.h and int_encoding.h.
10516 * Makefile.in: Regenerate.
10517 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10518 function definitions to int_encoding.cc
10519 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10520 prototypes to int_encoding.h
10521 * reduced_debug_output.cc (int_encoding.h): New include.
10522 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10523 function definitions to int_encoding.cc
10524 (insert_into_vector, read_from_pointer): Move template definitions to
10526 * attributes.cc: New file.
10527 * attributes.h: New file.
10528 * int_encoding.cc: New file.
10529 * int_encoding.h: New file.
10531 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
10534 * incremental-dump.cc (dump_incremental_inputs): New.
10535 (main): Use dump_incremental_inputs.
10537 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10540 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10541 checking elfcpp::STT_FUNC.
10542 (Target_i386::Relocate::relocate): Likewise.
10543 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10545 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10546 symbols from shared libraries into normal FUNC symbols.
10548 * symtab.h (Symbol): Add is_func and use it.
10550 2009-12-05 Doug Kwan <dougkwan@google.com>
10552 * arm.cc (Target_arm::arm_info): Initialize new fields
10553 attributes_section and attributes_vendor.
10554 * i386.cc (Target_i386::i386_info): Same.
10555 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10556 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10557 fields attributes_section and attributes_vendor.
10558 * sparc.cc (Target_sparc::sparc_info): Same.
10559 * target.h (Target::attributes_section, Target::attributes_vendor,
10560 Target::is_attributes_section, Target::attribute_arg_type,
10561 Target::attributes_order): New method definitions.
10562 (Target::Target_info::attributes_section,
10563 Target::Target_info::attributes_vendor): New fields.
10564 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10565 virtual method definitions.
10566 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10567 attributes_section and attributes_vendor.
10568 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10570 2009-12-05 Doug Kwan <dougkwan@google.com>
10572 * arm.cc: Update comments about interworking and stub generation.
10573 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10574 considered as non-PIC.
10575 (Arm_relocate_functions::base_abs): Fix formatting.
10576 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10577 of function to use GOT entry address instead of offset.
10578 (Target_arm::Scan::global): Issue an error if a symbol would need a
10579 PLT does not get one because it is untyped. Remove code to create
10580 dynamic symbols for relative branches.
10581 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10582 takes unsigned integer instead of boolean.
10584 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10586 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10587 (two_file_test_LDADD): Likewise.
10588 (common_test_1_LDADD): Likewise.
10589 (exception_test_LDADD) Likewise.
10590 (weak_test_LDADD): Likewise.
10591 (many_sections_test_LDADD): Likewise.
10592 (initpri1_LDADD): Likewise.
10593 (script_test_1_LDADD): Likewise.
10594 (script_test_2_LDADD): Likewise.
10595 (justsyms_LDADD): Likewise.
10596 (binary_test_LDADD): Likewise.
10597 (large_LDADD): Likewise.
10598 * testsuite/Makefile.in: Regenerated.
10600 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
10602 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10603 (Symbol_table::override_with_special): Likewise.
10604 (Symbol_table::add_from_object): Likewise.
10606 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10608 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10609 Don't set the data_offset twice.
10611 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10613 * testsuite/Makefile.in: Regenerate.
10615 2009-12-03 Doug Kwan <dougkwan@google.com>
10617 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10618 (Target_arm::do_finalize_sections): Add parameter for symbol table
10619 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10620 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10621 parameter for symbol table pointer.
10622 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10623 an additional parameter for a pointer to symbol table.
10624 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10625 parameter for a symbol table pointer.
10626 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10627 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10629 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10630 parameter for a symbol table pointer.
10632 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
10634 * incremental.cc (Incremental_inputs_header)
10635 (Incremental_inputs_header_write, Incremental_inputs_entry)
10636 (Incremental_inputs_entry_write): Move ...
10637 * incremental.h (Incremental_inputs_header)
10638 (Incremental_inputs_header_write, Incremental_inputs_entry)
10639 (Incremental_inputs_entry_write): here.
10641 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10643 * incremental.cc (make_sized_incremental_binary): Set the target.
10644 Error if it is incompatible.
10645 * output.h (Output_file): Add filename method.
10647 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10649 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10650 from the get_* methods.
10652 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10654 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10655 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10656 Write 0 for the data_offset of scripts.
10658 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10660 * testsuite/Makefile.am: Add the incremental_test.sh test.
10661 * testsuite/incremental_test.sh: New.
10662 * testsuite/incremental_test_1.c: New.
10663 * testsuite/incremental_test_2.c: New.
10665 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
10667 * incremental-dump.cc (main): Fix typos.
10669 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
10672 * incremental-dump.cc (main): Use llu to print 64 bit values.
10674 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10675 H.J. Lu <hongjiu.lu@intel.com>
10677 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10679 (incremental_dump_LDADD): Likewise.
10680 * Makefile.in: Regenerated.
10682 2009-11-25 Doug Kwan <dougkwan@google.com>
10686 2009-11-25 Doug Kwan <dougkwan@google.com>
10688 * arm.cc (Target_arm::Target_arm): Move method definition
10689 outside of class definition. Add code to handle
10690 --target1-rel, --target1-abs and --target2= options.
10691 (Target_arm::get_reloc_reloc_type): Change method to be
10692 non-static and const.
10693 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10694 New data member declaration.
10695 (Target_arm::Scan::local, Target_arm::Scan::global,
10696 Target_arm::Relocate::relocate,
10697 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10698 Adjust call to Target_arm::get_real_reloc_type.
10699 (Target_arm::get_real_reloc_type): Use command line options
10700 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10701 * options.h (--target1-rel, --target1-abs, --target2): New
10704 2009-11-25 Doug Kwan <dougkwan@google.com>
10706 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10707 class definition. Add code to handle --target1-rel, --target1-abs
10708 and --target2= options.
10709 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10711 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10712 member declaration.
10713 (Target_arm::Scan::local, Target_arm::Scan::global,
10714 Target_arm::Relocate::relocate,
10715 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10716 call to Target_arm::get_real_reloc_type.
10717 (Target_arm::get_real_reloc_type): Use command line options to
10718 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10719 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10722 2009-11-25 Doug Kwan <dougkwan@google.com>
10724 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10725 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10726 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10728 (Arm_relocate_functions::thm_call): Replace body with a call to
10729 Arm_relocate_functions::thumb_branch_common.
10730 (Arm_relocate_functions::thm_jump24,
10731 Arm_relocate_functions::thm_xpc22): New method definitions.
10732 (Arm_relocate_functions::thumb_branch_common): New method definition.
10733 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10735 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10736 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10738 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10740 * Makefile.am: Build incremental-dump
10741 * Makefile.in: Regenerate.
10742 * incremental-dump.cc: New.
10743 * incremental.cc (Incremental_inputs_header_data,
10744 Incremental_inputs_entry_data): Move to incremental.h
10745 * incremental.h: (Incremental_inputs_header_data,
10746 Incremental_inputs_entry_data): Move from incremental.cc
10748 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10750 * incremental.cc (Incremental_inputs_header,
10751 Incremental_inputs_header_write, Incremental_inputs_entry,
10752 Incremental_inputs_entry_write): Add a typedef with the data type.
10754 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10756 * incremental.cc (Incremental_inputs_header,
10757 Incremental_inputs_header_write, Incremental_inputs_entry,
10758 Incremental_inputs_entry_write): Update comment about which
10759 type has the filed descriptions.
10761 2009-11-15 Doug Kwan <dougkwan@google.com>
10763 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10764 (Arm_relocate_functions::arm_branch_common): Change method defintion
10765 in class definition to a method declaration and update list of formal
10767 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10768 Arm_relocation_functions::jump24): Adjust call to
10769 Arm_relocate_functions::arm_branch_common. Update list of formal
10771 (Arm_relocate_functions::xpc25): New method definition.
10772 (Arm_relocate_functions::arm_branch_common): Move method defintion
10773 out from class definition. Use stubs for mode-switching and extending
10775 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10776 specially. Change code to enable use of stubs in ARM branches.
10778 2009-11-10 Doug Kwan <dougkwan@google.com>
10780 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10781 in method declaration.
10782 (Target_arm::relocate_stub): New method declaration.
10783 (Target_arm::default_target): Change to return a pointer instead of
10785 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10786 Target_arm::default_target.
10787 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10789 (Target_arm::relocate_section): Adjust view.
10790 (Target_arm::relocate_stub): New method definition.
10792 2009-11-10 Doug Kwan <dougkwan@google.com>
10794 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10796 * incremental.cc (open_incremental_binary): Initialized local
10797 variables to avoid warnings.
10798 * object.cc (make_elf_object): Ditto.
10799 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10802 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10805 * testsuite/plugin_test.c: Include "config.h".
10807 2009-11-09 Doug Kwan <dougkwan@google.com>
10809 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10810 (arm_symbol_value): Remove.
10811 (Arm_relocate_functions::arm_branch_common,
10812 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10813 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10814 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10815 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10816 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10817 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10818 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10819 Arm_relocate_functions::thm_mobw_abs_nc,
10820 Arm_relocate_functions::thm_mov_abs,
10821 Arm_relocate_functions::movw_prel_nc,
10822 Arm_relocate_functions::thm_movt_abs,
10823 Arm_relocate_functions::movt_prel,
10824 Arm_relocate_functions::thm_movw_prel_nc,
10825 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10826 (Target_arm::Relocate::relocate): Only decompose address into two
10827 parts if relocation type uses the thumb-bit and pass the actual
10828 bit instead of a flag indicating that the thumb-bit is used. Adjust
10829 calls to methods in Arm_relocate_functions for this change.
10831 2009-11-08 Ian Lance Taylor <iant@google.com>
10834 * reloc.cc: Instantiate
10835 Sized_relobj::initialize_input_to_output_maps and
10836 Sized_relobj:free_input_to_output_maps.
10838 2009-11-06 Ian Lance Taylor <iant@google.com>
10841 * defstd.cc (in_segment): Set only_if_ref true for "end".
10843 2009-11-06 Doug Kwan <dougkwan@google.com>
10845 * arm.cc (class Reloc_stub): Correct a comment.
10846 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10847 (Target_arm::scan_section_for_stubs): New method declaration.
10848 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10849 Change methods from private to protected.
10850 (Target_arm::do_may_relax): New method definition.
10851 (Target_arm::do_relax, Target_arm::group_sections,
10852 Target_arm::scan_reloc_for_stub,
10853 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10854 (Target_arm::arm_input_section_map_): New data member declaration.
10855 (Target_arm::scan_reloc_for_stub,
10856 Target_arm::scan_reloc_section_for_stubs,
10857 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10858 Target_arm::do_relax): New method definitions.
10860 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10862 * configure.ac: Check for (struct stat)::st_mtim
10863 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10864 * config.in: Regenerate.
10865 * configure: Regenerate.
10867 2009-11-05 Ian Lance Taylor <iant@google.com>
10870 * output.cc (Output_segment::add_output_section): Add missing
10873 2009-11-04 Ian Lance Taylor <iant@google.com>
10876 * object.h (class Object): Add is_needed and set_is_needed
10877 methods. Add is_needed_ field. Make bool fields into bitfields.
10878 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10879 defined in a dynamic object and referenced by a regular object,
10880 set is_needed for the dynamic object.
10881 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10882 if the file is marked with as_needed and it is not needed.
10884 2009-11-04 Ian Lance Taylor <iant@google.com>
10887 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10888 tags if data is discarded by linker script.
10889 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10890 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10891 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10892 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10894 2009-11-04 Ian Lance Taylor <iant@google.com>
10896 * layout.cc (Layout::get_output_section): Add is_interp and
10897 is_dynamic_linker_section parameters. Change all callers.
10898 (Layout::choose_output_section): Likewise.
10899 (Layout::make_output_section): Likewise.
10900 (Layout::add_output_section_data): Add is_dynamic_linker_section
10901 parameter. Change all callers.
10902 * layout.h (class Layout): Update declarations.
10903 * output.h (class Output_section): Add is_interp, set_is_interp,
10904 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10905 Add is_interp_, is_dynamic_linker_section_ fields. Change
10906 generate_code_fills_at_write_ to a bitfield.
10907 * output.cc (Output_section::Output_sections): Initialize new
10909 (Output_segment::add_output_section): Add do_sort parameter.
10910 Change all callers.
10912 2009-11-03 Ian Lance Taylor <iant@google.com>
10915 * options.h (class General_options): Add --warn-common.
10916 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10917 merging two common symbols.
10918 (Symbol_table::should_override): Handle --warn-common when merging
10919 a common symbol with a defined symbol. Use report_resolve_problem
10920 for multiple definitions.
10921 (Symbol_table::report_resolve_problem): New function.
10922 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10924 2009-11-03 Doug Kwan <dougkwan@google.com>
10926 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10928 (Target_arm::stub_factory): New method definition.
10929 (Target_arm::new_arm_input_section,
10930 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10931 Target_arm::reloc_uses_thumb_bit): New method declarations.
10932 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
10933 New type definitions.
10934 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10935 member declarations.
10936 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10937 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10938 New method definitions.
10940 2009-11-03 Ian Lance Taylor <iant@google.com>
10942 * options.h (class General_options): Add --warn_constructors.
10944 2009-11-03 Ian Lance Taylor <iant@google.com>
10947 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10948 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10950 2009-11-03 Ian Lance Taylor <iant@google.com>
10953 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10954 --msgid-bugs-address.
10955 (install-pdf): New target.
10956 (install-data_yes): Look up one directory to find mkinstalldirs.
10958 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10960 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10963 2009-10-30 Doug Kwan <dougkwan@google.com>
10965 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10967 2009-10-30 Doug Kwan <dougkwan@google.com>
10969 * arm.cc (Stub_addend_reader): New struct template definition
10970 and partial specializations.
10971 (Stub_addend_reader::operator()): New method definition for a
10972 partially specialized template.
10974 2009-10-30 Doug Kwan <dougkwan@google.com>
10976 * arm.cc (Arm_relobj::processor_specific_flags): New method
10978 (Arm_relobj::do_read_symbols): New method declaration.
10979 (Arm_relobj::processor_specific_flags_): New data member declaration.
10980 (Arm_dynobj): New class definition.
10981 (Target_arm::do_finalize_sections): Add input_objects parameter.
10982 (Target_arm::do_adjust_elf_header): New method declaration.
10983 (Target_arm::are_eabi_versions_compatible,
10984 (Target_arm::merge_processor_specific_flags): New method declaration.
10985 (Target_arm::do_make_elf_object): New overloaded method definitions
10987 (Arm_relobj::do_read_symbols): New method definition.
10988 (Arm_dynobj::do_read_symbols): Ditto.
10989 (Target_arm::do_finalize_sections): Add input_objects parameters.
10990 Merge processor-specific flags from all input objects.
10991 (Target_arm::are_eabi_versions_compatible,
10992 Target_arm::merge_processor_specific_flags,
10993 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10994 New method definitions.
10995 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10996 Input_objects pointer type parameter.
10997 * layout.cc (Layout::finalize): Pass input objects to target's.
10998 finalize_sections function.
10999 * output.cc (Output_file_header::do_sized_write): Set ELF file
11000 header's processor-specific flags.
11001 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11002 Input_objects pointer type parameter.
11003 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11004 * target.h (Input_objects): New forward class declaration.
11005 (Target::processor_specific_flags,
11006 Target::are_processor_specific_flags_sect): New method definitions.
11007 (Target::finalize_sections): Add input_objects parameter.
11008 (Target::Target): Initialize processor_specific_flags_ and
11009 are_processor_specific_flags_set_.
11010 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11012 (Target::set_processor_specific_flags): New method definition.
11013 (Target::processor_specific_flags_,
11014 Target::are_processor_specific_flags_set_): New data member
11016 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11017 Input_objects pointer type parameter.
11019 2009-10-30 Doug Kwan <dougkwan@google.com>
11021 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11023 2009-10-28 Ian Lance Taylor <iant@google.com>
11025 * object.h (class Relobj): Drop options parameter from
11026 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11027 do_scan_relocs, do_relocate. Change all callers.
11028 (class Sized_relobj): Drop options parameters from
11029 do_gc_process_relocs, do_scan_relocs, do_relocate,
11030 do_relocate_sections, relocate_sections, emit_relocs_scan,
11031 emit_relocs_scan_reltype. Change all callers.
11032 (struct Relocate_info): Remove options field and all references to
11034 * reloc.h (class Read_relocs): Remove options constructor
11035 parameter and options_ field. Change all callers.
11036 (class Gc_process_relocs, class Scan_relocs): Likewise.
11037 (class Relocate_task): Likewise.
11038 * target-reloc.h (scan_relocs): Remove options parameter. Change
11040 (scan_relocatable_relocs): Likewise.
11041 * target.h (class Sized_target): Remove options parameter from
11042 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11044 * gc.h (gc_process_relocs): Remove options parameter. Change all
11046 * arm.cc: Update functions to remove options parameters.
11047 * i386.cc: Likewise.
11048 * powerpc.cc: Likewise.
11049 * sparc.cc: Likewise.
11050 * x86_64.cc: Likewise.
11051 * testsuite/testfile.cc: Likewise.
11053 2009-10-28 Doug Kwan <dougkwan@google.com>
11055 * arm.cc (Arm_relobj): New class definition.
11056 (Arm_relobj::scan_sections_for_stubs,
11057 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11058 New method definitions.
11060 2009-10-28 Cary Coutant <ccoutant@google.com>
11062 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11063 (Plugin::cleanup_done_): New member.
11064 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11065 (Plugin_manager::cleanup_done_): Remove.
11066 (Plugin_manager::add_input_file): Edit error message.
11067 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11068 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11070 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11072 * fileread.cc: (File_read::View::~View): Use the new
11073 data_ownership_ filed.
11074 (File_read::~File_read): Dispose the new whole_file_view_.
11075 (File_read::open): Mmap the whole file if needed.
11076 (File_read::open): Use whole_file_view_ instead of contents_.
11077 (File_read::find_view): Use whole_file_view_ if applicable.
11078 (File_read::do_read): Use whole_file_view_ instead of contents_.
11079 (File_read::make_view): Use whole_file_view_ instead of contents_,
11080 update File_read::View::View call.
11081 (File_read::find_or_make_view): Update File_read::View::View
11083 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11085 (File_read::View::Data_ownership): New enum.
11086 (File_read::View::View): Replace bool mapped_ with Data_ownership
11088 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11089 (File_read::View::data_ownership_): New field.
11090 (File_read::contents_): Remove (replaced by whole_file_view_).
11091 (File_read::whole_file_view_): New field.
11092 * options.h (class General_options): Add --keep-files-mapped.
11094 2009-10-27 Cary Coutant <ccoutant@google.com>
11096 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11097 * testsuite/Makefile.am (plugin_test_5): New test case.
11098 * testsuite/Makefile.in: Regenerate.
11100 2009-10-25 Doug Kwan <dougkwan@google.com>
11102 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11103 from private to protected to allow access by child class.
11104 (Sized_relobj::do_relocate_sections): New method declaration.
11105 (Sized_relobj::relocate_sections): Virtualize.
11106 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
11107 Sized_relobj::relocate_sections. Instantiate template explicitly
11108 for different target sizes and endianity.
11110 2009-10-24 Doug Kwan <dougkwan@google.com>
11112 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11113 (Arm_input_section::as_arm_input_section): New method.
11114 (Arm_output_section): New class definition.
11115 (Arm_output_section::create_stub_group,
11116 Arm_output_section::group_sections): New method definitions.
11118 2009-10-22 Doug Kwan <dougkwan@google.com>
11120 * arm.cc (Arm_input_section): New class definition.
11121 (Arm_input_section::init, Arm_input_section:do_write,
11122 Arm_input_section::set_final_data_size,
11123 Arm_input_section::do_reset_address_and_file_offset): New method
11126 2009-10-21 Doug Kwan <dougkwan@google.com>
11128 * arm.cc (Stub_table, Arm_input_section): New forward class
11130 (Stub_table): New class defintion.
11131 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11132 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11133 New method definition.
11135 2009-10-21 Doug Kwan <dougkwan@google.com>
11137 * arm.cc: Update copyright comments.
11138 (Target_arm): New forward class template declaration.
11139 (Arm_address): New type.
11140 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11141 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11142 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11144 (Insn_template): Same.
11145 (DEF_STUBS): New macro.
11146 (Stub_type): New enum type.
11147 (Stub_template): New class definition.
11149 (Reloc_stub): Same.
11150 (Stub_factory): Same.
11151 (Target_arm::Target_arm): Initialize may_use_blx_ and
11152 should_force_pic_veneer_.
11153 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11154 Target_arm::should_force_pic_veneer,
11155 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11156 Target_arm::using_thumb_only, Target_arm:;default_target): New
11158 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11159 New data member declarations.
11160 (Insn_template::size, Insn_template::alignment): New method defintions.
11161 (Stub_template::Stub_template): New method definition.
11162 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11163 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11164 (Stub_factory::Stub_factory): New method definition.
11165 * gold.h (string_hash): New template.
11166 * output.h (Input_section_specifier::hash_value): Use
11168 (Input_section_specifier::string_hash): Remove.
11169 * stringpool.cc (Stringpool_template::string_hash): Use
11172 2009-10-20 Doug Kwan <dougkwan@google.com>
11174 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11175 symbols of relaxed input sections.
11176 * output.h (Output_section::find_relaxed_input_section): Make
11179 2009-10-16 Doug Kwan <dougkwan@google.com>
11181 * dynobj.cc (Versions::Versions): Initialize version_script_.
11182 Only insert base version symbol definition for a shared object
11183 if version script defines any version versions.
11184 (Versions::define_base_version): New method definition.
11185 (Versions::add_def): Check that base version is not needed.
11186 (Versions::add_need): Define base version lazily.
11187 * dynobj.h (Versions::define_base_version): New method declaration.
11188 (Versions::needs_base_version_): New data member declaration.
11189 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11190 (check_DATA): Add no_version_test.stdout.
11191 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11193 * testsuite/Makefile.in: Regenerate.
11194 * testsuite/no_version_test.c: New file.
11195 * testsuite/no_version_test.sh: Ditto.
11197 2009-10-16 Doug Kwan <dougkwan@google.com>
11199 * expression.cc (class Segment_start_expression): New class definition.
11200 (Segment_start_expression::value): New method definition.
11201 (script_exp_function_segment_start): Return a new
11202 Segment_start_expression.
11203 * gold/script-c.h (script_saw_segment_start_expression): New function
11205 * script-sections.cc (Script_sections::Script_sections): Initialize
11206 SAW_SEGMENT_START_EXPRESSION_ to false.
11207 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11208 and -Tbbs options to specify section addresses if given in
11209 command line and no SEGMENT_START expression is seen in a script.
11210 * script-sections.h (Script_sections::saw_segment_start_expression,
11211 Script_sections::set_saw_segment_start_expression): New method
11213 (Script_sections::saw_segment_start_expression_): New data member
11215 * script.cc (script_saw_segment_start_expression): New function.
11216 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11217 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11218 script_test_7.sh and script_test_8.sh.
11219 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11220 script_test_8.stdout.
11221 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11222 (script_test_6, script_test_6.stdout, script_test_7,
11223 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11224 * Makefile.in: Regenerate.
11225 * testsuite/script_test_6.sh: New file.
11226 * testsuite/script_test_6.t: Same.
11227 * testsuite/script_test_7.sh: Same.
11228 * testsuite/script_test_7.t: Same.
11229 * testsuite/script_test_8.sh: Same.
11231 2009-10-16 Doug Kwan <dougkwan@google.com>
11233 * output.cc (Output_segment::set_section_list_address): Cast
11234 expressions to unsigned long long type to avoid format warnings.
11236 2009-10-15 Ian Lance Taylor <iant@google.com>
11238 * script.cc (Script_options::add_symbol_assignment): Always add a
11239 dot assignment to script_sections_.
11240 * script-sections.cc (Script_sections::add_dot_assignment):
11241 Initialize if necessary.
11243 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11244 program headers with no load segment if there is a linker script.
11246 * layout.cc (Layout::set_segment_offsets): Align the file offset
11247 to the segment aligment for -N or -n with no load segment.
11248 * output.cc (Output_segment::add_output_section): Don't crash if
11249 the first section is a TLS section.
11250 (Output_segment::set_section_list_addresses): Print an error
11251 message if the address moves backward in a linker script.
11252 * script-sections.cc
11253 (Output_section_element_input::set_section_addresses): Don't
11254 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11255 (Orphan_output_section::set_section_addresses): Likewise.
11257 2009-10-15 Doug Kwan <dougkwan@google.com>
11259 * layout.cc (Layout::finish_dynamic_section): Generate tags
11260 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11261 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11262 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11264 2009-10-14 Ian Lance Taylor <iant@google.com>
11266 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11268 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11269 data_shdr fields of relinfo.
11270 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11271 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11272 R_386_TLS_LDO_32, adjust based on section flags.
11273 (Target_i386::Relocate::fix_up_ldo): Remove.
11275 2009-10-13 Ian Lance Taylor <iant@google.com>
11277 Add support for -pie.
11278 * options.h (class General_options): Add -pie and
11280 (General_options::output_is_position_independent): Test -pie.
11281 (General_options::output_is_executable): Return true if not shared
11282 and not relocatable.
11283 (General_options::output_is_pie): Remove.
11284 * options.cc (General_options::finalize): Reject incompatible uses
11286 * gold.cc (queue_middle_tasks): A -pie link is not static.
11287 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11288 * symtab.cc (Symbol::final_value_is_known): Return false if
11289 output_is_position_independent.
11290 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11291 output_is_position_independent.
11292 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11293 output_is_position_independent.
11294 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11295 output_is_position_independent.
11296 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11298 (basic_pie_test.o, basic_pie_test): New targets.
11299 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11300 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11301 (two_file_pie_test): New target.
11302 * testsuite/Makefile.in: Rebuild.
11303 * README: Remove note saying that -pie is not supported.
11305 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11307 * options.h (class General_options): Add -init and -fini.
11308 * layout.cc (Layout::finish_dynamic_section): Emit
11309 given init and fini functions.
11311 2009-10-13 Sriraman Tallam <tmsriram@google.com>
11313 * gc.h (gc_process_relocs): Check if icf is enabled using new
11315 * gold.cc (queue_initial_tasks): Likewise.
11316 (queue_middle_tasks): Likewise.
11317 * object.cc (do_layout): Likewise.
11318 * symtab.cc (is_section_folded): Likewise.
11319 * main.cc (main): Likewise.
11320 * reloc.cc (Read_relocs::run): Likewise.
11321 (Sized_relobj::do_scan_relocs): Likewise.
11322 * icf.cc (is_function_ctor_or_dtor): New function.
11323 (Icf::find_identical_sections): Check if function is ctor or dtor when
11324 safe icf is chosen.
11325 * options.h (General_options::icf): Change option to be an enum.
11326 (Icf_status): New enum.
11327 (icf_enabled): New method.
11328 (icf_safe_folding): New method.
11329 (set_icf_status): New method.
11330 (icf_status_): New variable.
11331 * (options.cc) (General_options::finalize): Set icf_status_.
11332 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11333 icf_test and icf_keep_unique_test to use the --icf enum flag.
11334 * testsuite/icf_safe_test.sh: New file.
11335 * testsuite/icf_safe_test.cc: New file.
11337 2009-10-12 Sriraman Tallam <tmsriram@google.com>
11339 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11340 includes to gc.h and icf.h.
11341 * arm.cc: Include gc.h.
11342 * gold.cc: Likewise.
11343 * i386.cc: Likewise.
11344 * powerpc.cc: Likewise.
11345 * sparc.cc: Likewise.
11346 * x86_64.cc: Likewise.
11347 * gc.h: Include icf.h.
11349 2009-10-11 Ian Lance Taylor <iant@google.com>
11351 * plugin.cc: Include "gold.h" before other header files.
11353 2009-10-10 Chris Demetriou <cgd@google.com>
11355 * options.h (Input_file_argument::Input_file_type): New enum.
11356 (Input_file_argument::is_lib_): Replace with...
11357 (Input_file_argument::type_): New member.
11358 (Input_file_argument::Input_file_argument): Take Input_file_type
11359 'type' rather than boolean 'is_lib' as second argument.
11360 (Input_file_argument::is_lib): Use type_.
11361 (Input_file_argument::is_searched_file): New function.
11362 (Input_file_argument::may_need_search): Handle is_searched_file.
11363 * options.cc (General_options::parse_library): Support -l:filename.
11364 (General_options::parse_just_symbols): Update for Input_file_argument
11366 (Command_line::process): Likewise.
11367 * archive.cc (Archive::get_file_and_offset): Likewise.
11368 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11369 * script.cc (read_script_file, script_add_file): Likewise.
11370 * fileread.cc (Input_file::Input_file): Likewise.
11371 (Input_file::will_search_for): Handle is_searched_file.
11372 (Input_file::open): Likewise.
11373 * readsyms.cc (Read_symbols::get_name): Likewise.
11374 * testsuite/Makefile.am (searched_file_test): New test.
11375 * testsuite/Makefile.in: Regenerate.
11376 * testsuite/searched_file_test.cc: New file.
11377 * testsuite/searched_file_test_lib.cc: New file.
11379 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11380 Ian Lance Taylor <iant@google.com>
11382 * descriptor.cc: Include <cstdio> and "binary-io.h".
11383 (Descriptors::open): Open the files in binary mode always.
11384 * script.cc (Lex::get_token): Treat \r as whitespace.
11386 2009-10-09 Ian Lance Taylor <iant@google.com>
11388 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11390 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11391 Ian Lance Taylor <iant@google.com>
11393 * configure.ac: Check for readv function also.
11394 * fileread.cc (readv): Define if not HAVE_READV.
11395 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11397 * config.in: Regenerate.
11398 * configure: Regenerate.
11400 2009-10-09 Doug Kwan <dougkwan@google.com>
11402 * layout.cc (Layout::make_output_section): Call target hook to make
11403 ordinary output section.
11404 (Layout::finalize): Adjust parameter list of call the
11405 Target::may_relax().
11406 * layout.h (class Layout::section_list): New method.
11407 * merge.h (Output_merge_base::entsize): Change visibility to public.
11408 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11410 (Output_merge_string::do_is_string): New method.
11411 * object.cc (Sized_relobj::do_setup): renamed from
11412 Sized_relobj::set_up.
11413 * object.h (Sized_relobj::adjust_shndx,
11414 Sized_relobj::initializ_input_to_output_maps,
11415 Sized_relobj::free_input_to_output_maps): Change visibilities to
11417 (Sized_relobj::setup): Virtualize.
11418 (Sized_relobj::do_setup): New method declaration.
11419 (Sized_relobj::invalidate_section_offset,
11420 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11421 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11422 * options.cc (parse_int): New function.
11423 * options.h (parse_int): New declaration.
11424 (DEFINE_int): New macro.
11425 (stub_group_size): New option.
11426 * output.cc (Output_section::Output_section): Initialize memebers
11427 merge_section_map_, merge_section_by_properties_map_,
11428 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11429 (Output_section::add_input_section): Handled deferred code-fill
11430 generation and remove an old comment.
11431 (Output_section::add_relaxed_input_section): New method definition.
11432 (Output_section::add_merge_input_section): Use merge section by
11433 properties map to speed to search. Update merge section maps
11435 (Output_section::build_relaxation_map): New method definition.
11436 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11438 (Output_section::relax_input_section): Renamed to
11439 Output_section::convert_input_sections_to_relaxed_sections and change
11440 interface to take a vector of pointers to relaxed sections.
11441 (Output_section::find_merge_section,
11442 Output_section::find_relaxed_input_section): New method definitions.
11443 (Output_section::is_input_address_mapped,
11444 Output_section::output_offset, Output_section::output_address):
11445 Use output section data maps to speed up searching.
11446 (Output_section::find_starting_output_address): Add comments.
11447 (Output_section::do_write,
11448 Output_section::write_to_postprocessing_buffer): Do code-fill
11449 generation as appropriate.
11450 (Output_section::get_input_sections): Invalidate relaxed input section
11452 (Output_section::restore_states): Adjust type of checkpoint .
11453 Invalidate relaxed input section map.
11454 * output.h (Output_merge_base): New class declaration.
11455 (Input_section_specifier): New class defintion.
11456 (class Output_relaxed_input_section) Change base class to
11457 Output_section_data_build.
11458 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11459 base class initializer.
11460 (Output_section::add_relaxed_input_section): New method declaration.
11461 (Output_section::Input_section): Change visibility to protected.
11462 (Output_section::Input_section::relobj,
11463 Output_section::Input_section::shndx): Handle relaxed input sections.
11464 Output_section::input_sections) Change visibility to protected. Also
11465 define overload to return a non-const pointer.
11466 (Output_section::Merge_section_properties): New class defintion.
11467 (Output_section::Merge_section_by_properties_map,
11468 Output_section::Output_section_data_by_input_section_map,
11469 Output_section::Relaxation_map): New types.
11470 (Output_section::relax_input_section): Rename method to
11471 Output_section::convert_input_sections_to_relaxed_sections and change
11472 interface to take a vector of relaxed section pointers.
11473 (Output_section::find_merge_section,
11474 Output_section::find_relaxed_input_section,
11475 Output_section::build_relaxation_map,
11476 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11477 New method declarations.
11478 (Output_section::merge_section_map_
11479 Output_section::merge_section_by_properties_map_,
11480 Output_section::relaxed_input_section_map_,
11481 Output_section::is_relaxed_input_section_map_valid_,
11482 Output_section::generate_code_fills_at_write_): New data members.
11483 * script-sections.cc
11484 (Output_section_element_input::set_section_addresses): Call
11485 current_data_size and addralign methods of relaxed input sections.
11486 (Orphan_output_section::set_section_addresses): Call current_data_size
11487 and addralign methods of relaxed input sections.
11488 * symtab.cc (Symbol_table::compute_final_value): Extract template
11489 from the body of Symbol_table::sized_finalize_symbol.
11490 (Symbol_table::sized_finalized_symbol): Call
11491 Symbol_table::compute_final_value.
11492 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11493 (Symbol_table::compute_final_value): New templated method declaration.
11494 * target.cc (Target::do_make_output_section): New method defintion.
11495 * target.h (Target::make_output_section): New method declaration.
11496 (Target::relax): Add more parameters for input objects, symbol table
11497 and layout. Adjust call to do_relax.
11498 (Target::do_make_output_section): New method declaration.
11499 (Target::do_relax): Add parameters for input objects, symbol table
11502 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11504 * pread.c: Include stdio.h.
11506 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11508 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11511 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11513 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11514 Change read_shndx type to unsigned int.
11515 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11517 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11518 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11519 Change read_shndx type to unsigned int.
11520 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11522 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11523 * layout.cc (Layout::create_symtab_sections): Cast the result of
11524 local_symcount * symsize to off_t in the gold_assert.
11526 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11528 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11529 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11531 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11532 (Arm_relocate_functions::thm_abs5): New function.
11533 (Arm_relocate_functions::abs12): New function.
11534 (Arm_relocate_functions::abs16): New function.
11535 (Arm_relocate_functions::base_abs): New function.
11536 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11537 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11538 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11540 (Scan::global): Likewise.
11541 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11542 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11543 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11544 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11547 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11549 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11550 (Arm_relocate_functions::movt_prel): New function.
11551 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11552 (Arm_relocate_functions::thm_movt_prel): New function.
11553 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11554 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11555 (Scan::global, Relocate::relocate): Likewise.
11556 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11558 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11560 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11561 Incremental_checker.
11562 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11564 (class Incremental_inputs_header): New class.
11565 (Incremental_inputs_header_writer): Edit comment.
11566 (Incremental_inputs_entry): New class.
11567 (Incremental_inputs_entry_writer): Edit comment.
11568 (Sized_incremental_binary::do_find_incremental_inputs_section):
11569 Add *strtab_shndx parameter, fill it.
11570 (Sized_incremental_binary::do_check_inputs): New method.
11571 (Incremental_checker::can_incrementally_link_output_file): Use
11572 Sized_incremental_binary::check_inputs.
11573 (Incremental_inputs::report_command_line): Save command line in
11576 (Incremental_binary::find_incremental_inputs_section): New
11578 (Incremental_binary::do_find_incremental_inputs_section): Add
11579 strtab_shndx parameter.
11580 (Incremental_binary::do_check_inputs): New pure virtual method.
11581 (Sized_incremental_binary::do_check_inputs): Declare.
11582 (Incremental_checker::Incremental_checker): Add incremental_inputs
11583 parameter, use it to initialize incremental_inputs_.
11584 (Incremental_checker::incremental_inputs_): New field.
11585 (Incremental_checker::command_line): New method.
11586 (Incremental_checker::inputs): New method.
11587 (Incremental_checker::command_line_): New field.
11589 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11591 * incremental.cc: Include <cstdarg> and "target-select.h".
11592 (vexplain_no_incremental): New function.
11593 (explain_no_incremental): New function.
11594 (Incremental_binary::error): New method.
11595 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11597 (make_sized_incremental_binary): New function.
11598 (open_incremental_binary): New function.
11599 (can_incrementally_link_file): Add checks if output is ELF and has
11601 * incremental.h: Include "elfcpp_file.h" and "output.h".
11602 (Incremental_binary): New class.
11603 (Sized_incremental_binary): New class.
11604 (open_incremental_binary): Declare.
11605 * object.cc (is_elf_object): Use
11606 elfcpp::Elf_recognizer::is_elf_file.
11607 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11608 * output.h (Output_file::filesize): New method.
11610 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11612 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11614 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11615 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11617 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11619 (Arm_relocate_functions::movw_abs_nc): New function.
11620 (Arm_relocate_functions::movt_abs): New function.
11621 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11622 (Arm_relocate_functions::thm_movt_abs): New function.
11623 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11624 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11625 (Scan::global): Likewise.
11626 (Relocate::relocate): Likewise.
11627 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11629 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11631 * arm.cc (Arm_relocate_functions::got_prel) New function.
11632 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11633 (Relocate::relocate): Likewise.
11634 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11636 2009-10-06 Ian Lance Taylor <iant@google.com>
11638 * options.h (class General_options): Define
11639 split_stack_adjust_size parameter.
11640 * object.h (class Object): Add uses_split_stack_ and
11641 has_no_split_stack_ fields. Add uses_split_stack and
11642 has_no_split_stack accessor functions. Declare
11643 handle_split_stack_section.
11644 (class Reloc_symbol_changes): Define.
11645 (class Sized_relobj): Define Function_offsets. Declare
11646 split_stack_adjust, split_stack_adjust_reltype, and
11648 * object.cc (Object::handle_split_stack_section): New function.
11649 (Sized_relobj::do_layout): Call handle_split_stack_section.
11650 * dynobj.cc (Sized_dynobj::do_layout): Call
11651 handle_split_stack_section.
11652 * reloc.cc (Sized_relobj::relocate_sections): Call
11653 split_stack_adjust for executable sections in split_stack
11654 objects. Pass reloc_map to relocate_section.
11655 (Sized_relobj::split_stack_adjust): New function.
11656 (Sized_relobj::split_stack_adjust_reltype): New function.
11657 (Sized_relobj::find_functions): New function.
11658 * target-reloc.h: Include "object.h".
11659 (relocate_section): Add reloc_symbol_changes parameter. Change
11661 * target.h (class Target): Add calls_non_split method. Declare
11662 do_calls_non_split virtual method. Declare match_view and
11664 * target.cc: Include "elfcpp.h".
11665 (Target::do_calls_non_split): New function.
11666 (Target::match_view): New function.
11667 (Target::set_view_to_nop): New function.
11668 * gold.cc (queue_middle_tasks): Give an error if mixing
11669 split-stack and non-split-stack objects with -r.
11670 * i386.cc (Target_i386::relocate_section): Add
11671 reloc_symbol_changes parameter.
11672 (Target_i386::do_calls_non_split): New function.
11673 * x86_64.cc (Target_x86_64::relocate_section): Add
11674 reloc_symbol_changes parameter.
11675 (Target_x86_64::do_calls_non_split): New function.
11676 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11678 * powerpc.cc (Target_powerpc::relocate_section): Add
11679 reloc_symbol_changes parameter.
11680 * sparc.cc (Target_sparc::relocate_section): Add
11681 reloc_symbol_changes parameter.
11682 * configure.ac: Call AM_CONDITIONAL for the default target.
11683 * configure: Rebuild.
11684 * testsuite/Makefile.am (TEST_AS): New variable.
11685 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11686 (check_DATA): Add split_i386 and split_x86_64 files.
11687 (SPLIT_DEFSYMS): Define.
11688 (split_i386_[1234n].o): New targets.
11689 (split_i386_[124]): New targets.
11690 (split_i386_[1234r].stdout): New targets.
11691 (split_x86_64_[1234n].o): New targets.
11692 (split_x86_64_[124]): New targets.
11693 (split_x86_64_[1234r].stdout): New targets.
11694 (MOSTLYCLEANFILES): Add new executables.
11695 * testsuite/split_i386.sh: New file.
11696 * testsuite/split_x86_64.sh: New file.
11697 * testsuite/split_i386_1.s: New file.
11698 * testsuite/split_i386_2.s: New file.
11699 * testsuite/split_i386_3.s: New file.
11700 * testsuite/split_i386_4.s: New file.
11701 * testsuite/split_i386_n.s: New file.
11702 * testsuite/split_x86_64_1.s: New file.
11703 * testsuite/split_x86_64_2.s: New file.
11704 * testsuite/split_x86_64_3.s: New file.
11705 * testsuite/split_x86_64_4.s: New file.
11706 * testsuite/split_x86_64_n.s: New file.
11707 * testsuite/testfile.cc (Target_test): Update relocation_section
11709 * testsuite/Makefile.in: Rebuild.
11711 2009-10-06 Ian Lance Taylor <iant@google.com>
11713 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11714 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11715 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11716 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11717 the address on ldo_addrs_.
11718 (Target_i386::Relocate::fix_up_ldo): New function.
11720 2009-10-06 Rafael Espindola <espindola@google.com>
11722 * plugin.cc (add_input_library): New.
11723 (Plugin::load): Add add_input_library to tv.
11724 (Plugin_manager::add_input_file): Add the is_lib argument.
11725 (add_input_file): Update call to Plugin_manager::add_input_file.
11726 (add_input_library): New.
11727 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11729 2009-09-30 Doug Kwan <dougkwan@google.com>
11731 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11732 symbol and call Symbol::may_need_copy_reloc to determine if
11733 a copy reloc is needed.
11734 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11735 nocopyreloc is given in command line.
11736 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11737 given in command line.
11738 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11739 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11740 of the removed Target_i386::may_need_copy_reloc.
11741 * options.h (copyreloc): New option with default value false.
11742 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11743 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11744 instead of the removed Target_powerpc::may_need_copy_reloc.
11745 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11746 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11747 instead of the removed Target_sparc::may_need_copy_reloc.
11748 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11749 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11750 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11751 instead of the removed Target_x86_64::may_need_copy_reloc.
11753 2009-09-30 Ian Lance Taylor <iant@google.com>
11755 * object.h (class Object): Remove target_ field, and target,
11756 sized_target, and set_target methods.
11757 (Object::sized_target): Remove.
11758 (class Sized_relobj): Update declarations. Remove sized_target.
11759 * object.cc (Sized_relobj::setup): Remove target parameter.
11760 Change all callers.
11761 (Input_objects::add_object): Don't do anything with the target.
11762 (make_elf_sized_object): Add punconfigured parameter. Change all
11763 callers. Set or test parameter target.
11764 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11765 Change all callers.
11766 * parameters.cc (Parameters::set_target): Change parameter type to
11768 (Parameters::default_target): Remove.
11769 (set_parameters_target): Change parameter type to be non-const.
11770 (parameters_force_valid_target): New function.
11771 (parameters_clear_target): New function.
11772 * parameters.h (class Parameters): Update declarations. Remove
11773 default_target method. Add sized_target and clear_target
11774 methods. Change target_ to be non-const.
11775 (set_parameters_target): Update declaration.
11776 (parameters_force_valid_target): Declare.
11777 (parameters_clear_target): Declare.
11778 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11779 as NULL if we aren't searching.
11780 (Add_symbols::run): Don't check for compatible target.
11781 * fileread.cc (Input_file::open_binary): Call
11782 parameters_force_valid_target.
11783 * gold.cc (queue_middle_tasks): Likewise.
11784 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11785 set_target on object.
11786 * dynobj.h (class Sized_dynobj): Update declarations.
11787 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11788 make_elf_object returns NULL.
11789 (Archive::include_member): Don't check whether object target is
11791 * output.cc (Output_section::add_input_section): Get target from
11793 (Output_section::relax_input_section): Likewise.
11794 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11796 (Sized_relobj::do_scan_relocs): Likewise.
11797 (Sized_relobj::relocate_sections): Likewise.
11798 * resolve.cc (Symbol_table::resolve): Likewise.
11799 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11800 parameter. Change all callers.
11801 (Symbol_table::add_from_object): Get target from parameters.
11802 (Symbol_table::add_from_relobj): Don't check object target.
11803 (Symbol_table::add_from_dynobj): Likewise.
11804 (Symbol_table::define_special_symbol): Get target from
11806 * symtab.h (class Symbol_table): Update declaration.
11807 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11808 parameter. Change all callers. Clear parameter target.
11809 (Binary_test): Test target here.
11810 * testsuite/object_unittest.cc (gold_testsuite): Remove
11811 target_test_pointer parameter. Change all callers.
11812 (Object_test): Test target here.
11814 2009-09-26 Ian Lance Taylor <iant@google.com>
11816 * testsuite/initpri1.c: Don't try to use constructor priorities if
11817 compiling with gcc before 4.3.
11819 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11821 * testsuite/retain_symbols_file_test.sh (check_present): Change
11822 output file name to retain_symbols_file_test.stdout.
11823 (check_absent): Likewise.
11825 2009-09-18 Craig Silverstein <csilvers@google.com>
11827 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11828 * options.cc: Include <cerrno> and <fstream>.
11829 (General_options::finalize): Parse -retain-symbols-file tag.
11830 * options.h: New flag.
11831 (General_options): New method should_retain_symbol, new
11832 variable symbols_to_retain.
11833 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11834 should_retain_symbol map.
11835 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11836 * testsuite/Makefile.in: Regenerate.
11837 * testsuite/retain_symbols_file_test.sh: New file.
11839 2009-09-18 Nick Clifton <nickc@redhat.com>
11841 * po/es.po: Updated Spanish translation.
11843 2009-09-17 Doug Kwan <dougkwan@google.com>
11845 * debug.h (DEBUG_RELAXATION): New constant.
11846 (DEBUG_ALL): Add DEBUG_RELAXATION.
11847 (debug_string_to_enum): Add relaxation debug option.
11849 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11850 Layout::Relaxation_debug_check::read_sections,
11851 Layout::Relaxation_debug_check::read_sections): New method definitions.
11852 (Layout::Layout): Initialize data members
11853 record_output_section_data_from_scrips_,
11854 script_output_section_data_list_ and relaxation_debug_check_.
11855 (Layout::save_segments, Layout::restore_segments,
11856 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11857 Layout::relaxation_loop_body): New method definitions.
11858 (Layout::finalize): Support relaxation. Move section layout code to
11859 Layout::relaxation_loop_body.
11860 (Layout::set_asection_address_from_script): Move code for orphan
11861 section placement out.
11862 (Layout::place_orphan_sections_in_script): New method definition.
11863 * layout.h (Output_segment_headers, Output_file_header):
11864 New forward class declarations.
11865 (Layout::~Layout): Define.
11866 (Layout::new_output_section_data_from_script): New method definition.
11867 (Layout::place_orphan_sections_in_script): New method declaration.
11868 (Layout::Segment_states): New type declaration.
11869 (Layout::save_segments, Layout::restore_segments,
11870 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11871 Layout::relaxation_loop_body): New method declarations.
11872 (Layout::Output_section_data_list): New type declaration.
11873 (Layout::Relaxation_debug_check): New class definition.
11874 (Layout::record_output_section_data_from_script_,
11875 Layout::script_output_section_data_list_, Layout::segment_states_,
11876 Layout::relaxation_debug_check_): New data members.
11877 * output.cc: (Output_section_headers::do_size): New method definition.
11878 (Output_section_headers::Output_section_headers): Move size
11879 computation to Output_section_headers::do_size.
11880 (Output_segment_headers::do_size): New method definition.
11881 (Output_file_header::Output_file_header): Move size computation to
11882 Output_file_header::do_size and call it.
11883 (Output_file_header::do_size): New method definition.
11884 (Output_data_group::Output_data_group): Adjust call to
11885 Output_section_data.
11886 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11887 (Output_symtab_xindex::do_write): Add array bound check.
11888 (Output_section::Input_section::print_to_mapfile): Handle
11889 RELAXED_INPUT_SECTION_CODE.
11890 (Output_section::Output_section): Initialize data member checkpoint_.
11891 (Output_section::~Output_section): Delete checkpoint object pointed
11893 (Output_section::add_input_section): Always add an Input_section if
11895 (Output_section::add_merge_input_section): Add assert.
11896 (Output_section::relax_input_section): New method definition.
11897 (Output_section::set_final_data_size): Set load address to zero for
11898 an unallocated section.
11899 (Output_section::do_address_and_file_offset_have_reset_values):
11900 New method definition.
11901 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11902 Handle relaxed input section.
11903 (Output_section::sort_attached_input_sections): Checkpoint input
11904 section list lazily.
11905 (Output_section::get_input_sections): Change type of input_sections to
11906 list of Simple_input_section pointers. Checkpoint input section list
11907 lazily. Also handle relaxed input sections.
11908 (Output_section::add_input_section_for_script): Take a reference to
11909 a Simple_input_section object instead of Relobj pointer and section
11910 index as parameter. Handle relaxed input sections.
11911 (Output_section::save_states, Output_section::restore_states): New
11912 method definitions.
11913 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11914 (Output_data::is_data_size_fixed): New method definition.
11915 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11917 (Output_data::address_and_file_offset_have_reset_values): New method
11919 (Output_data::do_address_and_file_offset_have_reset_values): New method
11921 (Output_data::set_data_size): Check that data size is not fixed.
11922 (Output_data::fix_data_size): New method definition.
11923 (Output_data::is_data_size_fixed_): New data member.
11924 (Output_section_headers::set_final_data_size): New method definition.
11925 (Output_section_headers::do_size): New method declaration.
11926 (Output_segment_headers::set_final_data_size): New method definition.
11927 (Output_segment_headers::do_size): New method declaration.
11928 (Output_file_header::set_final_data_size)::New method definition.
11929 (Output_file_header::do_size)::New method declaration.
11930 (Output_section_data::Output_section_data): Add new parameter
11931 is_data_size_fixed and use it to fix data size.
11932 (Output_data_const::Output_data_const): Adjust call to base class
11933 constructor and fix data size.
11934 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11935 base class constructor and fix data size.
11936 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11937 base class constructor and fix data size.
11938 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11939 class constructor and fix data size.
11940 (Output_data_group::set_final_data_size): New method definition.
11941 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11942 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11943 class constructor and fix data size.
11944 (Output_relaxed_input_section): New class definition.
11945 (Output_section::Simple_input_section): New class definition.
11946 (Output_section::get_input_sections): Adjust parameter list.
11947 (Output_section::add_input_section_for_script): Same.
11948 (Output_section::save_states, Output_section::restore_states,
11949 Output_section::do_address_and_file_offset_have_reset_values,
11950 (Output_section::Input_section::Input_section): Handle
11951 RELAXED_INPUT_SECTION_CODE. Add new overload for
11952 Output_relaxed_input_section.
11953 (Output_section::Input_section::is_input_section,
11954 Output_section::Input_section::set_output_section): Handle relaxed
11956 (Output_section::Input_section::is_relaxed_input_section,
11957 Output_section::Input_section::output_section_data,
11958 Output_section::Input_section::relaxed_input_section): New method
11960 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11962 (Output_section::Input_section::u1_): Update comments.
11963 (Output_section::Input_section::u2_): Add new union member poris.
11964 (Output_section::Checkpoint_output_section): New classs definition.
11965 (Output_section::relax_input_section): New method declaration.
11966 (Output_section::checkpoint_): New data member.
11967 (Output_segment): Update comments.
11968 (Output_segment::Output_segment): Un-privatize copy constructor.
11969 (Output_segment::operator=): Un-privatize.
11970 * script-sections.cc (Output_section_element::Input_section_list):
11971 Change element type to Output_section::Simple_input_section.
11972 (Output_section_element_dot_assignment::set_section_addresses):
11973 Register output section data for relaxation clean up.
11974 (Output_data_exression::Output_data_expression): Adjust call to base
11975 constructor to fix data size.
11976 (Output_section_element_data::set_section_addresses): Register
11977 Output_data_expression object for relaxation clean up.
11978 (struct Input_section_info): Replace Relobj pointer and section index
11979 pair with Output_section::Simple_input_section and Convert struct to a
11981 (Input_section_sorter::operator()): Adjust access to
11982 Input_section_info data member to use accessors.
11983 (Output_section_element_input::set_section_addresses): Use layout
11984 parameter. Adjust code to use Output_section::Simple_input_section
11985 and Input_secction_info classes. Register filler for relaxation
11987 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11988 and section index pair with Output_section::Simple_input_section
11989 class. Adjust code accordingly.
11990 (Phdrs_element::release_segment): New method definition.
11991 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11993 (Script_sections::release_segments): New method definition.
11994 * gold/script-sections.h (Script_sections::release_segments): New
11995 method declaration.
11996 * gold/target.h (Target::may_relax, Target::relax,
11997 Target::do_may_relax, Target::do_relax): New method definitions.
11999 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12001 * arm.cc (has_signed_unsigned_overflow): New function.
12002 (Arm_relocate_functions::abs8): New function.
12003 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12004 (Target_arm::Scan::global): Likewise.
12005 (Target_arm::relocate::relocate): Likewise.
12006 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12009 2009-09-16 Cary Coutant <ccoutant@google.com>
12011 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12012 * testsuite/Makefile.in: Regenerate.
12014 2009-09-11 Nick Clifton <nickc@redhat.com>
12016 * po/gold.pot: Updated by the Translation project.
12018 2009-09-08 Cary Coutant <ccoutant@google.com>
12020 * output.cc (Output_file::open): Add execute permission to empty file.
12021 * testsuite/Makefile.am (permission_test): New test.
12022 * testsuite/Makefile.in: Regenerate.
12024 2009-09-02 Ian Lance Taylor <iant@google.com>
12026 * output.cc (Output_file::resize): Call map_no_anonymous rather
12029 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12031 * gold.cc: Include "incremental.h".
12032 (queue_initial_tasks): Call Incremental_checker methods.
12033 * incremental.cc: Include "output.h".
12034 (Incremental_checker::can_incrementally_link_output_file): New
12036 * incremental.h (Incremental_checker): New class.
12038 * output.cc (Output_file::open_for_modification): New method.
12039 (Output_file::map_anonymous): Changed return type to bool. Record
12040 map in base_ field.
12041 (Output_file::map_no_anonymous): New method, broken out of map.
12042 (Output_file::map): Use map_no_anonymous and map_anonymous.
12043 * output.h (class Output_file): Update declarations.
12045 2009-08-24 Cary Coutant <ccoutant@google.com>
12047 * options.h (Command_line::Pre_options): New class.
12048 (Command_line::pre_options): New member.
12049 * options.cc (gold::options::ready_to_register): New variable.
12050 (One_option::register_option): Do nothing if not registering options.
12051 Assert if same short option registered twice.
12052 (General_options::General_options): Turn off option registration when
12054 (Command_line::Pre_options::Pre_options): New constructor.
12056 2009-08-24 Cary Coutant <ccoutant@google.com>
12058 * options.h (General_options::no_keep_memory): Remove incorrect
12061 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12063 * Makefile.am (am__skiplex, am__skipyacc): New.
12064 * Makefile.in: Regenerate.
12066 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12068 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12069 (INCLUDES): ... this.
12070 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12071 (AM_CPPFLAGS): Renamed from ...
12072 (INCLUDE): ... this.
12073 * Makefile.in, testsuite/Makefile.in: Regenerate.
12075 * Makefile.in: Regenerate.
12076 * aclocal.m4: Likewise.
12077 * config.in: Likewise.
12078 * configure: Likewise.
12079 * testsuite/Makefile.in: Likewise.
12081 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12082 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12083 * Makefile.in: Regenerate.
12084 * testsuite/Makefile.in: Regenerate.
12086 2009-08-19 Cary Coutant <ccoutant@google.com>
12088 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12089 symbols in shared libraries overridden by hidden or internal symbols
12090 in the main program.
12092 2009-08-19 Chris Demetriou <cgd@google.com>
12094 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12095 checking source file names in error messages.
12097 2009-08-18 Doug Kwan <dougkwan@google.com>
12099 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12100 an elcpp::Ehdr as parameter. Adjust call to set_target.
12101 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12102 an elfcpp::Ehdr as parameter.
12103 * object.cc (Object::set_target): Remove the version that looks up
12104 a target and sets it.
12105 (Sized_relobj::setup): Take a Target object instead of
12106 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12107 (make_elf_sized_object): Find target and ask target to
12108 make an ELF object.
12109 * object.h: (Object::set_target): Remove the version that looks up
12110 a target and sets it.
12111 (Sized_relobj::setup): Take a Target object instead of
12112 an elfcpp:Ehdr as parameter.
12113 * target.cc: Include dynobj.h.
12114 (Target::do_make_elf_object_implementation): New.
12115 (Target::do_make_elf_object): New.
12116 * target.h (Target::make_elf_object): New template declaration.
12117 (Target::do_make_elf_object): New method declarations.
12118 (Target::do_make_elf_object_implementation): New template declaration.
12120 2009-08-14 Ian Lance Taylor <iant@google.com>
12122 * gold.h (FUNCTION_NAME): Define.
12123 (gold_unreachable): Use FUNCTION_NAME.
12125 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12127 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12128 symbol in the --keep-unique list is not found.
12130 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12132 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12133 been maked as --keep-unique.
12134 (Icf::unfold_section): New function.
12135 * icf.h (Icf::unfold_section): New function.
12136 * options.h (General_options::keep_unique): New option.
12137 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12138 * testsuite/Makefile.in: Regenerate.
12139 * testsuite/icf_keep_unique_test.sh: New file.
12140 * testsuite/icf_keep_unique_test.cc: New file.
12142 2009-08-12 Cary Coutant <ccoutant@google.com>
12145 * resolve.cc (Symbol_table::resolve): Check for references from
12146 dynamic objects to hidden and internal symbols.
12147 * testsuite/Makefile.am (hidden_test.sh): New test.
12148 * testsuite/Makefile.in: Regenerate.
12149 * testsuite/hidden_test.sh: New script.
12150 * testsuite/hidden_test_1.c: New test source.
12151 * testsuite/hidden_test_main.c: New test source.
12153 2009-08-11 Doug Kwan <dougkwan@google.com>
12155 * arm.cc: Update comments.
12156 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12157 segment to locate the .ARM.exidx section if present.
12159 2009-08-09 Doug Kwan <dougkwan@google.com>
12161 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12164 2009-08-07 Sriraman Tallam <tmsriram@google.com>
12165 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12168 2009-08-06 Sriraman Tallam <tmsriram@google.com>
12170 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12171 valid tls_segment only for non-debug-section relocations.
12172 * testsuite/Makefile.am: Add gc_tls_test.
12173 * testsuite/Makefile.in: Regenerate.
12174 * testsuite/gc_tls_test.cc: New file.
12175 * testsuite/gc_tls_test.sh: New file.
12177 2009-08-05 Sriraman Tallam <tmsriram@google.com>
12179 * icf.cc: New file.
12181 * Makefile.am (CCFILES): Add icf.cc.
12182 (HFILES): Add icf.h
12183 * Makefile.in: Regenerate.
12184 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12185 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12186 section, symbol and addend information for the relocs.
12187 * gold.cc (queue_middle_tasks): Call identical code folding.
12188 * gold.h: Add defines for multimap.
12189 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12190 to the call of finalize_local_symbols.
12191 * main.cc (main): Create object of class Icf.
12192 * object.cc (Sized_relobj::do_layout): Allow this function to be
12193 called twice during icf.
12194 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12195 to sections marked as identical by icf.
12196 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12198 (Sized_relobj::do_section_entsize): New function.
12199 * object.h (Object::section_entsize): New function.
12200 (Object::do_section_entsize): New pure virtual function.
12201 (Relobj::finalize_local_symbols): Add new parameter.
12202 (Relobj::do_section_entsize): New function.
12203 * options.h (General_options::icf): New option.
12204 (General_options::icf_iterations): New option.
12205 (General_options::print_icf_sections): New option.
12206 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12207 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12208 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12210 * symtab.cc (Symbol_table::is_section_folded): New function.
12211 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12212 to sections marked as identical by icf.
12213 * symtab.h (Symbol_table::set_icf): New function.
12214 (Symbol_table::icf): New function.
12215 (Symbol_table::is_section_folded): New function.
12216 (Symbol_table::icf_): New data member.
12217 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12218 * testsuite/Makefile.am: Add commands to build icf_test.
12219 * testsuite/Makefile.in: Regenerate.
12220 * testsuite/icf_test.sh: New file.
12221 * testsuite/icf_test.cc: New file.
12223 2009-07-24 Chris Demetriou <cgd@google.com>
12225 * layout.cc (is_compressible_debug_section): Fix incorrect
12226 comment about compressed section names.
12228 2009-07-20 Ian Lance Taylor <ian@airs.com>
12231 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12233 2009-07-16 Ian Lance Taylor <iant@google.com>
12236 * layout.h: #include <map>.
12237 (class Kept_section): Change from struct to class. Add accessors
12238 and setters. Add section size to Comdat_group mapping. Change
12239 Comdat_group to std::map. Add is_comdat_ field. Add
12240 linkonce_size field in union.
12241 (class Layout): Update declaration of find_or_add_kept_section.
12242 Don't declare find_kept_object.
12243 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12244 parameter. Add object, shndx, is_comdat, and is_group_name
12245 parameters. Change all callers. Adjust for new Kept_section.
12246 (Layout::find_kept_object): Remove.
12247 * object.cc (Sized_relobj::include_section_group): Update use of
12248 Kept_section. Rename secnum to shndx. Only record
12249 Kept_comdat_section if sections are the same size.
12250 (Sized_relobj::include_linkonce_section): Update use of
12251 Kept_section. Only record Kept_comdat_section if sections are the
12252 same size. Set size of linkonce section.
12253 (Sized_relobj::map_to_kept_section): Update call to
12254 get_kept_comdat_section.
12255 * object.h (class Sized_relobj): Rename fields in
12256 Kept_comdat_section to drop trailing underscores; change object
12257 field to Relobj*. Change Kept_comdat_section_table to store
12258 struct rather than pointer.
12259 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12260 Add kept_object and kept_shndx parameters. Change all callers.
12261 (Sized_relobj::get_kept_comdat_section): Change return type to
12262 bool. Add kept_object and kept_shndx parameters. Change all
12264 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12265 Layout::find_or_add_kept_section.
12267 2009-07-09 Ian Lance Taylor <iant@google.com>
12269 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12270 Reserve space in the hash table.
12272 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12274 * fileread.cc (File_read::get_mtime): New method.
12275 * fileread.h (Timespec): New structure.
12276 (File_read::get_mtime): New method.
12277 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12278 Renamed from timestamp_nsec.
12279 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12281 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
12283 (Incremental_inputs::report_archive): Save mtime; style fix.
12284 (Incremental_inputs::report_obejct): Save mtime; style fix.
12285 (Incremental_inputs::report_script): Save mtime; style fix.
12286 (Incremental_inputs::finalize_inputs): Style fix.
12287 (Incremental_inputs::finalize): Style fix.
12288 (Incremental_inputs::create_input_section_data): Store inputs
12290 * incremental.h (Incremental_inputs::report_script): Add mtime
12292 (Incremental_inputs::Input_info::Input_info): Intialize only one
12294 (Incremental_inputs::Input_info::archive): Move to nameless
12296 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12297 (Incremental_inputs::Input_info::script): Move to nameless union.
12298 (Incremental_inputs::mtime): New field.
12299 * script.cc (read_input_script): Pass file mtime to
12301 * script.h (Script_info::inputs): Style fix.
12303 2009-07-01 Ian Lance Taylor <ian@airs.com>
12305 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12308 2009-06-24 Ian Lance Taylor <iant@google.com>
12311 * layout.cc (Layout::choose_output_section): If we find an
12312 existing section, update the flags.
12313 (Layout::create_notes): New function, broken out of
12315 (Layout::finalize): Don't create note sections.
12316 (Layout::create_note): Don't crash if linker script discards
12318 (Layout::create_gold_note): Likewise.
12319 (Layout::create_build_id): Likewise. Don't set
12320 after_input_sections on the section.
12321 (Layout::create_executable_stack_info): Remove target parameter.
12323 * layout.h (class Layout): Declare create_notes. Update
12324 declaration of create_executable_stack_info.
12325 * gold.cc (queue_middle_tasks): Call create_notes.
12326 * output.cc (Output_section::update_flags_for_input_section): Move
12327 here from output.h. If SHF_ALLOC flag is newly set, mark address
12329 * output.h (Output_data::mark_address_invalid): New function.
12330 (class Output_section): Only declare, not define,
12331 update_flags_for_input_section. Remove set_flags.
12333 2009-06-24 Ian Lance Taylor <iant@google.com>
12335 * script-sections.cc (Output_section_definition::
12336 set_section_addresses): Rename shadowing local load_address to
12339 2009-06-24 Ian Lance Taylor <iant@google.com>
12342 * reloc.cc (relocate_sections): Skip empty relocation sections.
12344 2009-06-23 Ian Lance Taylor <iant@google.com>
12347 * layout.cc (Layout::create_note): Use choose_output_section
12348 rather than make_output_section.
12350 2009-06-23 Ian Lance Taylor <iant@google.com>
12353 * options.cc (General_options::parse_V): Set printed_version_.
12354 (General_options::General_options): Initialize printed_version_.
12355 * options.h (class General_options): Add printed_version_ field.
12356 * gold.cc (queue_initial_tasks): If there are no input files,
12357 don't give a fatal error if we printed the version information.
12358 (queue_middle_tasks): If using -r with a shared object, give a
12359 fatal error rather than an ordinary error.
12361 2009-06-23 Ian Lance Taylor <iant@google.com>
12364 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12365 (Layout::make_output_section): Set have_stabstr_section_ if we see
12366 a .stab*str section.
12367 (Layout::finalize): Call link_stabs_sections.
12368 (Layout::link_stabs_sections): New file.
12369 * layout.h (class Layout): Add have_stabstr_section_ field.
12370 Declare link_stabs_sections.
12372 2009-06-23 Doug Kwan <dougkwan@google.com>
12374 * Makefile.am (libgold_a_LIBADD): New.
12375 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
12376 * Makefile.in: Regenerate.
12377 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12378 * configure: Regenerate.
12379 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12380 * fileread.cc: Include sys/state.h
12381 * gold.h: Declare memmem and strndup if found missing.
12382 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12384 2009-06-23 Ian Lance Taylor <iant@google.com>
12386 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12387 * configure: Rebuild.
12389 2009-06-23 Ian Lance Taylor <iant@google.com>
12392 * object.cc (Object::section_contents): Don't try to get a view if
12393 the section has length zero.
12394 (Object::handle_gnu_warning_section): If the section is empty, use
12395 the name of the section as the warning.
12397 2009-06-23 Ian Lance Taylor <iant@google.com>
12400 * stringpool.h (class Stringpool_template): Add optimize_ field.
12401 (Stringpool_template::set_optimize): New function.
12402 * stringpool.cc (Stringpool_template::Stringpool_template):
12403 Initialize optimize_ field.
12404 (Stringpool_template::set_string_offsets): Test local optimize
12405 fild rather than parameter.
12406 * layout.cc (Layout::Layout): Call set_optimize on the section
12409 2009-06-22 Ian Lance Taylor <iant@google.com>
12412 * yyscript.y: Parse TARGET.
12413 * script.cc (script_set_target): New function.
12414 * script-c.h (script_set_target): Declare.
12415 * options.cc (General_options::string_to_object_format): Rename
12416 from string_to_object_format in anonymous namespace. Change
12418 * options.h (class General_options): Declare
12419 string_to_object_format.
12421 2009-06-22 Ian Lance Taylor <iant@google.com>
12423 * script-sections.cc (Script_sections::create_segments): Don't put
12424 program headers in a PT_LOAD segment if -n or -N.
12426 2009-06-22 Ian Lance Taylor <iant@google.com>
12429 * options.h (class General_options): Add -z lazy and -z now. Sort
12430 -z options into alphabetical order.
12431 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12433 2009-06-21 Ian Lance Taylor <iant@google.com>
12435 * layout.cc (Layout::make_output_section): Call
12436 Target::new_output_section.
12437 (Layout::attach_allocated_section_to_segment): Put large section
12438 sections in a separate load segment with the large segment flag
12440 (Layout::segment_precedes): Sort large data segments after other
12442 (align_file_offset): New static function.
12443 (Layout::set_segment_offsets): Use align_file_offset.
12444 * output.h (class Output_section): Add is_small_section_ and
12445 is_large_section_ fields.
12446 (Output_section::is_small_section): New function.
12447 (Output_section::set_is_small_section): New function.
12448 (Output_section::is_large_section): New function.
12449 (Output_section::set_is_large_section): New function.
12450 (Output_section::is_large_data_section): New function.
12451 (class Output_segment): Add is_large_data_segment_ field.
12452 (Output_segment::is_large_data_segment): New function.
12453 (Output_segment::set_is_large_data_segment): New function.
12454 * output.cc (Output_section::Output_section): Initialize new
12456 (Output_segment::Output_segment): Likewise.
12457 (Output_segment::add_output_section): Add assertion that large
12458 data sections always go in large data segments. Force small data
12459 sections to the end of the list of data sections. Force small BSS
12460 sections to the start of the list of BSS sections. For large BSS
12461 sections to the end of the list of BSS sections.
12462 * symtab.h (class Symbol): Declare is_common_shndx.
12463 (Symbol::is_defined): Check Symbol::is_common_shndx.
12464 (Symbol::is_common): Likewise.
12465 (class Symbol_table): Define enum Commons_section_type. Update
12466 declarations. Add small_commons_ and large_commons_ fields.
12467 * symtab.cc (Symbol::is_common_shndx): New function.
12468 (Symbol_table::Symbol_table): Initialize new fields.
12469 (Symbol_table::add_from_object): Put small and large common
12470 symbols in the right list.
12471 (Symbol_table::sized_finalized_symbol): Check
12472 Symbol::is_common_shndx.
12473 (Symbol_table::sized_write_globals): Likewise.
12474 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12475 common symbol lists. Don't call do_allocate_commons_list if the
12477 (Symbol_table::do_allocate_commons_list): Remove is_tls
12478 parameter. Add comons_section_type parameter. Change all
12479 callers. Handle small and large common symbols.
12480 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12481 Symbol::is_common_shndx.
12482 * resolve.cc (symbol_to_bits): Likewise.
12483 * target.h (Target::small_common_shndx): New function.
12484 (Target::small_common_section_flags): New function.
12485 (Target::large_common_shndx): New function.
12486 (Target::large_common_section_flags): New function.
12487 (Target::new_output_section): New function.
12488 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12489 small_common_section_flags, and large_common_section_flags
12491 (Target::do_new_output_section): New virtual function.
12492 * arm.cc (Target_arm::arm_info): Initialize new fields.
12493 * i386.cc (Target_i386::i386_info): Likewise.
12494 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12496 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12497 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12498 (Target_x86_64::do_new_output_section): New function.
12499 * configure.ac: Define conditional MCMODEL_MEDIUM.
12500 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12501 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12502 (large_LDFLAGS): Define.
12503 * testsuite/large.c: New file.
12504 * testsuite/testfile.cc (Target_test::test_target_info):
12505 Initialize new fields.
12506 * configure, testsuite/Makefile.in: Rebuild.
12508 2009-06-05 Doug Kwan <dougkwan@google.com>
12510 * Makefile.am (CCFILES): Add target.cc.
12511 * Makefile.in: Regenerate.
12512 * i386.cc (class Target_i386): Define new virtual method to
12513 override do_is_local_label_name in parent.
12514 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12515 local symbols if --discard-locals or -X is given.
12516 * options.h (class General_options): Declare new options
12517 '--discard-locals' and '-X' for discarding locals.
12518 * target.h (class Target): Define new methods is_local_label_name.
12519 Declare new virtual method do_is_local_label_name.
12520 * target.cc: New file.
12521 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12522 (check_SCRIPTS): Add discard_locals_test.sh.
12523 (check_DATA): Add discard_local_tests.syms.
12524 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12525 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12526 * testsuite/Makefile.in: Regenerate.
12527 * testsuite/discard_locals_test.c: New file.
12528 * testsuite/discard_locals_test.sh: Same.
12530 2009-06-05 Doug Kwan <dougkwan@google.com>
12532 * object.cc (Sized_relobj::Sized_relobj): Initialize
12533 discarded_eh_frame_shndx_ to -1U.
12534 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12536 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12537 a discarded .eh_frame section.
12538 (Sized_relobj::do_finalize_local_symbols): Ditto.
12539 * object.h (class Sized_relobj): Declare new member
12540 discarded_eh_frame_shndx_.
12541 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12542 (local_labels_test.o, local_labels_test): New rules.
12543 * testsuite/Makefile.in: Regenerate.
12545 2009-06-04 Doug Kwan <dougkwan@google.com>
12547 * layout.cc (Layout::section_name_mapping): Add mapping for
12548 special ARM sections.
12550 2009-06-03 Doug Kwan <dougkwan@google.com>
12552 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12553 (utils::has_overflow): Same.
12555 2009-06-03 Ian Lance Taylor <iant@google.com>
12557 * layout.cc (Layout::section_name_mapping): New array, replacing
12558 Layout::linkonce_mapping.
12559 (Layout::section_name_mapping_count): New variable, replacing
12560 Layout::linkonce_mapping_count.
12561 (Layout::linkonce_output_name): Remove.
12562 (Layout::output_section_name): Rewrite.
12563 * layout.h (class Layout): Rename Linkonce_mapping to
12564 Section_name_mapping, linkonce_mapping to section_name_mapping,
12565 linkonce_mapping_count to section_name_mapping_count. Don't
12566 declare linkonce_output_name.
12568 2009-06-03 Doug Kwan <dougkwan@google.com>
12570 * gold/arm.cc (namespace utils): New.
12571 (Target_arm::reloc_is_non_pic): Define new method.
12572 (class Arm_relocate_functions): New.
12573 (Target_arm::Relocate::relocate): Handle relocation types used by
12576 2009-06-03 Ian Lance Taylor <iant@google.com>
12578 * arm.cc (Target_arm::scan::global): Use || instead of |.
12580 2009-06-02 Doug Kwan <dougkwan@google.com>
12582 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12583 issued_non_pic_error_.
12584 (class Target_arm::Scan): Declare new method check_non_pic.
12585 Define new method symbol_needs_plt_entry.
12586 Declare new data member issued_non_pic_error_.
12587 (class Target_arm::Relocate): Declare new method
12588 should_apply_static_reloc.
12589 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12590 (Target_arm::Scan::check_non_pic): Define new method.
12591 (Target_arm::Scan::local): Handle a small subset of reloc types used
12593 (Target_arm::Scan::local): Same.
12594 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12596 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12598 * incremental.cc (Incremental_inputs::report_command_line): Filter
12599 out --incremental-* options.
12601 2009-05-29 Doug Kwan <dougkwan@google.com>
12603 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12605 (class Target_arm): Update comment.
12606 (Target_arm::Target_arm): Initialize new data members GOT_,
12607 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12608 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12609 and Target_arm::rel_dyn_section.
12610 Declare new_enum Target_arm::Got_type.
12611 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12613 Update commments for member do_dynsym_value.
12614 (Target_arm::got_size, Target_arm::plt_section,
12615 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12616 new methods inside class defintion.
12617 (Target_arm::got_section): Define new method.
12618 (Target_arm::rel_dyn_section): Same.
12619 (Output_data_plt_arm): New template class.
12620 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12621 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12622 (Output_data_plt_arm::add_entry): Same.
12623 (Output_data_plt_arm::first_plt_entry): Define new
12624 static data member for PLT instruction template.
12625 (Output_data_plt_arm::plt_entry): Same.
12626 (Output_data_plt_arm::do_write): Define new method.
12627 (Target_arm::make_plt_entry): Same.
12628 (Target_arm::do_finalize_sections): Same.
12629 (Target_arm::do_dynsym_value): Same.
12631 2009-05-28 Doug Kwan <dougkwan@google.com>
12633 * Makefile.am (TARGETSOURCES): Add arm.cc.
12634 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12635 * Makefile.in: Regenerate.
12636 * arm.cc: New file.
12637 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12639 2009-05-26 Doug Kwan <dougkwan@google.com>
12641 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12642 (General_options::check_excluded_libs): Strip off directories in
12643 archive name before matching like GNU ld does.
12644 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12645 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12646 (exclude_libs_test_LDFLAGS): Add linker option
12647 -Wl,--exclude-libs,libexclude_libs_test_3
12648 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12649 an explicit archive without using -l.
12650 (alt/libexclude_libs_test_3.a): New make rule.
12651 * testsuite/Makefile.in: Regenerate.
12652 * testsuite/exclude_libs_test.c : Declare lib3_default().
12654 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12655 * exclude_libs_test_3.c: New file.
12657 2009-05-26 Nick Clifton <nickc@redhat.com>
12659 * po/id.po: New Indonesian translation.
12660 * po/gold.pot: Updated template file.
12662 2009-05-22 Sriraman Tallam <tmsriram@google.com>
12664 * testsuite/Makefile.am: Add -ffunction-sections to compile
12665 gc_comdat_test files. Add -Wl,--gc-sections to build
12667 * testsuite/Makefile.in: Regenerate.
12668 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12670 2009-05-21 Sriraman Tallam <tmsriram@google.com>
12672 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12673 kept comdat section was garbage collected.
12674 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12675 * testsuite/Makefile.in: Regenerate.
12676 * testsuite/gc_comdat_test.sh: New file.
12677 * testsuite/gc_comdat_test_1.cc: New file.
12678 * testsuite/gc_comdat_test_2.cc: New file.
12680 2009-05-19 Doug Kwan <dougkwan@google.com>
12682 * archive.cc (Archive::Archive): Move constructor from archive.h
12683 to here. Initialize no_export_.
12684 (Archive::get_elf_object_for_member): Set no_export flag of object.
12685 * archive.h (Archive::Archive): Move constructor body to
12687 (Archive::no_export): New method.
12688 (Archive::no_export_): New field.
12689 * object.h (Object::Object): Initialize no_export_ to false.
12690 (Object::no_export, Object::set_no_export): New methods.
12691 (Object::no_export_): New field.
12692 * options.cc (General_options::parse_exclude_libs): New method.
12693 (General_options::check_excluded_libs) Same.
12694 * options.h (exclude_libs): New option.
12695 (General_options::check_excluded_libs): New method declaration.
12696 (General_options::excluded_libs_): New field.
12697 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12698 default or protected visibility if an object has no-export flag set.
12699 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12700 (check_SCRIPTS): Add exclude_libs_test.sh.
12701 (check_DATA): Add exclude_libs_test.syms.
12702 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12703 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12704 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12705 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12706 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12707 libexclude_libs_test_2.a): New rules.
12708 * testsuite/Makefile.in: Regenerate.
12709 * testsuite/exclude_libs_test.c: New file.
12710 * testsuite/exclude_libs_test.sh: Ditto.
12711 * testsuite/exclude_libs_test_1.c: Ditto.
12712 * testsuite/exclude_libs_test_2.c: Ditto.
12714 2009-05-15 Ian Lance Taylor <iant@google.com>
12716 * configure.ac: Check for declarations for cases where libiberty.h
12717 checks HAVE_DECL_xxx.
12718 * configure, config.in: Rebuild.
12720 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12722 * gold.h (Incremental_argument_list): Remove (invalid) forward
12724 * incremental.cc (Incremental_inputs::report_achive): New method.
12725 (Incremental_inputs::report_object): New method.
12726 (Incremental_inputs::report_script): New method.
12727 (Incremental_inputs::finalize_inputs): New method.
12728 (Incremental_inputs::finalize): Call finalize_inputs().
12729 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12730 Create inputs entries.
12731 * incremental.h (Incremental_input_type): New enum.
12732 (Incremental_inputs::Incremental_input): Initialize new fields.
12733 (Incremental_inputs::report_inputs): New method.
12734 (Incremental_inputs::report_achive): New method.
12735 (Incremental_inputs::report_object): New method.
12736 (Incremental_inputs::report_script): New method.
12737 (Incremental_inputs::finalize_inputs): New method.
12738 (Incremental_inputs::Input_info): New struct.
12739 (Incremental_inputs::Input_info_map): New typedef.
12740 (Incremental_inputs::lock_): New field.
12741 (Incremental_inputs::Inputs_): New field.
12742 (Incremental_inputs::Inputs_map): New field.
12743 * main.cc (main): Call Incremental_input::report_inputs.
12744 * options.h (Input_argument_list): Typedef moved from
12746 (Input_file_group::Files): Remove, use ::Input_argument_list.
12747 (Input_file_group::Input_argument_list): Remove, use
12748 ::Input_argument_list.
12749 * plugin.cc (Plugin_manager::add_input_file): Add error in
12751 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12753 * script.cc (read_input_script): Call
12754 Incremental_input::report_script.
12755 * script.h (Script_info): New class.
12757 2009-04-27 Ian Lance Taylor <iant@google.com>
12759 * x86_64.cc (do_adjust_output_section): Set entsize to
12762 2009-04-23 Elliott Hughes <enh@google.com>
12764 * output.cc (Output_file::close): After short writes, continue
12765 writing from the correct offset in the buffer being written.
12767 2009-04-23 Chris Demetriou <cgd@google.com>
12769 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12770 * configure: Regenerate.
12771 * config.in: Regenerate.
12772 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12773 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12775 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12777 * incremental.cc (Incremental_inputs_header_data): Renamed from
12778 Incremental_input_header_data.
12779 (Incremental_inputs_header_data::data_size): New field.
12780 (Incremental_inputs_header_data::put_input_file_count): Renamed
12781 from input_file_count.
12782 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12783 from command_line_offset.
12784 (Incremental_inputs_header_data::put_reserved): Renamed from
12786 (Incremental_inputs_entry_data): Renamed from
12787 Incremental_input_entry_data.
12788 (Incremental_inputs_entry_data::data_size): New field.
12789 (Incremental_inputs::report_command_line): New method.
12790 (Incremental_inputs::finalize): New method.
12791 (Incremental_inputs::create_incremental_inputs_data): New method.
12792 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12793 * incremental.h: New file.
12794 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
12795 (Layout::finalize): Create incremental inputs section in
12796 incremental builds.
12797 (Layout::create_incremental_info_sections): New method.
12798 * layout.h (Layout::incremental_inputs): New method.
12799 (Layout::create_incremental_info_sections): New method.
12800 (Layout::incremental_inputs_): New field.
12801 * main.cc (main): Notify Incremental_input of the command line.
12803 2009-04-01 Ian Lance Taylor <iant@google.com>
12804 Mikolaj Zalewski <mikolajz@google.com>
12806 * gold.h (reserve_unordered_map): Define, three versions, one for
12807 each version of Unordered_map.
12808 * layout.cc (Layout::Layout): Remove options parameter. Add
12809 number_of_input_files parameter. Don't initialize options_.
12810 Initialize number_of_input_files_ and resized_signatures_. Move
12811 sections_are_attached_.
12812 (Layout::layout_group): Reserve space for group_signatures_.
12813 (Layout::find_or_add_kept_section): Change name parameter to be a
12814 reference. Resize signatures_ map when it gets large enough.
12815 (Layout::layout_eh_frame): Use parameters->options() instead of
12817 (Layout::make_output_section): Likewise.
12818 (Layout::attach_allocated_section_to_segment): Likewise.
12819 (Layout::finalize, Layout::create_executable_stack): Likewise.
12820 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12821 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12822 * layout.h (class Layout): Update declarations. Remove options_
12823 field. Add number_of_input_files_ and resized_signatures_
12824 fields. Move sections_are_attached_ field.
12825 * main.cc (main): Pass number of input files to Layout
12826 constructor. Don't pass options.
12828 2009-03-30 Ian Lance Taylor <iant@google.com>
12830 * ffsll.c (ffsll): Correct implementation.
12832 2009-03-27 Ian Lance Taylor <iant@google.com>
12834 * ffsll.c: New file.
12835 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12836 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12837 * ftruncate.c (ftruncate): Declare before definition.
12838 * mremap.c (mremap): Likewise.
12839 * pread.c (pread): Likewise.
12840 * configure, Makefile.in, config.in: Rebuild.
12842 * mremap.c: New file.
12843 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12844 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12845 (mremap): Declare if HAVE_MREMAP is not defined.
12846 * configure, Makefile.in, config.in: Rebuild.
12848 2009-03-27 Cary Coutant <ccoutant@google.com>
12850 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12851 position independent.
12852 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12853 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12855 2009-03-24 Cary Coutant <ccoutant@google.com>
12857 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12859 (needs_dynamic_reloc): Likewise.
12861 2009-03-24 Ian Lance Taylor <iant@google.com>
12863 * yyscript.y (file_cmd): Recognize EXTERN.
12864 (extern_name_list, extern_name_list_body): New nonterminals.
12865 * script.cc (script_add_extern): Define.
12866 * script-c.h (script_add_extern): Declare.
12868 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
12870 * object.cc (is_elf_object): Define.
12871 * object.h (is_elf_object): Declare.
12872 * archive.cc (Archive::get_elf_object_for_member): Call
12874 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
12876 2009-03-24 Elliott Hughes <enh@google.com>
12878 * output.cc (Output_file::map_anonymous): Define.
12879 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12880 try an anonymous one. Report the size if the mmap fails.
12881 * output.h (class Output_file): Declare map_anonymous.
12883 2009-03-24 Ian Lance Taylor <iant@google.com>
12885 * target-select.cc (instantiate_target): Don't acquire the lock if
12886 the instantiated_target_ field has already been set.
12888 2009-03-23 Ian Lance Taylor <iant@google.com>
12890 * gold-threads.h (class Initialize_lock): Define.
12891 * gold-threads.cc (class Initialize_lock_once): Define.
12892 (initialize_lock_control): New static variable.
12893 (initialize_lock_pointer): New static variable.
12894 (initialize_lock_once): New static function.
12895 (Initialize_lock::Initialize_lock): Define.
12896 (Initialize_lock::initialize): Define.
12897 * target-select.h: Include "gold-threads.h".
12898 (class Target_selector): Add lock_ and initialize_lock_ fields.
12899 Don't define instantiate_target, just declare it.
12900 * target-select.cc (Target_selector::Target_selector): Initialize
12902 (Target_selector::instantiate_target): Define.
12903 * descriptors.h: Include "gold-threads.h".
12904 (class Descriptors): Add initialize_lock_ field.
12905 * descriptors.cc (Descriptors::Descriptors): Initialize new
12907 (Descriptors::open): Use initialize_lock_ field
12908 * errors.h (class Errors): Add initialize_lock_ field.
12909 * errors.cc (Errors::Errors): Initialize new field.
12910 (Errors::initialize_lock): Use initialize_lock_ field.
12911 * powerpc.cc (class Target_selector_powerpc): Remove
12912 instantiated_target_ field. In do_recognize call
12913 instantiate_target rather than do_instantiate_target. In
12914 do_instantiate_target just allocate a new target.
12915 * sparc.cc (class Target_selector_sparc): Likewise.
12917 * freebsd.h: New file.
12918 * i386.cc: Include "freebsd.h".
12919 (Target_i386): Derive from Target_freebsd rather than
12921 (Target_selector_i386): Derive from Target_selector_freebsd rather
12922 than Target_selector.
12923 * x86_64.cc: Include "freebsd.h".
12924 (Target_x86_64): Derive from Target_freebsd rather than
12926 (Target_selector_x86_64): Derive from Target_selector_freebsd
12927 rather than Target_selector.
12928 * target.h (class Target): Add adjust_elf_header and
12929 do_adjust_elf_header.
12930 * output.cc (Output_file_header:: do_sized_write): Call target
12931 adjust_elf_header routine.
12932 * configure.tgt: Set targ_osabi.
12933 * configure.ac: Define GOLD_DEFAULT_OSABI.
12934 * parameters.cc (Parameters::default_target): Pass
12935 GOLD_DEFAULT_OSABI to select_target.
12936 * target-select.h (class Target_selector): Make instantiate_target
12937 protected rather than private.
12938 * Makefile.am (HFILES): Add freebsd.h.
12939 * configure, Makefile.in, config.in: Rebuild.
12941 * merge.cc (do_add_input_section): Correct pend value. Change
12942 message about last entry not being null terminated from error to
12945 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12947 * incremental.cc: New file.
12948 * Makefile.am (CCFILES): Add incremental.cc.
12949 * Makefile.in: Rebuild.
12951 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12953 * layout.cc (Layout::output_section_name): Preserve names
12954 of '.note.' sections.
12956 2009-03-19 Ian Lance Taylor <iant@google.com>
12958 * descriptors.cc (Descriptors::open): Check that the options are
12959 valid before using them.
12961 2009-03-18 Ian Lance Taylor <iant@google.com>
12963 * script-sections.h: Include <list>.
12964 (class Script_sections): Change Sections_elements from std::vector
12965 to std::list. Typedef public Elements_iterator. Add
12966 orphan_section_placement_, data_segment_align_start_, and
12967 saw_data_segment_align_ fields. Remove data_segment_align_index_
12969 * script-sections.cc (class Orphan_section_placement): New class.
12970 (class Sections_element): Add virtual functions is_relro and
12971 orphan_section_init. Remove virtual function place_orphan_here.
12972 (class Output_section_definition): Add is_relro and
12973 orphan_section_init. Remove place_orphan_here.
12974 (class Orphan_output_section): Likewise.
12975 (Script_sections::Script_sections): Update for field changes.
12976 (Script_sections::data_segment_align): Set saw_data_segment_align_
12977 and data_segment_align_start_, not data_segment_align_index.
12978 (Script_sections::data_segment_relro_end): Check
12979 saw_data_segment_align_. Use data_segment_align_start_ rather
12980 than data_segment_align_index_.
12981 (Script_sections::place_orphan): Rewrite to use
12982 Orphan_section_placement.
12984 2009-03-17 Ian Lance Taylor <iant@google.com>
12986 * archive.cc (Archive::add_symbols): Check for a version attached
12987 to the symbol name in the archive map.
12988 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12989 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12990 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12991 (ver_test_11.a): New target.
12992 * testsuite/Makefile.in: Rebuild.
12994 * configure.ac: Check for chsize and posix_fallocate. Replace
12996 * ftruncate.c: New file, from gnulib.
12997 * output.cc (posix_fallocate): Define dummy version if not
12998 HAVE_POSIX_FALLOCATE.
12999 (Output_file::map): Call posix_fallocate rather than lseek and
13001 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13002 * configure, Makefile.in, config.in: Rebuild.
13004 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
13006 * layout.h (Layout::create_note): Add section_name parameter.
13007 * layout.cc (Layout::create_note): Likewise.
13008 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
13010 2009-03-17 Ian Lance Taylor <iant@google.com>
13012 * descriptors.cc: Include "options.h".
13013 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13014 (Descriptors::open): Always use O_CLOEXEC when opening a new
13015 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13016 then set FD_CLOEXEC.
13018 * sparc.cc (class Target_sparc): Add has_got_section.
13019 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13020 make sure we have a GOT section.
13022 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13023 (Target_sparc::Scan::local): Likewise.
13024 (Target_sparc::Scan::global): Likewise.
13025 (Target_sparc::Relocate::relocate): Likewise.
13026 (Target_sparc::Relocate::relocate_tls): Likewise.
13028 * symtab.cc (Symbol_table::define_default_version): New function,
13029 broken out of add_from_object.
13030 (Symbol_table::add_from_object): Call define_default_version.
13031 (Symbol_table::define_special_symbol): Add resolve_oldsym
13032 parameter. Change all callers. If the version for a symbol comes
13033 from a version script, resolve it with the symbol with the same
13034 name with no version. Also add the symbol without a version if
13036 (do_define_in_output_data): If resolving with oldsym, don't delete
13038 (do_define_in_output_segment): Likewise.
13039 (do_define_as_constant): Likewise.
13040 * symtab.h (class Symbol_table): Update declarations.
13042 2009-03-13 Ian Lance Taylor <iant@google.com>
13044 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13045 (Read_symbols::requeue): New function.
13046 (Read_symbols::do_read_symbols): If make_elf_object fails because
13047 the target type is not configured, and the file was searched for,
13048 issue a warning and retry with the next directory.
13049 (Add_symbols::run): If the file has an incompatible format, and
13050 it was searched for, requeue the Read_symbols task. On error,
13051 release the object.
13052 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13053 dirindex parameter to constructor. Change all callers. Declare
13054 incompatible_warning and requeue.
13055 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13056 input_argument_ and input_group_ fields. Add them to
13057 constructor. Change all callers.
13058 (class Read_script): Add dirindex_ field. Add it to constructor.
13059 Change all callers.
13060 * archive.cc (Archive::setup): Remove input_objects parameter.
13061 Change all callers.
13062 (Archive::get_file_and_offset): Likewise.
13063 (Archive::read_all_symbols): Likewise.
13064 (Archive::read_symbols): Likewise.
13065 (Archive::get_elf_object_for_member): Remove input_objects
13066 parameter. Add punconfigured parameter. Change all callers.
13067 (Archive::add_symbols): Change return type to bool. Check return
13068 value of include_member.
13069 (Archive::include_all_members): Likewise.
13070 (Archive::include_member): Change return type to bool. Return
13071 false if first included object has incompatible target. Set
13072 included_member_ field.
13073 (Add_archive_symbols::run): If add_symbols returns false, requeue
13075 * archive.h (class Archive): Add included_member_ field.
13076 Initialize it in constructor. Add input_file and searched_for
13077 methods. Update declarations.
13078 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13079 input_argument_ fields. Add them to constructor. Change all
13081 * script.cc: Include "target-select.h".
13082 (class Parser_closure): Add skip_on_incompatible_target_ and
13083 found_incompatible_target_ fields. Add
13084 skip_on_incompatible_target parameter to constructor. Change all
13085 callers. Add methods skip_on_incompatible_target,
13086 clear_skip_on_incompatible_target, found_incompatible_target, and
13087 set_found_incompatible_target.
13088 (read_input_script): Add dirindex parameter. Change all callers.
13089 If parser finds an incompatible target, requeue Read_symbols
13091 (script_set_symbol): Clear skip_on_incompatible_target in
13093 (script_add_assertion, script_parse_option): Likewise.
13094 (script_start_sections, script_add_phdr): Likewise.
13095 (script_check_output_format): New function.
13096 * script.h (read_input_script): Update declaration.
13097 * script-c.h (script_check_output_format): Declare.
13098 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13099 (ignore_cmd): Remove OUTPUT_FORMAT.
13100 * fileread.cc (Input_file::Input_file): Add explicit this.
13101 (Input_file::will_search_for): New function.
13102 (Input_file::open): Add pindex parameter. Change all callers.
13103 * fileread.h (class Input_file): Add input_file_argument method.
13104 Declare will_search_for. Update declarations.
13105 * object.cc (make_elf_object): Add punconfigured parameter.
13106 Change all callers.
13107 * object.h (class Object): Make input_file public. Add
13108 searched_for method.
13109 (make_elf_object): Update declaration.
13110 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13112 * dirsearch.h (class Dirsearch): Update declaration.
13113 * options.h (class General_options): Add --warn-search-mismatch.
13114 * parameters.cc (Parameters::is_compatible_target): New function.
13115 * parameters.h (class Parameters): Declare is_compatible_target.
13116 * workqueue.cc (Workqueue::add_blocker): New function.
13117 * workqueue.h (class Workqueue): Declare add_blocker.
13119 * fileread.cc (Input_file::open): Remove options parameter.
13120 Change all callers.
13121 (Input_file::open_binary): Likewise.
13122 * script.cc (read_input_script): Likewise.
13123 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13124 options parameter from constructor. Change all callers.
13125 (class Read_script): Likewise.
13126 * fileread.h (class Input_file): Update declarations.
13127 * script.h (read_input_script): Update declaration.
13129 2009-03-10 Nick Clifton <nickc@redhat.com>
13131 * po/es.po: New Spanish translation.
13133 2009-03-06 Cary Coutant <ccoutant@google.com>
13135 * options.cc (parse_short_option): Keep dash_z from registering itself.
13137 2009-03-03 Ian Lance Taylor <iant@google.com>
13140 * target-reloc.h (relocate_section): Pass output_section to
13142 * i386.cc (Target_i386::should_apply_static_reloc): Add
13143 output_section parameter. Change all callers.
13144 (Target_i386::Relocate::relocate): Add output_section parameter.
13145 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13146 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13147 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13148 * testsuite/two_file_shared.sh: New script.
13149 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13150 (check_DATA): Add two_file_shared.dbg.
13151 (two_file_shared.dbg): New target.
13152 * testsuite/Makefile.in: Rebuild.
13154 2009-03-01 Ian Lance Taylor <iant@google.com>
13156 * configure.ac: Check for byteswap.h.
13157 * configure: Rebuild.
13158 * config.in: Rebuild.
13160 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13162 * layout.cc (Layout::find_or_add_kept_section): New function.
13163 (Layout::add_comdat): Removed.
13164 * layout.h (struct Kept_section): Move out of class Layout.
13165 Remove trailing underscores from field names. Add group_sections
13166 field. Rename group_ field to is_group. Change all uses.
13167 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13168 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13169 comdat_groups_ field.
13170 (Sized_relobj::include_section_group): Use
13171 find_or_add_kept_section and Kept_section::group_sections.
13172 (Sized_relobj::include_linkonce_section): Likewise.
13173 * object.cc (class Sized_relobj): Don't define Comdat_group or
13174 Comdat_group_table. Remove find_comdat_group and
13175 add_comdat_group. Remove comdat_groups_ field.
13176 * plugin.cc (include_comdat_group): Use
13177 Layout::find_or_add_kept_section.
13179 2009-02-28 Ian Lance Taylor <iant@google.com>
13181 * README: --gc-sections and map files are now supported. Document
13182 some build requirements.
13185 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13186 relocatable link set the value of the section symbol to zero.
13187 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13188 relocatable link don't include the section address in the local
13191 2009-02-27 Ian Lance Taylor <iant@google.com>
13194 * options.h (class Search_directory): Add is_system_directory.
13195 (class General_options): Declare is_in_system_directory.
13196 * options.cc (get_relative_sysroot): Make static.
13197 (get_default_sysroot): Make static.
13198 (General_optoins::is_in_system_directory): New function.
13199 * fileread.cc (Input_file::is_in_system_directory): New function.
13200 * fileread.h (class Input_file): Declare is_in_system_directory.
13201 * object.h (class Object): Add is_in_system_directory.
13202 (class Input_objects): Remove system_library_directory_ field.
13203 * object.cc (Input_objects::add_object): Don't set
13204 system_library_directory_.
13205 (input_objects::found_in_system_library_directory): Remove.
13206 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13207 parameter. Change all callers.
13208 (Symbol_table::sized_write_globals): Likewise.
13209 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13210 Call Object::is_in_system_directory.
13211 * symtab.h (class Symbol_table): Update declarations.
13214 * descriptors.h (Open_descriptor): Add is_on_stack field.
13215 * descriptors.cc (Descriptors::open): If the descriptor is on the
13216 top of the stack, remove it. Initialize is_on_stack field.
13217 (Descriptors::release): Only add pod to stack if it is not on the
13219 (Descriptors::close_some_descriptor): Clear stack_next and
13220 is_on_stack fields.
13223 * output.cc (Output_section::find_starting_output_address): Rename
13224 from starting_output_address; add PADDR parameter; change return
13226 * output.h (class Output_section): Declare
13227 find_starting_output_address instead of starting_output_address.
13228 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13229 section symbol for which we can't find a merge section.
13232 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13233 hidden or internal, force the symbol to be local.
13234 * resolve.cc (Symbol::override_visibility): Define.
13235 (Symbol::override_base): Use override_visibility.
13236 (Symbol_table::resolve): Likewise.
13237 (Symbol::override_base_with_special): Likewise.
13238 (Symbol_table::override_with_special): If the visibility is hidden
13239 or internal, force the symbol to be local.
13240 * symtab.h (class Symbol): Add set_visibility and
13241 override_visibility.
13242 * testsuite/ver_test_1.sh: New file.
13243 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13244 (check_DATA): Add ver_test_1.syms.
13245 (ver_test_1.syms): New target.
13246 * testsuite/Makefile.in: Rebuild.
13248 2009-02-25 Cary Coutant <ccoutant@google.com>
13250 * layout.cc (Layout::choose_output_section): Don't rename sections
13251 when using a linker script that has a SECTIONS clause.
13252 * Makefile.in: Regenerate.
13254 * testsuite/Makefile.am (script_test_5.sh): New test case.
13255 * testsuite/Makefile.in: Regenerate.
13256 * testsuite/script_test_5.cc: New file.
13257 * testsuite/script_test_5.sh: New file.
13258 * testsuite/script_test_5.t: New file.
13260 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
13262 * archive.cc (Archive::include_member): Update calls to add_symbols.
13263 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13264 the Layout argument.
13265 * dynobj.h (do_add_symbols): Add the Layout argument.
13266 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13268 * object.h (Object::add_symbols): Add the Layout argument.
13269 (Object::do_add_symbols): Add the Layout argument.
13270 (Sized_relobj::do_add_symbols): Add the Layout argument.
13271 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13272 Unify the two versions.
13273 (Add_plugin_symbols): Remove.
13274 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13275 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13276 (Add_plugin_symbols): Remove.
13277 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13278 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13279 (Add_symbols::run): Make it work with Pulginobj.
13281 2009-02-06 Ian Lance Taylor <iant@google.com>
13283 * object.cc (Sized_relobj::do_layout): Make info message start
13284 with lower case letter.
13286 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13288 * binary.cc: Fix file comment.
13290 * options.h (enum Incremental_disposition): Define.
13291 (class General_options): Add new options: --incremental,
13292 --incremental_changed, --incremental_unchanged,
13293 --incremental_unknown. Add incremental_disposition_ and
13294 implicit_incremental_ fields.
13295 (General_options::incremental_disposition): New function.
13296 (class Position_dependent_options): Add incremental_disposition
13298 (Position_dependent_options::copy_from_options): Set incremental
13300 * options.cc (General_options::parse_incremental_changed): New
13302 (General_options::parse_incremental_unchanged): New function.
13303 (General_options::parse_incremental_unknown): New function.
13304 (General_options::General_options): Initialize new fields
13305 incremental_disposition_ and implicit_incremental_.
13306 (General_options::finalize): Check for uasge of --incremental-*
13307 without --incremental.
13309 2009-02-06 Chris Demetriou <cgd@google.com>
13311 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13312 pointer and to report location as the file name associated with
13314 (gold_undefined_symbol_at_location): New function to replace the
13315 old gold_undefined_symbol functionality.
13316 * target-reloc.h (relocate_section): Update to use
13317 gold_undefined_symbol_at_location.
13318 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13319 Call gold_undefined_symbol function rather than gold_error.
13320 * errors.h (Errors::undefined_symbol): Take location as a
13321 string, rather than calculating it from a relocation.
13322 * errors.cc (Errors::fatal): Print "fatal error:" before the
13324 (Errors::error, Errors::error_at_location): Print "error: "
13325 before the formatted message.
13326 (Errors::undefined_symbol): Take location as a string, rather
13327 than calculating it from a relocation.
13328 (gold_undefined_symbol_at_location): New function akin to
13329 old gold_undefined_symbol, calculates location from relocation.
13330 (gold_undefined_symbol): Change to take only a Symbol pointer
13331 and to report location as the file name associated with the symbol.
13332 * testsuite/debug_msg.sh: Update for changed error messages.
13333 * testsuite/undef_symbol.sh: Likewise.
13335 2009-02-04 Duncan Sands <baldrick@free.fr>
13338 * reduced_debug_output.h
13339 (Output_reduced_debug_abbrev_section::failed): Use format for
13341 (Output_reduced_debug_info_section::faild): Likewise.
13343 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13345 * script.cc (Lazy_demangler): New class.
13346 (Version_script_info::get_symbol_version_helper): Demangle a
13349 2009-01-29 Cary Coutant <ccoutant@google.com>
13351 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13353 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13355 2009-01-28 Ian Lance Taylor <iant@google.com>
13357 * version.cc (version_string): Bump to 1.9.
13359 * gold.h: Include <cstring> and <stdint.h>.
13360 * version.cc: Include <cstdio>.
13361 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13363 * reduced_debug_output.cc (insert_into_vector): Rename from
13364 Insert_into_vector; change all callers. Use Swap_unaligned to
13365 avoid aliasing issue; remove union since it is unnecessary.
13367 2009-01-27 Sriraman Tallam <tmsriram@google.com>
13369 * Makefile.am (CCFILES): Add gc.cc.
13370 (HFILES): Add gc.h.
13371 * Makefile.in: Regenerate.
13372 * gold.cc (Gc_runner): New class.
13373 (queue_initial_tasks): Call garbage collection related tasks
13374 when corresponding options are invoked.
13375 (queue_middle_gc_tasks): New function.
13376 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13377 processed early before laying out sections during garbage collection.
13378 * gold.h (queue_middle_gc_tasks): New function.
13379 (is_prefix_of): Move from "layout.cc".
13380 * i386.cc (Target_i386::gc_process_relocs): New function.
13381 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13382 * main.cc (main): Create object of class "Garbage_collection".
13383 * object.cc (Relobj::copy_symbols_data): New function.
13384 (Relobj::is_section_name_included): New function.
13385 (Sized_relobj::do_layout): Allow this function to be called twice
13386 during garbage collection and defer layout of section during the
13388 * object.h (Relobj::get_symbols_data): New function.
13389 (Relobj::is_section_name_included): New function.
13390 (Relobj::copy_symbols_data): New function.
13391 (Relobj::set_symbols_data): New function.
13392 (Relobj::get_relocs_data): New function.
13393 (Relobj::set_relocs_data): New function.
13394 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13395 (Relobj::gc_process_relocs): New function.
13396 (Relobj::do_gc_process_relocs): New pure virtual function.
13397 (Relobj::sd_): New data member.
13398 (Sized_relobj::is_output_section_offset_invalid): New function.
13399 (Sized_relobj::do_gc_process_relocs): New function.
13400 * options.h (General_options::gc_sections): Modify to not be a no-op.
13401 (General_options::print_gc_sections): New option.
13402 * plugin.cc (Plugin_finish::run): Remove function call to
13403 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13404 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13405 * reloc.cc (Read_relocs::run): Add task to process relocs and
13406 determine unreferenced sections when doing garbage collection.
13407 (Gc_process_relocs): New class.
13408 (Sized_relobj::do_gc_process_relocs): New function.
13409 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13410 sections that are garbage collected.
13411 * reloc.h (Gc_process_relocs): New class.
13412 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13413 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13414 symbols whose corresponding sections are garbage collected.
13415 (Symbol_table::Symbol_table): Add new parameter for the garbage
13417 (Symbol_table::gc_mark_undef_symbols): New function.
13418 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13419 (Symbol_table::gc_mark_dyn_syms): New function.
13420 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13422 (Symbol_table::add_from_object): Likewise.
13423 (Symbol_table::add_from_relobj): When building shared objects, do not
13424 treat externally visible symbols as garbage.
13425 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13426 table information for static and relocatable links.
13427 * symtab.h (Symbol_table::set_gc): New function.
13428 (Symbol_table::gc): New function.
13429 (Symbol_table::gc_mark_undef_symbols): New function.
13430 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13431 (Symbol_table::gc_mark_dyn_syms): New function.
13432 (Symbol_table::gc_): New data member.
13433 * target.h (Sized_target::gc_process_relocs): New pure virtual
13435 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13436 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13438 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13440 * options.h (General_options::gc_sections): Define as a no-op for now.
13441 (General_options::no_keep_memory): Ditto.
13442 (General_options::Bshareable): Define.
13443 * options.cc (General_options::finalize): Honor -Bshareable.
13445 2009-01-20 Andreas Schwab <schwab@suse.de>
13447 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13448 read the value in the contents, since we don't use it. Use the
13449 template endianness when writing.
13450 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13452 2009-01-19 Andreas Schwab <schwab@suse.de>
13454 * configure.tgt (powerpc64-*): Fix targ_obj.
13456 2009-01-15 Ian Lance Taylor <iant@google.com>
13458 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13459 local symbols when stripping all symbols.
13461 2009-01-14 Cary Coutant <ccoutant@google.com>
13463 * output.cc (Output_reloc): Add explicit instantiations.
13465 2009-01-14 Cary Coutant <ccoutant@google.com>
13467 * archive.cc (Archive::get_elf_object_for_member): Remove call
13468 to File_read::claim_for_plugin.
13469 * descriptors.cc (Descriptors::open): Remove reference to
13471 (Descriptors::claim_for_plugin): Remove.
13472 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13473 (Descriptors::is_claimed): Remove.
13474 (claim_descriptor_for_plugin): Remove.
13475 * fileread.cc (File_read::claim_for_plugin): Remove.
13476 * fileread.h (File_read::claim_for_plugin): Remove.
13477 (File_read::descriptor): Reopen descriptor if necessary.
13478 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13479 (Plugin_manager::all_symbols_read): Add task parameter. Change
13481 (Plugin_manager::get_input_file): New function.
13482 (Plugin_manager::release_input_file): New function.
13483 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13484 corresponding data member.
13485 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13486 and pass to base constructor. Change all callers.
13487 (get_input_file, release_input_file): New functions.
13488 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13489 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13490 (Plugin_manager::all_symbols_read): Add task parameter.
13491 (Plugin_manager::get_input_file): New function.
13492 (Plugin_manager::release_input_file): New function.
13493 (Plugin_manager::task_): New data member.
13494 (Pluginobj::Pluginobj): Add filesize parameter.
13495 (Pluginobj::filename): New function.
13496 (Pluginobj::descriptor): New function.
13497 (Pluginobj::filesize): New function.
13498 (Pluginobj::filesize_): New data member.
13499 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13500 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13501 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13503 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13504 with archive libraries.
13505 * testsuite/Makefile.in: Regenerate.
13506 * testsuite/plugin_test.c (struct sym_info): New type.
13507 (get_input_file, release_input_file): New static variables.
13508 (onload): Capture new transfer vector entries.
13509 (claim_file_hook): Stop reading at end of file according to filesize.
13510 Factor out parsing of readelf output into separate function.
13511 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13512 APIs and get the source file name from the symbol table. Convert
13513 source file name to corresponding object file name. Print info
13514 message when adding new input files.
13515 (parse_readelf_line): New function.
13516 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13517 * testsuite/plugin_test_2.sh: Likewise.
13518 * testsuite/plugin_test_3.sh: Likewise.
13519 * testsuite/plugin_test_4.sh: New test case.
13521 2009-01-07 Ian Lance Taylor <iant@google.com>
13523 * version.cc (version_string): Bump to 1.8.
13525 2008-12-23 Cary Coutant <ccoutant@google.com>
13527 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13528 * plugin.cc (Plugin_manager::finish): Rename as
13529 layout_deferred_objects. Move cleanup to separate function.
13530 (Plugin_manager::cleanup): New function.
13531 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13533 * plugin.h (Plugin_manager::finish): Rename as
13534 layout_deferred_objects.
13535 (Plugin_manager::cleanup): New function.
13536 (Plugin_manager::cleanup_done): New field.
13538 2008-12-23 Cary Coutant <ccoutant@google.com>
13540 * plugin.cc (is_visible_from_outside): New function.
13541 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13542 so we don't return "IR only" status for exported symbols or -r links.
13544 * testsuite/Makefile.am (plugin_test_3): New test case.
13545 * testsuite/Makefile.in: Regenerate.
13546 * testsuite/plugin_test_3.sh: New file.
13548 2008-12-22 Cary Coutant <ccoutant@google.com>
13550 * object.cc (Sized_relobj::layout_section): New function.
13551 (Sized_relobj::do_layout): Defer layout of input sections until after
13552 plugin has provided replacement files.
13553 (Sized_relobj::do_layout_deferred_sections): New function.
13554 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13555 (Relobj::layout_deferred_sections): New function.
13556 (Relobj::do_layout_deferred_sections): New function.
13557 (Sized_relobj::do_layout_deferred_sections): New function.
13558 (Sized_relobj::layout_section): New function.
13559 (Sized_relobj::Deferred_layout): New structure.
13560 (Sized_relobj::deferred_layout_): New field.
13561 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13562 Change all callers. Layout deferred sections.
13563 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13565 (Plugin_hook::run): Move code from do_plugin_hook inline.
13566 (Plugin_hook::do_plugin_hook): Remove.
13567 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13568 (Plugin_manager::finish): Renamed, was cleanup.
13569 (Plugin_manager::should_defer_layout): New function.
13570 (Plugin_manager::add_deferred_layout_object): New function.
13571 (Plugin_manager::Deferred_layout_list): New type.
13572 (Plugin_manager::deferred_layout_objects_): New field.
13573 (Plugin_hook::do_plugin_hook): Remove.
13575 2008-12-17 Ian Lance Taylor <iant@google.com>
13577 * options.h (class General_options): Add --no case for
13580 2008-12-16 Cary Coutant <ccoutant@google.com>
13582 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13584 (Plugin_manager::claim_file): Create plugin object even if
13585 plugin did not call the add_symbols callback.
13586 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13587 asking for more symbols than were added.
13588 * testsuite/Makefile.am (plugin_test_1): Add test case with
13590 (empty.syms): New target.
13591 * testsuite/Makefile.in: Regenerate.
13592 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13593 message. Don't call add_symbols if no globals.
13594 (all_symbols_read_hook): Don't provide replacement for empty
13597 2008-12-12 Ian Lance Taylor <iant@google.com>
13599 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13600 r_type == 0 for a local symbol with r_sym == 0.
13601 (scan_relocatable_relocs): Pass r_sym to
13602 local_non_section_strategy.
13603 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13606 * configure.ac: Update test for TLS descriptors: they are
13607 supported as of glibc 2.9.
13608 * configure: Rebuild.
13610 2008-12-11 Ian Lance Taylor <iant@google.com>
13613 * target-reloc.h (Default_scan_relocatable_relocs): For each
13614 function, map r_type == 0 to RELOC_DISCARD.
13616 2008-12-10 Cary Coutant <ccoutant@google.com>
13618 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13619 object to override a kept COMDAT group from a plugin object.
13621 2008-12-09 Ian Lance Taylor <iant@google.com>
13624 * yyscript.y (file_cmd): Handle INPUT.
13626 * testsuite/initpri1.c: Change all declarations to be full
13627 prototypes by adding void, to avoid compiler warnings.
13629 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
13631 * options.cc (General_options::parse_plugin_opt): New.
13632 (General_options::add_plugin): The argument now is just the filename.
13633 (General_options::add_plugin_option): New.
13634 * options.h (plugin_opt): New.
13635 (add_plugin): Change argument name.
13636 (add_plugin_option): New.
13637 * plugin.cc (Plugin::load): Don't parse the plugin option.
13638 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13639 (Plugin::add_option): New.
13640 (Plugin::args_): Change type.
13641 (Plugin::filename_): New.
13642 (Plugin_manager::add_plugin_option): New.
13643 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13644 * testsuite/Makefile.in: Regenerate.
13646 2008-12-05 Cary Coutant <ccoutant@google.com>
13648 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13649 Handle --strip-lto-sections option.
13650 * options.h (strip_lto_sections): New option.
13652 2008-12-01 Cary Coutant <ccoutant@google.com>
13654 * plugin.cc (ld_plugin_message): Change format parameter to const.
13655 Fix mismatch between new[] and delete.
13657 2008-11-14 Cary Coutant <ccoutant@google.com>
13659 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13662 2008-11-05 Craig Silverstein <csilvers@google.com>
13664 * options.cc (General_options::parse_dynamic_list): New function.
13665 * options.h (General_options): New flags dynamic_list,
13666 dynamic_list_data, dynamic_list_cpp_new, and
13667 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13668 (General_options::in_dynamic_list): New function.
13669 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13670 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13671 (Lex::can_continue_name): Likewise.
13673 (read_script_file): New parameter script_options.
13674 (read_dynamic_list): New function.
13675 (Script_options::define_dynamic_list): New function.
13676 (dynamic_list_keyword_parsecodes): New variable.
13677 (dynamic_list_keywords): New variable.
13678 * script.h (Script_options::define_dynamic_list): New function
13680 (read_dynamic_list): New function prototype.
13681 * symtab.cc (strprefix): New macro.
13682 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13683 dynamic_list_data, dynamic_list_cpp_new, and
13684 dynamic_list_cpp_typeinfo.
13685 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13686 (dynamic_list_expr): New rule.
13687 (dynamic_list_nodes): Likewise.
13688 (dynamic_list_node): Likewise.
13689 * testsuite/Makefile.am (dynamic_list): New test.
13690 * testsuite/Makefile.in: Regenerated.
13691 * testsuite/dynamic_list.t: New file.
13692 * testsuite/dynamic_list.sh: New file.
13694 2008-11-05 Craig Silverstein <csilvers@google.com>
13696 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13697 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13698 (t11_last): Likewise.
13699 * testsuite/ver_test_6.c (main): Likewise.
13701 2008-10-07 Cary Coutant <ccoutant@google.com>
13703 * options.c (General_options::finalize): Add check for -static and
13705 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13708 2008-10-02 Cary Coutant <ccoutant@google.com>
13710 * plugin.cc (make_sized_plugin_object): Fix conditional
13711 compilation to work when not all targets are enabled.
13713 2008-09-29 Cary Coutant <ccoutant@google.com>
13715 * archive.cc (Archive::get_file_and_offset): Use filename instead
13716 of name to get library path.
13717 (Archive::include_member): Unlock external member of a thin archive.
13719 * testsuite/Makefile.am (TEST_AR): New variable.
13720 (thin_archive_test_1): New test.
13721 (thin_archive_test_2): New test.
13722 * testsuite/Makefile.in: Regenerate.
13723 * testsuite/thin_archive_main.cc: New file.
13724 * testsuite/thin_archive_test_1.cc: New file.
13725 * testsuite/thin_archive_test_2.cc: New file.
13726 * testsuite/thin_archive_test_3.cc: New file.
13727 * testsuite/thin_archive_test_4.cc: New file.
13729 2008-09-29 Cary Coutant <ccoutant@google.com>
13731 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13732 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13734 (Sized_relobj::do_finalize_local_symbols): Likewise.
13735 (Sized_relobj::map_to_kept_section): Likewise.
13736 * object.h (Sized_relobj::invalid_address): New constant.
13737 (Sized_relobj::do_output_section_offset): Check for invalid_address
13739 * output.cc (Output_reloc::local_section_offset): Use constant
13740 invalid_address instead of -1U.
13741 (Output_reloc::get_address): Likewise.
13742 (Output_section::output_address): Change -1U to -1ULL.
13743 * output.h (Output_reloc::invalid_address): New constant.
13744 * reloc.cc (Sized_relobj::write_sections): Use constant
13745 invalid_address instead of -1U.
13746 (Sized_relobj::relocate_sections): Likewise.
13747 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13748 values for merge sections.
13749 * target-reloc.h (relocate_for_relocatable): Use constant
13750 invalid_address instead of -1U.
13752 2008-09-19 Cary Coutant <ccoutant@google.com>
13754 Add plugin functionality for link-time optimization (LTO).
13755 * configure.ac (plugins): Add --enable-plugins option.
13756 * configure: Regenerate.
13757 * config.in: Regenerate.
13758 * Makefile.am (LIBDL): New variable.
13759 (CCFILES): Add plugin.cc.
13760 (HFILES): Add plugin.h.
13761 (ldadd_var): Add LIBDL.
13762 * Makefile.in: Regenerate.
13764 * archive.cc: Include "plugin.h".
13765 (Archive::setup): Don't preread archive symbols when using a plugin.
13766 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13767 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13769 (Archive::include_member): Add symbols from plugin objects.
13770 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13771 * descriptors.cc (Descriptors::open): Check for file descriptors
13772 abandoned by plugins.
13773 (Descriptors::claim_for_plugin): New function.
13774 * descriptors.h (Descriptors::claim_for_plugin): New function.
13775 (Open_descriptor::is_claimed): New field.
13776 (claim_descriptor_for_plugin): New function.
13777 * fileread.cc (File_read::claim_for_plugin): New function.
13778 * fileread.h (File_read::claim_for_plugin): New function.
13779 (File_read::descriptor): New function.
13780 * gold.cc: Include "plugin.h".
13781 (queue_initial_tasks): Add task to call plugin hooks for generating
13783 * main.cc: Include "plugin.h".
13784 (main): Load plugin libraries.
13785 * object.h (Pluginobj): Declare.
13786 (Object::pluginobj): New function.
13787 (Object::do_pluginobj): New function.
13788 (Object::set_target): New function.
13789 * options.cc: Include "plugin.h".
13790 (General_options::parse_plugin): New function.
13791 (General_options::General_options): Initialize plugins_ field.
13792 (General_options::add_plugin): New function.
13793 * options.h (Plugin_manager): Declare.
13794 (General_options): Add --plugin option.
13795 (General_options::has_plugins): New function.
13796 (General_options::plugins): New function.
13797 (General_options::add_plugin): New function.
13798 (General_options::plugins_): New field.
13799 * plugin.cc: New file.
13800 * plugin.h: New file.
13801 * readsyms.cc: Include "plugin.h".
13802 (Read_symbols::do_read_symbols): Check for archive before checking
13803 for ELF file. Call plugin hooks to claim files.
13804 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13805 from a real object file; force override when processing replacement
13807 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13808 (Symbol::init_base_object): Likewise.
13809 (Symbol::init_base_output_data): Likewise.
13810 (Symbol::init_base_output_segment): Likewise.
13811 (Symbol::init_base_constant): Likewise.
13812 (Symbol::init_base_undefined): Likewise.
13813 (Symbol::output_section): Assert that object is not a plugin.
13814 (Symbol_table::add_from_pluginobj): New function.
13815 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13817 (Symbol_table::sized_write_globals): Likewise.
13818 (Symbol_table::add_from_pluginobj): Instantiate template.
13819 * symtab.h (Sized_pluginobj): Declare.
13820 (Symbol::in_real_elf): New function.
13821 (Symbol::set_in_real_elf): New function.
13822 (Symbol::in_real_elf_): New field.
13823 (Symbol_table::add_from_pluginobj): New function.
13825 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13826 (LIBDL): New variable.
13827 (LDADD): Add LIBDL.
13828 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13829 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13830 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13831 (MOSTLYCLEANFILES): Likewise.
13832 * testsuite/Makefile.in: Regenerate.
13833 * testsuite/plugin_test.c: New file.
13834 * testsuite/plugin_test_1.sh: New file.
13835 * testsuite/plugin_test_2.sh: New file.
13837 2008-09-16 Ian Lance Taylor <iant@google.com>
13839 * target-reloc.h (relocate_section): Check whether a symbol is
13840 defined by the ABI before reporting an undefined symbol error.
13841 * target.h (Target::is_defined_by_abi): Make parameter const.
13842 (Target::do_is_defined_by_abi): Likewise.
13843 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13844 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13845 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13846 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13847 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13848 * testsuite/Makefile.in: Rebuild.
13850 * fileread.cc (make_view): Add casts to avoid warning.
13852 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13854 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13855 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13857 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13859 * options.h (General_options::output_is_executable): New.
13860 (General_options::output_is_pie): New.
13861 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13862 for shared libraries.
13863 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13865 2008-09-11 Chris Demetriou <cgd@google.com>
13867 * options.h (origin): New -z option.
13868 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13869 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13872 2008-09-05 Cary Coutant <ccoutant@google.com>
13874 * fileread.cc (File_read::make_view): Add check for attempt to map
13875 beyond end of file.
13877 2008-09-05 Cary Coutant <ccoutant@google.com>
13879 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13880 explicit instantiations.
13882 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13885 * options.cc (General_options::finalize): Allow undefined symbols
13886 in shlibs if linking -shared.
13889 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13890 symbols as not needing a dynsym entry.
13892 2008-08-20 Craig Silverstein <csilvers@google.com>
13894 * fileread.cc (File_read::open): Do not lock the file unless it
13895 was successfully opened.
13897 2008-08-14 Cary Coutant <ccoutant@google.com>
13899 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13900 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13901 * testsuite/tls_test.cc (struct int128): 128-bit struct
13902 for testing TLS relocs with non-zero addend.
13903 (v12): New TLS variable.
13905 (t_last): Add check for v12.
13906 * testsuite/tls_test.h (t12): New function.
13907 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13909 2008-08-13 Ian Lance Taylor <iant@google.com>
13911 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13912 set tls_segment_ or relro_segment_.
13913 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13915 * output.h (Output_section::clear_is_relro): New function.
13916 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13917 sections specially even when output_data_ is empty.
13918 (Output_segment::maximum_alignment): When first section is relro,
13919 only force alignment for PT_LOAD segments.
13920 * script.cc (script_data_segment_align): New function.
13921 (script_data_segment_relro_end): New function.
13922 * script-c.h (script_data_segment_align): Declare.
13923 (script_data_segment_relro_end): Declare.
13924 * script-sections.h (class Script_sections): Declare
13925 data_segment_align and data_segment_relro_end. Add fields
13926 segment_align_index_ and saw_relro_end_.
13927 * script-sections.cc (class Sections_element): Add set_is_relro
13928 virtual function. Add new bool* parameter to place_orphan_here.
13929 Add get_output_section virtual function.
13930 (class Output_section_definition): Add set_is_relro. Add new
13931 bool* parameter to place_orphan_here. Add get_output_section.
13932 Add is_relro_ field.
13933 (Output_section_definition::Output_section_definition): Initialize
13934 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13935 and is_relro_ fields.
13936 (Output_section_definition::place_orphan_here): Add is_relro
13938 (Output_section_definition::set_section_addresses): Set relro for
13940 (Output_section_definition::alternate_constraint): Likewise.
13941 (class Orphan_output_section): Add new bool* parameter to
13942 place_orphan_here. Add get_output_section.
13943 (Orphan_output_section::place_orphan_here): Add is_relro
13945 (Script_sections::Script_sections): Initialize
13946 data_segment_align_index_ and saw_relro_end_.
13947 (Script_sections::data_segment_align): New function.
13948 (Script_sections::data_segment_relro_end): New function.
13949 (Script_sections::place_orphan): Set or clear is_relro.
13950 (Script_sections::set_section_addresses): Force alignment of first
13952 * yyscript.y (exp): Call script_data_segment_align and
13953 script_data_segment_relro_end.
13954 * testsuite/relro_script_test.t: New file.
13955 * testsuite/relro_test.cc (using_script): Declare.
13956 (t1, t2): Test using_script.
13957 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13958 (relro_script_test_SOURCES): Define.
13959 (relro_script_test_DEPENDENCIES): Define.
13960 (relro_script_test_LDFLAGS): Define.
13961 (relro_script_test_LDADD): Define.
13962 (relro_script_test.so): New target.
13963 * testsuite/Makefile.in: Rebuild.
13965 2008-08-06 Cary Coutant <ccoutant@google.com>
13967 * archive.cc (Archive::total_archives, Archive::total_members)
13968 (Archive::total_members_loaded): New variables.
13969 (Archive::setup): Add parameter. Add option to preread
13971 (Archive::read_armap): Add counter.
13972 (Archive::get_file_and_offset): New function.
13973 (Archive::get_elf_object_for_member): New function.
13974 (Archive::read_all_symbols): New function.
13975 (Archive::read_symbols): New function.
13976 (Archive::add_symbols): Add counters.
13977 (Archive::include_all_members): Use armap to find members if it's
13979 (Archive::include_member): Skip reading symbols if already read.
13980 Factored code into Archive::get_file_and_offset and
13981 Archive::get_elf_object_for_member. Changed call to
13982 Mapfile::report_include_archive_member.
13983 (Archive::print_stats): New function.
13984 * archive.h: Declare Object and Read_symbols_data classes.
13985 (Archive::Archive): Add initializers for new members.
13986 (Archive::setup): Add parameter.
13987 (Archive::print_stats): New function.
13988 (Archive::total_archives, Archive::total_members)
13989 (Archive::total_members_loaded): New variables.
13990 (Archive::get_file_and_offset): New function.
13991 (Archive::get_elf_object_for_member): New function.
13992 (Archive::read_all_symbols): New function.
13993 (Archive::read_symbols): New function.
13994 (Archive::Archive_member): New class.
13995 (Archive::members_): New member.
13996 (Archive::num_members_): New member.
13997 * main.cc: Include archive.h.
13998 (main): Call Archive::print_stats.
13999 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14000 archive parameter; member_name is now the fully-decorated name.
14001 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14002 * options.h: (General_options): Add --preread-archive-symbols option.
14003 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14006 2008-08-04 Ian Lance Taylor <iant@google.com>
14008 * symtab.h (Symbol::use_plt_offset): New function.
14009 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14010 * powerpc.cc (Relocate::relocate): Likewise.
14011 * sparc.cc (Relocate::relocate): Likewise.
14012 * x86_64.cc (Relocate::relocate): Likewise.
14013 * testsuite/weak_plt.sh: New test.
14014 * testsuite/weak_plt_main.cc: New test.
14015 * testsuite/weak_plt_shared.cc: New test.
14016 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14017 (check_PROGRAMS): Add weak_plt.
14018 (check_DATA): Add weak_plt_shared.so.
14019 (weak_plt_main_pic.o, weak_plt): New targets.
14020 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14021 * testsuite/Makefile.in: Rebuild.
14023 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14025 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14026 * testsuite/Makefile.in: Rebuild.
14028 2008-08-04 Alan Modra <amodra@bigpond.net.au>
14030 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14031 * Makefile.in: Regenerate.
14032 * po/POTFILES.in: Regenerate.
14034 2008-07-29 Ian Lance Taylor <iant@google.com>
14036 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14037 symbols before other symbols.
14038 * testsuite/script_test_2.cc (test_addr): Declare.
14039 (test_addr_alias): Declare.
14040 (main): Check that test_addr and test_addr_alias have the right
14042 * testsuite/script_test_2.t: Define test_addr_alias and
14045 2008-07-24 Ian Lance Taylor <iant@google.com>
14048 * descriptors.cc: New file.
14049 * descriptors.h: New file.
14050 * gold-threads.h (class Hold_optional_lock): New class.
14051 * fileread.cc: Include "descriptors.h".
14052 (File_read::~File_read): Release descriptor rather than closing
14054 (File_read::open) [file]: Call open_descriptor rather than open.
14055 Set is_descriptor_opened_.
14056 (File_read::open) [memory]: Assert that descriptor is not open.
14057 (File_read::reopen_descriptor): New function.
14058 (File_read::release): Release descriptor.
14059 (File_read::do_read): Make non-const. Reopen descriptor.
14060 (File_read::read): Make non-const.
14061 (File_read::make_view): Reopen descriptor.
14062 (File_read::do_readv): Likewise.
14063 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14064 Update declarations.
14065 * layout.cc: Include "descriptors.h".
14066 (Layout::create_build_id): Use open_descriptor rather than open.
14067 * output.cc: Include "descriptors.h".
14068 (Output_file::open): Use open_descriptor rather than open.
14069 * archive.cc (Archive::const_iterator): Change Archive to be
14071 (Archive::begin, Archive::end): Make non-const.
14072 (Archive::count_members): Likewise.
14073 * archive.h (class Archive): Update declarations.
14074 * object.h (Object::read): Make non-const.
14075 * Makefile.am (CCFILES): Add descriptors.cc.
14076 (HFILES): Add descriptors.h.
14077 * Makefile.in: Rebuild.
14080 * gold.h: Always include <clocale>. Add Solaris workarounds
14081 following code in binutils/sysdep.h.
14084 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14085 this->eh_frame_hdr_ is NULL before using it.
14087 * dynobj.cc (Versions::Versions): Update comment.
14089 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14090 the base version name.
14092 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14093 array size plus one.
14094 (Stringpool_template::set_string_offsets): Subtract one from key
14095 before using it as an array index.
14096 (Stringpool_template::get_offset_with_length): Likewise.
14097 (Stringpool_template::write_to_buffer): Likewise.
14098 * stringpool.h (Stringpool_template::get_offset_from_key):
14101 2008-07-23 Ian Lance Taylor <iant@google.com>
14104 * object.h (Merged_symbol_value::value): Do our best to handle a
14108 * script.cc (Version_script_info::get_versions): Don't add empty
14109 version tag to return value.
14110 (Version_script_info::get_symbol_version_helper): Change return
14111 type to bool. Add pversion parameter. Change all callers.
14112 (script_register_vers_node): Don't require a non-NULL tag.
14113 * script.h (class Version_script_info): Update declarations.
14114 (Version_script_info::get_symbol_version): Change return type to
14115 bool. Add version parameter. Change all callers.
14116 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14117 handling. Handle an empty version from a version script.
14118 (Symbol_table::define_special_symbol): Likewise.
14119 * testsuite/ver_test_10.script: New file.
14120 * testsuite/ver_test_10.sh: New file.
14121 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14122 (check_DATA): Add ver_test_10.syms.
14123 (ver_test_10.syms, ver_test_10.so): New target.
14124 * testsuite/Makefile.in: Rebuild.
14126 2008-07-23 Simon Baldwin <simonb@google.com>
14128 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14129 to zero for undefined symbols from dynamic libraries.
14131 2008-07-23 Ian Lance Taylor <iant@google.com>
14133 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14134 Change all callers.
14135 * symtab.h (class Symbol_table): Update declaration.
14136 * testsuite/ver_test_9.cc: New file.
14137 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14138 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14139 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14140 (ver_test_9.so, ver_test_9.o): New targets.
14141 * testsuite/Makefile.in: Rebuild.
14143 2008-07-22 Ian Lance Taylor <iant@google.com>
14145 * options.h (class General_options): Define --check-sections.
14146 * layout.cc (Layout::set_segment_offsets): Handle
14149 * options.h (class General_options): Define -n/--nmagic and
14151 * options.cc (General_options::finalize): For -n/--nmagic or
14152 -N/--omagic, set -static.
14153 * layout.cc (Layout::attach_allocated_section_to_segment): If
14154 -N/--omagic, don't put read-only and read-write sections in
14155 different segments.
14156 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14157 finding a read-only segment.
14158 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14159 don't set the minimum segment alignment to the common page size,
14160 and don't set the file offset to the address modulo the page size.
14161 * script-sections.cc (Script_sections::create_segments): If
14162 -n/--omagic, don't put read-only and read-write sections in
14163 different segments.
14165 * cref.cc: New file.
14166 * cref.h: New file.
14167 * options.h (class General_options): Add --print-symbol-counts.
14168 * main.cc (main): Issue defined symbol report if requested.
14169 * archive.cc (Archive::interpret_header): Make into a const member
14171 (Archive::add_symbols): Call Input_objects::archive_start and
14173 (Archive::const_iterator): Define new class.
14174 (Archive::begin, Archive::end): New functions.
14175 (Archive::include_all_members): Rewrite to use iterator.
14176 (Archive::count_members): New function.
14177 * archive.h (class Archive): Update declarations.
14178 (Archive::filename): New function.
14179 * object.cc: Include "cref.h".
14180 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14181 (Sized_relobj::do_get_global_symbol_counts): New function.
14182 (Input_objects::add_object): Add object to cross-referencer.
14183 (Input_objects::archive_start): New function.
14184 (Input_objects::archive_stop): New function.
14185 (Input_objects::print_symbol_counts): New function.
14186 * object.h: Declare Cref and Archive.
14187 (Object::get_global_symbol_counts): New function.
14188 (Object::do_get_global_symbol_counts): New pure virtual function.
14189 (class Sized_relobj): Add defined_count_ field. Update
14191 (class Input_objects): Add cref_ field. Update constructor.
14192 Update declarations.
14193 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14195 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14197 (Sized_dynobj::do_get_global_symbol_counts): New function.
14198 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14199 defined_count_. Update declarations. Define Symbols typedef.
14200 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14201 parameter. Change all callers.
14202 (Symbol_table::add_from_dynobj): Add sympointers and defined
14203 parameters. Change all callers.
14204 * symtab.h (class Symbol_table): Update declarations.
14205 * Makefile.am (CCFILES): Add cref.cc.
14206 (HFILES): Add cref.h.
14207 * Makefile.in: Rebuild.
14209 2008-07-22 Simon Baldwin <simonb@google.com>
14211 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14212 to zero when writing undefined symbols.
14214 2008-07-22 Ian Lance Taylor <iant@google.com>
14216 * output.cc (Output_section::add_input_section): Don't try to
14217 merge empty merge sections.
14219 2008-07-21 Craig Silverstein <csilvers@google.com>
14221 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14222 Include symbol version in error message.
14224 2008-07-20 Chris Demetriou <cgd@google.com>
14226 * configure.ac (gold_cv_c_random_seed): New configured variable.
14227 (RANDOM_SEED_CFLAGS): New substituted variable.
14228 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14229 * configure: Rebuild.
14230 * Makefile.in: Likewise.
14231 * testsuite/Makefile.in: Likewise.
14233 2008-07-18 Ian Lance Taylor <iant@google.com>
14235 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14236 where we see NAME/NULL and NAME/VERSION as separate symbols.
14237 * testsuite/ver_test_main.cc (main): Call t4.
14238 (t4, t4_2a): Define.
14239 * testsuite/ver_test_2.cc (t4_2): Define.
14240 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14241 * testsuite/ver_test_4.cc (t4_2a): Define.
14242 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14243 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14245 2008-07-17 Ian Lance Taylor <iant@google.com>
14247 * dynobj.cc (Versions::add_def): If we give an error about a
14248 missing version, go ahead and create the version anyhow.
14250 2008-07-10 Ian Lance Taylor <iant@google.com>
14252 Handle output sections with more than 0x7fffffff bytes.
14253 * object.h (class Relobj): Change map_to_output_ to
14254 output_sections_, and just keep a section pointer. Change all
14255 uses. Move comdat group support to Sized_relobj.
14256 (Relobj::is_section_specially_mapped): Remove.
14257 (Relobj::output_section): Remove poff parameter. Change all
14259 (Relobj::output_section_offset): New function.
14260 (Relobj::set_section_offset): Rewrite.
14261 (Relobj::map_to_output): Remove.
14262 (Relobj::output_sections): New function.
14263 (Relobj::do_output_section_offset): New pure virtual function.
14264 (Relobj::do_set_section_offset): Likewise.
14265 (class Sized_relobj): Add section_offsets_ field. Add comdat
14266 group support from Relobj. Update declarations.
14267 (Sized_relobj::get_output_section_offset): New function.
14268 (Sized_relobj::do_output_section_offset): New function.
14269 (Sized_relobj::do_set_section_offset): New function.
14270 * object.cc (Relobj::output_section_address): Remove.
14271 (Sized_relobj::Sized_relobj): Initialize new fields.
14272 (Sized_relobj::include_section_group): Cast find_kept_object to
14274 (Sized_relobj::include_linkonce_section): Likewise.
14275 (Sized_relobj::do_layout): Use separate arrays for output section
14277 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14279 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14280 output_sections and section_offsets.
14281 (Sized_relobj::write_local_symbols): Likewise.
14282 (map_to_kept_section): Compute output address directly.
14283 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14284 output_sections and section_offsets.
14285 (Sized_relobj::write_sections): Likewise.
14286 (Sized_relobj::relocate_sections): Likewise.
14287 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14288 * output.h (class Output_reloc): Update declarations. Change
14289 u2_.relobj to Sized_relobj*.
14290 (class Output_data_reloc): Change add functions to use
14292 * output.cc (Output_reloc::Output_reloc): Change relobj to
14294 (Output_reloc::local_section_offset): Change return type to
14295 Elf_Addr. Use get_output_section_offset.
14296 (Output_reloc::get_address): Likewise.
14297 (Output_section::is_input_address_mapped): Don't call
14298 is_section_specially_mapped.
14299 (Output_section::output_offset): Likewise.
14300 (Output_section::output_address): Likewise.
14301 (Output_section::starting_output_address): Likewise.
14302 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14303 parameter to Sized_relobj*.
14304 (Copy_relocs::need_copy_reloc): Likewise.
14305 (Copy_relocs::save): Likewise.
14306 * copy-relocs.h (class Copy_relocs): Update declarations.
14307 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14308 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14309 * target-reloc.h (relocate_for_relocatable): Change
14310 offset_in_output_section type to Elf_Addr. Change code that uses
14312 * layout.cc (Layout::layout): Always set *off.
14313 * mapfile.cc (Mapfile::print_input_section): Use
14314 output_section_offset.
14315 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14317 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14318 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14319 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14321 2008-07-03 Ian Lance Taylor <iant@google.com>
14323 * layout.cc (Layout::include_section): Do not discard unrecognized
14324 SHT_STRTAB sections.
14326 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14328 * script.cc (Lex::can_continue_name): Make '?' allowable in
14329 version-script names.
14330 * testsuite/version_script.map: Change glob pattern to use '?'
14332 2008-06-30 Manish Singh <yosh@gimp.org>
14335 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14338 2008-06-30 Ian Lance Taylor <iant@google.com>
14342 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14343 versions]: Don't try to read the value in the contents, since we
14344 don't use it. Use the template endianness when writing.
14346 2008-06-25 Cary Coutant <ccoutant@google.com>
14348 * fileread.cc (File_read::make_view): Assert on zero-length view.
14349 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14350 symbol table when there are no symbols to read.
14352 2008-06-23 Craig Silverstein <csilvers@google.com>
14354 * version.cc (version_string): Bump to 1.7
14356 2008-06-18 Craig Silverstein <csilvers@google.com>
14358 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14359 constant 0xFFFF to type Valtype.
14360 (Powerpc_relocate_functions::rel16_ha): Likewise.
14362 2008-06-17 Ian Lance Taylor <iant@google.com>
14364 * output.h (Output_section::Input_section): Initialize p2align_ to
14365 zero for Output_section_data constructors.
14366 (Output_section::Input_section::addralign): If not an input
14367 section, return the alignment of the Output_section_data.
14368 * testsuite/copy_test.cc: New file.
14369 * testsuite/copy_test_1.cc: New file.
14370 * testsuite/copy_test_2.cc: New file.
14371 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14372 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14373 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14374 (copy_test_1_pic.o, copy_test_1.so): New targets.
14375 (copy_test_2_pic.o, copy_test_2.so): New targets.
14376 * testsuite/Makefile.in: Rebuild.
14378 * script-sections.cc (Script_sections::place_orphan): Initialize
14379 local variable exact.
14381 2008-06-13 David Edelsohn <edelsohn@gnu.org>
14383 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14385 2008-06-12 David Edelsohn <edelsohn@gnu.org>
14386 David S. Miller <davem@davemloft.net>
14388 * powerpc.cc: New file.
14389 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14390 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14391 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14392 * Makefile.in: Rebuild.
14394 2008-06-09 Ian Lance Taylor <iant@google.com>
14396 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14398 (throwing, orig_terminate): New static variables.
14399 (terminate_handler): New static function.
14400 (t2): Set terminate handler.
14402 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14405 * binary.cc (Binary_to_elf::sized_convert): Fix .data
14408 2008-05-30 Cary Coutant <ccoutant@google.com>
14410 * archive.cc (Archive::include_all_members) Correct to step
14411 over symbol table and extended name table in thin archives.
14413 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14416 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14419 2008-05-28 Caleb Howe <cshowe@google.com>
14421 * reduced_debug_output.cc: New file.
14422 * reduced_debug_output.h: New file.
14423 * options.h (class General_options): Add --strip-debug-non-line.
14424 * options.cc (General_options::finalize): Add strip_debug_non_line
14425 to the strip heirarchy.
14426 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14428 * layout.cc: Include "reduced_debug_output.h".
14429 (Layout::Layout): Initialize new fields.
14430 (line_only_debug_sections): New static array.
14431 (is_lines_only_debug_sections): New static inline function.
14432 (Layout::include_section): Handle --strip-debug-non-line.
14433 (Layout::make_output_section): If --strip-debug-non-line, build
14434 new output sections for .debug_abbrev and .debug_info.
14435 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14436 gold. Warn about possible overflow.
14437 (read_signed_LEB_128): Likewise.
14438 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14439 (read_signed_LEB_128): Declare.
14440 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14441 (HFILES): Add reduced_debug_output.h.
14442 * Makefile.in: Rebuild.
14444 2008-05-21 Ian Lance Taylor <iant@google.com>
14446 * mapfile.cc: New file.
14447 * mapfile.h: New file.
14448 * options.h (class General_options): Add -M/--print-map and -Map.
14449 * options.cc (General_options::finalize): Make -M equivalent to
14451 * main.cc: Include <cstdio> and "mapfile.h".
14452 (main): Open mapfile if requested.
14453 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14454 constructor. Change caller.
14455 (queue_initial_tasks): Add mapfile parameter. Change caller.
14456 (queue_middle_tasks): Likewise.
14457 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14459 * archive.cc: Include "mapfile.h".
14460 (Archive::add_symbols): Add mapfile parameter. Change all
14461 callers. Pass mapfile, symbol, and reason to include_member.
14462 (Archive::include_all_members): Add mapfile parameter. Change all
14464 (Archive::include_member): Add mapfile, sym, and why parameters.
14465 Change all callers. Report inclusion to map file.
14466 * archive.h: Include "fileread.h".
14467 (class Archive): Update declarations.
14468 (Archive::file): New const method.
14469 (class Add_archive_symbols): Add mapfile_ field. Update
14470 constructor. Change all callers.
14471 * readsyms.h (class Read_symbols): Likewise.
14472 (class Finish_group): Likewise.
14473 (class Read_script): Likewise.
14474 * common.cc: Include "mapfile.h".
14475 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14477 (Symbol_table::do_allocate_commons): Likewise.
14478 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14479 symbol allocation to mapfile.
14480 * common.h (class Allocate_commons_task): Add mapfile_ field.
14481 Update constructor. Change all callers.
14482 * symtab.h (class Symbol_table): Update declarations.
14483 * layout.cc: Include "mapfile.h".
14484 (Layout_task_runner::run): Print information to mapfile.
14485 (Layout::create_gold_note): Change Output_data_fixed_space to
14486 Output_data_zero_fill.
14487 (Layout::create_build_id): Likewise.
14488 (Layout::print_to_mapfile): New function.
14489 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14490 constructor. Change caller.
14491 (class Layout): Declare print_to_mapfile.
14492 * output.cc (Output_section::Input_section::print_to_mapfile): New
14494 (Output_section::add_input_section): If producing a map, always
14495 add to input_sections_ list.
14496 (Output_section::do_print_to_mapfile): New function.
14497 (Output_segment::print_sections_to_mapfile): New function.
14498 (Output_segment::print_section_list_to_mapfile): New function.
14499 * output.h: Include "mapfile.h".
14500 (Output_data::print_to_mapfile): New function.
14501 (Output_data::do_print_to_mapfile): New virtual function.
14502 (Output_segment_headers::do_print_to_mapfile): New function.
14503 (Output_file_header::do_print_to_mapfile): New function.
14504 (Output_data_const::do_print_to_mapfile): New function.
14505 (class Output_data_const_buffer): Add map_name_ field. Update
14506 constructor. Change all callers. Add do_print_to_mapfile
14508 (class Output_data_fixed_space): Likewise.
14509 (class Output_data_space): Likewise.
14510 (class Output_data_zero_fill): New class.
14511 (Output_data_strtab::do_print_to_mapfile): New function.
14512 (Output_data_reloc_base::do_print_to_mapfile): New function.
14513 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14514 (Output_data_group::do_print_to_mapfile): New function.
14515 (Output_data_got::do_print_to_mapfile): New function.
14516 (Output_data_dynamic::do_print_to_mapfile): New function.
14517 (Output_symtab_xindex::do_print_to_mapfile): New function.
14518 (class Output_section): Declare do_print_to_mapflie. Declare
14519 print_to_mapfile in Input_section.
14520 (class Output_segment): Declare new functions.
14521 * object.h (Sized_relobj::symbol_count): New function.
14522 * script-sections.cc
14523 (Output_section_element_dot_assignment::set_section_addresses):
14524 Change Output_data_fixed_space to Output_data_zero_fill.
14525 (Output_data_expression::do_print_to_mapfile): New function.
14526 * script.cc (read_input_script): Add mapfile parameter. Change
14528 * script.h (read_input_script): Update declaration.
14529 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14530 (Eh_frame::do_print_to_mapfile): New function.
14531 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14532 (Output_merge_string::do_print_to_mapfile): New function.
14533 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14535 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14537 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14539 * Makefile.am (CCFILES): Add mapfile.cc.
14540 (HFILES): Add mapfile.h.
14541 * Makefile.in: Rebuild.
14543 2008-05-19 Ian Lance Taylor <iant@google.com>
14545 * options.h (class General_options): Add -z relro.
14546 * layout.cc (Layout::Layout): Initialize relro_segment_.
14547 (Layout::add_output_section_data): Return the output section.
14548 (Layout::make_output_section): Rcognize relro sections and mark
14549 them appropriately.
14550 (Layout::attach_allocated_section_to_segment): Put relro sections
14551 in a PT_GNU_RELRO segment.
14552 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14554 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14556 (Layout::linkonce_mapping): Map d.rel.ro.local to
14557 .data.rel.ro.local.
14558 (Layout::output_section_name): Us .data.rel.ro.local for any
14559 section which begins with that.
14560 * layout.h (class Layout): Update add_output_section_data
14561 declaration. Add relro_segment_ field.
14562 * output.cc (Output_section::Output_section): Initialize is_relro_
14563 and is_relro_local_ fields.
14564 (Output_segment::add_output_section): Group relro sections.
14565 (Output_segment::is_first_section_relro): New function.
14566 (Output_segment::maximum_alignment): If there is a relro section,
14567 align the segment to the common page size.
14568 (Output_segment::set_section_addresses): Track whether we are
14569 looking at relro sections. If the last section is a relro
14570 section, align to the common page size.
14571 (Output_segment::set_section_list_addresses): Add in_relro
14572 parameter. Change all callers. Align to the page size when
14573 moving from relro to non-relro section.
14574 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14576 * output.h (class Output_section): Add is_relro_ and
14577 is_relro_local_ fields.
14578 (Output_section::is_relro): New function.
14579 (Output_section::set_is_relro): New function.
14580 (Output_section::is_relro_local): New function.
14581 (Output_section::set_is_relro_local): New function.
14582 (class Output_segment): Update declarations.
14583 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14584 * sparc.cc (Target_sparc::got_section): Likewise.
14585 * x86_64.cc (Target_x86_64::got_section): Likewise.
14586 * testsuite/relro_test_main.cc: New file.
14587 * testsuite/relro_test.cc: New file.
14588 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14589 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14590 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14591 (relro_test.so, relro_test_pic.o): New targets.
14592 * testsuite/Makefile.in: Rebuild.
14594 2008-05-16 Ian Lance Taylor <iant@google.com>
14596 * output.cc (Output_segment::add_output_section): Remove front
14598 * output.h (class Output_segment): Remove
14599 add_initial_output_section and overloaded add_output_section.
14600 Update declaration of remaining add_output_section.
14601 * layout.cc (Layout::create_interp): Call add_output_section
14602 rather than add_initial_output_section.
14603 (Layout::finish_dynamic_section): Likewise.
14605 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14606 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14607 know the dynamic type.
14608 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14609 field. Initialize it in constructor.
14610 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14611 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14612 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14615 * output.cc (Output_reloc::get_address): Change return type to
14617 * output.h (class Output_reloc): Update get_address declaration.
14618 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14619 for section addresses.
14621 2008-05-09 Ian Lance Taylor <iant@google.com>
14624 * gold.cc (gold_nomem): Use return value of write.
14626 2008-05-08 Ian Lance Taylor <iant@google.com>
14628 * symtab.c (Symbol::init_base_output_data): Add version
14629 parameter. Change all callers.
14630 (Symbol::init_base_output_segment): Likewise.
14631 (Symbol::init_base_constant): Likewise.
14632 (Symbol::init_base_undefined): Likewise.
14633 (Sized_symbol::init_output_data): Likewise.
14634 (Sized_symbol::init_output_segment): Likewise.
14635 (Sized_symbol::init_constant): Likewise.
14636 (Sized_symbol::init_undefined): Likewise.
14637 (Symbol_table::do_define_in_output_data): If the new symbol has a
14638 version, mark it as the default.
14639 (Symbol_table::do_define_in_output_segment): Likewise.
14640 (Symbol_table::do_define_as_constant): Likewise.
14641 * symtab.h (class Symbol): Update declarations.
14642 (class Sized_symbol): Likewise.
14643 * resolve.cc (Symbol::override_version): New function.
14644 (Symbol::override_base): Call override_version.
14645 (Symbol::override_base_with_special): Likewise.
14646 * testsuite/ver_script_8.script: New file.
14647 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14648 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14649 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14650 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14652 2008-05-06 Ian Lance Taylor <iant@google.com>
14655 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14657 (class General_options): Remove existing --undefined, and add
14658 --no-undefined instead. Add new --undefined as synonym for -u.
14659 * archive.cc (Archive::add_symbols): Check whether symbol was
14661 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14662 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14663 all uses. Add IS_UNDEFINED. Update declarations to split
14664 different versions of init_base. Declare init_base_undefined.
14665 (Symbol::is_defined): Handle IS_UNDEFINED.
14666 (Symbol::is_undefined): Likewise.
14667 (Symbol::is_weak_undefined): Call is_undefined.
14668 (Symbol::is_absolute): Handle IS_CONSTANT.
14669 (class Sized_symbol): Update declarations to split different
14670 versions of init. Declare init_undefined.
14671 (class Symbol_table): Declare new functions.
14672 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14673 Change all callers.
14674 (Symbol::init_base_output_data): Likewise.
14675 (Symbol::init_base_output_segment): Likewise.
14676 (Symbol::init_base_constant): Likewise.
14677 (Symbol::init_base_undefined): New function.
14678 (Sized_symbol::init_object): Rename from init. Change all
14680 (Sized_symbol::init_output_data): Likewise.
14681 (Sized_symbol::init_output_segment): Likewise.
14682 (Sized_symbol::init_constant): Likewise.
14683 (Sized_symbol::init_undefined): New function.
14684 (Symbol_table::add_undefined_symbols_from_command_line): New
14686 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14688 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14689 (Symbol::output_section): Likewise.
14690 (Symbol::set_output_section): Likewise.
14691 (Symbol_table::sized_finalize_symbol): Likewise.
14692 (Symbol_table::sized_write_globals): Likewise.
14693 * resolve.cc (Symbol_table::should_override): Likewise.
14694 (Symbol::override_base_with_special): Likewise.
14696 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14697 symbol, change it to have default visibility.
14698 * testsuite/protected_1.cc: New file.
14699 * testsuite/protected_2.cc: New file.
14700 * testsuite/protected_3.cc: New file.
14701 * testsuite/protected_main_1.cc: New file.
14702 * testsuite/protected_main_2.cc: New file.
14703 * testsuite/protected_main_3.cc: New file.
14704 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14705 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14706 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14707 (protected_1.so): New target.
14708 (protected_1_pic.o, protected_2_pic.o): New targets.
14709 (protected_3_pic.o): New target.
14710 (check_PROGRAMS): Add protected_2.
14711 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14712 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14713 * testsuite/Makefile.in: Rebuild.
14715 * options.h (DEFINE_var): Add set_user_set_##varname__.
14716 (DEFINE_bool_alias): New macro.
14717 (class General_options): Define -Bstatic using DEFINE_bool_alias
14718 rather than DEFINE_special. Add --undefined as an alias for -z
14720 * options.cc (General_options::parse_Bstatic): Remove.
14722 * options.h (class General_options): Add --fatal-warnings.
14723 * main.cc (main): Implement --fatal-warnings.
14724 * errors.h (Errors::warning_count): New function.
14726 * options.h (class General_options): Add -Bsymbolic-functions.
14727 * symtab.h (Symbol::is_preemptible): Check for
14728 -Bsymbolic-functions.
14730 2008-05-05 Ian Lance Taylor <iant@google.com>
14732 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14733 as noVARNAME rather than no-VARNAME.
14734 (class General_options): Add option -z combreloc.
14735 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14737 (Output_reloc::sort_before) [SHT_REL]: New function.
14738 (Output_reloc::sort_before) [SHT_RELA]: New function.
14739 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14740 Sort_relocs_comparison.
14741 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14742 parameter. Change all callers.
14743 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14744 sort_relocs parameter. Change all callers.
14745 * output.cc (Output_reloc::get_address): New function, broken out
14747 (Output_reloc::write_rel): Call it.
14748 (Output_reloc::compare): New function.
14749 (Output_data_reloc_base::do_write): Optionally sort relocs.
14751 * configure.ac: If targ_extra_obj is set, link it in.
14752 * configure.tgt: Initialize all variables.
14753 (x86_64*): Set targ_extra_obj and targ_extra_size.
14754 * configure: Rebuild.
14756 * object.cc (Sized_relobj::include_section_group): Adjust section
14757 indexes read from group data. Build vector to pass to
14759 * layout.cc (Layout::layout_group): Add flags and shndxes
14760 parameters. Remove contents parameter. Change caller. Update
14761 explicit instantiations.
14762 * layout.h (class Layout): Update layout_group declaration.
14763 * output.cc (Output_data_group::Output_data_group): Add flags and
14764 input_shndxes parameters. Remove contents parameter. Change
14766 (Output_data_group::do_write): Change input_sections_ to
14768 * output.h (class Output_data_group): Update constructor
14769 declaration. Rename input_sections_ to input_shndxes_.
14770 * testsuite/many_sections_test.cc: Add template.
14772 2008-04-30 Cary Coutant <ccoutant@google.com>
14774 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14776 * layout.cc (Layout::include_section): Refactored check for debug
14778 (Layout::add_comdat): Add new parameters. Change type
14779 of signature parameter. Add object and shndx to signatures table.
14780 (Layout::find_kept_object): New function.
14781 * layout.h: Include <cstring>.
14782 (Layout::is_debug_info_section): New function.
14783 (Layout::add_comdat): Add new parameters.
14784 (Layout::find_kept_object): New function.
14785 (Layout::Kept_section): New struct.
14786 (Layout::Signatures): Change type of map range.
14787 * object.cc (Relobj::output_section_address): New function.
14788 (Sized_relobj::include_section_group): Add new parameters. Change
14789 calls to Layout::add_comdat. Change to build table of kept comdat
14790 groups and table mapping discarded sections to kept sections.
14791 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14792 (Sized_relobj::do_layout): Change calls to include_section_group and
14793 include_linkonce_section.
14794 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14795 value to zero when section is discarded.
14796 (Sized_relobj::map_to_kept_section): New function.
14797 * object.h (Relobj::output_section_address): New function.
14798 (Relobj::Comdat_group): New type.
14799 (Relobj::find_comdat_group): New function.
14800 (Relobj::Comdat_group_table): New type.
14801 (Relobj::Kept_comdat_section): New type.
14802 (Relobj::Kept_comdat_section_table): New type.
14803 (Relobj::add_comdat_group): New function.
14804 (Relobj::set_kept_comdat_section): New function.
14805 (Relobj::get_kept_comdat_section): New function.
14806 (Relobj::comdat_groups_): New field.
14807 (Relobj::kept_comdat_sections_): New field.
14808 (Symbol_value::input_value): Update comment.
14809 (Sized_relobj::map_to_kept_section) New function.
14810 (Sized_relobj::include_linkonce_section): Add new parameter.
14811 * target-reloc.h (Comdat_behavior): New type.
14812 (get_comdat_behavior): New function.
14813 (relocate_section): Add code to map a discarded section to the
14814 corresponding kept section when applying a relocation.
14816 2008-04-30 Craig Silverstein <csilvers@google.com>
14818 * dwarf_reader.cc (next_generation_count): New static var.
14819 (Addr2line_cache_entry): New struct.
14820 (addr2line_cache): New static var.
14821 (Dwarf_line_info::one_addr2line): Added caching.
14822 (Dwarf_line_info::clear_addr2line_cache): New function.
14823 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14824 cache-size parameter.
14825 (Dwarf_line_info::one_addr2line_cache): New function.
14826 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14827 new cache-size argument to one_addr2line(), and clear cache.
14829 2008-04-28 Cary Coutant <ccoutant@google.com>
14831 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14832 R_386_PC8 relocations.
14834 2008-04-23 Ian Lance Taylor <iant@google.com>
14836 * object.cc (Sized_relobj::include_section_group): Check for
14837 invalid section group.
14839 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14842 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14843 than read for file header.
14844 * archive.cc (Archive::include_member): Likewise.
14846 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
14848 * aclocal.m4: Regenerate.
14849 * configure: Regenerate.
14851 2008-04-19 Ian Lance Taylor <iant@google.com>
14853 * version.cc (version_string): Bump to 1.6.
14855 * testsuite/Makefile.am (many_sections_r_test): New target.
14856 (many_sections_r_test_SOURCES): Remove.
14857 (many_sections_r_test_DEPENDENCIES): Remove.
14858 (many_sections_r_test_LDFLAGS): Remove.
14859 (many_sections_r_test_LDADD): Remove.
14861 * object.cc (Sized_relobj::do_add_symbols): Always pass
14862 local_symbol_count_ to add_from_relobj.
14864 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14865 every thousand variables.
14866 * testsuite/Makefile.in: Rebuild.
14868 * object.cc (Xindex::initialize_symtab_xindex): New function.
14869 (Xindex::read_symtab_xindex): New function.
14870 (Xindex::sym_xindex_to_shndx): New function.
14871 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14873 (Sized_relobj::do_initialize_xindex): New function.
14874 (Sized_relobj::do_read_symbols): Adjust section links.
14875 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14876 parameter. Change all callers.
14877 (Sized_relobj::include_section_group): Adjust section links and
14878 symbol section indexes.
14879 (Sized_relobj::do_layout): Adjust section links.
14880 (Sized_relobj::do_count_local_symbols): Adjust section links and
14881 symbol section indexes.
14882 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14883 ordinary and special symbols.
14884 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14885 dynsym_xindex parameters. Change all callers. Adjust section
14886 links. Use SHN_XINDEX when needed.
14887 (Sized_relobj::get_symbol_location_info): Adjust section links.
14888 Don't get fooled by special symbols.
14889 * object.h (class Xindex): Define.
14890 (class Object): Add xindex_ parameter. Declare virtual functoin
14891 do_initialize_xindex.
14892 (Object::adjust_sym_shndx): New function.
14893 (Object::set_xindex): New protected function.
14894 (class Symbol_value): Add is_ordinary_shndx_ field.
14895 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14896 (Symbol_value::value): Assert ordinary section.
14897 (Symbol_value::initialize_input_to_output_map): Likewise.
14898 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14899 Change all callers.
14900 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14902 (class Sized_relobj): Update declarations.
14903 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14904 parameter. Change all callers.
14905 (Sized_relobj::adjust_shndx): New function.
14906 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14908 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14909 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14910 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14911 (Sized_dynobj::read_dynsym_section): Adjust section links.
14912 (Sized_dynobj::read_dynamic): Likewise.
14913 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14915 (Sized_dynobj::do_initialize_xindex): New function.
14916 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14917 do_initialize_xindex.
14918 (Sized_dynobj::adjust_shndx): New function.
14919 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14920 dynsym_xindex_ fields.
14921 (Layout::finalize): Add a call to set_section_indexes before
14922 creating the symtab sections.
14923 (Layout::set_section_indexes): Don't do anything if the section
14924 already has a section index.
14925 (Layout::create_symtab_sections): Add shnum parameter. Change
14926 caller. Create .symtab_shndx section if needed.
14927 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14929 (Layout::allocated_output_section_count): New function.
14930 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14932 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14933 fields. Update declarations.
14934 (Layout::symtab_xindex): New function.
14935 (Layout::dynsym_xindex): New function.
14936 (class Write_symbols_task): Add layout_ field.
14937 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14939 * output.cc (Output_section_headers::Output_section_headers): Add
14940 shstrtab_section parameter. Change all callers.
14941 (Output_section_headers::do_sized_write): Store overflow values
14942 for section count and section string table section index in
14943 section header zero.
14944 (Output_file_header::do_sized_write): Check for overflow of
14945 section count and section string table section index.
14946 (Output_symtab_xindex::do_write): New function.
14947 (Output_symtab_xindex::endian_do_write): New function.
14948 * output.h (class Output_section_headers): Add shstrtab_section_.
14949 Update declarations.
14950 (class Output_symtab_xindex): Define.
14951 (Output_section::has_out_shndx): New function.
14952 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14954 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14955 Change all callers.
14956 (Sized_symbol::init): Likewise.
14957 (Symbol::output_section): Check for ordinary symbol.
14958 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14959 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14961 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14962 Change all callers. Simplify handling of symbols from sections
14963 not included in the link.
14964 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14966 (Weak_alias_sorter::operator()): Assert that symbols are
14968 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14970 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14971 parameters. Change all callers.
14972 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14973 symbol distinction. Use SHN_XINDEX when needed.
14974 (Symbol_table::write_section_symbol): Add symtab_xindex
14975 parameter. Change all callers.
14976 (Symbol_table::sized_write_section_symbol): Likewise. Use
14977 SHN_XINDEX when needed.
14978 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14980 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14981 (Symbol::is_defined): Check is_ordinary.
14982 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14983 (Symbol::is_absolute, Symbol::is_common): Likewise.
14984 (class Sized_symbol): Update declarations.
14985 (class Symbol_table): Update declarations.
14986 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14987 parameters. Change all callers.
14988 (Sized_symbol::override): Likewise.
14989 (Symbol_table::override): Likewise.
14990 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14991 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14992 is_ordinary, and orig_st_shndx parameters. Change all callers.
14993 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14994 to be in an ordinary section.
14995 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14996 object and is_ordinary parameters. Change all callers.
14997 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14998 Change all callers. Don't add undefined or non-ordinary symbols
15000 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15001 Change all callers.
15002 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15004 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15005 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15006 (Sized_relobj::relocate_sections): Likewise.
15007 * target-reloc.h (scan_relocs): Adjust section symbol index.
15008 (scan_relocatable_relocs): Likewise.
15009 * i386.cc (Scan::local): Check for ordinary symbols.
15010 * sparc.cc (Scan::local): Likewise.
15011 * x86_64.cc (Scan::local): Likewise.
15012 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15013 to symbol_section_and_value.
15014 * testsuite/many_sections_test.cc: New file.
15015 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15016 (check_PROGRAMS): Add many_sections_test.
15017 (many_sections_test_SOURCES): Define.
15018 (many_sections_test_DEPENDENCIES): Define.
15019 (many_sections_test_LDFLAGS): Define.
15020 (BUILT_SOURCES): Add many_sections_define.h.
15021 (many_sections_define.h): New target.
15022 (BUILT_SOURCES): Add many_sections_check.h.
15023 (many_sections_check.h): New target.
15024 (check_PROGRAMS): Add many_sections_r_test.
15025 (many_sections_r_test_SOURCES): Define.
15026 (many_sections_r_test_DEPENDENCIES): Define.
15027 (many_sections_r_test_LDFLAGS): Define.
15028 (many_sections_r_test_LDADD): Define.
15029 (many_sections_r_test.o): New target.
15030 * testsuite/Makefile.in: Rebuild.
15032 2008-04-17 Cary Coutant <ccoutant@google.com>
15034 * errors.cc (Errors::info): New function.
15035 (gold_info): New function.
15036 * errors.h (Errors::info): New function.
15037 * gold.h (gold_info): New function.
15038 * object.cc (Input_objects::add_object): Print trace output.
15039 * options.cc (options::parse_set): New function.
15040 (General_options::parse_wrap): Deleted.
15041 (General_options::General_options): Deleted initializer.
15042 * options.h (options::String_set): New typedef.
15043 (options::parse_set): New function.
15044 (DEFINE_set): New macro.
15045 (General_options::wrap): Changed to use DEFINE_set. Changed
15046 callers of any_wrap_symbols and is_wrap_symbol.
15047 (General_options::trace, General_options::trace_symbol):
15049 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15050 (General_options::wrap_symbols_): Deleted.
15051 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15053 2008-04-17 David S. Miller <davem@davemloft.net>
15055 * options.cc (General_options::parse_V): New function.
15056 * options.h: Add entries for -V and -Qy.
15058 2008-04-17 Ian Lance Taylor <iant@google.com>
15060 * common.cc (Symbol_table::allocate_commons): Remove options
15061 parameter. Change caller.
15062 (Symbol_table::do_allocate_commons): Remove options parameter.
15063 Change caller. Just call do_allocate_commons_list twice.
15064 (Symbol_table::do_allocate_commons_list): New function, broken out
15065 of do_allocate_commons.
15066 * common.h (class Allocate_commons_task): Remove options_ field.
15067 Update constructor.
15068 * symtab.cc (Symbol_table::Symbol_table): Initialize
15070 (Symbol_table::add_from_object): Put TLS common symbols on
15072 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15073 which are IN_OUTPUT_DATA.
15074 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15075 allocate_commons and do_allocate_commons declarations. Declare
15076 do_allocate_commons_list.
15077 * gold.cc (queue_middle_tasks): Update creation of
15078 Allocate_commons_task to not pass options.
15079 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15080 (TLS_TEST_C_FLAGS): New variable.
15081 (tls_test_c_pic.o): New target.
15082 (tls_test_shared.so): Link in tls_test_c_pic.o.
15083 (tls_test_c_pic_ie.o): New target.
15084 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15085 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15086 (tls_test_c.o): New target.
15087 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15088 (tls_pic_test_LDADD): Likewise.
15089 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15090 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15091 (tls_test_c_gnu2.o): New target.
15092 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15094 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15095 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15096 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15097 * testsuite/tls_test.cc: Include "config.h".
15098 (t_last): Call t11_last.
15099 * testsuite/tls_test.h (t11, t11_last): Declare.
15100 * testsuite/tls_test_c.c: New file.
15101 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15102 * configure.ac: Check for OpenMP support.
15103 * configure, config.in, Makefile.in: Rebuild.
15104 * testsuite/Makefile.in: Rebuild.
15106 2008-04-16 Cary Coutant <ccoutant@google.com>
15108 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15109 (Target_i386::tls_base_symbol_defined_): New field.
15110 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15111 (Target_i386::Scan::global): Likewise.
15112 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15113 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15114 (Target_x86_64::tls_base_symbol_defined_): New field.
15115 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15116 (Target_x86_64::Scan::global): Likewise.
15118 2008-04-16 Cary Coutant <ccoutant@google.com>
15120 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15121 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15122 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15123 building shared libraries.
15124 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15125 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15126 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15127 * testsuite/Makefile.in: Rebuild.
15128 * testsuite/weak_undef.h: New file.
15129 * testsuite/weak_undef_file1.cc: Add extra test cases.
15130 * testsuite/weak_undef_file2.cc: Likewise.
15131 * testsuite/weak_undef_test.cc: Likewise.
15133 2008-04-16 David S. Miller <davem@davemloft.net>
15135 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15136 Add issued_non_pic_error_ field. Declare check_non_pic.
15137 (Target_sparc::Scan::check_non_pic): New function.
15138 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15139 (Target_sparc::Scan::global): Likewise.
15141 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15142 * configure: Rebuild.
15144 * options.h (DEFINE_enable): New macro.
15145 (new_dtags): New enable option.
15146 (initfirst, interpose, loadfltr, nodefaultlib,
15147 nodelete, nodlopen, nodump): New -z options.
15148 * layout.cc (Layout:finish_dynamic_section): If new
15149 dtags enabled, emit DT_RUNPATH. Also, emit a
15150 DT_FLAGS_1 containing any specified -z flags.
15152 2008-04-16 Ian Lance Taylor <iant@google.com>
15154 * copy-relocs.cc: New file.
15155 * copy-relocs.h: New file.
15156 * reloc.cc: Remove Copy_relocs code.
15157 * reloc.h: Likewise.
15158 * reloc-types.h (struct Reloc_types) [both versions]: Add
15159 get_reloc_addend_noerror.
15160 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15161 variants of add_global which take an addend which must be zero.
15162 * i386.cc: Include "copy-relocs.h".
15163 (class Target_i386): Change type of copy_relocs_ to variable,
15164 update initializer.
15165 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15166 Change all callers.
15167 (Target_i386::do_finalize_sections): Change handling of
15169 * sparc.cc: Include "copy-relocs.h".
15170 (class Target_sparc): Change type of copy_relocs_ to variable,
15171 update initializer.
15172 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15173 Change all callers.
15174 (Target_sparc::do_finalize_sections): Change handling of
15176 * x86_64.cc: Include "copy-relocs.h".
15177 (class Target_x86_64): Change type of copy_relocs_ to variable,
15178 update initializer.
15179 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15180 class. Change all callers.
15181 (Target_x86_64::do_finalize_sections): Change handling of
15183 * Makefile.am (CCFILES): Add copy-relocs.cc.
15184 (HFILES): Add copy-relocs.h.
15186 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15188 * testsuite/script_test_4.sh: Permit leading zeroes.
15190 2008-04-15 Ian Lance Taylor <iant@google.com>
15192 * script-sections.cc (Script_sections::create_segments): Use
15193 header_size_adjustment even when there is enough room for the
15195 * testsuite/script_test_4.sh: New file.
15196 * testsuite/script_test_4.t: New file.
15197 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15198 (check_DATA): Add script_test_4.stdout.
15199 (MOSTLYCLEANFILES): Likewise.
15200 (script_test_4): New target.
15201 (script_test_4.stdout): New target.
15202 * testsuite/Makefile.in: Rebuild.
15204 * sparc.cc: Add definitions for Output_data_plt_sparc class
15207 2008-04-14 David S. Miller <davem@davemloft.net>
15209 * sparc.cc: New file.
15210 * Makefile.am (TARGETSOURCES): Add sparc.cc
15211 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15212 * configure.tgt: Document targ_extra_size and
15213 targ_extra_big_endian. Add entries for sparc-* and
15215 * configure.ac: Handle targ_extra_size and
15216 targ_extra_big_endian.
15217 * Makefile.in: Rebuild.
15218 * configure: Likewise.
15219 * po/POTFILES.in: Likewise.
15220 * po/gold.pot: Likewise.
15222 2008-04-14 Ian Lance Taylor <iant@google.com>
15224 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15225 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15226 in the name/type/flags to section mapping. Don't call
15227 allocate_output_section.
15228 (Layout::choose_output_section): Change parameter from adjust_name
15229 to is_input_section. Don't permit input sections after sections
15230 are attached to segments. Don't call allocate_output_section.
15231 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15232 not write_enable_output_section.
15233 (Layout::make_output_section): Don't push to
15234 unattached_section_list_ nor call attach_to_segment. Call
15235 attach_section_to_segment if sections are attached.
15236 (Layout::attach_sections_to_segments): New function.
15237 (Layout::attach_section_to_segment): New function.
15238 (Layout::attach_allocated_section_to_segment): Rename from
15239 attach_to_segment. Remove flags parameter.
15240 (Layout::allocate_output_section): Remove function.
15241 (Layout::write_enable_output_section): Remove function.
15242 * layout.h (class Layout): Update for above changes. Add new
15243 field sections_are_attached_.
15244 * output.h (Output_section::update_flags_for_input_section): New
15246 * output.cc (Output_section::add_input_section): Call
15247 update_flags_for_input_section.
15248 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15250 2008-04-11 Cary Coutant <ccoutant@google.com>
15252 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15253 thought unnecessary.
15254 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15256 2008-04-11 Ian Lance Taylor <iant@google.com>
15258 * output.h (class Output_section_data): Remove inline definition
15260 * output.cc (Output_section_data::set_addralign): New function.
15262 2008-04-11 Cary Coutant <ccoutant@google.com>
15264 Add support for TLS descriptors for i386 and x86_64.
15265 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15266 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15267 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15269 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15270 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15271 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15273 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15274 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15275 Fix problem with initial-exec relocations.
15276 (Target_i386::Relocate::relocate_tls): Likewise.
15277 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15279 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15280 support for section-plus-offset dynamic table entries.
15281 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15282 (Output_data_dynamic::Dynamic_entry): Add support for
15283 section-plus-offset dynamic table entries.
15284 (Output_data_dynamic::Classification): Likewise.
15285 (Output_data_dynamic::classification_): Renamed offset_.
15286 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15287 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15288 (Target_x86_64::make_plt_section): New function.
15289 (Target_x86_64::reserve_tlsdesc_entries): New function.
15290 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15291 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15292 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15293 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15294 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15295 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15296 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15297 add extra PLT entry for TLS descriptors.
15298 (Output_data_plt_x86_64::got_): New field.
15299 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15300 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15302 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15304 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15305 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15306 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15307 R_386_TLS_DESC_CALL relocations.
15308 (Target_x86_64::Scan::global): Likewise.
15309 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15310 for TLS descriptors.
15311 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15312 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15313 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15314 GD-to-IE relaxation.
15315 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15316 and TLS_DESCRIPTORS.
15317 * Makefile.in: Rebuild.
15318 * configure: Rebuild.
15319 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15320 (tls_test_shared2.so): New target.
15321 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15322 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15323 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15324 (tls_shared_gd_to_ie_test_LDADD): New variable.
15325 (tls_shared_gnu2_gd_to_ie_test): New target.
15326 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15328 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15329 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15330 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15331 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15332 (tls_shared_gnu2_test): New target.
15333 (tls_test_gnu2_shared.so): New target.
15334 (tls_shared_gnu2_test_SOURCES): New variable.
15335 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15336 (tls_shared_gnu2_test_LDFLAGS): New variable.
15337 (tls_shared_gnu2_test_LDADD): New variable.
15338 * testsuite/Makefile.in: Rebuild.
15339 * testsuite/Makefile.
15341 2008-04-11 Ian Lance Taylor <iant@google.com>
15343 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15345 * testsuite/Makefile.in: Rebuild.
15347 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15349 * testsuite/script_test_2.cc (main): Adjust test.
15351 2008-04-11 David S. Miller <davem@davemloft.net>
15352 Ian Lance Taylor <iant@google.com>
15354 * options.h (General_options): Add entries for '-Y' and
15356 * options.cc (General_options:finalize): If -Y was used, add those
15357 entries to the library path instead of the default "/lib" and
15360 2008-04-11 David S. Miller <davem@davemloft.net>
15362 * testsuite/justsyms.t: Start at 0x100.
15363 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
15364 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15366 * testsuite/script_test_2.cc: Adjust string and section length
15369 2008-04-09 Ian Lance Taylor <iant@google.com>
15372 * script-sections.cc (Sections_element::allocate_to_segment): Add
15374 (Output_section_definition::allocate_to_segment): Likewise.
15375 (Orphan_output_section::allocate_to_segment): Likewise.
15376 (Script_sections::attach_sections_using_phdrs_clause): Don't
15377 propagate non-PT_LOAD segments to orphan sections.
15378 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15379 readelf rather than objdump.
15380 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15381 .interp section and PT_INTERP segment are the same size.
15382 * testsuite/Makefile.in: Rebuild.
15384 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15385 aliases for symbols defined in the same object.
15386 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15387 (weak_alias_test_SOURCES): New variable.
15388 (weak_alias_test_DEPENDENCIES): New variable.
15389 (weak_alias_test_LDFLAGS): New variable.
15390 (weak_alias_test_LDADD): New variable.
15391 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15392 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15393 (weak_alias_test_3.o): New target.
15394 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15395 * testsuite/weak_alias_test_main.cc: New file.
15396 * testsuite/weak_alias_test_1.cc: New file.
15397 * testsuite/weak_alias_test_2.cc: New file.
15398 * testsuite/weak_alias_test_3.cc: New file.
15400 2008-04-08 Ian Lance Taylor <iant@google.com>
15402 * options.h (class General_options): Add --noinhibit-exec option.
15403 * main.cc (main): Check --noinhibit-exec.
15405 * options.h (class General_options): Define --wrap as a special
15406 option. Add wrap_symbols_ field.
15407 (General_options::any_wrap_symbols): New function.
15408 (General_options::is_wrap_symbol): New function.
15409 * options.cc (General_options::parse_wrap): New function.
15410 (General_options::General_options): Initialize wrap_symbols_.
15411 * symtab.cc (Symbol_table::wrap_symbol): New function.
15412 (Symbol_table::add_from_object): Handle --wrap.
15413 * symtab.h (class Symbol_table): Declare wrap_symbol.
15414 * target.h (Target::wrap_char): New function.
15415 (Target::Target_info): Add wrap_char field.
15416 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15417 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15418 * testsuite/testfile.cc (Target_test::test_target_info):
15421 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15424 * layout.h (class Layout): Add added_eh_frame_data_ field.
15425 * layout.cc (Layout::Layout): Initialize new field.
15426 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15427 output section until we find a section we merged successfully.
15428 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15429 that the size be non-zero.
15431 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15434 2008-04-08 Craig Silverstein <csilvers@google.com>
15436 * configure.ac: Export new conditional variable HAVE_ZLIB.
15437 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15439 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15440 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15442 2008-04-07 Ian Lance Taylor <iant@google.com>
15444 * version.cc (version_string): Set to "1.5".
15446 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15447 Add issued_non_pic_error_ field. Declare check_non_pic.
15448 (Target_x86_64::Scan::check_non_pic): New function.
15449 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15450 (Target_x86_64::Scan::global): Likewise.
15452 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15453 addend parameter. Change caller. Handle merge sections.
15454 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15455 Address to Addend. Don't add in the result of
15456 local_section_offset, pass down the addend and use the returned
15458 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15459 Update declarations of local_section_offset and symbol_value.
15460 * testsuite/two_file_test_1.cc (t18): New function.
15461 * testsuite/two_file_test_2.cc (f18): New function.
15462 * testsuite/two_file_test_main.cc (main): Call t18.
15463 * testsuite/two_file_test.h (t18, f18): Declare.
15465 * configure.ac: Don't test for objdump, c++filt, or readelf.
15466 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15468 (TEST_READELF): New variable.
15469 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15470 (check_PROGRAMS): Add two_file_strip_test.
15471 (two_file_strip_test): New target.
15472 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15473 (two_file_same_shared_strip_test_SOURCES): New variable.
15474 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15475 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15476 (two_file_same_shared_strip_test_LDADD): New variable.
15477 (two_file_shared_strip.so): New target.
15478 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15479 (ver_test_5.syms, ver_test_7.syms): Likewise.
15480 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15481 (strip_test_3.stdout): Use TEST_OBJDUMP.
15482 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15484 2008-04-04 Cary Coutant <ccoutant@google.com>
15486 * symtab.h (Symbol::is_weak_undefined): New function.
15487 (Symbol::is_strong_undefined): New function.
15488 (Symbol::is_absolute): New function.
15489 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15490 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15492 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15493 (weak_undef_test): New target.
15494 * testsuite/Makefile.in: Rebuild.
15495 * testsuite/weak_undef_file1.cc: New file.
15496 * testsuite/weak_undef_file2.cc: New file.
15497 * testsuite/weak_undef_test.cc: New file.
15499 2008-04-03 Craig Silverstein <csilvers@google.com>
15501 * compressed_output.h (class Output_compressed_section): Use
15503 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15505 (zlib_compressed_suffix): Removed.
15506 (Output_compressed_section::set_final_data_size): Use unsigned
15508 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15509 Fix linker invocation.
15510 (flagstest_o_specialfile_and_compress_debug_sections):
15512 * testsuite/Makefile.in: Regenerated.
15514 2008-04-02 David S. Miller <davem@davemloft.net>
15516 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15517 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15519 2008-04-02 Craig Silverstein <csilvers@google.com>
15523 2008-04-02 Ian Lance Taylor <iant@google.com>
15525 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15526 parameters. Update for new key type to views_. Change all
15528 (File_read::read): Adjust for byteshift in returned view.
15529 (File_read::add_view): New function, broken out of
15530 find_and_make_view.
15531 (File_read::make_view): New function, broken out of
15532 find_and_make_view.
15533 (File_read::find_or_make_view): Add offset and aligned
15534 parameters. Rewrite accordingly. Change all callers.
15535 (File_read::get_view): Add offset and aligned parameters. Adjust
15536 for byteshift in return value.
15537 (File_read::get_lasting_view): Likewise.
15538 * fileread.h (class File_read): Update declarations.
15539 (class File_read::View): Add byteshift_ field. Add byteshift to
15540 constructor. Add byteshift method.
15541 * archive.h (Archive::clear_uncached_views): New function.
15542 (Archive::get_view): Add aligned parameter. Change all callers.
15543 * object.h (Object::get_view): Add aligned parameter. Change all
15545 (Object::get_lasting_view): Likewise.
15547 * fileread.cc (File_read::release): Don't call clear_views if
15548 there are multiple objects.
15549 * fileread.h (File_read::clear_uncached_views): New function.
15550 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15553 2008-03-31 Cary Coutant <ccoutant@google.com>
15555 Add thin archive support.
15556 * archive.cc (Archive::armagt): New const.
15557 (Archive::setup): Remove task parameter and calls to unlock.
15558 (Archive::unlock_nested_archives): New function.
15559 (Archive::read_header): Add nested_off parameter. Change
15561 (Archive::interpret_header): Likewise.
15562 (Archive::include_all_members): Change to handle thin
15564 (Archive::include_member): Likewise.
15565 * archive.h (Archive::Archive): Add new parameters and
15567 (Archive::armagt): New const.
15568 (Archive::setup): Remove task parameter.
15569 (Archive::unlock_nested_archives): New function.
15570 (Archive::read_header): Add nested_off parameter.
15571 (Archive::interpret_header): Likewise.
15572 (Archive::Nested_archive_table): New typedef.
15573 (Archive::is_thin_archive_): New field.
15574 (Archive::nested_archives_): New field.
15575 (Archive::options_): New field.
15576 (Archive::dirpath_): New field.
15577 (Archive::task_): New field.
15578 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15579 for thin archives. Pass additional parameters to
15580 Archive::Archive. Unlock the archive file after calling
15583 2008-03-29 Ian Lance Taylor <iant@google.com>
15585 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15586 version symbol to be local.
15587 * testsuite/ver_test_4.sh: New file.
15588 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15589 (check_DATA): Add ver_test_4.syms.
15590 (ver_test_4.syms): New target.
15591 * testsuite/Makefile.in: Rebuild.
15594 (Output_section::Input_section_sort_entry::has_priority): New
15596 (Output_section::Input_section_sort_entry::match_file_name): New
15598 (Output_section::Input_section_sort_entry::match_section_name):
15600 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15602 (Output_section::Input_section_sort_entry::match_section_file):
15604 (Output_section::Input_section_sort_compare::operator()): Rewrite
15605 using new Input_section_sort_entry functions. Sort crtbegin and
15606 crtend first. Sort sections with no priority before sections with
15608 * testsuite/initpri1.c (d3): Check j != 4.
15609 (cd5): New constructor/destructor function.
15610 (main): Check j != 2.
15612 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15613 new symbol when resolving, don't call set_is_default.
15614 * testsuite/ver_test_7.cc: New file.
15615 * testsuite/ver_test_7.sh: New file.
15616 * testsuite/Makefile.am (ver_test_7.so): New target.
15617 (ver_test_7.o): New target.
15618 (check_SCRIPTS): Add ver_test_7.sh.
15619 (check_DATA): Add ver_test_7.syms.
15620 (ver_test_7.syms): New target.
15622 2008-03-28 Ian Lance Taylor <iant@google.com>
15624 * layout.cc (Layout::layout): If we see an input section with a
15625 name that needs sorting, set the must_sort flag for the output
15627 (Layout::make_output_section): If the name of the output section
15628 indicates that it might require sorting, set the may_sort flag.
15629 * output.h (Output_section::may_sort_attached_input_sections): New
15631 (Output_section::set_may_sort_attached_input_sections): New
15633 (Output_section::must_sort_attached_input_sections): New
15635 (Output_section::set_must_sort_attached_input_sections): New
15637 (class Output_section): Declare Input_section_sort_entry. Define
15638 Input_section_sort_compare. Declare
15639 sort_attached_input_sections. Add new fields:
15640 may_sort_attached_input_sections_,
15641 must_sort_attached_input_sections_,
15642 attached_input_sections_are_sorted_.
15643 * output.cc (Output_section::Output_section): Initialize new
15645 (Output_section::add_input_section): Add an entry to
15646 input_sections_ if may_sort or must_sort are true.
15647 (Output_section::set_final_data_size): Call
15648 sort_attached_input_sections if necessary.
15649 (Output_section::Input_section_sort_entry): Define new class.
15650 (Output_section::Input_section_sort_compare::operator()): New
15652 (Output_section::sort_attached_input_sections): New function.
15653 * configure.ac: Check whether the compiler supports constructor
15654 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15655 * testsuite/initpri1.c: New file.
15656 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15657 CONSTRUCTOR_PRIORITY.
15658 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15659 (initpri1_LDFLAGS): New variable.
15660 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15662 2008-03-27 Ian Lance Taylor <iant@google.com>
15664 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15665 * testsuite/common_test_1.c: New file.
15666 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15667 (common_test_1_SOURCES): New variable.
15668 (common_test_1_DEPENDENCIES): New variable.
15669 (common_test_1_LDFLAGS): New variable.
15671 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15672 and commons_ correctly when NAME/VERSION does not override
15674 * testsuite/ver_test_6.c: New file.
15675 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15676 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15677 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15679 2008-03-26 Ian Lance Taylor <iant@google.com>
15681 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15682 of an undefined symbol from a version script.
15683 * testsuite/Makefile.am (ver_test_5.so): New target.
15684 (ver_test_5.o): New target.
15685 (check_SCRIPTS): Add ver_test_5.sh.
15686 (check_DATA): Add ver_test_5.syms.
15687 (ver_test_5.syms): New target.
15688 * testsuite/ver_test_5.cc: New file.
15689 * testsuite/ver_test_5.script: New file.
15690 * testsuite/ver_test_5.sh: New file.
15691 * Makefile.in, testsuite/Makefile.in: Rebuild.
15694 Fix problems building gold with gcc 4.3.0.
15695 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15696 (gold_error_at_location, gold_warning_at_location): Use it.
15697 * configure.ac: Check whether we can compile and use a template
15698 function with a printf attribute.
15699 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15700 when jumping over bytes.
15701 * object.cc: Instantiate Object::read_section_data.
15702 * debug.h: Include <cstring>
15703 * dwarf_reader.cc: Include <algorithm>
15704 * main.cc: Include <cstring>.
15705 * options.cc: Include <cstring>.
15706 * output.cc: Include <cstring>.
15707 * script.cc: Include <cstring>.
15708 * script.h: Include <string>.
15709 * symtab.cc: Include <cstring> and <algorithm>.
15710 * target-select.cc: Include <cstring>.
15711 * version.cc: Include <string>.
15712 * testsuite/testmain.cc: Include <cstdlib>.
15713 * configure, config.in: Rebuild.
15715 2008-03-25 Ian Lance Taylor <iant@google.com>
15717 * options.cc: Include "../bfd/bfdver.h".
15718 (options::help): Print bug reporting address.
15720 * version.cc (print_version): Adjust output for current value of
15721 BFD_VERSION_STRING.
15725 * options.cc (options::help): Print list of supported targets.
15726 * target-select.h: Include <vector>.
15727 (class Target_selector): Make machine_, size_, and is_big_endian_
15728 fields const. Add bfd_name_ and instantiated_target_ fields.
15729 (Target_selector::Target_selector): Add bfd_name parameter.
15730 (Target_selector::recognize): Make non-virtual, call
15732 (Target_selector::recognize_by_name): Make non-virtual, call
15733 do_recognize_by_name.
15734 (Target_selector::supported_names): New function.
15735 (Target_selector::bfd_name): New function.
15736 (Target_selector::do_instantiate_target): New pure virtual
15738 (Target_selector::do_recognize): New virtual function.
15739 (Target_selector::do_recognize_by_name): New virtual function.
15740 (Target_selector::instantiate_target): New private function.
15741 (supported_target_names): Declare.
15742 * target-select.cc (Target_selector::Target_selector): Update for
15743 new parameter and fields.
15744 (select_target_by_name): Check that the name matches before
15745 calling recognize_by_name.
15746 (supported_target_names): New function.
15747 * i386.cc (class Target_selector_i386): Update Target_selector
15748 constructor call. Remove recognize and recognize_by_name. Add
15749 do_instantiate_target.
15750 * x86_64.cc (class Target_selector_x86_64): Likewise.
15751 * testsuite/testfile.cc (class Target_selector_test): Update for
15752 changes to Target_selector.
15754 * README: Rewrite, with some notes on unsupported features.
15756 2008-03-24 Cary Coutant <ccoutant@google.com>
15758 * i386.cc (Target_i386::Got_type): New enum declaration.
15759 (Target_i386::Scan::local): Updated callers of Output_data_got
15761 (Target_i386::Scan::global): Likewise.
15762 (Target_i386::Relocate::relocate): Likewise.
15763 (Target_i386::Relocate::relocate_tls): Likewise.
15764 * object.h (Got_offset_list): New class.
15765 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15766 (Sized_relobj::local_got_offset): Likewise.
15767 (Sized_relobj::set_local_got_offset): Likewise.
15768 (Sized_relobj::local_has_tls_got_offset): Removed.
15769 (Sized_relobj::local_tls_got_offset): Removed.
15770 (Sized_relobj::set_local_tls_got_offset): Removed.
15771 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15772 * output.cc (Output_data_got::add_global): Added got_type parameter.
15773 (Output_data_got::add_global_with_rel): Likewise.
15774 (Output_data_got::add_global_with_rela): Likewise.
15775 (Output_data_got::add_global_pair_with_rel): New function.
15776 (Output_data_got::add_global_pair_with_rela): New function.
15777 (Output_data_got::add_local): Added got_type parameter.
15778 (Output_data_got::add_local_with_rel): Likewise.
15779 (Output_data_got::add_local_with_rela): Likewise.
15780 (Output_data_got::add_local_pair_with_rel): New function.
15781 (Output_data_got::add_local_pair_with_rela): New function.
15782 (Output_data_got::add_global_tls): Removed.
15783 (Output_data_got::add_global_tls_with_rel): Removed.
15784 (Output_data_got::add_global_tls_with_rela): Removed.
15785 (Output_data_got::add_local_tls): Removed.
15786 (Output_data_got::add_local_tls_with_rel): Removed.
15787 (Output_data_got::add_local_tls_with_rela): Removed.
15788 * output.h (Output_data_got::add_global): Added got_type parameter.
15789 (Output_data_got::add_global_with_rel): Likewise.
15790 (Output_data_got::add_global_with_rela): Likewise.
15791 (Output_data_got::add_global_pair_with_rel): New function.
15792 (Output_data_got::add_global_pair_with_rela): New function.
15793 (Output_data_got::add_local): Added got_type parameter.
15794 (Output_data_got::add_local_with_rel): Likewise.
15795 (Output_data_got::add_local_with_rela): Likewise.
15796 (Output_data_got::add_local_pair_with_rel): New function.
15797 (Output_data_got::add_local_pair_with_rela): New function.
15798 (Output_data_got::add_global_tls): Removed.
15799 (Output_data_got::add_global_tls_with_rel): Removed.
15800 (Output_data_got::add_global_tls_with_rela): Removed.
15801 (Output_data_got::add_local_tls): Removed.
15802 (Output_data_got::add_local_tls_with_rel): Removed.
15803 (Output_data_got::add_local_tls_with_rela): Removed.
15804 * resolve.cc (Symbol::override_base_with_special): Removed
15805 reference to has_got_offset_ field.
15806 * symtab.cc (Symbol::init_fields): Replaced initialization
15807 of got_offset_ with got_offsets_. Removed initialization
15809 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
15810 (Symbol::got_offset): Likewise.
15811 (Symbol::set_got_offset): Likewise.
15812 (Symbol::has_tls_got_offset): Removed.
15813 (Symbol::tls_got_offset): Removed.
15814 (Symbol::set_tls_got_offset): Removed.
15815 (Symbol::got_offset_): Removed.
15816 (Symbol::tls_mod_got_offset_): Removed.
15817 (Symbol::tls_pair_got_offset_): Removed.
15818 (Symbol::got_offsets_): New field.
15819 (Symbol::has_got_offset): Removed.
15820 (Symbol::has_tls_mod_got_offset): Removed.
15821 (Symbol::has_tls_pair_got_offset): Removed.
15822 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15823 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15825 (Target_x86_64::Scan::global): Likewise.
15826 (Target_x86_64::Relocate::relocate): Likewise.
15827 (Target_x86_64::Relocate::relocate_tls): Likewise.
15829 2008-03-25 Ben Elliston <bje@au.ibm.com>
15831 * yyscript.y: Fix spelling error in comment.
15833 2008-03-24 Ian Lance Taylor <iant@google.com>
15835 * options.h (class General_options): Define build_id option.
15836 * layout.h (class Layout): Declare write_build_id, create_note,
15837 create_build_id. Add build_id_note_ member.
15838 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15839 "libiberty.h", "md5.h", "sha1.h".
15840 (Layout::Layout): Initialize eh_frame_data_,
15841 eh_frame_hdr_section_, and build_id_note_.
15842 (Layout::finalize): Call create_build_id.
15843 (Layout::create_note): New function, broken out of
15844 Layout::create_gold_note.
15845 (Layout::create_gold_note): Call create_note.
15846 (Layout::create_build_id): New function.
15847 (Layout::write_build_id): New function.
15848 (Close_task_runner::run): Call write_build_id.
15850 * x86_64.cc: Correct license to GPLv3.
15852 2008-03-23 Ian Lance Taylor <iant@google.com>
15854 * options.cc: Include "demangle.h".
15855 (parse_optional_string): New function.
15856 (parse_long_option): Handle takes_optional_argument.
15857 (parse_short_option): Update dash_z initializer. Handle
15858 takes_optional_argument.
15859 (General_options::General_options): Initialize do_demangle_.
15860 (General_options::finalize): Set do_demangle_. Handle demangling
15862 * options.h (parse_optional_string): Declare.
15863 (struct One_option): Add optional_arg field. Update constructor.
15864 Update call constructor calls. Add takes_optional_argument
15866 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15867 (DEFINE_optional_string): Define.
15868 (General_options::demangle): Change from DEFINE_bool to
15869 DEFINE_optional_string.
15870 (General_options::no_demangle): New function.
15871 (General_options::do_demangle): New function.
15872 (General_options::set_do_demangle): New function.
15873 (General_options::execstack_status_): Move definition to end of
15875 (General_options::static_): Likewise.
15876 (General_options::do_demangle_): New field.
15877 * object.cc (big_endian>::get_symbol_location_info): Call
15878 Options::do_demangle, not Options::demangle.
15879 * symtab.cc (demangle): Likewise.
15881 2008-03-22 Ian Lance Taylor <iant@google.com>
15883 * gold.h: Include <cstddef> and <sys/types.h>
15884 * options.h: Include <cstring>.
15886 2008-03-21 Ian Lance Taylor <iant@google.com>
15888 * Added source code to GNU binutils.
15890 Copyright (C) 2008-2014 Free Software Foundation, Inc.
15892 Copying and distribution of this file, with or without modification,
15893 are permitted in any medium without royalty provided the copyright
15894 notice and this notice are preserved.
15900 version-control: never