1 2015-11-05 Cary Coutant <ccoutant@gmail.com>
6 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
7 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
8 * options.h (General_options): Remove "obsolete" from -m.
9 * parameters.cc (set_parameters_target): Check if input target
10 is compatible with output emulation set by "-m emulation".
12 2015-11-05 Cary Coutant <ccoutant@gmail.com>
15 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
16 certain relocations if --no-apply-dynamic-relocs is set.
17 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
19 2015-11-03 Alan Modra <amodra@gmail.com>
21 * po/POTFILES.in: Regenerate.
23 2015-10-30 Nick Clifton <nickc@redhat.com>
25 * po/zh_CN.po: New (simplified) Chinese translation.
27 2015-10-29 H.J. Lu <hongjiu.lu@intel.com>
30 * incremental.cc (Got_plt_view_info): Add got_entry_size.
31 (Local_got_offset_visitor::visit): Replace got_entry_size_
32 with info_.got_entry_size.
33 (Local_got_offset_visitor::got_entry_size_): Removed.
34 (Global_got_offset_visitor::visit): Replace got_entry_size_
35 with info_.got_entry_size.
36 (Global_got_offset_visitor::got_entry_size_): Removed.
37 (Output_section_incremental_inputs::write_got_plt): Initialize
38 view_info.got_entry_size.
39 * target.h (Sized_target::got_entry_size): New virtual function.
40 * x86_64.cc (Target_x86_64::got_entry_size): New function.
42 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
44 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
45 * testsuite/script_test_12a.c: Likewise.
46 * testsuite/script_test_1a.cc: Likewise.
47 * testsuite/script_test_2.cc: Likewise.
49 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
51 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
53 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
56 * stringpool.cc (Stringpool_template::new_key_offset): Align all
57 strings, even zero-length.
58 (Stringpool_template::set_string_offsets): Likewise.
60 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
63 * Makefile.am (TARGETSOURCES): Add s390.cc.
64 (ALL_TARGETOBJS): Add s390.o.
65 * Makefile.in: Regenerate.
66 * configure.ac: Add s390 support.
67 * configure: Regenerate.
68 * configure.tgt: Add s390-*-* and s390x-*-*.
69 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
72 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
74 * archive.cc (Archive::sym64name): New const.
75 (Archive::setup): Add support for SYM64 armap.
76 (Archive::read_armap): Likewise.
77 (Archive::interpret_header): Likewise.
78 (Archive::const_iterator::read_next_header): Likewise.
79 * archive.h (Archive::sym64name): New const.
80 (Archive::read_armap): Add mapsize template parameter.
82 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
84 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
85 target-specific entry size.
86 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
87 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
88 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
90 * target.h (Target::hash_entry_size): New method.
91 (Target::Target_info::hash_entry_size): New data member.
93 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
94 * arm.cc (Target_arm::arm_info): Likewise.
95 (Target_arm_nacl::arm_nacl_info): Likewise.
96 * i386.cc (Target_i386::i386_info): Likewise.
97 (Target_i386_nacl::i386_nacl_info): Likewise.
98 (Target_iamcu::iamcu_info): Likewise.
99 * mips.cc (Target_mips::mips_info): Likewise.
100 (Target_mips_nacl::mips_nacl_info): Likewise.
101 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
102 * sparc.cc (Target_sparc::sparc_info): Likewise.
103 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
104 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
105 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
106 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
108 2015-10-28 H.J. Lu <hongjiu.lu@intel.com>
111 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
112 and R_386_GOT32X relocations without base register.
114 2015-10.27 Han Shen <shenhan@google.com>
116 PR gold/19042 - unsupported reloc 311/312.
118 * aarch64.cc (Target_aarch64::Scan::local): Add support for
121 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
123 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
124 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
125 as R_X86_64_GOTPCREL.
126 (Target_x86_64<size>::Scan::local): Likewise.
127 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
129 (Target_x86_64<size>::Scan::global): Likewise.
130 (Target_x86_64<size>::Relocate::relocate): Likewise.
131 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
134 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
136 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
137 R_386_GOT32X the same as R_386_GOT32.
138 (Target_i386::Scan::local): Likewise.
139 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
140 (Target_i386::Scan::global): Likewise.
141 (Target_i386::Relocate::relocate): Likewise.
142 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
145 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
147 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
148 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
149 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
150 x86_64_mov_to_lea1.o.
151 * testsuite/Makefile.in: Regenerated.
153 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
156 * options.h (General_options): Remove "obsolete" from -m.
157 * parameters.cc (set_parameters_target): Check if input target
158 is compatible with output emulation set by "-m emulation".
160 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
163 * i386.cc (Target_iamcu): New class.
164 (Target_selector_iamcu): Likewise.
165 (Target_iamcu::iamcu_info): New variable.
166 (target_selector_iamcu): Likewise.
168 2015-10-07 Andreas Schwab <schwab@suse.de>
170 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
172 2015-10-06 Cary Coutant <ccoutant@gmail.com>
175 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
177 (Sparc_relocate_functions::gdop_lox10): Likewise.
178 (Target_sparc::Relocate::relocate): Use addend when computing
179 symbol value for R_SPARC_GOTDATA_OP*.
181 2015-09-07 Cary Coutant <ccoutant@gmail.com>
185 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
186 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
188 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
191 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
192 shared libraries into normal FUNC symbols.
193 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
194 symbols aren't from shared libraries.
196 2015-09-02 Alan Modra <amodra@gmail.com>
199 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
200 (Target_powerpc::Branch_info::make_stub): Determine whether long
201 branch stub is for save/restore function.
202 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
203 (Stub_table): Add need_save_res_.
204 (Stub_table:clear_stubs): Clear need_save_res_.
205 (Stub_table:set_address_and_size): Add save/restore section size.
206 (Stub_table::add_long_branch_entry): Add save_res param. Set
207 need_save_res_, but don't add space for save/restore stubs.
208 (Stub_table::find_long_branch_entry): Return offset to local copy
209 of save/restore func.
210 (Stub_table::do_write): Don't output save/restore stubs. Instead
211 copy the save/restore functions.
212 (Output_data_save_res:contents): New accessor.
213 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
215 2015-08-25 Cary Coutant <ccoutant@gmail.com>
218 * script-sections.cc (Memory_region::set_address): New method.
219 (Script_sections::find_memory_region): Add explicit_only parameter.
220 (Output_section_definition::set_section_addresses): Handle case where
221 script specifies both address and vma region.
222 * script-sections.h (Script_sections::find_memory_region): Add
223 explicit_only parameter.
225 2015-08-25 Cary Coutant <ccoutant@gmail.com>
228 * object.cc (Input_objects::add_object): Store objects in a map,
229 indexed by soname; update as-needed flag when necessary.
230 * object.h (Object::clear_as_needed): New method.
231 (Input_objects::so_names_): Change from set to map.
233 2015-08-25 Cary Coutant <ccoutant@gmail.com>
236 * expression.cc (Expression::Expression_eval_info): Add
237 is_valid_pointer field.
238 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
240 (Addr_expression::value_from_output_section): Check whether address
242 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
243 if evaluation failed due to address that is not yet valid.
244 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
247 2015-08-25 Cary Coutant <ccoutant@gmail.com>
251 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
253 2015-08-20 Alan Modra <amodra@gmail.com>
256 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
257 Subtract os->address() from addend.
258 * powerpc.cc (relocate_relocs): Likewise.
260 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
262 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
263 lazy_stub_normal_1, lazy_stub_normal_1_n64,
264 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
265 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
266 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
267 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
270 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
272 * configure: Regenerated.
274 2015-07-26 Doug Kwan <dougkwan@google.com>
276 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
277 disassembler output format.
279 2015-07-23 Ian Coolidge <icoolidge@google.com>
280 Plumb --pic-veneer option for gold.
282 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
284 * options.h (General_options): Add --pic-veneer option.
286 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
289 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
290 script_test_1a.cc script_test_1b.cc.
291 (script_test_11_r.o): Replace script_test_11.o with
292 script_test_11a.o script_test_11b.o.
293 (script_test_11.o): Removed.
294 (script_test_11a.o): New.
295 (script_test_11b.o): Likewise.
296 * testsuite/Makefile.in: Regenerated.
297 * testsuite/script_test_1.h: New file.
298 * testsuite/script_test_1b.cc: Likewise.
299 * testsuite/script_test_11.h: Likewise.
300 * testsuite/script_test_11b.c: Likewise.
301 * testsuite/script_test_1.cc: Renamed to ...
302 * testsuite/script_test_1a.cc: This.
303 Include "script_test_1.h".
304 (main): Call check_int and check_ptr.
305 * testsuite/script_test_11.c: Renamed to ...
306 * testsuite/script_test_11a.c: This.
307 Include "script_test_11.h".
308 (main): Call ptr_equal.
310 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
313 * testsuite/ifuncdep2.c (global): Change protected to hidden.
314 * testsuite/ifuncmod1.c (global): Likewise.
315 * testsuite/ifuncmod5.c (global): Likewise.
317 2015-07-22 Alan Modra <amodra@gmail.com>
319 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
321 2015-07-21 Cary Coutant <ccoutant@gmail.com>
324 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
325 forced local symbol even when oldsym != NULL.
326 (Symbol_table::do_define_in_output_segment): Likewise.
327 (Symbol_table::do_define_as_constant): Likewise.
329 2015-07-21 Cary Coutant <ccoutant@gmail.com>
332 * archive.cc (Library_base::should_include_member): Don't use entry
333 point for relocatable links, or if target is not yet valid.
334 * parameters.cc (Parameters::entry): Check target_valid().
336 2015-07-20 Han Shen <shenhan@google.com>
338 Optimize erratum 843419 fix.
340 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
341 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
342 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
343 (E843419_stub): New sub-class of Erratum_stub.
344 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
345 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
346 (AArch64_relobj::create_erratum_stub): Add 1 argument.
347 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
349 2015-07-20 Han Shen <shenhan@google.com>
351 Fix arm elf header flags wrt hardfp bit.
353 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
355 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
358 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
359 from input group section for relocatable link.
360 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
361 (check_DATA): Add pr18689.stdout.
362 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
363 (pr18689.stdout): New rule.
364 (pr18689a.o): Likewise.
365 (pr18689b.o): Likewise.
366 (pr18689.o): Likewise.
367 * testsuite/pr18689.c: New file.
368 * testsuite/pr18689.sh: Likewise.
369 * testsuite/Makefile.in: Regenerated.
371 2015-07-20 Yiran Wang <yiran@google.com>
372 Cary Coutant <ccoutant@gmail.com>
375 * resolve.cc (Symbol_table): Remove warning about references
376 from shared objects to hidden symbols.
377 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
378 * testsuite/Makefile.in: Regenerate.
379 * testsuite/hidden_test.sh: Check dynamic symbol table; update
380 expected error messages.
382 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
384 * compressed_output.cc (Output_compressed_section::set_final_data_size):
385 Make --compress-debug-sections=zlib the same as
386 --compress-debug-sections=zlib-gabi.
387 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
388 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
390 * testsuite/Makefile.in: Regenerated.
392 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
395 * compressed_output.cc (zlib_compress): Add argument for
396 compression header size. Set header size to compression header
397 size if it isn't 0. Don't write out the zlib header here.
398 (Output_compressed_section::set_final_data_size): Support
399 zlib-gnu and zlib-gabi compressions. Pass compression header
400 size to zlib_compress and write out compression header. Set
401 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
402 clear the SHF_COMPRESSED bit
403 * options.h (compress_debug_sections): Add zlib-gnu and
405 * output.h (Output_section::set_flags): New.
406 * testsuite/Makefile.am (check_PROGRAMS): Add
407 flagstest_compress_debug_sections_none,
408 flagstest_compress_debug_sections_gnu and
409 flagstest_compress_debug_sections_gabi.
410 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
411 flagstest_compress_debug_sections.stdout,
412 flagstest_compress_debug_sections.cmp,
413 flagstest_compress_debug_sections.check,
414 flagstest_compress_debug_sections_gnu.stdout,
415 flagstest_compress_debug_sections_gnu.cmp,
416 flagstest_compress_debug_sections_gnu.check,
417 flagstest_compress_debug_sections_gabi.stdout,
418 flagstest_compress_debug_sections_gabi.cmp and
419 flagstest_compress_debug_sections_gabi.check.
420 (flagstest_compress_debug_sections_none): New.
421 (flagstest_compress_debug_sections_none.stdout): Likewise.
422 (flagstest_compress_debug_sections.stdout): Likewise.
423 (flagstest_compress_debug_sections.check): Likewise.
424 (flagstest_compress_debug_sections.cmp): Likewise.
425 (flagstest_compress_debug_sections_gnu): Likewise.
426 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
427 (flagstest_compress_debug_sections_gnu.check): Likewise.
428 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
429 (flagstest_compress_debug_sections_gabi): Likewise.
430 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
431 (flagstest_compress_debug_sections_gnu.check): Likewise.
432 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
433 * testsuite/Makefile.in: Regenerated.
435 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
438 * compressed_output.h (decompress_input_section): Add arguments
439 for ELF class, big endian and sh_flags.
440 * compressed_output.cc (decompress_input_section): Likewise.
441 Support the SHF_COMPRESSED section.
442 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
444 * plugin.h (Pluginobj): Likewise.
445 * layout.cc (Layout::get_output_section_flags): Also clear the
447 * object.h (Compressed_section_info): Add flag to store sh_flags.
448 (Object): Add pure virtual elfsize and is_big_endian member
450 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
452 (build_compressed_section_map): Check SHF_COMPRESSED for
453 uncompressed size. Store sh_flags in Compressed_section_info.
454 Pass size, big_endian and sh_flags to decompress_input_section.
455 Skip the ".debug"/".zdebug" prefix when passing section name to
456 need_decompressed_section.
457 (Sized_relobj_file<size, big_endian>::do_find_special_section):
458 Don't check ".zdebug_*" sections.
459 (Object::decompressed_section_contents): Pass ELF class, big
460 endian and sh_flags to decompress_input_section.
461 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
463 * testsuite/Makefile.am (check_DATA): Add
464 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
465 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
466 gdb_index_test_2_gabi.stdout.
467 (debug_msg_cdebug_gabi.o): New.
468 (odr_violation1_cdebug_gabi.o): Likewise.
469 (odr_violation2_cdebug_gabi.o): Likewise.
470 (debug_msg_cdebug_gabi.err): Likewise.
471 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
472 (gdb_index_test_cdebug_gabi.o): Likewise.
473 (gdb_index_test_2_gabi): Likewise.
474 (gdb_index_test_2_gabi.stdout): Likewise.
475 * testsuite/gdb_index_test_2_gabi.sh: New file.
476 * testsuite/Makefile.in: Regenerated.
478 2015-07-09 Han Shen <shenhan@google.com>
480 Use "gold_info" instead of "gold_warning" for erratum fix.
482 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
484 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
486 2015-07-09 Han Shen <shenhan@google.com>
488 Drop missing symbol warning for arm/aarch64.
490 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
491 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
494 2015-07-07 Han Shen <shenhan@google.com>
496 Make gold aarch64 accept long form of mapping symbols.
498 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
501 2015-06-29 Doug Kwan <dougkwan@google.com>
503 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
504 at address expected by test.
505 * testsuite/arm_cortex_a8_b.s: Ditto.
506 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
507 * testsuite/arm_cortex_a8_bl.s: Ditto.
508 * testsuite/arm_cortex_a8_blx.s: Ditto.
509 * testsuite/arm_cortex_a8_local.s: Ditto.
510 * testsuite/arm_fix_v4bx.s: Ditto.
511 * testsuite/arm_unaligned_reloc.s: Ditto.
512 * testsuite/thumb_bl_out_of_range.s: Ditto.
513 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
514 * testsuite/thumb_blx_out_of_range.s: Ditto.
516 2015-06-29 Han Shen <shenhan@google.com>
518 Patch for erratum 843419 internal error.
520 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
521 (Erratum_stub::update_erratum_insn): New method.
522 (Stub_table::relocate_stubs): Modified to place relocated insn.
523 (AArch64_relobj::fix_errata): Modified gold_assert.
525 2015-06-12 Han Shen <shenhan@google.com>
529 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
530 defintion outside class definition.
531 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
532 (AArch64_insn_utilities::aarch64_op31): New member.
533 (AArch64_insn_utilities::aarch64_ra): New member.
534 (AArch64_insn_utilities::aarch64_mac): New member.
535 (AArch64_insn_utilities::aarch64_mlxl): New member.
536 (ST_E_835769): New global enum member.
537 (Stub_table::relocate_stubs): Add 835769 handler.
538 (Stub_template_repertoire::Stub_template_repertoire): Install new
540 (AArch64_relobj::scan_errata): This func is renamed from
542 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
543 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
544 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
545 (Target_aarch64::scan_erratum_835769_span): New method.
546 (Target_aarch64::create_erratum_stub): New method.
547 (Target_aarch64::is_erratum_835769_sequence): New method.
548 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
549 code into create_erratum_stub.
550 * options.h (fix_cortex_a53_835769): New option.
552 2015-06-11 Cary Coutant <ccoutant@gmail.com>
554 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
556 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
558 2015-06-11 Cary Coutant <ccoutant@gmail.com>
561 * layout.cc (corresponding_uncompressed_section_name): New function.
562 (Layout::choose_output_section): Call it.
563 * layout.h (corresponding_uncompressed_section_name): New function.
564 * script-sections.cc (Input_section_info::set_section_name): Check
565 for compressed debug section (.zdebug style).
567 2015-06-11 Jing Yu <jingyu@google.com>
569 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
570 * testsuite/Makefile.in: Regenerate.
572 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
574 * gold.h (is_cident): Correct typo.
576 2015-06-10 Han Shen <shenhan@google.com>
577 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
579 Now fixing for 843419 is fully functional.
581 The first part of the erratum fix CL is here -
582 https://sourceware.org/ml/binutils/2015-04/msg00229.html
584 * aarch64.cc(global enum): New constants representing stub types.
585 (Stub_template): New POD struct.
586 (Stub_template_repertoire): New class.
587 (Stub_base): New class.
588 (Erratum_stub): New class.
589 (Reloc_stub): Refactored to be a subclass of Stub_base.
590 (Reloc_stub::Stub_type): Removed.
591 (Reloc_stub::offset): Moved to Stub_base.
592 (Reloc_stub::set_offset): Moved to Stub_base.
593 (Reloc_stub::destination_address): Moved to Stub_base.
594 (Reloc_stub::set_destination_address): Moved to Stub_base.
595 (Reloc_stub::reset_destination_address): Moved to Stub_base.
596 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
597 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
598 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
599 (Reloc_stub::write): Moved to Stub_base.
600 (Reloc_stub::invalid_offset): Moved to Stub_base.
601 (Reloc_stub::invalid_address): Moved to Stub_base.
602 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
603 (Reloc_stub::stub_insns_): Moved to Stub_base.
604 (Reloc_stub::offset_): Moved to Stub_base.
605 (Reloc_stub::destination_address_): Moved to Stub_base.
606 (Stub_table::The_aarch64_relobj): New typedef.
607 (Stub_table::The_erratum_stub): New typedef.
608 (Stub_table::The_erratum_stub_less): New typedef.
609 (Stub_table::The_erratum_stub_set): New typedef.
610 (Stub_table::The_erratum_stub_set_iter): New typedef.
611 (Stub_table::empty): Added emptiness testing for erratum stubs.
612 (Stub_table::add_erratum_stub): New method to add an erratum stub.
613 (Stub_table::find_erratum_stub): New method.
614 (Stub_table::find_erratum_stubs_for_input_section): New method.
615 (Stub_table::erratum_stub_address): New method.
616 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
617 (Stub_table::do_addralign): Modified to handle erratum stubs.
618 (Stub_table::erratum_stubs_): New member.
619 (Stub_table::erratum_stub_size_): New member.
620 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
621 (Stub_table::do_write): Modified to handle erratum stubs.
622 (AArch64_relobj::The_erratum_stub): New typedef.
623 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
624 (AArch64_relobj::fix_errata): New method.
625 (Target_aarch64::The_reloc_stub_type): Removed.
626 (Target_aarch64::The_erratum_stub): New typede.
627 (AArch64_relocate_functions::construct_b): New method.
629 2015-06-08 Nick Clifton <nickc@redhat.com>
631 * po/fr.po: New French Translation.
633 2015-06-07 Cary Coutant <ccoutant@gmail.com>
636 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
637 callers. Don't use STT_COMMON to check for common symbols.
638 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
639 symbol that's not in a common section.
640 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
643 2015-06-04 Cary Coutant <ccoutant@gmail.com>
646 * Makefile.am (diststuff): Add target.
647 * Makefile.in: Regenerate.
649 2015-06-04 Cary Coutant <ccoutant@gmail.com>
652 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
653 temporary locals in merge sections.
654 * options.cc (General_options::parse_discard_all): New method.
655 (General_options::parse_discard_locals): New method.
656 (General_options::parse_discard_none): New method.
657 (General_options::General_options): Initialize discard_locals_.
658 * options.h (--discard-all): Convert to special option.
659 (--discard-locals): Likewise.
660 (--discard-none): New option.
661 (General_options::discard_all): New method.
662 (General_options::discard_locals): New method.
663 (General_options::discard_sec_merge): New method.
664 (General_options::Discard_locals): New enum.
665 (General_options::discard_locals_): New data member.
667 2015-06-03 Cary Coutant <cary@google.com>
669 * script-sections.cc (Script_sections::Script_sections): Initialize
671 (Script_sections::create_note_and_tls_segments): Set flag when
672 segments are created.
673 (Script_sections::expected_segment_count): Count PT_INTERP.
674 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
675 segments are created.
676 * script-sections.h (Script_sections::segments_created_): New data
679 2015-06-03 Cary Coutant <ccoutant@gmail.com>
683 (Output_section_element_input::set_section_addresses): When there
684 are several patterns with no sort spec, put all sections in the same
686 * testsuite/Makefile.am (script_test_12): New testcase.
687 (script_test_12i): New testcase.
688 * testsuite/Makefile.in: Regenerate.
689 * testsuite/script_test_12.t: New test linker script.
690 * testsuite/script_test_12i.t: New test linker script.
691 * testsuite/script_test_12a.c: New test source file.
692 * testsuite/script_test_12b.c: New test source file.
694 2015-06-02 Cary Coutant <ccoutant@gmail.com>
696 * nacl.h (Sniff_file): Switch parameters to get_view to get an
699 2015-06-03 Cary Coutant <ccoutant@gmail.com>
702 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
703 separate task to schedule the build id computation.
704 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
705 add Output_file and offset.
706 (Hash_task::run): Get and release the input views.
707 (Hash_task::is_runnable): Always return NULL (always runnable).
708 (Layout::queue_build_id_tasks): Remove.
709 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
710 parameters; use them instead of class members.
711 (Build_id_task_runner::run): New function.
712 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
714 * layout.h (Layout::queue_build_id_tasks): Remove.
715 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
717 (Layout::array_of_hashes_): Remove.
718 (Layout::size_of_array_of_hashes_): Remove.
719 (Layout::input_view_): Remove.
720 (Build_id_task_runner): New class.
721 (Close_task_runner::Close_task_runner): Add array_of_hashes and
722 size_of_hashes parameters.
723 (Close_task_runner::array_of_hashes_): New data member.
724 (Close_task_runner::size_of_hashes_): New data member.
725 * testsuite/Makefile.am
726 (flagstest_compress_debug_sections_and_build_id_tree): New test.
727 * testsuite/Makefile.in: Regenerate.
729 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
731 * merge.cc (get_input_merge_map): Update for data structure change.
732 (get_or_make_input_merge_map): Update for data structure change.
733 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
734 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
736 2015-05-16 Alan Modra <amodra@gmail.com>
738 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
739 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
740 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
741 (lis_0): Rename from lis_0_0.
743 2015-04-29 Cary Coutant <cary@google.com>
744 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
746 * gc.h (Garbage_collection::is_section_garbage): Change Object*
748 (Garbage_collection::add_reference): Likewise.
749 (Garbage_collection::gc_process_relocs): Likewise. Don't push
750 object/shndx pair onto *secvec for dynamic objects. Don't follow
751 relocations pointing to dynamic objects for GC.
752 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
753 (Icf::unfold_section): Likewise.
754 (Icf::is_section_folded): Likewise.
755 (Icf::get_folded_section): Likewise.
756 * icf.h: (Icf::get_folded_section): Likewise.
757 (Icf::unfold_section): Likewise.
758 (Icf::is_section_folded): Likewise.
759 (Icf::section_has_function_pointers): Likewise.
760 (Icf::set_section_has_function_pointers): Likewise.
761 * object.h (Section_id): Likewise.
762 (Const_section_id): Likewise.
763 * output.cc (Output_section::update_section_layout): Likewise.
764 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
766 * plugin.cc (update_section_order): Likewise.
767 (unique_segment_for_sections): Likewise.
768 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
769 (Target_powerpc::do_gc_add_reference): Likewise.
770 (Target_powerpc::gc_process_relocs): Likewise.
771 (Target_powerpc::do_gc_add_reference): Likewise.
772 * symtab.cc (Symbol_table::is_section_folded): Likewise.
773 (Symbol_table::gc_mark_symbol): Likewise.
774 * symtab.h: (Symbol_table::is_section_folded): Likewise.
775 * target.h: (Sized_target::gc_add_reference): Likewise.
776 (Sized_target::do_gc_add_reference): Likewise.
778 2015-04-29 Nick Clifton <nickc@redhat.com>
780 * po/fi.po: Updated Finnish translation.
782 2015-04-28 Alan Modra <amodra@gmail.com>
784 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
785 than unsigned int for find_global_entry result temp. Compare
786 against invalid_address.
787 (Target_powerpc::do_plt_address_for_global): Likewise.
788 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
789 on plt call stub existence for debug info. Do assert for plt
790 and global entry stub existence if an alloc section.
792 2015-04-28 Alan Modra <amodra@gmail.com>
794 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
795 on missing global entry stub due to bogus debug info.
797 2015-04-27 Han Shen <shenhan@google.com>
799 * options.h (--fix-cortex-a53-843419): Rename option.
800 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
802 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
804 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
807 * output.cc (Output_section::is_input_address_mapped): Assume a missing
809 * testsuite/Makefile.am: Add the eh_test test.
810 * testsuite/Makefile.in: Regenerate.
811 * testsuite/eh_test_a.cc: New test.
812 * testsuite/eh_test_b.cc: New test.
814 2015-04-23 Sriraman Tallam <tmsriram@google.com>
816 * options.h (--weak-unresolved-symbols): New option.
817 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
818 binding to weak with new option.
819 * symtab.h (is_weak_undefined): Check for new option.
820 (is_strong_undefined): Check for new option.
821 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
822 * testsuite/Makefile.in: Regenerate.
823 * testsuite/weak_unresolved_symbols_test.cc: New file.
825 2015-04-20 Ian Coolidge <icoolidge@google.com>
827 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
830 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
832 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
834 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
835 * object.cc (Sized_relobj_file::do_layout): Use push_back.
836 * powerpc.cc (process_gc_mark): Use push_back.
837 (Target_powerpc::do_gc_mark_symbol): Use push_back.
838 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
840 2015-04-16 Han Shen <shenhan@google.com>
842 * aarch64.cc (AArch64_insn_utilities): New utility class.
843 (AArch64_relobj::Mapping_symbol_position): New struct.
844 (AArch64_relobj::Mapping_symbol_info): New typedef.
845 (AArch64_relobj::do_count_local_symbols): New function overriding
846 parent's implementation.
847 (AArch64_relobj::mapping_symbol_info_): New member
848 (AArch64_relobj::scan_erratum_843419): New method.
849 (Target_aarch64::scan_erratum_843419_span): New method.
850 (Target_aarch64::is_erratum_843419_sequence): New method.
851 * options.h (fix_cortex_a53): New option.
853 2015-04-09 Cary Coutant <ccoutant@google.com>
855 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
857 * testsuite/Makefile.am (tls_pie_test.sh): New test.
858 * testsuite/Makefile.in: Regenerate.
859 * testsuite/tls_pie_test.sh: New.
861 2015-04-09 Cary Coutant <ccoutant@google.com>
863 * debug.h (DEBUG_LOCATION): New.
864 (DEBUG_ALL): Include DEBUG_LOCATION.
865 (debug_string_to_enum): Add DEBUG_LOCATION.
866 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
867 output to print correct context.
868 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
869 up to 4 more locations at the beginning of the function.
870 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
871 result before sorting list of line numbers.
872 * testsuite/debug_msg.sh: Allow range of line numbers for
873 canonical results on optimized code.
875 2015-04-07 HC Yen <hc.yen@mediatek.com>
877 Add AArch32 support for gold linker.
879 * arm.cc: Add V8 arch combine table.
881 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
883 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
885 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
887 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
888 to find by using the return value of insert.
890 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
892 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
895 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
898 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
899 (Target_x86_64::Scan::local): Don't create GOT entry, when we
900 can convert mov to lea.
901 (Target_x86_64::Scan::global): Ditto.
902 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
903 %reg to lea foo(%rip), %reg if possible.
904 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
905 * testsuite/x86_64_mov_to_lea1.s: New.
906 * testsuite/x86_64_mov_to_lea2.s: Ditto.
907 * testsuite/x86_64_mov_to_lea3.s: Ditto.
908 * testsuite/x86_64_mov_to_lea4.s: Ditto.
909 * testsuite/x86_64_mov_to_lea.sh: Ditto.
911 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
913 * configure: Regenerated.
915 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
918 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
919 (Target_i386::Scan::local): Don't create GOT entry, when we
920 can convert GOT to GOTOFF.
921 (Target_i386::Scan::global): Ditto.
922 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
923 lea foo@GOTOFF(%reg), %reg if possible.
924 * testsuite/Makefile.am (i386_mov_to_lea): New test.
925 * testsuite/i386_mov_to_lea1.s: New.
926 * testsuite/i386_mov_to_lea2.s: Ditto.
927 * testsuite/i386_mov_to_lea3.s: Ditto.
928 * testsuite/i386_mov_to_lea4.s: Ditto.
929 * testsuite/i386_mov_to_lea5.s: Ditto.
930 * testsuite/i386_mov_to_lea.sh: Ditto.
932 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
934 * Makefile.am (ZLIB): New.
936 (AM_CFLAGS): Add $(ZLIBINC).
937 (AM_CXXFLAGS): Likewise.
938 (ldadd_varldadd_var): Add $(ZLIB).
939 (incremental_dump_LDADD): Likewise.
940 (dwp_LDADD): Likewise.
941 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
943 (zlib_compress): Don't check HAVE_ZLIB_H.
944 (zlib_decompress): Likewise.
945 * options.h (compress_debug_sections): Likewise.
946 * configure.ac (AM_CONDITIONAL): Removed.
947 * testsuite/Makefile.am (ZLIB): New.
948 (LDADD): Add $(ZLIB).
949 Don't check HAVE_ZLIB.
950 * Makefile.in: Regenerated.
951 * config.in: Likewise.
952 * configure: Likewise.
953 * testsuite/Makefile.in: Likewise.
955 2015-03-30 Jing Yu <jingyu@google.com>
957 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
958 TLSLD_ADD_DTPREL_LO12_NC.
959 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
960 _TLS_MODULE_BASE_ point to the start of tls segment.
961 (Target_aarch64::optimize_tls_reloc): Add cases for
962 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
963 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
964 (Target_aarch64::Scan::local): Likewise.
965 (Target_aarch64::Scan::global): Likewise.
966 (Target_aarch64::Relocate::relocate): Likewise.
967 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
968 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
971 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
973 * merge.cc (Object_merge_map::add_mapping): call
974 Object_merge_map::Input_merge_map::add_mapping.
975 (Object_merge_map::Input_merge_map::add_mapping): New.
976 (Output_merge_data::do_add_input_section): Call
977 get_or_make_input_merge_map before a loop.
978 (Output_merge_string<Char_type>::finalize_merged_data): Call
979 get_or_make_input_merge_map before a loop.
980 * merge.h (Object_merge_map): Make Input_merge_map public.
981 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
982 (Relobj::get_or_create_merge_map): New.
983 * object.h (Relobj::get_or_create_merge_map): New.
985 2015-03-24 Alan Modra <amodra@gmail.com>
988 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
989 relocation errors for branches to strong undefined symbols.
991 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
993 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
994 (Object_merge_map::is_merge_section_for): Remove.
995 (Object_merge_map::find_merge_section): New.
996 * merge.h (Object_merge_map::is_merge_section_for): Remove.
997 (Object_merge_map::find_merge_section): New.
998 (Object_merge_map::get_input_merge_map): Add a const version.
999 * object.cc (Relobj::is_merge_section_for): Remove.
1000 (Relobj::find_merge_section): New.
1001 * object.h (Relobj::is_merge_section_for): Remove.
1002 (Relobj::find_merge_section): New.
1004 (Output_section::Input_section::is_merge_section_for): Remove.
1005 (Output_section::add_merge_input_section): Don't call
1006 add_merge_input_section.
1007 (Output_section::find_merge_section): Return const. Use
1008 object->find_merge_section.
1009 (Output_section::build_lookup_maps): Don't build a map for
1011 (Output_section::is_input_address_mapped): Return false if
1012 section is not found.
1013 (Output_section::find_starting_output_address): Use
1014 find_merge_section instead of is_merge_section_for.
1015 (Output_section::add_script_input_section): Don't build a map for
1017 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1018 (Output_section_lookup_maps::find_merge_section): Remove.
1019 (Output_section_lookup_maps::add_merge_input_section) Remove.
1020 (Output_section::find_merge_section): Return const.
1022 2015-03-22 Cary Coutant <cary@google.com>
1025 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1026 non-SIB form of lea, with nop after the call.
1028 2015-03-21 Cary Coutant <cary@google.com>
1031 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1033 (Output_segment::set_section_addresses): Don't align size of relro
1036 2015-03-21 Cary Coutant <cary@google.com>
1039 * stringpool.cc (Stringpool_template): Don't optimize if section
1040 alignment is greater than sizeof(char).
1042 2015-03-21 Cary Coutant <cary@google.com>
1045 * script-c.h (script_include_directive): Add first_token parameter.
1046 * script.cc (script_include_directive): Add first_token parameter, and
1047 pass it to read_script_file.
1048 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1049 (PARSING_MEMORY_DEF): New tokens.
1050 (top): Add new productions for INCLUDE files.
1051 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1052 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1053 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1054 (section_cmd): Pass PARSING_SECTION_CMDS.
1055 (file_or_sections_cmd): Remove.
1056 (memory_def): Pass PARSING_MEMORY_DEF.
1057 * testsuite/Makefile.am (memory_test_2): New test.
1058 * testsuite/Makefile.in: Regenerate.
1059 * testsuite/memory_test_inc.t: New script file.
1060 * testsuite/memory_test_inc_1.t.src: New script file.
1061 * testsuite/memory_test_inc_2.t.src: New script file.
1062 * testsuite/memory_test_inc_3.t.src: New script file.
1064 2015-03-21 Cary Coutant <cary@google.com>
1066 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1067 (Sized_relobj_dwo::setup): Build compressed section map.
1068 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1069 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1071 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1072 compressed_sections_ field.
1073 (build_compressed_section_map): Take Object instead of
1074 Sized_relobj_file parameter; add decompress_if_needed parameter.
1075 (Sized_relobj_file::do_find_special_sections): Store compressed
1076 section map in parent Object.
1077 (Sized_relobj_file::do_decompressed_section_contents): Move
1078 implementation to Object::decompressed_section_contents.
1079 (Sized_relobj_file::do_discard_decompressed_sections): Move
1080 implementation to Object::discard_decompressed_sections.
1081 * object.h (build_compressed_section_map): Declare.
1082 (Object::Object): Add compressed_sections_ field.
1083 (Object::section_is_compressed): Move implementation here.
1084 (Object::decompressed_section_contents): De-virtualize.
1085 (Object::discard_decompressed_sections): De-virtualize.
1086 (Object::do_section_is_compressed): Delete.
1087 (Object::do_decompressed_section_contents): Delete.
1088 (Object::set_compressed_sections): New method.
1089 (Object::compressed_sections): New method.
1090 (Object::compressed_sections_): New data member.
1091 (Compressed_section_info, Compressed_section_map): Move to top of file.
1092 (Sized_relobj_file::do_section_is_compressed): Delete.
1093 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1094 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1095 (Sized_relobj_file::compressed_sections_): Move to Object class.
1097 2015-03-21 Cary Coutant <ccoutant@google.com>
1100 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1103 2015-03-11 Cary Coutant <ccoutant@google.com>
1105 * options.cc (General_options::finalize): Don't allow -z relro
1106 with incremental linking.
1107 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1108 (incremental_test_2): Likewise.
1109 (incremental_test_3): Likewise.
1110 (incremental_test_4): Likewise.
1111 (incremental_test_5): Likewise.
1112 (incremental_test_6): Likewise.
1113 (incremental_copy_test): Likewise.
1114 (incremental_common_test_1): Likewise.
1115 (incremental_comdat_test_1): Likewise.
1116 * testsuite/Makefile.in: Regenerate.
1118 2015-03-09 Cary Coutant <ccoutant@google.com>
1121 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1122 return enum indicating whether .eh_frame section is empty, optimizable,
1123 unrecognized, or an end marker. Adjust explicit instantiations.
1124 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1125 (Eh_frame::add_ehframe_input_section): Change return type.
1126 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1127 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1128 to the .eh_frame output section until we see the end marker.
1129 (Layout::finalize_eh_frame_section): New.
1130 * layout.h: (Layout::finalize_eh_frame_section): New.
1132 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1134 * output.cc (Relobj::initialize_input_to_output_map<size>):
1135 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1137 2015-03-04 Cary Coutant <ccoutant@google.com>
1139 * parameters.cc (Parameters::set_target_once): Call
1140 Target::select_as_default_target just once from here...
1141 (set_parameters_target): ...instead of from here.
1143 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1145 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1146 Output_section_data instead of a Merge_map.
1147 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1148 (Eh_frame::read_cie): Use add_merge_mapping instead of
1149 Merge_map::add_mapping.
1150 (Eh_frame::read_fde): Ditto.
1151 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1152 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1153 merge_map_->get_output_offset.
1154 (Eh_frame::do_is_merge_section_for): Delete.
1155 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1156 instead of a Merge_map.
1157 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1159 (Eh_frame::do_is_merge_section_for): Delete.
1160 (Eh_frame::merge_map_): Delete.
1161 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1162 and use a Output_section_data instead of a Merge_map.
1163 (Object_merge_map::add_mapping): Ditto.
1164 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1165 (Object_merge_map::is_merge_section_for): Pass in and use a
1166 Output_section_data instead of a Merge_map.
1167 (Merge_map): Delete.
1168 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1169 of merge_map_.get_output_offset.
1170 (Output_merge_base::do_is_merge_section_for): Delete.
1171 (Output_merge_data::do_add_input_section): Use
1172 object->add_merge_mapping instead of add_mapping.
1173 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1174 * merge.h (Merge_map): Delete forward declaration.
1175 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1176 instead of a Merge_map.
1177 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1178 (Object_merge_map::is_merge_section_for): Pass in and use a
1179 Output_section_data instead of a Merge_map.
1180 (Input_merge_map::Object_merge_map::merge_map): Replace with
1182 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1183 Output_section_data instead of a Merge_map.
1184 (Merge_map): Delete.
1185 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1186 (Output_merge_base::do_is_merge_section_for): Delete.
1187 (Output_merge_base::add_mapping): Delete.
1188 (Output_merge_base::merge_map_): Delete.
1189 * object.cc (Relobj::initialize_input_to_output_map): New.
1190 (Relobj::initialize_input_to_output_map): New.
1191 (Relobj::merge_output_offset): New.
1192 (Relobj::is_merge_section_for): New.
1193 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1195 * object.h (Relobj::merge_map): Delete.
1196 (initialize_input_to_output_map): New.
1197 (set_merge_map): Delete.
1198 (add_merge_mapping): New.
1199 (merge_output_offset): New.
1200 (is_merge_section_for): New.
1201 * output.cc (Output_section::Input_section::is_merge_section_for):
1202 Use object->is_merge_section_for.
1203 * output.h (Output_section_data::is_merge_section_for): Delete.
1204 (Output_section_data::do_is_merge_section_for): Delete.
1205 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1206 Use object->initialize_input_to_output_map.
1207 (Merged_symbol_value<size>::value_from_output_section): Use
1208 object->merge_output_offset.
1210 2015-03-02 Peter Collingbourne <pcc@google.com>
1211 Cary Coutant <ccoutant@google.com>
1213 * output.cc (Output_section::add_merge_input_section): Do not
1214 attempt to merge sections with an entsize of 0.
1216 2015-03-02 Khem Raj <raj.khem@gmail.com>
1218 * attributes.h (class Output_attributes_section_data ): Add
1219 do_print_to_mapfile function.
1221 2015-02-24 Alan Modra <amodra@gmail.com>
1224 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1225 complain if value is not a multiple of four.
1226 (Target_powerpc::Relocate::relocate): Correct handling of
1227 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1229 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1231 * configure.ac (default_size): Set to 32 for x32.
1232 * configure: Regenerated.
1234 2015-02-18 Alan Modra <amodra@gmail.com>
1237 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1240 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1242 * gc.h (Garbage_collection::add_reference): Don't use find.
1244 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1246 * object.cc (write_local_symbols): avoid std::vector copy.
1248 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1250 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1252 2015-02-09 Mark Wielaard <mjw@redhat.com>
1254 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1255 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1257 2015-02-16 Cary Coutant <ccoutant@google.com>
1261 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1262 DF_SYMBOLIC if --dynamic-list option is used.
1263 * options.cc (General_options::finalize): --dynamic-list is not
1264 mutually exclusive with -Bsymbolic.
1265 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1266 listed in --dynamic-list.
1267 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1268 -Bsymbolic-functions.
1269 * testsuite/Makefile.in: Regenerate.
1271 2015-02-16 Cary Coutant <ccoutant@google.com>
1274 * incremental.cc: Remove redundant include of "output.h".
1276 2015-02-12 Jing Yu <jingyu@google.com>
1278 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1279 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1281 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1282 TLSLE_MOVW_* relocations.
1283 (Target_aarch64::Scan::global): Likewise.
1284 (Target_aarch64::Relocate::relocate): Likewise.
1285 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1286 for new TLSLE_MOVW_* relocations.
1288 2015-02-11 Will Newton <will.newton@linaro.org>
1291 * arm.cc (Target_arm::make_plt_section): Create an ARM
1292 state mapping symbol at the start of the PLT.
1294 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1296 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1297 Replace two_file_shared_2.so with two_file_shared_1.so.
1298 * testsuite/Makefile.in: Regenerated.
1300 2015-02-09 Alan Modra <amodra@gmail.com>
1302 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1303 plugin_test_thin.a and defsym_test.
1304 * testsuite/Makefile.in: Regenerate.
1306 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1308 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1311 2015-02-04 Peter Collingbourne <pcc@google.com>
1313 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1314 forwarding symbols when computing symbol resolution info for plugins.
1315 * plugin.h (Plugin_manager::symtab): New method.
1316 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1318 2015-02-03 Cary Coutant <ccoutant@google.com>
1319 Peter Collingbourne <pcc@google.com>
1322 * archive.cc (Thin_archive_object_unlocker): New class.
1323 (Archive::include_member): Unlock external members of thin archives.
1324 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1325 (plugin_test_2): Likewise.
1326 (plugin_test_3): Likewise.
1327 (plugin_test_4): Likewise.
1328 (plugin_test_5): Likewise.
1329 (plugin_test_6): Likewise.
1330 (plugin_test_7): Likewise.
1331 (plugin_test_8): Likewise.
1332 (plugin_test_9): Likewise.
1333 (plugin_test_10): Likewise.
1334 (plugin_test_11): New test case.
1335 * testsuite/Makefile.in: Regenerate.
1336 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1337 file to decide whether to claim file.
1338 (all_symbols_read_hook): Likewise.
1339 * testsuite/plugin_test_1.sh: Adjust expected output.
1340 * testsuite/plugin_test_2.sh: Likewise.
1341 * testsuite/plugin_test_3.sh: Likewise.
1342 * testsuite/plugin_test_6.sh: Likewise.
1343 * testsuite/plugin_test_tls.sh: Likewise.
1344 * testsuite/plugin_test_11.sh: New testcase.
1346 2015-02-03 Cary Coutant <ccoutant@google.com>
1348 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1349 file descriptors when debugging enabled. Add debug output.
1350 (Descriptors::release): Add debug output.
1351 (Descriptors::close_some_descriptor): Likewise.
1352 (Descriptors::close_all): Likewise.
1353 * fileread.cc (File_read::lock): Likewise.
1354 (File_read::unlock): Likewise.
1356 2015-02-02 Cary Coutant <ccoutant@google.com>
1358 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1359 executable output file.
1361 2015-01-22 Han Shen <shenhan@google.com>
1363 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1364 (Target_arm::do_plt_address_for_global): New method.
1365 (Target_arm::do_plt_address_for_local): New method.
1366 (Target_arm::rel_irelative_section): New method.
1367 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1368 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1369 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1370 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1371 (Target_arm::Scan::check_non_pic): Add ifunc support.
1372 (Target_arm::Scan::local): Add ifunc support.
1373 (Target_arm::Scan::global): Add ifunc support.
1374 (Target_arm::make_plt_section): New method.
1375 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1376 (Target_arm::make_local_ifunc_plt_entry): New method.
1377 (Target_arm::got_irelative_): New member.
1378 (Target_arm::rel_irelative_): New member.
1379 (Target_arm::got_section): Add creation for got_irelative_.
1380 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1381 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1382 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1383 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1384 (Output_data_plt_arm::IRelative_data): New type.
1385 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1386 (Output_data_plt_arm::add_entry): Add more parameters.
1387 (Output_data_plt_arm::add_relocation): New method.
1388 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1389 (Output_data_plt_arm::rel_irelative): New method.
1390 (Output_data_plt_arm::entry_count): Modified.
1391 (Output_data_plt_arm::address_for_global): New method.
1392 (Output_data_plt_arm::address_for_local): New method.
1394 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1395 (Output_data_plt_arm::insert_irelative_data): New method.
1396 (Output_data_plt_arm::irelative_rel_): New member.
1397 (Output_data_plt_arm::got_): New member.
1398 (Output_data_plt_arm::got_irelative_): New member.
1399 (Output_data_plt_arm::irelative_count_): New member.
1400 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1401 (Output_data_plt_arm::irelative_data_vec_): New member.
1402 (Output_data_plt_arm::do_write): Write out irelative entries.
1403 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1404 more parameters to ctor.
1405 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1406 more parameters to ctor.
1407 * output.h (Output_data_reloc::add_local_relative): New method.
1408 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1410 2015-01-29 Alan Modra <amodra@gmail.com>
1412 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1413 and GOT_TLSGD to LE optimization.
1415 2015-01-28 Cary Coutant <ccoutant@google.com>
1417 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1418 for undef TLS symbols.
1419 (Target_x86_64::Relocate::relocate_tls): Likewise.
1420 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1422 2015-01-25 Cary Coutant <ccoutant@google.com>
1424 * output.cc (Output_segment::set_section_addresses): Fix calculation
1425 of size of relro segment.
1427 2015-01-22 Alan Modra <amodra@gmail.com>
1429 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1430 condition for need of ifunc plt entry.
1431 (Target_powerpc::Scan::global <got relocs>): Likewise.
1433 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1435 * mips.cc (reloc_high): Add r_sym.
1436 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1437 reloc_high constructor.
1438 (Mips_relocate_functions::relgot16_local): Likewise.
1439 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1440 r_type to decide whether LO16 matches HI16.
1441 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1442 rello16 and relgot16_local.
1444 2015-01-09 Cary Coutant <ccoutant@google.com>
1446 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1447 unless alignment is larger than page size.
1449 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1450 Cary Coutant <ccoutant@google.com>
1453 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1454 (DEFAULT_TARGET_X32): Set for x32.
1455 * x86_64.cc (cmp_insn_32): New.
1456 (lea_r10_insn_32): Likewise.
1457 (lea_r11_insn_32): Likewise.
1458 (cmp_insn_64): Likewise.
1459 (lea_r10_insn_64): Likewise.
1460 (lea_r11_insn_64): Likewise.
1461 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1462 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1463 (check_DATA): Add split_x32 files.
1464 (split_x32_[1234n].o): New targets.
1465 (split_x32_[124]): New targets.
1466 (split_x32_[1234r].stdout): New targets.
1467 * testsuite/split_x32.sh: New file.
1468 * testsuite/split_x32_1.s: Likewise.
1469 * testsuite/split_x32_2.s: Likewise.
1470 * testsuite/split_x32_3.s: Likewise.
1471 * testsuite/split_x32_4.s: Likewise.
1472 * testsuite/split_x32_n.s: Likewise.
1473 * configure: Regenerated.
1474 * testsuite/Makefile.in: Likewise.
1476 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1479 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1482 2015-01-02 Alan Modra <amodra@gmail.com>
1484 * version.cc (print_version): Just print current year.
1485 * dwp.cc (print_version): Likewise.
1487 2015-01-01 Alan Modra <amodra@gmail.com>
1489 Update year range in copyright notice of all files.
1491 2014-12-25 Alan Modra <amodra@gmail.com>
1493 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1495 (Target_arm::merge_object_attributes, ): Likewise.
1497 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1499 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1500 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1501 AEABI_VFP_args_vfp to check that.
1502 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1503 value and replace hardcoded values by enum values.
1505 2014-12-22 Cary Coutant <ccoutant@google.com>
1507 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1509 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1512 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1513 to "return i * i * 3;".
1515 2014-12-16 Cary Coutant <ccoutant@google.com>
1517 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1518 (Mapfile::print_output_data): Use current_data_size() to avoid
1519 assert for sections requiring postprocessing; if address is not valid,
1521 (Mapfile::print_output_section): Use current_data_size(); print note
1522 that addresses and sizes are before compression.
1524 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1526 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1527 Cast current_group_size to unsigned long when reporting error.
1529 2014-12-10 Jing Yu <jingyu@google.com>
1531 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1532 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1533 Update error message.
1534 (Target_aarch64::do_relax): Use absolute value of option
1535 stub_group_size. Replace local variable with class member
1538 2014-12-04 Alan Modra <amodra@gmail.com>
1540 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1541 addend of PLTREL24 reloc when not generating a plt stub. Make
1542 max_branch_offset an "Address".
1543 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1544 (Target_powerpc::Relocate::relocate): Likewise.
1546 2014-12-04 Alan Modra <amodra@gmail.com>
1549 * symtab.cc (Symbol::set_undefined): Remove assertion.
1550 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1551 on symbols defined in discarded sections, instead return false.
1552 Rearrange params, update all callers.
1553 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1554 branches to syms in discarded sections.
1555 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1556 undefined and flag as discarded.
1557 (Target_powerpc::Relocate::relocate): Localize variable.
1559 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1562 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1563 * testsuite/Makefile.in: Regenerated.
1565 2014-12-03 Alan Modra <amodra@gmail.com>
1568 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1569 when adding dynamic relocations against section symbols.
1571 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1573 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1574 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1575 * options.h (General_options): New -z option (global).
1577 2014-12-01 Cary Coutant <ccoutant@google.com>
1580 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1582 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1583 given but some inputs require executable stack.
1585 2014-11-26 Cary Coutant <ccoutant@google.com>
1587 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1588 .debug_str_offsets; strip .debug_gnu_pubnames and
1589 .debug_gnu_pubtypes.
1590 (lines_only_debug_sections): Strip all four new sections.
1592 2014-11-26 Jing Yu <jingyu@google.com>
1594 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1595 register to be x0 when to relax TLSDESC_LD64_LO12.
1597 2014-11-26 Alan Modra <amodra@gmail.com>
1599 * powerpc.cc (struct Stub_table_owner): New.
1600 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1601 unsigned int vector. Update all references.
1602 (powerpc_relobj::set_stub_table): Take an unsigned int param
1603 rather than a Stub_table. Update callers.
1604 (Powerpc_relobj::clear_stub_table): New function.
1605 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1606 stub_group_size_ vars.
1607 (Target_powerpc::new_stub_table): Delete.
1608 (max_branch_delta): New function, extracted from..
1609 (Target_powerpc::Relocate::relocate): ..here..
1610 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1611 status on whether stub created successfully.
1612 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1614 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1615 reduce on relax failure.
1616 (Target_powerpc::group_sections): Add "no_size_errors" param.
1617 Use stub_group_size_. Set up group info in a temp vector,
1618 before building Stub_table vector. Account for input sections
1619 possibly already converted to relaxed sections.
1620 (Stub_table::init): Delete. Merge into..
1621 (Stub_table::Stub_table): ..here.
1622 (Stub_table::can_reach_stub): New function.
1623 (Stub_table::add_plt_call_entry): Add "from" parameter and
1624 return true iff stub could be reached.
1625 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1627 (Stub_table::clear_stubs): Add "all" param.
1629 2014-11-26 Alan Modra <amodra@gmail.com>
1631 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1632 (Target_powerpc::group_sections): Use it.
1634 2014-11-25 Cary Coutant <ccoutant@google.com>
1636 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1637 (Binary_to_elf::write_symbol): Add st_size parameter.
1638 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1640 2014-11-25 Cary Coutant <ccoutant@google.com>
1643 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1644 (Sized_relobj_file::do_layout): Handle deferred sections properly
1645 during GC pass 1. Don't add reloc sections to deferred list twice.
1646 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1647 (Sized_relobj_file::is_deferred_layout_): New data member.
1649 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1652 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1653 Check PC-relative offset overflow in PLT entry.
1655 2014-11-21 Alan Modra <amodra@gmail.com>
1657 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1658 for undefined weaks.
1660 2014-11-20 Alan Modra <amodra@gmail.com>
1662 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1663 from --stub-group-size parameter divided by 1024.
1664 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1665 template parameter. Update all uses.
1666 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1667 has_stub_value. Set for long branches. Don't report overflow for
1668 branch to undefined weak symbols. Print info message on
1669 overflowing branch to stub.
1671 2014-11-20 Alan Modra <amodra@gmail.com>
1673 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1675 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1677 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1678 entry for R_X86_64_GOTPLT64.
1679 (Target_x86_64<size>::Relocate::relocate): Update comments for
1682 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1684 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1685 * plugin.h: add lock definition
1687 2014-10-29 Han Shen <shenhan@google.com>
1688 Jing Yu <jingyu@google.com>
1690 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1691 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1692 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1694 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1696 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1697 (Target_aarch64::tls_ld_to_le): New method.
1698 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1700 (Output_data_plt_aarch64::irelative_rel_): New data member.
1701 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1702 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1703 (Output_data_plt_aarch64::add_relocation): New method.
1704 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1705 offset. Add got_irelative size to got size.
1706 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1707 type string with the new typename.
1708 (AArch64_relocate_functions::update_adr): Replace parameter x with
1710 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1711 (AArch64_relocate_functions::reloc_common): New method.
1712 (AArch64_relocate_funcsions::rela_general): Extract common part out
1713 into reloc_common method.
1714 (AArch64_relocate_functions::rela_general): Likewise.
1715 (AArch64_relocate_functions::pcrela_general): Likewise.
1716 (AArch64_relocate_functions::adr): New method.
1717 (AArch64_relocate_functions::adrp): Calculate immed before calling
1719 (AArch64_relocate_functions::adrp): Likewise.
1720 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1721 comparing x to 0. Calculate immed from ~x when x < 0.
1722 (Target_aarch64::optimize_tls_reloc): Add new cases for
1723 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1724 TLSLD_MOVW_DTPREL_G0_NC.
1725 (Target_aarch64::possible_function_pointer_reloc): Implement this
1727 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1729 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1730 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1731 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1732 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1733 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1734 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1735 (Target_aarch64::make_plt_entry): Call add_entry with two more
1737 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1738 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1739 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1740 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1741 (Target_aarch64::Relocate::relocate_tls): Add cases for
1742 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1743 TLSLD_MOVW_DTPREL_G0_NC.
1744 * testsuite/icf_safe_so_test.cc: Correct test comment.
1745 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1747 2014-10-22 Alan Modra <amodra@gmail.com>
1749 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1752 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1754 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1756 2014-10-17 Cary Coutant <ccoutant@google.com>
1758 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1759 Add "typename" keyword.
1761 2014-10-15 Han Shen <shenhan@google.com>
1762 Jing Yu <jingyu@google.com>
1764 Patch for gold aarch64 backend to support relaxation.
1765 * aarch64-reloc.def: Change format.
1766 * aarch64.cc (class Reloc_stub): New class.
1767 (class Stub_table): New class.
1768 (class AArch64_relobj): New class.
1769 (class AArch64_input_section): New class.
1770 (class AArch64_output_section): New class.
1771 (Target_aarch64::new_stub_table): New method.
1772 (Target_aarch64::new_aarch64_input_section): New method.
1773 (Target_aarch64::find_aarch64_input_section): New method.
1774 (Target_aarch64::scan_section_for_stubs): New method.
1775 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1776 (Target_aarch64::relocate_stub): New method.
1777 (Target_aarch64::current_target): New method.
1778 (Target_aarch64::do_make_elf_object): New method.
1779 (Target_aarch64::do_may_relax): New method.
1780 (Target_aarch64::do_relax): New method.
1781 (Target_aarch64::group_sections): New method.
1782 (Target_aarch64::scan_reloc_for_stub): New method.
1783 (Target_aarch64::do_make_output_section): New method.
1784 (Target_aarch64::stub_tables_): New data member.
1785 (Target_aarch64::aarch64_input_section_map_): New data member.
1786 (AArch64_relocate_functions::maybe_apply_stub): New method.
1788 2014-09-30 Cary Coutant <ccoutant@google.com>
1791 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1793 2014-09-30 Kito Cheng <kito@0xlab.org>
1796 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1797 hash table before sysv-style hash table.
1799 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1801 * options.h (--pic-executable): Add negative to alias to -no-pie.
1803 2014-09-26 Cary Coutant <ccoutant@google.com>
1806 * object.cc (Sized_relobj_file): Compute value of section symbols
1807 for TLS sections the same as TLS symbols.
1809 2014-09-25 Cary Coutant <ccoutant@google.com>
1812 * resolve.cc (Symbol_table::resolve): Override common placeholder
1813 symbols, but adjust sizes.
1814 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1815 symbols to common lists.
1817 2014-09-24 Alan Modra <amodra@gmail.com>
1819 * po/POTFILES.in: Regenerate.
1821 2014-09-23 Taiju Tsuiki <tzik@google.com>
1822 Cary Coutant <ccoutant@google.com>
1825 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1826 on input_sections_blocker.
1827 * layout.cc (Write_sections_task::locks): Unblock
1828 input_sections_blocker_.
1829 * layout.h (Write_sections_task::Write_sections_task): Add
1830 input_sections_blocker.
1831 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1833 * testsuite/Makefile.in: Regenerate.
1835 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1837 * testsuite/Makefile.am (plugin_test_10): New test.
1838 * testsuite/Makefile.in: Regenerate
1839 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1840 * testsuite/plugin_test_10.sh: New file.
1842 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1844 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1845 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1846 during the replacement phase.
1848 2014-09-17 Han Shen <shenhan@google.com>
1849 Jing Yu <jingyu@google.com>
1851 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1852 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1853 * aarch64.cc (Target_aarch64): Add data members
1854 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1855 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1857 (Target_aarch64::do_reloc_symbol_index): New method.
1858 (Target_aarch64::do_reloc_addend): New method.
1859 (Target_aarch64::add_tlsdesc_info): New method.
1860 (Target_aarch64::do_dynsym_value): New method.
1861 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1862 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1863 (Target_aarch64::make_data_plt): Add new parameters: got,
1864 got_irelative. Pass them to do_make_data_plt.
1865 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1866 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1867 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1868 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1869 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1870 (Target_aarch64::got_tlsdesc_section): New method.
1871 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1872 (Target_aarch64::define_tls_base_symbol): New method.
1873 (Target_aarch64::reserve_tlsdesc_entries): New method.
1874 (Target_aarch64::got_mod_index_entry): New method.
1875 (Target_aarch64::rela_tlsdesc_section): New method.
1876 (Target_aarch64::rela_irelative_section): New method.
1877 (Target_aarch64::Tlsdesc_info): New struct.
1878 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1879 relocations and tlsdesc relocations.
1880 (Target_aarch64::optimize_tls_reloc): Implement method.
1881 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1882 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1884 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1885 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1886 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1887 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1888 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1889 (Output_data_plt_aarch64::rela_irelative): New method.
1890 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1891 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1892 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1893 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1894 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1895 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1896 (Output_data_plt_aarch64_standard): New member variables:
1897 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1898 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1899 New parameter: got, got_irelative.
1900 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1901 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1902 (Output_data_plt_aarch64::do_write): Replace got_address with
1903 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1904 (AArch64_relocate_functions::update_movnz): New method.
1905 (AArch64_relocate_functions): Correct format.
1906 (AArch64_relocate_functions::movnz): New method.
1907 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1908 before the switch. Add new cases to switch.
1909 Check ie_to_le relaxation on tlsie relocations. Add code handling
1910 tlsgd tlsdesc cases.
1911 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1912 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1913 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1914 Call reloc_name_in_error_message to print unsupported reloc.
1915 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1917 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1918 relocs. Fill in some more dynamic tags.
1919 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1920 Skip call tls_get_addr when tlsgd is relaxed.
1921 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1922 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1923 tlsdesc->ie relaxation.
1925 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1927 * mips.cc (Target_mips_nacl): New class.
1928 (Target_selector_mips_nacl): New class.
1929 (target_selector_mips32): Rename from target_selector_mips32be and use
1930 Target_selector_mips_nacl instead of Target_selector_mips.
1931 (target_selector_mips32el): Rename from target_selector_mips32 and use
1932 Target_selector_mips_nacl instead of Target_selector_mips.
1933 (target_selector_mips64): Rename from target_selector_mips64be and use
1934 Target_selector_mips_nacl instead of Target_selector_mips.
1935 (target_selector_mips64el): Rename from target_selector_mips64 and use
1936 Target_selector_mips_nacl instead of Target_selector_mips.
1937 (Target_mips::mips_info): Add const attribute.
1939 2014-09-02 Cary Coutant <ccoutant@google.com>
1941 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1942 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1943 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1944 (Sized_incr_dynobj::do_section_name): Likewise.
1945 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1946 (Sized_incr_dynobj::do_section_name): Likewise.
1947 * object.h (Object::section_name): Likewise.
1948 (Object::do_section_name): Likewise.
1949 (Sized_relobj_file::do_section_name): Likewise.
1950 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1951 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1953 2014-09-02 Cary Coutant <ccoutant@google.com>
1956 * ehframe.cc (Fde::write): Add output_offset parameter.
1957 (Cie::write): Likewise.
1958 (Eh_frame::set_final_data_size): Account for offset within output
1960 (Eh_frame::do_sized_write): Likewise.
1961 * ehframe.h (Fde::write): Add output_offset parameter.
1962 (Cie::write): Likewise.
1963 * output.cc (Output_section::Input_section_sort_entry): Remove
1964 section_has_name_; add output_section_name parameter. Use
1965 output section name for non-input sections.
1966 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1967 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1968 (Output_section::Input_section_sort_compare): Remove logic for
1969 sections without names.
1970 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1971 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1973 (Output_section::Input_section_sort_section_name_compare): Likewise.
1975 2014-08-29 Han Shen <shenhan@google.com>
1976 Jing Yu <jingyu@google.com>
1978 * aarch64-reloc-property.cc
1979 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1980 reference reloc property in the table.
1981 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1983 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1984 2 new overloaded methods.
1985 (Output_data_got_aarch64::do_write): Add code to write out
1987 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1989 (Output_data_got_aarch64::static_relocs): New vector to
1991 (Target_aarch64::TCB_SIZE): New const static memeber.
1992 (Target_aarch64::tcb_size): New method.
1993 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1994 (Target_aarch64::Relocate::relocate_tls): New method.
1995 (Target_aarch64::Scan::local): Add code handling new reloc types.
1996 (Target_aarch64::Scan::global): Add code handling new reloc types.
1998 2014-08-13 Sriraman Tallam <tmsriram@google.com>
2000 * options.h (-no-pie): Add option.
2002 2014-08-08 Jing Yu <jingyu@google.com>
2003 Han Shen <shenhan@google.com>
2005 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2006 (DEFFILES): add aarch64-reloc.def.
2007 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2008 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2009 * Makefile.in: Regenerate.
2010 * aarch64-reloc-property.cc: New file.
2011 * aarch64-reloc-property.h: New file.
2012 * aarch64-reloc.def: New file.
2013 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2014 with tab to make the format consistent.
2015 (Output_data_got_aarch64::symbol_table_): New method.
2016 (Target_aarch64::do_plt_address_for_global): New method.
2017 (Target_aarch64::do_plt_address_for_local): New method.
2018 (Target_aarch64::do_select_as_default_target): New method.
2019 (Target_aarch64::do_make_data_plt): New method.
2020 (Target_aarch64::make_data_plt): New method.
2021 (Output_data_plt_aarch64::has_irelative_section): New method.
2022 (Output_data_plt_aarch64::address_for_global): New method.
2023 (Output_data_plt_aarch64::address_for_local): New method.
2024 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2025 (Output_data_plt_aarch64::add_entry): Implement contents.
2026 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2027 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2028 the got_pov entry to plt0.
2029 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2031 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2032 (AArch64_howto): New struct.
2033 (aarch64_howto[]): New static const array.
2034 (AArch64_relocate_functions): New class.
2035 (Target_aarch64::Scan::get_reference_flags): Remove method.
2036 (Target_aarch64::Scan::local): Implement to support a few relocations.
2037 (Target_aarch64::Scan::global): Implement to support a few relocations.
2038 (Target_aarch64::make_plt_section): Implement contents.
2039 (Target_aarch64::make_plt_entry): Implement contents.
2040 (Target_aarch64::do_finalize_sections): Implement contents.
2041 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2042 (Target_aarch64::relocate_section): Implement contents.
2044 2014-08-06 Alan Modra <amodra@gmail.com>
2046 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2048 2014-08-06 Alan Modra <amodra@gmail.com>
2051 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2053 2014-07-21 Sriraman Tallam <tmsriram@google.com>
2055 * object.cc (Relobj::is_section_name_included): Add
2056 ".rodata.nptl_version" to not garbage collect this section.
2058 2014-07-08 Cary Coutant <ccoutant@google.com>
2060 * expression.cc (struct Expression::Expression_eval_info): Add
2061 new fields type_pointer, vis_pointer, and nonvis_pointer.
2062 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2063 nonvis_pointer parameters. Adjust all calls.
2064 (Symbol_expression::value): Update type, visibility, and nonvis bits
2066 * script.cc (Symbol_assignment::sized_finalize): Update type,
2067 visibility, and remaining st_other bits for new symbol.
2068 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2069 vis_pointer, and nonvis_pointer parameters.
2070 * symtab.h (Symbol::set_type): New method.
2072 * testsuite/Makefile.am (defsym_test): New test.
2073 * testsuite/Makefile.in: Regenerate.
2074 * testsuite/defsym_test.c: New file.
2075 * testsuite/defsym_test.sh: New file.
2077 2014-07-08 Cary Coutant <ccoutant@google.com>
2080 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2081 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2082 (Sized_dynobj::base_read_symbols): ...new method.
2083 * object.h (Sized_relobj_file::base_read_symbols): New method.
2084 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2085 (Sized_relobj_file::base_read_symbols): ...new method.
2086 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2087 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2088 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2090 2014-07-04 Alan Modra <amodra@gmail.com>
2092 * po/POTFILES.in: Regenerate.
2094 2014-07-02 Jing Yu <jingyu@google.com>
2096 * aarch64.cc: New file
2097 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2098 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2099 * Makefile.in: Regenerate.
2100 * configure.tgt: Add entries for aarch64*.
2101 * configure.ac: Likewise.
2102 * configure: Likewise.
2104 2014-06-27 Alan Modra <amodra@gmail.com>
2106 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2108 2014-06-24 Cary Coutant <ccoutant@google.com>
2110 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2112 (Dwo_file::sized_read_unit_index): Likewise.
2114 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2116 * mips.cc: New file.
2117 * Makefile.am (TARGETSOURCES): Add mips.cc
2118 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2119 * configure.tgt: Add entries for mips*.
2120 * configure.ac: Likewise.
2121 * Makefile.in: Regenerate.
2122 * configure: Likewise.
2124 2014-06-09 Cary Coutant <ccoutant@google.com>
2126 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2127 unit_length is within section bounds.
2129 2014-06-09 Cary Coutant <ccoutant@google.com>
2132 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2135 2014-06-07 Alan Modra <amodra@gmail.com>
2137 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2139 2014-06-06 Cary Coutant <ccoutant@google.com>
2141 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2142 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2143 (Dwarf_pubnames_table::read_header): Likewise.
2144 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2145 .debug_gnu_pubtypes.
2147 2014-06-05 Joel Brobecker <brobecker@adacore.com>
2149 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2150 * Makefile.in, configure: Regenerate.
2152 2014-06-03 Alan Modra <amodra@gmail.com>
2154 * powerpc.cc (addis_12_2): Define.
2155 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2157 2014-06-03 Alan Modra <amodra@gmail.com>
2159 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2162 2014-06-02 Alan Modra <amodra@gmail.com>
2164 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2165 Only ignore relocs on ELFv1.
2166 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2168 2014-05-30 Cary Coutant <ccoutant@google.com>
2170 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2171 * testsuite/Makefile.in: Regenerate.
2172 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2174 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2177 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2178 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2180 2014-05-15 Alan Modra <amodra@gmail.com>
2182 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2183 Compare FDE contents with DW_CFA_nop rather than 0.
2185 2014-05-13 Sriraman Tallam <tmsriram@google.com>
2187 * symtab.h (may_need_copy_reloc): Remove check for position independent
2189 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2190 position independence before pc absolute may_need_copy_reloc call.
2191 Add check for executable output befor pc relative may_need_copy_reloc
2197 * powerpc.cc: Add check for no position independence before
2198 may_need_copy_reloc calls.
2199 * testsuite/pie_copyrelocs_test.cc: New file.
2200 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2201 * Makefile.am (pie_copyrelocs_test): New test.
2202 * Makefile.in: Regenerate.
2204 2014-05-08 Martin Liška <mliska@suse.cz>
2206 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2208 2014-05-06 Cary Coutant <ccoutant@google.com>
2211 * i386.cc (Output_data_got_plt_i386): New class.
2212 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2213 parameter. Change all callers.
2214 (Output_data_plt_i386::layout_): Remove.
2215 (Output_data_plt_i386::got_plt_): Change type.
2216 (Target_i386::got_plt_): Change type. Change all references.
2217 (Target_i386::got_section): Create instance of new class.
2218 (Output_data_got_plt_i386::do_write): New function.
2219 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2220 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2221 parameter. Change all callers.
2222 (Output_data_plt_x86_64::layout_): Remove.
2223 (Output_data_plt_x86_64::got_plt_): Change type.
2224 (Target_x86_64::got_plt_): Change type. Change all references.
2225 (Target_x86_64::got_section): Create instance of new class.
2226 (Output_data_got_plt_x86_64::do_write): New function.
2227 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2228 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2231 2014-05-05 Cary Coutant <ccoutant@google.com>
2233 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2234 if we have pubnames/pubtypes.
2236 2014-05-02 Cary Coutant <ccoutant@google.com>
2238 * defstd.cc (in_segment): Define __ehdr_start here...
2239 * layout.cc (Layout::finalize): ...Instead of here. Set the
2240 output segment when known.
2241 * resolve.cc (Symbol::override_base_with_special): Remember
2242 the original binding.
2243 * symtab.cc (Symbol::set_output_segment): New function.
2244 (Symbol::set_undefined): New function.
2245 * symtab.h (Symbol::is_weak_undefined): Check original undef
2247 (Symbol::is_strong_undefined): New function.
2248 (Symbol::set_output_segment): New function.
2249 (Symbol::set_undefined): New function.
2250 * target-reloc.h (is_strong_undefined): Remove.
2251 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2252 Check for hidden undefs.
2253 (relocate_section): Call Symbol::is_strong_undefined.
2255 * testsuite/Makefile.am (ehdr_start_test_1)
2256 (ehdr_start_test_2, ehdr_start_test_3)
2257 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2258 * testsuite/Makefile.in: Regenerate.
2259 * testsuite/ehdr_start_def.cc: New source file.
2260 * testsuite/ehdr_start_test.cc: New source file.
2261 * testsuite/ehdr_start_test.t: New linker script.
2262 * testsuite/ehdr_start_test_4.sh: New shell script.
2264 2014-04-23 Cary Coutant <ccoutant@google.com>
2267 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2269 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2271 * layout.cc (Layout::include_section): Allow a target to decide
2272 whether to include a section.
2273 * target.h (Target::should_include_section): New function.
2274 (Target::do_should_include_section): New function.
2276 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2278 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2280 (Copy_relocs::emit): ... here.
2281 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2282 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2283 (Copy_reloc_entry::entries_): Change from private to protected.
2285 2014-04-02 Sriraman Tallam <tmsriram@google.com>
2287 * icf.cc (get_section_contents): Replace copies of reloc
2288 vectors with const references.
2290 2014-04-02 Cary Coutant <ccoutant@google.com>
2292 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2293 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2294 * configure: Regenerate.
2295 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2296 -fno-use-linker-plugin.
2297 (LINK1, CXXLINK1): Add it to the link command.
2298 * testsuite/Makefile.in: Regenerate.
2300 2014-03-12 Alan Modra <amodra@gmail.com>
2302 * Makefile.in: Regenerate.
2304 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2306 * symtab.h (Symbol::set_nonvis): New function.
2308 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2310 * symtab.cc (Sized_symbol<32>::init_output_data):
2311 Instantiate the template.
2312 (Sized_symbol<64>::init_output_data): Likewise.
2314 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2316 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2317 adjust dynamic symbol value.
2318 * target.h (Target::adjust_dyn_symbol): New function.
2319 (Target::do_adjust_dyn_symbol): New function.
2321 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2323 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2324 Get the value of DYNAMIC_CUSTOM dynamic entry.
2325 * output.h (Output_data_dynamic::add_custom): New function.
2326 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2328 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2329 * target.h (Target::dynamic_tag_custom_value): New function.
2330 (Target::do_dynamic_tag_custom_value): New function.
2332 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2334 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2336 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2337 (Target::do_has_custom_set_dynsym_indexes): New function.
2338 (Target::set_dynsym_indexes): New function.
2339 (Target::do_set_dynsym_indexes): New function.
2341 2014-03-07 Alan Modra <amodra@gmail.com>
2343 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2344 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2345 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2346 (Powerpc_relocate_functions::has_overflow_bitfield,
2347 overflowed): Use the above.
2348 (Target_powerpc::Relocate::relocate): Correct overflow checking
2349 for a number of relocations. Modify overflow test for 16-bit
2350 fields in instructions to signed/unsigned according to whether
2351 the field takes a signed or unsigned value.
2353 2014-03-05 Alan Modra <amodra@gmail.com>
2355 Update copyright years.
2357 2014-03-05 Alan Modra <amodra@gmail.com>
2359 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2360 R_PPC64_ADDR64_LOCAL.
2361 (Target_powerpc::Relocate::relocate): Likewise.
2363 2014-03-03 Alan Modra <amodra@gmail.com>
2365 * dwp.cc (print_version): Update copyright year to current.
2367 2014-02-10 Alan Modra <amodra@gmail.com>
2369 * po/gold.pot: Regenerate.
2371 2014-02-06 Cary Coutant <ccoutant@google.com>
2373 Fix problem where -u is ignored when a weak undef is seen.
2375 * archive.cc (Library_base::should_include_member): Reorder
2376 code to check for -u option if a weak undef has already been seen.
2377 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2378 * testsuite/Makefile.in: Regenerate.
2379 * testsuite/weak_undef_file3.cc: New file.
2380 * testsuite/weak_undef_file4.cc: New file.
2381 * testsuite/weak_undef_test_2.cc: New file.
2383 2014-02-05 Cary Coutant <ccoutant@google.com>
2385 Fix issues with gold undefined symbol diagnostics.
2388 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2390 * target-reloc.h (is_strong_undefined): New function.
2391 (relocate_section): Move undef vtable symbol check from here.
2392 Check for is_strong_undefined.
2394 2014-02-05 Cary Coutant <ccoutant@google.com>
2396 Fix problems with the --dynamic-list option.
2399 * options.cc (General_options::parse_dynamic_list):
2400 Set have_dynamic_list_.
2401 (General_options::General_options): Initialize have_dynamic_list_.
2402 (General_options::finalize): Turn off -Bsymbolic and
2403 -Bsymbolic-functions if --dynamic-list provided.
2404 * options.h (General_options::have_dynamic_list): New function.
2405 (General_options::have_dynamic_list_): New data member.
2406 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2410 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2411 in --dynamic-list, mark it.
2413 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2414 (dynamic_list_2): New test case.
2415 * testsuite/Makefile.in: Regenerate.
2416 * testsuite/dynamic_list_2.cc: New file.
2417 * testsuite/dynamic_list_2.t: New file.
2418 * testsuite/dynamic_list_lib1.cc: New file.
2419 * testsuite/dynamic_list_lib2.cc: New file.
2420 * testsuite/gc_dynamic_list_test.c: New file.
2421 * testsuite/gc_dynamic_list_test.sh: New file.
2422 * testsuite/gc_dynamic_list_test.t: New file.
2424 2014-01-28 Cary Coutant <ccoutant@google.com>
2426 Add .gdb_index version 7 support.
2428 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2429 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2431 (Dwarf_ranges_table::read_ranges_table): Likewise.
2432 (Dwarf_pubnames_table::read_section): Check for GNU-style
2433 sections, and for compressed debug sections.
2434 (Dwarf_pubnames_table::read_header): Compute end address of table.
2435 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2436 for end of list by offset, not by offset == 0.
2437 (Dwarf_info_reader::do_read_string_table): Check for compressed
2439 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2440 Initialize new data members.
2441 (Dwarf_pubnames_table::next_name): return flag_byte.
2442 (Dwarf_pubnames_table::end_of_table_): New data member.
2443 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2444 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2445 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2446 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2447 read skeleton type unit DIEs.
2448 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2449 (Gdb_index::do_write): Write flag_byte.
2450 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2451 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2452 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2453 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2455 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2457 * version.cc (print_version): Update copyright year to 2014.
2459 2013-12-19 Dimitry Andric <dimitry@andric.com>
2461 * stringpool.cc (Stringpool_template::reserve): Add
2462 HAVE_UNORDERED_MAP case.
2463 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2465 2013-12-18 Cary Coutant <ccoutant@google.com>
2467 * configure.ac: Check for <unordered_set> and <unordered_map>.
2468 * config.in: Regenerate.
2469 * configure: Regenerate.
2470 * system.h: Use <unordered_set> and <unordered_map> if available.
2472 2013-12-10 Roland McGrath <mcgrathr@google.com>
2474 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2475 with $(INSTALL_PROGRAM_ENV).
2476 * Makefile.in: Regenerate.
2478 2013-11-22 Cary Coutant <ccoutant@google.com>
2480 * configure.ac: Add check for which library is needed for
2482 * configure: Regenerate.
2484 2013-11-22 Cary Coutant <ccoutant@google.com>
2486 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2488 * testsuite/Makefile.in: Regenerate.
2490 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2492 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2493 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2494 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2495 (Target_x86_64<size>::Scan::local): Likewise.
2496 (Target_x86_64<size>::Scan::global): Likewise.
2497 (Target_x86_64<size>::Relocate::relocate): Likewise.
2498 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2500 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2503 * testsuite/Makefile.am (check_PROGRAMS): Add
2504 exception_x86_64_bnd_test.
2505 (exception_x86_64_bnd_test_SOURCES): New macro.
2506 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2507 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2508 (exception_x86_64_bnd_test_LDADD): Likewise.
2509 (exception_x86_64_bnd_1.o): New rule.
2510 (exception_x86_64_bnd_2.o): Likewise.
2511 * testsuite/Makefile.in: Regenerated.
2513 2013-11-15 Alan Modra <amodra@gmail.com>
2515 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2517 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2518 Only call ppc64_local_entry_offset for 64-bit. Restrict
2519 symval_for_branch lookup to ELFv1.
2520 (Stub_table::add_plt_call_entry): Use unsigned int off.
2521 (Output_data_glink::Address, invalid_address): New.
2522 (Output_data_glink::add_eh_frame): Move out of line. Add
2524 (Output_data_glink::add_global_entry, find_global_entry,
2525 global_entry_address): New functions.
2526 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2527 ge_size): New variables.
2528 (Output_data_glink::set_final_data_size): Add global entry
2530 (Output_data_glink::do_write): Write global entry stubs.
2531 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2532 parameter. Return true for ELFv2. Adjust callers.
2533 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2534 ELFv1. Similarly for ifunc and dynamic relocation processing
2535 specific to ELFv1. Recognize that symbols are defined on
2536 their plt entries for ELFv2.
2537 (Target_powerpc::symval_for_branch): Assert if called for
2539 (Target_powerpc::Relocate::relocate): Use global entry plt
2540 stub for symbol value if such exists on ELFv2.
2541 (Target_powerpc::Relocate::relocate): Don't call
2542 symval_for_branch when ELFv2. Do adjust for local entry
2544 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2546 (Target_powerpc::do_plt_address_for_global): Similarly.
2548 2013-11-14 Cary Coutant <ccoutant@google.com>
2550 Revert patch -- this did not fix the problem, and there is
2553 2013-11-14 Cary Coutant <ccoutant@google.com>
2556 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2557 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2558 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2559 updating fde_offsets_.
2560 (Eh_frame_hdr::lock_): New data member.
2562 2013-11-14 Cary Coutant <ccoutant@google.com>
2564 * dwp.cc (Dwo_file_entry): New type.
2565 (File_list): Use Dwo_file_entry.
2566 (Dwo_file::verify): New function.
2567 (Dwo_file::verify_dwo_list): New function.
2568 (Dwo_file::sized_verify_dwo_list): New function.
2569 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2571 (Dwp_options): New enum type.
2572 (dwp_options): Add --verify-only.
2575 * dwp.h (gold_info): Add declaration.
2577 2013-11-14 Cary Coutant <ccoutant@google.com>
2580 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2581 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2582 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2583 updating fde_offsets_.
2584 (Eh_frame_hdr::lock_): New data member.
2586 2013-11-06 Cary Coutant <ccoutant@google.com>
2589 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2590 before reloc sections.
2592 2013-11-04 Alan Modra <amodra@gmail.com>
2594 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2595 (Symbol::needs_dynamic_reloc): Test new flag.
2596 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2597 (Target_powerpc::Scan::get_reference_flags): Add target param.
2598 Return FUNC_DESC_ABI for 64-bit ELFv1.
2599 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2601 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2602 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2604 2013-10-31 Cary Coutant <ccoutant@google.com>
2606 Restore support for dwp v2 DWARF package file format.
2608 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2609 tu_length parameter. Adjust all callers.
2610 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2611 * dwp.cc: Include dwarf.h.
2612 (Section_bounds): New struct type.
2613 (Unit_set): New struct type.
2614 (Dwo_file::Dwo_file): Initialize new data member.
2615 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2616 Combine and rename to...
2617 (Dwo_file::read_unit_index): ...this.
2618 (Dwo_file::sized_read_compunit_index)
2619 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2620 (Dwo_file::sized_read_unit_index): ...this.
2621 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2622 parameters; add section_id parameter.
2623 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2624 (Dwo_file::add_unit_set): ...this.
2625 (Dwo_file::shndx_map_): Remove.
2626 (Dwo_file::sect_offsets_): New data member.
2627 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2628 (Dwp_output_file::add_section): Rename to...
2629 (Dwp_output_file::add_contribution): ...this.
2630 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2631 (Dwp_output_file::add_tu_set): Likewise.
2632 (Dwp_output_file::Contribution): New type.
2633 (Dwp_output_file::Section::contributions): New data member.
2634 (Dwp_output_file::Cu_or_tu_set): Remove.
2635 (Dwp_output_file::Section::Section): New ctor.
2636 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2637 (Dwp_output_file::Dwp_index::Section_table): New type.
2638 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2639 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2641 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2642 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2643 (Dwp_output_file::Dwp_index::section_table): New member function.
2644 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2645 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2646 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2647 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2648 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2649 (Dwp_output_file::Dwp_index::section_table_): New data member.
2650 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2651 (Dwp_output_file::add_output_section): New member function.
2652 (Dwp_output_file::write_new_section): New member function.
2653 (Dwp_output_file::write_contributions): New member function.
2654 (Dwp_output_file::section_id_map_): New data member.
2655 (class Dwo_id_info_reader): Remove.
2656 (class Unit_reader): New class.
2657 (get_dwarf_section_name): New function.
2658 (Dwo_file::read_executable): Adjust initializations of class data.
2659 (Dwo_file::read): Add support for v2 package file format.
2660 (Dwo_file::read_unit_index): Likewise.
2661 (Dwo_file::sized_read_unit_index): Likewise.
2662 (Dwo_file::copy_section): Likewise.
2663 (Dwo_file::add_unit_set): Likewise.
2664 (Dwp_output_file::add_output_section): Likewise.
2665 (Dwp_output_file::add_contribution): Likewise.
2666 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2668 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2670 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2672 (Dwp_output_file::initialize): Remove unused function.
2673 (Dwp_output_file::finalize): Add support for v2 package file format.
2674 (Dwp_output_file::write_index): Likewise.
2675 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2678 2013-10-31 Cary Coutant <ccoutant@google.com>
2680 * configure.ac: Fix check for -fmerge-constants.
2681 * configure.ac: Regenerate.
2683 2013-10-30 Roland McGrath <mcgrathr@google.com>
2685 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2686 Correct 9-byte nop sequence to match what the assembler generates.
2688 2013-10-30 Alan Modra <amodra@gmail.com>
2690 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2691 ppc64_local_entry_offset, ppc64_local_entry_offset,
2692 do_read_symbols): New functions.
2693 (Powerpc_relobj::e_flags_, st_other_): New vars.
2694 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2695 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2696 (Powerpc_relobj::e_flags_): New var.
2697 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2698 and adjust for ELFv2.
2699 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2700 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2701 (Powerpc_dynobj::do_find_special_sections): Likewise.
2702 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2703 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2704 to ELFv2 local entry.
2705 (Target_powerpc::do_relax): No thread safe barriers needed for
2707 (Output_data_plt_powerpc::initial_plt_entry_size_,
2708 plt_entry_size): Delete. Replace all uses with
2709 first_plt_entry_offset() and plt_entry_size().
2710 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2711 reserved_size parm. Update callers.
2712 (Output_data_plt_powerpc::entry_count): Update.
2713 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2714 and use Target_powerpc::first_plt_entry_offset().
2715 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2716 rename to plt_entry_size.
2717 (Output_data_plt_powerpc::add_ifunc_entry,
2718 add_local_ifunc_entry): Adjust reloc for ELFv2.
2719 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2720 (glink_eh_frame_fde_64v2): New.
2721 (Stub_table::plt_call_size): Support ELFv2 sizing.
2722 (Output_data_glink::add_eh_frame): Use the new FDE.
2723 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2724 (Stub_table::do_write): Write ELFv2 stubs and glink.
2725 (Target_powerpc::Relocate::relocate): Replaces nop after call
2726 with ld 2,24(1) and adjust local offset destination for ELFv2.
2728 2013-10-30 Alan Modra <amodra@gmail.com>
2730 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2731 (Target_powerpc::Scan::global, local): Likewise.
2732 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2733 on all ppc64 @h and @ha relocs.
2735 2013-10-14 Alan Modra <amodra@gmail.com>
2737 * output.h (Output_data_got::add_constant): Tidy.
2738 (Output_data_got::add_constant_pair): New function.
2739 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2740 methods used so as to first call reserve_ent().
2742 2013-10-11 Roland McGrath <mcgrathr@google.com>
2744 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2745 add_got_entry and add_got_entry_pair.
2747 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2748 (HAVE_PUBNAMES): Likewise.
2749 * configure: Regenerate.
2751 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2752 * testsuite/Makefile.in: Regenerate.
2754 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2755 Remove const from declaration.
2756 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2757 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2758 * output.h (Output_file_header): Remove const from member target_
2759 and corresponding constructor argument.
2760 * output.cc (Output_file_header::Output_file_header): Update prototype.
2761 (Output_file_header::do_sized_write): Use this->target_ in place
2762 of parameters()->target().
2764 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2766 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2767 * configure: Regenerate.
2768 * Makefile.in: Regenerate.
2769 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2770 * testsuite/merge_string_literals_2.c: Likewise.
2771 * testsuite/Makefile.am
2772 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2773 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2774 literal -fmerge-constants.
2775 * testsuite/Makefile.in: Regenerate.
2777 * i386.cc (Target_i386): Remove unused member dynbss_.
2778 * arm.cc (Target_arm): Likewise.
2779 * powerpc.cc (Target_powerpc): Likewise.
2780 * sparc.cc (Target_sparc): Likewise.
2781 * tilegx.cc (Target_tilegx): Likewise.
2782 * x86_64.cc (Target_x86_64): Likewise.
2783 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2784 type_signature_, type_offset_.
2785 * plugin.h (Plugin_hook): Remove unused member layout_.
2786 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2788 (Read_member): Remove unused members input_objects_, symtab_,
2790 (Check_library): Remove unused member symtab_.
2791 * archive.h (Lib_group): Remove unused member lib_.
2792 * archive.cc (Lib_group::Lib_group): Update initializer.
2793 * incremental.h (Incremental_binary): Remove unused member target_.
2794 (Incremental_script_entry): Removed unused member script_.
2795 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2796 * icf.h (Icf): Remove unused member num_tracked_relocs.
2798 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2799 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2801 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2803 * archive.h: Use struct rather than class for forward declaration
2804 of Read_symbols_data.
2806 2013-10-07 Cary Coutant <ccoutant@google.com>
2809 * testsuite/Makefile.am (icf_test): Fix dependencies.
2810 (icf_safe_test): Likewise.
2811 (icf_safe_so_test): Likewise.
2812 (large_symbol_alignment): Add empty _LDADD rule.
2813 * testsuite/Makefile.in: Regenerate.
2815 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2818 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2819 relocation for R_X86_64_32 on x32.
2821 2013-08-27 Roland McGrath <mcgrathr@google.com>
2823 * output.cc (Output_segment::set_section_addresses): Take new
2824 Target* argument. If target->isolate_execinstr() and the segment
2825 is executable and starts at a target->abi_pagesize() boundary,
2826 pad its end out to a target->abi_pagesize() boundary with code fill.
2827 * output.h (Output_segment::set_section_addresses): Update decl.
2828 * layout.h (Layout::check_output_data_for_reset_values): Take new
2829 argument RELAX_OUTPUTS.
2830 (Layout): New member relax_output_list_.
2831 (Layout::add_relax_output): New method.
2832 * layout.cc (Layout::Layout): Update constructor.
2833 (Layout::reset_relax_output): New method.
2834 (Layout::clean_up_after_relaxation): Call it.
2835 (Layout::prepare_for_relaxation): Update caller.
2836 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2837 Call reset_relax_output before re-processing segments for
2838 isolate_execinstr case.
2839 (Layout::write_data): Handle relax_output_list_.
2840 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2841 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2843 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2846 * object.h: Fix typos.
2848 2013-08-16 Roland McGrath <mcgrathr@google.com>
2850 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2851 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2853 2013-08-07 Cary Coutant <ccoutant@google.com>
2855 Revert support for v2 DWP files:
2857 2013-03-01 Cary Coutant <ccoutant@google.com>
2859 Add dwp support for v2 DWARF package file format.
2860 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2861 tu_length parameter. Adjust all callers.
2862 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2863 * dwp.cc: Include dwarf.h.
2864 (Section_bounds): New struct type.
2865 (Unit_set): New struct type.
2866 (Dwo_file::Dwo_file): Initialize new data member.
2867 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2868 Combine and rename to...
2869 (Dwo_file::read_unit_index): ...this.
2870 (Dwo_file::sized_read_compunit_index)
2871 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2872 (Dwo_file::sized_read_unit_index): ...this.
2873 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2874 parameters; add section_id parameter.
2875 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2876 (Dwo_file::add_unit_set): ...this.
2877 (Dwo_file::shndx_map_): Remove.
2878 (Dwo_file::sect_offsets_): New data member.
2879 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2880 (Dwp_output_file::add_section): Rename to...
2881 (Dwp_output_file::add_contribution): ...this.
2882 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2883 (Dwp_output_file::add_tu_set): Likewise.
2884 (Dwp_output_file::Contribution): New type.
2885 (Dwp_output_file::Section::contributions): New data member.
2886 (Dwp_output_file::Cu_or_tu_set): Remove.
2887 (Dwp_output_file::Section::Section): New ctor.
2888 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2889 (Dwp_output_file::Dwp_index::Section_table): New type.
2890 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2891 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2893 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2894 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2895 (Dwp_output_file::Dwp_index::section_table): New member function.
2896 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2897 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2898 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2899 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2900 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2901 (Dwp_output_file::Dwp_index::section_table_): New data member.
2902 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2903 (Dwp_output_file::add_output_section): New member function.
2904 (Dwp_output_file::write_new_section): New member function.
2905 (Dwp_output_file::write_contributions): New member function.
2906 (Dwp_output_file::section_id_map_): New data member.
2907 (class Dwo_id_info_reader): Remove.
2908 (class Unit_reader): New class.
2909 (get_dwarf_section_name): New function.
2910 (Dwo_file::read_executable): Adjust initializations of class data.
2911 (Dwo_file::read): Add support for v2 package file format.
2912 (Dwo_file::read_unit_index): Likewise.
2913 (Dwo_file::sized_read_unit_index): Likewise.
2914 (Dwo_file::copy_section): Likewise.
2915 (Dwo_file::add_unit_set): Likewise.
2916 (Dwp_output_file::add_output_section): Likewise.
2917 (Dwp_output_file::add_contribution): Likewise.
2918 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2920 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2922 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2924 (Dwp_output_file::initialize): Remove unused function.
2925 (Dwp_output_file::finalize): Add support for v2 package file format.
2926 (Dwp_output_file::write_index): Likewise.
2927 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2930 2013-07-31 Cary Coutant <ccoutant@google.com>
2932 * object.cc (Sized_relobj::do_output_section_address): New function.
2933 (Sized_relobj): Instantiate explicitly.
2934 * object.h (Object::output_section_address): New function.
2935 (Object::do_output_section_address): New function.
2936 (Sized_relobj::do_output_section_address): New function.
2937 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2939 2013-07-30 Cary Coutant <ccoutant@google.com>
2940 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2942 * parameters.cc (Parameters::entry): Return target-specific entry
2944 * target.h (Target::entry_symbol_name): New function.
2945 (Target_info::entry_symbol_name): New data member.
2947 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2948 * i386.cc (Target_i386::i386_info): Likewise.
2949 (Target_i386_nacl::i386_nacl_info): Likewise.
2950 * sparc.cc (Target_sparc::sparc_info): Likewise.
2951 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2952 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2953 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2954 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2956 2013-07-22 Sterling Augustine <saugustine@google.com>
2958 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2959 Convert parameter shndx to local variable. Add parameters symtab
2960 and symtab_size. Scan over section names. Find relocation
2961 section corresponding to current section. Create and initialize
2962 reloc_mapper_ and reloc_type_.
2963 (Dwarf_pubnames_table::read_header): Add assertion. Change
2964 unit_length to off_t. Initialize member unit_length_. Fill in field
2966 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2967 Initialize new fields unit_length_ and cu_offset_.
2968 (Dwarf_pubnames_table::read_section): Update prototype.
2969 (Dwarf_pubnames_table::cu_offset): New member function.
2970 (Dwarf_pubnames_table::subsection_size): Likewise.
2971 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2973 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2974 member functions public.
2975 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2976 Update comment. Rework logic. Move repeated parts to...
2977 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2978 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2979 pubtypes_table_, and stmt_list_offset.
2980 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2981 Gdb_index::find_pubtype_offset,
2982 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2983 (Gdb_index::pubnames_read): Update prototype and rework logic.
2984 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2986 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2987 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2988 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2989 Gdb_index::map_pubtable_to_dies):
2991 (Gdb_index::pubnames_read): Update declaration.
2992 (Gdb_index::Pubname_offset_map): New type.
2993 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2994 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2995 Gdb_index::stmt_list_offset): Declare.
2996 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2997 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2998 Gdb_index::pubtypes_offset_): Remove.
3000 2013-07-19 Roland McGrath <mcgrathr@google.com>
3002 * options.h (General_options): Add -Trodata-segment option.
3003 * parameters.cc (Parameters::check_rodata_segment): New function.
3004 (Parameters::set_target_once): Call it.
3005 * parameters.h (Parameters): Declare it (private member function).
3006 * layout.cc (load_seg_unusable_for_headers): New function, broken
3007 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3008 then validate rodata segment rather than text segment.
3009 (relaxation_loop_body): Call that.
3010 (is_text_segment): New function. Don't admit a non-executable
3011 segment if TARGET->isolate_execinstr().
3012 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3014 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
3017 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3018 * nacl.h (Sniff_file::View::View): Request aligned view.
3020 2013-07-11 Cary Coutant <ccoutant@google.com>
3022 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3023 correct BRLT entry size.
3025 2013-07-03 Alan Modra <amodra@gmail.com>
3027 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3030 2013-07-01 Cary Coutant <ccoutant@google.com>
3032 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3034 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3035 (Dwarf_ranges_table::lookup_reloc): New function.
3036 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3038 (Dwarf_ranges_table::lookup_reloc): New function.
3039 (Dwarf_ranges_table::reloc_type_): New data member.
3041 2013-06-27 Jing Yu <jingyu@google.com>
3044 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3046 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3047 (Target_powerpc::do_relax): Call the above.
3049 2013-06-27 Cary Coutant <ccoutant@google.com>
3051 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3052 on garbage collected .opd section.
3054 2013-06-27 Alan Modra <amodra@gmail.com>
3056 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3058 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3059 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3061 2013-06-14 Cary Coutant <ccoutant@google.com>
3063 * resolve.cc (Symbol::override_base): Don't override st_type
3064 from plugin placeholder symbols.
3065 (Symbol_table::resolve): Likewise.
3066 (Symbol_table::should_override): Don't complain about TLS mismatch
3067 if the TO symbol is a plugin placeholder.
3068 * testsuite/Makefile.am (plugin_test_tls): New test.
3069 * testsuite/Makefile.in: Regenerate.
3070 * testsuite/plugin_test_tls.sh: New test script.
3071 * testsuite/two_file_test_2_tls.cc: New test source.
3072 * testsuite/two_file_test_tls.cc: New test source.
3074 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3076 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3077 the maximum segment alignment is larger than the page size.
3078 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3079 correctly aligns the symbols with large alignemnt.
3080 * testsuite/Makefile.in: Regenerate.
3081 * testsuite/large_symbol_alignment.cc: New file.
3083 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3084 Sriraman Tallam <tmsriram@google.com>
3086 * options.h (sort_section): New option.
3087 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3088 Rename from Input_section_sort_section_name_special_ordering_compare.
3089 (Input_section_sort_section_name_compare): New struct.
3090 * output.cc (Output_section::Input_section_sort_section_name_compare::
3091 operator()): New function.
3092 (Output_section::sort_attached_input_sections): Use new sort function
3093 for .text if --sort-section=name is specified.
3094 * layout.cc (Layout::make_output_section):
3095 Add sorting by name when --sort-section=name is specified.
3096 * testsuite/Makefile.am (text_section_grouping): Test option
3097 --sort-section=name.
3098 * testsuite/Makefile.in: Regenerate.
3099 * testsuite/section_sorting_name.cc: New file.
3100 * testsuite/section_sorting_name.sh: New file.
3102 2013-05-21 Cary Coutant <ccoutant@google.com>
3104 * symtab.h (Symbol::is_cxx_vtable): New function.
3105 * target-reloc.h (relocate_section): Check for vtable symbol.
3106 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3107 * testsuite/Makefile.in: Regenerate.
3108 * testsuite/missing_key_func.cc: New test source.
3109 * testsuite/missing_key_func.sh: New test script.
3111 2013-05-21 Cary Coutant <ccoutant@google.com>
3113 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3114 type of enclosing symbol.
3115 (Relocate_info::location): Check symbol type when describing symbol.
3116 * object.h (Symbol_location_info): Remove unused line_number;
3117 add enclosing_symbol_type.
3118 * testsuite/debug_msg.sh: Adjust expected output.
3120 2013-05-13 Cary Coutant <ccoutant@google.com>
3122 * configure.ac: Export DEFAULT_TARGET.
3123 * configure: Regenerate.
3124 * Makefile.in: Regenerate.
3125 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3126 * testsuite/Makefile.in: Regenerate.
3127 * testsuite/debug_msg.sh: Delete duplicate tests.
3128 Don't check undef_int error message match for powerpc where the
3129 source file and line number aren't available.
3131 2013-05-10 Roland McGrath <mcgrathr@google.com>
3133 * options.h (General_options): Add --rosegment-gap option.
3134 * options.cc (finalize): --rosegment-gap implies --rosegment.
3135 * layout.cc (set_segment_offsets): Let user option override
3136 target->rosegment_gap().
3138 2013-05-10 Roland McGrath <mcgrathr@google.com>
3140 * options.h (General_options): Remove leading space from help
3141 messages for -nostdlib and --rosegment.
3143 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3146 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3148 2013-05-03 Alan Modra <amodra@gmail.com>
3150 * merge.cc (Output_merge_string::do_add_input_section): Correct
3151 scan for number of strings. Rename vars to avoid shadowing.
3152 Include missing terminator in input_size_.
3154 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3156 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3157 Restore empty string handling.
3159 2013-05-01 Cary Coutant <ccoutant@google.com>
3161 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3162 uninitialized warning.
3164 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3166 * output.cc (Output_section::add_merge_input_section): Allow
3167 to merge sections if the alignment is more than character size.
3168 * merge.h (Output_merge_string::Output_merge_string): Remove
3170 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3171 only not-null strings. Check the alignment of strings.
3173 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3174 alignment as the argument.
3175 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3176 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3177 Align non-zero length strings according to the addralign_.
3178 (Stringpool_template<Stringpool_char>::set_string_offsets):
3179 Updating offsets according to the given alignment.
3180 * testsuite/Makefile.am (text_section_grouping): Test if string
3181 literals are getting merged.
3182 * testsuite/Makefile.in: Regenerate.
3183 * testsuite/merge_string_literals_1.c: New file.
3184 * testsuite/merge_string_literals_2.c: Ditto.
3185 * testsuite/merge_string_literals.sh: Ditto.
3187 2013-04-26 Ian Lance Taylor <iant@google.com>
3189 * target-reloc.h (relocate_section): If the reloc offset is out of
3190 range, pass VIEW as NULL to relocate.relocate.
3191 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3192 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3193 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3194 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3195 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3196 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3198 2013-04-26 Geoff Pike <gpike@chromium.org>
3200 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3201 * layout.cc (Hash_task): New class.
3202 (Layout::queue_build_id_tasks): New function.
3203 (Layout::write_build_id): Handle single-thread portion of build ID
3204 computation. (In some cases, all of it is single-threaded.) Replace
3205 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3206 functionality in fewer lines of code.
3207 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3208 * options.h (General_options): make "--build-id" default to tree
3209 rather than sha1. Add two new options related to --build-id=tree:
3210 --build-id-chunk-size-for-treehash and
3211 --build-id-min-file-size-for-treehash.
3212 * Makefile.am: add testing of --build-id=tree and related new options
3213 (these tests will be invoked by "make check").
3214 * Makefile.in: Regenerate.
3216 2013-04-25 Alan Modra <amodra@gmail.com>
3218 * configure.tgt: Add powerpcle and powerpc64le.
3220 2013-04-22 Alan Modra <amodra@gmail.com>
3223 * layout.cc (Layout::segment_precedes): Allow more than one
3224 segment with the same type and flags.
3226 2013-04-15 Cary Coutant <ccoutant@google.com>
3228 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3229 allocate space in file for BSS sections.
3231 2013-04-15 Cary Coutant <ccoutant@google.com>
3233 * script-sections.cc (Orphan_output_section): Reset address
3234 to zero after each orphaned section for relocatable links.
3236 2013-04-15 Cary Coutant <ccoutant@google.com>
3238 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3239 section starting address for relocatable link.
3240 * testsuite/Makefile.am (script_test_11): New test.
3241 * testsuite/Makefile.in: Regenerate.
3242 * testsuite/script_test_11.c: New source file.
3243 * testsuite/script_test_11.t: New linker script.
3245 2013-04-13 Alan Modra <amodra@gmail.com>
3247 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3248 owner when sections are not adjacent and exceed group size.
3249 (Target_powerpc::group_sections): Handle corner case.
3250 (Target_powerpc::Branch_info::make_stub): Handle case where
3251 stub table doesn't exist due to branches in non-exec sections.
3252 (Target_powerpc::Relocate::relocate): Likewise.
3254 2013-04-11 Alan Modra <amodra@gmail.com>
3257 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3258 .branch_lt to match bfd ld. Adjust comments throughout file.
3260 2013-04-04 Ian Lance Taylor <iant@google.com>
3263 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3264 sections before checking whether they are included in the link.
3266 2013-03-29 Sriraman Tallam <tmsriram@google.com>
3268 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3269 object before calling the plugin claim_file handler. Pass the elf
3270 object of the archive to the plugin. Delete the elf object if the
3271 plugin claims the file.
3273 2013-03-21 Alan Modra <amodra@gmail.com>
3275 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3276 segment when omagic.
3278 2013-03-21 Alan Modra <amodra@gmail.com>
3280 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3282 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3283 uninitialized" warning.
3285 2013-03-20 Alan Modra <amodra@gmail.com>
3287 * symtab.h (Symbol::clear_version): New function.
3288 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3289 is_needed by weak references. Clear version for symbols defined
3290 in as-needed objects that are not needed.
3292 2013-03-15 Alan Modra <amodra@gmail.com>
3294 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3295 static and public. Add report_err param. Return false for data refs.
3296 (Target_powerpc::rela_dyn_section): New overloaded function.
3297 (Target_powerpc::plt_, iplt_): Elucidate.
3298 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3299 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3300 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3301 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3302 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3303 push_branch and make_plt_entry for ifunc syms when
3304 reloc_needs_plt_for_ifunc.
3305 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3306 for ifunc unless reloc_needs_plt_for_ifunc.
3308 2013-03-15 Alan Modra <amodra@gmail.com>
3310 * gc.h (gc_process_relocs): Don't look through function descriptors.
3311 * icf.cc (get_section_contents): Do so here instead.
3313 2013-03-13 Alan Modra <amodra@gmail.com>
3315 * powerpc.cc (is_branch_reloc): Forward declare.
3316 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3317 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3318 false for 64-bit, true for 32-bit non-branch relocs.
3319 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3320 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3322 (icf_safe_test): Generate linker map file as well as nm output.
3323 (icf_safe_so_test): Likewise.
3324 * testsuite/Makefile.in: Regenerate.
3325 * testsuite/icf_test.sh: Parse linker map file to determine
3327 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3328 * testsuite/icf_safe_so_test.sh: Likewise.
3329 (X86_32_or_ARM_specific_safe_fold): Merge into..
3330 (arch_specific_safe_fold): ..this.
3331 (X86_64_specific_safe_fold): Delete unused function.
3333 2013-03-12 Alan Modra <amodra@gmail.com>
3335 * gc.h (gc_process_relocs): Look through function descriptors
3336 to determine shndx, symvalue and addend used by ICF. Tidy
3337 variable duplication.
3339 2013-03-11 Alan Modra <amodra@gmail.com>
3341 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3342 * layout.cc (Layout_task_runner::run): ..to here.
3343 * symtab.h (struct Symbol_location): Extract from..
3344 (class Symbol_table): ..here.
3345 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3346 * target.h (class Target): Add function_location and
3347 do_function_location functions.
3348 (class Sized_target): Add do_function_location.
3349 * object.h (class Sized_relobj_file): Move find_shdr..
3350 (class Object): ..to here.
3351 * object.cc: Likewise. Update to suit. Instantiate.
3352 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3353 * powerpc.cc (class Powerpc_dynobj): New.
3354 (Target_powerpc::do_function_location): New function.
3355 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3356 (Powerpc_dynobj::do_read_symbols): New function.
3357 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3359 2013-03-08 Ian Lance Taylor <iant@google.com>
3361 * options.cc (General_options::string_to_object_format): Accept
3364 2013-03-08 Alan Modra <amodra@gmail.com>
3366 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3367 pointer to Post_fde.
3368 (struct Post_fde): Move definition to here..
3369 * ehframe.cc (struct Post_fde): ..from here.
3370 (Cie::write): Don't alloc Post_fde.
3371 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3373 2013-03-07 Alan Modra <amodra@gmail.com>
3375 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3376 relocation referencing .LC0.
3377 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3379 2013-03-07 Alan Modra <amodra@gmail.com>
3381 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3382 always_inline. Add assembly for powerpc to avoid GOT.
3384 2013-03-07 Alan Modra <amodra@gmail.com>
3386 * testsuite/script_test_10.sh: Don't test .bss section
3389 2013-03-06 Alan Modra <amodra@gmail.com>
3391 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3392 (Target_powerpc::symval_for_branch): Add symtab param. Update
3393 all callers. Handle folded sections.
3394 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3396 (Global_symbol_visitor_opd::operator()): Likewise.
3398 2013-03-04 Alan Modra <amodra@gmail.com>
3400 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3401 * testsuite/Makefile.in: Regenerate.
3403 2013-03-01 Cary Coutant <ccoutant@google.com>
3405 Add dwp support for v2 DWARF package file format.
3406 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3407 tu_length parameter. Adjust all callers.
3408 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3409 * dwp.cc: Include dwarf.h.
3410 (Section_bounds): New struct type.
3411 (Unit_set): New struct type.
3412 (Dwo_file::Dwo_file): Initialize new data member.
3413 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3414 Combine and rename to...
3415 (Dwo_file::read_unit_index): ...this.
3416 (Dwo_file::sized_read_compunit_index)
3417 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3418 (Dwo_file::sized_read_unit_index): ...this.
3419 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3420 parameters; add section_id parameter.
3421 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3422 (Dwo_file::add_unit_set): ...this.
3423 (Dwo_file::shndx_map_): Remove.
3424 (Dwo_file::sect_offsets_): New data member.
3425 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3426 (Dwp_output_file::add_section): Rename to...
3427 (Dwp_output_file::add_contribution): ...this.
3428 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3429 (Dwp_output_file::add_tu_set): Likewise.
3430 (Dwp_output_file::Contribution): New type.
3431 (Dwp_output_file::Section::contributions): New data member.
3432 (Dwp_output_file::Cu_or_tu_set): Remove.
3433 (Dwp_output_file::Section::Section): New ctor.
3434 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3435 (Dwp_output_file::Dwp_index::Section_table): New type.
3436 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3437 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3439 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3440 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3441 (Dwp_output_file::Dwp_index::section_table): New member function.
3442 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3443 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3444 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3445 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3446 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3447 (Dwp_output_file::Dwp_index::section_table_): New data member.
3448 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3449 (Dwp_output_file::add_output_section): New member function.
3450 (Dwp_output_file::write_new_section): New member function.
3451 (Dwp_output_file::write_contributions): New member function.
3452 (Dwp_output_file::section_id_map_): New data member.
3453 (class Dwo_id_info_reader): Remove.
3454 (class Unit_reader): New class.
3455 (get_dwarf_section_name): New function.
3456 (Dwo_file::read_executable): Adjust initializations of class data.
3457 (Dwo_file::read): Add support for v2 package file format.
3458 (Dwo_file::read_unit_index): Likewise.
3459 (Dwo_file::sized_read_unit_index): Likewise.
3460 (Dwo_file::copy_section): Likewise.
3461 (Dwo_file::add_unit_set): Likewise.
3462 (Dwp_output_file::add_output_section): Likewise.
3463 (Dwp_output_file::add_contribution): Likewise.
3464 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3466 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3468 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3470 (Dwp_output_file::initialize): Remove unused function.
3471 (Dwp_output_file::finalize): Add support for v2 package file format.
3472 (Dwp_output_file::write_index): Likewise.
3473 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3476 2013-03-01 Cary Coutant <ccoutant@google.com>
3478 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3479 function into class definition in header file.
3480 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3481 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3483 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3485 2013-02-28 Alan Modra <amodra@gmail.com>
3487 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3488 * target.cc (Target::do_plt_fde_location): New function.
3489 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3490 accessor function, and constructor param.
3491 (struct Post_fde, Post_fdes): Declare.
3492 (Cie::write): Add post_fdes param.
3493 * ehframe.cc (Fde::write): Use plt_fde_location.
3494 (struct Post_fde): Define.
3495 (Cie::write): Stash FDEs added post merge mapping.
3496 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3497 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3498 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3500 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3501 (Target_powerpc::has_glink): New function.
3502 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3503 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3504 glink_eh_frame_fde_32, default_fde): New data.
3505 (Stub_table::eh_frame_added_): New var.
3506 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3508 (Stub_table::add_eh_frame): New function.
3509 (Output_data_glink::add_eh_frame): New function.
3510 (Target_powerpc::make_glink_section): Call add_eh_frame.
3512 2013-02-15 Ian Lance Taylor <iant@google.com>
3514 * options.h (DEFINE_uint64_alias): Define.
3515 (class General_options): Add -Ttext-segment as an alias for
3518 2013-02-15 Alan Modra <amodra@gmail.com>
3520 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3521 (Stub_table::do_write): ..here, two places.
3522 (Stub_table::plt_call_size): Use it here too.
3524 2013-02-11 Ian Lance Taylor <iant@google.com>
3526 * descriptors.cc (Descriptors::close_all): New function.
3527 * descriptors.h (class Descriptors): Declare close_all.
3528 (close_all_descriptors): New inline function.
3529 * plugin.cc: Include "descriptors.h".
3530 (Plugin_manager::cleanup): Call close_all_descriptors.
3532 2013-02-06 Alan Modra <amodra@gmail.com>
3534 * README: Update coding style link.
3536 2013-01-28 Cary Coutant <ccoutant@google.com>
3538 * dwp.cc (File_list): New typedef.
3539 (Dwo_name_info_reader): New class.
3540 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3541 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3542 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3543 (Dwo_file::read_executable): New function.
3544 (Dwo_file::read): Move common setup code to ...
3545 (Dwo_file::make_object): ... here.
3546 (dwp_options): Add --exec/-e.
3550 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3552 * layout.cc (Layout::layout): Check for option text_reorder.
3553 (Layout::make_output_section): Ditto.
3554 * options.h (text_reorder): New option.
3555 * output.cc (Input_section_sort_compare): Remove special ordering
3558 Input_section_sort_section_name_special_ordering_compare::
3559 operator()): New function.
3560 (Output_section::sort_attached_input_sections): Use new sort function
3562 * output.h (Input_section_sort_section_name_special_ordering_compare):
3564 * testsuite/Makefile.am (text_section_grouping): Test option
3566 * testsuite/Makefile.in: Regenerate.
3567 * testsuite/text_section_grouping.sh: Check order of functions without
3568 default text reordering.
3570 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3572 * options.h (General_options): Change default to true for new_dtags.
3574 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3576 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3577 when enable_new_dtags is false. Only add DT_RUNPATH when
3578 enable_new_dtags is true.
3580 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3582 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3583 used in declaration and definition consistent.
3584 (Target_powerpc::symval_for_branch): Ditto.
3586 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3588 * testsuite/plugin_final_layout.cc: Fix comment.
3590 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3592 * layout.cc (Layout::layout): Do not do default sorting for
3593 text sections when section ordering is specified.
3594 (make_output_section): Ditto.
3595 * testsuite/plugin_final_layout.cc: Name the function sections
3596 to catch reordering issues.
3598 2013-01-15 Alan Modra <amodra@gmail.com>
3600 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3603 2013-01-15 Alan Modra <amodra@gmail.com>
3605 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3606 * testsuite/Makefile.in: Regenerate.
3608 2013-01-14 Alan Modra <amodra@gmail.com>
3610 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3611 * testsuite/Makefile.in: Regenerate.
3613 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3616 Fix mingw gold build with plugins enabled
3617 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3618 * configure.ac: Export DLOPEN_LIBS and add headers check.
3619 * plugin.cc: Handle non-dlfcn case.
3620 * Makefile.in: Regenerate.
3621 * config.in: Regenerate.
3622 * configure: Regenerate.
3623 * testsuite/Makefile.in: Regenerate.
3625 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3627 * output.h (sort_attached_input_sections): Change to be public.
3628 * script-sections.cc
3629 (Output_section_definition::set_section_addresses): Sort
3630 attached input sections according to section order before linker
3631 script assigns section addresses.
3632 (Orphan_output_section::set_section_addresses): Sort
3633 attached input sections according to section order before linker
3634 script assigns section addresses.
3635 * Makefile.am (final_layout.sh): Use a simple linker script to
3636 check if section ordering still works.
3637 * Makefile.in: Regenerate.
3639 2013-01-09 Ben Cheng <bccheng@google.com>
3641 * arm.cc (Target_arm::attributes_accept_div): New function.
3642 (Target_arm::attributes_forbid_div): New function.
3643 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3644 attribute using the same new functions as what bfd/elf32_arm.c
3647 2013-01-07 Cary Coutant <ccoutant@google.com>
3650 * output.cc (Output_section::add_input_section): For incremental
3651 updates, don't track input sections that are allocated from patch
3654 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3655 Ian Lance Taylor <iant@google.com>
3658 * configure.ac (--enable-ld): Removed.
3659 (install_as_default): Set to yes only for --enable-gold=default
3661 * configure: Regenerated.
3663 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3665 * options.h (General_options): Add -fuse-ld= for GCC linker
3666 option compatibility.
3668 2013-01-04 Cary Coutant <ccoutant@google.com>
3670 * configure.ac: Fix typo restoring CXXFLAGS.
3671 * configure: Regenerate.
3673 2013-01-04 Cary Coutant <ccoutant@google.com>
3675 * testsuite/Makefile.am (CXXLINK_S): New macro.
3676 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3677 * testsuite/Makefile.in: Regenerate.
3679 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3681 * version.cc (print_version): Update copyright year to 2013.
3683 2012-12-20 Ian Lance Taylor <iant@google.com>
3685 * layout.cc (Layout::special_ordering_of_input_section): New
3687 (Layout::layout): If input section requires special ordering, must
3688 sort input sections.
3689 (Layout::make_output_section): May sort .text input sections.
3690 (Layout::is_section_name_prefix_grouped): Remove.
3691 * layout.h (class Layout): Declare
3692 special_ordering_of_input_section. Don't declare
3693 is_section_name_prefix_grouped.
3694 * output.cc (Output_section::add_input_section): Revert last
3696 (Output_section::Input_section_sort::match_file_name): Don't crash
3697 if called on output section data.
3698 (Output_section::Input_section_sort_compare): Sort based on
3700 (Output_section::Input_section_sort_section_order_index_compare):
3702 (Output_section::sort_attached_input_sections): Likewise.
3704 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3706 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3707 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3708 * output.cc (Output_section::add_input_section): Check if section
3709 name contains special prefix. Keep input sections to sort such
3711 (Output_section::Input_section_sort_section_order_index_compare
3712 ::operator()): Group sections according to prefixes.
3713 (Output_section::sort_attached_input_sections): Add condition to
3714 Input_section_entry constructor call.
3715 * testsuite/Makefile.am (text_section_grouping): New test.
3716 * testsuite/Makefile.in: Regenerate.
3717 * testsuite/text_section_grouping.cc: New file.
3718 * testsuite/text_section_grouping.sh: New file.
3720 2012-12-17 Nick Clifton <nickc@redhat.com>
3722 * Makefile.am: Add copyright notice.
3725 * configure.ac: Likewise.
3726 * ftruncate.c: Likewise.
3727 * Makefile.in: Regenerate.
3729 2012-12-14 Cary Coutant <ccoutant@google.com>
3731 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3732 --no-as-needed flag.
3733 (exception_separate_shared_12_test): Likewise.
3734 (incremental_copy_test): Likewise.
3735 * testsuite/Makefile.in: Regenerate.
3737 2012-12-14 Cary Coutant <ccoutant@google.com>
3739 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3740 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3742 2012-12-12 Alan Modra <amodra@gmail.com>
3744 * powerpc.cc (class Track_tls): New.
3745 (class Relocate, class Scan): Inherit Track_tls.
3746 (Target_powerpc::Scan::local, global): Track tls optimization
3747 and avoid creating plt entry for __tls_get_addr if all uses
3749 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3751 2012-12-12 Alan Modra <amodra@gmail.com>
3753 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3754 Replace no_toc_optimize with toc_optimize.
3755 * output.h (Output_section::input_sections): Provide non-const variant.
3756 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3757 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3759 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3760 (class Sort_toc_sections): New.
3761 (Target_powerpc::do_finalize_sections): Sort toc sections.
3762 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3764 2012-12-10 Roland McGrath <mcgrathr@google.com>
3766 * testsuite/binary_unittest.cc (read_all): New function.
3767 (Sized_binary_test): Use it instead of ::read.
3768 * fileread.cc (do_read): Don't assume pread always reads the whole
3769 amount in a single call.
3771 2012-12-10 Alan Modra <amodra@gmail.com>
3773 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3774 Set EM_PPC64 or EM_PPC here.
3775 (Target_selector_powerpc::do_recognize): Delete.
3777 2012-12-10 Alan Modra <amodra@gmail.com>
3779 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3781 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3783 2012-12-07 Roland McGrath <mcgrathr@google.com>
3785 * testsuite/binary_unittest.cc (Sized_binary_test):
3786 Use open_descriptor rather than ::open.
3788 2012-12-07 Alan Modra <amodra@gmail.com>
3790 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3791 typedef and invalid_address constant.
3792 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3793 instantiate constants.
3795 2012-12-06 Roland McGrath <mcgrathr@google.com>
3797 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3798 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3799 * aclocal.m4: Regenerate.
3800 * configure: Regenerate.
3801 * Makefile.in: Regenerate.
3802 * testsuite/Makefile.in: Regenerate.
3804 2012-12-07 Alan Modra <amodra@gmail.com>
3806 * options.h (General_options): Add no_toc_optimize.
3807 * powerpc.cc (ok_lo_toc_insn): New function.
3808 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3810 2012-12-06 Alan Modra <amodra@gmail.com>
3812 * options.h (General_options): Add plt_align, plt_static_chain,
3813 plt_thread_safe. Update stub_group_size help text.
3814 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3815 for new plt_thread_safe_ var.
3816 (use_plt_offset): Correct comments.
3817 (Target_powerpc::do_relax): Look for thread creation symbols to
3818 determine default plt_thread_safe value. Clear plt call stubs
3819 as well as branch stubs each iteration.
3820 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3822 (l, hi, ha, write_insn): Move earlier.
3823 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3824 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3826 (Stub_table::update_size): Adjust.
3827 (Stub_table::prev_size, set_prev_size): Delete.
3828 (Stub_table::stub_align): Let --plt-align affect result.
3829 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3830 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3831 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3832 (Stub_table::do_write): Support more stub variants.
3834 2012-12-04 Alan Modra <amodra@gmail.com>
3836 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3837 (Target_powerpc::do_define_standard_symbols): New function.
3839 2012-12-03 Alan Modra <amodra@gmail.com>
3841 * output.h: Formatting, whitespace.
3843 2012-12-03 Alan Modra <amodra@gmail.com>
3845 * layout.h (Layout::get_executable_sections): Declare.
3846 * layout.cc (Layout::get_executable_sections): New function.
3847 * arm.cc (Target_arm::group_sections): Use it.
3848 (Arm_output_section::group_sections): Delete now redundant test.
3849 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3850 param to handle relative relocs.
3851 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3852 (Output_data_reloc::add_absolute): Adjust.
3853 (Output_data_reloc::add_relative): New function.
3854 (Output_data::reset_data_size): New function.
3855 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3856 (Output_section::set_addralign): New function.
3857 (Output_section::checkpoint_set_addralign): New function.
3858 (Output_section::clear_section_offsets_need_adjustment): New function.
3859 (Output_section::input_sections): Make public.
3860 * powerpc.cc (class Output_data_brlt_powerpc): New.
3861 (class Stub_table, class Stub_control): New.
3862 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3863 stub_table_, set_stub_table, stub_table): New vectors and accessor
3865 (Target_powerpc::do_may_relax, do_relax, push_branch,
3866 new_stub_table, stub_tables, brlt_section, group_sections,
3867 add_branch_lookup_table, find_branch_lookup_table,
3868 write_branch_lookup_table, make_brlt_section): New functions.
3869 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3870 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3871 branch_info_): New vars.
3872 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3873 make call stubs here.
3874 (Output_data_glink): Remove all call stub handling from this class.
3875 (Target_powerpc::Scan::local, global): Save interesting branch
3876 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3877 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3878 functions on final link.
3879 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3880 Handle long branch destinations too.
3881 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3882 do_plt_address_for_local): Adjust lookup of plt call stubs.
3884 2012-11-30 Alan Modra <amodra@gmail.com>
3886 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3887 relocs against protected symbols when building 32-bit shared libs.
3889 2012-11-30 Alan Modra <amodra@gmail.com>
3891 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3892 param. Call got_section() to make .got. Update all callers
3893 and their callers and so on.
3895 2012-11-30 Alan Modra <amodra@gmail.com>
3897 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3898 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3899 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3900 value if it already exists.
3902 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3905 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3907 2012-11-14 Roland McGrath <mcgrathr@google.com>
3909 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3910 than bfc instruction for data sandboxing.
3912 2012-11-08 Alan Modra <amodra@gmail.com>
3914 * po/POTFILES.in: Regenerate.
3916 2012-11-05 Alan Modra <amodra@gmail.com>
3918 * configure.ac: Apply 2012-09-10 change to config.in here.
3919 * configure: Regenerate.
3921 2012-11-05 Alan Modra <amodra@gmail.com>
3923 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3924 (struct Opd_ent): Use "Address" rather than "Offset".
3925 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3926 (Target_powerpc::got_section): Make public.
3927 (Target_powerpc::scan_relocs): Move code setting symbols..
3928 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3929 Create _SDA_BASE_ only when referenced.
3931 2012-11-02 Roland McGrath <mcgrathr@google.com>
3933 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3936 2012-11-01 Roland McGrath <mcgrathr@google.com>
3938 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3939 for offset_in_output_section parameter.
3940 (Sized_target::relocate_special_relocatable): Likewise.
3941 * arm.cc (Target_arm::relocate_relocs): Likewise.
3942 (Target_arm::relocate_special_relocatable): Likewise.
3943 * i386.cc (Target_i386::relocate_relocs): Likewise.
3944 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3945 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3946 * target-reloc.h (relocate_relocs): Likewise.
3947 * testsuite/testfile.cc (Target_test): Likewise.
3948 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3949 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3951 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3952 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3954 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3955 parameter, which is unused in the [!F_SETFD] case.
3957 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3958 SYMNDX to off_t before comparing it to this->data_size().
3959 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3960 * incremental.cc (Output_section_incremental_inputs::do_write):
3961 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3963 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3965 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3967 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3968 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3971 2012-10-29 Cary Coutant <ccoutant@google.com>
3973 * dwp.cc (usage): Add file and exit status parameters;
3974 add --help and --version options.
3975 (print_version): New function.
3976 (main): Add --help and --version options.
3978 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3980 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3981 final_layout_sequence.txt.
3982 * testsuite/Makefile.in: Regenerated.
3984 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3986 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3987 COMPILE generated by automake.
3989 (CXXCOMPILE1): Likewise.
3990 (CXXLINK1): Likewise.
3991 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3993 (CXXCOMPILE): Likewise.
3994 (CXXLINK): Likewise.
3995 * testsuite/Makefile.in: Regenerated.
3997 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3999 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4000 on bad fwrite return.
4002 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4004 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4007 2012-10-23 Cary Coutant <ccoutant@google.com>
4009 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4010 * testsuite/Makefile.in: Regenerate.
4011 * testsuite/dwp_test.h: New source file.
4012 * testsuite/dwp_test_1.cc: New source file.
4013 * testsuite/dwp_test_1.s: New source file.
4014 * testsuite/dwp_test_1.sh: New source file.
4015 * testsuite/dwp_test_1b.cc: New source file.
4016 * testsuite/dwp_test_1b.s: New source file.
4017 * testsuite/dwp_test_2.cc: New source file.
4018 * testsuite/dwp_test_2.s: New source file.
4019 * testsuite/dwp_test_2.sh: New source file.
4020 * testsuite/dwp_test_main.cc: New source file.
4021 * testsuite/dwp_test_main.s: New source file.
4023 2012-10-23 Cary Coutant <ccoutant@google.com>
4025 * dwp.h: New header file.
4026 * dwp.cc: New source file.
4027 * gold.h: Move shared declarations to system.h.
4028 * system.h: New header file.
4029 * Makefile.am: Add dwp.
4030 * Makefile.in: Regenerate.
4032 2012-10-23 Cary Coutant <ccoutant@google.com>
4034 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4035 Dwarf_info_reader::read_from_pointer.
4036 (Dwarf_pubnames_table::read_header): Likewise.
4037 (Dwarf_pubnames_table::next_name): Likewise.
4038 (Dwarf_die::read_attributes): Likewise.
4039 (Dwarf_die::skip_attributes): Likewise.
4040 (Dwarf_info_reader::read_from_pointer): New function template.
4041 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4042 (Dwarf_pubnames_table): Likewise.
4043 (Dwarf_info_reader::read_from_pointer): New function template.
4044 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4045 Dwarf_pubnames_table ctor.
4047 2012-10-23 Cary Coutant <ccoutant@google.com>
4049 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4051 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4053 (Dwarf_info_reader::set_abbrev_shndx): New method.
4054 (Dwarf_info_reader::abbrev_shndx_): New data member.
4056 2012-10-23 Cary Coutant <ccoutant@google.com>
4058 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4059 from object, not parameters.
4060 (Dwarf_info_reader::parse): Likewise.
4061 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4062 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4063 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4066 2012-10-23 Cary Coutant <ccoutant@google.com>
4068 * fileread.cc (Input_file::Input_file): New constructor.
4069 * fileread.h (class Input_file): Add new constructor.
4071 2012-10-18 Alan Modra <amodra@gmail.com>
4074 * object.cc (Relobj::is_section_name_included): Also match
4075 .sdata personality section.
4077 2012-10-18 Alan Modra <amodra@gmail.com>
4079 * target-reloc.h (class Default_comdat_behavior): New, package up..
4080 (get_comdat_behaviour): ..this.
4081 (relocate_section): Add Relocate_comdat_behavior template arg,
4082 adjust code to suit.
4083 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4084 (Target_arm::scan_reloc_section): Likewise.
4085 * i386.cc (Target_i386::relocate_section): Likewise.
4086 * sparc.cc (Target_sparc::relocate_section): Likewise.
4087 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4088 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4089 * powerpc.cc (class Relocate_comdat_behavior): New.
4090 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4091 gold::relocate_section with new template arg.
4093 2012-10-18 Alan Modra <amodra@gmail.com>
4095 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4096 dynamic relocs for GOT_TPREL got entries, without symbol if
4098 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4099 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4100 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4102 2012-10-17 Alan Modra <amodra@gmail.com>
4105 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4107 2012-10-16 Sriraman Tallam <tmsriram@google.com>
4109 * layout.cc (Layout::include_section): Keep sections marked
4110 SHF_EXCLUDE when doing relocatable links.
4112 2012-10-16 Alan Modra <amodra@gmail.com>
4114 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4115 (Target_powerpc::do_finalize_sections): Call it.
4116 (Output_data_save_res): New class and supporting functions.
4117 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4118 normal symbols defined in object files.
4120 2012-10-12 Alan Modra <amodra@gmail.com>
4122 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4123 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4124 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4125 section if scan_opd_relocs not yet called.
4126 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4128 2012-10-12 Alan Modra <amodra@gmail.com>
4130 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4131 add_local_ifunc_entry): Revert last change.
4132 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4134 2012-10-05 Alan Modra <amodra@gmail.com>
4136 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4137 do_plt_address_for_global): New functions.
4138 (Output_data_got_powerpc::do_write): Don't segfault when linking
4140 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4141 add_local_ifunc_entry): Return true on adding entry..
4142 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4143 glink->add_entry call. Remove unused symtab param. Adjust calls.
4144 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4145 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4146 set up symbols here.
4147 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4148 syms here. Do so even when no .iplt. Don't segfault when linking
4150 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4151 new variants without reloc param.
4152 (Glink_sym_ent::Glink_sym_ent): Likewise.
4153 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4154 reloc when refs will resolve to plt call stub.
4155 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4156 R_PPC_PLTREL24 to resolve locally.
4157 (Target_powerpc::Scan::global): Correct ifunc handling.
4158 (Target_powerpc::Relocate::relocate): Correct local sym glink
4159 lookup. Don't destroy "value" when we have a plt call stub,
4160 and when checking plt call validity.
4161 (Target_powerpc::do_dynsym_value): Simplify.
4163 2012-10-05 Alan Modra <amodra@gmail.com>
4165 * i386.cc (Output_data_plt_i386::address_for_global,
4166 address_for_local): Add plt offset to returned value. Adjust uses.
4167 * sparc.cc (Output_data_plt_sparc::address_for_global,
4168 address_for_local): Likewise.
4169 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4170 address_for_local): Likewise.
4171 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4172 address_for_local): Likewise.
4173 * target.h (Target::plt_address_for_global, plt_address_for_local):
4175 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4176 (Output_data_got::Got_entry::write): Nor here.
4177 * output.h: Comment fix.
4179 2012-10-02 Jiong Wang <jiwang@tilera.com>
4181 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4182 global_offset_table_ value for larget got.
4183 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4185 2012-09-29 Alan Modra <amodra@gmail.com>
4187 * powerpc.cc (Target_powerpc::iplt_): New output section.
4188 (Target_powerpc::iplt_section, make_iplt_section,
4189 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4190 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4191 Target_powerpc::plt_entry_count): Count iplt entries too.
4192 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4193 reloc section in constructor. New params.
4194 (Target_powerpc::make_plt_section): Create reloc section here instead.
4195 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4197 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4198 (Output_data_glink::add_entry, find_entry): New functions to
4199 deal with local syms.
4200 (Glink_sym_ent): Add support for local syms.
4201 (Output_data_glink::do_write): Handle ifunc plt entries.
4202 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4203 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4204 (Target_powerpc::Relocate::relocate): Likewise.
4205 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4207 2012-09-25 Alan Modra <amodra@gmail.com>
4209 * object.h (Sized_relobj_file::adjust_local_symbol,
4210 do_adjust_local_symbol): New functions.
4211 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4212 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4213 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4214 and irregular opd entry spacing.
4215 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4216 (Global_symbol_visitor_opd): New functor.
4217 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4218 on deleted opd entries.
4220 2012-09-15 Jiong Wang <jiwang@tilera.com>
4222 * tilegx.cc: New file.
4223 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4224 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4225 * configure.tgt: Add entries for tilegx*.
4226 * configure.ac: Likewise.
4227 * Makefile.in: Rebuild.
4228 * configure: Likewise.
4229 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4232 2012-09-13 Alan Modra <amodra@gmail.com>
4234 * target-reloc.h (scan_relocs): Call scan.local for relocs
4235 against symbols in discarded sections. Pass is_discarded
4237 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4238 Add is_discarded param.
4239 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4240 is_discarded to flag opd entry as discarded. Don't emit dyn
4241 relocs on such entries.
4242 (Target_powerpc::Scan::global): Similarly detect and handle
4244 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4245 opd_ent_. Update all uses.
4246 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4247 (Target_powerpc::relocate_section): Zero out discarded opd
4250 2012-09-12 Ian Lance Taylor <iant@google.com>
4253 * output.cc: Rename Output_data_got template parameter from size
4254 to got_size for all functions. Compile all variants of
4256 (Output_data_got::Got_entry::write): Correct use of size for
4257 symbol value. Use local_is_tls rather than casting to
4259 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4260 (class Sized_relobj_file): Add do_local_is_tls.
4261 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4263 2012-09-11 Alan Modra <amodra@gmail.com>
4266 * layout.cc (Layout::set_segment_offsets): When using
4267 common-page-size alignment, ensure we are on a new max-page-size
4269 * output.cc (Output_segment::set_section_addresses): Use
4270 abi_pagesize, not common_pagesize for relro boundary.
4271 (Output_segment::set_offset): Likewise.
4273 2012-09-11 Alan Modra <amodra@gmail.com>
4275 * output.h (Output_data_got::add_global_tls, add_local_tls,
4276 add_local_tls_pair): New functions.
4277 (Output_data_got::add_local_pair_with_rel): Remove second
4278 reloc param. Expand comment.
4279 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4280 use_plt_or_tls_offset_, similarly for constructor param.
4281 (Output_data_got::Got_entry::write): Add got_index param.
4282 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4283 add_local_tls_pair): New functions.
4284 (Output_data_got::Got_entry::write): Handle tls symbols
4285 with use_plt_or_tls_offset_ set specially.
4286 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4287 (Output_data_got::do_write): Replace iterator with index, pass
4288 index to entry write function.
4289 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4290 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4291 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4293 * i386.cc (Target_i386::Scan::local): Likewise.
4294 * sparc.cc (Target_sparc::Scan::local): Likewise.
4295 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4296 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4297 do_tls_offset_for_global): New functions.
4298 (Target_powerpc::Scan::local): Correct TLS relocations and got
4300 (Target_powerpc::Scan::global): Don't emit unnecessary
4301 dynamic relocations on TLS GOT entries.
4303 2012-09-10 Matthias Klose <doko@ubuntu.com>
4305 * config.in: Disable sanity check for kfreebsd.
4307 2012-09-10 Sterling Augustine <saugustine@google.com>
4309 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4310 (Gdb_index::pubtypes_read): New parameter.
4311 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4313 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4316 2012-09-09 Alan Modra <amodra@gmail.com>
4318 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4319 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4320 * gc.h (gc_process_relocs): Call target gc_add_reference.
4321 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4322 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4323 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4325 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4326 to cater for when we don't need code offset. Update use.
4327 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4328 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4329 set_opd_valid): New functions.
4330 (Target_powerpc::do_gc_add_reference): New function.
4331 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4333 (Target_powerpc::do_gc_mark_symbol): New function.
4335 2012-09-06 Cary Coutant <ccoutant@google.com>
4337 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4338 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4339 (Dwarf_die::skip_attributes): Likewise.
4340 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4341 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4343 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4345 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4347 * testsuite/script_test_3.t: Add .got.plt output section
4349 * testsuite/script_test_4.t: Likewise.
4351 2012-09-05 Alan Modra <amodra@gmail.com>
4353 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4354 update all uses and lose "enum" when using type.
4356 2012-09-05 Alan Modra <amodra@gmail.com>
4358 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4359 * configure: Regenerate.
4360 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4361 (plugin_final_layout.stdout): Likewise.
4362 (memory_test): Set page sizes to 0x1000.
4363 * testsuite/Makefile.in: Regenerate.
4364 * testsuite/discard_locals_test.sh: Add FIXME comment.
4365 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4366 * testsuite/pr14265.t: Add .got output section statement.
4367 * testsuite/script_test_2.t: Likewise.
4368 * testsuite/script_test_3.t: Likewise.
4369 * testsuite/script_test_4.t: Likewise.
4370 * testsuite/script_test_5.t: Likewise.
4371 * testsuite/script_test_6.t: Likewise.
4372 * testsuite/script_test_7.t: Likewise.
4373 * testsuite/script_test_9.t: Likewise.
4375 2012-09-05 Alan Modra <amodra@gmail.com>
4377 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4378 (Powerpc_relocate_functions::Status): New typedef.
4379 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4380 (Target_powerpc::Scan::local): Handle REL64.
4381 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4382 for REL32 and REL64.
4383 (Target_powerpc::symval_for_branch): New function, extracted from..
4384 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4385 checks. Report overflow errors.
4387 2012-09-05 Alan Modra <amodra@gmail.com>
4389 * object.h (Sized_relobj_file::emit_relocs): Delete.
4390 (Sized_relobj_file::emit_relocs_reltype): Delete.
4391 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4392 relocate_relocs for --emit-relocs.
4393 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4394 * output.h: Update comment.
4395 (Output_segment::first_section): New function.
4396 (Output_segment::first_section_load_address): Use first_section.
4397 * output.cc (Output_segment::first_section): New function extracted..
4398 (Output_segment::first_section_load_address): ..from here. Delete.
4399 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4400 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4401 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4402 adjust call to target.h function.
4403 * i386.cc (Target_i386): Likewise.
4404 * sparc.cc (Target_sparc): Likewise.
4405 * x86_64.cc (Target_x86_64): Likewise.
4406 * powerpc.cc (Target_powerpc): Likewise.
4407 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4408 first tls section has section symbol for optimised local dynamic
4410 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4411 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4413 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4414 Rename to relocate_relocs. Update error message.
4416 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4418 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4421 2012-08-31 Alan Modra <amodra@gmail.com>
4423 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4424 (Powerpc_relobj::toc_base_offset): New stub function.
4425 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4426 got_mod_index_offset to tlsld_got_offset. Update all refs.
4427 (Target_powerpc::Relocate::enum skip_tls): New.
4428 (Target_powerpc::call_tls_get_addr_): New var.
4429 (Target_powerpc::is_branch_reloc): Move to file scope.
4430 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4431 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4433 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4434 (powerpc_info): Correct common_pagesize for ppc64.
4435 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4436 (Powerpc_relocate_functions): Add overflow check enums and functions.
4437 Add non-shift version of rela, rela_ua. Delete all rel public
4438 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4439 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4440 addr16_ha3, addr14 functions.
4441 (Output_data_got_powerpc::add_constant_pair): New function.
4442 (Output_data_got_powerpc::got_base_offset): Likewise.
4443 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4444 (instruction constants): Sort, add some more.
4445 (Output_data_glink::do_write): Add and use Address typedef. Use
4446 object->toc_base_offset() stub for 64-bit.
4447 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4448 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4449 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4450 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4451 Always treat .opd relocs as against locally defined symbol.
4452 Correct condition for RELATIVE relocs.
4453 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4454 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4455 for 32-bit syms with a plt entry. Correct ppc64 toc base
4456 calculations. Handle TLS relocs, and more. Add overflow
4457 checking and adjust for Powerpc_relocate_functions changes.
4458 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4459 Reinstate --emit-relocs code with FIXME.
4461 2012-08-30 Alan Modra <amodra@gmail.com>
4463 * layout.cc (Layout::set_segment_offsets): Set p_align to
4464 abi_pagesize, not common_pagesize.
4465 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4466 to determine whether file header can go in segment.
4468 2012-08-30 Alan Modra <amodra@gmail.com>
4470 * output.h (Output_reloc::Output_reloc <output section>): Add
4471 is_relative param. Adjust calls.
4472 (Output_reloc::add_output_section_relative): New functions.
4473 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4475 (Output_reloc::symbol_value): Handle SECTION_CODE.
4477 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4479 * gold.cc (queue_middle_tasks): Call layout again when unique
4480 segments for sections is desired.
4481 * layout.cc (Layout::Layout): Initialize new members.
4482 (Layout::get_output_section_flags): New function.
4483 (Layout::choose_output_section): Call get_output_section_flags.
4484 (Layout::layout): Make output section for mapping to a unique segment.
4485 (Layout::insert_section_segment_map): New function.
4486 (Layout::attach_allocated_section_to_segment): Make unique segment for
4487 output sections marked so.
4488 (Layout::segment_precedes): Check for unique segments when sorting.
4489 * layout.h (Layout::Unique_segment_info): New struct.
4490 (Layout::Section_segment_map): New typedef.
4491 (Layout::insert_section_segment_map): New function.
4492 (Layout::get_output_section_flags): New function.
4493 (Layout::is_unique_segment_for_sections_specified): New function.
4494 (Layout::set_unique_segment_for_sections_specified): New function.
4495 (Layout::unique_segment_for_sections_specified_): New member.
4496 (Layout::section_segment_map_): New member.
4497 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4498 Rename is_gc_pass_one to is_pass_one.
4499 Rename is_gc_pass_two to is_pass_two.
4500 Rename is_gc_or_icf to is_two_pass.
4501 Check for which pass based on whether symbols data is present.
4502 Make it two pass when unique segments for sections is desired.
4503 * output.cc (Output_section::Output_section): Initialize new
4505 * output.h (Output_section::is_unique_segment): New function.
4506 (Output_section::set_is_unique_segment): New function.
4507 (Output_section::is_unique_segment_): New member.
4508 (Output_section::extra_segment_flags): New function.
4509 (Output_section::set_extra_segment_flags): New function.
4510 (Output_section::extra_segment_flags_): New member.
4511 (Output_section::segment_alignment): New function.
4512 (Output_section::set_segment_alignment): New function.
4513 (Output_section::segment_alignment_): New member.
4514 (Output_segment::Output_segment): Initialize is_unique_segment_.
4515 (Output_segment::is_unique_segment): New function.
4516 (Output_segment::set_is_unique_segment): New function.
4517 (Output_segment::is_unique_segment_): New member.
4518 * plugin.cc (allow_unique_segment_for_sections): New function.
4519 (unique_segment_for_sections): New function.
4520 (Plugin::load): Add new functions to transfer vector.
4521 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4522 * Makefile.in: Regenerate.
4523 * testsuite/plugin_final_layout.sh: Check if unique segment
4524 functionality works.
4525 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4527 (allow_unique_segment_for_sections): New global.
4528 (unique_segment_for_sections): New global.
4529 (claim_file_hook): Call allow_unique_segment_for_sections.
4530 (all_symbols_read_hook): Call unique_segment_for_sections.
4532 2012-08-22 Cary Coutant <ccoutant@google.com>
4534 * layout.cc (Layout::include_section): Don't assert on GROUP
4535 sections with --emit-relocs.
4537 2012-08-21 Cary Coutant <ccoutant@google.com>
4539 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4540 if --export-dynamic-symbol names an undef symbol.
4542 2012-08-18 Alan Modra <amodra@gmail.com>
4544 * powerpc.cc: Formatting and white space.
4545 (Powerpc_relobj): Rename got2_section_ to special_.
4546 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4547 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4548 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4549 (Target_powerpc): Add Address typedef and invalid_address. Use
4551 (Target_powerpc::is_branch_reloc): New function.
4552 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4553 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4554 for dst_mask, value and addend.
4555 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4556 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4557 (Output_data_glink::do_write): Correct toc base. Don't try to use
4558 uint16_t for 24-bit offset. Use get_output_section_offset and
4560 (Target_powerpc::Scan::local): Handle more relocs.
4561 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4562 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4563 Plug in toc restoring insn after plt calls. Translate branches
4564 to function descriptor symbols to corresponding entry point.
4565 (Target_powerpc::relocate_for_relocatable): Check return from
4566 get_output_section_offset.
4567 * symtab.h: Comment typo.
4569 2012-08-14 Ian Lance Taylor <iant@google.com>
4571 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4572 unsupported_relocal_local to call unsupported_reloc_global.
4574 2012-08-14 Nick Clifton <nickc@redhat.com>
4577 * script-sections.cc (Sections_element::output_section_name): Add
4578 keep return parameter.
4579 (Output_section_element::match_name): Add keep return parameter.
4580 Return the value of the keep_ member.
4581 * script-sections.h (class Output_section): Update
4582 output_section_name prototype.
4583 * layout.cc (Layout::keep_input_section): New public member
4585 (Layout::choose_output_section): Pass keep parameter to
4586 output_section_name.
4587 * layout.h (class Layout): Add keep_input_section.
4588 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4590 * testsuite/Makefile.am: Add a test.
4591 * testsuite/Makefile.in: Regenerate.
4592 * testsuite/pr14265.c: Source file for the test.
4593 * testsuite/pr14265.t: Linker script for the test.
4594 * testsuite/pr14265.sh: Shell script for the test.
4596 2012-08-14 Alan Modra <amodra@gmail.com>
4598 * target.h (Target::output_section_name): New function.
4599 (Target::do_output_section_name): New function.
4600 * layout.cc (Layout::choose_output_section): Call the above.
4601 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4603 2012-08-14 Alan Modra <amodra@gmail.com>
4605 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4606 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4607 for replace_constant call.
4608 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4609 (Output_data_glink::do_print_to_mapfile): New function.
4610 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4611 (Target_powerpc::Relocate::relocate): Likewise.
4613 2012-08-14 Alan Modra <amodra@gmail.com>
4615 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4616 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4617 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4618 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4619 all references to shndx_. Handle special case for R_PPC_PLTREL24
4621 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4622 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4623 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4625 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4626 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4628 2012-08-12 Alan Modra <amodra@gmail.com>
4630 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4631 (glink insn constants): Use uint32_t.
4632 (Output_data_glink::add_entry): Use insert, not [] operator.
4634 2012-08-11 Alan Modra <amodra@gmail.com>
4636 * object.h (Sized_relobj_file::find_shdr): New function.
4637 (Sized_relobj_file::find_special_sections): New function.
4638 * object.cc (Sized_relobj_file::find_shdr): New function.
4639 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4640 (Sized_relobj_file::find_special_sections): New function, split out..
4641 (Sized_relobj_file::do_read_symbols): ..from here.
4642 * output.h (Output_data_got::replace_constant): New function.
4643 (Output_data_got::num_entries): New function.
4644 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4645 (Output_data_got::got_offset): Protected rather than private.
4646 (Output_data_got::replace_got_entry): New function.
4647 * output.cc (Output_data_got::replace_got_entry): New function.
4648 * powerpc.cc (class Powerpc_relobj): New.
4649 (class Powerpc_relocate_functions): Delete all psymval variants or
4650 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4651 Implement _ha functions using corresponding _hi function.
4652 (Powerpc_relobj::find_special_sections): New function.
4653 (Target_powerpc::do_make_elf_object): New function.
4654 (class Output_data_got_powerpc): New.
4655 (class Output_data_glink): New.
4656 (class Powerpc_scan_relocatable_reloc): New.
4657 Many more changes througout file.
4659 2012-08-09 Nick Clifton <nickc@redhat.com>
4661 * po/vi.po: Updated Vietnamese translation.
4663 2012-08-07 Ian Lance Taylor <iant@google.com>
4665 * layout.cc (Layout::add_target_dynamic_tags): If
4666 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4669 2012-07-30 Nick Clifton <nickc@redhat.com>
4671 * po/gold.pot: Updated template.
4672 * po/es.po: Updated Spanish translation.
4674 2012-07-18 Cary Coutant <ccoutant@google.com>
4677 * configure.ac: Add check for -gpubnames support.
4678 * configure: Regenerate.
4679 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4680 support; force -gno-pubnames.
4681 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4683 (gdb_index_test_4): New test.
4684 * testsuite/Makefile.in: Regenerate.
4685 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4686 * testsuite/gdb_index_test_2.sh: Likewise.
4687 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4688 * testsuite/gdb_index_test_4.sh: New script.
4689 * testsuite/gdb_index_test_comm.sh: New script with common code;
4690 don't look for space after colon.
4692 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4694 * gold.cc (queue_middle_tasks): Update function order only after
4695 deferred objects due to plugins are processed.
4697 2012-07-11 Ian Lance Taylor <iant@google.com>
4699 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4700 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4701 (Target_arm::scan_reloc_for_stub): Likewise.
4702 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4703 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4704 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4705 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4706 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4708 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4709 Ian Lance Taylor <iant@google.com>
4712 * configure.ac: Test whether std::tr1::hash<off_t> works.
4713 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4715 * output.h (class Output_fill): Add virtual destructor.
4716 * configure, config.in: Rebuild.
4718 2012-06-22 Roland McGrath <mcgrathr@google.com>
4720 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4722 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4724 * plugin.cc (Plugin::load): Handle position independent executables.
4726 2012-06-06 Cary Coutant <ccoutant@google.com>
4728 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4730 (lines_only_debug_sections): Likewise.
4731 (gdb_fast_lookup_sections): New static array.
4732 (is_gdb_debug_section): Rename formal parameter.
4733 (is_lines_only_debug_section): Likewise.
4734 (is_gdb_fast_lookup_section): New function.
4735 (Layout::include_section): Check for ".zdebug_" prefix; pass
4736 section name suffix to is_gdb_debug_section, et al.; check for
4737 fast-lookup sections when building .gdb_index.
4738 * options.h (--strip-debug-gdb): Update GDB version number.
4740 2012-06-06 Cary Coutant <ccoutant@google.com>
4742 * configure.ac: Add check for fallocate.
4743 * configure: Regenerate.
4744 * config.in: Regenerate.
4746 * options.h (class General_options): Add --mmap-output-file and
4747 --posix-fallocate options.
4748 * output.cc: (posix_fallocate): Remove; replace with...
4749 (gold_fallocate): New function.
4750 (Output_file::map_no_anonymous): Call gold_fallocate.
4751 (Output_file::map): Check --mmap-output-file option.
4753 2012-06-05 Jing Yu <jingyu@google.com>
4755 * gold.h (textdomain): Add do {} to empty while(0).
4756 (bindtextdomain): Likewise.
4758 2012-06-04 Cary Coutant <ccoutant@google.com>
4760 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4763 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4765 * symtab.cc (Symbol_table::define_special_symbol):
4766 Initialize *poldsym to prevent uninitialized variable errors.
4768 2012-05-23 Cary Coutant <ccoutant@google.com>
4770 * layout.cc (Layout::section_name_mapping): Add rules to handle
4771 exact match on .data.rel.ro.local or .data.rel.ro.
4772 (Layout::output_section_name): Check for exact matches.
4774 2012-05-23 Cary Coutant <ccoutant@google.com>
4776 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4779 2012-05-22 Cary Coutant <ccoutant@google.com>
4781 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4782 object before exporting symbol.
4784 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4786 * testsuite/tls_test.cc: Include "config.h" first.
4787 * testsuite/tls_test_c.c: Likewise.
4789 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4790 Nick Clifton <nickc@redhat.com>
4793 * configure.in: Add check that sysdep.h has been included before
4794 any system header files.
4795 * configure: Regenerate.
4796 * config.in: Regenerate.
4798 2012-05-14 Cary Coutant <ccoutant@google.com>
4800 * layout.cc (Layout::make_output_section): Mark .tdata section
4802 * testsuite/relro_test.cc: Add a TLS variable.
4804 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4807 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4808 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4811 2012-05-08 Cary Coutant <ccoutant@google.com>
4813 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4814 (lines_only_debug_sections): Likewise.
4816 2012-05-02 Roland McGrath <mcgrathr@google.com>
4818 * nacl.cc: New file.
4820 * Makefile.am (CCFILES, HFILES): Add them.
4821 * Makefile.in: Regenerate.
4822 * i386.cc (Output_data_plt_i386_nacl): New class.
4823 (Output_data_plt_i386_nacl_exec): New class.
4824 (Output_data_plt_i386_nacl_dyn): New class.
4825 (Target_i386_nacl): New class.
4826 (Target_selector_i386_nacl): New class.
4827 (target_selector_i386): Use it instead of Target_selector_i386.
4828 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4829 (Target_x86_64_nacl): New class.
4830 (Target_selector_x86_64_nacl): New class.
4831 (target_selector_x86_64, target_selector_x32): Use it instead of
4832 Target_selector_x86_64.
4833 * arm.cc (Output_data_plt_arm_nacl): New class.
4834 (Target_arm_nacl): New class.
4835 (Target_selector_arm_nacl): New class.
4836 (target_selector_arm, target_selector_armbe): Use it instead of
4837 Target_selector_arm.
4839 * target-select.cc (select_target): Take new Input_file* and off_t
4840 arguments, pass them on to recognize method of selector.
4841 * object.cc (make_elf_sized_object): Update caller.
4842 * parameters.cc (parameters_force_valid_target): Likewise.
4843 * incremental.cc (make_sized_incremental_binary): Likewise.
4844 * target-select.h: Update decl.
4845 (Target_selector::recognize): Take new Input_file* argument,
4846 pass it on to do_recognize.
4847 (Target_selector::do_recognize): Take new Input_file* argument.
4848 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4849 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4850 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4851 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4853 * target.h (Target::Target_info): New members isolate_execinstr
4855 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4856 * arm.cc (Target_arm::arm_info): Update initializer.
4857 * i386.cc (Target_i386::i386_info): Likewise.
4858 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4859 * sparc.cc (Target_sparc::sparc_info): Likewise.
4860 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4861 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4862 * layout.cc (Layout::attach_allocated_section_to_segment):
4863 Take new const Target* argument. If target->isolate_execinstr(), act
4865 (Layout::find_first_load_seg): Take new const Target* argument;
4866 if target->isolate_execinstr(), reject PF_X segments.
4867 (Layout::relaxation_loop_body): Update caller.
4868 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4869 reset file offset to zero when we hit LOAD_SEG, and then do a second
4870 loop over the segments before LOAD_SEG to reassign offsets after
4871 addresses have been determined. Handle target->rosegment_gap().
4872 (Layout::attach_section_to_segment): Take new const Target* argument;
4873 pass it to attach_allocated_section_to_segment.
4874 (Layout::make_output_section): Update caller.
4875 (Layout::attach_sections_to_segments): Take new const Target* argument;
4876 pass it to attach_section_to_segment.
4877 * gold.cc (queue_middle_tasks): Update caller.
4878 * layout.h (Layout): Update method decls with new arguments.
4880 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4881 Target_info pointer to use.
4882 (Target_arm::do_make_data_plt): New virtual method.
4883 (Target_arm::make_data_plt): New method that calls it.
4884 (Target_arm::make_plt_entry): Use it.
4885 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4886 for the section alignment.
4887 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4889 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4890 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4892 (Output_data_plt_arm::get_plt_entry_size): Call it.
4893 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4894 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4895 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4897 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4898 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4899 method instead of sizeof(plt_entry).
4900 (Output_data_plt_arm::add_entry): Likewise.
4901 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4902 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4904 (Target_arm::plt_entry_size): Likewise.
4905 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4907 (Output_data_plt_arm_standard): ... here, new class.
4908 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4909 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4910 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4912 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4913 Take additional argument for the PLT entry size.
4914 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4915 Use get_plt_entry_size method rather than plt_entry_size variable.
4916 (Output_data_plt_x86_64::reserve_slot): Likewise.
4917 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4918 (Output_data_plt_x86_64::add_entry): Likewise.
4919 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4920 (Output_data_plt_x86_64::address_for_global): Likewise.
4921 (Output_data_plt_x86_64::address_for_local): Likewise.
4922 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4923 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4924 Make method non-static.
4925 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4927 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4928 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4929 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4930 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4932 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4933 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4935 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4936 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4938 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4939 (Output_data_plt_x86_64::plt_entry_size)
4940 (Output_data_plt_x86_64::first_plt_entry)
4941 (Output_data_plt_x86_64::plt_entry)
4942 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4943 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4944 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4945 (Output_data_plt_x86_64_standard): ... here, new class.
4946 (Target_x86_64::Target_x86_64): Take optional argument for the
4947 Target_info pointer to use.
4948 (Target_x86_64::do_make_data_plt): New virtual method.
4949 (Target_x86_64::make_data_plt): New method to call it.
4950 (Target_x86_64::init_got_plt_for_update): Use that.
4951 Call this->plt_->add_eh_frame method here.
4952 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4953 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4954 rather than static method.
4955 (Target_x86_64::plt_entry_size): Likewise.
4956 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4957 rather than plt_entry_size variable. Move guts of PLT filling to...
4958 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4959 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4960 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4962 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4963 additional argument for the section alignment.
4964 Don't do add_eh_frame_for_plt here.
4965 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4966 non-static. Use get_plt_entry_size method rather than plt_entry_size
4968 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4970 (Output_data_plt_i386::get_plt_entry_size): Call it.
4971 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4972 (Output_data_plt_i386::add_eh_frame): New method to call it.
4973 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4975 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4976 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4978 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4979 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4980 method instead of plt_entry_size.
4981 (Output_data_plt_i386::plt_entry_size)
4982 (Output_data_plt_i386::plt_eh_frame_fde_size)
4983 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4984 (Output_data_plt_i386_standard): ... here, new class.
4985 (Output_data_plt_i386_exec): New class.
4986 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4987 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4988 (Output_data_plt_i386::exec_plt_entry): Move to ...
4989 (Output_data_plt_i386_exec::plt_entry): ... here.
4990 (Output_data_plt_i386_dyn): New class.
4991 (Output_data_plt_i386::first_plt_entry): Move to ...
4992 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4993 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4994 (Output_data_plt_i386_dyn::plt_entry): ... here.
4995 (Target_i386::Target_i386): Take optional argument for the Target_info
4997 (Target_i386::do_make_data_plt): New virtual method.
4998 (Target_i386::make_data_plt): New method to call it.
4999 (Target_i386::make_plt_section): Use that.
5000 Call this->plt_->add_eh_frame method here.
5001 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5002 rather than plt_entry_size variable.
5003 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5004 (Output_data_plt_i386::address_for_local): Likewise.
5005 (Output_data_plt_i386::do_write): Likewise.
5006 Move guts of PLT filling to...
5007 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5008 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5009 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5010 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5012 2012-05-01 Cary Coutant <ccoutant@google.com>
5014 * dwarf_reader.cc (Dwarf_die::read_attributes)
5015 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5016 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5017 * reduced_debug_output.cc
5018 (Output_reduced_debug_info_section::get_die_end): Remove
5019 DW_FORM_GNU_ref_index. Add default case.
5021 2012-04-26 Mark Wielaard <mjw@redhat.com>
5023 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5024 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5025 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5026 DW_AT_high_pc as offset from DW_AT_low_pc.
5028 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5029 * testsuite/Makefile.in: Regenerate.
5030 * testsuite/gdb_index_test_3.c: New test source file.
5031 * testsuite/gdb_index_test_3.sh: New test source file.
5033 2012-04-25 Ian Lance Taylor <iant@google.com>
5035 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5037 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5038 as a class, not a struct.
5039 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5040 (Target_arm::apply_cortex_a8_workaround): Likewise.
5041 * gc.h: Declare Reloc_types as a struct, not a class.
5042 * object.h: Declare Symbols_data as a struct.
5043 * reloc.h: Declare Read_relocs_data as a struct.
5044 * target.h: Declare Relocate_info as a struct.
5046 2012-04-24 David S. Miller <davem@davemloft.net>
5048 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5049 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5052 2012-04-24 Cary Coutant <ccoutant@google.com>
5054 * incremental-dump.cc (find_input_containing_global): Replace
5055 magic number with symbolic constant.
5056 (dump_incremental_inputs): Update version number.
5057 * incremental.cc (Output_section_incremental_inputs): Update version
5058 number; import symbolic constants from Incremental_inputs_reader.
5059 (Incremental_inputs::create_data_sections): Align relocations
5060 section correctly for 64-bit targets.
5061 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5062 constants; add padding.
5063 (Output_section_incremental_inputs::write_header): Add assert for
5065 (Output_section_incremental_inputs::write_input_files): Add assert
5066 for input_entry_size.
5067 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5068 add assert for object_info_size, input_section_entry_size,
5069 global_sym_entry_size.
5070 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5071 for data structure sizes; use them.
5072 (Incremental_input_entry_reader): Import symbolic constants from
5073 Incremental_inputs_reader; use them.
5075 2012-04-23 David S. Miller <davem@davemloft.net>
5077 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5079 (Target_sparc::Target_sparc): Initialize new fields.
5080 (Target_sparc::do_make_elf_object): New function.
5081 (Target_sparc::do_adjust_elf_header): New function.
5083 2012-04-23 Cary Coutant <ccoutant@google.com>
5085 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5086 CU range table of gdb index.
5088 2012-04-20 David S. Miller <davem@davemloft.net>
5090 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5093 2012-04-16 David S. Miller <davem@davemloft.net>
5095 * sparc.cc (Target_sparc::got_address): New function.
5096 (Sparc_relocate_functions::gdop_hix22): New function.
5097 (Sparc_relocate_functions::gdop_lox10): New function.
5098 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5100 (Target_sparc::Scan::local): Likewise if the global symbol is not
5101 preemptible and is not IFUNC.
5102 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5103 transformations for local and non-preemptible non-IFUNC global
5106 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5107 writing out 64-bit part of ranges.
5109 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5110 -fpic and -fpie respectively.
5111 * Makefile.in: Regenerate.
5113 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5114 (Target_sparc::Target_sparc): Initialize new field.
5115 (Target_sparc::do_plt_section_for_global): New function.
5116 (Target_sparc::do_plt_section_for_local): New function.
5117 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5118 (Target_sparc::make_plt_section): New function, broken out of
5119 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5120 (Target_sparc::make_plt_entry): Call make_plt_section.
5121 (Target_sparc::make_local_ifunc_plt_entry): New function.
5122 (Target_sparc::rela_ifunc_section): New function.
5123 (Target_sparc::plt_section): Remove const.
5124 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5125 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5126 and ifunc_count_ fields.
5127 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5128 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5129 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5130 (Output_data_plt_sparc::rela_ifunc): New function.
5131 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5132 (Output_data_plt_sparc::has_ifunc_section): New function.
5133 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5134 (Output_data_plt_sparc::address_for_global): New function.
5135 (Output_data_plt_sparc::address_for_local): New function.
5136 (Output_data_plt_sparc::plt_index_to_offset): New function.
5137 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5139 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5141 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5142 R_SPARC_JMP_IREL to switch.
5143 (Target_sparc::Scan::check_non_pic): Likewise.
5144 (Target_sparc::Scan::local): Handle IFUNC symbols.
5145 (Target_sparc::Scan::local): Likewise.
5146 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5147 and plt_address_for_local.
5148 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5149 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5151 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5152 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5153 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5154 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5156 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5157 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5159 * sparc.cc (Target_sparc::Scan::global): Likewise.
5160 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5162 2012-04-16 Cary Coutant <ccoutant@google.com>
5164 * archive.cc (Library_base::should_include_member): Check for
5165 --export-dynamic-symbol.
5166 * options.h (class General_options): Add --export-dynamic-symbol.
5167 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5168 --export-dynamic-symbol.
5169 (Symbol_table::gc_mark_undef_symbols): Likewise.
5170 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5172 2012-04-12 David S. Miller <davem@davemloft.net>
5174 * sparc.cc (Reloc::wdisp10): New relocation method.
5175 (Reloc::h34): Likewise.
5176 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5177 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5179 (Target_sparc::Scan::local): Likewise.
5180 (Target_sparc::Scan::global): Likewise.
5181 (Target_sparc::Relocate::relocate): Likewise.
5183 2012-04-09 Cary Coutant <ccoutant@google.com>
5185 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5188 2012-04-06 Ian Lance Taylor <iant@google.com>
5190 * timer.cc: #include <unistd.h>.
5192 2012-04-06 Roland McGrath <mcgrathr@google.com>
5194 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5195 * config.in: Regenerate.
5196 * configure: Regenerate.
5198 2012-04-05 Nick Clifton <nickc@redhat.com>
5200 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5201 (AM_LC_MESSAGES): Add.
5202 * aclocal.m4: Regenerate.
5203 * config.in: Regenerate.
5204 * configure: Regenerate.
5206 2012-03-21 Cary Coutant <ccoutant@google.com>
5208 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5209 * Makefile.in: Regenerate.
5210 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5211 (Sized_elf_reloc_mapper::symbol_section): New function.
5212 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5213 (make_elf_reloc_mapper): New function.
5214 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5215 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5216 (Dwarf_abbrev_table::do_get_abbrev): New function.
5217 (Dwarf_ranges_table::read_ranges_table): New function.
5218 (Dwarf_ranges_table::read_range_list): New function.
5219 (Dwarf_pubnames_table::read_section): New function.
5220 (Dwarf_pubnames_table::read_header): New function.
5221 (Dwarf_pubnames_table::next_name): New function.
5222 (Dwarf_die::Dwarf_die): New function.
5223 (Dwarf_die::read_attributes): New function.
5224 (Dwarf_die::skip_attributes): New function.
5225 (Dwarf_die::set_name): New function.
5226 (Dwarf_die::set_linkage_name): New function.
5227 (Dwarf_die::attribute): New function.
5228 (Dwarf_die::string_attribute): New function.
5229 (Dwarf_die::int_attribute): New function.
5230 (Dwarf_die::uint_attribute): New function.
5231 (Dwarf_die::ref_attribute): New function.
5232 (Dwarf_die::child_offset): New function.
5233 (Dwarf_die::sibling_offset): New function.
5234 (Dwarf_info_reader::check_buffer): New function.
5235 (Dwarf_info_reader::parse): New function.
5236 (Dwarf_info_reader::do_parse): New function.
5237 (Dwarf_info_reader::do_read_string_table): New function.
5238 (Dwarf_info_reader::lookup_reloc): New function.
5239 (Dwarf_info_reader::get_string): New function.
5240 (Dwarf_info_reader::visit_compilation_unit): New function.
5241 (Dwarf_info_reader::visit_type_unit): New function.
5242 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5243 Sized_elf_reloc_mapper.
5244 (Sized_dwarf_line_info::symbol_section): Remove function.
5245 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5246 (Sized_dwarf_line_info::read_line_mappings): Remove object
5247 parameter, adjust callers.
5248 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5249 * dwarf_reader.h: Include <sys/types.h>.
5250 (class Track_relocs): Remove forward declaration.
5251 (class Elf_reloc_mapper): New class.
5252 (class Sized_elf_reloc_mapper): New class.
5253 (class Dwarf_abbrev_table): New class.
5254 (class Dwarf_range_list): New class.
5255 (class Dwarf_ranges_table): New class.
5256 (class Dwarf_pubnames_table): New class.
5257 (class Dwarf_die): New class.
5258 (class Dwarf_info_reader): New class.
5259 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5260 (Sized_dwarf_line_info::symbol_section): Remove member function.
5261 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5263 * gdb-index.cc: New source file.
5264 * gdb-index.h: New source file.
5265 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5266 and .debug_types sections, call Layout::add_to_gdb_index.
5267 (Sized_relobj_incr::do_section_name): Implement.
5268 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5269 return type; Implement.
5270 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5272 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5273 parameter list and return type.
5274 (Sized_incr_dynobj::do_section_contents): Likewise.
5275 * layout.cc: Include gdb-index.h.
5276 (Layout::Layout): Initialize gdb_index_data_.
5277 (Layout::init_fixed_output_section): Check for .gdb_index section.
5278 (Layout::add_to_gdb_index): New function. Instantiate.
5279 * layout.h: Add forward declaration for class Gdb_index.
5280 (Layout::add_to_gdb_index): New member function.
5281 (Layout::gdb_index_data_): New data member.
5282 * main.cc: Include gdb-index.h.
5283 (main): Print statistics for gdb index.
5284 * object.cc (Object::section_contents): Move code into
5285 do_section_contents.
5286 (need_decompressed_section): Check for sections needed when building
5288 (build_compressed_section_map): Likewise.
5289 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5291 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5292 sections; call Layout::add_to_gdb_index.
5293 (Sized_relobj_file::do_decompressed_section_contents): Call
5294 do_section_contents directly.
5295 * object.h (Object::do_section_contents): Adjust parameter list and
5297 (Object::do_decompressed_section_contents): Call do_section_contents
5299 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5301 * options.h (class General_options): Add --gdb-index option.
5302 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5303 list and return type.
5304 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5305 * reloc.h (Track_relocs::checkpoint): New function.
5306 (Track_relocs::reset): New function.
5308 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5310 * testsuite/Makefile.in: Regenerate.
5311 * testsuite/gdb_index_test.cc: New test source file.
5312 * testsuite/gdb_index_test_1.sh: New test source file.
5313 * testsuite/gdb_index_test_2.sh: New test source file.
5315 2012-03-19 Doug Kwan <dougkwan@google.com>
5317 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5318 (Target_arm::do_finalize_sections): Remove code which defines
5319 __exidx_start and __exidx_end. Make symbol table parameter
5320 anonymous as it is not used.
5321 * gold.cc (queue_middle_tasks): Call target hook to define any
5322 target-specific symbols.
5323 * target.h (Target::define_standard_symbols): New method.
5324 (Target::do_define_standard_symbols): Same.
5325 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5326 * testsuite/Makefile.in: Regenerate.
5327 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5329 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5330 relocations are generated for __exidx_start and __exidx_end.
5332 2012-03-16 Doug Kwan <dougkwan@google.com>
5334 * testsuite/Makefile.am: Disable test initpri3b.
5335 * testsuite/Makefile.in: Regenerate.
5337 2012-03-15 Doug Kwan <dougkwan@google.com>
5339 * arm.cc (Target_arm::got_section): Make .got section read-only
5342 2012-03-15 Ian Lance Taylor <iant@google.com>
5345 * layout.cc (Layout::make_output_section): Correctly mark
5346 SHT_INIT_ARRAY, et. al., as relro.
5348 2012-03-14 Doug Kwan <dougkwan@google.com>
5350 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5351 dynamic relocations for protected symbols in shared objects.
5353 2012-03-13 Ian Lance Taylor <iant@google.com>
5355 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5356 keep the larger alignment.
5358 2012-03-12 Cary Coutant <ccoutant@google.com>
5360 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5361 handling of DW_LNE_define_file.
5363 2012-03-12 Cary Coutant <ccoutant@google.com>
5365 * reduced_debug_output.cc
5366 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5369 2012-02-29 Cary Coutant <ccoutant@google.com>
5371 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5373 2012-02-29 Cary Coutant <ccoutant@google.com>
5375 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5376 Call Object::decompressed_section_contents.
5377 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5379 (Sized_dwarf_line_info::buffer_start_): New data member.
5380 * merge.cc (Output_merge_data::do_add_input_section): Call
5381 Object::decompressed_section_contents.
5382 (Output_merge_string::do_add_input_section): Likewise.
5383 * object.cc (need_decompressed_section): New function.
5384 (build_compressed_section_map): Decompress sections needed later.
5385 (Sized_relobj_file::do_decompressed_section_contents): New function.
5386 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5387 * object.h (Object::decompressed_section_contents): New function.
5388 (Object::discard_decompressed_sections): New function.
5389 (Object::do_decompressed_section_contents): New function.
5390 (Object::do_discard_decompressed_sections): New function.
5391 (Compressed_section_info): New type.
5392 (Compressed_section_map): Include decompressed section contents.
5393 (Sized_relobj_file::do_decompressed_section_contents): New function.
5394 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5396 2012-02-16 Cary Coutant <ccoutant@google.com>
5398 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5399 * testsuite/Makefile.in: Regenerate.
5401 2012-02-14 Cary Coutant <ccoutant@google.com>
5403 * options.cc (General_options::finalize): Disallow -pie and -static.
5405 2012-02-03 Doug Kwan <dougkwan@google.com>
5407 * arm.cc (Arm_relocate_functions::abs8,
5408 Arm_relocate_functions::abs16): Use
5409 Bits::has_signed_unsigned_overflow32.
5410 (Arm_relocate_functions::thm_abs8): Correct range of
5412 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5415 2012-02-02 Doug Kwan <dougkwan@google.com>
5417 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5418 position independent outputs, not just shared objects.
5420 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5422 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5423 * configure: Regenerated.
5425 2012-01-27 Ian Lance Taylor <iant@google.com>
5427 * reloc.h (Bits): New class with static functions, copied from
5428 namespace utils in arm.cc.
5429 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5432 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5434 * incremental.cc (write_info_blocks): Correct relocation offset.
5436 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5438 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5439 (Relocate::tls_gd_to_le): Likewise.
5441 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5443 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5445 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5447 * configure.ac: Check if -mcmodel=medium works.
5448 * configure: Regenerated.
5450 2012-01-24 Cary Coutant <ccoutant@google.com>
5452 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5454 (read_unsigned_LEB_128_x): ... this new function.
5455 (read_signed_LEB_128): Replaced with inline definition and ...
5456 (read_signed_LEB_128_x): ... this new function.
5457 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5458 (read_unsigned_LEB_128): Add inline definition.
5459 (read_signed_LEB_128_x): New function.
5460 (read_signed_LEB_128): Add inline definition.
5461 * testsuite/Makefile.am (leb128_unittest): New unit test.
5462 * testsuite/Makefile.in: Regenerate.
5463 * testsuite/leb128_unittest.cc: New unit test.
5465 2012-01-23 Ian Lance Taylor <iant@google.com>
5468 * i386.cc (Target_i386::do_code_fill): When using a jmp
5469 instruction, pad with nop instructions.
5470 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5472 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5474 * x86_64.cc (gc_process_relocs): Add typename on types used in
5476 (scan_relocs): Likewise.
5477 (relocate_section): Likewise.
5478 (apply_relocation): Likewise.
5480 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5482 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5483 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5486 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5488 * x86_64.cc: Initial support for x32.
5490 2012-01-03 Cary Coutant <ccoutant@google.com>
5492 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5493 Use abstract base class for GOT.
5494 * gold/output.h (class Output_data_got_base): New abstract base class.
5495 (class Output_data_got): Derive from new base class, adjust ctors.
5496 (Output_data_got::reserve_slot): Make virtual; rename to
5497 do_reserve_slot; Adjust callers.
5498 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5499 pointer to abstract base class.
5500 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5502 2011-12-18 Ian Lance Taylor <iant@google.com>
5504 * object.h (Relobj::local_symbol_value): New function.
5505 (Relobj::local_plt_offset): New function.
5506 (Relobj::local_has_got_offset): New function.
5507 (Relobj::local_got_offset): New function.
5508 (Relobj::set_local_got_offset): New function.
5509 (Relobj::do_local_symbol_value): New pure virtual function.
5510 (Relobj::do_local_plt_offset): Likewise.
5511 (Relobj::do_local_has_got_offset): Likewise.
5512 (Relobj::do_local_got_offset): Likewise.
5513 (Relobj::do_set_local_got_offset): Likewise.
5514 (Sized_relobj::do_local_has_got_offset): Rename from
5515 local_has_got_offset.
5516 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5517 (Sized_relobj::do_set_local_got_offset): Rename from
5518 set_local_got_offset.
5519 (Sized_relobj_file::do_local_plt_offset): Rename from
5521 (Sized_relobj_file::do_local_symbol_value): New function.
5522 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5524 * output.cc (Output_data_got::Got_entry::write): Change object to
5525 Relobj. Use local_symbol_value.
5526 (Output_data_got::add_global_with_rel): Change rel_dyn to
5527 Output_data_reloc_generic*. Use add_global_generic.
5528 (Output_data_got::add_global_with_rela): Remove. Change all
5529 callers to use add_global_with_rel.
5530 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5531 Output_data_reloc_generic*. Use add_global_generic.
5532 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5533 callers to use add_global_pair_with_rel.
5534 (Output_data_got::add_local): Change object to Relobj*.
5535 (Output_data_got::add_local_plt): Likewise.
5536 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5537 change rel_dyn to Output_data_reloc_generic*. Use
5539 (Output_data_got::add_local_with_rela): Remove. Change all
5540 callers to use all_local_with_rel.
5541 (Output_data_got::add_local_pair_with_rel): Change object to
5542 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5543 add_output_section_generic.
5544 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5545 callers to use add_local_pair_with_rel.
5546 (Output_data_got::reserve_local): Change object to Relobj*.
5547 * output.h: (class Output_data_reloc_generic): Add pure virtual
5548 declarations for add_global_generic, add_local_generic,
5549 add_output_section_generic.
5550 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5551 functions for Output_data_reloc_generic. Update declarations for
5552 changes listed in output.cc.
5553 (class Output_data_got): Change template parameter to got_size.
5554 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5555 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5557 (Sized_relobj_incr::do_local_plt_offset): New function.
5558 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5561 2011-12-17 Cary Coutant <ccoutant@google.com>
5563 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5564 * resolve.cc (Symbol_table::resolve): Likewise.
5565 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5567 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5569 2011-12-16 Ian Lance Taylor <iant@google.com>
5571 * output.h (Output_data_reloc_generic::add): Only call
5572 add_dynamic_reloc if this is a dynamic reloc section.
5574 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5577 * target-reloc.h (apply_relocation): Replace <64, false> with
5580 2011-11-25 Nick Clifton <nickc@redhat.com>
5582 * po/it.po: New Italian translation.
5584 2011-11-17 Sterling Augustine <saugustine@google.com>
5586 * script.cc (script_include_directive): Implement.
5587 (read_script_file): New local variables name and search_path. Update
5588 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5589 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5590 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5592 2011-11-11 Sterling Augustine <saugustine@google.com>
5594 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5595 (file_or_sections_cmd): Likewise.
5597 2011-11-11 Doug Kwan <dougkwan@google.com>
5599 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5600 if --just-symbols is given.
5602 2011-11-10 Doug Kwan <dougkwan@google.com>
5605 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5606 when processing data relocs.
5607 * reloc.h (Relocate_functions::rel_unaligned): New method.
5608 (Relocate_functions::pcrel_unaligned): Ditto.
5609 (Relocate_functions::rel32_unaligned): Ditto.
5610 (Relocate_functions::pcrel32_unaligned): Ditto.
5612 2011-11-09 Doug Kwan <dougkwan@google.com>
5615 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5616 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5617 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5618 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5619 (Relocate_functions::rel_unaligned): New.
5620 (Relocate_functions::rel32_unaligned): New.
5621 * target-reloc.h (relocate_for_relocatable): Add code to handle
5622 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5623 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5624 arm_unaligned_reloc_r): New targets.
5625 * testsuite/Makefile.in: Regenerate.
5626 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5629 2011-11-02 Ian Lance Taylor <iant@google.com>
5631 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5633 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5634 * options.cc (General_options::finalize): Use library search path
5635 from configure script if specified. If not native and no sysroot,
5636 only search TOOLLIBDIR.
5637 * options.h (Search_directory::Search_directory): Change name to
5639 (General_options::add_to_library_path_with_sysroot): Change arg to
5641 * configure, Makefile.in, config.in: Rebuild.
5643 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5645 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5646 we are working around the ARM1176 Erratum.
5647 * options.h (General_options::fix_arm1176): Add option.
5648 * testsuite/Makefile.am: Add testcases, and keep current ones
5650 * testsuite/Makefile.in: Regenerate.
5651 * testsuite/arm_fix_1176.s: New file.
5652 * testsuite/arm_fix_1176.sh: Likewise.
5654 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5656 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5658 (Target_arm::may_use_blx): Remove method.
5659 (Target_arm::set_may_use_blx): Likewise.
5660 (Target_arm::may_use_v4t_interworking): New method.
5661 (Target_arm::may_use_v5t_interworking): Likewise.
5662 (Target_arm::may_use_blx_): Remove member variable.
5663 (Arm_relocate_functions::arm_branch_common): Check for v5T
5665 (Arm_relocate_functions::thumb_branch_common): Likewise.
5666 (Reloc_stub::stub_type_for_reloc): Likewise.
5667 (Target_arm::do_finalize_sections): Correct interworking checks.
5668 * testsuite/Makefile.am: Add new tests.
5669 * testsuite/Makefile.in: Regenerate.
5670 * testsuite/arm_farcall_arm_arm.s: New test.
5671 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5672 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5673 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5674 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5675 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5676 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5677 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5679 2011-10-31 Cary Coutant <ccoutant@google.com>
5682 * expression.cc (Expression::eval_with_dot): Add
5683 is_section_dot_assignment parameter.
5684 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5685 absolute and assigning to dot within a section.
5686 * script-sections.cc
5687 (Output_section_element_assignment::set_section_addresses): Pass
5688 dot_section to set_if_absolute.
5689 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5690 as is_section_dot_assignment flag to eval_with_dot.
5691 (Output_section_element_dot_assignment::set_section_addresses):
5693 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5694 parameter. Also set value if relative to dot_section; set the
5695 symbol's output_section.
5696 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5697 parameter. Adjust all callers.
5698 (Expression::eval_maybe_dot): Likewise.
5699 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5701 * testsuite/script_test_2.t: Test assignment of an absolute value
5702 to dot within an output section element.
5704 2011-10-31 Cary Coutant <ccoutant@google.com>
5706 * options.h (class General_options): Add --[no-]gnu-unique options.
5707 * symtab.cc (Symbol_table::sized_write_globals): Convert
5708 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5710 2011-10-31 Cary Coutant <ccoutant@google.com>
5713 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5714 unnecessary assertion.
5715 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5717 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5719 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5721 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5723 Change to just keep the section associated with symbol.
5724 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5725 they are externally visible and --export-dynamic is turned on.
5726 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5728 2011-10-19 Ian Lance Taylor <iant@google.com>
5731 * script-sections.cc
5732 (Output_section_element_dot_assignment::needs_output_section): New
5735 2011-10-19 Ian Lance Taylor <iant@google.com>
5738 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5739 --section-start option was seen.
5740 * options.h (General_options::any_section_start): New function.
5742 2011-10-18 David S. Miller <davem@davemloft.net>
5745 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5746 member to track relocation locations that have moved during TLS
5747 reloc optimizations.
5748 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5749 (Target_sparc::Relocate::relocate): Adjust view down by 4
5750 bytes if it matches reloc_adjust_addr_.
5751 (Target_sparc::Relocate::relocate_tls): Always move the
5752 __tls_get_addr call delay slot instruction forward 4 bytes when
5753 performing relaxation.
5755 2011-10-18 Cary Coutant <ccoutant@google.com>
5757 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5758 (Output_file::map_no_anonymous): Check for non-zero
5759 return code from posix_fallocate.
5761 2011-10-17 Cary Coutant <ccoutant@google.com>
5764 * plugin.cc (is_visible_from_outside): Check for symbols
5765 referenced from dynamic objects.
5766 * resolve.cc (Symbol_table::resolve): Don't count references
5767 from dynamic objects as references from real ELF files.
5768 * testsuite/plugin_test_2.sh: Adjust expected result.
5770 2011-10-17 Cary Coutant <ccoutant@google.com>
5772 * gold.cc: Include timer.h.
5773 (queue_middle_tasks): Stamp time.
5774 (queue_final_tasks): Likewise.
5775 * main.cc (main): Store timer in parameters. Print timers
5777 * parameters.cc (Parameters::Parameters): Initialize timer_.
5778 (Parameters::set_timer): New function.
5779 (set_parameters_timer): New function.
5780 * parameters.h (Parameters::set_timer): New function.
5781 (Parameters::timer): New function.
5782 (Parameters::timer_): New data member.
5783 (set_parameters_timer): New function.
5784 * timer.cc (Timer::stamp): New function.
5785 (Timer::get_pass_time): New function.
5786 * timer.h (Timer::stamp): New function.
5787 (Timer::get_pass_time): New function.
5788 (Timer::pass_times_): New data member.
5790 2011-10-17 Cary Coutant <ccoutant@google.com>
5792 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5793 task for members of lib groups.
5795 2011-10-17 Cary Coutant <ccoutant@google.com>
5798 * fileread.cc (File_read::find_view): Add assert.
5799 (File_read::make_view): Move bounds check (replace with assert)...
5800 (File_read::find_or_make_view): ... to here.
5802 2011-10-12 Cary Coutant <ccoutant@google.com>
5804 * output.cc (Output_file::open_base_file): Handle case where
5805 ::read returns less than requested size.
5807 2011-10-10 Cary Coutant <ccoutant@google.com>
5809 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5810 Initialize defined_count_.
5811 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5812 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5813 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5814 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5815 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5816 * incremental.h (Sized_relobj_incr::defined_count_): New data
5818 (Sized_incr_dynobj::defined_count_): New data member.
5819 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5820 Return zeroes instead of internal error.
5822 2011-10-10 Cary Coutant <ccoutant@google.com>
5825 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5826 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5827 * output.h (class Output_reloc): Add use_plt_offset flag.
5828 (Output_reloc::type_): Adjust size of bit field.
5829 (Output_reloc::use_plt_offset_): New bit field.
5830 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5831 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5832 flag. Adjust all callers.
5833 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5834 creating RELATIVE relocations.
5836 2011-10-10 Nick Clifton <nickc@redhat.com>
5838 * po/es.po: Updated Spanish translation.
5839 * po/fi.po: Updated Finnish translation.
5841 2011-10-03 Diego Novillo <dnovillo@google.com>
5843 * options.cc (parse_uint): Fix dereference of RETVAL.
5845 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5847 * layout.h (section_order_map_): New member.
5848 (get_section_order_map): New member function.
5849 * output.cc (Output_section::add_input_section): Check for patterns
5850 only when --section-ordering-file is specified.
5851 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5852 output_sections have been formed.
5853 * layout.cc (Layout_Layout): Initialize section_order_map_.
5854 * plugin.cc (update_section_order): Store order in order_map. Do not
5856 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5857 * testsuite/Makefile.in: Regenerate.
5858 * testsuite/plugin_section_order.c: New file.
5859 * testsuite/plugin_final_layout.cc: New file.
5860 * testsuite/plugin_final_layout.sh: New file.
5862 2011-09-29 Cary Coutant <ccoutant@google.com>
5864 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5866 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
5867 symbols during incremental update.
5868 (Symbol_table::add_from_dynobj): Likewise.
5870 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5871 Ian Lance Taylor <iant@google.com>
5873 * symtab.cc (Symbol_table::define_special_symbol): Always
5874 canonicalize version string.
5876 2011-09-26 Cary Coutant <ccoutant@google.com>
5878 * gold.cc (queue_initial_tasks): Move option checks ...
5879 * options.cc (General_options::finalize): ... to here. Disable
5880 some options; make others fatal.
5882 2011-09-26 Cary Coutant <ccoutant@google.com>
5885 * plugin.cc (get_symbols_v2): New function.
5886 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5887 (is_referenced_from_outside): New function.
5888 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5889 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5890 (get_symbols): Pass version parameter.
5891 (get_symbols_v2): New function.
5892 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5894 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5895 (onload): Add LDPT_GET_SYMBOLS_V2.
5896 (all_symbols_read_hook): Use get_symbols_v2; check for
5897 LDPR_PREVAILING_DEF_IRONLY_EXP.
5898 * testsuite/plugin_test_3.sh: Update expected results.
5900 2011-09-23 Simon Baldwin <simonb@google.com>
5902 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5903 configuration options.
5904 * configure: Regenerate.
5905 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5906 * Makefile.in: Regenerate.
5907 * testsuite/Makefile.in: Regenerate.
5909 2011-09-19 Sriraman Tallam <tmsriram@google.com>
5911 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5913 2011-09-19 Cary Coutant <ccoutant@google.com>
5915 * incremental.cc (can_incremental_update): Fix typo in comment.
5916 * incremental.h (can_incremental_update): Likewise.
5918 2011-09-18 Cary Coutant <ccoutant@google.com>
5920 * incremental.cc (can_incremental_update): New function.
5921 * incremental.h (can_incremental_update): New function.
5922 * layout.cc (Layout::init_fixed_output_section): Call it.
5923 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5924 * object.cc (Sized_relobj_file::do_layout): Call
5925 can_incremental_update.
5927 2011-09-13 Cary Coutant <ccoutant@google.com>
5929 * configure.ac: Check for glibc support for gnu_indirect_function
5930 support with static linking, setting automake conditional
5932 * Makefile.in: Regenerate.
5933 * configure: Regenerate.
5935 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5936 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5938 * testsuite/Makefile.in: Regenerate.
5940 2011-09-13 Cary Coutant <ccoutant@google.com>
5942 * incremental.cc (Sized_relobj_incr::do_layout): Call
5943 report_comdat_group for kept comdat sections.
5944 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5945 * testsuite/Makefile.in: Regenerate.
5946 * testsuite/incr_comdat_test_1.cc: New source file.
5947 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5948 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5949 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5951 2011-09-13 Ian Lance Taylor <iant@google.com>
5953 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5954 variable external_symbols_offset.
5956 2011-09-12 Ian Lance Taylor <iant@google.com>
5958 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5959 triggered if object has no symbols.
5961 2011-09-09 David S. Miller <davem@davemloft.net>
5963 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5964 (Output_fill_debug_line::do_write): Likewise.
5966 2011-08-29 Cary Coutant <ccoutant@google.com>
5968 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5969 casts to match formatting specs.
5970 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5972 2011-08-26 Cary Coutant <ccoutant@google.com>
5974 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5975 remaining hole size when allocating.
5976 (Layout::make_output_section): Set fill methods for debug sections.
5977 * layout.h (Free_list::Free_list_node): Move from private to
5979 (Free_list::set_min_hole_size): New function.
5980 (Free_list::begin, Free_list::end): New functions.
5981 (Free_list::min_hole_): New data member.
5982 * output.cc: Include dwarf.h.
5983 (Output_fill_debug_info::do_minimum_hole_size): New function.
5984 (Output_fill_debug_info::do_write): New function.
5985 (Output_fill_debug_line::do_minimum_hole_size): New function.
5986 (Output_fill_debug_line::do_write): New function.
5987 (Output_section::Output_section): Initialize new data member.
5988 (Output_section::set_final_data_size): Ensure patch space is larger
5989 than minimum hole size.
5990 (Output_section::do_write): Fill holes in debug sections.
5991 * output.h (Output_fill): New class.
5992 (Output_fill_debug_info): New class.
5993 (Output_fill_debug_line): New class.
5994 (Output_section::set_free_space_fill): New function.
5995 (Output_section::free_space_fill_): New data member.
5996 * testsuite/Makefile.am (incremental_test_3): Add
5997 --incremental-patch option.
5998 (incremental_test_4): Likewise.
5999 (incremental_test_5): Likewise.
6000 (incremental_test_6): Likewise.
6001 (incremental_copy_test): Likewise.
6002 (incremental_common_test_1): Likewise.
6003 * testsuite/Makefile.in: Regenerate.
6005 2011-08-26 Nick Clifton <nickc@redhat.com>
6007 * po/es.po: Updated Spanish translation.
6009 2011-08-01 Cary Coutant <ccoutant@google.com>
6011 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6012 * gold/testsuite/Makefile.in: Regenerate.
6013 * gold/testsuite/justsyms_exec.c: New source file.
6014 * gold/testsuite/justsyms_lib.c: New source file.
6016 2011-08-01 Cary Coutant <ccoutant@google.com>
6018 * layout.cc (Layout::set_segment_offsets): Don't realign text
6019 segment if -Ttext was specified.
6020 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6022 * object.h (Sized_relobj_file::e_type): New function.
6023 (Sized_relobj_file::e_type_): New data member.
6024 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6025 base address for ET_EXEC files.
6026 * target.cc (Target::do_make_elf_object_implementation): Allow
6027 ET_EXEC files with --just-symbols option.
6029 2011-07-28 Cary Coutant <ccoutant@google.com>
6031 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6032 Add thread_number parameter.
6033 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6034 * workqueue-threads.cc
6035 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6036 current thread if its thread number is greater than desired thread
6038 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6039 Add thread_number parameter.
6040 (Workqueue::should_cancel_thread): Likewise.
6041 (Workqueue::find_runnable_or_wait): Pass thread_number to
6042 should_cancel_thread.
6043 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6046 2011-07-22 Sriraman Tallam <tmsriram@google.com>
6048 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6049 only after checking if it cannot be forced local.
6050 * symtab.h (is_externally_visible): Check if the symbol is not forced
6053 2011-07-15 Ian Lance Taylor <iant@google.com>
6055 * options.h (class General_options): Add --print-output-format.
6056 Move -EL next to -EB, for better --help output.
6057 * target-select.cc: Include <cstdio>, "options.h", and
6059 (Target_selector::do_target_bfd_name): New function.
6060 (print_output_format): New function.
6061 * target-select.h (class Target_selector): Update declarations.
6062 (Target_selector::target_bfd_name): New function.
6063 (print_output_format): Declare.
6064 * main.cc: Include "target-select.h".
6065 (main): Handle --print-output-format.
6066 * gold.cc: Include "target-select.h".
6067 (queue_initial_tasks): Handle --print-output-format when there are
6069 * parameters.cc (parameters_force_valid_target): Give a better
6070 error message if -EB/-EL does not match target.
6071 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6074 2011-07-15 Ian Lance Taylor <iant@google.com>
6076 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6077 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6078 (Output_data_plt_i386::do_write): Write address of .dynamic
6079 section to first entry in .got.plt section.
6080 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6081 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6083 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6084 section to first entry in .got.plt section.
6085 * layout.h (Layout::dynamic_section): New function.
6087 2011-07-13 Sriraman Tallam <tmsriram@google.com>
6089 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6091 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6092 input_section_position_, and input_section_glob_.
6093 (read_layout_from_file): Call function section_ordering_specified.
6094 * layout.h (is_section_ordering_specified): New function.
6095 (section_ordering_specified): New function.
6096 (section_ordering_specified_): New boolean member.
6097 * main.cc(main): Call load_plugins after layout object is defined.
6098 * output.cc (Output_section::add_input_section): Use
6099 function section_ordering_specified to check if section ordering is
6101 * output.cc (Output_section::add_relaxed_input_section): Use
6102 function section_ordering_specified to check if section ordering is
6104 (Output_section::update_section_layout): New function.
6105 (Output_section::sort_attached_input_sections): Check if input section
6107 * output.h (Output_section::update_section_layout): New function.
6108 * plugin.cc (get_section_count): New function.
6109 (get_section_type): New function.
6110 (get_section_name): New function.
6111 (get_section_contents): New function.
6112 (update_section_order): New function.
6113 (allow_section_ordering): New function.
6114 (Plugin::load): Add the new interfaces to the transfer vector.
6115 (Plugin_manager::load_plugins): New parameter.
6116 (Plugin_manager::all_symbols_read): New parameter.
6117 (Plugin_manager::claim_file): New parameter. Save the elf object for
6119 (Plugin_manager::get_elf_object): New function.
6120 (Plugin_manager::get_view): Change to directly use the bool to check
6121 if get_view is called from claim_file_hook.
6122 * plugin.h (input_objects): New function
6123 (Plugin__manager::load_plugins): New parameter.
6124 (Plugin_manager::claim_file): New parameter.
6125 (Plugin_manager::get_elf_object): New function.
6126 (Plugin_manager::in_claim_file_handler): New function.
6127 (Plugin_manager::in_claim_file_handler_): New member.
6128 (layout): New function.
6129 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6130 handler with an extra parameter. Make the elf object before calling
6132 * testsuite/plugin_test.c (get_section_count): New function pointer.
6133 (get_section_type): New function pointer.
6134 (get_section_name): New function pointer.
6135 (get_section_contents): New function pointer.
6136 (update_section_order): New function pointer.
6137 (allow_section_ordering): New function pointer.
6138 (onload): Check if the new interfaces exist.
6140 2011-07-13 Ian Lance Taylor <iant@google.com>
6142 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6144 * x86_64.cc (Target_x86_64::got_section): Likewise.
6145 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6146 (relro_now_test_SOURCES): New variable.
6147 (relro_now_test_DEPENDENCIES): New variable.
6148 (relro_now_test_LDFLAGS): New variable.
6149 (relro_now_test_LDADD): New variable.
6150 (relro_now_test.so): New target.
6151 * testsuite/Makefile.in: Rebuild.
6153 2011-07-12 Ian Lance Taylor <iant@google.com>
6156 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6157 GLOB_DAT relocation rather than a RELATIVE relocation for a
6158 protected symbol when creating a shared library.
6159 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6160 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6161 * testsuite/protected_main_1.cc (main): Test that protected
6162 function has same address.
6164 2011-07-11 Ian Lance Taylor <iant@google.com>
6167 * options.h (class General_options): Add -Bgroup.
6168 * options.cc (General_options::finalize): If -Bgroup is set,
6169 default to --unresolved-symbols=report-all.
6170 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6171 * target-reloc.h (issue_undefined_symbol_error): Handle
6172 --unresolved-symbols=report-all.
6174 2011-07-08 Ian Lance Taylor <iant@google.com>
6177 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6178 if linker script discards key sections.
6179 (Layout::create_dynamic_symtab): Likewise.
6180 (Layout::assign_local_dynsym_offsets): Likewise.
6181 (Layout::sized_create_version_sections): Likewise.
6182 (Layout::create_interp): Likewise.
6183 (Layout::finish_dynamic_section): Likewise.
6184 (Layout::set_dynamic_symbol_size): Likewise.
6186 2011-07-08 Ian Lance Taylor <iant@google.com>
6189 * options.h (class General_options): Add --unresolved-symbols.
6190 * target-reloc.h (issue_undefined_symbol_error): Check
6191 --unresolved-symbols. Add comments.
6193 2011-07-08 Ian Lance Taylor <iant@google.com>
6195 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6196 expression more complex.
6198 2011-07-08 Ian Lance Taylor <iant@google.com>
6201 * target-reloc.h (issue_undefined_symbol_error): New inline
6202 function, broken out of relocate_section.
6203 (relocate_section): Call issue_undefined_symbol_error.
6204 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6205 there is no TLS segment if we are about to issue an undefined
6207 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6209 2011-07-08 Ian Lance Taylor <iant@google.com>
6212 * resolve.cc (Symbol_table::should_override): Add fromtype
6213 parameter. Change all callers. Give error when linking together
6214 TLS and non-TLS symbol.
6215 (Symbol_table::should_override_with_special): Add fromtype
6216 parameter. Change all callers.
6217 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6218 there is no TLS segment if we have reported some errors.
6219 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6221 2011-07-08 Ian Lance Taylor <iant@google.com>
6224 * target.h (Target::plt_address_for_global): New function.
6225 (Target::plt_address_for_local): New function.
6226 (Target::plt_section_for_global): Remove.
6227 (Target::plt_section_for_local): Remove.
6228 (Target::do_plt_address_for_global): New virtual function.
6229 (Target::do_plt_address_for_local): New virtual function.
6230 (Target::do_plt_section_for_global): Remove.
6231 (Target::do_plt_section_for_local): Remove.
6232 (Target::register_global_plt_entry): Add Symbol_table and Layout
6234 * output.cc (Output_data_got::Got_entry::write): Use
6235 plt_address_for_global and plt_address_for_local.
6236 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6237 address of output section.
6238 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6239 got_irelative_, and irelative_count_ fields. Update
6241 (Output_data_plt_i386::has_irelative_section): New function.
6242 (Output_data_plt_i386::entry_count): Add irelative_count_.
6243 (Output_data_plt_i386::set_final_data_size): Likewise.
6244 (class Target_i386): Add got_irelative_ and rel_irelative_
6245 fields. Update declarations.
6246 (Target_i386::Target_i386): Initialize new fields.
6247 (Target_i386::do_plt_address_for_global): New function replacing
6248 do_plt_section_for_global.
6249 (Target_i386::do_plt_address_for_local): New function replacing
6250 do_plt_section_for_local.
6251 (Target_i386::got_section): Create got_irelative_.
6252 (Target_i386::rel_irelative_section): New function.
6253 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6254 fields. Don't define __rel_iplt_{start,end}.
6255 (Output_data_plt_i386::add_entry): Add symtab and layout
6256 parameters. Change all callers. Use different PLT and GOT for
6258 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6259 layout parameters. Change all callers. Use different PLT and
6261 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6262 (Output_data_plt_i386::rel_irelative): New function.
6263 (Output_data_plt_i386::address_for_global): New function.
6264 (Output_data_plt_i386::address_for_local): New function.
6265 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6266 IRELATIVE GOT when changing IFUNC GOT entries.
6267 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6269 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6270 if we didn't create an IRELATIVE GOT.
6271 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6272 plt_address_for_local.
6273 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6274 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6275 got_irelative_, and irelative_count_ fields. Update
6277 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6278 Initialize new fields. Remove symtab parameter. Change all
6280 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6282 (Output_data_plt_x86_64::has_irelative_section): New function.
6283 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6284 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6285 fields. Update declarations.
6286 (Target_x86_64::Target_x86_64): Initialize new fields.
6287 (Target_x86_64::do_plt_address_for_global): New function replacing
6288 do_plt_section_for_global.
6289 (Target_x86_64::do_plt_address_for_local): New function replacing
6290 do_plt_section_for_local.
6291 (Target_x86_64::got_section): Create got_irelative_.
6292 (Target_x86_64::rela_irelative_section): New function.
6293 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6294 all callers. Don't create __rel_iplt_{start,end}.
6295 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6296 parameters. Change all callers. Use different PLT and GOT for
6298 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6299 layout parameters. Change all callers. Use different PLT and
6301 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6302 parameters. Change all callers. Use different PLT and GOT for
6304 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6305 (Output_data_plt_x86_64::rela_irelative): New function.
6306 (Output_data_plt_x86_64::address_for_global): New function.
6307 (Output_data_plt_x86_64::address_for_local): New function.
6308 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6309 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6310 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6311 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6313 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6315 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6316 symbols if we didn't create an IRELATIVE GOT.
6317 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6318 plt_address_for_local.
6319 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6320 * testsuite/ifuncvar1.c: New test file.
6321 * testsuite/ifuncvar2.c: New test file.
6322 * testsuite/ifuncvar3.c: New test file.
6323 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6324 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6325 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6326 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6327 * testsuite/Makefile.in: Rebuild.
6329 2011-07-07 Cary Coutant <ccoutant@google.com>
6331 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6332 (two_file_test_1_ndebug.o): Likewise.
6333 (two_file_test_1b_ndebug.o): Likewise.
6334 (two_file_test_2_ndebug.o): Likewise.
6335 (two_file_test_main_ndebug.o): Likewise.
6336 (incremental_test_2): Link with no-debug versions.
6338 2011-07-06 Cary Coutant <ccoutant@google.com>
6340 * gold/incremental.cc
6341 (Output_section_incremental_inputs::write_info_blocks): Check for
6342 hidden and internal symbols.
6344 2011-07-06 Cary Coutant <ccoutant@google.com>
6346 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6347 Check disposition for startup file.
6348 (Incremental_inputs::report_command_line): Ignore
6349 --incremental-startup-unchanged option.
6350 * options.cc (General_options::parse_incremental_startup_unchanged):
6352 (General_options::General_options): Initialize new data member.
6353 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6354 (General_options): Add --incremental-startup-unchanged option.
6355 (General_options::incremental_startup_disposition): New function.
6356 (General_options::incremental_startup_disposition_): New data member.
6358 2011-07-06 Cary Coutant <ccoutant@google.com>
6360 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6361 input file index to Script_info ctor.
6362 (Sized_incremental_binary::do_file_has_changed): Find the
6363 command-line argument for files named in scripts.
6364 * incremental.h (Script_info::Script_info): New ctor
6365 with input file index.
6366 (Script_info::input_file_index): New function.
6367 (Script_info::input_file_index_): New data member.
6368 (Incremental_binary::get_library): Add const.
6369 (Incremental_binary::get_script_info): Add const.
6370 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6371 * testsuite/Makefile.am (incremental_test_5): New test case.
6372 (incremental_test_6): New test case.
6373 * testsuite/Makefile.in: Regenerate.
6375 2011-07-06 Cary Coutant <ccoutant@google.com>
6377 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6378 debug output when command lines differ.
6380 2011-07-06 Cary Coutant <ccoutant@google.com>
6382 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6383 --incremental-patch option.
6384 * layout.cc (Free_list::allocate): Extend allocation beyond original
6386 (Layout::make_output_section): Mark sections that should get
6388 * options.cc (parse_percent): New function.
6389 * options.h (parse_percent): New function.
6390 (DEFINE_percent): New macro.
6391 (General_options): Add --incremental-patch option.
6392 * output.cc (Output_section::Output_section): Initialize new data
6394 (Output_section::add_input_section): Print section name when out
6396 (Output_section::add_output_section_data): Likewise.
6397 (Output_section::set_final_data_size): Add patch space when
6398 doing --incremental-full.
6399 (Output_section::do_reset_address_and_file_offset): Remove patch
6401 (Output_segment::set_section_list_addresses): Print debug output
6402 only if --incremental-update.
6403 * output.h (Output_section::set_is_patch_space_allowed): New function.
6404 (Output_section::is_patch_space_allowed_): New data member.
6405 (Output_section::patch_space_): New data member.
6406 * parameters.cc (Parameters::incremental_full): New function.
6407 * parameters.h (Parameters::incremental_full): New function
6408 * testsuite/Makefile.am (incremental_test_2): Add test for
6409 --incremental-patch option.
6410 * testsuite/Makefile.in: Regenerate.
6411 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6412 (t18): Remove function body.
6414 2011-07-05 Doug Kwan <dougkwan@google.com>
6417 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6418 Arm_Address type for relocation result.
6419 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6421 (Arm_relocate_functions::abs32): Use unaligned access.
6422 (Arm_relocate_functions::rel32): Ditto.
6423 (Arm_relocate_functions::prel31): Ditto.
6424 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6425 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6426 static data relocations.
6427 * testsuite/Makefile.in: Regnerate.
6428 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6430 2011-07-05 Ian Lance Taylor <iant@google.com>
6433 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6434 symbols if necessary.
6435 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6437 2011-07-05 Ian Lance Taylor <iant@google.com>
6440 * resolve.cc (Symbol::override_base_with_special): Simply override
6441 version with special symbol version, ignoring previous version.
6443 2011-07-05 Ian Lance Taylor <iant@google.com>
6445 * object.cc (Sized_relobj_file::include_section_group): Add
6446 information to comment about signature location.
6448 2011-07-02 Ian Lance Taylor <iant@google.com>
6451 * options.h (class General_options): Add -f and -F.
6452 * options.cc (General_options::finalize): Fatal error if -f/-F
6453 are used without -shared.
6454 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6456 2011-07-02 Ian Lance Taylor <iant@google.com>
6458 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6460 2011-07-01 Ian Lance Taylor <iant@google.com>
6464 * resolve.cc (Symbol::override_base_with_special): Don't override
6465 the version if the overriding symbol has a different name.
6466 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6467 all callers. If we give an error about an undefined version,
6468 define the base version if necessary.
6469 * dynobj.h (class Versions): Update declaration.
6470 * testsuite/weak_alias_test_5.cc: New file.
6471 * testsuite/weak_alias_test.script: New file.
6472 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6473 and versioned_alias have the right value, and call t2.
6474 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6475 weak_alias_test_5.so.
6476 (weak_alias_test_LDADD): Likewise.
6477 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6478 * testsuite/Makefile.in: Rebuild.
6480 2011-07-01 Ian Lance Taylor <iant@google.com>
6483 * options.h (class General_options): Support -z notext.
6484 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6486 (two_file_shared_nonpic.so): Likewise.
6487 (two_file_shared_mixed.so): Likewise.
6488 (two_file_shared_mixed_1.so): Likewise.
6489 (weak_undef_lib_nonpic.so): Likewise.
6490 (alt/weak_undef_lib_nonpic.so): Likewise.
6491 (tls_test_shared_nonpic.so): Likewise.
6492 * testsuite/Makefile.in: Rebuild.
6494 2011-07-01 Ian Lance Taylor <iant@google.com>
6497 * configure.ac: Test whether static linking works, setting
6498 the automake conditional HAVE_STATIC.
6499 * testsuite/Makefile.am: Disable tests using -static if
6500 HAVE_STATIC is not true.
6501 * configure, testsuite/Makefile.in: Rebuild.
6503 2011-07-01 Ian Lance Taylor <iant@google.com>
6506 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6507 Assert if we see DW_EH_PE_indirect.
6508 * target.h (Target::ehframe_datarel_base): New function.
6509 (Target::do_ehframe_datarel_base): New target function.
6510 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6511 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6514 2011-07-01 Ian Lance Taylor <iant@google.com>
6517 * options.h (class General_options): Add
6518 --ld-generated-unwind-info.
6519 * ehframe.cc (Fde::write): Add address parameter. Change all
6520 callers. If associated with PLT, fill in address and size.
6521 (Cie::set_output_offset): Only add merge mapping if there is an
6523 (Cie::write): Add address parameter. Change all callers.
6524 (Eh_frame::add_ehframe_for_plt): New function.
6525 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6526 input_offset_ fields into union u_, with new plt field.
6527 (Fde::Fde): Adjust for new union field.
6528 (Fde::Fde) [Output_data version]: New constructor.
6529 (Fde::add_mapping): Only add merge mapping if there is an object.
6530 (class Cie): Update declarations.
6531 (class Eh_frame): Declare add_ehframe_for_plt.
6532 * layout.cc (Layout::layout_eh_frame): Break out code into
6533 make_eh_frame_section, and call it.
6534 (Layout::make_eh_frame_section): New function.
6535 (Layout::add_eh_frame_for_plt): New function.
6536 * layout.h (class Layout): Update declarations.
6537 * merge.cc (Merge_map::add_mapping): Add assertion.
6538 * i386.cc: Include "dwarf.h".
6539 (class Output_data_plt_i386): Make first_plt_entry,
6540 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6541 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6542 and plt_eh_frame_fde.
6543 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6544 boundary. Call add_eh_frame_for_plt if appropriate.
6545 * x86_64.cc: Include "dwarf.h".
6546 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6547 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6548 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6549 and plt_eh_frame_fde.
6550 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6553 2011-06-29 Ian Lance Taylor <iant@google.com>
6556 * object.cc (Sized_relobj_file::layout_section): Change shdr
6557 parameter to be const.
6558 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6560 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6561 appropriate. Call layout_eh_frame_section.
6562 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6564 * object.h (class Sized_relobj_file): Update declarations.
6566 2011-06-29 Ian Lance Taylor <iant@google.com>
6569 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6571 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6573 2011-06-29 Ian Lance Taylor <iant@google.com>
6576 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6578 * layout.cc (Layout::layout_eh_frame): Likewise.
6580 2011-06-29 Ian Lance Taylor <iant@google.com>
6583 * layout.cc (Layout::symtab_section_shndx): New function.
6584 * layout.h (class Layout): Declare symtab_section_shndx.
6585 * output.cc (Output_section::write_header): Call it.
6587 2011-06-29 Ian Lance Taylor <iant@google.com>
6590 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6591 symbols which are not used in a relocation.
6593 2011-06-28 Ian Lance Taylor <iant@google.com>
6596 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6597 script create indistinguishable segments.
6598 (Layout::set_segment_offsets): Use stable_sort when sorting
6599 segments. Pass this to Compare_segments constructor.
6600 * layout.h (class Layout): Make segment_precedes non-static.
6601 (class Compare_segments): Change from struct to class. Add
6602 layout_ field. Add constructor.
6603 * script-sections.cc
6604 (Script_sections::attach_sections_using_phdrs_clause): Rename
6605 local orphan to is_orphan. Don't report failure to put empty
6606 section in segment. On attachment failure, report name of
6607 section, and attach to first PT_LOAD segment.
6609 2011-06-28 Ian Lance Taylor <iant@google.com>
6612 * target-select.cc (Target_selector::Target_selector): Add
6613 emulation parameter. Change all callers.
6614 (select_target_by_bfd_name): Rename from select_target_by_name.
6616 (select_target_by_emulation): New function.
6617 (supported_emulation_names): New function.
6618 * target-select.h (class Target_selector): Add emulation_ field.
6619 Update declarations.
6620 (Target_selector::recognize_by_bfd_name): Rename from
6621 recognize_by_name. Change all callers.
6622 (Target_selector::supported_bfd_names): Rename from
6623 supported_names. Change all callers.
6624 (Target_selector::recognize_by_emulation): New function.
6625 (Target_selector::supported_emulations): New function.
6626 (Target_selector::emulation): New function.
6627 (Target_selector::do_recognize_by_bfd_name): Rename from
6628 do_recognize_by_name. Change all callers.
6629 (Target_selector::do_supported_bfd_names): Rename from
6630 do_supported_names. Change all callers.
6631 (Target_selector::do_recognize_by_emulation): New function.
6632 (Target_selector::do_supported_emulations): New function.
6633 (select_target_by_bfd_name): Change name in declaration.
6634 (select_target_by_emulation): Declare.
6635 (supported_emulation_names): Declare.
6636 * parameters.cc (parameters_force_valid_target): Try to find
6637 target based on emulation from -m option.
6638 * options.h (class General_options): Change doc string for -m.
6639 * options.cc (help): Print emulations.
6640 (General_options::parse_V): Likewise.
6641 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6642 Add emulation parameter. Change all callers.
6644 2011-06-28 Ian Lance Taylor <iant@google.com>
6646 * target.h (class Target): Add osabi_ field.
6647 (Target::osabi): New function.
6648 (Target::set_osabi): New function.
6649 (Target::Target): Initialize osabi_.
6650 (Target::do_adjust_elf_header): Make pure virtual.
6651 (Sized_target::do_adjust_elf_header): Declare.
6652 * target.cc (Sized_target::do_adjust_elf_header): New function.
6653 (class Sized_target): Instantiate all versions.
6654 * freebsd.h (class Target_freebsd): Remove.
6655 (Target_selector_freebsd::do_recognize): Call set_osabi on
6657 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6658 (Target_selector_freebsd::set_osabi): Remove.
6659 * i386.cc (class Target_i386): Inherit from Sized_target rather
6660 than Target_freebsd.
6661 * x86_64.cc (class Target_x86_64): Likewise.
6663 2011-06-28 Ian Lance Taylor <iant@google.com>
6665 * target.h (Target::can_check_for_function_pointers): Rewrite.
6667 (Target::can_icf_inline_merge_sections): Likewise.
6668 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6669 (Target::Target_info): Add can_icf_inline_merge_sections field.
6670 (Target::do_can_check_for_function_pointers): New virtual
6672 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6673 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6674 from can_check_for_function_pointers, move in file.
6675 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6676 section_may_have_icf_unsafe_poineters, move in file.
6677 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6678 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6679 Rename from can_check_for_function_pointers, move in file.
6680 (Target_i386::can_icf_inline_merge_sections): Remove.
6681 (Target_i386::i386_info): Initialize
6682 can_icf_inline_merge_sections.
6683 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6684 Initialize can_icf_inline_merge_sections.
6685 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6686 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6687 Rename from can_check_for_function_pointers, move in file.
6688 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6689 (Target_x86_64::x86_64_info): Initialize
6690 can_icf_inline_merge_sections.
6691 * testsuite/testfile.cc (Target_test::test_target_info):
6693 * icf.cc (get_section_contents): Correct formatting.
6695 2011-06-27 Ian Lance Taylor <iant@google.com>
6697 * symtab.cc (Symbol::versioned_name): New function.
6698 (Symbol_table::add_to_final_symtab): Use versioned_name when
6700 (Symbol_table::sized_write_symbol): Likewise.
6701 * symtab.h (class Symbol): Declare versioned_name.
6702 * stringpool.h (class Stringpool_template): Add variant of add
6703 which takes a std::basic_string.
6704 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6705 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6706 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6707 (ver_test_12.o): New target.
6708 * testsuite/Makefile.in: Rebuild.
6710 2011-06-27 Doug Kwan <dougkwan@google.com>
6712 * arm.cc (Arm_relocate_functions::thm_jump8,
6713 Arm_relocate_functions::thm_jump11): Use a wider signed
6714 type to compute offset.
6715 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6717 * testsuite/Makefile.in: Regenerate.
6718 * testsuite/arm_branch_in_range.sh: Check test results of
6719 arm_thm_jump11 and arm_thm_jump8.
6720 * testsuite/arm_thm_jump11.s: New test source file.
6721 * testsuite/arm_thm_jump11.t: New linker script.
6722 * testsuite/arm_thm_jump8.s: New test source file.
6723 * testsuite/arm_thm_jump8.t: New linker script.
6725 2011-06-24 Ian Lance Taylor <iant@google.com>
6727 * layout.cc: Include "object.h".
6728 (ctors_sections_in_init_array): New static variable.
6729 (Layout::is_ctors_in_init_array): New function.
6730 (Layout::layout): Add entry to ctors_sections_in_init_array if
6732 * layout.h (class Layout): Declare is_ctors_in_init_array.
6733 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6734 is_ctors_reverse_view is set.
6735 (Sized_relobj_file::write_sections): Add layout parameter. Change
6736 all callers. Set is_ctors_reverse_view field of View_size.
6737 (Sized_relobj_file::reverse_words): New function.
6738 * object.h (Sized_relobj_file::View_size): Add
6739 is_ctors_reverse_view field.
6740 (class Sized_relobj_file): Update declarations.
6741 * testsuite/initpri3.c: New test.
6742 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6744 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6745 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6746 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6747 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6748 * testsuite/Makefile.in: Rebuild.
6750 2011-06-24 Cary Coutant <ccoutant@google.com>
6752 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6753 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6754 (debug_msg_cdebug.err): New targets.
6755 * testsuite/Makefile.in: Regenerate.
6756 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6757 Fix checks for link with shared library.
6759 2011-06-24 Doug Kwan <dougkwan@google.com>
6761 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6762 skip empty text sections.
6763 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6765 2011-06-22 Ian Lance Taylor <iant@google.com>
6768 * options.h (class General_options): Add --ctors-in-init-array.
6769 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6770 friends as SHT_PROGBITS for merging sections.
6771 (Layout::layout): Remove special handling of .init_array and
6772 friends. Don't sort if doing relocatable link. Sort for .ctors
6773 and .dtors if ctors_in_init_array.
6774 (Layout::make_output_section): Force correct section types for
6775 .init_array and friends. Don't sort if doing relocatable link,
6776 Don't sort .ctors and .dtors if ctors_in_init_array.
6777 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6778 (Layout::output_section_name): Add relobj parameter. Change all
6779 callers. Handle .ctors. and .dtors. in code rather than table.
6780 Handle .ctors and .dtors if ctors_in_init_array.
6781 (Layout::match_file_name): New function, moved from output.cc.
6782 * layout.h (class Layout): Update declarations.
6783 * output.cc: Include "layout.h".
6784 (Input_section_sort_entry::get_priority): New function.
6785 (Input_section_sort_entry::match_file_name): Just call
6786 Layout::match_file_name.
6787 (Output_section::Input_section_sort_init_fini_compare::operator()):
6788 Handle .ctors and .dtors. Sort by explicit priority rather than
6790 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6791 * testsuite/initpri2.c: New test.
6792 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6793 (check_PROGRAMS): Add initpri2.
6794 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6795 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6796 * configure, testsuite/Makefile.in: Rebuild.
6798 2011-06-19 Ian Lance Taylor <iant@google.com>
6801 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6802 .interp section to a PT_INTERP segment even if we have seen a
6803 --dynamic-linker option. Don't do it if we have seen a PHDRS
6804 clause in a linker script.
6805 (Layout::finalize): Don't create a .interp section if we've
6806 already create a PT_INTERP segment.
6807 (Layout::create_interp): Always call choose_output_section (revert
6808 patch of 2011-06-17). Don't create PT_INTERP segment.
6809 * script-sections.cc
6810 (Script_sections::create_note_and_tls_segments): Add a .interp
6811 section to a PT_INTERP segment even if we have seen a
6812 --dynamic-linker option.
6814 2011-06-18 Ian Lance Taylor <iant@google.com>
6816 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6817 merely because a non-PT_LOAD segment has a dynamic reloc.
6819 2011-06-18 Ian Lance Taylor <iant@google.com>
6821 * layout.cc (Layout::finish_dynamic_section): Don't create
6822 DT_FLAGS entry if not needed.
6824 2011-06-18 Ian Lance Taylor <iant@google.com>
6827 * layout.cc (Layout::layout_eh_frame): Correct handling of
6828 writable .eh_frame section.
6830 2011-06-17 Ian Lance Taylor <iant@google.com>
6833 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6834 symbol is redefined with the exact same object and value.
6836 2011-06-17 Ian Lance Taylor <iant@google.com>
6839 * layout.h (class Layout): Add interp_segment_ field.
6840 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6841 (Layout::attach_allocated_section_to_segment): If making shared
6842 library, put .interp section in PT_INTERP segment.
6843 (Layout::finalize): Also call create_interp if -dynamic-linker
6845 (Layout::create_interp): Assert that there is no PT_INTERP
6846 segment. If not using a SECTIONS clause, use make_output_section.
6847 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6848 * script-sections.cc
6849 (Script_sections::create_note_and_tls_segments): If making shared
6850 library, put .interp section in PT_INTERP segment.
6852 2011-06-17 Ian Lance Taylor <iant@google.com>
6854 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6855 when making a shared library.
6857 2011-06-17 Ian Lance Taylor <iant@google.com>
6859 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6860 parameter. Change all callers. Don't issue warning about PC32
6861 against locally defined symbol.
6863 2011-06-16 Ian Lance Taylor <iant@google.com>
6865 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6866 occurs in same object.
6868 2011-06-14 Alan Modra <amodra@gmail.com>
6870 * po/POTFILES.in: Regenerate.
6872 2011-06-09 Ian Lance Taylor <iant@google.com>
6874 * script-sections.cc
6875 (Orphan_output_section::set_section_addresses): For a relocatable
6876 link set address to 0.
6878 2011-06-09 Cary Coutant <ccoutant@google.com>
6881 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6882 used with --compress-debug-sections.
6883 * gold/object.cc (Sized_relobj_file::do_layout): Report
6884 uncompressed size of compressed input sections.
6886 2011-06-08 Cary Coutant <ccoutant@google.com>
6889 * testsuite/two_file_test_2_v1.cc: Change initialization of
6890 v2 to keep it in .data.
6892 2011-06-07 Cary Coutant <ccoutant@google.com>
6894 * common.cc (Symbol_table::do_allocate_commons_list): Call
6896 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6897 (Errors::fallback): New function.
6898 (gold_fallback): New function.
6899 * errors.h (Errors::fallback): New function.
6900 * gold.cc (gold_exit): Change status parameter to enum; adjust
6902 (queue_initial_tasks): Call gold_fallback.
6903 * gold.h: Include cstdlib.
6904 (Exit_status): New enum type.
6905 (gold_exit): Change status parameter to enum.
6906 (gold_fallback): New function.
6907 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6908 (Layout::create_symtab_sections): Likewise.
6909 (Layout::create_shdrs): Likewise.
6910 * main.cc (main): Adjust call to gold_exit.
6911 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6912 (Output_data_got::add_got_entry_pair): Likewise.
6913 (Output_section::add_input_section): Likewise.
6914 (Output_section::add_output_section_data): Likewise.
6915 (Output_segment::set_section_list_addresses): Likewise.
6916 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6918 2011-06-07 Cary Coutant <ccoutant@google.com>
6920 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6921 for incremental links.
6922 * output.cc (Output_segment::set_section_list_addresses): Remove
6923 FIXME and test for TLS or BSS.
6925 2011-06-07 Cary Coutant <ccoutant@google.com>
6927 * testsuite/Makefile.am: Add incremental_copy_test,
6928 incremental_common_test_1.
6929 * testsuite/Makefile.in: Regenerate.
6930 * testsuite/common_test_1_v1.c: New source file.
6931 * testsuite/common_test_1_v2.c: New source file.
6932 * testsuite/copy_test_v1.cc: New source file.
6934 2011-06-07 Cary Coutant <ccoutant@google.com>
6936 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6937 update, allocate common from bss section's free list.
6938 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6939 linker-defined symbols.
6940 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6941 Skip GOT and PLT entries that are no longer referenced.
6942 (Output_section_incremental_inputs::write_info_blocks): Mark
6943 linker-defined symbols.
6944 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6945 * output.cc (Output_section::allocate): New function.
6946 * output.h (Output_section::allocate): New function.
6947 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6948 linker-defined symbols.
6949 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6950 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6951 (Symbol::init_base_output_data): Likewise.
6952 (Symbol::init_base_output_segment): Likewise.
6953 (Symbol::init_base_constant): Likewise.
6954 (Sized_symbol::init_output_data): Likewise.
6955 (Sized_symbol::init_output_segment): Likewise.
6956 (Sized_symbol::init_constant): Likewise.
6957 (Symbol_table::do_define_in_output_data): Likewise.
6958 (Symbol_table::do_define_in_output_segment): Likewise.
6959 (Symbol_table::do_define_as_constant): Likewise.
6960 * symtab.h (Symbol::is_predefined): New function.
6961 (Symbol::init_base_output_data): Add is_predefined parameter.
6962 (Symbol::init_base_output_segment): Likewise.
6963 (Symbol::init_base_constant): Likewise.
6964 (Symbol::is_predefined_): New data member.
6965 (Sized_symbol::init_output_data): Add is_predefined parameter.
6966 (Sized_symbol::init_output_segment): Likewise.
6967 (Sized_symbol::init_constant): Likewise.
6968 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6970 2011-06-07 Cary Coutant <ccoutant@google.com>
6972 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6973 instead of emit_copy_reloc.
6974 (Copy_relocs::emit_copy_reloc): Refactor.
6975 (Copy_relocs::make_copy_reloc): New function.
6976 (Copy_relocs::add_copy_reloc): Remove.
6977 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6979 (Copy_relocs::make_copy_reloc): New function.
6980 (Copy_relocs::add_copy_reloc): Remove.
6981 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6982 unchanged input files.
6983 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6984 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6985 Reserve BSS space for COPY relocations.
6986 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6987 (Output_section_incremental_inputs::write_info_blocks): Record
6988 whether a symbol is copied from a shared object.
6989 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6990 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6991 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6992 (Incremental_input_entry_reader::get_output_symbol_index): Add
6994 (Incremental_binary::emit_copy_relocs): New function.
6995 (Incremental_binary::do_emit_copy_relocs): New function.
6996 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6998 (Sized_incremental_binary::add_copy_reloc): New function.
6999 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7000 (Sized_incremental_binary::Copy_reloc): New struct.
7001 (Sized_incremental_binary::Copy_relocs): New typedef.
7002 (Sized_incremental_binary::copy_relocs_): New data member.
7003 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7004 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7005 * target.h (Sized_target::emit_copy_reloc): New function.
7006 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7008 2011-06-02 Cary Coutant <ccoutant@google.com>
7011 * gold/archive.cc (Archive::Archive): Initialize new data member.
7012 (Archive::include_all_members): Return if archive has already been
7014 * gold/archive.h (Archive::include_all_members_): New data member.
7016 2011-06-02 Nick Clifton <nickc@redhat.com>
7018 * dynobj.h: Fix spelling mistake in comment.
7019 * output.cc: Likewise.
7021 2011-05-31 Doug Kwan <dougkwan@google.com>
7025 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
7026 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7027 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7028 redundant arm_exidx_test.so.
7029 * testsuite/Makefile.in: Regenerate.
7030 (check_SCRIPTS): Add pr12826.sh
7031 (check_DATA): Add pr12826.stdout
7032 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7033 * testsuite/pr12826.sh: New file.
7034 * testsuite/pr12826_1.s: Ditto.
7035 * testsuite/pr12826_1.s: Ditto.
7037 2011-05-30 Ian Lance Taylor <iant@google.com>
7039 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7042 2011-05-29 Ian Lance Taylor <iant@google.com>
7045 * testsuite/Makefile.am: Use different file name for two_file_test
7046 temporary file for each incremental test.
7047 * testsuite/Makefile.in: Rebuild.
7049 2011-05-29 Ian Lance Taylor <iant@google.com>
7051 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7052 binary input file is empty.
7054 2011-05-27 Ian Lance Taylor <iant@google.com>
7056 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7057 (ver_test_9.so): Likewise.
7058 * testsuite/Makefile.in: Rebuild.
7060 2011-05-26 Cary Coutant <ccoutant@google.com>
7062 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7063 * incremental.cc (Incremental_inputs::report_input_section): Fix
7064 comment, indentation.
7065 (Incremental_inputs::report_comdat_group): New function.
7066 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7067 of data for incremental input file entry.
7068 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7069 group count, COMDAT group signatures.
7070 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7071 an unchanged input file.
7072 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7073 Initialize new data member.
7074 (Incremental_object_entry::add_comdat_group): New function.
7075 (Incremental_object_entry::get_comdat_group_count): New function.
7076 (Incremental_object_entry::get_comdat_signature_key): New function.
7077 (Incremental_object_entry::groups_): New data member.
7078 (Incremental_inputs::report_comdat_group): New function.
7079 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7080 data for incremental input file entry.
7081 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7082 (Incremental_input_entry_reader::get_input_section): Adjust size of
7083 data for incremental input file entry.
7084 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7085 (Incremental_input_entry_reader::get_comdat_group_signature): New
7087 * object.cc (Sized_relobj::include_section_group): Report kept
7088 COMDAT groups for incremental links.
7090 2011-05-24 David Meyer <pdox@google.com>
7092 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7093 with name parameter. Add found_name parameter.
7094 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7095 * dirsearch.h (class Dirsearch): Update declaration.
7097 2011-05-24 Ian Lance Taylor <iant@google.com>
7099 * archive.cc (Library_base::should_include_member): Pull in object
7100 from archive if it defines the entry symbol.
7101 * parameters.cc (Parameters::entry): New function.
7102 * parameters.h (class Parameters): Declare entry.
7103 * output.h (class Output_file_header): Remove entry_ field.
7104 * output.cc (Output_file_header::Output_file_header): Remove entry
7105 parameter. Change all callers.
7106 (Output_file_header::entry): Use parameters->entry.
7107 * gold.cc (queue_middle_tasks): Likewise.
7108 * plugin.cc (Plugin_hook::run): Likewise.
7110 2011-05-24 Cary Coutant <ccoutant@google.com>
7112 * gold.cc (queue_initial_tasks): Pass incremental base filename
7113 to Output_file::open_base_file; don't print error message.
7114 * incremental-dump.cc (main): Adjust call to
7115 Output_file::open_for_modification.
7116 * incremental-dump.cc (main): Likewise.
7117 * incremental.cc (Incremental_inputs::report_command_line):
7118 Ignore --incremental-base option when comparing command lines.
7119 Ignore parameter when given as separate argument.
7120 * options.h (class General_options): Add --incremental-base.
7121 * output.cc (Output_file::Output_file):
7122 (Output_file::open_base_file): Add base_name and writable parameters;
7123 read base file into new file; print error message here.
7124 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7126 * output.h (Output_file::open_for_modification): Rename to...
7127 (Output_file::open_base_file): ...this; add base_name and
7128 writable parameters; adjust all callers.
7129 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7131 * testsuite/Makefile.am (incremental_test_4): Test
7133 * testsuite/Makefile.in: Regenerate.
7135 2011-05-24 Cary Coutant <ccoutant@google.com>
7137 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7139 * testsuite/Makefile.in: Regenerate.
7140 * testsuite/two_file_test_1_v1.cc: New test source file.
7141 * testsuite/two_file_test_1b_v1.cc: New test source file.
7142 * testsuite/two_file_test_2_v1.cc: New test source file.
7144 2011-05-24 Cary Coutant <ccoutant@google.com>
7146 * dynobj.h (Dynobj::do_dynobj): New function.
7147 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7148 flag and soname for shared objects.
7149 * incremental.cc (Incremental_inputs::report_object): Make
7150 either Incremental_object_entry or Incremental_dynobj_entry; add
7151 soname to string table.
7152 (Incremental_inputs::report_input_section): Add assertion.
7153 (Output_section_incremental_inputs::set_final_data_size): Adjust
7154 type of input file entry for shared libraries; adjust size of
7155 shared library info entry.
7156 (Output_section_incremental_inputs::write_input_files): Write
7157 as_needed flag for shared libraries.
7158 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7159 of input file entry for shared libraries; write soname.
7160 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7161 soname from incremental info.
7162 * incremental.h (enum Incremental_input_flags): Add
7163 INCREMENTAL_INPUT_AS_NEEDED.
7164 (Incremental_input_entry::Incremental_input_entry): Initialize new
7166 (Incremental_input_entry::set_as_needed): New function.
7167 (Incremental_input_entry::as_needed): New function.
7168 (Incremental_input_entry::do_dynobj_entry): New function.
7169 (Incremental_input_entry::as_needed_): New data member.
7170 (Incremental_object_entry::Incremental_object_entry): Don't check
7172 (Incremental_object_entry::do_type): Likewise.
7173 (class Incremental_dynobj_entry): New class.
7174 (Incremental_input_entry_reader::as_needed): New function.
7175 (Incremental_input_entry_reader::get_soname): New function.
7176 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7177 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7178 size of shared library info entry.
7179 * layout.cc (Layout::finish_dynamic_section): Don't test for
7180 incremental link when adding DT_NEEDED entries.
7181 * object.h (Object::Object): Initialize new data member.
7182 (Object::dynobj): New function.
7183 (Object::set_as_needed): New function.
7184 (Object::as_needed): New function.
7185 (Object::do_dynobj): New function.
7186 (Object::as_needed_): New data member.
7188 2011-05-24 Cary Coutant <ccoutant@google.com>
7190 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7191 info; adjust display of GOT entries.
7192 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7193 vector of input objects; remove file_status_.
7194 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7195 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7196 got_plt reader; call target hooks to reserve GOT entries.
7197 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7198 of input file info header and GOT info entry.
7199 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7201 (Got_plt_view_info::got_descriptor): Remove.
7202 (Got_plt_view_info::sym_index): New data member.
7203 (Got_plt_view_info::input_index): New data member.
7204 (Local_got_offset_visitor::visit): Write input file index.
7205 (Global_got_offset_visitor::visit): Write 0 for input file index.
7206 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7207 with sym_index and input_index.
7208 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7209 incremental info GOT entry; replace got_descriptor with input_index.
7210 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7211 map from input file index to object.
7212 (Sized_relobj_incr::do_layout): Replace direct data member reference
7213 with accessor function.
7214 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7215 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7216 Adjust size of input file info header.
7217 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7218 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7219 (Incremental_input_entry_reader::get_input_section): Adjust size of
7220 input file info header.
7221 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7222 of incremental info GOT entry.
7223 (Incremental_got_plt_reader::get_got_desc): Remove.
7224 (Incremental_got_plt_reader::get_got_symndx): New function.
7225 (Incremental_got_plt_reader::get_got_input_index): New function.
7226 (Sized_incremental_binary::Sized_incremental_binary): Remove
7227 file_status_; add input_objects_.
7228 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7229 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7230 (Sized_incremental_binary::file_is_unchanged): Remove.
7231 (Sized_incremental_binary::set_input_object): New function.
7232 (Sized_incremental_binary::input_object): New function.
7233 (Sized_incremental_binary::file_status_): Remove.
7234 (Sized_incremental_binary::input_objects_): New data member.
7235 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7237 (Sized_relobj_incr::invalid_address): Move to base class.
7238 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7240 (Sized_relobj_incr::do_output_section_offset): Likewise.
7241 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7242 (Sized_relobj_incr::section_offsets_): Likewise.
7243 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7245 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7246 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7247 with accessor function.
7248 (Sized_relobj_file::do_layout): Likewise.
7249 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7250 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7251 (Sized_relobj_file::compute_final_local_value): Replace refs to
7252 section_offsets_ with accessor function.
7253 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7254 * object.h (Relobj::Relobj): Initialize new data members.
7255 (Relobj::add_dyn_reloc): New function.
7256 (Relobj::first_dyn_reloc): New function.
7257 (Relobj::dyn_reloc_count): New function.
7258 (Relobj::first_dyn_reloc_): New data member.
7259 (Relobj::dyn_reloc_count_): New data member.
7260 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7262 (Sized_relobj::Address): New typedef.
7263 (Sized_relobj::invalid_address): Move here from child class.
7264 (Sized_relobj::Sized_relobj): Initialize new data members.
7265 (Sized_relobj::sized_relobj): New function.
7266 (Sized_relobj::is_output_section_offset_invalid): Move here from
7268 (Sized_relobj::get_output_section_offset): Likewise.
7269 (Sized_relobj::local_has_got_offset): Likewise.
7270 (Sized_relobj::local_got_offset): Likewise.
7271 (Sized_relobj::set_local_got_offset): Likewise.
7272 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7273 (Sized_relobj::clear_got_offsets): New function.
7274 (Sized_relobj::section_offsets): Move here from child class.
7275 (Sized_relobj::do_output_section_offset): Likewise.
7276 (Sized_relobj::do_set_section_offset): Likewise.
7277 (Sized_relobj::Local_got_offsets): Likewise.
7278 (Sized_relobj::local_got_offsets_): Likewise.
7279 (Sized_relobj::section_offsets_): Likewise.
7280 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7282 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7284 (Sized_relobj_file::sized_relobj): New function
7285 (Sized_relobj_file::local_has_got_offset): Move to base class.
7286 (Sized_relobj_file::local_got_offset): Likewise.
7287 (Sized_relobj_file::set_local_got_offset): Likewise.
7288 (Sized_relobj_file::get_output_section_offset): Likewise.
7289 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7290 (Sized_relobj_file::do_output_section_offset): Likewise.
7291 (Sized_relobj_file::do_set_section_offset): Likewise.
7292 (Sized_relobj_file::Local_got_offsets): Likewise.
7293 (Sized_relobj_file::local_got_offsets_): Likewise.
7294 (Sized_relobj_file::section_offsets_): Likewise.
7295 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7297 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7298 (Output_reloc::get_symbol_index): Likewise.
7299 (Output_reloc::local_section_offset): Likewise.
7300 (Output_reloc::get_address): Likewise.
7301 (Output_reloc::symbol_value): Likewise.
7302 (Output_data_got::reserve_slot): Move to class definition.
7303 (Output_data_got::reserve_local): New function.
7304 (Output_data_got::reserve_slot_for_global): Remove.
7305 (Output_data_got::reserve_global): New function.
7306 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7307 (all constructors, two instantiations).
7308 (Output_reloc::get_relobj): New function (two instantiations).
7309 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7310 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7311 (Output_data_reloc::add_global): Adjust type of relobj.
7312 (Output_data_reloc::add_global_relative): Likewise.
7313 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7314 (Output_data_reloc::add_local): Likewise.
7315 (Output_data_reloc::add_local_relative): Likewise.
7316 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7317 (Output_data_reloc::add_local_section): Likewise.
7318 (Output_data_reloc::add_output_section): Likewise.
7319 (Output_data_reloc::add_absolute): Likewise.
7320 (Output_data_reloc::add_target_specific): Likewise.
7321 (Output_data_got::reserve_slot): Move definition here.
7322 (Output_data_got::reserve_local): New function.
7323 (Output_data_got::reserve_global): New function.
7324 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7325 section_offsets_ with accessor function.
7326 (Sized_relobj_file::write_sections): Likewise.
7327 (Sized_relobj_file::do_relocate_sections): Likewise.
7328 * target.h (Sized_target::reserve_local_got_entry): New function.
7329 (Sized_target::reserve_global_got_entry): New function.
7330 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7331 (Target_x86_64::reserve_global_got_entry): New function.
7332 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7334 2011-05-23 Cary Coutant <ccoutant@google.com>
7336 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7337 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7338 bit when checking got_type.
7339 * incremental.cc (Sized_incremental_binary::setup_readers):
7340 Store symbol table and string table locations; initialize bit vector
7341 of file status flags.
7342 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7344 (Sized_incremental_binary::do_process_got_plt): New function.
7345 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7346 (Output_section_incremental_inputs::set_final_data_size): Record
7347 file index for each input file.
7348 (Output_section_incremental_inputs::write_got_plt): Store file index
7349 instead of input entry offset for each GOT entry.
7351 (Incremental_input_entry::Incremental_input_entry): Initialize new
7353 (Incremental_input_entry::set_offset): Store file index.
7354 (Incremental_input_entry::get_file_index): New function.
7355 (Incremental_input_entry::file_index_): New data member.
7356 (Incremental_binary::process_got_plt): New function.
7357 (Incremental_binary::do_process_got_plt): New function.
7358 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7360 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7361 (Sized_incremental_binary::set_file_is_unchanged): New function.
7362 (Sized_incremental_binary::file_is_unchanged): New function.
7363 (Sized_incremental_binary::do_process_got_plt): New function.
7364 (Sized_incremental_binary::file_status_): New data member.
7365 (Sized_incremental_binary::main_symtab_loc_): New data member.
7366 (Sized_incremental_binary::main_strtab_loc_): New data member.
7367 * output.cc (Output_data_got::Got_entry::write): Add case
7369 (Output_data_got::add_global): Call add_got_entry.
7370 (Output_data_got::add_global_plt): Likewise.
7371 (Output_data_got::add_global_with_rel): Likewise.
7372 (Output_data_got::add_global_with_rela): Likewise.
7373 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7374 (Output_data_got::add_global_pair_with_rela): Likewise.
7375 (Output_data_got::add_local): Call add_got_entry.
7376 (Output_data_got::add_local_plt): Likewise.
7377 (Output_data_got::add_local_with_rel): Likewise.
7378 (Output_data_got::add_local_with_rela): Likewise.
7379 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7380 (Output_data_got::add_local_pair_with_rela): Likewise.
7381 (Output_data_got::reserve_slot): New function.
7382 (Output_data_got::reserve_slot_for_global): New function.
7383 (Output_data_got::add_got_entry): New function.
7384 (Output_data_got::add_got_entry_pair): New function.
7385 (Output_section::add_output_section_data): Edit FIXME.
7387 (Output_section_data_build::Output_section_data_build): New
7388 constructor with size parameter.
7389 (Output_data_space::Output_data_space): Likewise.
7390 (Output_data_got::Output_data_got): Initialize new data member; new
7391 constructor with size parameter.
7392 (Output_data_got::add_constant): Call add_got_entry.
7393 (Output_data_got::reserve_slot): New function.
7394 (Output_data_got::reserve_slot_for_global): New function.
7395 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7396 (Output_data_got::add_got_entry): New function.
7397 (Output_data_got::add_got_entry_pair): New function.
7398 (Output_data_got::free_list_): New data member.
7399 * target.h (Sized_target::init_got_plt_for_update): New function.
7400 (Sized_target::register_global_plt_entry): New function.
7401 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7402 Initialize new data member; call init; add constructor with PLT count.
7403 (Output_data_plt_x86_64::init): New function.
7404 (Output_data_plt_x86_64::add_relocation): New function.
7405 (Output_data_plt_x86_64::reserve_slot): New function.
7406 (Output_data_plt_x86_64::free_list_): New data member.
7407 (Target_x86_64::init_got_plt_for_update): New function.
7408 (Target_x86_64::register_global_plt_entry): New function.
7409 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7410 incremental updates.
7411 (Output_data_plt_x86_64::add_relocation): New function.
7412 * testsuite/object_unittest.cc (Object_test): Set default options.
7414 2011-05-16 Ian Lance Taylor <iant@google.com>
7416 * options.h (class General_options): Make -i a synonym for -r.
7418 2011-05-16 Ian Lance Taylor <iant@google.com>
7420 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7422 2011-05-10 Cary Coutant <ccoutant@google.com>
7424 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7427 2011-05-06 Ian Lance Taylor <iant@google.com>
7429 * layout.cc (Layout::layout): If the output section flags change,
7430 update the ordering.
7432 2011-04-25 Cary Coutant <ccoutant@google.com>
7434 * incremental-dump.cc (dump_incremental_inputs): Print local
7435 symbol info for each input file.
7437 (Output_section_incremental_inputs::set_final_data_size): Add local
7438 symbol info to input file entries in incremental info.
7439 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7440 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7441 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7442 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7444 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7445 (Sized_incr_relobj::do_relocate): Write the local symbols.
7446 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7447 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7448 Adjust size of input file header.
7449 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7450 (Incremental_inputs_reader::get_local_symbol_count): New function.
7451 (Incremental_inputs_reader::get_input_section): Adjust size of input
7453 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7454 (Sized_incr_relobj::This): New typedef.
7455 (Sized_incr_relobj::sym_size): New const data member.
7456 (Sized_incr_relobj::Local_symbol): New struct.
7457 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7458 (Sized_incr_relobj::do_local_symbol_offset): New function.
7459 (Sized_incr_relobj::local_symbol_count_): New data member.
7460 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7461 (Sized_incr_relobj::local_symbol_index_): New data member.
7462 (Sized_incr_relobj::local_symbol_offset_): New data member.
7463 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7464 (Sized_incr_relobj::local_symbols_): New data member.
7465 * object.h (Relobj::output_local_symbol_count): New function.
7466 (Relobj::local_symbol_offset): New function.
7467 (Relobj::do_output_local_symbol_count): New function.
7468 (Relobj::do_local_symbol_offset): New function.
7469 (Sized_relobj::do_output_local_symbol_count): New function.
7470 (Sized_relobj::do_local_symbol_offset): New function.
7472 2011-04-22 Vladimir Simonov <sv@sw.ru>
7474 * descriptors.cc (set_close_on_exec): New function.
7475 (Descriptors::open): Use set_close_on_exec.
7476 * output.cc (S_ISLNK): Define if not defined.
7478 2011-04-22 Cary Coutant <ccoutant@google.com>
7480 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7482 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7483 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7484 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7486 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7487 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7488 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7490 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7492 (Incremental_binary::apply_incremental_relocs): New function.
7493 (Incremental_binary::do_apply_incremental_relocs): New function.
7494 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7496 (Sized_incremental_binary::add_global_symbol): New function.
7497 (Sized_incremental_binary::global_symbol): New function.
7498 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7499 (Sized_incremental_binary::symbol_map_): New data member.
7500 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7501 * target.h (Sized_target::apply_relocation): New function.
7502 * target-reloc.h (apply_relocation): New function.
7503 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7505 2011-04-22 Doug Kwan <dougkwan@google.com>
7507 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7508 flag of a SHT_ARM_EXIDX section.
7509 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7510 * testsuite/Makefile.in: Regenerate.
7511 * testsuite/arm_exidx_test.s: New file.
7512 * testsuite/arm_exidx_test.sh: Same.
7514 2011-04-20 Cary Coutant <ccoutant@google.com>
7517 * archive.h (Incremental_archive_entry::Archive_member):
7518 Initialize arg_serial_ (second constructor).
7520 2011-04-17 Ian Lance Taylor <iant@google.com>
7522 * object.cc (Relocate_info::location): Simplify location string.
7523 * errors.cc (Errors::error_at_location): Don't print program
7525 (Errors::warning_at_location): Likewise.
7526 (Errors::undefined_symbol): Likewise.
7527 * testsuite/debug_msg.sh: Update accordingly.
7529 2011-04-14 Cary Coutant <ccoutant@google.com>
7531 * gold/layout.cc (Layout::symtab_section_offset): New function.
7532 * gold/layout.h (Layout::symtab_section_offset): New function.
7533 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7535 2011-04-12 Ian Lance Taylor <iant@google.com>
7537 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7538 with MREMAP_MAYMOVE.
7539 * output.h (class Output_file): Add map_is_allocated_ field.
7540 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7541 not available, provide stubs. If mremap is not available, #define
7543 (MREMAP_MAYMOVE): Define if not defined.
7544 (Output_file::Output_file): Initialize map_is_allocated_.
7545 (Output_file::resize): Check map_is_allocated_.
7546 (Output_file::map_anonymous): If mmap fails, use malloc.
7547 (Output_file::unmap): Don't do anything for an anonymous map.
7548 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7549 is not available, provide stubs.
7550 (File_read::View::~View): Use free rather than delete[].
7551 (File_read::make_view): Use malloc rather than new[]. If mmap
7553 (File_read::find_or_make_view): Use malloc rather than new[].
7554 * gold.h: Remove HAVE_REMAP code.
7555 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7556 exists. Rename mremap to gold_mremap. If mmap is not available
7558 * configure, config.in: Rebuild.
7560 2011-04-11 Ian Lance Taylor <iant@google.com>
7562 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7563 initialize local variable v.
7565 2011-04-11 Cary Coutant <ccoutant@google.com>
7567 * archive.cc (Archive::include_member): Adjust call to
7569 (Add_archive_symbols::run): Track argument serial numbers.
7570 (Lib_group::include_member): Likewise.
7571 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7572 * archive.h (Incremental_archive_entry::Archive_member):
7573 Initialize arg_serial_.
7574 (Archive_member::arg_serial_): New data member.
7575 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7576 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7578 (Sized_dynobj::do_for_all_local_got_entries): New function.
7579 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7581 * fileread.cc (get_mtime): New function.
7582 * fileread.h (get_mtime): New function.
7583 * gold.cc (queue_initial_tasks): Check for incremental update.
7584 (process_incremental_input): New function.
7585 (queue_middle_tasks): Don't force valid target for incremental
7587 * incremental-dump.cc (find_input_containing_global): Adjust
7588 size of symbol info entry.
7589 (dump_incremental_inputs): Dump argument serial number and
7590 in_system_directory flag; bias shndx by 1; print symbol names
7591 when dumping per-file symbol lists; use new symbol info readers.
7593 (Output_section_incremental_inputs:update_data_size): New function.
7594 (Sized_incremental_binary::setup_readers): Setup input readers
7595 for each input file; build maps for files added from libraries
7597 (Sized_incremental_binary::check_input_args): New function.
7598 (Sized_incremental_binary::do_check_inputs): Build map of argument
7599 serial numbers to input arguments.
7600 (Sized_incremental_binary::do_file_has_changed): Rename
7601 do_file_is_unchanged to this; compare file modification times.
7602 (Sized_incremental_binary::do_init_layout): New function.
7603 (Sized_incremental_binary::do_reserve_layout): New function.
7604 (Sized_incremental_binary::do_get_input_reader): Remove.
7605 (Sized_incremental_binary::get_symtab_view): New function.
7606 (Incremental_checker::can_incrementally_link_output_file): Remove.
7607 (Incremental_inputs::report_command_line): Exclude --debug options.
7608 (Incremental_inputs::report_archive_begin): Add parameter; track
7609 argument serial numbers; don't put input file entry for archive
7610 before archive members.
7611 (Incremental_inputs::report_archive_end): Put input file entry
7612 for archive after archive members.
7613 (Incremental_inputs::report_object): Add parameter; track argument
7614 serial numbers and in_system_directory flag.
7615 (Incremental_inputs::report_script): Add parameter; track argument
7617 (Output_section_incremental_inputs::set_final_data_size): Adjust
7618 size of symbol info entry; check for forwarding symbols.
7619 (Output_section_incremental_inputs::write_input_files): Write
7620 in_system_directory flag and argument serial number.
7621 (Output_section_incremental_inputs::write_info_blocks): Map section
7622 indices between incremental info and original input file; store
7623 input section index for each symbol.
7624 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7625 change operator() to visit().
7626 (class Global_got_offset_visitor): Likewise.
7627 (class Global_symbol_visitor_got_plt):
7628 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7630 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7631 (Sized_incr_relobj::do_read_symbols): New function.
7632 (Sized_incr_relobj::do_layout): New function.
7633 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7634 (Sized_incr_relobj::do_add_symbols): New function.
7635 (Sized_incr_relobj::do_should_include_member): New function.
7636 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7637 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7638 (Sized_incr_relobj::do_section_size): New function.
7639 (Sized_incr_relobj::do_section_name): New function.
7640 (Sized_incr_relobj::do_section_contents): New function.
7641 (Sized_incr_relobj::do_section_flags): New function.
7642 (Sized_incr_relobj::do_section_entsize): New function.
7643 (Sized_incr_relobj::do_section_address): New function.
7644 (Sized_incr_relobj::do_section_type): New function.
7645 (Sized_incr_relobj::do_section_link): New function.
7646 (Sized_incr_relobj::do_section_info): New function.
7647 (Sized_incr_relobj::do_section_addralign): New function.
7648 (Sized_incr_relobj::do_initialize_xindex): New function.
7649 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7650 (Sized_incr_relobj::do_read_relocs): New function.
7651 (Sized_incr_relobj::do_gc_process_relocs): New function.
7652 (Sized_incr_relobj::do_scan_relocs): New function.
7653 (Sized_incr_relobj::do_count_local_symbols): New function.
7654 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7655 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7656 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7657 (Sized_incr_relobj::do_relocate): New function.
7658 (Sized_incr_relobj::do_set_section_offset): New function.
7659 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7660 (Sized_incr_dynobj::do_read_symbols): New function.
7661 (Sized_incr_dynobj::do_layout): New function.
7662 (Sized_incr_dynobj::do_add_symbols): New function.
7663 (Sized_incr_dynobj::do_should_include_member): New function.
7664 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7665 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7666 (Sized_incr_dynobj::do_section_size): New function.
7667 (Sized_incr_dynobj::do_section_name): New function.
7668 (Sized_incr_dynobj::do_section_contents): New function.
7669 (Sized_incr_dynobj::do_section_flags): New function.
7670 (Sized_incr_dynobj::do_section_entsize): New function.
7671 (Sized_incr_dynobj::do_section_address): New function.
7672 (Sized_incr_dynobj::do_section_type): New function.
7673 (Sized_incr_dynobj::do_section_link): New function.
7674 (Sized_incr_dynobj::do_section_info): New function.
7675 (Sized_incr_dynobj::do_section_addralign): New function.
7676 (Sized_incr_dynobj::do_initialize_xindex): New function.
7677 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7678 (make_sized_incremental_object): New function.
7679 (Incremental_library::copy_unused_symbols): New function.
7680 (Incremental_library::do_for_all_unused_symbols): New function.
7681 * incremental.h (enum Incremental_input_flags): New type.
7682 (class Incremental_checker): Remove.
7683 (Incremental_input_entry::Incremental_input_entry): Add argument
7685 (Incremental_input_entry::arg_serial): New function.
7686 (Incremental_input_entry::set_is_in_system_directory): New function.
7687 (Incremental_input_entry::is_in_system_directory): New function.
7688 (Incremental_input_entry::arg_serial_): New data member.
7689 (Incremental_input_entry::is_in_system_directory_): New data member.
7690 (class Script_info): Move here from script.h.
7691 (Script_info::Script_info): Add filename parameter.
7692 (Script_info::filename): New function.
7693 (Script_info::filename_): New data member.
7694 (Incremental_script_entry::Incremental_script_entry): Add argument
7696 (Incremental_object_entry::Incremental_object_entry): Likewise.
7697 (Incremental_object_entry::add_input_section): Build list of input
7698 sections with map to original shndx.
7699 (Incremental_object_entry::get_input_section_index): New function.
7700 (Incremental_object_entry::shndx_): New data member.
7701 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7702 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7703 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7705 (Incremental_inputs::report_archive_begin): Likewise.
7706 (Incremental_inputs::report_object): Likewise.
7707 (Incremental_inputs::report_script): Likewise.
7708 (class Incremental_global_symbol_reader): New class.
7709 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7710 and store flags and input file type.
7711 (Incremental_input_entry_reader::arg_serial): New function.
7712 (Incremental_input_entry_reader::type): Extract type from flags.
7713 (Incremental_input_entry_reader::is_in_system_directory): New function.
7714 (Incremental_input_entry_reader::get_input_section_count): Call
7715 accessor function for type.
7716 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7717 function for type; adjust size of global symbol entry.
7718 (Incremental_input_entry_reader::get_global_symbol_count): Call
7719 accessor function for type.
7720 (Incremental_input_entry_reader::get_object_count): Likewise.
7721 (Incremental_input_entry_reader::get_object_offset): Likewise.
7722 (Incremental_input_entry_reader::get_member_count): Likewise.
7723 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7724 (Incremental_input_entry_reader::get_member_offset): Likewise.
7725 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7726 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7727 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7728 (Incremental_input_entry_reader::get_global_symbol_reader): New
7730 (Incremental_input_entry_reader::get_output_symbol_index): New
7732 (Incremental_input_entry_reader::type_): Remove.
7733 (Incremental_input_entry_reader::flags_): New data member.
7734 (Incremental_inputs_reader::input_file_offset): New function.
7735 (Incremental_inputs_reader::input_file_index): New function.
7736 (Incremental_inputs_reader::input_file): Call input_file_offset.
7737 (Incremental_inputs_reader::input_file_at_offset): New function.
7738 (Incremental_relocs_reader::get_r_type): Reformat.
7739 (Incremental_relocs_reader::get_r_shndx): Reformat.
7740 (Incremental_relocs_reader::get_r_offset): Reformat.
7741 (Incremental_relocs_reader::data): New function.
7742 (Incremental_binary::Incremental_binary): Initialize new data members.
7743 (Incremental_binary::check_inputs): Add cmdline parameter.
7744 (Incremental_binary::file_is_unchanged): Remove.
7745 (Input_reader::arg_serial): New function.
7746 (Input_reader::get_unused_symbol_count): New function.
7747 (Input_reader::get_unused_symbol): New function.
7748 (Input_reader::do_arg_serial): New function.
7749 (Input_reader::do_get_unused_symbol_count): New function.
7750 (Input_reader::do_get_unused_symbol): New function.
7751 (Incremental_binary::input_file_count): New function.
7752 (Incremental_binary::get_input_reader): Change signature to use
7753 index instead of filename.
7754 (Incremental_binary::file_has_changed): New function.
7755 (Incremental_binary::get_input_argument): New function.
7756 (Incremental_binary::get_library): New function.
7757 (Incremental_binary::get_script_info): New function.
7758 (Incremental_binary::init_layout): New function.
7759 (Incremental_binary::reserve_layout): New function.
7760 (Incremental_binary::output_file): New function.
7761 (Incremental_binary::do_check_inputs): New function.
7762 (Incremental_binary::do_file_is_unchanged): Remove.
7763 (Incremental_binary::do_file_has_changed): New function.
7764 (Incremental_binary::do_init_layout): New function.
7765 (Incremental_binary::do_reserve_layout): New function.
7766 (Incremental_binary::do_input_file_count): New function.
7767 (Incremental_binary::do_get_input_reader): Change signature.
7768 (Incremental_binary::input_args_map_): New data member.
7769 (Incremental_binary::library_map_): New data member.
7770 (Incremental_binary::script_map_): New data member.
7771 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7773 (Sized_incremental_binary::output_section): New function.
7774 (Sized_incremental_binary::inputs_reader): Add const.
7775 (Sized_incremental_binary::symtab_reader): Add const.
7776 (Sized_incremental_binary::relocs_reader): Add const.
7777 (Sized_incremental_binary::got_plt_reader): Add const.
7778 (Sized_incremental_binary::get_symtab_view): New function.
7779 (Sized_incremental_binary::Inputs_reader): New typedef.
7780 (Sized_incremental_binary::Input_entry_reader): New typedef.
7781 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7782 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7783 (Sized_incremental_binary::do_file_has_changed): New function.
7784 (Sized_incremental_binary::do_init_layout): New function.
7785 (Sized_incremental_binary::do_reserve_layout): New function.
7786 (Sized_input_reader::Inputs_reader): Remove.
7787 (Sized_input_reader::Input_entry_reader): Remove.
7788 (Sized_input_reader::do_arg_serial): New function.
7789 (Sized_input_reader::do_get_unused_symbol_count): New function.
7790 (Sized_input_reader::do_get_unused_symbol): New function.
7791 (Sized_incremental_binary::do_input_file_count): New function.
7792 (Sized_incremental_binary::do_get_input_reader): Change signature;
7793 use index instead of filename.
7794 (Sized_incremental_binary::section_map_): New data member.
7795 (Sized_incremental_binary::input_entry_readers_): New data member.
7796 (class Sized_incr_relobj): New class.
7797 (class Sized_incr_dynobj): New class.
7798 (make_sized_incremental_object): New function.
7799 (class Incremental_library): New class.
7800 * layout.cc (Free_list::num_lists): New static data member.
7801 (Free_list::num_nodes): New static data member.
7802 (Free_list::num_removes): New static data member.
7803 (Free_list::num_remove_visits): New static data member.
7804 (Free_list::num_allocates): New static data member.
7805 (Free_list::num_allocate_visits): New static data member.
7806 (Free_list::init): New function.
7807 (Free_list::remove): New function.
7808 (Free_list::allocate): New function.
7809 (Free_list::dump): New function.
7810 (Free_list::print_stats): New function.
7811 (Layout_task_runner::run): Resize output file for incremental updates.
7812 (Layout::Layout): Initialize new data members.
7813 (Layout::set_incremental_base): New function.
7814 (Layout::init_fixed_output_section): New function.
7815 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7816 incremental updates.
7817 (Layout::create_gold_note): Do not create gold note section for
7818 incremental updates.
7819 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7820 for incremental updates.
7821 (Layout::set_section_offsets): For incremental updates, allocate space
7823 (Layout::create_symtab_sections): Layout with offsets relative to
7824 start of section; for incremental updates, allocate space from free
7826 (Layout::create_shdrs): For incremental updates, allocate space from
7828 (Layout::finish_dynamic_section): For incremental updates, do not
7829 check --as-needed (fixed in subsequent patch).
7830 * layout.h (class Free_list): New class.
7831 (Layout::set_incremental_base): New function.
7832 (Layout::incremental_base): New function.
7833 (Layout::init_fixed_output_section): New function.
7834 (Layout::allocate): New function.
7835 (Layout::incremental_base_): New data member.
7836 (Layout::free_list_): New data member.
7837 * main.cc (main): Print Free_list statistics.
7838 * object.cc (Relobj::finalize_incremental_relocs): Add
7839 clear_counts parameter; clear counts only when clear_counts is set.
7840 (Sized_relobj::Sized_relobj): Initialize new base class.
7841 (Sized_relobj::do_layout): Don't report special sections.
7842 (Sized_relobj::do_for_all_local_got_entries): New function.
7843 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7844 symtab_off to all symbol table offsets.
7845 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7846 * object.h (class Got_offset_list): Move to top of file.
7847 (Object::Object): Allow case where input_file == NULL.
7848 (Object::~Object): Likewise.
7849 (Object::input_file): Assert that input_file != NULL.
7850 (Object::lock): Allow case where input_file == NULL.
7851 (Object::unlock): Likewise.
7852 (Object::is_locked): Likewise.
7853 (Object::token): Likewise.
7854 (Object::release): Likewise.
7855 (Object::is_incremental): New function.
7856 (Object::get_mtime): New function.
7857 (Object::for_all_local_got_entries): New function.
7858 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7859 (Object::set_is_in_system_directory): New function.
7860 (Object::is_in_system_directory): New function.
7861 (Object::do_is_incremental): New function.
7862 (Object::do_get_mtime): New function.
7863 (Object::do_for_all_local_got_entries): New function.
7864 (Object::is_in_system_directory_): New data member.
7865 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7866 (class Sized_relobj_base): New class.
7867 (class Sized_relobj): Derive from Sized_relobj_base.
7868 (class Sized_relobj::Symbols): Redeclare from base class.
7869 (class Sized_relobj::local_got_offset_list): Remove.
7870 (class Sized_relobj::Output_sections): Redeclare from base class.
7871 (class Sized_relobj::do_for_all_local_got_entries): New function.
7872 (class Sized_relobj::write_local_symbols): Add offset parameter.
7873 (class Sized_relobj::local_symbol_offset_): Update comment.
7874 (class Sized_relobj::local_dynsym_offset_): Update comment.
7875 * options.cc (Input_arguments::add_file): Remove const.
7876 * options.h (Input_file_argument::Input_file_argument):
7877 Initialize arg_serial_ (all constructors).
7878 (Input_file_argument::set_arg_serial): New function.
7879 (Input_file_argument::arg_serial): New function.
7880 (Input_file_argument::arg_serial_): New data member.
7881 (Input_arguments::Input_arguments): Initialize file_count_.
7882 (Input_arguments::add_file): Remove const.
7883 (Input_arguments::number_of_input_files): New function.
7884 (Input_arguments::file_count_): New data member.
7885 (Command_line::number_of_input_files): Call
7886 Input_arguments::number_of_input_files.
7887 * output.cc (Output_segment_headers::Output_segment_headers):
7889 (Output_section::Input_section::current_data_size): New function.
7890 (Output_section::Output_section): Initialize new data members.
7891 (Output_section::add_input_section): Don't do merge sections for
7892 an incremental link; allocate space from free list for an
7894 (Output_section::add_output_section_data): Allocate space from
7895 free list for an incremental update.
7896 (Output_section::update_data_size): New function.
7897 (Output_section::set_fixed_layout): New function.
7898 (Output_section::reserve): New function.
7899 (Output_segment::set_section_addresses): Remove const.
7900 (Output_segment::set_section_list_addresses): Remove const; allocate
7901 space from free list for an incremental update.
7902 (Output_segment::set_offset): Adjust size of RELRO segment for an
7904 * output.h (Output_data::current_data_size): Move here from
7906 (Output_data::pre_finalize_data_size): New function.
7907 (Output_data::update_data_size): New function.
7908 (Output_section_headers::update_data_size): new function.
7909 (Output_section_data_build::current_data_size): Move to Output_data.
7910 (Output_data_strtab::update_data_size): New function.
7911 (Output_section::current_data_size): Move to Output_data.
7912 (Output_section::set_fixed_layout): New function.
7913 (Output_section::has_fixed_layout): New function.
7914 (Output_section::reserve): New function.
7915 (Output_section::update_data_size): New function.
7916 (Output_section::has_fixed_layout_): New data member.
7917 (Output_section::free_list_): New data member.
7918 (Output_segment::set_section_addresses): Remove const.
7919 (Output_segment::set_section_list_addresses): Remove const.
7920 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7922 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7924 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7925 parameter when calling Add_symbols constructor; store argument
7926 serial number for members of a lib group.
7927 (Add_symbols::locks): Allow case where token == NULL.
7928 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7929 (Read_member::~Read_member): New function.
7930 (Read_member::is_runnable): New function.
7931 (Read_member::locks): New function.
7932 (Read_member::run): New function.
7933 (Check_script::~Check_script): New function.
7934 (Check_script::is_runnable): New function.
7935 (Check_script::locks): New function.
7936 (Check_script::run): New function.
7937 (Check_library::~Check_library): New function.
7938 (Check_library::is_runnable): New function.
7939 (Check_library::locks): New function.
7940 (Check_library::run): New function.
7941 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7942 (Add_symbols::library_): New data member.
7943 (class Read_member): New class.
7944 (class Check_script): New class.
7945 (class Check_library): New class.
7946 * reloc.cc (Read_relocs::is_runnable): Allow case where
7948 (Read_relocs::locks): Likewise.
7949 (Scan_relocs::locks): Likewise.
7950 (Relocate_task::locks): Likewise.
7951 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7953 (Sized_relobj::incremental_relocs_scan): Fix comment.
7954 (Sized_relobj::do_relocate): Pass output file offset to
7955 write_local_symbols.
7956 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7957 from class declaration.
7958 * script.cc (read_input_script): Allocate Script_info; pass
7959 argument serial number to report_script.
7960 * script.h (class Script_info): Move to incremental.h.
7961 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7962 * symtab.h (Symbol_table::add_from_incrobj): New function.
7963 (Symbol_table::set_file_offset): New function.
7965 2011-04-05 Cary Coutant <ccoutant@google.com>
7967 * incremental-dump.cc (dump_incremental_inputs): Change signature
7968 to take a Sized_incremental_binary; change caller. Use readers
7969 in Sized_incremental_binary.
7971 (Sized_incremental_binary::find_incremental_inputs_sections):
7972 Rename do_find_incremental_inputs_sections to this.
7973 (Sized_incremental_binary::setup_readers): New function.
7974 (Sized_incremental_binary::do_check_inputs): Check
7975 has_incremental_info_ flag; move setup code to setup_readers;
7977 (Sized_incremental_binary::do_file_is_unchanged): New function.
7978 (Sized_incremental_binary::do_get_input_reader): New function.
7979 * incremental.h (class Incremental_binary): Move to end of file.
7980 (Incremental_binary::file_is_unchanged): New function.
7981 (Incremental_binary::do_file_is_unchanged): New function.
7982 (Incremental_binary::Input_reader): New class.
7983 (Incremental_binary::get_input_reader): New function.
7984 (class Sized_incremental_binary): Move to end of file.
7985 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7986 input section reader classes.
7987 (Sized_incremental_binary::has_incremental_info): New function.
7988 (Sized_incremental_binary::inputs_reader): New function.
7989 (Sized_incremental_binary::symtab_reader): New function.
7990 (Sized_incremental_binary::relocs_reader): New function.
7991 (Sized_incremental_binary::got_plt_reader): New function.
7992 (Sized_incremental_binary::do_file_is_unchanged): New function.
7993 (Sized_incremental_binary::Sized_input_reader): New class.
7994 (Sized_incremental_binary::get_input_reader): New function.
7995 (Sized_incremental_binary::find_incremental_inputs_sections):
7996 Rename do_find_incremental_inputs_sections to this.
7997 (Sized_incremental_binary::setup_readers): New function.
7998 (Sized_incremental_binary::has_incremental_info_): New data member.
7999 (Sized_incremental_binary::inputs_reader_): New data member.
8000 (Sized_incremental_binary::symtab_reader_): New data member.
8001 (Sized_incremental_binary::relocs_reader_): New data member.
8002 (Sized_incremental_binary::got_plt_reader_): New data member.
8003 (Sized_incremental_binary::current_input_file_): New data member.
8005 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8008 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8011 2011-03-30 Cary Coutant <ccoutant@google.com>
8013 * archive.cc (Archive::include_member): Adjust call to report_object.
8014 (Add_archive_symbols::run): Add script_info to call to
8015 report_archive_begin.
8016 (Lib_group::include_member): Adjust call to report_object.
8017 (Add_lib_group_symbols::run): Adjust call to report_object.
8018 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8019 blocks. Add object count for script input files.
8020 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8021 script_info parameter; change all callers.
8022 (Incremental_inputs::report_object): Add script_info parameter;
8024 (Incremental_inputs::report_script): Store backpointer to
8025 incremental info entry.
8026 (Output_section_incremental_inputs::set_final_data_size): Record
8027 additional information for scripts.
8028 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8029 * incremental.h (Incremental_script_entry::add_object): New function.
8030 (Incremental_script_entry::get_object_count): New function.
8031 (Incremental_script_entry::get_object): New function.
8032 (Incremental_script_entry::objects_): New data member; adjust
8034 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8035 (Incremental_inputs::report_object): Add script_info parameter.
8036 (Incremental_inputs_reader::get_object_count): New function.
8037 (Incremental_inputs_reader::get_object_offset): New function.
8038 * options.cc (Input_arguments::add_file): Return reference to
8040 * options.h (Input_argument::set_script_info): New function.
8041 (Input_argument::script_info): New function.
8042 (Input_argument::script_info_): New data member; adjust all
8044 (Input_file_group::add_file): Return reference to new input argument.
8045 (Input_file_lib::add_file): Likewise.
8046 (Input_arguments::add_file): Likewise.
8047 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8048 * script.cc (Parser_closure::Parser_closure): Add script_info
8049 parameter; adjust all callers.
8050 (Parser_closure::script_info): New function.
8051 (Parser_closure::script_info_): New data member.
8052 (read_input_script): Report scripts earlier to incremental info.
8053 (script_add_file): Set script_info in Input_argument.
8054 (script_add_library): Likewise.
8055 * script.h (Script_options::Script_info): Rewrite class.
8057 2011-03-29 Cary Coutant <ccoutant@google.com>
8059 * archive.cc (Library_base::should_include_member): Move
8060 method here from class Archive.
8061 (Archive::Archive): Initialize base class.
8062 (Archive::should_include_member): Move to base class.
8063 (Archive::do_for_all_unused_symbols): New function.
8064 (Add_archive_symbols::run): Remove redundant access to
8066 (Lib_group::Lib_group): Initialize base class.
8067 (Lib_group::do_filename): New function.
8068 (Lib_group::include_member): Pass pointer to Lib_group to
8070 (Lib_group::do_for_all_unused_symbols): New function.
8071 (Add_lib_group_symbols::run): Report archive information for
8073 * archive.h (class Library_base): New base class.
8074 (class Archive): Derive from Library_base.
8075 (Archive::filename): Move to base class.
8076 (Archive::set_incremental_info): Likewise.
8077 (Archive::incremental_info): Likewise.
8078 (Archive::Should_include): Likewise.
8079 (Archive::should_include_member): Likewise.
8080 (Archive::Armap_entry): Remove.
8081 (Archive::Unused_symbol_iterator): Remove.
8082 (Archive::unused_symbols_begin): Remove.
8083 (Archive::unused_symbols_end): Remove.
8084 (Archive::do_filename): New function.
8085 (Archive::do_get_mtime): New function.
8086 (Archive::do_for_all_unused_symbols): New function.
8087 (Archive::task_): Move to base class.
8088 (Archive::incremental_info_): Likewise.
8089 (class Lib_group): Derive from Library_base.
8090 (Lib_group::do_filename): New function.
8091 (Lib_group::do_get_mtime): New function.
8092 (Lib_group::do_for_all_unused_symbols): New function.
8093 (Lib_group::task_): Move to base class.
8094 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8096 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8098 * incremental.cc (Incremental_inputs::report_archive_begin):
8099 Use Library_base; call library's get_mtime; add incremental inputs
8100 entry before members.
8101 (class Unused_symbol_visitor): New class.
8102 (Incremental_inputs::report_archive_end): Use Library_base; use
8103 visitor class to record unused symbols; don't add incremental inputs
8104 entry after members.
8105 (Incremental_inputs::report_object): Use Library_base.
8107 (Incremental_archive_entry::Incremental_archive_entry): Remove
8108 unused Archive parameter.
8109 (Incremental_inputs::report_archive_begin): Use Library_base.
8110 (Incremental_inputs::report_archive_end): Likewise.
8111 (Incremental_inputs::report_object): Likewise.
8112 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8114 * object.h (Object::for_all_global_symbols): New function.
8115 (Object::do_for_all_global_symbols): New function.
8116 (Sized_relobj::do_for_all_global_symbols): New function.
8117 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8119 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8122 2011-03-27 Ian Lance Taylor <iant@google.com>
8124 * archive.cc (Archive::interpret_header): Return -1 if something
8125 goes wrong. Change callers accordingly.
8127 2011-03-25 Cary Coutant <ccoutant@google.com>
8129 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8130 * testsuite/Makefile.in: Regenerate.
8132 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
8134 * plugin.cc (get_view): New.
8135 (Plugin::load): Pass get_view to the plugin.
8136 (Plugin_manager::get_view): New.
8138 2011-03-21 Ian Lance Taylor <iant@google.com>
8140 * testsuite/final_layout.sh: Rewrite to not use dc.
8141 * testsuite/relro_test.sh: Fail if dc is not present.
8143 2011-03-21 Sriraman Tallam <tmsriram@google.com>
8145 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8147 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8148 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8150 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8151 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8153 2011-03-14 Ian Lance Taylor <iant@google.com>
8155 * script-sections.cc (Sort_output_sections::script_compare):
8156 Rename from is_before, change return type.
8157 (Sort_output_sections::operator()): Adjust accordingly.
8159 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8162 * testsuite/odr_violation2.cc: Add comment to make all error line
8163 numbers double digits.
8164 * testsuite/debug_msg.sh: Adjust expected errors.
8166 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8168 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8169 but mark earlier ones as non-canonical
8170 (offset_to_iterator): Update search target and example
8171 (do_addr2line): Return extra lines in a vector*
8172 (format_file_lineno): Extract from do_addr2line
8173 (one_addr2line): Add vector* out-param
8174 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8175 when a lineno entry appeared last for its instruction
8176 (Dwarf_line_info): Add vector* out-param
8177 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8178 * symtab.cc (Odr_violation_compare): Include the lineno in the
8180 (linenos_from_loc): New. Combine the canonical line for an
8181 address with its other lines.
8182 (True_if_intersect): New. Helper functor to make
8183 std::set_intersection a query.
8184 (detect_odr_violations): Compare sets of lines instead of just
8185 one line for each function. This became less deterministic, but
8186 has fewer false positives.
8187 * symtab.h: Declarations.
8188 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8189 mix an optimized and non-optimized object in the same binary
8190 (odr_violation2.so): Same.
8191 * testsuite/Makefile.in: Regenerate from Makefile.am.
8192 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8193 * testsuite/debug_msg.sh: Update line numbers and add
8195 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8196 non-optimized context.
8197 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8198 isn't inlined, and use OdrDerived in an optimized context.
8199 * testsuite/odr_header1.h: Defines OdrDerived, where
8200 optimization will change the
8201 first-instruction-in-the-destructor's file and line number.
8202 * testsuite/odr_header2.h: Defines OdrBase.
8204 2011-03-09 Ian Lance Taylor <iant@google.com>
8206 * fileread.cc (File_read::clear_views): Don't delete the whole
8209 2011-03-08 Ian Lance Taylor <iant@google.com>
8212 * fileread.cc: #include <climits>.
8213 (GOLD_IOV_MAX): Define.
8214 (File_read::read_multiple): Limit number of entries by iov_max.
8215 * fileread.h (class File_read): Always set max_readv_entries to
8218 2011-03-07 Ian Lance Taylor <iant@google.com>
8221 * options.h (class General_options): Add -dy and -dn.
8223 2011-03-02 Cary Coutant <ccoutant@google.com>
8225 * testsuite/script_test_9.t: Add TLS segment.
8227 2011-03-02 Simon Baldwin <simonb@google.com>
8229 * configure.ac: Add check for gnu_indirect_function support in
8230 the toolchain building binutils.
8231 * configure: Rebuild.
8233 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
8235 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8236 plugin only symbols.
8237 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8238 in plugin files as not needed in the symbol table.
8240 2011-02-11 Sriraman Tallam <tmsriram@google.com>
8242 * output.cc (Output_section::add_input_section): Delay fill
8243 generation for section ordering.
8245 2011-02-09 Ian Lance Taylor <iant@google.com>
8248 * object.h (class Sized_relobj): Remove clear_local_symbols.
8249 * reloc.cc (Sized_relobj::do_relocate): Don't call
8250 clear_local_symbols.
8252 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
8254 * plugin.cc (is_visible_from_outside): Return true for symbols
8257 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8259 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8262 2011-02-02 Sriraman Tallam <tmsriram@google.com>
8264 * icf.h (is_section_foldable_candidate): Change type of parameter
8266 * icf.cc (Icf::find_identical_sections): Change type of local variable
8267 section_name to be std::string.
8268 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8270 2011-01-25 Ian Lance Taylor <iant@google.com>
8272 * script.cc (script_add_extern): Rewrite to use
8273 add_symbol_reference.
8275 2011-01-25 Doug Kwan <dougkwan@google.com>
8277 * icf.cc (get_section_contents): Always lock section's object.
8279 2011-01-24 Ian Lance Taylor <iant@google.com>
8281 * options.h (class General_options): Accept
8282 --no-detect-odr-violations.
8284 2011-01-24 Ian Lance Taylor <iant@google.com>
8286 * version.cc (version_string): Bump to 1.11.
8288 2011-01-24 Ian Lance Taylor <iant@google.com>
8290 * plugin.cc (class Plugin_rescan): Define new class.
8291 (Plugin_manager::claim_file): Set any_claimed_.
8292 (Plugin_manager::save_archive): New function.
8293 (Plugin_manager::save_input_group): New function.
8294 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8296 (Plugin_manager::new_undefined_symbol): New function.
8297 (Plugin_manager::rescan): New function.
8298 (Plugin_manager::rescannable_defines): New function.
8299 (Plugin_manager::add_input_file): Set any_added_.
8300 * plugin.h (class Plugin_manager): define new fields rescannable_,
8301 undefined_symbols_, any_claimed_, and any_added_. Declare
8302 Plugin_rescan as friend. Declare new functions.
8303 (Plugin_manager::Rescannable): Define type.
8304 (Plugin_manager::Rescannable_list): Define type.
8305 (Plugin_manager::Undefined_symbol_list): Define type.
8306 (Plugin_manager::Plugin_manager): Initialize new fields.
8307 * archive.cc (Archive::defines_symbol): New function.
8308 (Add_archive_symbols::run): Pass archive to plugins if any.
8309 * archive.h (class Archive): Declare defines_symbol.
8310 * readsyms.cc (Input_group::~Input_group): New function.
8311 (Finish_group::run): Pass input_group to plugins if any.
8312 * readsyms.h (class Input_group): Declare destructor.
8313 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8316 2011-01-10 Ian Lance Taylor <iant@google.com>
8318 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8320 (Layout::set_segment_offsets): Reset increase_relro before calling
8321 set_section_addresses a second time.
8323 2011-01-04 Cary Coutant <ccoutant@google.com>
8325 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8326 sections before NOBITS sections.
8328 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8330 * version.cc (print_version): Update copyright to 2011.
8332 2010-12-23 Cary Coutant <ccoutant@google.com>
8334 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8335 of OS to this->add. Add OD parameter to second form of the function.
8337 2010-12-20 Ian Lance Taylor <iant@google.com>
8339 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8340 second of two consecutive entries with same offset.
8342 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8344 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8345 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8346 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8347 to avoid unneeded links against $(LDADD).
8348 * testsuite/Makefile.in: Regenerate.
8350 2010-12-15 Ian Lance Taylor <iant@google.com>
8353 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8354 for R_X86_64_32 and R_X86_64_PC32.
8355 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8356 ver_matching_def_pic.o.
8357 (ver_matching_def_pic.o): New target.
8359 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8361 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8362 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8363 Move definition before File_read::View member definitions.
8364 (File_read::View::~View): Initialize and hold lock before
8365 updating current_mapped_bytes.
8367 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8369 * dwarf_reader.cc: Remove outdated comment.
8370 * gold-threads.cc: Fix typo in error message.
8371 * archive.cc: Fix typos in comments.
8372 * archive.h: Likewise.
8373 * arm-reloc-property.cc: Likewise.
8374 * arm-reloc-property.h: Likewise.
8375 * arm-reloc.def: Likewise.
8377 * attributes.h: Likewise.
8378 * cref.cc: Likewise.
8379 * ehframe.cc: Likewise.
8380 * fileread.h: Likewise.
8382 * i386.cc: Likewise.
8384 * incremental.h: Likewise.
8385 * int_encoding.cc: Likewise.
8386 * layout.h: Likewise.
8387 * main.cc: Likewise.
8388 * merge.h: Likewise.
8389 * object.cc: Likewise.
8390 * object.h: Likewise.
8391 * options.cc: Likewise.
8392 * readsyms.cc: Likewise.
8393 * reduced_debug_output.cc: Likewise.
8394 * reloc.cc: Likewise.
8395 * script-sections.cc: Likewise.
8396 * sparc.cc: Likewise.
8397 * symtab.h: Likewise.
8398 * target-reloc.h: Likewise.
8399 * target.cc: Likewise.
8400 * target.h: Likewise.
8401 * timer.cc: Likewise.
8402 * timer.h: Likewise.
8403 * x86_64.cc: Likewise.
8405 2010-12-09 Cary Coutant <ccoutant@google.com>
8407 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8409 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8410 parameter; change all callers.
8411 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8412 * options.h (warn_execstack): New option.
8414 2010-12-07 Doug Kwan <dougkwan@google.com>
8416 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8417 like function call relocations.
8419 2010-12-07 Ian Lance Taylor <iant@google.com>
8421 * archive.cc (Archive::get_elf_object_for_member): Permit
8422 punconfigured to be NULL.
8423 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8424 (Archive::include_member): Pass NULL to get_elf_object_for_member
8425 if we searched for the archive and this is the first included
8428 2010-12-01 Ian Lance Taylor <iant@google.com>
8430 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8431 track_relocs_type_ field.
8432 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8433 Set track_relocs_type_.
8434 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8435 contents when using RELA relocs.
8436 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8438 * reloc.cc (Track_relocs::next_addend): New function.
8439 * reloc.h (class Track_relocs): Declare next_addend.
8441 2010-12-01 Ian Lance Taylor <iant@google.com>
8443 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8446 2010-12-01 Ian Lance Taylor <iant@google.com>
8448 * README: Update compilers known to work and fail.
8450 2010-11-23 Matthias Klose <doko@ubuntu.com>
8452 * configure.in: For --enable-gold, handle value `default' instead of
8453 `both*'. Always install ld as ld.bfd, install as ld if gold is
8455 * configure: Regenerate.
8457 2010-11-18 Doug Kwan <dougkwan@google.com>
8459 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8460 and right_alignment to be zero. Store result alignment only if it is
8461 greater than existing alignment.
8463 2010-11-16 Cary Coutant <ccoutant@google.com>
8466 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8467 Check for ".zdebug_line".
8469 2010-11-16 Doug Kwan <dougkwan@google.com>
8470 Cary Coutant <ccoutant@google.com>
8472 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8473 by reference; adjust all callers.
8474 * output.cc (Output_segment::set_section_addresses): Adjust references
8475 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8477 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8478 end at page boundary.
8480 2010-11-16 Cary Coutant <ccoutant@google.com>
8483 * layout.cc (Layout::choose_output_section): Transform names of
8484 compressed sections even when using a script with a SECTIONS clause.
8485 (Layout::output_section_name): Remove code to transform
8486 compressed debug section names.
8487 * output.cc (Output_section::add_input_section): Use uncompressed
8488 section size when tracking input sections.
8490 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8492 * symtab.h (Symbol::NON_PIC_REF): Remove.
8493 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8494 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8495 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8496 (Symbol::use_plt_offset): Take a flags argument and pass it
8497 directly to needs_dynamic_reloc. Restrict check for undefined
8498 weak symbols to function calls.
8499 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8500 (Target_arm::Scan::global): Use it.
8501 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8502 (Target_arm::Relocate::relocate): Likewise.
8503 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8504 parameter with an r_type parameter. Use get_reference_flags
8506 (Target_arm::Relocate::relocate): Update accordingly.
8507 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8508 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8509 (Target_i386::Scan::global): Likewise.
8510 (Target_i386::Relocate::relocate): Likewise.
8511 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8512 parameter with an r_type parameter. Use get_reference_flags
8514 (Target_i386::Relocate::relocate): Update accordingly.
8515 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8516 (Target_powerpc::Scan::global): Use it.
8517 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8518 (Target_powerpc::Relocate::relocate): Likewise.
8519 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8520 (Target_sparc::Scan::global): Use it.
8521 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8522 (Target_sparc::Relocate::relocate): Likewise.
8523 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8524 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8525 (Target_x86_64::Scan::global): Likewise.
8526 (Target_x86_64::Relocate::relocate): Likewise.
8528 2010-11-08 Doug Kwan <dougkwan@google.com>
8529 Cary Coutant <ccoutant@google.com>
8531 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8532 (Arm_exidx_merge_section::section_contents_): New data member.
8533 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8534 (Arm_input_section::~Arm_input_section): De-allocate memory.
8535 (Arm_input_section::original_contents_): New data member.
8536 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8537 in parameters instead of calling Object::section_contents without
8539 (Arm_output_section::group_section): New parameter TASK. Pass it
8540 to callees that need locking objects.
8541 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8542 to lock EXIDX input sections. Fix a formatting issue. Call
8543 Arm_exidx_merged_section::build_contents to create merged section
8545 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8546 to lock object of stub table owner.
8547 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8548 TEXT_SIZE to initialize data member TEXT_SIZE_.
8549 (Arm_exidx_input_section::addralign): Fix typo in comment.
8550 (Arm_exidx_input_section::text_size): New method.
8551 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8552 that require locking objects. Lock objects before scanning for stubs
8553 and updating local symbols.
8554 (Arm_input_section<big_endian>::init): Copy contents of original
8556 (Arm_input_section<big_endian>::do_write): Use saved contents of
8557 original input section instead of calling Object::section_contents
8559 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8560 size without calling Object::section_size().
8561 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8562 for size. Allocate a buffer for merged EXIDX entries.
8563 (Arm_exidx_merged_section::build_contents): New method.
8564 (Arm_exidx_merged_section::do_write): Move merge section contents
8565 building code to Arm_exidx_merged_section::build_contetns. Write
8566 out contetns in buffer instead of building it on the fly.
8567 (Arm_relobj::make_exidx_input_section): Also pass text section size
8568 to Arm_exidx_input_section constructor.
8569 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8570 (Arm_dynobj::do_read_symbols): Fix memory leak.
8571 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8572 * target.h: (class Task): Add forward declaration.
8573 (Target::relax): Add new parameter TASK and pass it to
8575 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8577 2010-11-05 Cary Coutant <ccoutant@google.com>
8580 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8581 object when reading from the file.
8582 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8584 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8585 when reading section contents.
8586 (get_section_contents): Likewise.
8587 (icf::find_identical_sections): Likewise.
8588 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8589 object when reading from the file.
8590 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8591 the object when doing deferred section layout.
8593 2010-11-03 Nick Clifton <nickc@redhat.com>
8596 * script.h (class Symbol_assignment: name): New member. Returns
8597 the name of the symbol.
8598 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8599 Returns true if the given symbol name is on the list of
8600 assignments wating to be processed.
8601 * archive.cc (should_incldue_member): If the symbol is undefined,
8602 check to see if it is on the list of symbols pending assignment.
8604 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8606 * script-sections.cc (Script_sections::find_memory_region): Check
8607 for a NULL output section pointer.
8609 2010-10-29 Doug Kwan <dougkwan@google.com>
8611 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8612 Output_section::add_relaxed_input_section.
8613 * output.cc (Output_section::add_relaxed_input_section): Add new
8614 arguments LAYOUT and NAME. Set section order index.
8615 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8616 Copy section order index.
8617 * output.h (Output_section::add_relaxed_input_section): Add new
8618 arguments LAYOUT and NAME.
8620 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8622 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8623 NATIVE_OR_CROSS_LINKER.
8624 * testsuite/Makefile.in: Regenerate.
8626 2010-10-20 Doug Kwan <dougkwan@google.com>
8628 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8629 without SHF_LINK_ORDER flags.
8630 * layout.cc (Layout::choose_output_section): Do not filter
8631 SHF_LINK_ORDER flag in a relocatable link.
8633 2010-10-17 Cary Coutant <ccoutant@google.com>
8635 * output.h (Output_segment::set_section_addresses): Change function
8636 signature. Update all callers.
8637 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8639 (Output_segment::set_section_addresses): Align after last TLS
8640 section. Add padding before last relro section instead of after.
8642 2010-10-17 Doug Kwan <dougkwan@google.com>
8644 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8645 GOT output section to be writable.
8647 2010-10-14 Cary Coutant <ccoutant@google.com>
8649 * debug.h (DEBUG_INCREMENTAL): New flag.
8650 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8651 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8653 * incremental.cc (report_command_line): Ignore all forms of
8655 * layout.cc (Layout::Layout): Check parameters for incremental link
8657 * options.cc (General_options::parse_incremental): New function.
8658 (General_options::parse_no_incremental): New function.
8659 (General_options::parse_incremental_full): New function.
8660 (General_options::parse_incremental_update): New function.
8661 (General_options::incremental_mode_): New data member.
8662 (General_options::finalize): Check incremental_mode_.
8663 * options.h (General_options): Update help text for --incremental.
8664 Add --no-incremental, --incremental-full, --incremental-update.
8665 (General_options::Incremental_mode): New enum type.
8666 (General_options::incremental_mode): New function.
8667 (General_options::incremental_mode_): New data member.
8668 * parameters.cc (Parameters::incremental_mode_): New data member.
8669 (Parameters::set_options): Set incremental_mode_.
8670 (Parameters::set_incremental_full): New function.
8671 (Parameters::incremental): New function.
8672 (Parameters::incremental_update): New function.
8673 (set_parameters_incremental_full): New function.
8674 * parameters.h (Parameters::set_incremental_full): New function.
8675 (Parameters::incremental): New function.
8676 (Parameters::incremental_update): New function.
8677 (Parameters::incremental_mode_): New data member.
8678 (set_parameters_incremental_full): New function.
8679 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8680 incremental link mode.
8681 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8682 (Sized_relobj::do_relocate_sections): Likewise.
8683 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8685 * testsuite/Makefile.in: Regenerate.
8686 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8688 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8690 * script-sections.h (class Script_sections): Make
8691 Sections_elements typedef public.
8692 * script-sections.cc (class Sort_output_sections): Add elements_
8693 field. Add constructor which sets it; change all callers.
8694 (Sort_output_sections::is_before): New function.
8695 (Sort_output_sections::operator()): Call is_before.
8696 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8698 * testsuite/script_test_10.sh: New test. Test script section
8700 * testsuite/script_test_10.t: Likewise.
8701 * testsuite/script_test_10.s: Likewise.
8702 * testsuite/Makefile.am: Wrap the cross linker tests and the
8703 common tests into NATIVE_OR_CROSS_LINKER.
8704 (check_SCRIPTS): Add script_test_10.sh.
8705 (check_DATA): Add script_test_10.stdout.
8706 (script_test_10.o, script_test_10): New targets.
8707 (script_test_10.stdout): New target.
8708 * configure, testsuite/Makefile.in: Regenerate.
8710 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8712 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8713 error for the deprecated relocations.
8714 (Target_arm::Scan::global): Likewise.
8715 (Target_arm::Relocate::relocate): Likewise.
8717 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8719 * fileread.cc (Input_file::find_file): Initialize *found_name
8720 and *namep when using the fallback search for case 4.
8722 2010-10-11 Cary Coutant <ccoutant@google.com>
8724 * options.h (class General_options): Redefine -z lazy as an alias for
8725 the negation of -z now.
8727 2010-10-11 Ian Lance Taylor <iant@google.com>
8729 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8732 2010-10-06 Nick Clifton <nickc@redhat.com>
8734 * script-sections.cc(class Memory_region): Remove
8735 current_lma_offset_ field. Rename current_vma_offset_ to
8736 current_offset_. Add last_section_ field.
8737 (Memory_region::get_current_vma_address): Rename to
8738 get_current_address.
8739 (Memory_region::get_current_lma_address): Delete.
8740 (Memory_region::increment_vma_offset): Rename to
8742 (Memory_region::increment_lma_offset): Delete.
8743 (Memory_region::attributes_compatible): New method. Returns
8744 true if the provided section is compatible with the region.
8745 (Memory_region::get_last_section): New method. Returns the last
8746 section to use the region.
8747 (Memory_region::set_last_section): New method. Stores the last
8748 section to use the region.
8749 (Script_sections::block_in_region): New method. Returns true if
8750 a block of memory is contained within a region.
8751 (Script_sections::find_memory_region): New method. Locates a
8752 memory region to be used to set a VMA or LMA address.
8753 (Output_section_definition::set_section_addresses): Add code to
8754 check for addresses set by memory regions.
8755 (Output_segment::set_section_addresses): Remove memory region
8757 (Script_sections::create_segment): Add a warning if a header
8758 segment is created outside of any region.
8759 * script-sections.h (class Script_sections): Add prototypes for
8760 find_memory_region and block_in_region methods.
8761 * testsuite/memory_test.s: Use .long instead of .word.
8762 * testsuite/memory_test.t: Add some more output sections.
8763 * testsuite/memory_test.sh: Update expected output.
8765 2010-10-02 Doug Kwan <dougkwan@google.com>
8767 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8768 defintion to symtab.h
8769 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8770 declaration to defintion.
8772 2010-10-01 Nick Clifton <nickc@redhat.com>
8774 * expression.cc (eval): Replace dummy argument with NULL.
8775 (eval_maybe_dot): Check for a NULL result section pointer.
8776 (Symbol_expression::value): Likewise.
8777 (Dot_expression::value): Likewise.
8778 (BINARY_EXPRESSION): Likewise.
8779 (Max_expression::value): Likewise.
8780 (Min_expression::value): Likewise.
8781 (Absolute_expression::value): Likewise.
8782 (Addr_expression::value_from_output_section): Likewise.
8783 (Loaddddr_expression::value_from_output_section): Likewise.
8784 (Segment_start_expression::value): Likewise.
8785 * script-sections.cc
8786 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8788 (Sections_elememt_dot_assignment::set_section_addresses):
8790 (Output_data_expression::do_write_to_buffer): Likewise.
8791 (Output_section_definition::finalize_symbols): Likewise.
8792 (Output_section_definition::set_section_addresses): Likewise.
8794 2010-09-30 Doug Kwan <dougkwan@google.com>
8796 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8798 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8800 * target.h (Target::can_icf_inline_merge_sections): New virtual
8802 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8804 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8806 * icf.cc (get_section_contents): Inline merge sections only when
8809 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8811 * configure: Regenerate.
8813 2010-09-17 Ian Lance Taylor <iant@google.com>
8815 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8816 * testsuite/Makefile.am (memory_test.o): New target.
8817 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8819 * testsuite/Makefile.in: Rebuild.
8821 2010-09-17 Doug Kwan <dougkwan@google.com>
8823 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8824 defintion if relocation uses GOT entries of the symbol.
8825 * testsuite/icf_safe_test.sh: Fix test.
8826 * testsuite/icf_safe_so_test.sh: Fix test.
8828 2010-09-16 Cary Coutant <ccoutant@google.com>
8830 * script_sections.cc (class Memory_region): Remove "NULL" from
8831 vector initializations.
8833 2010-09-15 Cary Coutant <ccoutant@google.com>
8835 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8836 Resolve forwarding symbols.
8838 2010-09-15 Doug Kwan <dougkwan@google.com>
8840 * gold/testsuite/script_test_3.t: Add ARM special sections.
8841 * gold/testsuite/script_test_4.t: Same.
8842 * gold/testsuite/script_test_5.t: Same.
8843 * gold/testsuite/script_test_6.t: Same.
8844 * gold/testsuite/script_test_7.t: Same.
8845 * gold/testsuite/script_test_7.t: Same.
8846 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8848 2010-09-14 Cary Coutant <ccoutant@google.com>
8850 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8851 (Target_x86_64::Relocate::relocate_tls): Replace check for
8852 saw_tls_block_reloc_ with test for executable section.
8854 2010-09-12 Cary Coutant <ccoutant@google.com>
8856 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8857 position-independent executables to shared libraries need dynamic
8859 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8860 position-independent executables.
8861 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8862 * testsuite/Makefile.in: Regenerate.
8864 2010-09-10 Nick Clifton <nickc@redhat.com>
8867 * testsuite/memory_test.t: Discard any sections that are not
8870 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8873 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8874 "This::" to work around a bug in gcc 4.2.
8876 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8878 2010-09-09 Rafael Espindola <espindola@google.com>
8880 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8881 sections with different PF_X flags in the same segment.
8882 (Layout::find_first_load_seg): Search all segments to find the first
8884 * options.h (rosegment): New.
8886 2010-09-08 Rafael Espindola <espindola@google.com>
8888 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
8890 2010-09-08 Doug Kwan <dougkwan@google.com>
8892 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8893 (Arm_relobj::do_relocate_sections): Add new parameter for output
8894 file to match the parent.
8895 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8896 of local symbols instead of input values. Update code to track
8897 changes in gold::relocate_section.
8898 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8899 (Sized_relobj::compute_final_local_value_internal): New methods.
8900 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8901 body into private version of Sized_relobj::compute_final_local_value.
8902 Call the inline method.
8903 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8904 merged symbol value if there is one.
8905 (Symbol_value::has_output_value): New method defintiion.
8906 (Sized_relobj::Compute_final_local_value_status): New enum type.
8907 (Sized_relobj::compute_final_local_value): New methods.
8908 (Sized_relobj::compute_final_local_value_internal): New methods.
8909 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8910 and arm_cortex_a8.sh.
8911 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8912 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8914 * Makefile.in: Regenerate.
8915 * testsuite/arm_bl_out_of_range.s: Update test.
8916 * testsuite/thumb_bl_out_of_range.s: Ditto.
8917 * testsuite/thumb_blx_out_of_range.s: Ditto.
8918 * testsuite/arm_branch_out_of_range.sh: New file.
8919 * testsuite/arm_cortex_a8.sh: Ditto.
8920 * testsuite/arm_cortex_a8_b.s: Ditto.
8921 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8922 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8923 * testsuite/arm_cortex_a8_bl.s: Ditto.
8924 * testsuite/arm_cortex_a8_blx.s: Ditto.
8925 * testsuite/arm_cortex_a8_local.s: Ditto.
8926 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8927 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8929 2010-09-08 Rafael Espindola <espindola@google.com>
8931 * Makefile.am (memory_test.stdout): Run readelf with -W.
8932 * Makefile.in: Regenerate.
8933 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8936 2010-09-08 Rafael Espindola <espindola@google.com>
8938 * script-sections.cc (Script_sections::add_memory_region): Convert
8939 field precision to int.
8940 * script.cc (script_set_section_region, script_set_section_region):
8941 Convert field precision to int.
8943 2010-09-08 Rafael Espindola <espindola@google.com>
8945 * arm.cc (do_finalize_sections): Create the __exidx_start and
8946 __exdix_end symbols even when the section is missing.
8948 2010-09-08 Nick Clifton <nickc@redhat.com>
8950 * README: Remove claim that MEMORY is not supported.
8951 * expression.cc (script_exp_function_origin)
8952 (script_exp_function_length): Move from here to ...
8953 * script.cc: ... here.
8954 (script_set_section_region, script_add_memory)
8955 (script_parse_memory_attr, script_include_directive): New
8957 * script-sections.cc
8958 (class Memory_region): New class.
8959 (class Output_section_definition): Add set_memory_region,
8960 set_section_vma, set_section_lma and get_section_name methods.
8961 (class Script_Sections): Add add_memory_region,
8962 find_memory_region, find_memory_region_origin,
8963 find_memory_region_length and set_memory_region methods.
8964 Have set_section_addresses method walk the list of set memory
8966 Extend the print methos to display memory regions.
8967 * script-sections.h: Add prototypes for new methods.
8968 Add enum for MEMORY region attributes.
8969 * yyscript.y: Add support for parsing MEMORY regions.
8970 * script-c.h: Add prototypes for new functions.
8971 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8972 * testsuite/Makefile.in: Regenerate.
8973 * testsuite/memory_test.sh: New script.
8974 * testsuite/memory_test.s: New assembler source file.
8975 * testsuite/memory_test.t: New linker script.
8977 2010-08-27 Doug Kwan <dougkwan@google.com>
8979 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8980 reference override an existing dynamic weak reference.
8981 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8982 * testsuite/Makefile.in: Regenerate.
8983 * testsuite/dyn_weak_ref.sh: New file.
8984 * testsuite/dyn_weak_ref_1.c: Ditto.
8985 * testsuite/dyn_weak_ref_2.c: Ditto.
8987 2010-08-27 Ian Lance Taylor <iant@google.com>
8989 * incremental.h (class Incremental_input_entry): Add virtual
8992 2010-08-27 Ian Lance Taylor <iant@google.com>
8994 * testsuite/start_lib_test_3.c: Mark t3 as used.
8996 2010-08-27 Nick Clifton <nickc@redhat.com>
8998 * options.cc (version_script): Fix small typo in previous
9001 2010-08-25 Nick Clifton <nickc@redhat.com>
9003 * archive.cc: Formatting fixes: Remove whitespace between
9004 typename and following asterisk. Remove whitespace between
9005 function name and opening parenthesis.
9006 * archive.h: Likewise.
9008 * attributes.cc: Likewise.
9009 * attributes.h: Likewise.
9010 * common.cc: Likewise.
9011 * copy-relocs.cc: Likewise.
9012 * dirsearch.h: Likewise.
9013 * dynobj.cc: Likewise.
9014 * ehframe.cc: Likewise.
9015 * ehframe.h: Likewise.
9016 * expression.cc: Likewise.
9017 * fileread.cc: Likewise.
9018 * fileread.h: Likewise.
9020 * gold-threads.cc: Likewise.
9021 * gold.cc: Likewise.
9022 * i386.cc: Likewise.
9024 * incremental-dump.cc: Likewise.
9025 * incremental.cc: Likewise.
9026 * layout.cc: Likewise.
9027 * layout.h: Likewise.
9028 * main.cc: Likewise.
9029 * merge.cc: Likewise.
9030 * merge.h: Likewise.
9031 * object.cc: Likewise.
9032 * object.h: Likewise.
9033 * options.cc: Likewise.
9034 * options.h: Likewise.
9035 * output.cc: Likewise.
9036 * output.h: Likewise.
9037 * plugin.cc: Likewise.
9038 * plugin.h: Likewise.
9039 * powerpc.cc: Likewise.
9040 * reloc.cc: Likewise.
9041 * script-c.h: Likewise.
9042 * script-sections.cc: Likewise.
9043 * script.cc: Likewise.
9044 * stringpool.cc: Likewise.
9045 * symtab.cc: Likewise.
9046 * symtab.h: Likewise.
9047 * target.cc: Likewise.
9048 * timer.cc: Likewise.
9049 * timer.h: Likewise.
9050 * version.cc: Likewise.
9051 * x86_64.cc: Likewise.
9053 2010-08-24 Nick Clifton <nickc@redhat.com>
9056 * layout.cc (segment_precedes): Sort segments by their physical
9057 addresses, if they have been set.
9059 2010-08-23 Cary Coutant <ccoutant@google.com>
9061 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9063 (Lib_group::include_member): Unlock object after deleting its
9065 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9068 2010-08-19 Neil Vachharajani <nvachhar@google.com>
9069 Cary Coutant <ccoutant@google.com>
9071 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9072 constructor, and set_blocker.
9073 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9075 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9076 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9077 * testsuite/Makefile.am (start_lib_test): New test case.
9078 * testsuite/Makefile.in: Regenerate.
9079 * testsuite/start_lib_test_main.c: New file.
9080 * testsuite/start_lib_test_1.c: New file.
9081 * testsuite/start_lib_test_2.c: New file.
9082 * testsuite/start_lib_test_3.c: New file.
9084 2010-08-19 Ian Lance Taylor <iant@google.com>
9086 * Makefile.in: Rebuild with automake 1.11.1.
9087 * aclocal.m4: Likewise.
9088 * testsuite/Makefile.in: Likewise.
9090 2010-08-19 Ian Lance Taylor <iant@google.com>
9093 * i386.cc (class Output_data_plt_i386): Update declarations.
9094 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9095 local_ifuncs_ fields.
9096 (Target_i386::do_plt_section_for_global): New function.
9097 (Target_i386::do_plt_section_for_local): New function.
9098 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9099 parameter; change all callers. Initialize global_ifuncs_ and
9100 local_ifuncs_. If doing a static link define __rel_iplt_start and
9102 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9103 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9104 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9106 (Target_i386::make_plt_section): New function, broken out of
9107 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9108 (Target_i386::make_plt_entry): Call make_plt_section.
9109 (Target_i386::make_local_ifunc_plt_entry): New function.
9110 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9111 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9112 R_386_IRELATIVE to switch.
9113 (Target_i386::Scan::global): Likewise.
9114 (Target_i386::Relocate::relocate): Likewise.
9115 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9117 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9118 (Target_x86_64::do_plt_section_for_global): New function.
9119 (Target_x86_64::do_plt_section_for_local): New function.
9120 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9121 parameter; change all callers. If doing a static link define
9122 __rela_iplt_start and __rela_iplt_end.
9123 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9124 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9125 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9127 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9128 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9130 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9131 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9132 R_X86_64_IRELATIVE to switch.
9133 (Target_x86_64::Scan::global): Likewise.
9134 (Target_x86_64::Relocate::relocate): Likewise.
9135 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9137 * target.h (class Target): Add plt_section_for_global and
9138 plt_section_for_local functions. Add do_plt_section_for_global
9139 and do_plt_section_for_local virtual functions.
9140 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9141 clarifying comments.
9142 (Symbol::use_plt_offset): Handle IFUNC symbol.
9143 * object.cc (Sized_relobj::Sized_relobj): Initialize
9145 (Sized_relobj::local_has_plt_offset): New function.
9146 (Sized_relobj::local_plt_offset): New function.
9147 (Sized_relobj::set_local_plt_offset): New function.
9148 (Sized_relobj::do_count): Handle IFUNC symbol.
9149 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9150 a bit away from input_shndx_ field. Add set_is_func_symbol and
9151 is_ifunc_symbol functions.
9152 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9153 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9154 local_plt_offsets_ field.
9155 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9156 * output.h (class Output_section_data): Add non-const
9157 output_section function.
9158 (class Output_data_got): Update declarations.
9159 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9160 Add use_plt_offset parameter to global and local constructors.
9161 Change all callers. Change local_sym_index_ field to 31 bits.
9162 Change GSYM_CODE and CONSTANT_CODE accordingly.
9163 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9164 doing a static link don't set sh_link field.
9165 (Output_data_got::Got_entry::write): Use PLT offset if
9167 (Output_data_got::add_global_plt): New function.
9168 (Output_data_got::add_local_plt): New function.
9169 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9170 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9171 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9172 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9173 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9175 * testsuite/ifunc-sel.h: New file.
9176 * testsuite/ifuncmain1.c: New file.
9177 * testsuite/ifuncmain1vis.c: New file.
9178 * testsuite/ifuncmod1.c: New file.
9179 * testsuite/ifuncdep2.c: New file.
9180 * testsuite/ifuncmain2.c: New file.
9181 * testsuite/ifuncmain3.c: New file.
9182 * testsuite/ifuncmod3.c: New file.
9183 * testsuite/ifuncmain4.c: New file.
9184 * testsuite/ifuncmain5.c: New file.
9185 * testsuite/ifuncmod5.c: New file.
9186 * testsuite/ifuncmain6pie.c: New file.
9187 * testsuite/ifuncmod6.c: New file.
9188 * testsuite/ifuncmain7.c: New file.
9189 * configure, testsuite/Makefile.in: Rebuild.
9191 2010-08-18 Ian Lance Taylor <iant@google.com>
9194 (Output_section_incremental_inputs::write_input_files): Add cast
9195 to avoid signed/unsigned comparison warning.
9196 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9198 2010-08-12 Cary Coutant <ccoutant@google.com>
9200 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9202 2010-08-13 Ian Lance Taylor <iant@google.com>
9204 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9206 2010-08-12 Cary Coutant <ccoutant@google.com>
9207 Doug Kwan <dougkwan@google.com>
9209 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9210 defintion overrides non-weak undef, remember that the original undef
9212 * symtab.cc (Symbol_table::sized_write_global): For undef without
9213 an original weak binding, set binding to global in output.
9214 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9215 * testsuite/Makefile.in: Regenerate.
9216 * testsuite/strong_ref_weak_def.sh: New file.
9217 * testsuite/strong_ref_weak_def_1.c: Ditto.
9218 * testsuite/strong_ref_weak_def_2.c: Ditto.
9220 2010-08-12 Cary Coutant <ccoutant@google.com>
9222 * testsuite/incremental_test.sh: Rewrite.
9223 * testsuite/incremental_test_1.c: Rewrite.
9224 * testsuite/incremental_test_2.c: Rewrite.
9226 2010-08-12 Cary Coutant <ccoutant@google.com>
9228 * arm.cc (Target_arm::got_size): Add const.
9229 (Target_arm::got_entry_count): New function.
9230 (Target_arm::plt_entry_count): New function.
9231 (Target_arm::first_plt_entry_offset): New function.
9232 (Target_arm::plt_entry_size): New function.
9233 (Output_data_plt_arm::entry_count): New function.
9234 (Output_data_plt_arm::first_plt_entry_offset): New function.
9235 (Output_data_plt_arm::get_plt_entry_size): New function.
9236 * i386.cc (Target_i386::got_size): Add const.
9237 (Target_i386::got_entry_count): New function.
9238 (Target_i386::plt_entry_count): New function.
9239 (Target_i386::first_plt_entry_offset): New function.
9240 (Target_i386::plt_entry_size): New function.
9241 (Output_data_plt_i386::entry_count): New function.
9242 (Output_data_plt_i386::first_plt_entry_offset): New function.
9243 (Output_data_plt_i386::get_plt_entry_size): New function.
9244 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9245 find_incremental_inputs_sections. Dump incremental_got_plt section.
9246 * incremental.cc: Include target.h.
9247 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9248 parameter. Adjust all callers. Find incremental_got_plt section.
9249 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9251 (Output_section_incremental_inputs::set_final_data_size): Calculate
9252 size of incremental_got_plt section.
9253 (Output_section_incremental_inputs::do_write): Write the
9254 incremental_got_plt section.
9255 (Got_plt_view_info): New struct.
9256 (Local_got_offset_visitor): New class.
9257 (Global_got_offset_visitor): New class.
9258 (Global_symbol_visitor_got_plt): New class.
9259 (Output_section_incremental_inputs::write_got_plt): New function.
9260 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9261 Add parameter. Adjust all callers.
9262 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9263 (Incremental_inputs::got_plt_section): New function.
9264 (Incremental_inputs::got_plt_section_): New data member.
9265 (Incremental_got_plt_reader): New class.
9266 * layout.cc (Layout::create_incremental_info_sections): Add the
9267 incremental_got_plt section.
9268 * object.h (Got_offset_list::get_list): New function.
9269 (Got offset_list::for_all_got_offsets): New function.
9270 (Sized_relobj::local_got_offset_list): New function.
9271 * powerpc.cc (Target_powerpc::got_size): Add const.
9272 (Target_powerpc::got_entry_count): New function.
9273 (Target_powerpc::plt_entry_count): New function.
9274 (Target_powerpc::first_plt_entry_offset): New function.
9275 (Target_powerpc::plt_entry_size): New function.
9276 (Output_data_plt_powerpc::entry_count): New function.
9277 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9278 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9279 * sparc.cc (Target_sparc::got_size): Add const.
9280 (Target_sparc::got_entry_count): New function.
9281 (Target_sparc::plt_entry_count): New function.
9282 (Target_sparc::first_plt_entry_offset): New function.
9283 (Target_sparc::plt_entry_size): New function.
9284 (Output_data_plt_sparc::entry_count): New function.
9285 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9286 (Output_data_plt_sparc::get_plt_entry_size): New function.
9287 * symtab.h (Symbol::got_offset_list): New function.
9288 (Symbol_table::for_all_symbols): New function.
9289 * target.h (Sized_target::got_entry_count): New function.
9290 (Sized_target::plt_entry_count): New function.
9291 (Sized_target::plt_entry_size): New function.
9292 * x86_64.cc (Target_x86_64::got_size): Add const.
9293 (Target_x86_64::got_entry_count): New function.
9294 (Target_x86_64::plt_entry_count): New function.
9295 (Target_x86_64::first_plt_entry_offset): New function.
9296 (Target_x86_64::plt_entry_size): New function.
9297 (Output_data_plt_x86_64::entry_count): New function.
9298 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9299 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9301 2010-08-12 Cary Coutant <ccoutant@google.com>
9303 * archive.cc: Include incremental.h.
9304 (Archive::Archive): Initialize incremental_info_.
9305 (Archive::include_member): Record archive members in incremental info.
9306 (Add_archive_symbols::run): Record begin and end of an archive in
9308 (Lib_group::include_member): Record objects in incremental info.
9309 * archive.h (Incremental_archive_entry): Forward declaration.
9310 (Archive::set_incremental_info): New member function.
9311 (Archive::incremental_info): New member function.
9312 (Archive::Unused_symbol_iterator): New class.
9313 (Archive::unused_symbols_begin): New member function.
9314 (Archive::unused_symbols_end): New member function.
9315 (Archive::incremental_info_): New data member.
9316 * incremental-dump.cc (find_input_containing_global): New function.
9317 (dump_incremental_inputs): Dump new incremental info sections.
9318 * incremental.cc: Include symtab.h.
9319 (Output_section_incremental_inputs): New class.
9320 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9321 new incremental info sections.
9322 (Sized_incremental_binary::do_check_inputs): Likewise.
9323 (Incremental_inputs::report_archive): Remove.
9324 (Incremental_inputs::report_archive_begin): New function.
9325 (Incremental_inputs::report_archive_end): New function.
9326 (Incremental_inputs::report_object): New function.
9327 (Incremental_inputs::finalize_inputs): Remove.
9328 (Incremental_inputs::report_input_section): New function.
9329 (Incremental_inputs::report_script): Rewrite.
9330 (Incremental_inputs::finalize): Do nothing but finalize string table.
9331 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9332 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9333 (Incremental_inputs::create_data_sections): New function.
9334 (Incremental_inputs::relocs_entsize): New function.
9335 (Output_section_incremental_inputs::set_final_data_size): New function.
9336 (Output_section_incremental_inputs::do_write): New function.
9337 (Output_section_incremental_inputs::write_header): New function.
9338 (Output_section_incremental_inputs::write_input_files): New function.
9339 (Output_section_incremental_inputs::write_info_blocks): New function.
9340 (Output_section_incremental_inputs::write_symtab): New function.
9341 * incremental.h (Incremental_script_entry): Forward declaration.
9342 (Incremental_object_entry): Forward declaration.
9343 (Incremental_archive_entry): Forward declaration.
9344 (Incremental_inputs): Forward declaration.
9345 (Incremental_inputs_header_data): Remove.
9346 (Incremental_inputs_header): Remove.
9347 (Incremental_inputs_header_write): Remove.
9348 (Incremental_inputs_entry_data): Remove.
9349 (Incremental_inputs_entry): Remove.
9350 (Incremental_inputs_entry_write): Remove.
9351 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9352 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9353 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9354 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9356 (Incremental_input_entry): New class.
9357 (Incremental_script_entry): New class.
9358 (Incremental_object_entry): New class.
9359 (Incremental_archive_entry): New class.
9360 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9361 (Incremental_inputs::report_inputs): Remove.
9362 (Incremental_inputs::report_archive): Remove.
9363 (Incremental_inputs::report_archive_begin): New function.
9364 (Incremental_inputs::report_archive_end): New function.
9365 (Incremental_inputs::report_object): Change prototype.
9366 (Incremental_inputs::report_input_section): New function.
9367 (Incremental_inputs::report_script): Change prototype.
9368 (Incremental_inputs::get_reloc_count): New function.
9369 (Incremental_inputs::set_reloc_count): New function.
9370 (Incremental_inputs::create_data_sections): New function.
9371 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9372 (Incremental_inputs::inputs_section): New function.
9373 (Incremental_inputs::symtab_section): New function.
9374 (Incremental_inputs::relocs_section): New function.
9375 (Incremental_inputs::get_stringpool): Add const.
9376 (Incremental_inputs::command_line): Add const.
9377 (Incremental_inputs::inputs): Remove.
9378 (Incremental_inputs::command_line_key): New function.
9379 (Incremental_inputs::input_file_count): New function.
9380 (Incremental_inputs::input_files): New function.
9381 (Incremental_inputs::relocs_entsize): New function.
9382 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9383 (Incremental_inputs::finalize_inputs): Remove.
9384 (Incremental_inputs::Input_info): Remove.
9385 (Incremental_inputs::lock_): Remove.
9386 (Incremental_inputs::inputs_): Change type.
9387 (Incremental_inputs::inputs_map_): Remove.
9388 (Incremental_inputs::current_object_entry_): New data member.
9389 (Incremental_inputs::inputs_section_): New data member.
9390 (Incremental_inputs::symtab_section_): New data member.
9391 (Incremental_inputs::relocs_section_): New data member.
9392 (Incremental_inputs::reloc_count_): New data member.
9393 (Incremental_inputs_reader): New class.
9394 (Incremental_symtab_reader): New class.
9395 (Incremental_relocs_reader): New class.
9396 * layout.cc (Layout::finalize): Move finalization of incremental info
9397 and creation of incremental info sections to follow finalization of
9398 symbol table. Set offsets for postprocessing sections.
9399 (Layout::create_incremental_info_sections): Call
9400 Incremental_inputs::create_data_sections. Add incremental symtab
9401 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9402 sections to layout after input sections.
9403 * layout.h (struct Timespec): Forward declaration.
9404 (Layout::incremental_inputs): Add const.
9405 (Layout::create_incremental_info_sections): Add parameter.
9406 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9407 * object.cc: Include incremental.h.
9408 (Relobj::finalize_incremental_relocs): New function.
9409 (Sized_relobj::do_layout): Record input sections in incremental info.
9410 * object.h (Object::output_section): New function.
9411 (Object::output_section_offset): Moved from Relobj.
9412 (Object::get_incremental_reloc_base): New function.
9413 (Object::get_incremental_reloc_count): New function.
9414 (Object::do_output_section): New function.
9415 (Object::do_output_section_offset): Moved from Relobj.
9416 (Object::do_get_incremental_reloc_base): New function.
9417 (Object::do_get_incremental_reloc_count): New function.
9418 (Object::Object): Initialize new data members.
9419 (Relobj::output_section): Renamed do_output_section and moved to
9421 (Relobj::output_section_offset): Moved to Object.
9422 (Relobj::do_get_incremental_reloc_base): New function.
9423 (Relobj::do_get_incremental_reloc_count): New function.
9424 (Relobj::allocate_incremental_reloc_counts): New function.
9425 (Relobj::count_incremental_reloc): New function.
9426 (Relobj::finalize_incremental_relocs): New function.
9427 (Relobj::next_incremental_reloc_index): New function.
9428 (Relobj::reloc_counts_): New data member.
9429 (Relobj::reloc_bases_): New data member.
9430 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9431 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9432 (Sized_relobj::incremental_relocs_scan): New function.
9433 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9434 (Sized_relobj::incremental_relocs_write): New function.
9435 (Sized_relobj::incremental_relocs_write_reltype): New function.
9436 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9438 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9439 archives and object files elsewhere.
9440 (Add_symbols::run): Report object files here.
9441 (Finish_group::run): Report end of archive at end of group.
9442 * reloc.cc: Include layout.h, incremental.h.
9443 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9444 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9445 (Sized_relobj::incremental_relocs_scan): New function.
9446 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9447 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9448 (Sized_relobj::incremental_relocs_write): New function.
9449 (Sized_relobj::incremental_relocs_write_reltype): New function.
9450 * script.cc (read_input_script): Rewrite test for incremental link.
9451 Change call to Incremental_inputs::report_script.
9452 * symtab.h (Symbol_table::first_global_index): New function.
9453 (Symbol_table::output_count): New function.
9455 2010-08-12 Doug Kwan <dougkwan@google.com>
9457 * arm.cc (Target_arm::merge_object_attributes): Check command line
9458 options --no-wchar-size-warning and --no-enum-size-warning.
9459 * options.h (General_options): Add ld-compatible options
9460 --no-enum-size-warning and --no-wchar-size-warning.
9462 2010-08-04 Ian Lance Taylor <iant@google.com>
9464 * x86_64.cc (Target_x86_64::Scan::local): Use
9465 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9466 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9467 (Target_x86_64::Scan::global): Likewise.
9468 (Target_x86_64::Relocate::relocate): Likewise.
9469 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9472 2010-08-03 Cary Coutant <ccoutant@google.com>
9474 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9475 to reserve space in merged_strings vector. Keep total input size
9477 (Output_merge_string::do_print_merge_stats): Print total input size.
9478 * merge.h (Output_merge_string): Add input_size_ field.
9479 * stringpool.cc (Stringpool_template::string_length): Move
9480 implementations out of Stringpool_template class and place in
9482 * stringpool.h (string_length): Move out of Stringpool_template.
9484 2010-08-03 Ian Lance Taylor <iant@google.com>
9487 * layout.cc (relaxation_loop_body): If address of load segment is
9488 set, adjust address to include headers if possible.
9490 2010-08-03 Ian Lance Taylor <iant@google.com>
9492 * version.cc (version_string): Bump to 1.10.
9494 2010-08-03 Ian Lance Taylor <iant@google.com>
9497 * layout.h (enum Output_section_order): Define.
9498 (class Layout): Update declarations.
9499 * layout.cc (Layout::get_output_section): Add order parameter.
9500 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9501 is_first_non_relro parameters. Change all callers.
9502 (Layout::choose_output_section): Likewise.
9503 (Layout::add_output_section_data): Likewise.
9504 (Layout::make_output_section): Likewise. Set order.
9505 (Layout::default_section_order): New function.
9506 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9507 * output.cc (Output_section::Output_section): Initialize order_.
9508 Don't initialize deleted fields.
9509 (Output_segment::Output_segment): Don't initialize deleted
9511 (Output_segment::add_output_section_to_load): New function
9512 replacing add_output_section. Change all callers to call this or
9513 add_output_section_to_nonload.
9514 (Output_segment::add_output_section_to_nonload): New function.
9515 (Output_segment::remove_output_section): Rewrite.
9516 (Output_segment::add_initial_output_data): Likewise.
9517 (Output_segment::has_any_data_sections): Likewise.
9518 (Output_segment::is_first_section_relro): Likewise.
9519 (Output_segment::maximum_alignment): Likewise.
9520 (Output_segment::has_dynamic_reloc): New function replacing
9521 dynamic_reloc_count. Change all callers.
9522 (Output_segment::has_dynamic_reloc_list): New function replacing
9523 dynamic_reloc_count_list. Change all callers.
9524 (Output_segment::set_section_addresses): Rewrite.
9525 (Output_segment::set_offset): Rewrite.
9526 (Output_segment::find_first_and_last_list): Remove.
9527 (Output_segment::set_tls_offsets): Rewrite.
9528 (Output_segment::first_section_load_address): Likewise.
9529 (Output_segment::output_section_count): Likewise.
9530 (Output_segment::section_with_lowest_load_address): Likewise.
9531 (Output_segment::write_section_headers): Likewise.
9532 (Output_segment::print_sections_to_map): Likewise.
9533 * output.h (class Output_data): Remove dynamic_reloc_count_
9534 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9535 (Output_data::add_dynamic_reloc): Rewrite.
9536 (Output_data::has_dynamic_reloc): New function.
9537 (Output_data::dynamic_reloc_count): Remove.
9538 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9539 is_last_relro_, is_first_non_relro_, is_interp_,
9540 is_dynamic_linker_section_ fields. Add order and set_order
9541 functions. Remove is_relro_local, set_is_relro_local,
9542 is_last_relro, set_is_last_relro, is_first_non_relro,
9543 set_is_first_non_relro functions, is_interp, set_is_interp,
9544 is_dynamic_linker_section, and set_is_dynamic_linker_section
9546 (class Output_segment): Change Output_data_list from std::list to
9547 std:;vector. Add output_lists_ field. Remove output_data_ and
9548 output_bss_ fields. Update declarations.
9550 2010-08-02 Ian Lance Taylor <iant@google.com>
9552 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9553 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9554 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9556 2010-08-02 Ian Lance Taylor <iant@google.com>
9559 * script.cc (Script_options::Script_options): Initialize
9560 symbol_definitions_ and symbol_references_.
9561 (Script_options::add_symbol_assignment): Update
9562 symbol_definitions_ and symbol_references_.
9563 (Script_options::add_symbol_reference): New function.
9564 (script_symbol): New function.
9565 * script.h (class Script_options): Add symbol_definitions_ and
9566 symbol_references_ fields.
9567 (Script_options::referenced_const_iterator): New type.
9568 (Script_options::referenced_begin): New function.
9569 (Script_options::referenced_end): New function.
9570 (Script_options::is_referenced): New function.
9571 (Script_options::any_unreferenced): New function.
9572 * script-c.h (script_symbol): Declare.
9573 * yyscript.y (exp): Call script_symbol.
9574 * symtab.cc: Include "script.h".
9575 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9576 Change all callers. Check symbols referenced by scripts.
9577 (Symbol_table::add_undefined_symbols_from_command_line): Add
9578 layout parameter. Change all callers.
9579 (Symbol_table::do_add_undefined_symbols_from_command_line):
9580 Likewise. Break out loop body. Check symbols referenced by
9582 (Symbol_table::add_undefined_symbol_from_command_line): New
9583 function broken out of
9584 do_add_undefined_symbols_from_command_line.
9585 * symtab.h (class Symbol_table): Update declarations.
9586 * archive.cc: Include "layout.h".
9587 (Archive::should_include_member): Add layout parameter. Change
9588 all callers. Check for symbol mentioned in expression.
9589 * archive.h (class Archive): Update declaration.
9590 * object.cc (Sized_relobj::do_should_include_member): Add layout
9592 * object.h (Object::should_include_member): Add layout parameter.
9594 (Object::do_should_include_member): Add layout parameter.
9595 (class Sized_relobj): Update declaration.
9596 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9598 * dynobj.h (class Sized_dynobj): Update declaration.
9599 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9601 * plugin.h (class Sized_pluginobj): Update declaration.
9603 2010-08-02 Ian Lance Taylor <iant@google.com>
9606 * output.cc (Output_segment::set_offset): Search for the first and
9607 last sections rather than assuming that the list is in order.
9608 (Output_segment::find_first_and_last_list): New function.
9609 * output.h (class Output_segment): Update declarations.
9610 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9611 (relro_strip_test_SOURCES): New variable.
9612 (relro_strip_test_DEPENDENCIES): New variable.
9613 (relro_strip_test_LDFLAGS): New variable.
9614 (relro_strip_test_LDADD): New variable.
9615 (relro_strip_test.so): New target.
9617 2010-08-02 Ian Lance Taylor <iant@google.com>
9619 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9620 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9621 (Target_i386::got_tlsdesc_section): New function.
9622 (Target_i386::got_section): Create space for GOT entries for
9623 TLSDESC relocations.
9624 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9626 (Target_i386::Scan::global): Likewise.
9627 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9629 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9630 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9631 (Target_x86_64::got_tlsdesc_section): New function.
9632 (Target_x86_64::got_section): Create space for GOT entries for
9633 TLSDESC relocations.
9634 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9636 (Target_x86_64::Scan::global): Likewise.
9637 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9640 2010-08-02 Ian Lance Taylor <iant@google.com>
9642 * testsuite/final_layout.sh: Use dc to convert from hex to
9645 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9647 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9648 paramter to the call to gold::gc_process_relocs.
9649 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9650 paramter to the call to gold::gc_process_relocs.
9651 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9652 parameter to the call to gold::gc_process_relocs.
9653 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9654 template parameter to the call to gold::gc_process_relocs.
9655 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9656 paramter to the call to gold::gc_process_relocs.
9657 * gc.h (get_embedded_addend_size): New function.
9658 (gc_process_relocs): Save the size of the reloc for use by ICF.
9659 * icf.cc (get_section_contents): Get the addend from the text section
9660 for SHT_REL relocation sections.
9661 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9662 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9663 * int_encoding.h (read_from_pointer): New overloaded function.
9664 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9665 * testsuite/icf_sht_rel_addend_test.sh: New file.
9666 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9667 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9669 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9671 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9672 * Makefile.in: Regenerate.
9673 * testsuite/Makefile.in: Regenerate.
9675 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9677 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9678 * gold/testsuite/debug_msg.cc: Likewise.
9679 * gold/testsuite/odr_violation1.cc
9680 * gold/testsuite/odr_violation2.cc
9682 2010-07-21 Cary Coutant <ccoutant@google.com>
9684 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9685 string, and length fields.
9686 (Output_merge_string::Merged_strings_list): New type.
9687 (Output_merge_string::Merged_strings_lists): New typedef.
9688 (Output_merge_string): Replace merged_strings_ with
9689 merged_strings_lists_.
9690 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9691 Merged_strings_list per input object and section. Don't store pointer
9692 to the string. Don't store length with each merged string entry.
9693 (Output_merge_string::finalize_merged_data): Loop over list of merged
9694 strings lists. Recompute length of each merged string.
9696 2010-07-15 Cary Coutant <ccoutant@google.com>
9698 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9701 2010-07-14 Ian Lance Taylor <iant@google.com>
9703 * descriptors.cc (Descriptors::open): Report correct name in error
9706 2010-07-13 Doug Kwan <dougkwan@google.com>
9708 * arm.cc (Arm_input_section::Arm_input_section): For a
9709 SHT_ARM_EXIDX section, always keeps the input sections.
9710 (Arm_input_section::set_exidx_section_link): New method.
9711 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9712 has_errors_ to false.
9713 (Arm_exidx_input_section::has_errors,
9714 Arm_exidx_input_section::set_has_errors): New methods.
9715 (Arm_exidx_input_section::has_errors_): New data member.
9716 (Arm_relobj::get_exidx_shndx_list): New method.
9717 (Arm_output_section::append_text_sections_to_list): Do not skip
9718 section without SHF_EXECINSTR.
9719 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9721 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9722 section header. Make error messages more verbose. Check for
9723 a non-executable section linked to an EXIDX section.
9724 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9725 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9726 check that there is no deferred EXIDX section if we exit early.
9727 Instead of not making an EXIDX section in case of an error, make one
9728 and set the has_errors flag of it.
9729 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9730 in a relocatable link.
9731 (Target_arm::do_relax): Look for the EXIDX output section instead of
9732 assuming that it is called .ARM.exidx.
9733 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9734 section list. Do not check for SHF_EXECINSTR section flags but
9735 skip any input section with errors.
9736 * output.cc (Output_section::Output_section): Initialize
9737 always_keeps_input_sections_ to false.
9738 (Output_section::add_input_section): Check for
9739 always_keeps_input_sections_.
9740 * output.h (Output_section::always_keeps_input_sections,
9741 Output_section::set_always_keeps_input_sections): New methods.
9742 (Output_section::always_keeps_input_sections): New data member.
9744 2010-07-13 Rafael Espindola <espindola@google.com>
9746 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9747 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9749 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9750 Ian Lance Taylor <iant@google.com>
9752 * output.h (Output_section_lookup_maps::add_merge_section):
9753 Correct check of whether value was inserted.
9754 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9755 (Output_section_lookup_maps::add_relaxed_input_section):
9757 * arm.cc (Target_arm::got_section): Remove used local os.
9758 * i386.cc (Target_i386::got_section): Likewise.
9759 * x86_64.cc (Target_x86_64::got_section): Likewise.
9760 * sparc.cc (Target_sparc::got_section): Likewise.
9761 (Target_sparc::relocate): Remove unused local have_got_offset.
9762 * powerpc.cc (Target_powerpc::relocate): Likewise.
9764 2010-07-13 Ian Lance Taylor <iant@google.com>
9766 * compressed_output.cc (zlib_decompress): Fix signature in
9769 * archive.cc (Archive::include_member): Unlock an external member
9770 of a thin archive. Don't bother to delete an object we know is
9773 2010-07-12 Cary Coutant <ccoutant@google.com>
9775 * compressed_output.cc (zlib_decompress): New function.
9776 (get_uncompressed_size): New function.
9777 (decompress_input_section): New function.
9778 * compressed_output.h (get_uncompressed_size): New function.
9779 (decompress_input_section): New function.
9780 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9781 Handle compressed debug sections.
9782 * layout.cc (is_compressed_debug_section): New function.
9783 (Layout::output_section_name): Map compressed section names to
9785 * layout.h (is_compressed_debug_section): New function.
9786 (is_debug_info_section): Recognize compressed debug sections.
9787 * merge.cc: Include compressed_output.h.
9788 (Output_merge_data::do_add_input_section): Handle compressed
9790 (Output_merge_string::do_add_input_section): Handle compressed
9792 * object.cc: Include compressed_output.h.
9793 (Sized_relobj::Sized_relobj): Initialize new data members.
9794 (build_compressed_section_map): New function.
9795 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9796 * object.h (Object::section_is_compressed): New method.
9797 (Object::do_section_is_compressed): New method.
9798 (Sized_relobj::Compressed_section_map): New type.
9799 (Sized_relobj::do_section_is_compressed): New method.
9800 (Sized_relobj::compressed_sections_): New data member.
9801 * output.cc (Output_section::add_input_section): Handle compressed
9803 * reloc.cc: Include compressed_output.h.
9804 (Sized_relobj::write_sections): Handle compressed debug sections.
9806 2010-07-08 Cary Coutant <ccoutant@google.com>
9808 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9809 weak when resolving to a dynamic def.
9810 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9811 for weak undef/dynamic def cases. Adjust callers.
9812 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9813 undef_binding_weak_.
9814 (Symbol_table::sized_write_globals): Adjust symbol binding.
9815 (Symbol_table::sized_write_symbol): Add binding parameter.
9816 * symtab.h (Symbol::set_undef_binding): New method.
9817 (Symbol::is_undef_binding_weak): New method.
9818 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9819 (Symbol_table::should_override): Add new parameter.
9820 (Symbol_table::sized_write_symbol): Add new parameter.
9822 * testsuite/weak_undef_file1.cc: Add new test case.
9823 * testsuite/weak_undef_file2.cc: Fix header comment.
9824 * testsuite/weak_undef_test.cc: Add new test case.
9826 2010-06-29 Doug Kwan <dougkwan@google.com>
9828 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9829 Initialize USE_SYMBOL_.
9830 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9832 (Arm_reloc_property::uses_symbol_): New data member declaration.
9833 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9834 uses symbol value and symbol is undefined but not weakly undefined.
9836 2010-06-28 Rafael Espindola <espindola@google.com>
9838 * plugin.cc (Plugin::load): Use dlerror.
9840 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9842 * symtab.cc (detect_odr_violations): When reporting an ODR
9843 violation, report an object where the symbol is defined.
9845 2010-06-25 Doug Kwan <dougkwan@google.com>
9847 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9848 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9850 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9851 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9852 target hook to detect function points.
9853 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9854 * icf.h (Icf::check_section_for_function_pointers): Change type of
9855 parameter SECTION_NAME to const reference to std::string. Use
9856 target hook to determine if section may have unsafe pointers.
9857 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9860 2010-06-21 Rafael Espindola <espindola@google.com>
9862 * fileread.cc (Input_file::find_fie): New
9863 (Input_file::open): Use Input_file::find_fie.
9864 * fileread.h (Input_file::find_fie): New
9865 * plugin.cc (set_extra_library_path): New.
9866 (Plugin::load): Add set_extra_library_path to the transfer vector.
9867 (Plugin_manager::set_extra_library_path): New.
9868 (Plugin_manager::add_input_file): Use the extra search path if set.
9869 (set_extra_library_path(): New.
9870 * plugin.h (Plugin_manager): Add set_extra_library_path and
9873 2010-06-19 Cary Coutant <ccoutant@google.com>
9875 * layout.cc (gdb_sections): Add .debug_types.
9876 (lines_only_debug_sections): Likewise.
9878 2010-06-18 Rafael Espindola <espindola@google.com>
9880 * plugin.cc (add_input_file,add_input_library)
9881 (Plugin_manager::add_input_file): Make filename arguments const.
9882 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9885 2010-06-16 Doug Kwan <dougkwan@google.com>
9887 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9888 .ARM.attributes section if we have not merged any input
9889 attributes sections.
9891 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9893 * arm.cc: Allow combining objects with no EABI version
9896 2010-06-15 Rafael Espindola <espindola@google.com>
9898 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9900 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9902 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9903 (struct iovec): Correct !HAVE_READV definition.
9905 2010-06-10 Cary Coutant <ccoutant@google.com>
9907 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9908 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9910 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9913 * symtab.h (Symbol::is_placeholder): New member function.
9914 * target-reloc.h (relocate_section): Check for placeholder symbols.
9916 * testsuite/Makefile.am (plugin_test_8): New test.
9917 (plugin_test_9): New test.
9918 * testsuite/Makefile.in: Regenerate.
9920 2010-06-09 Nick Clifton <nickc@redhat.com>
9922 * yyscript.y (input_list_element): Allow strings prefixed with
9923 the '-' character. Treat these as libraries.
9924 * script.cc (script_add_library): New function. Adds a library
9925 specified by "-l<name>" found in an input script.
9926 * script-c.h: Add prototype for script_add_library.
9928 2010-06-07 Doug Kwan <dougkwan@google.com>
9930 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9931 Restrict stub-group size to be within long conditional branch
9932 range when working around cortex-A8 erratum.
9934 2010-06-07 Damien Diederen <dd@crosstwine.com>
9936 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9939 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9943 (Output_section::Input_section_sort_entry::compare_section_ordering):
9944 Change to return non-zero correctly.
9945 (Output_section::Input_section_sort_section_order_index_compare
9946 ::operator()): Change to fix ambiguity in comparisons.
9948 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9950 * gold.h (is_wildcard_string): New function.
9951 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9952 (Layout::layout_eh_frame): Ditto.
9953 (Layout::find_section_order_index): New method.
9954 (Layout::read_layout_from_file): New method.
9955 * layout.h (Layout::find_section_order_index): New method.
9956 (Layout::read_layout_from_file): New method.
9957 (Layout::input_section_position_): New private member.
9958 (Layout::input_section_glob_): New private member.
9959 * main.cc (main): Call read_layout_from_file here.
9960 * options.h (--section-ordering-file): New option.
9961 * output.cc (Output_section::input_section_order_specified_): New
9963 (Output_section::Output_section): Initialize new member.
9964 (Output_section::add_input_section): Add new parameter.
9965 Keep input sections when --section-ordering-file is used.
9966 (Output_section::set_final_data_size): Sort input sections when
9967 section ordering file is specified.
9968 (Output_section::Input_section_sort_entry): Add new parameter.
9970 (Output_section::Input_section_sort_entry::compare_section_ordering):
9972 (Output_section::Input_section_sort_compare::operator()): Change to
9973 consider section_order_index.
9974 (Output_section::Input_section_sort_init_fini_compare::operator()):
9975 Change to consider section_order_index.
9976 (Output_section::Input_section_sort_section_order_index_compare
9977 ::operator()): New method.
9978 (Output_section::sort_attached_input_sections): Change to sort
9979 according to section order when specified.
9980 (Output_section::add_input_section<32, true>): Add new parameter.
9981 (Output_section::add_input_section<64, true>): Add new parameter.
9982 (Output_section::add_input_section<32, false>): Add new parameter.
9983 (Output_section::add_input_section<64, false>): Add new parameter.
9984 * output.h (Output_section::add_input_section): Add new parameter.
9985 (Output_section::input_section_order_specified): New
9987 (Output_section::set_input_section_order_specified): New method.
9988 (Input_section::Input_section): Initialize section_order_index_.
9989 (Input_section::section_order_index): New method.
9990 (Input_section::set_section_order_index): New method.
9991 (Input_section::section_order_index_): New member.
9992 (Input_section::Input_section_sort_section_order_index_compare): New
9994 (Output_section::input_section_order_specified_): New member.
9995 * script-sections.cc (is_wildcard_string): Delete and move modified
9997 (Output_section_element_input::Output_section_element_input): Modify
9998 call to is_wildcard_string.
9999 (Output_section_element_input::Input_section_pattern
10000 ::Input_section_pattern): Ditto.
10001 (Output_section_element_input::Output_section_element_input): Ditto.
10002 * testsuite/Makefile.am (final_layout): New test case.
10003 * testsuite/Makefile.in: Regenerate.
10004 * testsuite/final_layout.cc: New file.
10005 * testsuite/final_layout.sh: New file.
10007 2010-06-01 Rafael Espindola <espindola@google.com>
10009 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10011 2010-06-01 Rafael Espindola <espindola@google.com>
10013 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10014 visibility of symbols.
10016 2010-05-27 Doug Kwan <dougkwan@google.com>
10018 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10019 from start of output section instead of address for a local symbol
10020 in a merged or relaxed section when doing a relocatable link.
10022 2010-05-26 Rafael Espindola <espindola@google.com>
10025 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10026 adding sections the garbage collector removed.
10027 * gold/testsuite/Makefile.am: Add test.
10028 * gold/testsuite/Makefile.in: Regenerate.
10029 * gold/testsuite/plugin_test_7.sh: New.
10030 * gold/testsuite/plugin_test_7_1.c: New.
10031 * gold/testsuite/plugin_test_7_2.c: New.
10033 2010-05-26 Rafael Espindola <espindola@google.com>
10035 * script-sections.cc (Output_section_definition::set_section_addresses):
10036 Check for --section-start.
10038 2010-05-26 Doug Kwan <dougkwan@google.com>
10040 * arm.cc (Arm_scan_relocatable_relocs): New class.
10041 (Target_arm::relocate_special_relocatable): New method.
10042 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10043 (Arm_relocate_functions::thumb_branch_common): Same.
10044 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10045 instead of Default_scan_relocatable_relocs.
10046 * target-reloc.h (relocate_for_relocatable): Let target handle
10047 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10048 * target.h (Sized_target::relocate_special_relocatable): New method.
10050 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10052 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10054 2010-05-23 Doug Kwan <dougkwan@google.com>
10056 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10058 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10059 with a direct branch, not a conditional branch, to a stub.
10060 * merge.cc (Output_merge_base::record_input_section): New method
10062 (Output_merge_data::do_add_input_section): Record input section if
10063 keeps-input-sections flag is set.
10064 (Output_merge_string::do_add_input_section): Ditto.
10065 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10066 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10068 (Output_merge_base::keeps_input_sections,
10069 Output_merge_base::set_keeps_input_sections,
10070 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10071 method definitions.
10072 (Output_merge_base::Input_sections): New type declaration.
10073 (Output_merge_base::input_sections_begin,
10074 Output_merge_base::input_sections_end,
10075 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10076 (Output_merge_base::bool keeps_input_sections_,
10077 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10078 Output_merge_base::input_sections_): New data members.
10079 (Output_merge_data::do_set_keeps_input_sections): New method
10081 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10082 * output.cc (Output_section::Input_section::relobj): Move method
10083 defintion from class declaration to here and handle merge sections.
10084 (Output_section::Input_section::shndx): Ditto.
10085 (Output_section::Output_section): Remove initializations of removed
10086 data members and initialize new data member LOOKUP_MAPS_.
10087 (Output_section::add_input_section): Set keeps-input-sections flag
10088 for a newly created merge output section as appropriate. Adjust code
10089 to use Output_section_lookup_maps class.
10090 (Output_section::add_relaxed_input_section): Adjst code for lookup
10091 maps code refactoring.
10092 (Output_section::add_merge_input_section): Add a new parameter
10093 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10094 class. If adding input section to a newly created merge output
10095 section fails, remove the new merge section.
10096 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
10097 Adjust code for use of the Output_section_lookup_maps class.
10098 (Output_section::find_merge_section): Ditto.
10099 (Output_section::build_lookup_maps): New method defintion.
10100 (Output_section::find_relaxed_input_section): Adjust code to use
10101 Output_section_lookup_maps class.
10102 (Output_section::get_input_sections): Export merge sections. Adjust
10103 code to use Output_section_lookup_maps class.
10104 (Output_section:::add_script_input_section): Adjust code to use
10105 Output_section_lookup_maps class. Update lookup maps for merge
10107 (Output_section::discard_states): Use Output_section_lookup_maps.
10108 (Output_section::restore_states): Same.
10109 * output.h (Merge_section_properties): Move class defintion out of
10111 (Output_section_lookup_maps): New class.
10112 (Output_section::Input_section::is_merge_section): New method
10114 (Output_section::Input_section::relobj): Move defintion out of class
10115 defintion. Declare method only.
10116 (Output_section::Input_section::shndx): Ditto.
10117 (Output_section::Input_section::output_merge_base): New method defintion.
10118 (Output_section::Input_section::u2_.pomb): New union field.
10119 (Output_section::Merge_section_by_properties_map,
10120 Output_section::Output_section_data_by_input_section_map,
10121 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10123 (Output_section::add_merge_input_section): Add new parameter
10124 KEEPS_INPUT_SECTIONS.
10125 (Output_section::build_lookup_maps): New method declaration.
10126 (Output_section::merge_section_map_,
10127 Output_section::merge_section_by_properties_map_,
10128 Output_section::relaxed_input_section_map_,
10129 Output_section::is_relaxed_input_section_map_valid_): Remove data
10131 (Output_section::lookup_maps_): New data member.
10133 2010-05-21 Doug Kwan <dougkwan@google.com>
10136 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10137 avoid a compilation error.
10139 2010-05-19 Rafael Espindola <espindola@google.com>
10141 * script-sections.cc (Output_section_definition::allocate_to_segment):
10142 Update the phdrs_list even when the output section is NULL.
10143 * testsuite/Makefile.am: Add test.
10144 * testsuite/Makefile.in: Regenerate.
10145 * testsuite/script_test_9.cc: New.
10146 * testsuite/script_test_9.sh: New.
10147 * testsuite/script_test_9.t: New.
10149 2010-05-19 Doug Kwan <dougkwan@google.com>
10151 * arm.cc (Arm_input_section::original_size): New method.
10152 (Arm_input_section::do_addralign): Add a cast.
10153 (Arm_input_section::do_output_offset): Remove static cast.
10154 (Arm_input_section::original_addralign,
10155 Arm_input_section::original_size_): Change type to uint32_t.
10156 (Arm_input_section::init): Add safe casts for section alignment
10158 (Arm_input_section::set_final_data_size): Do not set address and
10159 offset of stub table.
10160 (Arm_output_section::fix_exidx_coverage): Change use of of
10161 Output_section::Simple_input_section to that of
10162 Output_section::Input_section.
10163 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10164 except for the first pass.
10165 * output.cc (Output_section::get_input_sections): Change type of
10166 input_sections to std::list<Input_section>.
10167 (Output_section::add_script_input_section): Rename from
10168 Output_section::add_simple_input_section. Change type of SIS
10169 parameter from Simple_input_section to Input_section.
10170 * output.h (Output_section::Simple_input_section): Remove class.
10171 (Output_section::Input_section): Change class visibility to public.
10172 (Output_section::Input_section::addralign): Use stored alignments
10173 for special input sections if set.
10174 (Output_section::Input_section::set_addralign): New method.
10175 (Output_section::get_input_sections): Change parameter type from
10176 list of Simple_input_section to list of Input_section.
10177 (Output_section::add_script_input_section): Rename from
10178 Output_section::add_simple_input_section. Change first parameter's
10179 type from Simple_input_section to Input_section and remove the
10180 second and third parameters.
10181 * script-sections.cc (Input_section::Input_section_list): Change
10182 type to list of Output_section::Input_section/
10183 (Input_section_info::Input_section_info): Change parameter type of
10184 INPUT_SECTION to Output_section::Input_section.
10185 (Input_section_info::input_section): Change return type.
10186 (Input_section_info::input_section_): Change type to
10187 Output_section::Input_section.
10188 (Output_section_element_input::set_section_addresses): Adjust code
10189 to use Output_section::Input_section instead of
10190 Output_section::Simple_input_section. Adjust code for renaming
10191 of Output_section::add_simple_input_section.
10192 (Orphan_output_section::set_section_addresses): Ditto.
10194 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10196 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10197 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10199 2010-05-18 Rafael Espindola <espindola@google.com>
10201 * options.cc (General_options::finalize): Handle -nostdlib.
10202 * options.h (nostdlib): New option.
10203 * script.cc (script_add_search_dir): Handle -nostdlib.
10205 2010-05-12 Doug Kwan <dougkwan@google.com>
10207 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10208 attributes section only if there no attributes section after merging.
10209 (Target_arm::merge_object_attributes): Move value of
10210 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
10211 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10212 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10213 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10214 and arm_attr_merge_7.stdout.
10215 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10216 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10217 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10218 arm_attr_merge_7b.o): New rules.
10219 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10221 * testsuite/Makefile.in: Regenerate.
10222 * testsuite/arm_attr_merge.sh: New file.
10223 * testsuite/arm_attr_merge_[67][ab].s: Same.
10225 2010-05-05 Nick Clifton <nickc@redhat.com>
10227 * po/es.po: Updated Spanish translation.
10229 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10231 * Makefile.am (install-exec-local): Properly install gold as
10232 default cross linker.
10233 * Makefile.in: Regenerated.
10235 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10236 Nick Clifton <nickc@redhat.com>
10238 * configure.ac (install_as_default): Define and set to false
10239 unless --enable-gold or --enable-gold=both/gold has been
10241 * configure: Regenerate.
10243 * Makefile.am (install-exec-local): Install the executable as
10244 'ld.gold'. If install_as_default is true then also install it as
10246 * Makefile.in: Regenerated.
10248 2010-04-24 Ian Lance Taylor <iant@google.com>
10250 * layout.cc (Layout::layout_reloc): In relocatable link don't
10251 combine reloc sections for grouped sections.
10253 2010-04-23 Sriraman Tallam <tmsriram@google.com>
10255 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10256 sections that are not ordinary to icf.
10257 * icf.cc (get_section_contents): Handle relocation pointing to section
10258 with no object or shndx information.
10259 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10260 * testsuite/Makefile.in: Regenerate.
10261 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10262 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10264 2010-04-22 Ian Lance Taylor <iant@google.com>
10266 * expression.cc (Expression::Expression_eval_info): Add
10267 result_alignment_pointer field.
10268 (Expression::eval_with_dot): Add result_alignment_pointer
10269 parameter. Change all callers.
10270 (Expression::eval_maybe_dot): Likewise.
10271 (class Binary_expression): Add alignment_pointer parameter to
10272 left_value and right_value. Change all callers.
10273 (BINARY_EXPRESSION): Set result alignment.
10274 (class Trinary_expression): Add alignment_pointer parameter to
10275 arg2_value and arg3_value. Change all callers.
10276 (Trinary_cond::value): Set result alignment.
10277 (Max_expression::value, Min_expression::value): Likewise.
10278 (Align_expression::value): Likewise.
10279 * script-sections.cc (class Sections_element): Add dot_alignment
10280 parameter to set_section_addresses virtual function. Update
10282 (class Output_section_element): Likewise.
10283 (Script_sections::create_segments): Add dot_alignment parameter.
10284 Change all callers.
10285 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10286 (Script_sections::set_phdrs_clause_addresses): Likewise.
10287 * script-sections.h: Update declarations.
10288 * script.h: Update declarations.
10289 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10291 * testsuite/script_test_3.t: Set large alignment.
10292 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10293 segment has expected alignment.
10295 2010-04-22 Nick Clifton <nickc@redhat.com>
10297 * po/gold.pot: Updated by the Translation project.
10298 * po/vi.po: Updated Vietnamese translation.
10300 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10302 * testsuite/Makefile.am (check_PROGRAMS): Add
10303 icf_virtual_function_folding_test.
10304 * testsuite/Makefile.in: Regenerated.
10306 2010-04-15 Andrew Haley <aph@redhat.com>
10308 * options.h (merge_exidx_entries): New option.
10309 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10310 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10311 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10312 (Target_arm::merge_exidx_entries): New function.
10313 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10314 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10315 to Arm_exidx_fixup constructor.
10316 Add new arg, merge_exidx_entries.
10317 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10318 Arm_output_section::fix_exidx_coverage.
10320 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10322 * icf.cc (get_section_contents): Check for preemptible functions.
10323 Ignore addend when appropriate.
10324 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10326 (add_from_relobj): Check for section folded.
10327 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10328 * symtab.h (should_add_dynsym_entry): Add new parameter.
10329 * target-reloc.h (scan_relocs): Check for section folded.
10330 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10331 Check reloc types for function pointers in shared objects.
10332 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10334 (icf_preemptible_functions_test): New test case.
10335 (icf_string_merge_test): New test case.
10336 * testsuite.Makefile.in: Regenerate.
10337 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10338 bar_glob. Refactor code.
10339 * testsuite/icf_preemptible_functions_test.cc: New file.
10340 * testsuite/icf_preemptible_functions_test.sh: New file.
10341 * testsuite/icf_string_merge_test.cc: New file.
10342 * testsuite/icf_string_merge_test.sh: New file.
10343 * testsuite/icf_virtual_function_folding_test.cc: New file.
10344 * testsuite/icf_virtual_function_folding_test.sh: New file.
10346 2010-04-14 Doug Kwan <dougkwan@google.com>
10348 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10349 for local symbol recounting if we remove a section due to ICF.
10350 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10351 there are no regular objects in input.
10353 2010-04-13 Doug Kwan <dougkwan@google.com>
10355 * arm.cc (Arm_input_section::set_final_data_size): Compute
10356 accurate final data size instead of using current data size.
10358 2010-04-09 Doug Kwan <dougkwan@google.com>
10360 * layout.cc (Layout::choose_output_section): Handle script section
10362 (Layout::make_output_section_for_script): Add section type parameter.
10363 Handle script section types.
10364 * layout.h (Layout::make_output_section_for_script): Add section
10366 * output.cc (Output_section::Output_section): Initialize data member
10368 (Output_section::do_reset_address_and_file_offset): Do not set address
10369 to 0 if section is a NOLOAD section.
10370 * output.h (Output_section::is_noload): New method.
10371 (Output_section::set_is_noload): Ditto.
10372 (Output_section::is_noload_): New data member.
10373 * script-c.h (Script_section_type): New enum type.
10374 (struct Parser_output_section_header): Add new file section_type.
10375 * script-sections.cc (Sections_element::output_section_name): Add
10376 parameter for returning script section type.
10377 (Output_section_definition::output_section_name): Ditto.
10378 (Output_section_definition::section_type)P; New method.
10379 (Output_section_definiton::script_section_type_name): Ditto.
10380 (Output_section_definition::script_section_type_): New data member.
10381 (Output_section_definition::Output_section_definition): Initialize
10382 data member Output_section_definition::script_section_type_.
10383 (Output_section_definition::create_sections): Pass script section type
10384 to Layout::make_output_section_for_script.
10385 (Output_section_definition::output_section_name): Return script
10386 section type to caller.
10387 (Output_section_definition::set_section_address): Do not advance
10388 dot value and load address if section type is NOLOAD. Set address
10389 of NOLOAD sections regardless of section flags.
10390 (Output_section_definition::print): Print section type if it is
10391 not SCRIPT_SECTION_TYPE_NONE.
10392 (Output_section_definition::section_type): New method.
10393 (Output_section_definition::script_section_type_name): Ditto.
10394 (Script_sections::output_section_name): Add new parameter
10395 PSECTION_TYPE for returning script section type. Pass it to
10396 section elements. Handle discard sections.
10397 (Sort_output_sections::operator()): Handle NOLOAD sections.
10398 * script-sections.h (Script_sections::Section_type): New enum type.
10399 (Script_sections::output_section_name): Add a new parameter for
10400 returning script section type.
10401 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10403 * yyscript.y (union): Add new field SECTION_TYPE.
10404 (COPY, DSECT, INFO, NOLOAD): New tokens.
10405 (opt_address_and_section_type): Change type to output_section_header.
10406 (section_type): New non-terminal
10407 (section_header): Handle section type.
10408 (opt_address_and_section_type): Return section type value.
10410 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10412 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10413 * testsuite/plugin_common_test_2.c (foo): Likewise.
10415 2010-04-08 Doug Kwan <dougkwan@google.com>
10417 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10419 * output.cc (Output_section::add_merge_input_section): Simplify
10420 code and return status of Output_merge_base::add_input_section.
10421 Update merge section map only if Output_merge_base::add_input_section
10424 2010-04-07 Doug Kwan <dougkwan@google.com>
10426 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10427 if section is marked as containing instructions but has no mapping
10429 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10430 correct section index.
10431 (Arm_relobj::find_linked_text_section): Ditto.
10433 2010-04-07 Cary Coutant <ccoutant@google.com>
10435 * archive.cc (include_member): Destroy Read_symbols_data object before
10437 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10438 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10439 (Read_symbols_data::~Read_symbols_data) New destructor.
10440 (Section_relocs::Section_relocs) New constructor.
10441 (Section_relocs::~Section_relocs) New destructor.
10442 (Read_relocs_data::Read_relocs_data) New constructor.
10443 (Read_relocs_data::~Read_relocs_data) New destructor.
10444 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10445 pointers to NULL after deleting.
10447 2010-04-07 Doug Kwan <dougkwan@google.com>
10449 * arm.cc: Replace "endianity" with "endianness" in comments.
10450 (Arm_exidx_cantunwind): Ditto.
10451 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10452 (Arm_relobj::merge_flags_and_attributes): New method.
10453 (Arm_relobj::merge_flags_and_attributes_): New data member.
10454 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10455 (Arm_relobj::scan_sections_for_stubs): Ditto.
10456 (Arm_relobj::do_read_symbols): Check to see if we really want to
10457 merge processor-specific flags and attributes. Exit early if
10458 an object is empty except for section names and the undefined symbol.
10459 (Target_arm::do_finalize_sections): Move check for ELF format to
10460 Arm_relobj::do_read_symbols. Merge processor specific flags and
10461 attributes from a regular object only when we have determined that
10462 it is aapropriate. Do not create an .ARM.attributes section in
10463 output if there is no regular input object.
10464 (Target_arm::merge_processor_specific_flags): Check
10465 --warn-mismatch before printing any error.
10466 (Target_arm::merge_object_attributes): Ditto.
10467 * gold.cc (queue_middle_tasks): Handle the case in which there is
10468 no regular object in input.
10469 * options.cc (General_options::parse_EB): New method.
10470 (General_options::parse_EL): Same.
10471 (General_options::General_options): Initialize endianness_.
10472 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10474 (General_options::Endianness): New enum.
10475 (General_options::endianness): New method.
10476 (General_options::endianness_): New data member.
10477 * parameters.cc (Parameters::set_options): Check target endianness.
10478 (Parameters::set_target_once): Ditto.
10479 (Parameters::check_target_endianness): New method.
10480 (parameters_force_valid_target): If either -EL or -EB is specified,
10481 use it to define endianness of default target.
10482 * parameters.h (Parameters::check_target_endianness): New method
10484 * target.h (class Target): Change "endianity" to "endianness"
10487 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10489 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10490 * configure: Regenerate.
10491 * Makefile.in: Regenerate.
10492 * testsuite/Makefile.in: Regenerate.
10494 2010-04-06 Cary Coutant <ccoutant@google.com>
10497 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10498 prevailing definitions of common symbols.
10499 * testsuite/plugin_test_6.sh: New test case.
10500 * testsuite/plugin_common_test_1.c: New test case.
10501 * testsuite/plugin_common_test_2.c: New test case.
10502 * testsuite/Makefile.am (plugin_test_6): New test case.
10503 * testsuite/Makefile.in: Regenerate.
10505 2010-04-06 Nick Clifton <nickc@redhat.com>
10507 * po/vi.po: New Vietnamese translation.
10509 2010-03-30 Doug Kwan <dougkwan@google.com>
10511 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10513 2010-03-25 Doug Kwan <dougkwan@google.com>
10515 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10516 to avoid a conversion warning on a 32-bit host.
10518 2010-03-24 Ian Lance Taylor <iant@google.com>
10520 * testsuite/script_test_3.t: Add a TLS segment.
10521 * testsuite/Makefile.am (check_PROGRAMS): Add
10522 tls_phdrs_script_test.
10523 (tls_phdrs_script_test_SOURCES): Define.
10524 (tls_phdrs_script_test_DEPENDENCIES): Define.
10525 (tls_phdrs_script_test_LDFLAGS): Define.
10526 (tls_phdrs_script_test_LDADD): Define.
10527 * testsuite/Makefile.in: Rebuild.
10529 2010-03-23 Cary Coutant <ccoutant@google.com>
10531 * fileread.cc (find_or_make_view): Fix comment.
10533 2010-03-23 Ian Lance Taylor <iant@google.com>
10535 * script-sections.cc (class Orphan_section_placement): Define
10536 PLACE_TLS and PLACE_TLS_BSS.
10537 (Orphan_section_placement::Orphan_section_placement): Initialize
10539 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10540 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10541 (tls_script_test_SOURCES): Define.
10542 (tls_script_test_DEPENDENCIES): Define.
10543 (tls_script_test_LDFLAGS): Define.
10544 (tls_script_test_LDADD): Define.
10545 * testsuite/Makefile.in: Rebuild.
10547 2010-03-22 Doug Kwan <dougkwan@google.com>
10549 * arm.cc (Arm_relocate_functions::abs8,
10550 Arm_relocate_functions::abs16): Use correct check for overflow
10551 specified in the ARM ELF specs.
10552 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10553 target of a BLX instruction specially.
10554 (Reloc_stub::stub_type_for_reloc): Ditto.
10555 (Relocate::relocate): Use symbolic names instead of numeric relocation
10556 codes to report error.
10557 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10559 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10560 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10561 thumb2_blx_out_of_range.stdout
10562 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10563 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10564 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10565 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10566 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10567 thumb2_blx_in_range, thumb2_blx_in_range.o,
10568 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10569 thumb2_blx_out_of_range.o): New rules.
10570 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10571 thumb2_blx_in_range and thumb2_blx_out_of_range.
10572 * testsuite/Makefile.in: Regenerate.
10573 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10574 * testsuite/thumb_blx_in_range.s: New file.
10575 * testsuite/thumb_blx_out_of_range.s: New file.
10577 2010-03-22 Rafael Espindola <espindola@google.com>
10579 * archive.cc (Should_include): Move to archive.h.
10580 (should_include_member): Make it a member of Archive.
10582 (Add_lib_group_symbols): New.
10583 * archive.h: Include options.h.
10584 (Archive_member): Moved from Archive.
10585 (Should_include): Moved from archive.cc.
10587 (Add_lib_group_symbols): New.
10588 * dynobj.cc (do_should_include_member): New.
10589 * dynobj.h (do_should_include_member): New.
10590 * gold.cc (queue_initial_tasks): Update call to queue.
10591 * main.cc (main): Print lib group stats.
10592 * object.cc (do_should_include_member): New.
10593 * object.h: Include archive.h.
10594 (Object::should_include_member): New.
10595 (Object::do_should_include_member): New.
10596 (Sized_relobj::do_should_include_member): New.
10597 * options.cc (General_options::parse_start_lib): New.
10598 (General_options::parse_end_lib): New.
10599 (Input_arguments::add_file): Handle lib groups.
10600 (Input_arguments::start_group): Check we are not in a lib.
10601 (Input_arguments::start_lib): New.
10602 (Input_arguments::end_lib): New.
10603 * options.h (General_options): Add start_lib and end_lib.
10604 (Input_argument::lib_): New.
10605 (Input_argument::lib): New.
10606 (Input_argument::is_lib): New.
10607 (Input_file_lib): New.
10608 (Input_arguments::in_lib_): New.
10609 (Input_arguments::in_lib): New.
10610 (Input_arguments::start_lib): New.
10611 (Input_arguments::end_lib_): New.
10612 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10613 in unused members as preempted.
10614 (Sized_pluginobj::do_should_include_member): New.
10615 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10616 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10617 return the blocker.
10618 (Read_symbols::do_whole_lib_group): New.
10619 (Read_symbols::do_lib_group): New.
10620 (Read_symbols::do_read_symbols): Handle lib groups.
10621 (Read_symbols::get_name): Handle lib groups.
10622 * readsyms.h (Read_symbols): Add an archive member pointer.
10623 (Read_symbols::do_whole_lib_group): New.
10624 (Read_symbols::do_lib_group): New.
10625 (Read_symbols::member_): New.
10626 * script.cc (read_input_script): Update call to queue_soon.
10628 2010-03-19 Doug Kwan <dougkwan@google.com>
10630 * arm.cc (Stub_table::Stub_table): Initialize new data members
10631 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10632 (Stub_table::add_reloc_stub): Assign stub offset and update
10633 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10634 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10636 (Stub_table::update_data_size_and_addralign): Use
10637 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10638 instead of going over all reloc stubs.
10639 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10640 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10641 Stringpool_template::offset_ to size of Stringpool_char.
10642 (Stringpool_template::new_key_offset): Remove code to initialize
10643 Stringpool_template::offset_.
10644 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10645 Stringpool_template::offset_ to zero.
10647 2010-03-15 Doug Kwan <dougkwan@google.com>
10649 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10651 (Stringpool_template::new_key_offset): New method.
10652 (Stringpool_template::add_string): Assign offsets when adding new
10654 (Stringpool_template::set_string_offsets): Do not set string offsets
10655 when not optimizing.
10656 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10658 (Chunked_vector::clear): Clear size_.
10659 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10660 (Chunked_vector::size): Return size_.
10661 (Chunked_vector::push_back): Use size_ to find insert position.
10662 (Chunked_vector::size_): New data member.
10663 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10664 (Stringpool_template::new_key_offset): New method declaration.
10665 (Stringpool_template::offset_): New data member.
10667 2010-03-15 Rafael Espindola <espindola@google.com>
10669 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10670 Add_symbols' constructor.
10671 * readsyms.h (Add_symbols): Remove the input_group member.
10673 2010-03-10 Ian Lance Taylor <iant@google.com>
10675 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10676 target to ask whether a reference to a symbol requires a stack
10678 * target.h (Target::is_call_to_non_split): New function.
10679 (Target::do_is_call_to_non_split): Declare virtual function.
10680 * target.cc: Include "symtab.h".
10681 (Target::do_is_call_to_non_split): New function.
10682 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10684 2010-03-10 Cary Coutant <ccoutant@google.com>
10686 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10687 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10688 (File_read::open[2]): Add whole_file_view_ to list of views.
10689 (File_read::make_view): Remove test of whole_file_view_.
10690 (File_read::find_or_make_view): Create whole_file_view_ if
10692 (File_read::clear_views): Replace bool parameter with enum;
10693 adjust all callers. Don't delete views with permanent data;
10694 do delete cached views and views from archives if
10695 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10696 if clearing the corresponding view.
10697 * fileread.h (File_read::Clear_views_mode): New enum.
10698 (File_read::View::is_permanent_view): New method.
10699 (File_read::clear_views): Replace bool parameter
10700 with enum; adjust all callers.
10701 * options.h (General_options): Change keep_files_mapped option;
10702 add map_whole_files.
10703 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10704 releasing the file.
10705 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10708 2010-03-10 David S. Miller <davem@davemloft.net>
10710 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10712 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10714 * icf.cc (get_section_contents): Add '@' marker after processing the
10717 2010-03-08 Doug Kwan <dougkwan@google.com>
10719 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10720 due to a conversion warning.
10721 (Arm_relobj::update_output_local_symbol_count): Check for local
10722 symbol with unset output index.
10724 2010-03-05 Ian Lance Taylor <iant@google.com>
10726 * options.h (class General_options): Add --spare-dynamic-tags.
10727 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10728 --spare-dynamic-tags.
10730 2010-03-05 Ian Lance Taylor <iant@google.com>
10732 * incremental.cc: Include "libiberty.h".
10734 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10736 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10737 function, is_info_ member.
10738 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10739 (Versions::Versions): Update caller.
10740 (Versions::define_base_version): Likewise.
10741 (Versions::add_def): Likewise.
10743 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10745 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10746 (Scan::possible_function_pointer_reloc): New function.
10747 (Scan::local_reloc_may_be_function_pointer): Change to call
10748 possible_function_pointer_reloc.
10749 (Scan::global_reloc_may_be_function_pointer): Ditto.
10750 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10751 relocations in ".data.rel.ro._ZTV" section.
10752 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10753 * testsuite/icf_safe_so_test.cc: Ditto.
10754 * testsuite/icf_safe_test.cc: Ditto.
10755 * testsuite/icf_safe_test.sh: Ditto.
10757 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10758 Ian Lance Taylor <iant@google.com>
10760 * target-reloc.h (relocate_section): Check the symbol table index
10761 for -1U before setting the local symbol index.
10762 (scan_relocatable_relocs): If copying the relocation, record that
10763 the local symbol is required.
10764 * object.h (Symbol_value::is_output_symtab_index_set): New
10766 (Symbol_value::may_be_discarded_from_output_symtab): New
10768 (Symbol_value::has_output_symtab_entry): New function.
10769 (Symbol_value::needs_output_symtab_entry): Remove.
10770 (Symbol_value::output_symtab_index): Make sure the symbol index is
10772 (Symbol_value::set_output_symtab_index): Make sure the symbol
10773 index is not set. Make sure the new index is valid.
10774 (Symbol_value::set_must_have_output_symtab_entry): New function.
10775 (Symbol_value::has_output_dynsym_entry): New function.
10776 (Symbol_value::set_output_dynsym_index): Make sure the new index
10778 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10779 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10780 local symbol if permitted.
10781 (Sized_relobj::do_finalize_local_symbols): Call
10782 is_output_symtab_index_set rather than needs_output_symtab_entry.
10783 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10784 rather than needs_output_symtab_entry. Call
10785 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10786 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10787 is_output_symtab_index_set rather than needs_output_symtab_entry.
10788 * testsuite/discard_locals_relocatable_test.c: New file.
10789 * testsuite/discard_locals_test.sh: Test -r.
10790 * testsuite/Makefile.am (check_DATA): Add
10791 discard_locals_relocatable_test1.syms,
10792 discard_local_relocatable_test2.syms.
10793 (MOSTLYCLEANFILES): Likewise. Also add
10794 discard_locals_relocatable_test1.lout and
10795 discard_locals_relocatable_test2.out.
10796 (discard_locals_relocatable_test1.syms): New target.
10797 (discard_locals_relocatable_test.o): New target.
10798 (discard_locals_relocatable_test1.out): New target.
10799 (discard_locals_relocatable_test2.syms): New target.
10800 (discard_locals_relocatable_test2.out): New target.
10801 (various): Add missing ../ld-new dependencies.
10802 * testsuite/Makefile.in: Rebuild.
10804 2010-03-03 Nick Clifton <nickc@redhat.com>
10806 * po/fi.po: New Finnish translation.
10808 2010-03-01 Doug Kwan <dougkwan@google.com>
10810 * layout.cc (Layout::Layout): Force section types of .init_array*,
10811 .preinit_array* and .fini_array* sections.
10812 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10813 Fix check of return value of std::string::find.().
10814 (Output_section::Input_section_sort_compare::operator()): Remove
10815 comment about .init_array.
10816 (Output_section::Input_section_sort_init_fini_compare::operator()):
10818 (Output_section::sort_attached_input_sections): Handle .init_array
10819 and .fini_array specially.
10820 * output.h (Output_section::Inut_section_sort_compare): Update
10822 (Output_section::Input_section_sort_init_fini_compare): New struct.
10824 2010-02-26 Doug Kwan <dougkwan@google.com>
10826 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10827 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10828 * testsuite/debug_msg.sh: Avoid matching source line number for
10829 use of global variable undef_int.
10831 2010-02-26 Doug Kwan <dougkwan@google.com>
10833 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10834 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10835 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10836 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10837 * options.cc (General_options::General_options): Initialize member
10839 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10840 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10841 and rm_no_fix_v4bx.stdout
10842 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10843 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10844 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10845 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10846 and arm_no_fix_v4bx.
10847 * Makefile.in: Regenerate.
10848 * testsuite/arm_fix_v4bx.s: New file.
10849 * testsuite/arm_fix_v4bx.sh: Ditto.
10851 2010-02-24 Doug Kwan <dougkwan@google.com>
10853 * arm.cc (Target_arm::got_section): Make the .got section the first
10854 non RELRO section in the data segment.
10855 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10856 suffixes of section names.
10858 2010-02-24 Doug Kwan <dougkwan@google.com>
10860 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10861 flags and attributes merging if an input file is a binary file.
10862 * fileread.cc (Input_file::open): Record format of original file.
10863 * fileread.h (Input_file::Format): New enum type.
10864 (Input_file::Input_file): Initialize data member format_.
10865 (Input_file::format): New method definition.
10866 (Input_file::format_):: New data member.
10868 2010-02-24 Doug Kwan <dougkwan@google.com>
10870 * arm.cc (Arm_output_data_got): New class.
10871 (ARM_TCB_SIZE): New constant
10872 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10873 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10874 If user uses a script with a SECTIONS clause, issue only a warning
10875 for a misplaced EXIDX input section. Otherwise, issue an error.
10876 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
10877 garbage collection.
10878 (Target_arm::got_mode_index_entry): Handle static linking.
10879 (Target_arm::Scan::local): Ditto.
10880 (Target_arm::Scan::global): Ditto.
10881 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10882 all incorrectly implemented relocations.
10883 (Target_arm::fix_exidx_coverage): Pass layout to
10884 Arm_output_section::fix_exidx_coverage.
10885 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10886 from ".ARM.exidx." and ".ARM.extab.".
10888 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10890 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10891 section if it does not already exist.
10892 * attributes.cc (Attributes_section_data::Attributes_section_data):
10893 Don't crash if size is zero.
10895 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10896 Ian Lance Taylor <iant@google.com>
10898 * gold.cc (queue_middle_tasks): If no input files were opened,
10900 * workqueue.h (Task_function::Task_function): Assert that there is
10903 2010-02-22 Doug Kwan <dougkwan@google.com>
10905 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10906 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10907 types to avoid warnings due to different uint64_t implementations
10908 on different hosts.
10910 2010-02-21 Doug Kwan <dougkwan@google.com>
10912 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10913 handling of the maximum backward branch offset.
10914 (Arm_relocate_functions::thumb_branch_common): Ditto.
10915 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10916 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
10917 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
10918 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10919 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10920 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10921 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10922 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10923 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10924 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10925 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10926 thumb2_bl_out_of_range.o): New rules.
10927 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10928 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10929 thumb2_bl_out_of_range
10930 * testsuite/Makefile.in: Regenerate.
10931 * testsuite/arm_bl_in_range.s: New file.
10932 * testsuite/arm_bl_out_of_range.s: Ditto.
10933 * testsuite/arm_branch_in_range.sh: Ditto.
10934 * testsuite/arm_branch_range.t: Ditto.
10935 * testsuite/thumb2_branch_range.t: Ditto.
10936 * testsuite/thumb_bl_in_range.s: Ditto.
10937 * testsuite/thumb_bl_out_of_range.s: Ditto.
10938 * testsuite/thumb_branch_range.t: Ditto.
10940 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10942 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10943 Add reloc offset information.
10944 * icf.cc (get_section_contents): Change iterators to point to the new
10945 vectors. Add reloc offset information to the contents.
10946 * icf.h (Icf::Sections_reachable_info): New typedef.
10947 (Icf::Sections_reachable_list): New typedef.
10948 (Icf::Offset_info): New typedef.
10949 (Icf::Reloc_info): New struct typedef.
10950 (Icf::Reloc_info_list): New typedef.
10951 (Icf::symbol_reloc_list): Delete method.
10952 (Icf::addend_reloc_list): Delete method.
10953 (Icf::section_reloc_list): Delete method.
10954 (Icf::reloc_info_list): New method.
10955 (Icf::reloc_info_list_): New member.
10957 2010-02-19 Doug Kwan <dougkwan@google.com>
10959 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10960 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10961 * arm.cc (Arm_relocation_functions): New forward declaration.
10962 (Target_arm::Target_arm): Initialize new data members
10963 got_mod_index_offset_ and tls_base_symbol_defined_.
10964 (Target_arm::Relocate::relocate_tls): New method.
10965 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10966 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10968 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
10969 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10970 (Target_arm::got_mod_index_offset_,
10971 Target_arm::tls_base_symbol_defined_): New data members.
10972 (Target_arm::Scan::local, Target::Scan::global,
10973 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10976 2010-02-18 Doug Kwan <dougkwan@google.com>
10978 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10979 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10980 text section as a parameter becuase some broken tools may not set
10981 the link in section header.
10982 (Target_arm::has_got_section): New method.
10983 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10984 without any mapping symbol as data only. Remove warning.
10985 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10986 link in its section header, try to discover the link by inspecting the
10987 REL31 relocation at the beginning of the section.
10988 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10990 (Target_arm::Scan::global): Treat any reference to the symbol
10991 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10993 2010-02-12 Sriraman Tallam <tmsriram@google.com>
10995 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10996 (Scan::global_reloc_may_be_function_pointer): New function.
10997 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10998 (Scan::global_reloc_may_be_function_pointer): New function.
10999 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11000 (Scan::global_reloc_may_be_function_pointer): New function.
11001 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11002 (Scan::global_reloc_may_be_function_pointer): New function.
11003 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11004 (Scan::global_reloc_may_be_function_pointer): New function.
11005 (Scan::possible_function_pointer_reloc): New function.
11006 (Target_x86_64::can_check_for_function_pointers): New function.
11007 * gc.h (gc_process_relocs): Scan relocation types to determine if
11008 function pointers were taken for targets that support it.
11009 * icf.cc (Icf::find_identical_sections): Include functions for
11010 folding in safe ICF whose pointer is not taken.
11011 * icf.h (Secn_fptr_taken_set): New typedef.
11012 (fptr_section_id_): New member.
11013 (section_has_function_pointers): New function.
11014 (set_section_has_function_pointers): New function.
11015 (check_section_for_function_pointers): New function.
11016 * options.h: Fix comment for safe ICF option.
11017 * target.h (can_check_for_function_pointers): New function.
11018 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11019 Modify icf_safe_test for X86-64.
11020 * testsuite/Makefile.in: Regenerate.
11021 * testsuite/icf_safe_so_test.cc: New file.
11022 * testsuite/icf_safe_so_test.sh: New file.
11023 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11024 (main): Change to take pointer to function kept_func_3.
11025 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11026 folding is done correctly for X86-64.
11028 2010-02-12 David S. Miller <davem@davemloft.net>
11030 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11031 is_symbolless parameter.
11032 (Output_reloc<SHT_REL>::is_symbolless): New.
11033 (Output_reloc<SHT_REL>::is_symbolless_): New.
11034 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11035 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11036 (Output_reloc<SHT_RELA>::is_symbolless): New.
11037 (Output_data_reloc::add_global): Handle is_symbolless.
11038 (Output_data_reloc::add_global_relative): Likewise.
11039 (Output_data_reloc::add_local): Likewise.
11040 (Output_data_reloc::add_local_relative): Likewise.
11041 (Output_data_reloc::add_symbolless_global_addend): New.
11042 (Output_data_reloc::add_symbolless_local_addend): New.
11043 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11045 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11046 instead of ->is_relative_
11047 (Output_reloc::write): Likewise.
11048 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11049 (Output_reloc::write_rel): Simplify.
11051 * sparc.cc (Target_sparc::Scan::local): Use
11052 ->add_symbolless_local_addend as needed.
11053 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11054 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11055 based upon relocation offset.
11057 2010-02-11 Doug Kwan <dougkwan@google.com>
11059 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11060 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11061 beginning of function.
11062 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11063 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11064 parameter is_32bit in calls to should_apply_static_reloc.
11065 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11066 (check_DATA): Add arm_abs_global.stdout.
11067 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11068 arm_abs_global.stdout): New rules.
11069 (MOSTLLYCLEANFILES): Add arm_abs_global
11070 * Makefile.in: Regenerate.
11071 * testsuite/arm_abs_global.s: New file.
11072 * testsuite/arm_abs_global.sh: Ditto.
11073 * testsuite/arm_abs_lib.s: Ditto.
11075 2010-02-11 Ian Lance Taylor <iant@google.com>
11077 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11079 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11080 Allocate_commons_task first.
11081 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11082 task, rather than symtab_lock_.
11083 (Gc_process_relocs::~Gc_process_relocs): New function.
11084 (Gc_process_relocs::is_runnable): Check this_blocker_.
11085 (Gc_process_relocs::locks): Use next_blocker_ rather than
11087 (Scan_relocs::~Scan_relocs): New function.
11088 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11090 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11092 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11093 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11094 constructor accordingly.
11095 (class Gc_process_relocs): Likewise.
11096 (class Scan_relocs): Likewise.
11097 * common.h (class Allocate_commons_task): Remove symtab_lock_
11098 field, and corresponding constructor parameter.
11099 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11101 (Allocate_commons_task::locks): Likewise.
11103 2010-02-11 Ian Lance Taylor <iant@google.com>
11105 * gold-threads.h (class Once): Define.
11106 (class Initialize_lock): Rewrite as child of Once.
11107 * gold-threads.cc (class Once_initialize): Define.
11108 (once_pointer_control): New static variable.
11109 (once_pointer, once_arg): New static variables.
11110 (c_run_once): New static function.
11111 (Once::Once, Once::run_once, Once::internal_run): New functions.
11112 (class Initialize_lock_once): Remove.
11113 (initialize_lock_control): Remove.
11114 (initialize_lock_pointer): Remove.
11115 (initialize_lock_once): Remove.
11116 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11117 (Initialize_lock::initialize): Rewrite.
11118 (Initialize_lock::do_run_once): New function.
11119 * archive.cc (Archive::interpret_header): Only clear name if it is
11121 * fileread.cc: Include "gold-threads.h"
11122 (file_counts_lock): New static variable.
11123 (file_counts_initialize_lock): Likewise.
11124 (File_read::release): Only increment counts when using --stats.
11125 Use a lock around the increment.
11126 * parameters.cc (class Set_parameters_target_once): Define.
11127 (set_parameters_target_once): New static variable.
11128 (Parameters::Parameters): Move here from parameters.h.
11129 (Parameters::set_target): Rewrite.
11130 (Parameters::set_target_once): New function.
11131 (Parameters::clear_target): Move here and rewrite.
11132 * parameters.h (class Parameters): Update declarations. Add
11133 set_parameters_target_once_ field.
11134 (Parameters::Parameters): Move to parameters.cc.
11135 (Parameters::clear_target): Likewise.
11136 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11138 (Start_group::~Start_group): New function.
11139 (Start_group::is_runnable): New function.
11140 (Start_group::locks, Start_group::run): New functions.
11141 (Finish_group::run): Change saw_undefined to size_t.
11142 * readsyms.h (class Start_group): Define.
11143 (class Finish_group): Change saw_undefined_ field to size_t.
11144 (Finish_group::Finish_group): Remove saw_undefined and
11145 this_blocker parameters. Change all callers.
11146 (Finish_group::set_saw_undefined): New function.
11147 (Finish_group::set_blocker): New function.
11148 * symtab.h (class Symbol_table): Change saw_undefined to return
11149 size_t. Change saw_undefined_ field to size_t.
11150 * target-select.cc (Set_target_once::do_run_once): New function.
11151 (Target_selector::Target_selector): Initialize set_target_once_
11152 field. Don't initialize lock_ and initialize_lock_ fields.
11153 (Target_selector::instantiate_target): Rewrite.
11154 (Target_selector::set_target): New function.
11155 * target-select.h (class Set_target_once): Define.
11156 (class Target_selector): Update declarations. Make
11157 Set_target_once a friend. Remove lock_ and initialize_lock_
11158 fields. Add set_target_once_ field.
11160 2010-02-10 Ian Lance Taylor <iant@google.com>
11162 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11163 queueing any tasks.
11164 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11165 (queue_middle_tasks): Add all blockers before queueing any tasks.
11166 (queue_final_tasks): Likewise.
11167 * token.h (Task_token::add_blockers): New function.
11168 * object.h (Input_objects::number_of_relobjs): New function.
11170 2010-02-10 Ian Lance Taylor <iant@google.com>
11172 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11173 shared, not if not position independent.
11174 * x86_64.cc (Relocate::relocate_tls): Likewise.
11175 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11176 (tls_pie_pic_test): New target.
11177 * testsuite/Makefile.in: Rebuild.
11179 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11180 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11181 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11182 * testsuite/Makefile.in: Rebuild.
11184 2010-02-09 David S. Miller <davem@davemloft.net>
11186 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11187 R_SPARC_RELATIVE using ->add_local_relative().
11188 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11190 * output.h (Output_data_dynamic::add_section_size): New method
11191 that takes two Output_data objects.
11192 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11193 entry param. Handle it in initializers.
11194 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11195 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11196 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11198 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11199 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11200 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11201 for dynrel_includes_plt.
11202 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11203 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11204 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11206 (Target_sparc::do_finalize_sections): Update to pass true for
11207 dynrel_includes_plt.
11208 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11209 output before .rela.plt
11210 (Target_powerpc::do_finalize_sections): Update to pass true for
11211 dynrel_includes_plt when 32-bit.
11213 2010-02-08 Doug Kwan <dougkwan@google.com>
11215 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11217 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11218 Arm_relobj::scan_section_for_cortex_a8_stubs,
11219 Arm_relobj::do_relocation_section): Instead of calling
11220 Output_section::output_address, use faster
11221 Arm_relobj::simple_input_section_output_address.
11223 2010-02-08 David S. Miller <davem@davemloft.net>
11225 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11226 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11227 relocation helper function.
11229 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11230 just like R_SPARC_GOT{10,13,22}.
11231 (Target_sparc::Scan::local): Likewise.
11232 (Target_sparc::Relocate:relocate): Likewise.
11234 2010-02-06 Ian Lance Taylor <iant@google.com>
11236 * configure.ac: Rewrite targetobjs duplicate removal code to use
11237 only shell constructs.
11238 * configure: Rebuild.
11240 2010-02-05 Doug Kwan <dougkwan@google.com>
11243 * arm.cc (Arm_relobj::section_is_scannable): New method.
11244 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11245 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11247 2010-02-04 Doug Kwan <dougkwan@google.com>
11250 * arm-reloc-property.cc (cstdio): Include.
11251 * configure.ac (targetobjs): Remove duplicates.
11252 * configure: Regenerate.
11253 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11254 big and little endian version for a given address size.
11256 2010-02-03 Doug Kwan <dougkwan@google.com>
11258 * arm-reloc-property.cc
11259 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11261 * arm-reloc-property.h
11262 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11263 New method definition.
11264 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11266 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11268 (GOT_PREL): Change implemented to Y.
11269 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11270 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11271 (Arm_relocate_functions::movw_abs_nc): Remove method.
11272 (Arm_relocate_functions::movt_abs): Ditto.
11273 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11274 (Arm_relocate_functions::thm_movt_abs): Ditto.
11275 (Arm_relocate_functions::movw_rel_nc): Ditto.
11276 (Arm_relocate_functions::movw_rel): Ditto.
11277 (Arm_relocate_functions::movt_rel): Ditto.
11278 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11279 (Arm_relocate_functions:thm_movw_rel): Ditto.
11280 (Arm_relocate_functions:thm_movt_rel): Ditto.
11281 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11282 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11283 New method definitions.
11284 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11285 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11286 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11287 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11288 (Target_arm::Relocate::relocate): Check for non-static or
11289 unimplemented relocation code and exit early. Change calls to
11290 Target_arm::reloc_uses_thumb_bit and
11291 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11292 instead. Refactor code to handle similar relocations to increase
11293 code sharing. Remove check for unsupported relocation code in switch
11295 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11296 relocation property table to find out size. Change error message to
11297 print out the name of a relocation code instead of the numeric value.
11298 (Target_arm::scan_reloc_for_stub): Use relocation property table
11299 instead of calling Target_arm::reloc_uses_thumb_bit().
11301 2010-02-02 Doug Kwan <dougkwan@google.com>
11303 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11304 types of relaxed input section.
11306 2010-02-02 Doug Kwan <dougkwan@google.com>
11308 * Makefile.am (HFILES): Add arm-reloc-property.h.
11310 (TARGETSOURCES): Add arm-reloc-property.cc
11311 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11312 (libgold_a_SOURCES): $(DEFFILES)
11313 * Makefile.in: Regenerate.
11314 * arm-reloc-property.cc: New file.
11315 * arm-reloc-property.h: New file.
11316 * arm-reloc.def: New file.
11317 * arm.cc: Update comments.
11318 (arm-reloc-property.h): New included header.
11319 (arm_reloc_property_table): New global variable.
11320 (Target_arm::do_select_as_default_target): New method definition.
11321 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11322 arm-reloc-property to targ_extra_obj.
11323 * parameters.cc (set_parameters_target): Call
11324 Target::select_as_default_target().
11325 * target.h (Target::select_as_default_target): New method definition.
11326 (Target::do_select_as_default_target): Same.
11328 2010-02-01 Doug Kwan <dougkwan@google.com>
11330 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11331 first_output_text_section_.
11332 (Arm_exidx_fixup::first_output_text_section): New method definition.
11333 (Arm_exidx_fixup::first_output_text_section_): New data member.
11334 (Arm_exidx_fixup::process_exidx_section): Record the first text
11335 output section seen.
11336 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11337 and entsize in output section header.
11339 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11341 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11342 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11343 (Arm_relocate_functions::thm_alu11): New Method.
11344 (Arm_relocate_functions::thm_pc8): New Method.
11345 (Arm_relocate_functions::thm_pc12): New Method.
11346 (Target_arm::Scan::local): Handle the relocations.
11347 (Target_arm::Scan::global): Likewise.
11348 (Target_arm::Relocate::relocate): Likewise.
11349 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11351 2010-01-29 Doug Kwan <dougkwan@google.com>
11353 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11354 of relocation types as ld.
11356 2010-01-29 Doug Kwan <dougkwan@google.com>
11358 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11360 (Arm_relocate_functions::thumb_branch_common): Ditto.
11361 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11362 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11363 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11364 Arm_relocate_functions::jump24): Remove.
11365 (Target_arm::Relocate::relocate): Adjust code to call
11366 Arm_relocation_functions::arm_branch_common and
11367 Arm_relocation_functions::thumb_branch_common instead of their removed
11368 wrappers. Merge switch-cases together to reduce source code size.
11370 2010-01-29 Doug Kwan <dougkwan@google.com>
11372 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11373 output_local_symbol_count_needs_update_.
11374 (Arm_relobj::output_local_symbol_count_needs_update,
11375 Arm_relobj::set_output_local_symbol_count_needs_update,
11376 Arm_relobj::update_output_local_symbol_count): New methods.
11377 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11379 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11380 of pointed function as in a R_ARM_PREL31 relocation.
11381 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11382 for output local symbol count updating.
11383 (Target_arm::do_relax): Update output local symbol counts in objects
11385 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11387 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11389 * arm.cc: Added support for the ARM relocations:
11390 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11391 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11392 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11394 (Arm_relocate_functions::movw_rel): New method.
11395 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11396 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11398 (Arm_relocate_functions::thm_movw_rel): New method.
11399 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11401 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11403 (Target_arm::Scan::global): Likewise.
11404 (Target_arm::Relocate::relocate): Likewise.
11405 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11408 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11410 * arm.cc: Added support for ARM group relocations.
11411 (Target_arm::reloc_needs_sym_origin): New method.
11412 (Arm_relocate_functions::calc_grp_kn): New method.
11413 (Arm_relocate_functions::calc_grp_residual): New method.
11414 (Arm_relocate_functions::calc_grp_gn): New method.
11415 (Arm_relocate_functions::arm_grp_alu): New Method.
11416 (Arm_relocate_functions::arm_grp_ldr): New Method.
11417 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11418 (Arm_relocate_functions::arm_grp_ldc): New Method.
11419 (Target_arm::Scan::local): Handle the ARM group relocations.
11420 (Target_arm::Scan::global): Likewise.
11421 (Target_arm::Relocate::relocate): Likewise.
11422 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11425 2010-01-26 Doug Kwan <dougkwan@google.com>
11427 * arm.cc (set): Include.
11428 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11430 (Arm_output_section::Text_section_list): New type.
11431 (Arm_output_section::append_text_sections_to_list): New method.
11432 (Arm_output_section::fix_exidx_coverage): Ditto.
11433 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11434 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11435 Relobj::set_section_offset() instead of
11436 Sized_relobj::invalidate_section_offset().
11437 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11438 parameter for section headers. Ignore relocation sections for
11439 unallocated sections and EXIDX sections.
11440 (Target_arm::fix_exidx_coverage): New method.
11441 (Target_arm::output_section_address_less_than): New type.
11442 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11443 linked text section instead of the EXIDX section.
11444 (Arm_output_section::create_stub_group): Add an assertion to check
11445 that this is not an EXIDX output section.
11446 (Arm_output_section::append_text_sections_to_list): New method.
11447 (Arm_output_section::fix_exidx_coverage): Ditto.
11448 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11449 Arm_relobj::section_needs_reloc_stub_scanning.
11450 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11452 (Target_arm::fix_exidx_coverage): New method.
11453 * object.h (Relobj::set_output_section): New method.
11454 (Sized_relobj::invalidate_section_offset): Remove method.
11455 (Sized_relobj::do_invalidate_section_offset): Remove method.
11456 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11458 2010-01-25 Doug Kwan <dougkwan@google.com>
11460 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11461 Fix warning due to signed and unsigned comparison on a 32-bit host.
11463 2010-01-22 Doug Kwan <dougkwan@google.com>
11465 * arm.cc (Target_arm::do_relax): Record an output section for section
11466 offset adjustment it contains any stub table that has changed.
11467 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11468 offsets in an output section if necessary.
11469 * output.cc (Output_section::Output_section): Initialize
11470 section_offsets_need_adjustments_.
11471 (Output_section::add_input_section_for_script): Renamed to
11472 Output_section::add_simple_input_section.
11473 (Output_section::save_states): Add a comment.
11474 (Output_section::discard_states): New method defintion.
11475 (Output_section::adjust_section_offsets): Same.
11476 * output.h (Output_section::add_input_section_for_script): Renamed to
11477 Output_section::add_simple_input_section.
11478 (Output_section::discard_states): New method declaration.
11479 (Output_section::adjust_section_offsets): Same.
11480 (Output_section::section_offsets_need_adjustment,
11481 Output_section::set_section_offsets_need_adjustment): New method
11483 (Output_section::section_offsets_need_adjustment_): New data member.
11484 * script-sections.cc
11485 (Output_section_element_input::set_section_address): Adjust code for
11486 renaming of Output_section::add_input_section_for_script.
11487 (Orphan_output_section::set_section_address): Same.
11489 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11491 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11492 Fix_v4bx enum values .
11493 * gold/options.h (General_options): New option definitions.
11494 (General_options::fix_v4bx): New method.
11495 (General_options::Fix_v4bx): New enum.
11496 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11497 (General_options::parse_fix_v4bx_interworking): New method.
11499 2010-01-22 Doug Kwan <dougkwan@google.com>
11501 * arm.cc (Arm_exidx_fixup): New class.
11503 2010-01-21 Doug Kwan <dougkwan@google.com>
11505 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11507 (Arm_exidx_section_offset_map): New type.
11509 2010-01-21 Doug Kwan <dougkwan@google.com>
11511 * arm.cc (Arm_exidx_input_section): New class.
11512 (Arm_relobj::exidx_input_section_by_link,
11513 Arm_relobj::exidx_input_section_by_shndx,
11514 Arm_relobj::make_exidx_input_section): New methods.
11515 (read_arm_attributes_section): Remove.
11516 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11517 information about them.
11518 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11521 2010-01-20 Doug Kwan <dougkwan@google.com>
11523 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11524 Input_section_specifier to Section_id.
11525 (Target_arm::new_arm_input_section: Adjust code for change of key
11527 (Target_arm::find_arm_input_section): Ditto.
11528 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11529 (Section_id): Remove.
11530 (Garbage_collection::Section_id_hash): Remove.
11531 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11532 (Section_id): Remove.
11533 (Icf::Section_id_hash): Remove.
11534 * object.h (Section_id, Const_section_id, Section_id_hash,
11535 Const_section_id_hash): New type definitions.
11536 * output.cc (Output_section::add_relaxed_input_section): Change to
11537 use Const_section_id instead of Input_section_specifier as key type.
11538 (Output_section::add_merge_input_section): Ditto.
11539 (Output_section::build_relaxation_map): Change to use Section_id
11540 instead of Input_section_specifier as key type.
11541 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11543 (Output_section::convert_input_sections_to_relaxed_sections): Change
11544 to use Const_section_id instead of Input_section_specifier as key type.
11545 (Output_section::find_merge_section): Ditto.
11546 (Output_section::find_relaxed_input_section): Ditto.
11547 * output.h (Input_section_specifier): Remove class.
11548 (Output_section::Output_section_data_by_input_section_map): Change
11549 key type to Const_section_id.
11550 (Output_section::Output_relaxed_input_section_by_input_section_map):
11552 (Output_section::Relaxation_map): Change key type to Section_id.
11554 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11556 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11557 (class Arm_v4bx_stub): New class.
11558 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11559 (Stub_factory::make_arm_v4bx_stub): New method.
11560 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11561 (Stub_table::empty): Handle v4bx stubs.
11562 (Stub_table::add_arm_v4bx_stub): New method.
11563 (Stub_table::find_arm_v4bx_stub): New method.
11564 (Arm_relocate_functions::v4bx): New method.
11565 (Target_arm::fix_v4bx): New method.
11566 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11567 (Stub_table::relocate_stubs): Likewise.
11568 (Stub_table::do_write): Likewise.
11569 (Stub_table::update_data_size_and_addralign): Likewise.
11570 (Stub_table::finalize_stubs): Likewise.
11571 (Target_arm::Scan::local): Likewise.
11572 (Target_arm::Scan::global): Likewise.
11573 (Target_arm::do_finalize_sections): Likewise.
11574 (Target_arm::Relocate::relocate): Likewise.
11575 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11577 (Target_arm::scan_reloc_for_stub): Likewise.
11578 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11580 2010-01-19 Ian Lance Taylor <iant@google.com>
11582 * output.cc (Output_section_headers::do_sized_write): Write large
11583 segment count to sh_info field.
11584 (Output_file_header::do_sized_write): For large segment count,
11585 write PN_XNUM to e_phnum field.
11587 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11589 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11590 (Arm_relocate_functions::thm_jump8): New function.
11591 (Arm_relocate_functions::thm_jump11): New function.
11592 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11594 (Target_arm::Scan::global): Likewise.
11595 (Target_arm::Relocate::relocate): Likewise.
11596 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11599 2010-01-14 Doug Kwan <dougkwan@google.com>
11601 * arm.cc (map, utility): Include headers.
11602 (Target_arm::apply_cortex_a8_workaround): New method.
11603 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11604 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11605 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11606 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11607 the --[no-]fix-cortex-a8 command line options.
11608 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11609 (Target_arm::relocate_stub): Use addend in instruction template.
11610 * options.h (DEFINE_bool): Set the user-set flag.
11611 (General_options): Add --[no-]-fix-cortex options.
11612 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11613 : Update fast look-up map after conversion.
11615 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11617 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11618 in the first pass of do_layout.
11620 2010-01-13 Doug Kwan <dougkwan@google.com>
11622 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11623 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11624 apparent compiler problem of not folding static constant integral
11625 data members of elfcpp::Elf_sizes<32>.
11627 2010-01-13 Doug Kwan <dougkwan@google.com>
11629 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11630 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11631 Arm_relobj::scan_section_for_cortex_a8_erratum,
11632 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11633 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11634 sections to scan for relocation stubs into a new method
11635 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11636 relocation and Cortex-A8 stub scanning.
11637 (Target_arm::do_relax): Force stubs to be after stubbed sections
11638 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11639 the beginning of a new relaxation pass. Update a comment.
11640 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11642 2010-01-12 Ian Lance Taylor <iant@google.com>
11644 * target-reloc.h (visibility_error): New inline function.
11645 (relocate_section): Call visibility_error.
11646 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11647 (MOSTLYCLEANFILES): Likewise.
11648 (protected_4_pic.o, protected_3.err): New targets.
11649 * testsuite/protected_4.cc: New file.
11651 2010-01-12 Doug Kwan <dougkwan@google.com>
11653 * arm.cc (Cortex_a8_reloc): New class.
11654 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11655 and cortex_a8_relocs_info_.
11656 (Target_arm::fix_cortex_a8): New method definition.
11657 (Target_arm::Cortex_a8_relocs_info): New type.
11658 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11659 New data member declarations.
11660 (Target_arm::scan_reloc_for_stub): Record information about
11661 relocations for THUMB branches that might be exempted from the
11662 Cortex-A8 workaround.
11663 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11664 at the beginning of a relaxation pass.
11666 2010-01-12 Doug Kwan <dougkwan@google.com>
11668 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11669 (Arm_relobj::Mapping_symbol_position,
11670 Arm_reloj::Mapping_symbol_position_less,
11671 Arm_relobj::Mapping_symbols_info): New types.
11672 (Target_arm::is_mapping_symbol_name): New method definition.
11673 (Arm_relobj::do_count_local_symbols): Save information about mapping
11676 2010-01-11 Doug Kwan <dougkwan@google.com>
11678 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11679 Arm_relocate_functions::thumb32_branch_upper,
11680 Arm_relocate_functions::thumb32_branch_lower,
11681 Arm_relocate_functions::thumb32_cond_branch_offset,
11682 Arm_relocate_functions::thumb32_cond_branch_upper,
11683 Arm_relocate_functions::thumb32_cond_branch_lower,
11684 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11685 branch offset encoding.
11686 (Arm_relocate_functions::thumb_branch_common): Use new branch
11687 offset encoding methods to avoid code duplication.
11688 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11689 (Stub_addend_reader::operator()): Use new branch encoding method
11690 to avoid code duplication.
11692 2010-01-11 Doug Kwan <dougkwan@google.com>
11694 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11695 (Target_arm::do_finalize_sections): Define special EXIDX section
11696 symbols only if referenced.
11697 * gc.h (Garbage_collection::add_reference): New method.
11698 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11701 2010-01-11 Ian Lance Taylor <iant@google.com>
11703 * script.cc (Version_script_info::build_expression_list_lookup):
11704 Change complaing about duplicate wildcard match from error to
11707 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11709 (Version_script_info::Version_script_info): Initialize globs_,
11710 default_version_, default_is_global_, and exact_. Don't
11711 initialize globals_ or locals_.
11712 (Version_script_info::build_lookup_tables): Build local symbols
11714 (Version_script_info::unquote): New function.
11715 (Version_script_info::add_exact_match): New function.
11716 (Version_script_info::build_expression_list_lookup): Remove lookup
11717 parameter. Add is_global parameter. Change all callers. Handle
11718 wildcard pattern specially. Unquote pattern. Call
11720 (Version_script_info::get_name_to_match): New function.
11721 (Version_script_info::get_symbol_version): New function.
11722 (Version_script_info::get_symbol_version_helper): Remove.
11723 (Version_script_info::check_unmatched_names): Call unquote.
11724 * script.h (class Version_script_info): Change get_symbol_version
11725 to be non-inline and add is_global parameter; change all callers.
11726 Rewrite symbol_is_local. Update declarations. Define struct
11727 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11728 Remove globals_ and locals_ members. Add exact_, globs_,
11729 default_version_, is_global_.
11730 (Version_script_info::Glob): Remove pattern, add expression and
11731 is_global. Update constructor. Change all callers.
11732 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11734 (Versions::symbol_section_contents): If a symbol is undefined, or
11735 defined in a dynamic object, set the version index to
11737 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11739 (Symbol_table::add_from_pluginobj): Likewise.
11740 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11742 2010-01-11 Doug Kwan <dougkwan@google.com>
11744 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11745 (incremental_dump_LDADD): Add linking option for libintl.
11746 * Makefile.in: Regenerate.
11748 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11751 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11753 * testsuite/Makefile.in: Regenerated.
11755 2010-01-10 Doug Kwan <dougkwan@google.com>
11757 * options.h (DEFINE_var): Use parentheses around argument varname__
11758 in macro body to avoid any unintended subsequent substitutions.
11760 2010-01-10 Ian Lance Taylor <iant@google.com>
11762 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11763 candidates before doing symbol resolution.
11765 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11766 ODR candidates if only one is weak.
11768 2010-01-08 Ian Lance Taylor <iant@google.com>
11770 * script.cc (Version_script_info::build_expression_list_lookup):
11771 Don't warn about ambiguous version, just record the ambiguity.
11772 (Version_script_info::get_symbol_version_helper): Give error if
11773 version is ambiguous.
11775 2010-01-08 Doug Kwan <dougkwan@google.com>
11777 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11778 prev_data_size_ and prev_addralign_. Remove initializer for
11779 deleted data member has_been_changed_.
11780 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11781 to determine if the table is empty.
11782 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11784 (Stub_table::add_reloc_stub): Define method in class definition
11785 instead of just declaring it there.
11786 (Stub_table::add_cortex_a8_stub): New method definition.
11787 (Stub_table::update_data_size_and_addralign): Ditto.
11788 (Stub_table::finalize_stubs): Ditto.
11789 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11790 (Stub_table::do_addralign_): Return address alignment in the
11791 (Stub_table::do_reset_address_and_file_offset): Define method in
11792 class definition instead of declaring it there. Set current data
11793 size to be the data size of the previous pass.
11794 (Stub_table::set_final_data_size): Use current data size as the
11796 (Stub_table::relocate_stub): Change parameter type of stub from
11797 Reloc_stub pointer to Stub pointer.
11798 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11799 (Stub_table::Cortex_a8_stub_list): New typedef.
11800 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11801 Stub_table::prev_addralign_): New data member.
11802 (Arm_relobj::Arm_relobj): Initialize data member
11803 section_has_cortex_a8_workaround_.
11804 (Arm_relobj::section_has_cortex_a8_workaround,
11805 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11807 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11809 (Target_arm::relocate_stub): Change parameter type of stub from
11810 Reloc_stub pointer to Stub pointer.
11811 (Insn_template::size, Insn_template::alignment): Handle
11812 THUMB16_SPECIAL_TYPE.
11813 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11814 Stub_table::update_data_size_and_addralign,
11815 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11817 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11818 (Stub_table::do_write): Ditto.
11819 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11821 2010-01-08 Ian Lance Taylor <iant@google.com>
11824 * symtab.h (class Symbol): Remove fields is_target_special_ and
11825 has_plt_offset_. Add field is_defined_in_discarded_section_.
11826 (Symbol::is_defined_in_discarded_section): New function.
11827 (Symbol::set_is_defined_in_discarded_section): New function.
11828 (Symbol::has_plt_offset): Rewrite.
11829 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11830 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11831 Don't initialize is_target_special_ or has_plt_offset_.
11832 Initialize is_defined_in_discarded_section_.
11833 (Symbol_table::add_from_relobj): If appropriate, set
11834 is_defined_in_discarded_section.
11835 * resolve.cc (Symbol::override_base_with_special): Don't test
11836 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11837 * target-reloc.h (relocate_section): Do special handling for
11838 symbols defined in discarded sections for global symbols as well
11841 2010-01-08 Ian Lance Taylor <iant@google.com>
11843 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11844 the SHT_SYMTAB case.
11846 2010-01-08 Ian Lance Taylor <iant@google.com>
11848 * object.cc (Sized_relobj::do_layout): Don't get confused if
11849 layout_eh_frame returns NULL.
11851 2010-01-08 Ian Lance Taylor <iant@google.com>
11854 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11855 dynamic symbol table, use the normal symbol table.
11856 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11859 2010-01-08 Ian Lance Taylor <iant@google.com>
11862 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11865 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11867 * version.cc (print_version): Change to "Copyright 2010".
11869 2010-01-08 Ian Lance Taylor <iant@google.com>
11873 * i386.cc (class Target_i386): Change return type of plt_section
11875 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11876 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11877 tls_desc_rel_ field.
11878 (Output_data_plt_i386::rel_tls_desc): New function.
11879 (Target_i386::rel_tls_desc_section): New function.
11880 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11881 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11882 R_386_TLS_DESC reloc in rel_tls_desc_section.
11883 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11884 Define struct Tlsdesc_info.
11885 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11886 (Target_x86_64::do_reloc_symbol_index): New function.
11887 (Target_x86_64::add_tlsdesc_info): New function.
11888 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11889 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11890 tlsdesc_rel_ field.
11891 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11893 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11894 (Target_x86_64::rela_tlsdesc_section): New function.
11895 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11897 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11898 (Target_x86_64::do_reloc_addend): New function.
11899 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11900 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11901 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11902 (Output_reloc::type): New function.
11903 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11904 (Output_reloc::is_target_specific): New function.
11905 (Output_reloc::target_arg): New function.
11906 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11907 absolute relocs and target specific relocs.
11908 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11909 add_target_specific.
11910 (class Output_data_reloc) [SHT_RELA]: Likewise.
11911 * output.cc (Output_reloc::Output_reloc): Add four new versions
11912 for absolute relocs and target specific relocs.
11913 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11914 (Output_reloc::get_symbol_index): Likewise.
11915 (Output_reloc::local_section_offset): Check that local_sym_index_
11916 is not TARGET_CODE or 0.
11917 (Output_reloc::symbol_value): Likewise.
11918 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11920 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11921 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11923 * layout.cc (add_target_dynamic_tags): Use output section for
11924 DT_PLTRELSZ and DT_JMPREL.
11926 2010-01-07 Ian Lance Taylor <iant@google.com>
11929 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11931 (class Output_data_reloc_generic): Define.
11932 (class Output_data_reloc_base): Change base class to
11933 Output_data_reloc_generic. Change add() method to call
11934 bump_relative_reloc_count for a relative reloc. Remove
11935 sort_relocs_ field.
11936 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11938 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11939 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11941 * layout.h (class Layout): Update declaration.
11943 2010-01-07 Ian Lance Taylor <iant@google.com>
11945 * output.h (class Output_data): Add const version of
11946 output_section and do_output_section.
11947 (class Output_section_data): Add const version of
11949 (class Output_section): Likewise.
11950 * layout.cc (Layout::add_target_dynamic_tags): New function.
11951 * layout.h (class Layout): Update declarations.
11952 * arm.cc (Target_arm::do_finalize_sections): Use
11953 add_target_dynamic_tags.
11954 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11955 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11956 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11957 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11959 2010-01-07 Ian Lance Taylor <iant@google.com>
11962 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11965 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11966 Ian Lance Taylor <iant@google.com>
11969 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11970 Xindex::read_symtab_xindex.
11972 2010-01-07 Doug Kwan <dougkwan@google.com>
11974 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11975 (Insn_template::thumb16_bcond_insn): New method declaration.
11976 (Insn_template): Fix spelling.
11977 (Stub::thumb16_special): New method declaration.
11978 (Stub::do_write): Define virtual method which was previously pure
11980 (Stub::do_thumb16_special): New method declaration.
11981 (Stub::do_fixed_endian_write): New template member.
11982 (Reloc_stub::do_write): Remove.
11983 (Reloc_stub::do_fixed_endian_write): Remove.
11984 (Cortex_a8_stub): New class definition.
11985 (Stub_factory::make_cortex_a8_stub): New method definition.
11986 (Stub_factory::Stub_factory): Add missing static storage class
11987 qualifier for elf32_arm_stub_a8_veneer_blx.
11989 2010-01-07 Ian Lance Taylor <iant@google.com>
11992 * options.h (class General_options): Add --warn-unresolved-symbols
11993 and --error-unresolved-symbols.
11994 * errors.cc (Errors::undefined_symbol): Implement
11995 --warn-unresolved-symbols.
11997 * options.h (class General_options): Add -z text and -z textoff.
11998 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12000 2010-01-06 Sriraman Tallam <tmsriram@google.com>
12002 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12003 (Garbage_collection::cident_sections): New function.
12004 (Garbage_collection::add_cident_section): New function.
12005 (Garbage_collection::cident_sections_): New member.
12006 (gc_process_relocs): Add references to sections whose names are C
12008 * gold.h (cident_section_start_prefix): New constant.
12009 (cident_section_stop_prefix): New constant.
12010 (is_cident): New function.
12011 * layout.cc (Layout::define_section_symbols): Replace string constants
12012 with the newly defined constants.
12013 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12015 * testsuite/Makefile.am: Add gc_orphan_section_test.
12016 * testsuite/Makefile.in: Regenerate.
12017 * testsuite/gc_orphan_section_test.cc: New file.
12018 * testsuite/gc_orphan_section_test.sh: New file.
12020 2010-01-06 Ian Lance Taylor <iant@google.com>
12023 * options.h (class General_options): Add --warn-shared-textrel.
12024 * layout.cc (Layout::finish_dynamic_section): Implement
12025 --warn-shared-textrel.
12028 * options.h (class General_options): Add --warn-multiple-gp.
12030 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12032 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12033 $(THREADSLIB) and $(LIBDL).
12034 * Makefile.in: Rebuild.
12036 2010-01-06 Ian Lance Taylor <iant@google.com>
12039 * options.cc (General_options::parse_section_start): New function.
12040 (General_options::section_start): New function.
12041 (General_options::General_options): Initialize all members.
12042 * options.h: Include <map>
12043 (class General_options): Add --section-start. Add section_starts_
12045 * layout.cc (Layout::attach_allocated_section_to_segment): If
12046 --section-start was used, set the address of the segment. Remove
12047 local sort_sections.
12048 (Layout::relaxation_loop_body): If the address of the load segment
12049 has been set by --section-start, don't use it.
12050 * output.h (Output_segment::update_flags_for_output_section): New
12052 * output.cc (Output_segment::add_output_section): Call
12053 update_flags_for_output_section.
12055 2010-01-05 Ian Lance Taylor <iant@google.com>
12058 * options.h (class General_options): Add --undefined-version.
12059 * script.cc (struct Version_expression): Add was_matched_by_symbol
12061 (Version_script_info::matched_symbol): New function.
12062 (Version_script_info::get_symbol_version_helper): Call
12064 (Version_script_info::check_unmatched_names): New function.
12065 * script.h (class Version_script_info): Update declarations.
12066 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12068 * options.h (class General_options): Use DEFINE_bool_alias for
12069 allow_multiple_definition.
12070 * resolve.cc (Symbol_table::should_override): Don't test
12071 allow_multiple_definition.
12074 * options.h (class General_options): Add --cref.
12075 * main.cc (main): Print cref table if --cref. Don't close mapfile
12076 until after printing cref table.
12077 * cref.cc: Include "symtab.h".
12078 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12079 (Cref_table_compare::operator()): New function.
12080 (Cref_inputs::gather_cref): New function.
12081 (filecol): New static const.
12082 (Cref_inputs::print_cref): New function.
12083 (Cref::print_cref): New function.
12084 * cref.h: Include <cstdio>.
12085 (class Cref): Update declarations.
12086 * mapfile.h (Mapfile::file): New function.
12087 * object.h (class Object): Define Symbols. Declare virtual
12088 do_get_global_symbols.
12089 (Object::get_global_symbols): New function.
12090 * object.cc (Input_objects::add_object): Pass object to cref_ if
12092 (Input_objects::archive_start): Likewise.
12093 (Input_objects::archive_stop): Likewise.
12094 (Input_objects::print_cref): New function.
12095 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12096 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12098 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12100 * plugin.h (class Sized_pluginobj): Update declarations.
12102 2010-01-05 Ian Lance Taylor <iant@google.com>
12104 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12105 to is_default_version. Rename insdef to insdefault.
12106 (Symbol_table::add_from_relobj): Rename def to is_default_version
12107 and local to is_forced_local.
12108 (Symbol_table::add_from_pluginobj): Likewise.
12109 (Symbol_table::add_from_dynobj): Likewise.
12110 (Symbol_table::define_special_symbol): Rename insdef to
12113 2010-01-04 Ian Lance Taylor <iant@google.com>
12116 * options.h (class General_options): Add
12117 --allow-multiple-definition and -z muldefs.
12118 * resolve.cc (Symbol_table::should_override): Don't warn about a
12119 multiple symbol definition if --allow-multiple-definition or -z
12123 * options.h (class General_options): Add --add-needed and
12124 --copy-dt-needed-entries. Tweak --as-needed help entry.
12125 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12126 error if --copy-dt-needed-entries aka --add-needed is used and
12127 would cause a change in behaviour.
12130 * options.h (class General_options): Add -G as a short version of
12131 --shared. Add no-op options -assert, -g, and -i.
12133 2010-01-04 Sriraman Tallam <tmsriram@google.com>
12135 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12136 check for .text or .gnu.linkonce.t sections.
12137 * icf.cc (Icf::find_identical_sections): Ditto.
12138 Change the detection for mangled function name within the section
12140 * icf.h (is_section_foldable_candidate): New function.
12142 2009-12-30 Ian Lance Taylor <iant@google.com>
12145 * options.h (class General_options): Permit two dashes with
12146 --retain-symbols-file.
12148 2009-12-30 Ian Lance Taylor <iant@google.com>
12151 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12152 don't put the file header and segment headers in the text
12156 * common.cc (Sort_commons::operator()): Stabilize sort when both
12158 (Symbol_table::do_allocate_commons_list): When allocating common
12159 symbols, skip a symbol which is no longer common.
12160 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12161 an object before checking its type.
12162 * testsuite/common_test_2.c: New file.
12163 * testsuite/common_test_3.c: New file.
12164 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12165 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12166 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12167 (common_test_2_pic.o, common_test_2.so): New targets.
12168 (common_test_3_pic.o, common_test_3.so): New targets.
12169 * testsuite/Makefile.in: Rebuild.
12172 * script.cc (read_input_script): If we see a new SECTIONS clause,
12173 and we have added an input section, give an error.
12174 * layout.h (class Layout): Add have_added_input_section function.
12175 Add have_added_input_section_ field.
12176 * layout.cc (Layout::Layout): Initialize
12177 have_added_input_section_.
12178 (Layout::layout): Set have_added_input_section_.
12179 (Layout::layout_eh_frame): Likewise.
12181 2009-12-30 Ian Lance Taylor <iant@google.com>
12184 * options.h (class General_options): Add --sort-common option.
12185 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12186 * common.cc (Sort_common): Add sort_order parameter to
12187 constructor. Add sort_order_ field.
12188 (Sort_commons::operator): Check sort_order_.
12189 (Symbol_table::allocate_commons): Determine the sort order.
12190 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12191 Change all callers.
12192 (Symbol_table::do_allocate_commons_list): Likewise.
12194 2009-12-30 Ian Lance Taylor <iant@google.com>
12197 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12198 symbols from this object, don't change the visibility of an
12200 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12202 2009-12-30 Ian Lance Taylor <iant@google.com>
12205 * script.h (class Version_script_info): Define Language enum.
12206 Update declarations. Define Glob, Exact, and Lookup types. Add
12207 new fields globals_, locals_, and is_finalized_.
12208 * script.cc: Various formatting fixes.
12209 (class Parser_closure): Change language_stack_ from a vector of
12210 std::string to one of Version_script_info::Language. Adjust all
12212 (class Lazy_demangler): Remove.
12213 (struct Version_expression): Change language from std::string to
12214 Version_script_info::Language.
12215 (Version_script_info::Version_script_info): New function.
12216 (Version_script_info::~Version_script_info): Don't call clear.
12217 (Version_script_info::finalize): New function.
12218 (Version_script_info::build_lookup_tables): New function.
12219 (Version_script_info::build_expression_list_lookup): New
12221 (Version_script_info::get_symbol_version_helper): Rewrite to use
12223 (Version_script_info::print_expression_list): Adjust to use
12224 Version_script_info::Language.
12225 (script_push_lex_into_version_mode): Check that the version script
12226 has not been finalized.
12227 (version_script_push_lang): Change language string to
12228 Version_script_info::Language.
12229 * options.cc (Command_line::version_script): New function.
12230 * options.h (class General_options): Add finalize_dynamic_list
12231 function. Change version_script from declaration to definition.
12232 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12233 * testsuite/version_script.map: Remove duplicate def of foo.
12234 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12235 version_script.map.
12236 * testsuite/Makefile.in: Rebuild.
12238 2009-12-30 Ian Lance Taylor <iant@google.com>
12241 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12242 if the input symbol index is 0, make the output symbol index 0.
12244 2009-12-30 Ian Lance Taylor <iant@google.com>
12247 * options.h (class General_options): Add -x/--discard-all.
12248 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12249 --discard-all. If the local symbol needs a dynamic entry, check
12250 that before handling --discard-locals.
12252 2009-12-30 Ian Lance Taylor <iant@google.com>
12255 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12257 (Output_segment::add_output_section): Don't change the flags if
12258 the type is PT_TLS.
12261 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12262 GNU hash table if they need a dynamic value. Otherwise, don't add
12263 them if they are defined in a dynamic object or are forced local.
12265 2009-12-29 Ian Lance Taylor <iant@google.com>
12268 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12269 .gnu.hash table for a 32-bit target.
12272 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12273 regular and a dynamic object only needs a dynamic symbol table
12274 entry if it is externally visible.
12277 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12278 constructor. Add global_offset_table_ field.
12279 (Target_i386::got_section): Set global_offset_table_.
12280 (Target_i386::do_finalize_sections): Set global_offset_table_
12282 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12283 in constructor. Add global_offset_table_ field.
12284 (Target_x86_64::got_section): Set global_offset_table_.
12285 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12288 * layout.cc (Layout::Layout): Initialize increase_relro_.
12289 (Layout::get_output_section): Add is_relro, is_last_relro, and
12290 is_first_non_relro parameters. Change all callers.
12291 (Layout::choose_output_section): Likewise.
12292 (Layout::add_output_section_data): Likewise.
12293 (Layout::make_output_section): Likewise.
12294 (Layout::set_segment_offsets): Clear increase_relro when using a
12296 * layout.h (class Layout): Add increase_relro method. Add
12297 increase_relro_ field. Update declarations.
12298 * output.cc (Output_section::Output_section): Initialize
12299 is_last_relro_ and is_first_non_relro_.
12300 (Output_segment::add_output_section): Group relro sections is
12301 do_sort is true. Handle is_last_relro and is_first_non_relro.
12302 (Output_segment::maximum_alignment): Remove relro handling.
12303 (Output_segment::set_section_addresses): Add increase_relro
12304 parameter. Change all callers. Add initial alignment to align
12305 relro sections on separate page. Remove old relro handling.
12306 (Output_segment::set_section_list_addresses): Remove in_relro
12307 parameter. Change all callers.
12308 (Output_segment::set_offset): Add increase parameter. Change all
12309 callers. Remove old relro handling.
12310 * output.h (class Output_section): Add new methods: is_last_relro,
12311 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12312 Add is_last_relro_ and is_first_non_relro_ fields.
12313 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12314 Create separate .got.plt section. Call increase_relro.
12315 * x86_64.cc (Target_x86_64::got_section): Likewise.
12316 * testsuite/relro_script_test.t: Add .got.plt.
12319 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12320 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12321 (Layout::finalize): Call set_dynamic_symbol_size.
12322 (Layout::set_dynamic_symbol_size): New function.
12323 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12324 set_dynamic_symbol_size.
12327 * output.h (class Output_section): Add is_entsize_zero_ field.
12328 * output.cc (Output_section::Output_section): Initialize
12330 (Output_section::set_entsize): If two different entsizes are
12331 requested, force it to zero.
12332 (Output_section::add_input_section): Set flags for .debug_str
12333 before updating section flags. Set entsize.
12334 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12335 and SHF_STRING if all input sections have those flags.
12337 2009-12-29 Rafael Espindola <espindola@google.com>
12339 * main.cc (main): Fix the sys time reporting.
12340 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12343 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12345 * options.cc (General_options::parse_version): Allow -v to exit
12346 without an error if there is nothing to link.
12348 2009-12-29 Ian Lance Taylor <iant@google.com>
12350 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12351 using a version of gcc before 4.1.
12352 * configure: Rebuild.
12354 2009-12-28 Chris Demetriou <cgd@google.com>
12356 * attributes.cc (Output_attributes_section_data::do_write): Use
12357 std::vector::front rather than std::vector::data.
12359 2009-12-28 Ian Lance Taylor <iant@google.com>
12361 * symtab.h (class Symbol_table): Add enum Defined.
12362 * resolve.cc (Symbol_table::should_override): Add defined
12363 parameter. Change all callers. Test whether object is NULL
12364 before calling a method on it.
12365 (Symbol_table::report_resolve_problem): Add defined parameter.
12366 Change all callers.
12367 (Symbol_table::should_override_with_special): Likewise.
12368 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12369 parameter. Change all callers.
12370 (Symbol_table::do_define_in_output_data): Likewise.
12371 (Symbol_table::define_in_output_segment): Likewise.
12372 (Symbol_table::do_define_in_output_segment): Likewise.
12373 (Symbol_table::define_as_constant): Likewise.
12374 (Symbol_table::do_define_as_constant): Likewise.
12375 * script.h (class Symbol_assignment): Add is_defsym parameter to
12376 constructor; change all callers.
12377 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12378 parameter. Change all callers. Add is_defsym_ field.
12379 (class Parser_closure): Add parsing_defsym parameter to
12380 constructor; change all callers. Add parsing_defsym accessor
12381 function. Add parsing_defsym_ field.
12383 2009-12-28 Ian Lance Taylor <iant@google.com>
12385 * gold.cc (queue_middle_tasks): Fix formatting.
12386 * object.cc (Relobj::is_section_name_included): Likewise.
12388 2009-12-23 Ian Lance Taylor <iant@google.com>
12390 * i386.cc (Target_i386::do_calls_non_split): Recognize
12391 -fsplit-stack prologue for a function with a static chain.
12392 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12393 -fsplit-stack prologue when using %r11.
12395 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12397 * options.cc (General_options::parse_version): Make -v continue and do
12398 the link like GNU ld does.
12400 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12402 * Makefile.am (CCFILES): Add timer.cc.
12403 (HFILES): Add timer.h.
12404 * configure.ac: Check for sysconf and times.
12405 * main.cc: include timer.h.
12406 (main): Use Timer instead of get_run_time.
12409 * workqueue.cc: include timer.h.
12410 (Workqueue::find_and_run_task):
12411 Report user, sys and wall time.
12412 * Makefile.in: Regenerate.
12413 * config.in: Regenerate.
12414 * configure: Regenerate.
12416 2009-12-16 Doug Kwan <dougkwan@google.com>
12418 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12420 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12421 relaxed input sections.
12422 * output.cc (Output_section::find_relaxed_input_section): Change
12423 return type to Output_relaxed_input_section pointer. Adjust code
12424 for new type of relaxed_input_section_map_.
12425 * output.h (Output_section::find_relaxed_input_section): Change
12426 return type to Output_relaxed_input_section pointer.
12427 (Output_section::Output_relaxed_input_section_by_input_section_map):
12429 (Output_section::relaxed_input_section_map_): Change type to
12430 Output_section::Output_relaxed_input_section_by_input_section_map.
12431 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12434 2009-12-15 Ian Lance Taylor <iant@google.com>
12436 * layout.cc (Layout::create_shstrtab): Only write out after input
12437 sections if we are compressing debug sections.
12439 2009-12-15 Ian Lance Taylor <iant@google.com>
12441 * archive.cc (Archive::add_symbols): Only look up a symbol without
12442 a version if there is, in fact, a version.
12444 2009-12-14 Ian Lance Taylor <iant@google.com>
12446 Revert -Wshadow changes, all changes from:
12447 2009-12-11 Doug Kwan <dougkwan@google.com>
12448 2009-12-11 Nick Clifton <nickc@redhat.com>
12449 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12451 2009-12-11 Doug Kwan <dougkwan@google.com>
12453 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12455 * attributes.cc (Object_attribute::size): Ditto.
12456 (Attributes_section_data::size): Ditto.
12457 (Attributes_section_data::Attributes_section_data): Ditto.
12458 (Output_attributes_section_data::do_write): Ditto.
12459 * attributes.h (Object_attribute::set_type): Ditto.
12460 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12462 2009-12-11 Nick Clifton <nickc@redhat.com>
12464 * archive.cc: Fix shadowed variable warnings.
12465 * arm.cc: Likewise.
12466 * compressed_output.cc: Likewise.
12467 * compressed_output.h: Likewise.
12468 * configure: Likewise.
12469 * dwarf_reader.cc: Likewise.
12470 * dynobj.cc: Likewise.
12471 * dynobj.h: Likewise.
12472 * ehframe.cc: Likewise.
12473 * ehframe.h: Likewise.
12474 * errors.cc: Likewise.
12475 * expression.cc: Likewise.
12476 * fileread.cc: Likewise.
12477 * fileread.h: Likewise.
12478 * freebsd.h: Likewise.
12479 * i386.cc: Likewise.
12480 * icf.cc: Likewise.
12481 * incremental.h: Likewise.
12482 * layout.cc: Likewise.
12483 * layout.h: Likewise.
12484 * mapfile.cc: Likewise.
12485 * merge.cc: Likewise.
12486 * merge.h: Likewise.
12487 * object.cc: Likewise.
12488 * object.h: Likewise.
12489 * options.h: Likewise.
12490 * output.cc: Likewise.
12491 * output.h: Likewise.
12492 * parameters.cc: Likewise.
12493 * plugin.cc: Likewise.
12494 * powerpc.cc: Likewise.
12495 * reduced_debug_output.cc: Likewise.
12496 * reduced_debug_output.h: Likewise.
12497 * reloc.cc: Likewise.
12498 * reloc.h: Likewise.
12499 * resolve.cc: Likewise.
12500 * script-sections.cc: Likewise.
12501 * script.cc: Likewise.
12502 * script.h: Likewise.
12503 * sparc.cc: Likewise.
12504 * symtab.cc: Likewise.
12505 * symtab.h: Likewise.
12506 * target-select.cc: Likewise.
12507 * target-select.h: Likewise.
12508 * token.h: Likewise.
12509 * workqueue.cc: Likewise.
12510 * workqueue.h: Likewise.
12511 * x86_64.cc: Likewise.
12513 2009-12-10 Doug Kwan <dougkwan@google.com>
12515 * arm.cc (attributes.h): New include.
12516 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12517 (Arm_relobj::~Arm_relobj): Delete object pointed by
12518 attributes_section_data_.
12519 (Arm_relobj::attributes_section_data): New method definition.
12520 (Arm_relobj::attributes_section_data_): New data member declaration.
12521 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12522 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12523 attributes_section_data_.
12524 (Arm_dynobj::attributes_section_data): New method definition.
12525 (Arm_dynobj::attributes_section_data_): New data member declaration.
12526 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12527 initialization value of may_use_blx_ to false.
12528 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12529 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12530 object attributes to compute results instead of hard-coding.
12531 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12532 Target_arm::get_secondary_compatible_arch,
12533 Target_arm::set_secondary_compatible_arch
12534 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12535 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12536 New method declarations.
12537 (Target_arm::get_aeabi_object_attribute): New method definition.
12538 (Target_arm::attributes_section_data_): New data member declaration.
12539 (read_arm_attributes_section): New template definition.
12540 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12541 (Arm_dynobj::do_read_symbols): Ditto.
12542 (Target_arm::do_finalize_sections): Merge attributes sections from
12543 input. Check for BLX use after attributes section merging.
12544 Fix __exidx_start and __exidx_end visibility. Create an
12545 .ARM.attributes section if necessary.
12546 (Target_arm::get_secondary_compatible_arch,
12547 Target_arm::set_secondary_compatible_arch,
12548 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12549 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12550 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12551 New method definitions.
12553 2009-12-09 Ian Lance Taylor <iant@google.com>
12555 * plugin.cc (Plugin::load): Don't cast from void* to a function
12558 2009-12-09 Ian Lance Taylor <iant@google.com>
12560 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12561 information fields.
12563 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12565 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12566 Replace two_file_shared_1.so with two_file_shared_2.so.
12567 * testsuite/Makefile.in: Regenerated.
12569 2009-12-08 Doug Kwan <dougkwan@google.com>
12571 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12572 (HFILES): Add attributes.h and int_encoding.h.
12573 * Makefile.in: Regenerate.
12574 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12575 function definitions to int_encoding.cc
12576 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12577 prototypes to int_encoding.h
12578 * reduced_debug_output.cc (int_encoding.h): New include.
12579 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12580 function definitions to int_encoding.cc
12581 (insert_into_vector, read_from_pointer): Move template definitions to
12583 * attributes.cc: New file.
12584 * attributes.h: New file.
12585 * int_encoding.cc: New file.
12586 * int_encoding.h: New file.
12588 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12591 * incremental-dump.cc (dump_incremental_inputs): New.
12592 (main): Use dump_incremental_inputs.
12594 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12597 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12598 checking elfcpp::STT_FUNC.
12599 (Target_i386::Relocate::relocate): Likewise.
12600 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12602 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12603 symbols from shared libraries into normal FUNC symbols.
12605 * symtab.h (Symbol): Add is_func and use it.
12607 2009-12-05 Doug Kwan <dougkwan@google.com>
12609 * arm.cc (Target_arm::arm_info): Initialize new fields
12610 attributes_section and attributes_vendor.
12611 * i386.cc (Target_i386::i386_info): Same.
12612 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12613 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12614 fields attributes_section and attributes_vendor.
12615 * sparc.cc (Target_sparc::sparc_info): Same.
12616 * target.h (Target::attributes_section, Target::attributes_vendor,
12617 Target::is_attributes_section, Target::attribute_arg_type,
12618 Target::attributes_order): New method definitions.
12619 (Target::Target_info::attributes_section,
12620 Target::Target_info::attributes_vendor): New fields.
12621 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12622 virtual method definitions.
12623 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12624 attributes_section and attributes_vendor.
12625 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12627 2009-12-05 Doug Kwan <dougkwan@google.com>
12629 * arm.cc: Update comments about interworking and stub generation.
12630 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12631 considered as non-PIC.
12632 (Arm_relocate_functions::base_abs): Fix formatting.
12633 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12634 of function to use GOT entry address instead of offset.
12635 (Target_arm::Scan::global): Issue an error if a symbol would need a
12636 PLT does not get one because it is untyped. Remove code to create
12637 dynamic symbols for relative branches.
12638 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12639 takes unsigned integer instead of boolean.
12641 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12643 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12644 (two_file_test_LDADD): Likewise.
12645 (common_test_1_LDADD): Likewise.
12646 (exception_test_LDADD) Likewise.
12647 (weak_test_LDADD): Likewise.
12648 (many_sections_test_LDADD): Likewise.
12649 (initpri1_LDADD): Likewise.
12650 (script_test_1_LDADD): Likewise.
12651 (script_test_2_LDADD): Likewise.
12652 (justsyms_LDADD): Likewise.
12653 (binary_test_LDADD): Likewise.
12654 (large_LDADD): Likewise.
12655 * testsuite/Makefile.in: Regenerated.
12657 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12659 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12660 (Symbol_table::override_with_special): Likewise.
12661 (Symbol_table::add_from_object): Likewise.
12663 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12665 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12666 Don't set the data_offset twice.
12668 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12670 * testsuite/Makefile.in: Regenerate.
12672 2009-12-03 Doug Kwan <dougkwan@google.com>
12674 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12675 (Target_arm::do_finalize_sections): Add parameter for symbol table
12676 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12677 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12678 parameter for symbol table pointer.
12679 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12680 an additional parameter for a pointer to symbol table.
12681 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12682 parameter for a symbol table pointer.
12683 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12684 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12686 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12687 parameter for a symbol table pointer.
12689 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12691 * incremental.cc (Incremental_inputs_header)
12692 (Incremental_inputs_header_write, Incremental_inputs_entry)
12693 (Incremental_inputs_entry_write): Move ...
12694 * incremental.h (Incremental_inputs_header)
12695 (Incremental_inputs_header_write, Incremental_inputs_entry)
12696 (Incremental_inputs_entry_write): here.
12698 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12700 * incremental.cc (make_sized_incremental_binary): Set the target.
12701 Error if it is incompatible.
12702 * output.h (Output_file): Add filename method.
12704 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12706 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12707 from the get_* methods.
12709 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12711 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12712 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12713 Write 0 for the data_offset of scripts.
12715 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12717 * testsuite/Makefile.am: Add the incremental_test.sh test.
12718 * testsuite/incremental_test.sh: New.
12719 * testsuite/incremental_test_1.c: New.
12720 * testsuite/incremental_test_2.c: New.
12722 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12724 * incremental-dump.cc (main): Fix typos.
12726 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12729 * incremental-dump.cc (main): Use llu to print 64 bit values.
12731 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12732 H.J. Lu <hongjiu.lu@intel.com>
12734 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12736 (incremental_dump_LDADD): Likewise.
12737 * Makefile.in: Regenerated.
12739 2009-11-25 Doug Kwan <dougkwan@google.com>
12743 2009-11-25 Doug Kwan <dougkwan@google.com>
12745 * arm.cc (Target_arm::Target_arm): Move method definition
12746 outside of class definition. Add code to handle
12747 --target1-rel, --target1-abs and --target2= options.
12748 (Target_arm::get_reloc_reloc_type): Change method to be
12749 non-static and const.
12750 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12751 New data member declaration.
12752 (Target_arm::Scan::local, Target_arm::Scan::global,
12753 Target_arm::Relocate::relocate,
12754 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12755 Adjust call to Target_arm::get_real_reloc_type.
12756 (Target_arm::get_real_reloc_type): Use command line options
12757 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12758 * options.h (--target1-rel, --target1-abs, --target2): New
12761 2009-11-25 Doug Kwan <dougkwan@google.com>
12763 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12764 class definition. Add code to handle --target1-rel, --target1-abs
12765 and --target2= options.
12766 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12768 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12769 member declaration.
12770 (Target_arm::Scan::local, Target_arm::Scan::global,
12771 Target_arm::Relocate::relocate,
12772 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12773 call to Target_arm::get_real_reloc_type.
12774 (Target_arm::get_real_reloc_type): Use command line options to
12775 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12776 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12779 2009-11-25 Doug Kwan <dougkwan@google.com>
12781 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12782 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12783 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12785 (Arm_relocate_functions::thm_call): Replace body with a call to
12786 Arm_relocate_functions::thumb_branch_common.
12787 (Arm_relocate_functions::thm_jump24,
12788 Arm_relocate_functions::thm_xpc22): New method definitions.
12789 (Arm_relocate_functions::thumb_branch_common): New method definition.
12790 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12792 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12793 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12795 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12797 * Makefile.am: Build incremental-dump
12798 * Makefile.in: Regenerate.
12799 * incremental-dump.cc: New.
12800 * incremental.cc (Incremental_inputs_header_data,
12801 Incremental_inputs_entry_data): Move to incremental.h
12802 * incremental.h: (Incremental_inputs_header_data,
12803 Incremental_inputs_entry_data): Move from incremental.cc
12805 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12807 * incremental.cc (Incremental_inputs_header,
12808 Incremental_inputs_header_write, Incremental_inputs_entry,
12809 Incremental_inputs_entry_write): Add a typedef with the data type.
12811 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12813 * incremental.cc (Incremental_inputs_header,
12814 Incremental_inputs_header_write, Incremental_inputs_entry,
12815 Incremental_inputs_entry_write): Update comment about which
12816 type has the filed descriptions.
12818 2009-11-15 Doug Kwan <dougkwan@google.com>
12820 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12821 (Arm_relocate_functions::arm_branch_common): Change method defintion
12822 in class definition to a method declaration and update list of formal
12824 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12825 Arm_relocation_functions::jump24): Adjust call to
12826 Arm_relocate_functions::arm_branch_common. Update list of formal
12828 (Arm_relocate_functions::xpc25): New method definition.
12829 (Arm_relocate_functions::arm_branch_common): Move method defintion
12830 out from class definition. Use stubs for mode-switching and extending
12832 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12833 specially. Change code to enable use of stubs in ARM branches.
12835 2009-11-10 Doug Kwan <dougkwan@google.com>
12837 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12838 in method declaration.
12839 (Target_arm::relocate_stub): New method declaration.
12840 (Target_arm::default_target): Change to return a pointer instead of
12842 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12843 Target_arm::default_target.
12844 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12846 (Target_arm::relocate_section): Adjust view.
12847 (Target_arm::relocate_stub): New method definition.
12849 2009-11-10 Doug Kwan <dougkwan@google.com>
12851 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12853 * incremental.cc (open_incremental_binary): Initialized local
12854 variables to avoid warnings.
12855 * object.cc (make_elf_object): Ditto.
12856 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12859 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12862 * testsuite/plugin_test.c: Include "config.h".
12864 2009-11-09 Doug Kwan <dougkwan@google.com>
12866 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12867 (arm_symbol_value): Remove.
12868 (Arm_relocate_functions::arm_branch_common,
12869 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12870 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12871 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12872 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12873 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12874 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12875 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12876 Arm_relocate_functions::thm_mobw_abs_nc,
12877 Arm_relocate_functions::thm_mov_abs,
12878 Arm_relocate_functions::movw_prel_nc,
12879 Arm_relocate_functions::thm_movt_abs,
12880 Arm_relocate_functions::movt_prel,
12881 Arm_relocate_functions::thm_movw_prel_nc,
12882 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12883 (Target_arm::Relocate::relocate): Only decompose address into two
12884 parts if relocation type uses the thumb-bit and pass the actual
12885 bit instead of a flag indicating that the thumb-bit is used. Adjust
12886 calls to methods in Arm_relocate_functions for this change.
12888 2009-11-08 Ian Lance Taylor <iant@google.com>
12891 * reloc.cc: Instantiate
12892 Sized_relobj::initialize_input_to_output_maps and
12893 Sized_relobj:free_input_to_output_maps.
12895 2009-11-06 Ian Lance Taylor <iant@google.com>
12898 * defstd.cc (in_segment): Set only_if_ref true for "end".
12900 2009-11-06 Doug Kwan <dougkwan@google.com>
12902 * arm.cc (class Reloc_stub): Correct a comment.
12903 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12904 (Target_arm::scan_section_for_stubs): New method declaration.
12905 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12906 Change methods from private to protected.
12907 (Target_arm::do_may_relax): New method definition.
12908 (Target_arm::do_relax, Target_arm::group_sections,
12909 Target_arm::scan_reloc_for_stub,
12910 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12911 (Target_arm::arm_input_section_map_): New data member declaration.
12912 (Target_arm::scan_reloc_for_stub,
12913 Target_arm::scan_reloc_section_for_stubs,
12914 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12915 Target_arm::do_relax): New method definitions.
12917 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12919 * configure.ac: Check for (struct stat)::st_mtim
12920 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12921 * config.in: Regenerate.
12922 * configure: Regenerate.
12924 2009-11-05 Ian Lance Taylor <iant@google.com>
12927 * output.cc (Output_segment::add_output_section): Add missing
12930 2009-11-04 Ian Lance Taylor <iant@google.com>
12933 * object.h (class Object): Add is_needed and set_is_needed
12934 methods. Add is_needed_ field. Make bool fields into bitfields.
12935 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12936 defined in a dynamic object and referenced by a regular object,
12937 set is_needed for the dynamic object.
12938 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12939 if the file is marked with as_needed and it is not needed.
12941 2009-11-04 Ian Lance Taylor <iant@google.com>
12944 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12945 tags if data is discarded by linker script.
12946 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12947 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12948 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12949 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12951 2009-11-04 Ian Lance Taylor <iant@google.com>
12953 * layout.cc (Layout::get_output_section): Add is_interp and
12954 is_dynamic_linker_section parameters. Change all callers.
12955 (Layout::choose_output_section): Likewise.
12956 (Layout::make_output_section): Likewise.
12957 (Layout::add_output_section_data): Add is_dynamic_linker_section
12958 parameter. Change all callers.
12959 * layout.h (class Layout): Update declarations.
12960 * output.h (class Output_section): Add is_interp, set_is_interp,
12961 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12962 Add is_interp_, is_dynamic_linker_section_ fields. Change
12963 generate_code_fills_at_write_ to a bitfield.
12964 * output.cc (Output_section::Output_sections): Initialize new
12966 (Output_segment::add_output_section): Add do_sort parameter.
12967 Change all callers.
12969 2009-11-03 Ian Lance Taylor <iant@google.com>
12972 * options.h (class General_options): Add --warn-common.
12973 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12974 merging two common symbols.
12975 (Symbol_table::should_override): Handle --warn-common when merging
12976 a common symbol with a defined symbol. Use report_resolve_problem
12977 for multiple definitions.
12978 (Symbol_table::report_resolve_problem): New function.
12979 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12981 2009-11-03 Doug Kwan <dougkwan@google.com>
12983 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12985 (Target_arm::stub_factory): New method definition.
12986 (Target_arm::new_arm_input_section,
12987 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12988 Target_arm::reloc_uses_thumb_bit): New method declarations.
12989 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
12990 New type definitions.
12991 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12992 member declarations.
12993 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12994 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12995 New method definitions.
12997 2009-11-03 Ian Lance Taylor <iant@google.com>
12999 * options.h (class General_options): Add --warn_constructors.
13001 2009-11-03 Ian Lance Taylor <iant@google.com>
13004 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13005 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13007 2009-11-03 Ian Lance Taylor <iant@google.com>
13010 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13011 --msgid-bugs-address.
13012 (install-pdf): New target.
13013 (install-data_yes): Look up one directory to find mkinstalldirs.
13015 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13017 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13020 2009-10-30 Doug Kwan <dougkwan@google.com>
13022 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13024 2009-10-30 Doug Kwan <dougkwan@google.com>
13026 * arm.cc (Stub_addend_reader): New struct template definition
13027 and partial specializations.
13028 (Stub_addend_reader::operator()): New method definition for a
13029 partially specialized template.
13031 2009-10-30 Doug Kwan <dougkwan@google.com>
13033 * arm.cc (Arm_relobj::processor_specific_flags): New method
13035 (Arm_relobj::do_read_symbols): New method declaration.
13036 (Arm_relobj::processor_specific_flags_): New data member declaration.
13037 (Arm_dynobj): New class definition.
13038 (Target_arm::do_finalize_sections): Add input_objects parameter.
13039 (Target_arm::do_adjust_elf_header): New method declaration.
13040 (Target_arm::are_eabi_versions_compatible,
13041 (Target_arm::merge_processor_specific_flags): New method declaration.
13042 (Target_arm::do_make_elf_object): New overloaded method definitions
13044 (Arm_relobj::do_read_symbols): New method definition.
13045 (Arm_dynobj::do_read_symbols): Ditto.
13046 (Target_arm::do_finalize_sections): Add input_objects parameters.
13047 Merge processor-specific flags from all input objects.
13048 (Target_arm::are_eabi_versions_compatible,
13049 Target_arm::merge_processor_specific_flags,
13050 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13051 New method definitions.
13052 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13053 Input_objects pointer type parameter.
13054 * layout.cc (Layout::finalize): Pass input objects to target's.
13055 finalize_sections function.
13056 * output.cc (Output_file_header::do_sized_write): Set ELF file
13057 header's processor-specific flags.
13058 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13059 Input_objects pointer type parameter.
13060 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13061 * target.h (Input_objects): New forward class declaration.
13062 (Target::processor_specific_flags,
13063 Target::are_processor_specific_flags_sect): New method definitions.
13064 (Target::finalize_sections): Add input_objects parameter.
13065 (Target::Target): Initialize processor_specific_flags_ and
13066 are_processor_specific_flags_set_.
13067 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13069 (Target::set_processor_specific_flags): New method definition.
13070 (Target::processor_specific_flags_,
13071 Target::are_processor_specific_flags_set_): New data member
13073 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13074 Input_objects pointer type parameter.
13076 2009-10-30 Doug Kwan <dougkwan@google.com>
13078 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13080 2009-10-28 Ian Lance Taylor <iant@google.com>
13082 * object.h (class Relobj): Drop options parameter from
13083 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13084 do_scan_relocs, do_relocate. Change all callers.
13085 (class Sized_relobj): Drop options parameters from
13086 do_gc_process_relocs, do_scan_relocs, do_relocate,
13087 do_relocate_sections, relocate_sections, emit_relocs_scan,
13088 emit_relocs_scan_reltype. Change all callers.
13089 (struct Relocate_info): Remove options field and all references to
13091 * reloc.h (class Read_relocs): Remove options constructor
13092 parameter and options_ field. Change all callers.
13093 (class Gc_process_relocs, class Scan_relocs): Likewise.
13094 (class Relocate_task): Likewise.
13095 * target-reloc.h (scan_relocs): Remove options parameter. Change
13097 (scan_relocatable_relocs): Likewise.
13098 * target.h (class Sized_target): Remove options parameter from
13099 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13101 * gc.h (gc_process_relocs): Remove options parameter. Change all
13103 * arm.cc: Update functions to remove options parameters.
13104 * i386.cc: Likewise.
13105 * powerpc.cc: Likewise.
13106 * sparc.cc: Likewise.
13107 * x86_64.cc: Likewise.
13108 * testsuite/testfile.cc: Likewise.
13110 2009-10-28 Doug Kwan <dougkwan@google.com>
13112 * arm.cc (Arm_relobj): New class definition.
13113 (Arm_relobj::scan_sections_for_stubs,
13114 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13115 New method definitions.
13117 2009-10-28 Cary Coutant <ccoutant@google.com>
13119 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13120 (Plugin::cleanup_done_): New member.
13121 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13122 (Plugin_manager::cleanup_done_): Remove.
13123 (Plugin_manager::add_input_file): Edit error message.
13124 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13125 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13127 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13129 * fileread.cc: (File_read::View::~View): Use the new
13130 data_ownership_ filed.
13131 (File_read::~File_read): Dispose the new whole_file_view_.
13132 (File_read::open): Mmap the whole file if needed.
13133 (File_read::open): Use whole_file_view_ instead of contents_.
13134 (File_read::find_view): Use whole_file_view_ if applicable.
13135 (File_read::do_read): Use whole_file_view_ instead of contents_.
13136 (File_read::make_view): Use whole_file_view_ instead of contents_,
13137 update File_read::View::View call.
13138 (File_read::find_or_make_view): Update File_read::View::View
13140 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13142 (File_read::View::Data_ownership): New enum.
13143 (File_read::View::View): Replace bool mapped_ with Data_ownership
13145 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13146 (File_read::View::data_ownership_): New field.
13147 (File_read::contents_): Remove (replaced by whole_file_view_).
13148 (File_read::whole_file_view_): New field.
13149 * options.h (class General_options): Add --keep-files-mapped.
13151 2009-10-27 Cary Coutant <ccoutant@google.com>
13153 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13154 * testsuite/Makefile.am (plugin_test_5): New test case.
13155 * testsuite/Makefile.in: Regenerate.
13157 2009-10-25 Doug Kwan <dougkwan@google.com>
13159 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13160 from private to protected to allow access by child class.
13161 (Sized_relobj::do_relocate_sections): New method declaration.
13162 (Sized_relobj::relocate_sections): Virtualize.
13163 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
13164 Sized_relobj::relocate_sections. Instantiate template explicitly
13165 for different target sizes and endianity.
13167 2009-10-24 Doug Kwan <dougkwan@google.com>
13169 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13170 (Arm_input_section::as_arm_input_section): New method.
13171 (Arm_output_section): New class definition.
13172 (Arm_output_section::create_stub_group,
13173 Arm_output_section::group_sections): New method definitions.
13175 2009-10-22 Doug Kwan <dougkwan@google.com>
13177 * arm.cc (Arm_input_section): New class definition.
13178 (Arm_input_section::init, Arm_input_section:do_write,
13179 Arm_input_section::set_final_data_size,
13180 Arm_input_section::do_reset_address_and_file_offset): New method
13183 2009-10-21 Doug Kwan <dougkwan@google.com>
13185 * arm.cc (Stub_table, Arm_input_section): New forward class
13187 (Stub_table): New class defintion.
13188 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13189 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13190 New method definition.
13192 2009-10-21 Doug Kwan <dougkwan@google.com>
13194 * arm.cc: Update copyright comments.
13195 (Target_arm): New forward class template declaration.
13196 (Arm_address): New type.
13197 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13198 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13199 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13201 (Insn_template): Same.
13202 (DEF_STUBS): New macro.
13203 (Stub_type): New enum type.
13204 (Stub_template): New class definition.
13206 (Reloc_stub): Same.
13207 (Stub_factory): Same.
13208 (Target_arm::Target_arm): Initialize may_use_blx_ and
13209 should_force_pic_veneer_.
13210 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13211 Target_arm::should_force_pic_veneer,
13212 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13213 Target_arm::using_thumb_only, Target_arm:;default_target): New
13215 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13216 New data member declarations.
13217 (Insn_template::size, Insn_template::alignment): New method defintions.
13218 (Stub_template::Stub_template): New method definition.
13219 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13220 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13221 (Stub_factory::Stub_factory): New method definition.
13222 * gold.h (string_hash): New template.
13223 * output.h (Input_section_specifier::hash_value): Use
13225 (Input_section_specifier::string_hash): Remove.
13226 * stringpool.cc (Stringpool_template::string_hash): Use
13229 2009-10-20 Doug Kwan <dougkwan@google.com>
13231 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13232 symbols of relaxed input sections.
13233 * output.h (Output_section::find_relaxed_input_section): Make
13236 2009-10-16 Doug Kwan <dougkwan@google.com>
13238 * dynobj.cc (Versions::Versions): Initialize version_script_.
13239 Only insert base version symbol definition for a shared object
13240 if version script defines any version versions.
13241 (Versions::define_base_version): New method definition.
13242 (Versions::add_def): Check that base version is not needed.
13243 (Versions::add_need): Define base version lazily.
13244 * dynobj.h (Versions::define_base_version): New method declaration.
13245 (Versions::needs_base_version_): New data member declaration.
13246 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13247 (check_DATA): Add no_version_test.stdout.
13248 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13250 * testsuite/Makefile.in: Regenerate.
13251 * testsuite/no_version_test.c: New file.
13252 * testsuite/no_version_test.sh: Ditto.
13254 2009-10-16 Doug Kwan <dougkwan@google.com>
13256 * expression.cc (class Segment_start_expression): New class definition.
13257 (Segment_start_expression::value): New method definition.
13258 (script_exp_function_segment_start): Return a new
13259 Segment_start_expression.
13260 * gold/script-c.h (script_saw_segment_start_expression): New function
13262 * script-sections.cc (Script_sections::Script_sections): Initialize
13263 SAW_SEGMENT_START_EXPRESSION_ to false.
13264 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13265 and -Tbbs options to specify section addresses if given in
13266 command line and no SEGMENT_START expression is seen in a script.
13267 * script-sections.h (Script_sections::saw_segment_start_expression,
13268 Script_sections::set_saw_segment_start_expression): New method
13270 (Script_sections::saw_segment_start_expression_): New data member
13272 * script.cc (script_saw_segment_start_expression): New function.
13273 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13274 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13275 script_test_7.sh and script_test_8.sh.
13276 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13277 script_test_8.stdout.
13278 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13279 (script_test_6, script_test_6.stdout, script_test_7,
13280 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13281 * Makefile.in: Regenerate.
13282 * testsuite/script_test_6.sh: New file.
13283 * testsuite/script_test_6.t: Same.
13284 * testsuite/script_test_7.sh: Same.
13285 * testsuite/script_test_7.t: Same.
13286 * testsuite/script_test_8.sh: Same.
13288 2009-10-16 Doug Kwan <dougkwan@google.com>
13290 * output.cc (Output_segment::set_section_list_address): Cast
13291 expressions to unsigned long long type to avoid format warnings.
13293 2009-10-15 Ian Lance Taylor <iant@google.com>
13295 * script.cc (Script_options::add_symbol_assignment): Always add a
13296 dot assignment to script_sections_.
13297 * script-sections.cc (Script_sections::add_dot_assignment):
13298 Initialize if necessary.
13300 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13301 program headers with no load segment if there is a linker script.
13303 * layout.cc (Layout::set_segment_offsets): Align the file offset
13304 to the segment aligment for -N or -n with no load segment.
13305 * output.cc (Output_segment::add_output_section): Don't crash if
13306 the first section is a TLS section.
13307 (Output_segment::set_section_list_addresses): Print an error
13308 message if the address moves backward in a linker script.
13309 * script-sections.cc
13310 (Output_section_element_input::set_section_addresses): Don't
13311 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13312 (Orphan_output_section::set_section_addresses): Likewise.
13314 2009-10-15 Doug Kwan <dougkwan@google.com>
13316 * layout.cc (Layout::finish_dynamic_section): Generate tags
13317 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13318 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13319 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13321 2009-10-14 Ian Lance Taylor <iant@google.com>
13323 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13325 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13326 data_shdr fields of relinfo.
13327 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13328 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13329 R_386_TLS_LDO_32, adjust based on section flags.
13330 (Target_i386::Relocate::fix_up_ldo): Remove.
13332 2009-10-13 Ian Lance Taylor <iant@google.com>
13334 Add support for -pie.
13335 * options.h (class General_options): Add -pie and
13337 (General_options::output_is_position_independent): Test -pie.
13338 (General_options::output_is_executable): Return true if not shared
13339 and not relocatable.
13340 (General_options::output_is_pie): Remove.
13341 * options.cc (General_options::finalize): Reject incompatible uses
13343 * gold.cc (queue_middle_tasks): A -pie link is not static.
13344 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13345 * symtab.cc (Symbol::final_value_is_known): Return false if
13346 output_is_position_independent.
13347 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13348 output_is_position_independent.
13349 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13350 output_is_position_independent.
13351 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13352 output_is_position_independent.
13353 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13355 (basic_pie_test.o, basic_pie_test): New targets.
13356 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13357 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13358 (two_file_pie_test): New target.
13359 * testsuite/Makefile.in: Rebuild.
13360 * README: Remove note saying that -pie is not supported.
13362 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13364 * options.h (class General_options): Add -init and -fini.
13365 * layout.cc (Layout::finish_dynamic_section): Emit
13366 given init and fini functions.
13368 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13370 * gc.h (gc_process_relocs): Check if icf is enabled using new
13372 * gold.cc (queue_initial_tasks): Likewise.
13373 (queue_middle_tasks): Likewise.
13374 * object.cc (do_layout): Likewise.
13375 * symtab.cc (is_section_folded): Likewise.
13376 * main.cc (main): Likewise.
13377 * reloc.cc (Read_relocs::run): Likewise.
13378 (Sized_relobj::do_scan_relocs): Likewise.
13379 * icf.cc (is_function_ctor_or_dtor): New function.
13380 (Icf::find_identical_sections): Check if function is ctor or dtor when
13381 safe icf is chosen.
13382 * options.h (General_options::icf): Change option to be an enum.
13383 (Icf_status): New enum.
13384 (icf_enabled): New method.
13385 (icf_safe_folding): New method.
13386 (set_icf_status): New method.
13387 (icf_status_): New variable.
13388 * (options.cc) (General_options::finalize): Set icf_status_.
13389 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13390 icf_test and icf_keep_unique_test to use the --icf enum flag.
13391 * testsuite/icf_safe_test.sh: New file.
13392 * testsuite/icf_safe_test.cc: New file.
13394 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13396 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13397 includes to gc.h and icf.h.
13398 * arm.cc: Include gc.h.
13399 * gold.cc: Likewise.
13400 * i386.cc: Likewise.
13401 * powerpc.cc: Likewise.
13402 * sparc.cc: Likewise.
13403 * x86_64.cc: Likewise.
13404 * gc.h: Include icf.h.
13406 2009-10-11 Ian Lance Taylor <iant@google.com>
13408 * plugin.cc: Include "gold.h" before other header files.
13410 2009-10-10 Chris Demetriou <cgd@google.com>
13412 * options.h (Input_file_argument::Input_file_type): New enum.
13413 (Input_file_argument::is_lib_): Replace with...
13414 (Input_file_argument::type_): New member.
13415 (Input_file_argument::Input_file_argument): Take Input_file_type
13416 'type' rather than boolean 'is_lib' as second argument.
13417 (Input_file_argument::is_lib): Use type_.
13418 (Input_file_argument::is_searched_file): New function.
13419 (Input_file_argument::may_need_search): Handle is_searched_file.
13420 * options.cc (General_options::parse_library): Support -l:filename.
13421 (General_options::parse_just_symbols): Update for Input_file_argument
13423 (Command_line::process): Likewise.
13424 * archive.cc (Archive::get_file_and_offset): Likewise.
13425 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13426 * script.cc (read_script_file, script_add_file): Likewise.
13427 * fileread.cc (Input_file::Input_file): Likewise.
13428 (Input_file::will_search_for): Handle is_searched_file.
13429 (Input_file::open): Likewise.
13430 * readsyms.cc (Read_symbols::get_name): Likewise.
13431 * testsuite/Makefile.am (searched_file_test): New test.
13432 * testsuite/Makefile.in: Regenerate.
13433 * testsuite/searched_file_test.cc: New file.
13434 * testsuite/searched_file_test_lib.cc: New file.
13436 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13437 Ian Lance Taylor <iant@google.com>
13439 * descriptor.cc: Include <cstdio> and "binary-io.h".
13440 (Descriptors::open): Open the files in binary mode always.
13441 * script.cc (Lex::get_token): Treat \r as whitespace.
13443 2009-10-09 Ian Lance Taylor <iant@google.com>
13445 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13447 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13448 Ian Lance Taylor <iant@google.com>
13450 * configure.ac: Check for readv function also.
13451 * fileread.cc (readv): Define if not HAVE_READV.
13452 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13454 * config.in: Regenerate.
13455 * configure: Regenerate.
13457 2009-10-09 Doug Kwan <dougkwan@google.com>
13459 * layout.cc (Layout::make_output_section): Call target hook to make
13460 ordinary output section.
13461 (Layout::finalize): Adjust parameter list of call the
13462 Target::may_relax().
13463 * layout.h (class Layout::section_list): New method.
13464 * merge.h (Output_merge_base::entsize): Change visibility to public.
13465 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13467 (Output_merge_string::do_is_string): New method.
13468 * object.cc (Sized_relobj::do_setup): renamed from
13469 Sized_relobj::set_up.
13470 * object.h (Sized_relobj::adjust_shndx,
13471 Sized_relobj::initializ_input_to_output_maps,
13472 Sized_relobj::free_input_to_output_maps): Change visibilities to
13474 (Sized_relobj::setup): Virtualize.
13475 (Sized_relobj::do_setup): New method declaration.
13476 (Sized_relobj::invalidate_section_offset,
13477 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13478 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13479 * options.cc (parse_int): New function.
13480 * options.h (parse_int): New declaration.
13481 (DEFINE_int): New macro.
13482 (stub_group_size): New option.
13483 * output.cc (Output_section::Output_section): Initialize memebers
13484 merge_section_map_, merge_section_by_properties_map_,
13485 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13486 (Output_section::add_input_section): Handled deferred code-fill
13487 generation and remove an old comment.
13488 (Output_section::add_relaxed_input_section): New method definition.
13489 (Output_section::add_merge_input_section): Use merge section by
13490 properties map to speed to search. Update merge section maps
13492 (Output_section::build_relaxation_map): New method definition.
13493 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13495 (Output_section::relax_input_section): Renamed to
13496 Output_section::convert_input_sections_to_relaxed_sections and change
13497 interface to take a vector of pointers to relaxed sections.
13498 (Output_section::find_merge_section,
13499 Output_section::find_relaxed_input_section): New method definitions.
13500 (Output_section::is_input_address_mapped,
13501 Output_section::output_offset, Output_section::output_address):
13502 Use output section data maps to speed up searching.
13503 (Output_section::find_starting_output_address): Add comments.
13504 (Output_section::do_write,
13505 Output_section::write_to_postprocessing_buffer): Do code-fill
13506 generation as appropriate.
13507 (Output_section::get_input_sections): Invalidate relaxed input section
13509 (Output_section::restore_states): Adjust type of checkpoint .
13510 Invalidate relaxed input section map.
13511 * output.h (Output_merge_base): New class declaration.
13512 (Input_section_specifier): New class defintion.
13513 (class Output_relaxed_input_section) Change base class to
13514 Output_section_data_build.
13515 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13516 base class initializer.
13517 (Output_section::add_relaxed_input_section): New method declaration.
13518 (Output_section::Input_section): Change visibility to protected.
13519 (Output_section::Input_section::relobj,
13520 Output_section::Input_section::shndx): Handle relaxed input sections.
13521 Output_section::input_sections) Change visibility to protected. Also
13522 define overload to return a non-const pointer.
13523 (Output_section::Merge_section_properties): New class defintion.
13524 (Output_section::Merge_section_by_properties_map,
13525 Output_section::Output_section_data_by_input_section_map,
13526 Output_section::Relaxation_map): New types.
13527 (Output_section::relax_input_section): Rename method to
13528 Output_section::convert_input_sections_to_relaxed_sections and change
13529 interface to take a vector of relaxed section pointers.
13530 (Output_section::find_merge_section,
13531 Output_section::find_relaxed_input_section,
13532 Output_section::build_relaxation_map,
13533 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13534 New method declarations.
13535 (Output_section::merge_section_map_
13536 Output_section::merge_section_by_properties_map_,
13537 Output_section::relaxed_input_section_map_,
13538 Output_section::is_relaxed_input_section_map_valid_,
13539 Output_section::generate_code_fills_at_write_): New data members.
13540 * script-sections.cc
13541 (Output_section_element_input::set_section_addresses): Call
13542 current_data_size and addralign methods of relaxed input sections.
13543 (Orphan_output_section::set_section_addresses): Call current_data_size
13544 and addralign methods of relaxed input sections.
13545 * symtab.cc (Symbol_table::compute_final_value): Extract template
13546 from the body of Symbol_table::sized_finalize_symbol.
13547 (Symbol_table::sized_finalized_symbol): Call
13548 Symbol_table::compute_final_value.
13549 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13550 (Symbol_table::compute_final_value): New templated method declaration.
13551 * target.cc (Target::do_make_output_section): New method defintion.
13552 * target.h (Target::make_output_section): New method declaration.
13553 (Target::relax): Add more parameters for input objects, symbol table
13554 and layout. Adjust call to do_relax.
13555 (Target::do_make_output_section): New method declaration.
13556 (Target::do_relax): Add parameters for input objects, symbol table
13559 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13561 * pread.c: Include stdio.h.
13563 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13565 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13568 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13570 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13571 Change read_shndx type to unsigned int.
13572 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13574 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13575 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13576 Change read_shndx type to unsigned int.
13577 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13579 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13580 * layout.cc (Layout::create_symtab_sections): Cast the result of
13581 local_symcount * symsize to off_t in the gold_assert.
13583 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13585 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13586 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13588 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13589 (Arm_relocate_functions::thm_abs5): New function.
13590 (Arm_relocate_functions::abs12): New function.
13591 (Arm_relocate_functions::abs16): New function.
13592 (Arm_relocate_functions::base_abs): New function.
13593 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13594 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13595 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13597 (Scan::global): Likewise.
13598 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13599 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13600 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13601 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13604 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13606 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13607 (Arm_relocate_functions::movt_prel): New function.
13608 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13609 (Arm_relocate_functions::thm_movt_prel): New function.
13610 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13611 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13612 (Scan::global, Relocate::relocate): Likewise.
13613 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13615 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13617 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13618 Incremental_checker.
13619 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13621 (class Incremental_inputs_header): New class.
13622 (Incremental_inputs_header_writer): Edit comment.
13623 (Incremental_inputs_entry): New class.
13624 (Incremental_inputs_entry_writer): Edit comment.
13625 (Sized_incremental_binary::do_find_incremental_inputs_section):
13626 Add *strtab_shndx parameter, fill it.
13627 (Sized_incremental_binary::do_check_inputs): New method.
13628 (Incremental_checker::can_incrementally_link_output_file): Use
13629 Sized_incremental_binary::check_inputs.
13630 (Incremental_inputs::report_command_line): Save command line in
13633 (Incremental_binary::find_incremental_inputs_section): New
13635 (Incremental_binary::do_find_incremental_inputs_section): Add
13636 strtab_shndx parameter.
13637 (Incremental_binary::do_check_inputs): New pure virtual method.
13638 (Sized_incremental_binary::do_check_inputs): Declare.
13639 (Incremental_checker::Incremental_checker): Add incremental_inputs
13640 parameter, use it to initialize incremental_inputs_.
13641 (Incremental_checker::incremental_inputs_): New field.
13642 (Incremental_checker::command_line): New method.
13643 (Incremental_checker::inputs): New method.
13644 (Incremental_checker::command_line_): New field.
13646 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13648 * incremental.cc: Include <cstdarg> and "target-select.h".
13649 (vexplain_no_incremental): New function.
13650 (explain_no_incremental): New function.
13651 (Incremental_binary::error): New method.
13652 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13654 (make_sized_incremental_binary): New function.
13655 (open_incremental_binary): New function.
13656 (can_incrementally_link_file): Add checks if output is ELF and has
13658 * incremental.h: Include "elfcpp_file.h" and "output.h".
13659 (Incremental_binary): New class.
13660 (Sized_incremental_binary): New class.
13661 (open_incremental_binary): Declare.
13662 * object.cc (is_elf_object): Use
13663 elfcpp::Elf_recognizer::is_elf_file.
13664 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13665 * output.h (Output_file::filesize): New method.
13667 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13669 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13671 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13672 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13674 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13676 (Arm_relocate_functions::movw_abs_nc): New function.
13677 (Arm_relocate_functions::movt_abs): New function.
13678 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13679 (Arm_relocate_functions::thm_movt_abs): New function.
13680 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13681 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13682 (Scan::global): Likewise.
13683 (Relocate::relocate): Likewise.
13684 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13686 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13688 * arm.cc (Arm_relocate_functions::got_prel) New function.
13689 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13690 (Relocate::relocate): Likewise.
13691 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13693 2009-10-06 Ian Lance Taylor <iant@google.com>
13695 * options.h (class General_options): Define
13696 split_stack_adjust_size parameter.
13697 * object.h (class Object): Add uses_split_stack_ and
13698 has_no_split_stack_ fields. Add uses_split_stack and
13699 has_no_split_stack accessor functions. Declare
13700 handle_split_stack_section.
13701 (class Reloc_symbol_changes): Define.
13702 (class Sized_relobj): Define Function_offsets. Declare
13703 split_stack_adjust, split_stack_adjust_reltype, and
13705 * object.cc (Object::handle_split_stack_section): New function.
13706 (Sized_relobj::do_layout): Call handle_split_stack_section.
13707 * dynobj.cc (Sized_dynobj::do_layout): Call
13708 handle_split_stack_section.
13709 * reloc.cc (Sized_relobj::relocate_sections): Call
13710 split_stack_adjust for executable sections in split_stack
13711 objects. Pass reloc_map to relocate_section.
13712 (Sized_relobj::split_stack_adjust): New function.
13713 (Sized_relobj::split_stack_adjust_reltype): New function.
13714 (Sized_relobj::find_functions): New function.
13715 * target-reloc.h: Include "object.h".
13716 (relocate_section): Add reloc_symbol_changes parameter. Change
13718 * target.h (class Target): Add calls_non_split method. Declare
13719 do_calls_non_split virtual method. Declare match_view and
13721 * target.cc: Include "elfcpp.h".
13722 (Target::do_calls_non_split): New function.
13723 (Target::match_view): New function.
13724 (Target::set_view_to_nop): New function.
13725 * gold.cc (queue_middle_tasks): Give an error if mixing
13726 split-stack and non-split-stack objects with -r.
13727 * i386.cc (Target_i386::relocate_section): Add
13728 reloc_symbol_changes parameter.
13729 (Target_i386::do_calls_non_split): New function.
13730 * x86_64.cc (Target_x86_64::relocate_section): Add
13731 reloc_symbol_changes parameter.
13732 (Target_x86_64::do_calls_non_split): New function.
13733 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13735 * powerpc.cc (Target_powerpc::relocate_section): Add
13736 reloc_symbol_changes parameter.
13737 * sparc.cc (Target_sparc::relocate_section): Add
13738 reloc_symbol_changes parameter.
13739 * configure.ac: Call AM_CONDITIONAL for the default target.
13740 * configure: Rebuild.
13741 * testsuite/Makefile.am (TEST_AS): New variable.
13742 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13743 (check_DATA): Add split_i386 and split_x86_64 files.
13744 (SPLIT_DEFSYMS): Define.
13745 (split_i386_[1234n].o): New targets.
13746 (split_i386_[124]): New targets.
13747 (split_i386_[1234r].stdout): New targets.
13748 (split_x86_64_[1234n].o): New targets.
13749 (split_x86_64_[124]): New targets.
13750 (split_x86_64_[1234r].stdout): New targets.
13751 (MOSTLYCLEANFILES): Add new executables.
13752 * testsuite/split_i386.sh: New file.
13753 * testsuite/split_x86_64.sh: New file.
13754 * testsuite/split_i386_1.s: New file.
13755 * testsuite/split_i386_2.s: New file.
13756 * testsuite/split_i386_3.s: New file.
13757 * testsuite/split_i386_4.s: New file.
13758 * testsuite/split_i386_n.s: New file.
13759 * testsuite/split_x86_64_1.s: New file.
13760 * testsuite/split_x86_64_2.s: New file.
13761 * testsuite/split_x86_64_3.s: New file.
13762 * testsuite/split_x86_64_4.s: New file.
13763 * testsuite/split_x86_64_n.s: New file.
13764 * testsuite/testfile.cc (Target_test): Update relocation_section
13766 * testsuite/Makefile.in: Rebuild.
13768 2009-10-06 Ian Lance Taylor <iant@google.com>
13770 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13771 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13772 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13773 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13774 the address on ldo_addrs_.
13775 (Target_i386::Relocate::fix_up_ldo): New function.
13777 2009-10-06 Rafael Espindola <espindola@google.com>
13779 * plugin.cc (add_input_library): New.
13780 (Plugin::load): Add add_input_library to tv.
13781 (Plugin_manager::add_input_file): Add the is_lib argument.
13782 (add_input_file): Update call to Plugin_manager::add_input_file.
13783 (add_input_library): New.
13784 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13786 2009-09-30 Doug Kwan <dougkwan@google.com>
13788 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13789 symbol and call Symbol::may_need_copy_reloc to determine if
13790 a copy reloc is needed.
13791 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13792 nocopyreloc is given in command line.
13793 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13794 given in command line.
13795 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13796 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13797 of the removed Target_i386::may_need_copy_reloc.
13798 * options.h (copyreloc): New option with default value false.
13799 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13800 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13801 instead of the removed Target_powerpc::may_need_copy_reloc.
13802 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13803 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13804 instead of the removed Target_sparc::may_need_copy_reloc.
13805 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13806 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13807 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13808 instead of the removed Target_x86_64::may_need_copy_reloc.
13810 2009-09-30 Ian Lance Taylor <iant@google.com>
13812 * object.h (class Object): Remove target_ field, and target,
13813 sized_target, and set_target methods.
13814 (Object::sized_target): Remove.
13815 (class Sized_relobj): Update declarations. Remove sized_target.
13816 * object.cc (Sized_relobj::setup): Remove target parameter.
13817 Change all callers.
13818 (Input_objects::add_object): Don't do anything with the target.
13819 (make_elf_sized_object): Add punconfigured parameter. Change all
13820 callers. Set or test parameter target.
13821 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13822 Change all callers.
13823 * parameters.cc (Parameters::set_target): Change parameter type to
13825 (Parameters::default_target): Remove.
13826 (set_parameters_target): Change parameter type to be non-const.
13827 (parameters_force_valid_target): New function.
13828 (parameters_clear_target): New function.
13829 * parameters.h (class Parameters): Update declarations. Remove
13830 default_target method. Add sized_target and clear_target
13831 methods. Change target_ to be non-const.
13832 (set_parameters_target): Update declaration.
13833 (parameters_force_valid_target): Declare.
13834 (parameters_clear_target): Declare.
13835 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13836 as NULL if we aren't searching.
13837 (Add_symbols::run): Don't check for compatible target.
13838 * fileread.cc (Input_file::open_binary): Call
13839 parameters_force_valid_target.
13840 * gold.cc (queue_middle_tasks): Likewise.
13841 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13842 set_target on object.
13843 * dynobj.h (class Sized_dynobj): Update declarations.
13844 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13845 make_elf_object returns NULL.
13846 (Archive::include_member): Don't check whether object target is
13848 * output.cc (Output_section::add_input_section): Get target from
13850 (Output_section::relax_input_section): Likewise.
13851 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13853 (Sized_relobj::do_scan_relocs): Likewise.
13854 (Sized_relobj::relocate_sections): Likewise.
13855 * resolve.cc (Symbol_table::resolve): Likewise.
13856 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13857 parameter. Change all callers.
13858 (Symbol_table::add_from_object): Get target from parameters.
13859 (Symbol_table::add_from_relobj): Don't check object target.
13860 (Symbol_table::add_from_dynobj): Likewise.
13861 (Symbol_table::define_special_symbol): Get target from
13863 * symtab.h (class Symbol_table): Update declaration.
13864 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13865 parameter. Change all callers. Clear parameter target.
13866 (Binary_test): Test target here.
13867 * testsuite/object_unittest.cc (gold_testsuite): Remove
13868 target_test_pointer parameter. Change all callers.
13869 (Object_test): Test target here.
13871 2009-09-26 Ian Lance Taylor <iant@google.com>
13873 * testsuite/initpri1.c: Don't try to use constructor priorities if
13874 compiling with gcc before 4.3.
13876 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13878 * testsuite/retain_symbols_file_test.sh (check_present): Change
13879 output file name to retain_symbols_file_test.stdout.
13880 (check_absent): Likewise.
13882 2009-09-18 Craig Silverstein <csilvers@google.com>
13884 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13885 * options.cc: Include <cerrno> and <fstream>.
13886 (General_options::finalize): Parse -retain-symbols-file tag.
13887 * options.h: New flag.
13888 (General_options): New method should_retain_symbol, new
13889 variable symbols_to_retain.
13890 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13891 should_retain_symbol map.
13892 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13893 * testsuite/Makefile.in: Regenerate.
13894 * testsuite/retain_symbols_file_test.sh: New file.
13896 2009-09-18 Nick Clifton <nickc@redhat.com>
13898 * po/es.po: Updated Spanish translation.
13900 2009-09-17 Doug Kwan <dougkwan@google.com>
13902 * debug.h (DEBUG_RELAXATION): New constant.
13903 (DEBUG_ALL): Add DEBUG_RELAXATION.
13904 (debug_string_to_enum): Add relaxation debug option.
13906 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13907 Layout::Relaxation_debug_check::read_sections,
13908 Layout::Relaxation_debug_check::read_sections): New method definitions.
13909 (Layout::Layout): Initialize data members
13910 record_output_section_data_from_scrips_,
13911 script_output_section_data_list_ and relaxation_debug_check_.
13912 (Layout::save_segments, Layout::restore_segments,
13913 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13914 Layout::relaxation_loop_body): New method definitions.
13915 (Layout::finalize): Support relaxation. Move section layout code to
13916 Layout::relaxation_loop_body.
13917 (Layout::set_asection_address_from_script): Move code for orphan
13918 section placement out.
13919 (Layout::place_orphan_sections_in_script): New method definition.
13920 * layout.h (Output_segment_headers, Output_file_header):
13921 New forward class declarations.
13922 (Layout::~Layout): Define.
13923 (Layout::new_output_section_data_from_script): New method definition.
13924 (Layout::place_orphan_sections_in_script): New method declaration.
13925 (Layout::Segment_states): New type declaration.
13926 (Layout::save_segments, Layout::restore_segments,
13927 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13928 Layout::relaxation_loop_body): New method declarations.
13929 (Layout::Output_section_data_list): New type declaration.
13930 (Layout::Relaxation_debug_check): New class definition.
13931 (Layout::record_output_section_data_from_script_,
13932 Layout::script_output_section_data_list_, Layout::segment_states_,
13933 Layout::relaxation_debug_check_): New data members.
13934 * output.cc: (Output_section_headers::do_size): New method definition.
13935 (Output_section_headers::Output_section_headers): Move size
13936 computation to Output_section_headers::do_size.
13937 (Output_segment_headers::do_size): New method definition.
13938 (Output_file_header::Output_file_header): Move size computation to
13939 Output_file_header::do_size and call it.
13940 (Output_file_header::do_size): New method definition.
13941 (Output_data_group::Output_data_group): Adjust call to
13942 Output_section_data.
13943 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13944 (Output_symtab_xindex::do_write): Add array bound check.
13945 (Output_section::Input_section::print_to_mapfile): Handle
13946 RELAXED_INPUT_SECTION_CODE.
13947 (Output_section::Output_section): Initialize data member checkpoint_.
13948 (Output_section::~Output_section): Delete checkpoint object pointed
13950 (Output_section::add_input_section): Always add an Input_section if
13952 (Output_section::add_merge_input_section): Add assert.
13953 (Output_section::relax_input_section): New method definition.
13954 (Output_section::set_final_data_size): Set load address to zero for
13955 an unallocated section.
13956 (Output_section::do_address_and_file_offset_have_reset_values):
13957 New method definition.
13958 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13959 Handle relaxed input section.
13960 (Output_section::sort_attached_input_sections): Checkpoint input
13961 section list lazily.
13962 (Output_section::get_input_sections): Change type of input_sections to
13963 list of Simple_input_section pointers. Checkpoint input section list
13964 lazily. Also handle relaxed input sections.
13965 (Output_section::add_input_section_for_script): Take a reference to
13966 a Simple_input_section object instead of Relobj pointer and section
13967 index as parameter. Handle relaxed input sections.
13968 (Output_section::save_states, Output_section::restore_states): New
13969 method definitions.
13970 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13971 (Output_data::is_data_size_fixed): New method definition.
13972 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13974 (Output_data::address_and_file_offset_have_reset_values): New method
13976 (Output_data::do_address_and_file_offset_have_reset_values): New method
13978 (Output_data::set_data_size): Check that data size is not fixed.
13979 (Output_data::fix_data_size): New method definition.
13980 (Output_data::is_data_size_fixed_): New data member.
13981 (Output_section_headers::set_final_data_size): New method definition.
13982 (Output_section_headers::do_size): New method declaration.
13983 (Output_segment_headers::set_final_data_size): New method definition.
13984 (Output_segment_headers::do_size): New method declaration.
13985 (Output_file_header::set_final_data_size)::New method definition.
13986 (Output_file_header::do_size)::New method declaration.
13987 (Output_section_data::Output_section_data): Add new parameter
13988 is_data_size_fixed and use it to fix data size.
13989 (Output_data_const::Output_data_const): Adjust call to base class
13990 constructor and fix data size.
13991 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13992 base class constructor and fix data size.
13993 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13994 base class constructor and fix data size.
13995 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13996 class constructor and fix data size.
13997 (Output_data_group::set_final_data_size): New method definition.
13998 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13999 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14000 class constructor and fix data size.
14001 (Output_relaxed_input_section): New class definition.
14002 (Output_section::Simple_input_section): New class definition.
14003 (Output_section::get_input_sections): Adjust parameter list.
14004 (Output_section::add_input_section_for_script): Same.
14005 (Output_section::save_states, Output_section::restore_states,
14006 Output_section::do_address_and_file_offset_have_reset_values,
14007 (Output_section::Input_section::Input_section): Handle
14008 RELAXED_INPUT_SECTION_CODE. Add new overload for
14009 Output_relaxed_input_section.
14010 (Output_section::Input_section::is_input_section,
14011 Output_section::Input_section::set_output_section): Handle relaxed
14013 (Output_section::Input_section::is_relaxed_input_section,
14014 Output_section::Input_section::output_section_data,
14015 Output_section::Input_section::relaxed_input_section): New method
14017 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14019 (Output_section::Input_section::u1_): Update comments.
14020 (Output_section::Input_section::u2_): Add new union member poris.
14021 (Output_section::Checkpoint_output_section): New classs definition.
14022 (Output_section::relax_input_section): New method declaration.
14023 (Output_section::checkpoint_): New data member.
14024 (Output_segment): Update comments.
14025 (Output_segment::Output_segment): Un-privatize copy constructor.
14026 (Output_segment::operator=): Un-privatize.
14027 * script-sections.cc (Output_section_element::Input_section_list):
14028 Change element type to Output_section::Simple_input_section.
14029 (Output_section_element_dot_assignment::set_section_addresses):
14030 Register output section data for relaxation clean up.
14031 (Output_data_exression::Output_data_expression): Adjust call to base
14032 constructor to fix data size.
14033 (Output_section_element_data::set_section_addresses): Register
14034 Output_data_expression object for relaxation clean up.
14035 (struct Input_section_info): Replace Relobj pointer and section index
14036 pair with Output_section::Simple_input_section and Convert struct to a
14038 (Input_section_sorter::operator()): Adjust access to
14039 Input_section_info data member to use accessors.
14040 (Output_section_element_input::set_section_addresses): Use layout
14041 parameter. Adjust code to use Output_section::Simple_input_section
14042 and Input_secction_info classes. Register filler for relaxation
14044 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14045 and section index pair with Output_section::Simple_input_section
14046 class. Adjust code accordingly.
14047 (Phdrs_element::release_segment): New method definition.
14048 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14050 (Script_sections::release_segments): New method definition.
14051 * gold/script-sections.h (Script_sections::release_segments): New
14052 method declaration.
14053 * gold/target.h (Target::may_relax, Target::relax,
14054 Target::do_may_relax, Target::do_relax): New method definitions.
14056 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14058 * arm.cc (has_signed_unsigned_overflow): New function.
14059 (Arm_relocate_functions::abs8): New function.
14060 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14061 (Target_arm::Scan::global): Likewise.
14062 (Target_arm::relocate::relocate): Likewise.
14063 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14066 2009-09-16 Cary Coutant <ccoutant@google.com>
14068 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14069 * testsuite/Makefile.in: Regenerate.
14071 2009-09-11 Nick Clifton <nickc@redhat.com>
14073 * po/gold.pot: Updated by the Translation project.
14075 2009-09-08 Cary Coutant <ccoutant@google.com>
14077 * output.cc (Output_file::open): Add execute permission to empty file.
14078 * testsuite/Makefile.am (permission_test): New test.
14079 * testsuite/Makefile.in: Regenerate.
14081 2009-09-02 Ian Lance Taylor <iant@google.com>
14083 * output.cc (Output_file::resize): Call map_no_anonymous rather
14086 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14088 * gold.cc: Include "incremental.h".
14089 (queue_initial_tasks): Call Incremental_checker methods.
14090 * incremental.cc: Include "output.h".
14091 (Incremental_checker::can_incrementally_link_output_file): New
14093 * incremental.h (Incremental_checker): New class.
14095 * output.cc (Output_file::open_for_modification): New method.
14096 (Output_file::map_anonymous): Changed return type to bool. Record
14097 map in base_ field.
14098 (Output_file::map_no_anonymous): New method, broken out of map.
14099 (Output_file::map): Use map_no_anonymous and map_anonymous.
14100 * output.h (class Output_file): Update declarations.
14102 2009-08-24 Cary Coutant <ccoutant@google.com>
14104 * options.h (Command_line::Pre_options): New class.
14105 (Command_line::pre_options): New member.
14106 * options.cc (gold::options::ready_to_register): New variable.
14107 (One_option::register_option): Do nothing if not registering options.
14108 Assert if same short option registered twice.
14109 (General_options::General_options): Turn off option registration when
14111 (Command_line::Pre_options::Pre_options): New constructor.
14113 2009-08-24 Cary Coutant <ccoutant@google.com>
14115 * options.h (General_options::no_keep_memory): Remove incorrect
14118 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14120 * Makefile.am (am__skiplex, am__skipyacc): New.
14121 * Makefile.in: Regenerate.
14123 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14125 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14126 (INCLUDES): ... this.
14127 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14128 (AM_CPPFLAGS): Renamed from ...
14129 (INCLUDE): ... this.
14130 * Makefile.in, testsuite/Makefile.in: Regenerate.
14132 * Makefile.in: Regenerate.
14133 * aclocal.m4: Likewise.
14134 * config.in: Likewise.
14135 * configure: Likewise.
14136 * testsuite/Makefile.in: Likewise.
14138 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14139 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14140 * Makefile.in: Regenerate.
14141 * testsuite/Makefile.in: Regenerate.
14143 2009-08-19 Cary Coutant <ccoutant@google.com>
14145 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14146 symbols in shared libraries overridden by hidden or internal symbols
14147 in the main program.
14149 2009-08-19 Chris Demetriou <cgd@google.com>
14151 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14152 checking source file names in error messages.
14154 2009-08-18 Doug Kwan <dougkwan@google.com>
14156 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14157 an elcpp::Ehdr as parameter. Adjust call to set_target.
14158 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14159 an elfcpp::Ehdr as parameter.
14160 * object.cc (Object::set_target): Remove the version that looks up
14161 a target and sets it.
14162 (Sized_relobj::setup): Take a Target object instead of
14163 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14164 (make_elf_sized_object): Find target and ask target to
14165 make an ELF object.
14166 * object.h: (Object::set_target): Remove the version that looks up
14167 a target and sets it.
14168 (Sized_relobj::setup): Take a Target object instead of
14169 an elfcpp:Ehdr as parameter.
14170 * target.cc: Include dynobj.h.
14171 (Target::do_make_elf_object_implementation): New.
14172 (Target::do_make_elf_object): New.
14173 * target.h (Target::make_elf_object): New template declaration.
14174 (Target::do_make_elf_object): New method declarations.
14175 (Target::do_make_elf_object_implementation): New template declaration.
14177 2009-08-14 Ian Lance Taylor <iant@google.com>
14179 * gold.h (FUNCTION_NAME): Define.
14180 (gold_unreachable): Use FUNCTION_NAME.
14182 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14184 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14185 symbol in the --keep-unique list is not found.
14187 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14189 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14190 been maked as --keep-unique.
14191 (Icf::unfold_section): New function.
14192 * icf.h (Icf::unfold_section): New function.
14193 * options.h (General_options::keep_unique): New option.
14194 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14195 * testsuite/Makefile.in: Regenerate.
14196 * testsuite/icf_keep_unique_test.sh: New file.
14197 * testsuite/icf_keep_unique_test.cc: New file.
14199 2009-08-12 Cary Coutant <ccoutant@google.com>
14202 * resolve.cc (Symbol_table::resolve): Check for references from
14203 dynamic objects to hidden and internal symbols.
14204 * testsuite/Makefile.am (hidden_test.sh): New test.
14205 * testsuite/Makefile.in: Regenerate.
14206 * testsuite/hidden_test.sh: New script.
14207 * testsuite/hidden_test_1.c: New test source.
14208 * testsuite/hidden_test_main.c: New test source.
14210 2009-08-11 Doug Kwan <dougkwan@google.com>
14212 * arm.cc: Update comments.
14213 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14214 segment to locate the .ARM.exidx section if present.
14216 2009-08-09 Doug Kwan <dougkwan@google.com>
14218 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14221 2009-08-07 Sriraman Tallam <tmsriram@google.com>
14222 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14225 2009-08-06 Sriraman Tallam <tmsriram@google.com>
14227 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14228 valid tls_segment only for non-debug-section relocations.
14229 * testsuite/Makefile.am: Add gc_tls_test.
14230 * testsuite/Makefile.in: Regenerate.
14231 * testsuite/gc_tls_test.cc: New file.
14232 * testsuite/gc_tls_test.sh: New file.
14234 2009-08-05 Sriraman Tallam <tmsriram@google.com>
14236 * icf.cc: New file.
14238 * Makefile.am (CCFILES): Add icf.cc.
14239 (HFILES): Add icf.h
14240 * Makefile.in: Regenerate.
14241 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14242 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14243 section, symbol and addend information for the relocs.
14244 * gold.cc (queue_middle_tasks): Call identical code folding.
14245 * gold.h: Add defines for multimap.
14246 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14247 to the call of finalize_local_symbols.
14248 * main.cc (main): Create object of class Icf.
14249 * object.cc (Sized_relobj::do_layout): Allow this function to be
14250 called twice during icf.
14251 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14252 to sections marked as identical by icf.
14253 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14255 (Sized_relobj::do_section_entsize): New function.
14256 * object.h (Object::section_entsize): New function.
14257 (Object::do_section_entsize): New pure virtual function.
14258 (Relobj::finalize_local_symbols): Add new parameter.
14259 (Relobj::do_section_entsize): New function.
14260 * options.h (General_options::icf): New option.
14261 (General_options::icf_iterations): New option.
14262 (General_options::print_icf_sections): New option.
14263 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14264 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14265 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14267 * symtab.cc (Symbol_table::is_section_folded): New function.
14268 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14269 to sections marked as identical by icf.
14270 * symtab.h (Symbol_table::set_icf): New function.
14271 (Symbol_table::icf): New function.
14272 (Symbol_table::is_section_folded): New function.
14273 (Symbol_table::icf_): New data member.
14274 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14275 * testsuite/Makefile.am: Add commands to build icf_test.
14276 * testsuite/Makefile.in: Regenerate.
14277 * testsuite/icf_test.sh: New file.
14278 * testsuite/icf_test.cc: New file.
14280 2009-07-24 Chris Demetriou <cgd@google.com>
14282 * layout.cc (is_compressible_debug_section): Fix incorrect
14283 comment about compressed section names.
14285 2009-07-20 Ian Lance Taylor <ian@airs.com>
14288 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14290 2009-07-16 Ian Lance Taylor <iant@google.com>
14293 * layout.h: #include <map>.
14294 (class Kept_section): Change from struct to class. Add accessors
14295 and setters. Add section size to Comdat_group mapping. Change
14296 Comdat_group to std::map. Add is_comdat_ field. Add
14297 linkonce_size field in union.
14298 (class Layout): Update declaration of find_or_add_kept_section.
14299 Don't declare find_kept_object.
14300 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14301 parameter. Add object, shndx, is_comdat, and is_group_name
14302 parameters. Change all callers. Adjust for new Kept_section.
14303 (Layout::find_kept_object): Remove.
14304 * object.cc (Sized_relobj::include_section_group): Update use of
14305 Kept_section. Rename secnum to shndx. Only record
14306 Kept_comdat_section if sections are the same size.
14307 (Sized_relobj::include_linkonce_section): Update use of
14308 Kept_section. Only record Kept_comdat_section if sections are the
14309 same size. Set size of linkonce section.
14310 (Sized_relobj::map_to_kept_section): Update call to
14311 get_kept_comdat_section.
14312 * object.h (class Sized_relobj): Rename fields in
14313 Kept_comdat_section to drop trailing underscores; change object
14314 field to Relobj*. Change Kept_comdat_section_table to store
14315 struct rather than pointer.
14316 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14317 Add kept_object and kept_shndx parameters. Change all callers.
14318 (Sized_relobj::get_kept_comdat_section): Change return type to
14319 bool. Add kept_object and kept_shndx parameters. Change all
14321 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14322 Layout::find_or_add_kept_section.
14324 2009-07-09 Ian Lance Taylor <iant@google.com>
14326 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14327 Reserve space in the hash table.
14329 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14331 * fileread.cc (File_read::get_mtime): New method.
14332 * fileread.h (Timespec): New structure.
14333 (File_read::get_mtime): New method.
14334 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14335 Renamed from timestamp_nsec.
14336 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14338 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14340 (Incremental_inputs::report_archive): Save mtime; style fix.
14341 (Incremental_inputs::report_obejct): Save mtime; style fix.
14342 (Incremental_inputs::report_script): Save mtime; style fix.
14343 (Incremental_inputs::finalize_inputs): Style fix.
14344 (Incremental_inputs::finalize): Style fix.
14345 (Incremental_inputs::create_input_section_data): Store inputs
14347 * incremental.h (Incremental_inputs::report_script): Add mtime
14349 (Incremental_inputs::Input_info::Input_info): Intialize only one
14351 (Incremental_inputs::Input_info::archive): Move to nameless
14353 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14354 (Incremental_inputs::Input_info::script): Move to nameless union.
14355 (Incremental_inputs::mtime): New field.
14356 * script.cc (read_input_script): Pass file mtime to
14358 * script.h (Script_info::inputs): Style fix.
14360 2009-07-01 Ian Lance Taylor <ian@airs.com>
14362 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14365 2009-06-24 Ian Lance Taylor <iant@google.com>
14368 * layout.cc (Layout::choose_output_section): If we find an
14369 existing section, update the flags.
14370 (Layout::create_notes): New function, broken out of
14372 (Layout::finalize): Don't create note sections.
14373 (Layout::create_note): Don't crash if linker script discards
14375 (Layout::create_gold_note): Likewise.
14376 (Layout::create_build_id): Likewise. Don't set
14377 after_input_sections on the section.
14378 (Layout::create_executable_stack_info): Remove target parameter.
14380 * layout.h (class Layout): Declare create_notes. Update
14381 declaration of create_executable_stack_info.
14382 * gold.cc (queue_middle_tasks): Call create_notes.
14383 * output.cc (Output_section::update_flags_for_input_section): Move
14384 here from output.h. If SHF_ALLOC flag is newly set, mark address
14386 * output.h (Output_data::mark_address_invalid): New function.
14387 (class Output_section): Only declare, not define,
14388 update_flags_for_input_section. Remove set_flags.
14390 2009-06-24 Ian Lance Taylor <iant@google.com>
14392 * script-sections.cc (Output_section_definition::
14393 set_section_addresses): Rename shadowing local load_address to
14396 2009-06-24 Ian Lance Taylor <iant@google.com>
14399 * reloc.cc (relocate_sections): Skip empty relocation sections.
14401 2009-06-23 Ian Lance Taylor <iant@google.com>
14404 * layout.cc (Layout::create_note): Use choose_output_section
14405 rather than make_output_section.
14407 2009-06-23 Ian Lance Taylor <iant@google.com>
14410 * options.cc (General_options::parse_V): Set printed_version_.
14411 (General_options::General_options): Initialize printed_version_.
14412 * options.h (class General_options): Add printed_version_ field.
14413 * gold.cc (queue_initial_tasks): If there are no input files,
14414 don't give a fatal error if we printed the version information.
14415 (queue_middle_tasks): If using -r with a shared object, give a
14416 fatal error rather than an ordinary error.
14418 2009-06-23 Ian Lance Taylor <iant@google.com>
14421 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14422 (Layout::make_output_section): Set have_stabstr_section_ if we see
14423 a .stab*str section.
14424 (Layout::finalize): Call link_stabs_sections.
14425 (Layout::link_stabs_sections): New file.
14426 * layout.h (class Layout): Add have_stabstr_section_ field.
14427 Declare link_stabs_sections.
14429 2009-06-23 Doug Kwan <dougkwan@google.com>
14431 * Makefile.am (libgold_a_LIBADD): New.
14432 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14433 * Makefile.in: Regenerate.
14434 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14435 * configure: Regenerate.
14436 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14437 * fileread.cc: Include sys/state.h
14438 * gold.h: Declare memmem and strndup if found missing.
14439 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14441 2009-06-23 Ian Lance Taylor <iant@google.com>
14443 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14444 * configure: Rebuild.
14446 2009-06-23 Ian Lance Taylor <iant@google.com>
14449 * object.cc (Object::section_contents): Don't try to get a view if
14450 the section has length zero.
14451 (Object::handle_gnu_warning_section): If the section is empty, use
14452 the name of the section as the warning.
14454 2009-06-23 Ian Lance Taylor <iant@google.com>
14457 * stringpool.h (class Stringpool_template): Add optimize_ field.
14458 (Stringpool_template::set_optimize): New function.
14459 * stringpool.cc (Stringpool_template::Stringpool_template):
14460 Initialize optimize_ field.
14461 (Stringpool_template::set_string_offsets): Test local optimize
14462 fild rather than parameter.
14463 * layout.cc (Layout::Layout): Call set_optimize on the section
14466 2009-06-22 Ian Lance Taylor <iant@google.com>
14469 * yyscript.y: Parse TARGET.
14470 * script.cc (script_set_target): New function.
14471 * script-c.h (script_set_target): Declare.
14472 * options.cc (General_options::string_to_object_format): Rename
14473 from string_to_object_format in anonymous namespace. Change
14475 * options.h (class General_options): Declare
14476 string_to_object_format.
14478 2009-06-22 Ian Lance Taylor <iant@google.com>
14480 * script-sections.cc (Script_sections::create_segments): Don't put
14481 program headers in a PT_LOAD segment if -n or -N.
14483 2009-06-22 Ian Lance Taylor <iant@google.com>
14486 * options.h (class General_options): Add -z lazy and -z now. Sort
14487 -z options into alphabetical order.
14488 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14490 2009-06-21 Ian Lance Taylor <iant@google.com>
14492 * layout.cc (Layout::make_output_section): Call
14493 Target::new_output_section.
14494 (Layout::attach_allocated_section_to_segment): Put large section
14495 sections in a separate load segment with the large segment flag
14497 (Layout::segment_precedes): Sort large data segments after other
14499 (align_file_offset): New static function.
14500 (Layout::set_segment_offsets): Use align_file_offset.
14501 * output.h (class Output_section): Add is_small_section_ and
14502 is_large_section_ fields.
14503 (Output_section::is_small_section): New function.
14504 (Output_section::set_is_small_section): New function.
14505 (Output_section::is_large_section): New function.
14506 (Output_section::set_is_large_section): New function.
14507 (Output_section::is_large_data_section): New function.
14508 (class Output_segment): Add is_large_data_segment_ field.
14509 (Output_segment::is_large_data_segment): New function.
14510 (Output_segment::set_is_large_data_segment): New function.
14511 * output.cc (Output_section::Output_section): Initialize new
14513 (Output_segment::Output_segment): Likewise.
14514 (Output_segment::add_output_section): Add assertion that large
14515 data sections always go in large data segments. Force small data
14516 sections to the end of the list of data sections. Force small BSS
14517 sections to the start of the list of BSS sections. For large BSS
14518 sections to the end of the list of BSS sections.
14519 * symtab.h (class Symbol): Declare is_common_shndx.
14520 (Symbol::is_defined): Check Symbol::is_common_shndx.
14521 (Symbol::is_common): Likewise.
14522 (class Symbol_table): Define enum Commons_section_type. Update
14523 declarations. Add small_commons_ and large_commons_ fields.
14524 * symtab.cc (Symbol::is_common_shndx): New function.
14525 (Symbol_table::Symbol_table): Initialize new fields.
14526 (Symbol_table::add_from_object): Put small and large common
14527 symbols in the right list.
14528 (Symbol_table::sized_finalized_symbol): Check
14529 Symbol::is_common_shndx.
14530 (Symbol_table::sized_write_globals): Likewise.
14531 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14532 common symbol lists. Don't call do_allocate_commons_list if the
14534 (Symbol_table::do_allocate_commons_list): Remove is_tls
14535 parameter. Add comons_section_type parameter. Change all
14536 callers. Handle small and large common symbols.
14537 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14538 Symbol::is_common_shndx.
14539 * resolve.cc (symbol_to_bits): Likewise.
14540 * target.h (Target::small_common_shndx): New function.
14541 (Target::small_common_section_flags): New function.
14542 (Target::large_common_shndx): New function.
14543 (Target::large_common_section_flags): New function.
14544 (Target::new_output_section): New function.
14545 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14546 small_common_section_flags, and large_common_section_flags
14548 (Target::do_new_output_section): New virtual function.
14549 * arm.cc (Target_arm::arm_info): Initialize new fields.
14550 * i386.cc (Target_i386::i386_info): Likewise.
14551 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14553 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14554 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14555 (Target_x86_64::do_new_output_section): New function.
14556 * configure.ac: Define conditional MCMODEL_MEDIUM.
14557 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14558 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14559 (large_LDFLAGS): Define.
14560 * testsuite/large.c: New file.
14561 * testsuite/testfile.cc (Target_test::test_target_info):
14562 Initialize new fields.
14563 * configure, testsuite/Makefile.in: Rebuild.
14565 2009-06-05 Doug Kwan <dougkwan@google.com>
14567 * Makefile.am (CCFILES): Add target.cc.
14568 * Makefile.in: Regenerate.
14569 * i386.cc (class Target_i386): Define new virtual method to
14570 override do_is_local_label_name in parent.
14571 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14572 local symbols if --discard-locals or -X is given.
14573 * options.h (class General_options): Declare new options
14574 '--discard-locals' and '-X' for discarding locals.
14575 * target.h (class Target): Define new methods is_local_label_name.
14576 Declare new virtual method do_is_local_label_name.
14577 * target.cc: New file.
14578 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14579 (check_SCRIPTS): Add discard_locals_test.sh.
14580 (check_DATA): Add discard_local_tests.syms.
14581 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14582 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14583 * testsuite/Makefile.in: Regenerate.
14584 * testsuite/discard_locals_test.c: New file.
14585 * testsuite/discard_locals_test.sh: Same.
14587 2009-06-05 Doug Kwan <dougkwan@google.com>
14589 * object.cc (Sized_relobj::Sized_relobj): Initialize
14590 discarded_eh_frame_shndx_ to -1U.
14591 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14593 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14594 a discarded .eh_frame section.
14595 (Sized_relobj::do_finalize_local_symbols): Ditto.
14596 * object.h (class Sized_relobj): Declare new member
14597 discarded_eh_frame_shndx_.
14598 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14599 (local_labels_test.o, local_labels_test): New rules.
14600 * testsuite/Makefile.in: Regenerate.
14602 2009-06-04 Doug Kwan <dougkwan@google.com>
14604 * layout.cc (Layout::section_name_mapping): Add mapping for
14605 special ARM sections.
14607 2009-06-03 Doug Kwan <dougkwan@google.com>
14609 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14610 (utils::has_overflow): Same.
14612 2009-06-03 Ian Lance Taylor <iant@google.com>
14614 * layout.cc (Layout::section_name_mapping): New array, replacing
14615 Layout::linkonce_mapping.
14616 (Layout::section_name_mapping_count): New variable, replacing
14617 Layout::linkonce_mapping_count.
14618 (Layout::linkonce_output_name): Remove.
14619 (Layout::output_section_name): Rewrite.
14620 * layout.h (class Layout): Rename Linkonce_mapping to
14621 Section_name_mapping, linkonce_mapping to section_name_mapping,
14622 linkonce_mapping_count to section_name_mapping_count. Don't
14623 declare linkonce_output_name.
14625 2009-06-03 Doug Kwan <dougkwan@google.com>
14627 * gold/arm.cc (namespace utils): New.
14628 (Target_arm::reloc_is_non_pic): Define new method.
14629 (class Arm_relocate_functions): New.
14630 (Target_arm::Relocate::relocate): Handle relocation types used by
14633 2009-06-03 Ian Lance Taylor <iant@google.com>
14635 * arm.cc (Target_arm::scan::global): Use || instead of |.
14637 2009-06-02 Doug Kwan <dougkwan@google.com>
14639 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14640 issued_non_pic_error_.
14641 (class Target_arm::Scan): Declare new method check_non_pic.
14642 Define new method symbol_needs_plt_entry.
14643 Declare new data member issued_non_pic_error_.
14644 (class Target_arm::Relocate): Declare new method
14645 should_apply_static_reloc.
14646 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14647 (Target_arm::Scan::check_non_pic): Define new method.
14648 (Target_arm::Scan::local): Handle a small subset of reloc types used
14650 (Target_arm::Scan::local): Same.
14651 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14653 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14655 * incremental.cc (Incremental_inputs::report_command_line): Filter
14656 out --incremental-* options.
14658 2009-05-29 Doug Kwan <dougkwan@google.com>
14660 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14662 (class Target_arm): Update comment.
14663 (Target_arm::Target_arm): Initialize new data members GOT_,
14664 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14665 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14666 and Target_arm::rel_dyn_section.
14667 Declare new_enum Target_arm::Got_type.
14668 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14670 Update commments for member do_dynsym_value.
14671 (Target_arm::got_size, Target_arm::plt_section,
14672 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14673 new methods inside class defintion.
14674 (Target_arm::got_section): Define new method.
14675 (Target_arm::rel_dyn_section): Same.
14676 (Output_data_plt_arm): New template class.
14677 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14678 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14679 (Output_data_plt_arm::add_entry): Same.
14680 (Output_data_plt_arm::first_plt_entry): Define new
14681 static data member for PLT instruction template.
14682 (Output_data_plt_arm::plt_entry): Same.
14683 (Output_data_plt_arm::do_write): Define new method.
14684 (Target_arm::make_plt_entry): Same.
14685 (Target_arm::do_finalize_sections): Same.
14686 (Target_arm::do_dynsym_value): Same.
14688 2009-05-28 Doug Kwan <dougkwan@google.com>
14690 * Makefile.am (TARGETSOURCES): Add arm.cc.
14691 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14692 * Makefile.in: Regenerate.
14693 * arm.cc: New file.
14694 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14696 2009-05-26 Doug Kwan <dougkwan@google.com>
14698 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14699 (General_options::check_excluded_libs): Strip off directories in
14700 archive name before matching like GNU ld does.
14701 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14702 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14703 (exclude_libs_test_LDFLAGS): Add linker option
14704 -Wl,--exclude-libs,libexclude_libs_test_3
14705 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14706 an explicit archive without using -l.
14707 (alt/libexclude_libs_test_3.a): New make rule.
14708 * testsuite/Makefile.in: Regenerate.
14709 * testsuite/exclude_libs_test.c : Declare lib3_default().
14711 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14712 * exclude_libs_test_3.c: New file.
14714 2009-05-26 Nick Clifton <nickc@redhat.com>
14716 * po/id.po: New Indonesian translation.
14717 * po/gold.pot: Updated template file.
14719 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14721 * testsuite/Makefile.am: Add -ffunction-sections to compile
14722 gc_comdat_test files. Add -Wl,--gc-sections to build
14724 * testsuite/Makefile.in: Regenerate.
14725 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14727 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14729 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14730 kept comdat section was garbage collected.
14731 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14732 * testsuite/Makefile.in: Regenerate.
14733 * testsuite/gc_comdat_test.sh: New file.
14734 * testsuite/gc_comdat_test_1.cc: New file.
14735 * testsuite/gc_comdat_test_2.cc: New file.
14737 2009-05-19 Doug Kwan <dougkwan@google.com>
14739 * archive.cc (Archive::Archive): Move constructor from archive.h
14740 to here. Initialize no_export_.
14741 (Archive::get_elf_object_for_member): Set no_export flag of object.
14742 * archive.h (Archive::Archive): Move constructor body to
14744 (Archive::no_export): New method.
14745 (Archive::no_export_): New field.
14746 * object.h (Object::Object): Initialize no_export_ to false.
14747 (Object::no_export, Object::set_no_export): New methods.
14748 (Object::no_export_): New field.
14749 * options.cc (General_options::parse_exclude_libs): New method.
14750 (General_options::check_excluded_libs) Same.
14751 * options.h (exclude_libs): New option.
14752 (General_options::check_excluded_libs): New method declaration.
14753 (General_options::excluded_libs_): New field.
14754 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14755 default or protected visibility if an object has no-export flag set.
14756 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14757 (check_SCRIPTS): Add exclude_libs_test.sh.
14758 (check_DATA): Add exclude_libs_test.syms.
14759 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14760 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14761 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14762 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14763 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14764 libexclude_libs_test_2.a): New rules.
14765 * testsuite/Makefile.in: Regenerate.
14766 * testsuite/exclude_libs_test.c: New file.
14767 * testsuite/exclude_libs_test.sh: Ditto.
14768 * testsuite/exclude_libs_test_1.c: Ditto.
14769 * testsuite/exclude_libs_test_2.c: Ditto.
14771 2009-05-15 Ian Lance Taylor <iant@google.com>
14773 * configure.ac: Check for declarations for cases where libiberty.h
14774 checks HAVE_DECL_xxx.
14775 * configure, config.in: Rebuild.
14777 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14779 * gold.h (Incremental_argument_list): Remove (invalid) forward
14781 * incremental.cc (Incremental_inputs::report_achive): New method.
14782 (Incremental_inputs::report_object): New method.
14783 (Incremental_inputs::report_script): New method.
14784 (Incremental_inputs::finalize_inputs): New method.
14785 (Incremental_inputs::finalize): Call finalize_inputs().
14786 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14787 Create inputs entries.
14788 * incremental.h (Incremental_input_type): New enum.
14789 (Incremental_inputs::Incremental_input): Initialize new fields.
14790 (Incremental_inputs::report_inputs): New method.
14791 (Incremental_inputs::report_achive): New method.
14792 (Incremental_inputs::report_object): New method.
14793 (Incremental_inputs::report_script): New method.
14794 (Incremental_inputs::finalize_inputs): New method.
14795 (Incremental_inputs::Input_info): New struct.
14796 (Incremental_inputs::Input_info_map): New typedef.
14797 (Incremental_inputs::lock_): New field.
14798 (Incremental_inputs::Inputs_): New field.
14799 (Incremental_inputs::Inputs_map): New field.
14800 * main.cc (main): Call Incremental_input::report_inputs.
14801 * options.h (Input_argument_list): Typedef moved from
14803 (Input_file_group::Files): Remove, use ::Input_argument_list.
14804 (Input_file_group::Input_argument_list): Remove, use
14805 ::Input_argument_list.
14806 * plugin.cc (Plugin_manager::add_input_file): Add error in
14808 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14810 * script.cc (read_input_script): Call
14811 Incremental_input::report_script.
14812 * script.h (Script_info): New class.
14814 2009-04-27 Ian Lance Taylor <iant@google.com>
14816 * x86_64.cc (do_adjust_output_section): Set entsize to
14819 2009-04-23 Elliott Hughes <enh@google.com>
14821 * output.cc (Output_file::close): After short writes, continue
14822 writing from the correct offset in the buffer being written.
14824 2009-04-23 Chris Demetriou <cgd@google.com>
14826 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14827 * configure: Regenerate.
14828 * config.in: Regenerate.
14829 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14830 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14832 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14834 * incremental.cc (Incremental_inputs_header_data): Renamed from
14835 Incremental_input_header_data.
14836 (Incremental_inputs_header_data::data_size): New field.
14837 (Incremental_inputs_header_data::put_input_file_count): Renamed
14838 from input_file_count.
14839 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14840 from command_line_offset.
14841 (Incremental_inputs_header_data::put_reserved): Renamed from
14843 (Incremental_inputs_entry_data): Renamed from
14844 Incremental_input_entry_data.
14845 (Incremental_inputs_entry_data::data_size): New field.
14846 (Incremental_inputs::report_command_line): New method.
14847 (Incremental_inputs::finalize): New method.
14848 (Incremental_inputs::create_incremental_inputs_data): New method.
14849 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14850 * incremental.h: New file.
14851 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14852 (Layout::finalize): Create incremental inputs section in
14853 incremental builds.
14854 (Layout::create_incremental_info_sections): New method.
14855 * layout.h (Layout::incremental_inputs): New method.
14856 (Layout::create_incremental_info_sections): New method.
14857 (Layout::incremental_inputs_): New field.
14858 * main.cc (main): Notify Incremental_input of the command line.
14860 2009-04-01 Ian Lance Taylor <iant@google.com>
14861 Mikolaj Zalewski <mikolajz@google.com>
14863 * gold.h (reserve_unordered_map): Define, three versions, one for
14864 each version of Unordered_map.
14865 * layout.cc (Layout::Layout): Remove options parameter. Add
14866 number_of_input_files parameter. Don't initialize options_.
14867 Initialize number_of_input_files_ and resized_signatures_. Move
14868 sections_are_attached_.
14869 (Layout::layout_group): Reserve space for group_signatures_.
14870 (Layout::find_or_add_kept_section): Change name parameter to be a
14871 reference. Resize signatures_ map when it gets large enough.
14872 (Layout::layout_eh_frame): Use parameters->options() instead of
14874 (Layout::make_output_section): Likewise.
14875 (Layout::attach_allocated_section_to_segment): Likewise.
14876 (Layout::finalize, Layout::create_executable_stack): Likewise.
14877 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14878 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14879 * layout.h (class Layout): Update declarations. Remove options_
14880 field. Add number_of_input_files_ and resized_signatures_
14881 fields. Move sections_are_attached_ field.
14882 * main.cc (main): Pass number of input files to Layout
14883 constructor. Don't pass options.
14885 2009-03-30 Ian Lance Taylor <iant@google.com>
14887 * ffsll.c (ffsll): Correct implementation.
14889 2009-03-27 Ian Lance Taylor <iant@google.com>
14891 * ffsll.c: New file.
14892 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14893 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14894 * ftruncate.c (ftruncate): Declare before definition.
14895 * mremap.c (mremap): Likewise.
14896 * pread.c (pread): Likewise.
14897 * configure, Makefile.in, config.in: Rebuild.
14899 * mremap.c: New file.
14900 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14901 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14902 (mremap): Declare if HAVE_MREMAP is not defined.
14903 * configure, Makefile.in, config.in: Rebuild.
14905 2009-03-27 Cary Coutant <ccoutant@google.com>
14907 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14908 position independent.
14909 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14910 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14912 2009-03-24 Cary Coutant <ccoutant@google.com>
14914 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14916 (needs_dynamic_reloc): Likewise.
14918 2009-03-24 Ian Lance Taylor <iant@google.com>
14920 * yyscript.y (file_cmd): Recognize EXTERN.
14921 (extern_name_list, extern_name_list_body): New nonterminals.
14922 * script.cc (script_add_extern): Define.
14923 * script-c.h (script_add_extern): Declare.
14925 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
14927 * object.cc (is_elf_object): Define.
14928 * object.h (is_elf_object): Declare.
14929 * archive.cc (Archive::get_elf_object_for_member): Call
14931 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14933 2009-03-24 Elliott Hughes <enh@google.com>
14935 * output.cc (Output_file::map_anonymous): Define.
14936 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14937 try an anonymous one. Report the size if the mmap fails.
14938 * output.h (class Output_file): Declare map_anonymous.
14940 2009-03-24 Ian Lance Taylor <iant@google.com>
14942 * target-select.cc (instantiate_target): Don't acquire the lock if
14943 the instantiated_target_ field has already been set.
14945 2009-03-23 Ian Lance Taylor <iant@google.com>
14947 * gold-threads.h (class Initialize_lock): Define.
14948 * gold-threads.cc (class Initialize_lock_once): Define.
14949 (initialize_lock_control): New static variable.
14950 (initialize_lock_pointer): New static variable.
14951 (initialize_lock_once): New static function.
14952 (Initialize_lock::Initialize_lock): Define.
14953 (Initialize_lock::initialize): Define.
14954 * target-select.h: Include "gold-threads.h".
14955 (class Target_selector): Add lock_ and initialize_lock_ fields.
14956 Don't define instantiate_target, just declare it.
14957 * target-select.cc (Target_selector::Target_selector): Initialize
14959 (Target_selector::instantiate_target): Define.
14960 * descriptors.h: Include "gold-threads.h".
14961 (class Descriptors): Add initialize_lock_ field.
14962 * descriptors.cc (Descriptors::Descriptors): Initialize new
14964 (Descriptors::open): Use initialize_lock_ field
14965 * errors.h (class Errors): Add initialize_lock_ field.
14966 * errors.cc (Errors::Errors): Initialize new field.
14967 (Errors::initialize_lock): Use initialize_lock_ field.
14968 * powerpc.cc (class Target_selector_powerpc): Remove
14969 instantiated_target_ field. In do_recognize call
14970 instantiate_target rather than do_instantiate_target. In
14971 do_instantiate_target just allocate a new target.
14972 * sparc.cc (class Target_selector_sparc): Likewise.
14974 * freebsd.h: New file.
14975 * i386.cc: Include "freebsd.h".
14976 (Target_i386): Derive from Target_freebsd rather than
14978 (Target_selector_i386): Derive from Target_selector_freebsd rather
14979 than Target_selector.
14980 * x86_64.cc: Include "freebsd.h".
14981 (Target_x86_64): Derive from Target_freebsd rather than
14983 (Target_selector_x86_64): Derive from Target_selector_freebsd
14984 rather than Target_selector.
14985 * target.h (class Target): Add adjust_elf_header and
14986 do_adjust_elf_header.
14987 * output.cc (Output_file_header:: do_sized_write): Call target
14988 adjust_elf_header routine.
14989 * configure.tgt: Set targ_osabi.
14990 * configure.ac: Define GOLD_DEFAULT_OSABI.
14991 * parameters.cc (Parameters::default_target): Pass
14992 GOLD_DEFAULT_OSABI to select_target.
14993 * target-select.h (class Target_selector): Make instantiate_target
14994 protected rather than private.
14995 * Makefile.am (HFILES): Add freebsd.h.
14996 * configure, Makefile.in, config.in: Rebuild.
14998 * merge.cc (do_add_input_section): Correct pend value. Change
14999 message about last entry not being null terminated from error to
15002 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15004 * incremental.cc: New file.
15005 * Makefile.am (CCFILES): Add incremental.cc.
15006 * Makefile.in: Rebuild.
15008 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15010 * layout.cc (Layout::output_section_name): Preserve names
15011 of '.note.' sections.
15013 2009-03-19 Ian Lance Taylor <iant@google.com>
15015 * descriptors.cc (Descriptors::open): Check that the options are
15016 valid before using them.
15018 2009-03-18 Ian Lance Taylor <iant@google.com>
15020 * script-sections.h: Include <list>.
15021 (class Script_sections): Change Sections_elements from std::vector
15022 to std::list. Typedef public Elements_iterator. Add
15023 orphan_section_placement_, data_segment_align_start_, and
15024 saw_data_segment_align_ fields. Remove data_segment_align_index_
15026 * script-sections.cc (class Orphan_section_placement): New class.
15027 (class Sections_element): Add virtual functions is_relro and
15028 orphan_section_init. Remove virtual function place_orphan_here.
15029 (class Output_section_definition): Add is_relro and
15030 orphan_section_init. Remove place_orphan_here.
15031 (class Orphan_output_section): Likewise.
15032 (Script_sections::Script_sections): Update for field changes.
15033 (Script_sections::data_segment_align): Set saw_data_segment_align_
15034 and data_segment_align_start_, not data_segment_align_index.
15035 (Script_sections::data_segment_relro_end): Check
15036 saw_data_segment_align_. Use data_segment_align_start_ rather
15037 than data_segment_align_index_.
15038 (Script_sections::place_orphan): Rewrite to use
15039 Orphan_section_placement.
15041 2009-03-17 Ian Lance Taylor <iant@google.com>
15043 * archive.cc (Archive::add_symbols): Check for a version attached
15044 to the symbol name in the archive map.
15045 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15046 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15047 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15048 (ver_test_11.a): New target.
15049 * testsuite/Makefile.in: Rebuild.
15051 * configure.ac: Check for chsize and posix_fallocate. Replace
15053 * ftruncate.c: New file, from gnulib.
15054 * output.cc (posix_fallocate): Define dummy version if not
15055 HAVE_POSIX_FALLOCATE.
15056 (Output_file::map): Call posix_fallocate rather than lseek and
15058 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15059 * configure, Makefile.in, config.in: Rebuild.
15061 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
15063 * layout.h (Layout::create_note): Add section_name parameter.
15064 * layout.cc (Layout::create_note): Likewise.
15065 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
15067 2009-03-17 Ian Lance Taylor <iant@google.com>
15069 * descriptors.cc: Include "options.h".
15070 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15071 (Descriptors::open): Always use O_CLOEXEC when opening a new
15072 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15073 then set FD_CLOEXEC.
15075 * sparc.cc (class Target_sparc): Add has_got_section.
15076 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15077 make sure we have a GOT section.
15079 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15080 (Target_sparc::Scan::local): Likewise.
15081 (Target_sparc::Scan::global): Likewise.
15082 (Target_sparc::Relocate::relocate): Likewise.
15083 (Target_sparc::Relocate::relocate_tls): Likewise.
15085 * symtab.cc (Symbol_table::define_default_version): New function,
15086 broken out of add_from_object.
15087 (Symbol_table::add_from_object): Call define_default_version.
15088 (Symbol_table::define_special_symbol): Add resolve_oldsym
15089 parameter. Change all callers. If the version for a symbol comes
15090 from a version script, resolve it with the symbol with the same
15091 name with no version. Also add the symbol without a version if
15093 (do_define_in_output_data): If resolving with oldsym, don't delete
15095 (do_define_in_output_segment): Likewise.
15096 (do_define_as_constant): Likewise.
15097 * symtab.h (class Symbol_table): Update declarations.
15099 2009-03-13 Ian Lance Taylor <iant@google.com>
15101 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15102 (Read_symbols::requeue): New function.
15103 (Read_symbols::do_read_symbols): If make_elf_object fails because
15104 the target type is not configured, and the file was searched for,
15105 issue a warning and retry with the next directory.
15106 (Add_symbols::run): If the file has an incompatible format, and
15107 it was searched for, requeue the Read_symbols task. On error,
15108 release the object.
15109 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15110 dirindex parameter to constructor. Change all callers. Declare
15111 incompatible_warning and requeue.
15112 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15113 input_argument_ and input_group_ fields. Add them to
15114 constructor. Change all callers.
15115 (class Read_script): Add dirindex_ field. Add it to constructor.
15116 Change all callers.
15117 * archive.cc (Archive::setup): Remove input_objects parameter.
15118 Change all callers.
15119 (Archive::get_file_and_offset): Likewise.
15120 (Archive::read_all_symbols): Likewise.
15121 (Archive::read_symbols): Likewise.
15122 (Archive::get_elf_object_for_member): Remove input_objects
15123 parameter. Add punconfigured parameter. Change all callers.
15124 (Archive::add_symbols): Change return type to bool. Check return
15125 value of include_member.
15126 (Archive::include_all_members): Likewise.
15127 (Archive::include_member): Change return type to bool. Return
15128 false if first included object has incompatible target. Set
15129 included_member_ field.
15130 (Add_archive_symbols::run): If add_symbols returns false, requeue
15132 * archive.h (class Archive): Add included_member_ field.
15133 Initialize it in constructor. Add input_file and searched_for
15134 methods. Update declarations.
15135 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15136 input_argument_ fields. Add them to constructor. Change all
15138 * script.cc: Include "target-select.h".
15139 (class Parser_closure): Add skip_on_incompatible_target_ and
15140 found_incompatible_target_ fields. Add
15141 skip_on_incompatible_target parameter to constructor. Change all
15142 callers. Add methods skip_on_incompatible_target,
15143 clear_skip_on_incompatible_target, found_incompatible_target, and
15144 set_found_incompatible_target.
15145 (read_input_script): Add dirindex parameter. Change all callers.
15146 If parser finds an incompatible target, requeue Read_symbols
15148 (script_set_symbol): Clear skip_on_incompatible_target in
15150 (script_add_assertion, script_parse_option): Likewise.
15151 (script_start_sections, script_add_phdr): Likewise.
15152 (script_check_output_format): New function.
15153 * script.h (read_input_script): Update declaration.
15154 * script-c.h (script_check_output_format): Declare.
15155 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15156 (ignore_cmd): Remove OUTPUT_FORMAT.
15157 * fileread.cc (Input_file::Input_file): Add explicit this.
15158 (Input_file::will_search_for): New function.
15159 (Input_file::open): Add pindex parameter. Change all callers.
15160 * fileread.h (class Input_file): Add input_file_argument method.
15161 Declare will_search_for. Update declarations.
15162 * object.cc (make_elf_object): Add punconfigured parameter.
15163 Change all callers.
15164 * object.h (class Object): Make input_file public. Add
15165 searched_for method.
15166 (make_elf_object): Update declaration.
15167 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15169 * dirsearch.h (class Dirsearch): Update declaration.
15170 * options.h (class General_options): Add --warn-search-mismatch.
15171 * parameters.cc (Parameters::is_compatible_target): New function.
15172 * parameters.h (class Parameters): Declare is_compatible_target.
15173 * workqueue.cc (Workqueue::add_blocker): New function.
15174 * workqueue.h (class Workqueue): Declare add_blocker.
15176 * fileread.cc (Input_file::open): Remove options parameter.
15177 Change all callers.
15178 (Input_file::open_binary): Likewise.
15179 * script.cc (read_input_script): Likewise.
15180 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15181 options parameter from constructor. Change all callers.
15182 (class Read_script): Likewise.
15183 * fileread.h (class Input_file): Update declarations.
15184 * script.h (read_input_script): Update declaration.
15186 2009-03-10 Nick Clifton <nickc@redhat.com>
15188 * po/es.po: New Spanish translation.
15190 2009-03-06 Cary Coutant <ccoutant@google.com>
15192 * options.cc (parse_short_option): Keep dash_z from registering itself.
15194 2009-03-03 Ian Lance Taylor <iant@google.com>
15197 * target-reloc.h (relocate_section): Pass output_section to
15199 * i386.cc (Target_i386::should_apply_static_reloc): Add
15200 output_section parameter. Change all callers.
15201 (Target_i386::Relocate::relocate): Add output_section parameter.
15202 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15203 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15204 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15205 * testsuite/two_file_shared.sh: New script.
15206 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15207 (check_DATA): Add two_file_shared.dbg.
15208 (two_file_shared.dbg): New target.
15209 * testsuite/Makefile.in: Rebuild.
15211 2009-03-01 Ian Lance Taylor <iant@google.com>
15213 * configure.ac: Check for byteswap.h.
15214 * configure: Rebuild.
15215 * config.in: Rebuild.
15217 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15219 * layout.cc (Layout::find_or_add_kept_section): New function.
15220 (Layout::add_comdat): Removed.
15221 * layout.h (struct Kept_section): Move out of class Layout.
15222 Remove trailing underscores from field names. Add group_sections
15223 field. Rename group_ field to is_group. Change all uses.
15224 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15225 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15226 comdat_groups_ field.
15227 (Sized_relobj::include_section_group): Use
15228 find_or_add_kept_section and Kept_section::group_sections.
15229 (Sized_relobj::include_linkonce_section): Likewise.
15230 * object.cc (class Sized_relobj): Don't define Comdat_group or
15231 Comdat_group_table. Remove find_comdat_group and
15232 add_comdat_group. Remove comdat_groups_ field.
15233 * plugin.cc (include_comdat_group): Use
15234 Layout::find_or_add_kept_section.
15236 2009-02-28 Ian Lance Taylor <iant@google.com>
15238 * README: --gc-sections and map files are now supported. Document
15239 some build requirements.
15242 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15243 relocatable link set the value of the section symbol to zero.
15244 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15245 relocatable link don't include the section address in the local
15248 2009-02-27 Ian Lance Taylor <iant@google.com>
15251 * options.h (class Search_directory): Add is_system_directory.
15252 (class General_options): Declare is_in_system_directory.
15253 * options.cc (get_relative_sysroot): Make static.
15254 (get_default_sysroot): Make static.
15255 (General_optoins::is_in_system_directory): New function.
15256 * fileread.cc (Input_file::is_in_system_directory): New function.
15257 * fileread.h (class Input_file): Declare is_in_system_directory.
15258 * object.h (class Object): Add is_in_system_directory.
15259 (class Input_objects): Remove system_library_directory_ field.
15260 * object.cc (Input_objects::add_object): Don't set
15261 system_library_directory_.
15262 (input_objects::found_in_system_library_directory): Remove.
15263 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15264 parameter. Change all callers.
15265 (Symbol_table::sized_write_globals): Likewise.
15266 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15267 Call Object::is_in_system_directory.
15268 * symtab.h (class Symbol_table): Update declarations.
15271 * descriptors.h (Open_descriptor): Add is_on_stack field.
15272 * descriptors.cc (Descriptors::open): If the descriptor is on the
15273 top of the stack, remove it. Initialize is_on_stack field.
15274 (Descriptors::release): Only add pod to stack if it is not on the
15276 (Descriptors::close_some_descriptor): Clear stack_next and
15277 is_on_stack fields.
15280 * output.cc (Output_section::find_starting_output_address): Rename
15281 from starting_output_address; add PADDR parameter; change return
15283 * output.h (class Output_section): Declare
15284 find_starting_output_address instead of starting_output_address.
15285 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15286 section symbol for which we can't find a merge section.
15289 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15290 hidden or internal, force the symbol to be local.
15291 * resolve.cc (Symbol::override_visibility): Define.
15292 (Symbol::override_base): Use override_visibility.
15293 (Symbol_table::resolve): Likewise.
15294 (Symbol::override_base_with_special): Likewise.
15295 (Symbol_table::override_with_special): If the visibility is hidden
15296 or internal, force the symbol to be local.
15297 * symtab.h (class Symbol): Add set_visibility and
15298 override_visibility.
15299 * testsuite/ver_test_1.sh: New file.
15300 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15301 (check_DATA): Add ver_test_1.syms.
15302 (ver_test_1.syms): New target.
15303 * testsuite/Makefile.in: Rebuild.
15305 2009-02-25 Cary Coutant <ccoutant@google.com>
15307 * layout.cc (Layout::choose_output_section): Don't rename sections
15308 when using a linker script that has a SECTIONS clause.
15309 * Makefile.in: Regenerate.
15311 * testsuite/Makefile.am (script_test_5.sh): New test case.
15312 * testsuite/Makefile.in: Regenerate.
15313 * testsuite/script_test_5.cc: New file.
15314 * testsuite/script_test_5.sh: New file.
15315 * testsuite/script_test_5.t: New file.
15317 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15319 * archive.cc (Archive::include_member): Update calls to add_symbols.
15320 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15321 the Layout argument.
15322 * dynobj.h (do_add_symbols): Add the Layout argument.
15323 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15325 * object.h (Object::add_symbols): Add the Layout argument.
15326 (Object::do_add_symbols): Add the Layout argument.
15327 (Sized_relobj::do_add_symbols): Add the Layout argument.
15328 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15329 Unify the two versions.
15330 (Add_plugin_symbols): Remove.
15331 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15332 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15333 (Add_plugin_symbols): Remove.
15334 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15335 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15336 (Add_symbols::run): Make it work with Pulginobj.
15338 2009-02-06 Ian Lance Taylor <iant@google.com>
15340 * object.cc (Sized_relobj::do_layout): Make info message start
15341 with lower case letter.
15343 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15345 * binary.cc: Fix file comment.
15347 * options.h (enum Incremental_disposition): Define.
15348 (class General_options): Add new options: --incremental,
15349 --incremental_changed, --incremental_unchanged,
15350 --incremental_unknown. Add incremental_disposition_ and
15351 implicit_incremental_ fields.
15352 (General_options::incremental_disposition): New function.
15353 (class Position_dependent_options): Add incremental_disposition
15355 (Position_dependent_options::copy_from_options): Set incremental
15357 * options.cc (General_options::parse_incremental_changed): New
15359 (General_options::parse_incremental_unchanged): New function.
15360 (General_options::parse_incremental_unknown): New function.
15361 (General_options::General_options): Initialize new fields
15362 incremental_disposition_ and implicit_incremental_.
15363 (General_options::finalize): Check for uasge of --incremental-*
15364 without --incremental.
15366 2009-02-06 Chris Demetriou <cgd@google.com>
15368 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15369 pointer and to report location as the file name associated with
15371 (gold_undefined_symbol_at_location): New function to replace the
15372 old gold_undefined_symbol functionality.
15373 * target-reloc.h (relocate_section): Update to use
15374 gold_undefined_symbol_at_location.
15375 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15376 Call gold_undefined_symbol function rather than gold_error.
15377 * errors.h (Errors::undefined_symbol): Take location as a
15378 string, rather than calculating it from a relocation.
15379 * errors.cc (Errors::fatal): Print "fatal error:" before the
15381 (Errors::error, Errors::error_at_location): Print "error: "
15382 before the formatted message.
15383 (Errors::undefined_symbol): Take location as a string, rather
15384 than calculating it from a relocation.
15385 (gold_undefined_symbol_at_location): New function akin to
15386 old gold_undefined_symbol, calculates location from relocation.
15387 (gold_undefined_symbol): Change to take only a Symbol pointer
15388 and to report location as the file name associated with the symbol.
15389 * testsuite/debug_msg.sh: Update for changed error messages.
15390 * testsuite/undef_symbol.sh: Likewise.
15392 2009-02-04 Duncan Sands <baldrick@free.fr>
15395 * reduced_debug_output.h
15396 (Output_reduced_debug_abbrev_section::failed): Use format for
15398 (Output_reduced_debug_info_section::faild): Likewise.
15400 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15402 * script.cc (Lazy_demangler): New class.
15403 (Version_script_info::get_symbol_version_helper): Demangle a
15406 2009-01-29 Cary Coutant <ccoutant@google.com>
15408 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15410 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15412 2009-01-28 Ian Lance Taylor <iant@google.com>
15414 * version.cc (version_string): Bump to 1.9.
15416 * gold.h: Include <cstring> and <stdint.h>.
15417 * version.cc: Include <cstdio>.
15418 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15420 * reduced_debug_output.cc (insert_into_vector): Rename from
15421 Insert_into_vector; change all callers. Use Swap_unaligned to
15422 avoid aliasing issue; remove union since it is unnecessary.
15424 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15426 * Makefile.am (CCFILES): Add gc.cc.
15427 (HFILES): Add gc.h.
15428 * Makefile.in: Regenerate.
15429 * gold.cc (Gc_runner): New class.
15430 (queue_initial_tasks): Call garbage collection related tasks
15431 when corresponding options are invoked.
15432 (queue_middle_gc_tasks): New function.
15433 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15434 processed early before laying out sections during garbage collection.
15435 * gold.h (queue_middle_gc_tasks): New function.
15436 (is_prefix_of): Move from "layout.cc".
15437 * i386.cc (Target_i386::gc_process_relocs): New function.
15438 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15439 * main.cc (main): Create object of class "Garbage_collection".
15440 * object.cc (Relobj::copy_symbols_data): New function.
15441 (Relobj::is_section_name_included): New function.
15442 (Sized_relobj::do_layout): Allow this function to be called twice
15443 during garbage collection and defer layout of section during the
15445 * object.h (Relobj::get_symbols_data): New function.
15446 (Relobj::is_section_name_included): New function.
15447 (Relobj::copy_symbols_data): New function.
15448 (Relobj::set_symbols_data): New function.
15449 (Relobj::get_relocs_data): New function.
15450 (Relobj::set_relocs_data): New function.
15451 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15452 (Relobj::gc_process_relocs): New function.
15453 (Relobj::do_gc_process_relocs): New pure virtual function.
15454 (Relobj::sd_): New data member.
15455 (Sized_relobj::is_output_section_offset_invalid): New function.
15456 (Sized_relobj::do_gc_process_relocs): New function.
15457 * options.h (General_options::gc_sections): Modify to not be a no-op.
15458 (General_options::print_gc_sections): New option.
15459 * plugin.cc (Plugin_finish::run): Remove function call to
15460 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15461 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15462 * reloc.cc (Read_relocs::run): Add task to process relocs and
15463 determine unreferenced sections when doing garbage collection.
15464 (Gc_process_relocs): New class.
15465 (Sized_relobj::do_gc_process_relocs): New function.
15466 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15467 sections that are garbage collected.
15468 * reloc.h (Gc_process_relocs): New class.
15469 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15470 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15471 symbols whose corresponding sections are garbage collected.
15472 (Symbol_table::Symbol_table): Add new parameter for the garbage
15474 (Symbol_table::gc_mark_undef_symbols): New function.
15475 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15476 (Symbol_table::gc_mark_dyn_syms): New function.
15477 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15479 (Symbol_table::add_from_object): Likewise.
15480 (Symbol_table::add_from_relobj): When building shared objects, do not
15481 treat externally visible symbols as garbage.
15482 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15483 table information for static and relocatable links.
15484 * symtab.h (Symbol_table::set_gc): New function.
15485 (Symbol_table::gc): New function.
15486 (Symbol_table::gc_mark_undef_symbols): New function.
15487 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15488 (Symbol_table::gc_mark_dyn_syms): New function.
15489 (Symbol_table::gc_): New data member.
15490 * target.h (Sized_target::gc_process_relocs): New pure virtual
15492 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15493 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15495 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15497 * options.h (General_options::gc_sections): Define as a no-op for now.
15498 (General_options::no_keep_memory): Ditto.
15499 (General_options::Bshareable): Define.
15500 * options.cc (General_options::finalize): Honor -Bshareable.
15502 2009-01-20 Andreas Schwab <schwab@suse.de>
15504 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15505 read the value in the contents, since we don't use it. Use the
15506 template endianness when writing.
15507 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15509 2009-01-19 Andreas Schwab <schwab@suse.de>
15511 * configure.tgt (powerpc64-*): Fix targ_obj.
15513 2009-01-15 Ian Lance Taylor <iant@google.com>
15515 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15516 local symbols when stripping all symbols.
15518 2009-01-14 Cary Coutant <ccoutant@google.com>
15520 * output.cc (Output_reloc): Add explicit instantiations.
15522 2009-01-14 Cary Coutant <ccoutant@google.com>
15524 * archive.cc (Archive::get_elf_object_for_member): Remove call
15525 to File_read::claim_for_plugin.
15526 * descriptors.cc (Descriptors::open): Remove reference to
15528 (Descriptors::claim_for_plugin): Remove.
15529 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15530 (Descriptors::is_claimed): Remove.
15531 (claim_descriptor_for_plugin): Remove.
15532 * fileread.cc (File_read::claim_for_plugin): Remove.
15533 * fileread.h (File_read::claim_for_plugin): Remove.
15534 (File_read::descriptor): Reopen descriptor if necessary.
15535 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15536 (Plugin_manager::all_symbols_read): Add task parameter. Change
15538 (Plugin_manager::get_input_file): New function.
15539 (Plugin_manager::release_input_file): New function.
15540 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15541 corresponding data member.
15542 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15543 and pass to base constructor. Change all callers.
15544 (get_input_file, release_input_file): New functions.
15545 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15546 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15547 (Plugin_manager::all_symbols_read): Add task parameter.
15548 (Plugin_manager::get_input_file): New function.
15549 (Plugin_manager::release_input_file): New function.
15550 (Plugin_manager::task_): New data member.
15551 (Pluginobj::Pluginobj): Add filesize parameter.
15552 (Pluginobj::filename): New function.
15553 (Pluginobj::descriptor): New function.
15554 (Pluginobj::filesize): New function.
15555 (Pluginobj::filesize_): New data member.
15556 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15557 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15558 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15560 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15561 with archive libraries.
15562 * testsuite/Makefile.in: Regenerate.
15563 * testsuite/plugin_test.c (struct sym_info): New type.
15564 (get_input_file, release_input_file): New static variables.
15565 (onload): Capture new transfer vector entries.
15566 (claim_file_hook): Stop reading at end of file according to filesize.
15567 Factor out parsing of readelf output into separate function.
15568 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15569 APIs and get the source file name from the symbol table. Convert
15570 source file name to corresponding object file name. Print info
15571 message when adding new input files.
15572 (parse_readelf_line): New function.
15573 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15574 * testsuite/plugin_test_2.sh: Likewise.
15575 * testsuite/plugin_test_3.sh: Likewise.
15576 * testsuite/plugin_test_4.sh: New test case.
15578 2009-01-07 Ian Lance Taylor <iant@google.com>
15580 * version.cc (version_string): Bump to 1.8.
15582 2008-12-23 Cary Coutant <ccoutant@google.com>
15584 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15585 * plugin.cc (Plugin_manager::finish): Rename as
15586 layout_deferred_objects. Move cleanup to separate function.
15587 (Plugin_manager::cleanup): New function.
15588 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15590 * plugin.h (Plugin_manager::finish): Rename as
15591 layout_deferred_objects.
15592 (Plugin_manager::cleanup): New function.
15593 (Plugin_manager::cleanup_done): New field.
15595 2008-12-23 Cary Coutant <ccoutant@google.com>
15597 * plugin.cc (is_visible_from_outside): New function.
15598 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15599 so we don't return "IR only" status for exported symbols or -r links.
15601 * testsuite/Makefile.am (plugin_test_3): New test case.
15602 * testsuite/Makefile.in: Regenerate.
15603 * testsuite/plugin_test_3.sh: New file.
15605 2008-12-22 Cary Coutant <ccoutant@google.com>
15607 * object.cc (Sized_relobj::layout_section): New function.
15608 (Sized_relobj::do_layout): Defer layout of input sections until after
15609 plugin has provided replacement files.
15610 (Sized_relobj::do_layout_deferred_sections): New function.
15611 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15612 (Relobj::layout_deferred_sections): New function.
15613 (Relobj::do_layout_deferred_sections): New function.
15614 (Sized_relobj::do_layout_deferred_sections): New function.
15615 (Sized_relobj::layout_section): New function.
15616 (Sized_relobj::Deferred_layout): New structure.
15617 (Sized_relobj::deferred_layout_): New field.
15618 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15619 Change all callers. Layout deferred sections.
15620 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15622 (Plugin_hook::run): Move code from do_plugin_hook inline.
15623 (Plugin_hook::do_plugin_hook): Remove.
15624 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15625 (Plugin_manager::finish): Renamed, was cleanup.
15626 (Plugin_manager::should_defer_layout): New function.
15627 (Plugin_manager::add_deferred_layout_object): New function.
15628 (Plugin_manager::Deferred_layout_list): New type.
15629 (Plugin_manager::deferred_layout_objects_): New field.
15630 (Plugin_hook::do_plugin_hook): Remove.
15632 2008-12-17 Ian Lance Taylor <iant@google.com>
15634 * options.h (class General_options): Add --no case for
15637 2008-12-16 Cary Coutant <ccoutant@google.com>
15639 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15641 (Plugin_manager::claim_file): Create plugin object even if
15642 plugin did not call the add_symbols callback.
15643 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15644 asking for more symbols than were added.
15645 * testsuite/Makefile.am (plugin_test_1): Add test case with
15647 (empty.syms): New target.
15648 * testsuite/Makefile.in: Regenerate.
15649 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15650 message. Don't call add_symbols if no globals.
15651 (all_symbols_read_hook): Don't provide replacement for empty
15654 2008-12-12 Ian Lance Taylor <iant@google.com>
15656 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15657 r_type == 0 for a local symbol with r_sym == 0.
15658 (scan_relocatable_relocs): Pass r_sym to
15659 local_non_section_strategy.
15660 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15663 * configure.ac: Update test for TLS descriptors: they are
15664 supported as of glibc 2.9.
15665 * configure: Rebuild.
15667 2008-12-11 Ian Lance Taylor <iant@google.com>
15670 * target-reloc.h (Default_scan_relocatable_relocs): For each
15671 function, map r_type == 0 to RELOC_DISCARD.
15673 2008-12-10 Cary Coutant <ccoutant@google.com>
15675 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15676 object to override a kept COMDAT group from a plugin object.
15678 2008-12-09 Ian Lance Taylor <iant@google.com>
15681 * yyscript.y (file_cmd): Handle INPUT.
15683 * testsuite/initpri1.c: Change all declarations to be full
15684 prototypes by adding void, to avoid compiler warnings.
15686 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15688 * options.cc (General_options::parse_plugin_opt): New.
15689 (General_options::add_plugin): The argument now is just the filename.
15690 (General_options::add_plugin_option): New.
15691 * options.h (plugin_opt): New.
15692 (add_plugin): Change argument name.
15693 (add_plugin_option): New.
15694 * plugin.cc (Plugin::load): Don't parse the plugin option.
15695 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15696 (Plugin::add_option): New.
15697 (Plugin::args_): Change type.
15698 (Plugin::filename_): New.
15699 (Plugin_manager::add_plugin_option): New.
15700 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15701 * testsuite/Makefile.in: Regenerate.
15703 2008-12-05 Cary Coutant <ccoutant@google.com>
15705 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15706 Handle --strip-lto-sections option.
15707 * options.h (strip_lto_sections): New option.
15709 2008-12-01 Cary Coutant <ccoutant@google.com>
15711 * plugin.cc (ld_plugin_message): Change format parameter to const.
15712 Fix mismatch between new[] and delete.
15714 2008-11-14 Cary Coutant <ccoutant@google.com>
15716 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15719 2008-11-05 Craig Silverstein <csilvers@google.com>
15721 * options.cc (General_options::parse_dynamic_list): New function.
15722 * options.h (General_options): New flags dynamic_list,
15723 dynamic_list_data, dynamic_list_cpp_new, and
15724 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15725 (General_options::in_dynamic_list): New function.
15726 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15727 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15728 (Lex::can_continue_name): Likewise.
15730 (read_script_file): New parameter script_options.
15731 (read_dynamic_list): New function.
15732 (Script_options::define_dynamic_list): New function.
15733 (dynamic_list_keyword_parsecodes): New variable.
15734 (dynamic_list_keywords): New variable.
15735 * script.h (Script_options::define_dynamic_list): New function
15737 (read_dynamic_list): New function prototype.
15738 * symtab.cc (strprefix): New macro.
15739 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15740 dynamic_list_data, dynamic_list_cpp_new, and
15741 dynamic_list_cpp_typeinfo.
15742 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15743 (dynamic_list_expr): New rule.
15744 (dynamic_list_nodes): Likewise.
15745 (dynamic_list_node): Likewise.
15746 * testsuite/Makefile.am (dynamic_list): New test.
15747 * testsuite/Makefile.in: Regenerated.
15748 * testsuite/dynamic_list.t: New file.
15749 * testsuite/dynamic_list.sh: New file.
15751 2008-11-05 Craig Silverstein <csilvers@google.com>
15753 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15754 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15755 (t11_last): Likewise.
15756 * testsuite/ver_test_6.c (main): Likewise.
15758 2008-10-07 Cary Coutant <ccoutant@google.com>
15760 * options.c (General_options::finalize): Add check for -static and
15762 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15765 2008-10-02 Cary Coutant <ccoutant@google.com>
15767 * plugin.cc (make_sized_plugin_object): Fix conditional
15768 compilation to work when not all targets are enabled.
15770 2008-09-29 Cary Coutant <ccoutant@google.com>
15772 * archive.cc (Archive::get_file_and_offset): Use filename instead
15773 of name to get library path.
15774 (Archive::include_member): Unlock external member of a thin archive.
15776 * testsuite/Makefile.am (TEST_AR): New variable.
15777 (thin_archive_test_1): New test.
15778 (thin_archive_test_2): New test.
15779 * testsuite/Makefile.in: Regenerate.
15780 * testsuite/thin_archive_main.cc: New file.
15781 * testsuite/thin_archive_test_1.cc: New file.
15782 * testsuite/thin_archive_test_2.cc: New file.
15783 * testsuite/thin_archive_test_3.cc: New file.
15784 * testsuite/thin_archive_test_4.cc: New file.
15786 2008-09-29 Cary Coutant <ccoutant@google.com>
15788 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15789 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15791 (Sized_relobj::do_finalize_local_symbols): Likewise.
15792 (Sized_relobj::map_to_kept_section): Likewise.
15793 * object.h (Sized_relobj::invalid_address): New constant.
15794 (Sized_relobj::do_output_section_offset): Check for invalid_address
15796 * output.cc (Output_reloc::local_section_offset): Use constant
15797 invalid_address instead of -1U.
15798 (Output_reloc::get_address): Likewise.
15799 (Output_section::output_address): Change -1U to -1ULL.
15800 * output.h (Output_reloc::invalid_address): New constant.
15801 * reloc.cc (Sized_relobj::write_sections): Use constant
15802 invalid_address instead of -1U.
15803 (Sized_relobj::relocate_sections): Likewise.
15804 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15805 values for merge sections.
15806 * target-reloc.h (relocate_for_relocatable): Use constant
15807 invalid_address instead of -1U.
15809 2008-09-19 Cary Coutant <ccoutant@google.com>
15811 Add plugin functionality for link-time optimization (LTO).
15812 * configure.ac (plugins): Add --enable-plugins option.
15813 * configure: Regenerate.
15814 * config.in: Regenerate.
15815 * Makefile.am (LIBDL): New variable.
15816 (CCFILES): Add plugin.cc.
15817 (HFILES): Add plugin.h.
15818 (ldadd_var): Add LIBDL.
15819 * Makefile.in: Regenerate.
15821 * archive.cc: Include "plugin.h".
15822 (Archive::setup): Don't preread archive symbols when using a plugin.
15823 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15824 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15826 (Archive::include_member): Add symbols from plugin objects.
15827 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15828 * descriptors.cc (Descriptors::open): Check for file descriptors
15829 abandoned by plugins.
15830 (Descriptors::claim_for_plugin): New function.
15831 * descriptors.h (Descriptors::claim_for_plugin): New function.
15832 (Open_descriptor::is_claimed): New field.
15833 (claim_descriptor_for_plugin): New function.
15834 * fileread.cc (File_read::claim_for_plugin): New function.
15835 * fileread.h (File_read::claim_for_plugin): New function.
15836 (File_read::descriptor): New function.
15837 * gold.cc: Include "plugin.h".
15838 (queue_initial_tasks): Add task to call plugin hooks for generating
15840 * main.cc: Include "plugin.h".
15841 (main): Load plugin libraries.
15842 * object.h (Pluginobj): Declare.
15843 (Object::pluginobj): New function.
15844 (Object::do_pluginobj): New function.
15845 (Object::set_target): New function.
15846 * options.cc: Include "plugin.h".
15847 (General_options::parse_plugin): New function.
15848 (General_options::General_options): Initialize plugins_ field.
15849 (General_options::add_plugin): New function.
15850 * options.h (Plugin_manager): Declare.
15851 (General_options): Add --plugin option.
15852 (General_options::has_plugins): New function.
15853 (General_options::plugins): New function.
15854 (General_options::add_plugin): New function.
15855 (General_options::plugins_): New field.
15856 * plugin.cc: New file.
15857 * plugin.h: New file.
15858 * readsyms.cc: Include "plugin.h".
15859 (Read_symbols::do_read_symbols): Check for archive before checking
15860 for ELF file. Call plugin hooks to claim files.
15861 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15862 from a real object file; force override when processing replacement
15864 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15865 (Symbol::init_base_object): Likewise.
15866 (Symbol::init_base_output_data): Likewise.
15867 (Symbol::init_base_output_segment): Likewise.
15868 (Symbol::init_base_constant): Likewise.
15869 (Symbol::init_base_undefined): Likewise.
15870 (Symbol::output_section): Assert that object is not a plugin.
15871 (Symbol_table::add_from_pluginobj): New function.
15872 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15874 (Symbol_table::sized_write_globals): Likewise.
15875 (Symbol_table::add_from_pluginobj): Instantiate template.
15876 * symtab.h (Sized_pluginobj): Declare.
15877 (Symbol::in_real_elf): New function.
15878 (Symbol::set_in_real_elf): New function.
15879 (Symbol::in_real_elf_): New field.
15880 (Symbol_table::add_from_pluginobj): New function.
15882 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15883 (LIBDL): New variable.
15884 (LDADD): Add LIBDL.
15885 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15886 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15887 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15888 (MOSTLYCLEANFILES): Likewise.
15889 * testsuite/Makefile.in: Regenerate.
15890 * testsuite/plugin_test.c: New file.
15891 * testsuite/plugin_test_1.sh: New file.
15892 * testsuite/plugin_test_2.sh: New file.
15894 2008-09-16 Ian Lance Taylor <iant@google.com>
15896 * target-reloc.h (relocate_section): Check whether a symbol is
15897 defined by the ABI before reporting an undefined symbol error.
15898 * target.h (Target::is_defined_by_abi): Make parameter const.
15899 (Target::do_is_defined_by_abi): Likewise.
15900 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15901 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15902 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15903 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15904 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15905 * testsuite/Makefile.in: Rebuild.
15907 * fileread.cc (make_view): Add casts to avoid warning.
15909 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15911 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15912 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15914 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15916 * options.h (General_options::output_is_executable): New.
15917 (General_options::output_is_pie): New.
15918 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15919 for shared libraries.
15920 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15922 2008-09-11 Chris Demetriou <cgd@google.com>
15924 * options.h (origin): New -z option.
15925 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15926 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15929 2008-09-05 Cary Coutant <ccoutant@google.com>
15931 * fileread.cc (File_read::make_view): Add check for attempt to map
15932 beyond end of file.
15934 2008-09-05 Cary Coutant <ccoutant@google.com>
15936 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15937 explicit instantiations.
15939 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15942 * options.cc (General_options::finalize): Allow undefined symbols
15943 in shlibs if linking -shared.
15946 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15947 symbols as not needing a dynsym entry.
15949 2008-08-20 Craig Silverstein <csilvers@google.com>
15951 * fileread.cc (File_read::open): Do not lock the file unless it
15952 was successfully opened.
15954 2008-08-14 Cary Coutant <ccoutant@google.com>
15956 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15957 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15958 * testsuite/tls_test.cc (struct int128): 128-bit struct
15959 for testing TLS relocs with non-zero addend.
15960 (v12): New TLS variable.
15962 (t_last): Add check for v12.
15963 * testsuite/tls_test.h (t12): New function.
15964 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15966 2008-08-13 Ian Lance Taylor <iant@google.com>
15968 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15969 set tls_segment_ or relro_segment_.
15970 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15972 * output.h (Output_section::clear_is_relro): New function.
15973 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15974 sections specially even when output_data_ is empty.
15975 (Output_segment::maximum_alignment): When first section is relro,
15976 only force alignment for PT_LOAD segments.
15977 * script.cc (script_data_segment_align): New function.
15978 (script_data_segment_relro_end): New function.
15979 * script-c.h (script_data_segment_align): Declare.
15980 (script_data_segment_relro_end): Declare.
15981 * script-sections.h (class Script_sections): Declare
15982 data_segment_align and data_segment_relro_end. Add fields
15983 segment_align_index_ and saw_relro_end_.
15984 * script-sections.cc (class Sections_element): Add set_is_relro
15985 virtual function. Add new bool* parameter to place_orphan_here.
15986 Add get_output_section virtual function.
15987 (class Output_section_definition): Add set_is_relro. Add new
15988 bool* parameter to place_orphan_here. Add get_output_section.
15989 Add is_relro_ field.
15990 (Output_section_definition::Output_section_definition): Initialize
15991 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15992 and is_relro_ fields.
15993 (Output_section_definition::place_orphan_here): Add is_relro
15995 (Output_section_definition::set_section_addresses): Set relro for
15997 (Output_section_definition::alternate_constraint): Likewise.
15998 (class Orphan_output_section): Add new bool* parameter to
15999 place_orphan_here. Add get_output_section.
16000 (Orphan_output_section::place_orphan_here): Add is_relro
16002 (Script_sections::Script_sections): Initialize
16003 data_segment_align_index_ and saw_relro_end_.
16004 (Script_sections::data_segment_align): New function.
16005 (Script_sections::data_segment_relro_end): New function.
16006 (Script_sections::place_orphan): Set or clear is_relro.
16007 (Script_sections::set_section_addresses): Force alignment of first
16009 * yyscript.y (exp): Call script_data_segment_align and
16010 script_data_segment_relro_end.
16011 * testsuite/relro_script_test.t: New file.
16012 * testsuite/relro_test.cc (using_script): Declare.
16013 (t1, t2): Test using_script.
16014 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16015 (relro_script_test_SOURCES): Define.
16016 (relro_script_test_DEPENDENCIES): Define.
16017 (relro_script_test_LDFLAGS): Define.
16018 (relro_script_test_LDADD): Define.
16019 (relro_script_test.so): New target.
16020 * testsuite/Makefile.in: Rebuild.
16022 2008-08-06 Cary Coutant <ccoutant@google.com>
16024 * archive.cc (Archive::total_archives, Archive::total_members)
16025 (Archive::total_members_loaded): New variables.
16026 (Archive::setup): Add parameter. Add option to preread
16028 (Archive::read_armap): Add counter.
16029 (Archive::get_file_and_offset): New function.
16030 (Archive::get_elf_object_for_member): New function.
16031 (Archive::read_all_symbols): New function.
16032 (Archive::read_symbols): New function.
16033 (Archive::add_symbols): Add counters.
16034 (Archive::include_all_members): Use armap to find members if it's
16036 (Archive::include_member): Skip reading symbols if already read.
16037 Factored code into Archive::get_file_and_offset and
16038 Archive::get_elf_object_for_member. Changed call to
16039 Mapfile::report_include_archive_member.
16040 (Archive::print_stats): New function.
16041 * archive.h: Declare Object and Read_symbols_data classes.
16042 (Archive::Archive): Add initializers for new members.
16043 (Archive::setup): Add parameter.
16044 (Archive::print_stats): New function.
16045 (Archive::total_archives, Archive::total_members)
16046 (Archive::total_members_loaded): New variables.
16047 (Archive::get_file_and_offset): New function.
16048 (Archive::get_elf_object_for_member): New function.
16049 (Archive::read_all_symbols): New function.
16050 (Archive::read_symbols): New function.
16051 (Archive::Archive_member): New class.
16052 (Archive::members_): New member.
16053 (Archive::num_members_): New member.
16054 * main.cc: Include archive.h.
16055 (main): Call Archive::print_stats.
16056 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16057 archive parameter; member_name is now the fully-decorated name.
16058 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16059 * options.h: (General_options): Add --preread-archive-symbols option.
16060 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16063 2008-08-04 Ian Lance Taylor <iant@google.com>
16065 * symtab.h (Symbol::use_plt_offset): New function.
16066 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16067 * powerpc.cc (Relocate::relocate): Likewise.
16068 * sparc.cc (Relocate::relocate): Likewise.
16069 * x86_64.cc (Relocate::relocate): Likewise.
16070 * testsuite/weak_plt.sh: New test.
16071 * testsuite/weak_plt_main.cc: New test.
16072 * testsuite/weak_plt_shared.cc: New test.
16073 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16074 (check_PROGRAMS): Add weak_plt.
16075 (check_DATA): Add weak_plt_shared.so.
16076 (weak_plt_main_pic.o, weak_plt): New targets.
16077 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16078 * testsuite/Makefile.in: Rebuild.
16080 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16082 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16083 * testsuite/Makefile.in: Rebuild.
16085 2008-08-04 Alan Modra <amodra@bigpond.net.au>
16087 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16088 * Makefile.in: Regenerate.
16089 * po/POTFILES.in: Regenerate.
16091 2008-07-29 Ian Lance Taylor <iant@google.com>
16093 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16094 symbols before other symbols.
16095 * testsuite/script_test_2.cc (test_addr): Declare.
16096 (test_addr_alias): Declare.
16097 (main): Check that test_addr and test_addr_alias have the right
16099 * testsuite/script_test_2.t: Define test_addr_alias and
16102 2008-07-24 Ian Lance Taylor <iant@google.com>
16105 * descriptors.cc: New file.
16106 * descriptors.h: New file.
16107 * gold-threads.h (class Hold_optional_lock): New class.
16108 * fileread.cc: Include "descriptors.h".
16109 (File_read::~File_read): Release descriptor rather than closing
16111 (File_read::open) [file]: Call open_descriptor rather than open.
16112 Set is_descriptor_opened_.
16113 (File_read::open) [memory]: Assert that descriptor is not open.
16114 (File_read::reopen_descriptor): New function.
16115 (File_read::release): Release descriptor.
16116 (File_read::do_read): Make non-const. Reopen descriptor.
16117 (File_read::read): Make non-const.
16118 (File_read::make_view): Reopen descriptor.
16119 (File_read::do_readv): Likewise.
16120 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16121 Update declarations.
16122 * layout.cc: Include "descriptors.h".
16123 (Layout::create_build_id): Use open_descriptor rather than open.
16124 * output.cc: Include "descriptors.h".
16125 (Output_file::open): Use open_descriptor rather than open.
16126 * archive.cc (Archive::const_iterator): Change Archive to be
16128 (Archive::begin, Archive::end): Make non-const.
16129 (Archive::count_members): Likewise.
16130 * archive.h (class Archive): Update declarations.
16131 * object.h (Object::read): Make non-const.
16132 * Makefile.am (CCFILES): Add descriptors.cc.
16133 (HFILES): Add descriptors.h.
16134 * Makefile.in: Rebuild.
16137 * gold.h: Always include <clocale>. Add Solaris workarounds
16138 following code in binutils/sysdep.h.
16141 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16142 this->eh_frame_hdr_ is NULL before using it.
16144 * dynobj.cc (Versions::Versions): Update comment.
16146 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16147 the base version name.
16149 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16150 array size plus one.
16151 (Stringpool_template::set_string_offsets): Subtract one from key
16152 before using it as an array index.
16153 (Stringpool_template::get_offset_with_length): Likewise.
16154 (Stringpool_template::write_to_buffer): Likewise.
16155 * stringpool.h (Stringpool_template::get_offset_from_key):
16158 2008-07-23 Ian Lance Taylor <iant@google.com>
16161 * object.h (Merged_symbol_value::value): Do our best to handle a
16165 * script.cc (Version_script_info::get_versions): Don't add empty
16166 version tag to return value.
16167 (Version_script_info::get_symbol_version_helper): Change return
16168 type to bool. Add pversion parameter. Change all callers.
16169 (script_register_vers_node): Don't require a non-NULL tag.
16170 * script.h (class Version_script_info): Update declarations.
16171 (Version_script_info::get_symbol_version): Change return type to
16172 bool. Add version parameter. Change all callers.
16173 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16174 handling. Handle an empty version from a version script.
16175 (Symbol_table::define_special_symbol): Likewise.
16176 * testsuite/ver_test_10.script: New file.
16177 * testsuite/ver_test_10.sh: New file.
16178 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16179 (check_DATA): Add ver_test_10.syms.
16180 (ver_test_10.syms, ver_test_10.so): New target.
16181 * testsuite/Makefile.in: Rebuild.
16183 2008-07-23 Simon Baldwin <simonb@google.com>
16185 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16186 to zero for undefined symbols from dynamic libraries.
16188 2008-07-23 Ian Lance Taylor <iant@google.com>
16190 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16191 Change all callers.
16192 * symtab.h (class Symbol_table): Update declaration.
16193 * testsuite/ver_test_9.cc: New file.
16194 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16195 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16196 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16197 (ver_test_9.so, ver_test_9.o): New targets.
16198 * testsuite/Makefile.in: Rebuild.
16200 2008-07-22 Ian Lance Taylor <iant@google.com>
16202 * options.h (class General_options): Define --check-sections.
16203 * layout.cc (Layout::set_segment_offsets): Handle
16206 * options.h (class General_options): Define -n/--nmagic and
16208 * options.cc (General_options::finalize): For -n/--nmagic or
16209 -N/--omagic, set -static.
16210 * layout.cc (Layout::attach_allocated_section_to_segment): If
16211 -N/--omagic, don't put read-only and read-write sections in
16212 different segments.
16213 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16214 finding a read-only segment.
16215 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16216 don't set the minimum segment alignment to the common page size,
16217 and don't set the file offset to the address modulo the page size.
16218 * script-sections.cc (Script_sections::create_segments): If
16219 -n/--omagic, don't put read-only and read-write sections in
16220 different segments.
16222 * cref.cc: New file.
16223 * cref.h: New file.
16224 * options.h (class General_options): Add --print-symbol-counts.
16225 * main.cc (main): Issue defined symbol report if requested.
16226 * archive.cc (Archive::interpret_header): Make into a const member
16228 (Archive::add_symbols): Call Input_objects::archive_start and
16230 (Archive::const_iterator): Define new class.
16231 (Archive::begin, Archive::end): New functions.
16232 (Archive::include_all_members): Rewrite to use iterator.
16233 (Archive::count_members): New function.
16234 * archive.h (class Archive): Update declarations.
16235 (Archive::filename): New function.
16236 * object.cc: Include "cref.h".
16237 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16238 (Sized_relobj::do_get_global_symbol_counts): New function.
16239 (Input_objects::add_object): Add object to cross-referencer.
16240 (Input_objects::archive_start): New function.
16241 (Input_objects::archive_stop): New function.
16242 (Input_objects::print_symbol_counts): New function.
16243 * object.h: Declare Cref and Archive.
16244 (Object::get_global_symbol_counts): New function.
16245 (Object::do_get_global_symbol_counts): New pure virtual function.
16246 (class Sized_relobj): Add defined_count_ field. Update
16248 (class Input_objects): Add cref_ field. Update constructor.
16249 Update declarations.
16250 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16252 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16254 (Sized_dynobj::do_get_global_symbol_counts): New function.
16255 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16256 defined_count_. Update declarations. Define Symbols typedef.
16257 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16258 parameter. Change all callers.
16259 (Symbol_table::add_from_dynobj): Add sympointers and defined
16260 parameters. Change all callers.
16261 * symtab.h (class Symbol_table): Update declarations.
16262 * Makefile.am (CCFILES): Add cref.cc.
16263 (HFILES): Add cref.h.
16264 * Makefile.in: Rebuild.
16266 2008-07-22 Simon Baldwin <simonb@google.com>
16268 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16269 to zero when writing undefined symbols.
16271 2008-07-22 Ian Lance Taylor <iant@google.com>
16273 * output.cc (Output_section::add_input_section): Don't try to
16274 merge empty merge sections.
16276 2008-07-21 Craig Silverstein <csilvers@google.com>
16278 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16279 Include symbol version in error message.
16281 2008-07-20 Chris Demetriou <cgd@google.com>
16283 * configure.ac (gold_cv_c_random_seed): New configured variable.
16284 (RANDOM_SEED_CFLAGS): New substituted variable.
16285 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16286 * configure: Rebuild.
16287 * Makefile.in: Likewise.
16288 * testsuite/Makefile.in: Likewise.
16290 2008-07-18 Ian Lance Taylor <iant@google.com>
16292 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16293 where we see NAME/NULL and NAME/VERSION as separate symbols.
16294 * testsuite/ver_test_main.cc (main): Call t4.
16295 (t4, t4_2a): Define.
16296 * testsuite/ver_test_2.cc (t4_2): Define.
16297 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16298 * testsuite/ver_test_4.cc (t4_2a): Define.
16299 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16300 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16302 2008-07-17 Ian Lance Taylor <iant@google.com>
16304 * dynobj.cc (Versions::add_def): If we give an error about a
16305 missing version, go ahead and create the version anyhow.
16307 2008-07-10 Ian Lance Taylor <iant@google.com>
16309 Handle output sections with more than 0x7fffffff bytes.
16310 * object.h (class Relobj): Change map_to_output_ to
16311 output_sections_, and just keep a section pointer. Change all
16312 uses. Move comdat group support to Sized_relobj.
16313 (Relobj::is_section_specially_mapped): Remove.
16314 (Relobj::output_section): Remove poff parameter. Change all
16316 (Relobj::output_section_offset): New function.
16317 (Relobj::set_section_offset): Rewrite.
16318 (Relobj::map_to_output): Remove.
16319 (Relobj::output_sections): New function.
16320 (Relobj::do_output_section_offset): New pure virtual function.
16321 (Relobj::do_set_section_offset): Likewise.
16322 (class Sized_relobj): Add section_offsets_ field. Add comdat
16323 group support from Relobj. Update declarations.
16324 (Sized_relobj::get_output_section_offset): New function.
16325 (Sized_relobj::do_output_section_offset): New function.
16326 (Sized_relobj::do_set_section_offset): New function.
16327 * object.cc (Relobj::output_section_address): Remove.
16328 (Sized_relobj::Sized_relobj): Initialize new fields.
16329 (Sized_relobj::include_section_group): Cast find_kept_object to
16331 (Sized_relobj::include_linkonce_section): Likewise.
16332 (Sized_relobj::do_layout): Use separate arrays for output section
16334 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16336 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16337 output_sections and section_offsets.
16338 (Sized_relobj::write_local_symbols): Likewise.
16339 (map_to_kept_section): Compute output address directly.
16340 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16341 output_sections and section_offsets.
16342 (Sized_relobj::write_sections): Likewise.
16343 (Sized_relobj::relocate_sections): Likewise.
16344 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16345 * output.h (class Output_reloc): Update declarations. Change
16346 u2_.relobj to Sized_relobj*.
16347 (class Output_data_reloc): Change add functions to use
16349 * output.cc (Output_reloc::Output_reloc): Change relobj to
16351 (Output_reloc::local_section_offset): Change return type to
16352 Elf_Addr. Use get_output_section_offset.
16353 (Output_reloc::get_address): Likewise.
16354 (Output_section::is_input_address_mapped): Don't call
16355 is_section_specially_mapped.
16356 (Output_section::output_offset): Likewise.
16357 (Output_section::output_address): Likewise.
16358 (Output_section::starting_output_address): Likewise.
16359 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16360 parameter to Sized_relobj*.
16361 (Copy_relocs::need_copy_reloc): Likewise.
16362 (Copy_relocs::save): Likewise.
16363 * copy-relocs.h (class Copy_relocs): Update declarations.
16364 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16365 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16366 * target-reloc.h (relocate_for_relocatable): Change
16367 offset_in_output_section type to Elf_Addr. Change code that uses
16369 * layout.cc (Layout::layout): Always set *off.
16370 * mapfile.cc (Mapfile::print_input_section): Use
16371 output_section_offset.
16372 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16374 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16375 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16376 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16378 2008-07-03 Ian Lance Taylor <iant@google.com>
16380 * layout.cc (Layout::include_section): Do not discard unrecognized
16381 SHT_STRTAB sections.
16383 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16385 * script.cc (Lex::can_continue_name): Make '?' allowable in
16386 version-script names.
16387 * testsuite/version_script.map: Change glob pattern to use '?'
16389 2008-06-30 Manish Singh <yosh@gimp.org>
16392 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16395 2008-06-30 Ian Lance Taylor <iant@google.com>
16399 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16400 versions]: Don't try to read the value in the contents, since we
16401 don't use it. Use the template endianness when writing.
16403 2008-06-25 Cary Coutant <ccoutant@google.com>
16405 * fileread.cc (File_read::make_view): Assert on zero-length view.
16406 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16407 symbol table when there are no symbols to read.
16409 2008-06-23 Craig Silverstein <csilvers@google.com>
16411 * version.cc (version_string): Bump to 1.7
16413 2008-06-18 Craig Silverstein <csilvers@google.com>
16415 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16416 constant 0xFFFF to type Valtype.
16417 (Powerpc_relocate_functions::rel16_ha): Likewise.
16419 2008-06-17 Ian Lance Taylor <iant@google.com>
16421 * output.h (Output_section::Input_section): Initialize p2align_ to
16422 zero for Output_section_data constructors.
16423 (Output_section::Input_section::addralign): If not an input
16424 section, return the alignment of the Output_section_data.
16425 * testsuite/copy_test.cc: New file.
16426 * testsuite/copy_test_1.cc: New file.
16427 * testsuite/copy_test_2.cc: New file.
16428 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16429 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16430 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16431 (copy_test_1_pic.o, copy_test_1.so): New targets.
16432 (copy_test_2_pic.o, copy_test_2.so): New targets.
16433 * testsuite/Makefile.in: Rebuild.
16435 * script-sections.cc (Script_sections::place_orphan): Initialize
16436 local variable exact.
16438 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16440 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16442 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16443 David S. Miller <davem@davemloft.net>
16445 * powerpc.cc: New file.
16446 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16447 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16448 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16449 * Makefile.in: Rebuild.
16451 2008-06-09 Ian Lance Taylor <iant@google.com>
16453 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16455 (throwing, orig_terminate): New static variables.
16456 (terminate_handler): New static function.
16457 (t2): Set terminate handler.
16459 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16462 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16465 2008-05-30 Cary Coutant <ccoutant@google.com>
16467 * archive.cc (Archive::include_all_members) Correct to step
16468 over symbol table and extended name table in thin archives.
16470 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16473 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16476 2008-05-28 Caleb Howe <cshowe@google.com>
16478 * reduced_debug_output.cc: New file.
16479 * reduced_debug_output.h: New file.
16480 * options.h (class General_options): Add --strip-debug-non-line.
16481 * options.cc (General_options::finalize): Add strip_debug_non_line
16482 to the strip heirarchy.
16483 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16485 * layout.cc: Include "reduced_debug_output.h".
16486 (Layout::Layout): Initialize new fields.
16487 (line_only_debug_sections): New static array.
16488 (is_lines_only_debug_sections): New static inline function.
16489 (Layout::include_section): Handle --strip-debug-non-line.
16490 (Layout::make_output_section): If --strip-debug-non-line, build
16491 new output sections for .debug_abbrev and .debug_info.
16492 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16493 gold. Warn about possible overflow.
16494 (read_signed_LEB_128): Likewise.
16495 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16496 (read_signed_LEB_128): Declare.
16497 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16498 (HFILES): Add reduced_debug_output.h.
16499 * Makefile.in: Rebuild.
16501 2008-05-21 Ian Lance Taylor <iant@google.com>
16503 * mapfile.cc: New file.
16504 * mapfile.h: New file.
16505 * options.h (class General_options): Add -M/--print-map and -Map.
16506 * options.cc (General_options::finalize): Make -M equivalent to
16508 * main.cc: Include <cstdio> and "mapfile.h".
16509 (main): Open mapfile if requested.
16510 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16511 constructor. Change caller.
16512 (queue_initial_tasks): Add mapfile parameter. Change caller.
16513 (queue_middle_tasks): Likewise.
16514 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16516 * archive.cc: Include "mapfile.h".
16517 (Archive::add_symbols): Add mapfile parameter. Change all
16518 callers. Pass mapfile, symbol, and reason to include_member.
16519 (Archive::include_all_members): Add mapfile parameter. Change all
16521 (Archive::include_member): Add mapfile, sym, and why parameters.
16522 Change all callers. Report inclusion to map file.
16523 * archive.h: Include "fileread.h".
16524 (class Archive): Update declarations.
16525 (Archive::file): New const method.
16526 (class Add_archive_symbols): Add mapfile_ field. Update
16527 constructor. Change all callers.
16528 * readsyms.h (class Read_symbols): Likewise.
16529 (class Finish_group): Likewise.
16530 (class Read_script): Likewise.
16531 * common.cc: Include "mapfile.h".
16532 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16534 (Symbol_table::do_allocate_commons): Likewise.
16535 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16536 symbol allocation to mapfile.
16537 * common.h (class Allocate_commons_task): Add mapfile_ field.
16538 Update constructor. Change all callers.
16539 * symtab.h (class Symbol_table): Update declarations.
16540 * layout.cc: Include "mapfile.h".
16541 (Layout_task_runner::run): Print information to mapfile.
16542 (Layout::create_gold_note): Change Output_data_fixed_space to
16543 Output_data_zero_fill.
16544 (Layout::create_build_id): Likewise.
16545 (Layout::print_to_mapfile): New function.
16546 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16547 constructor. Change caller.
16548 (class Layout): Declare print_to_mapfile.
16549 * output.cc (Output_section::Input_section::print_to_mapfile): New
16551 (Output_section::add_input_section): If producing a map, always
16552 add to input_sections_ list.
16553 (Output_section::do_print_to_mapfile): New function.
16554 (Output_segment::print_sections_to_mapfile): New function.
16555 (Output_segment::print_section_list_to_mapfile): New function.
16556 * output.h: Include "mapfile.h".
16557 (Output_data::print_to_mapfile): New function.
16558 (Output_data::do_print_to_mapfile): New virtual function.
16559 (Output_segment_headers::do_print_to_mapfile): New function.
16560 (Output_file_header::do_print_to_mapfile): New function.
16561 (Output_data_const::do_print_to_mapfile): New function.
16562 (class Output_data_const_buffer): Add map_name_ field. Update
16563 constructor. Change all callers. Add do_print_to_mapfile
16565 (class Output_data_fixed_space): Likewise.
16566 (class Output_data_space): Likewise.
16567 (class Output_data_zero_fill): New class.
16568 (Output_data_strtab::do_print_to_mapfile): New function.
16569 (Output_data_reloc_base::do_print_to_mapfile): New function.
16570 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16571 (Output_data_group::do_print_to_mapfile): New function.
16572 (Output_data_got::do_print_to_mapfile): New function.
16573 (Output_data_dynamic::do_print_to_mapfile): New function.
16574 (Output_symtab_xindex::do_print_to_mapfile): New function.
16575 (class Output_section): Declare do_print_to_mapflie. Declare
16576 print_to_mapfile in Input_section.
16577 (class Output_segment): Declare new functions.
16578 * object.h (Sized_relobj::symbol_count): New function.
16579 * script-sections.cc
16580 (Output_section_element_dot_assignment::set_section_addresses):
16581 Change Output_data_fixed_space to Output_data_zero_fill.
16582 (Output_data_expression::do_print_to_mapfile): New function.
16583 * script.cc (read_input_script): Add mapfile parameter. Change
16585 * script.h (read_input_script): Update declaration.
16586 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16587 (Eh_frame::do_print_to_mapfile): New function.
16588 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16589 (Output_merge_string::do_print_to_mapfile): New function.
16590 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16592 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16594 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16596 * Makefile.am (CCFILES): Add mapfile.cc.
16597 (HFILES): Add mapfile.h.
16598 * Makefile.in: Rebuild.
16600 2008-05-19 Ian Lance Taylor <iant@google.com>
16602 * options.h (class General_options): Add -z relro.
16603 * layout.cc (Layout::Layout): Initialize relro_segment_.
16604 (Layout::add_output_section_data): Return the output section.
16605 (Layout::make_output_section): Rcognize relro sections and mark
16606 them appropriately.
16607 (Layout::attach_allocated_section_to_segment): Put relro sections
16608 in a PT_GNU_RELRO segment.
16609 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16611 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16613 (Layout::linkonce_mapping): Map d.rel.ro.local to
16614 .data.rel.ro.local.
16615 (Layout::output_section_name): Us .data.rel.ro.local for any
16616 section which begins with that.
16617 * layout.h (class Layout): Update add_output_section_data
16618 declaration. Add relro_segment_ field.
16619 * output.cc (Output_section::Output_section): Initialize is_relro_
16620 and is_relro_local_ fields.
16621 (Output_segment::add_output_section): Group relro sections.
16622 (Output_segment::is_first_section_relro): New function.
16623 (Output_segment::maximum_alignment): If there is a relro section,
16624 align the segment to the common page size.
16625 (Output_segment::set_section_addresses): Track whether we are
16626 looking at relro sections. If the last section is a relro
16627 section, align to the common page size.
16628 (Output_segment::set_section_list_addresses): Add in_relro
16629 parameter. Change all callers. Align to the page size when
16630 moving from relro to non-relro section.
16631 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16633 * output.h (class Output_section): Add is_relro_ and
16634 is_relro_local_ fields.
16635 (Output_section::is_relro): New function.
16636 (Output_section::set_is_relro): New function.
16637 (Output_section::is_relro_local): New function.
16638 (Output_section::set_is_relro_local): New function.
16639 (class Output_segment): Update declarations.
16640 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16641 * sparc.cc (Target_sparc::got_section): Likewise.
16642 * x86_64.cc (Target_x86_64::got_section): Likewise.
16643 * testsuite/relro_test_main.cc: New file.
16644 * testsuite/relro_test.cc: New file.
16645 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16646 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16647 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16648 (relro_test.so, relro_test_pic.o): New targets.
16649 * testsuite/Makefile.in: Rebuild.
16651 2008-05-16 Ian Lance Taylor <iant@google.com>
16653 * output.cc (Output_segment::add_output_section): Remove front
16655 * output.h (class Output_segment): Remove
16656 add_initial_output_section and overloaded add_output_section.
16657 Update declaration of remaining add_output_section.
16658 * layout.cc (Layout::create_interp): Call add_output_section
16659 rather than add_initial_output_section.
16660 (Layout::finish_dynamic_section): Likewise.
16662 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16663 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16664 know the dynamic type.
16665 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16666 field. Initialize it in constructor.
16667 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16668 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16669 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16672 * output.cc (Output_reloc::get_address): Change return type to
16674 * output.h (class Output_reloc): Update get_address declaration.
16675 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16676 for section addresses.
16678 2008-05-09 Ian Lance Taylor <iant@google.com>
16681 * gold.cc (gold_nomem): Use return value of write.
16683 2008-05-08 Ian Lance Taylor <iant@google.com>
16685 * symtab.c (Symbol::init_base_output_data): Add version
16686 parameter. Change all callers.
16687 (Symbol::init_base_output_segment): Likewise.
16688 (Symbol::init_base_constant): Likewise.
16689 (Symbol::init_base_undefined): Likewise.
16690 (Sized_symbol::init_output_data): Likewise.
16691 (Sized_symbol::init_output_segment): Likewise.
16692 (Sized_symbol::init_constant): Likewise.
16693 (Sized_symbol::init_undefined): Likewise.
16694 (Symbol_table::do_define_in_output_data): If the new symbol has a
16695 version, mark it as the default.
16696 (Symbol_table::do_define_in_output_segment): Likewise.
16697 (Symbol_table::do_define_as_constant): Likewise.
16698 * symtab.h (class Symbol): Update declarations.
16699 (class Sized_symbol): Likewise.
16700 * resolve.cc (Symbol::override_version): New function.
16701 (Symbol::override_base): Call override_version.
16702 (Symbol::override_base_with_special): Likewise.
16703 * testsuite/ver_script_8.script: New file.
16704 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16705 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16706 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16707 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16709 2008-05-06 Ian Lance Taylor <iant@google.com>
16712 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16714 (class General_options): Remove existing --undefined, and add
16715 --no-undefined instead. Add new --undefined as synonym for -u.
16716 * archive.cc (Archive::add_symbols): Check whether symbol was
16718 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16719 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16720 all uses. Add IS_UNDEFINED. Update declarations to split
16721 different versions of init_base. Declare init_base_undefined.
16722 (Symbol::is_defined): Handle IS_UNDEFINED.
16723 (Symbol::is_undefined): Likewise.
16724 (Symbol::is_weak_undefined): Call is_undefined.
16725 (Symbol::is_absolute): Handle IS_CONSTANT.
16726 (class Sized_symbol): Update declarations to split different
16727 versions of init. Declare init_undefined.
16728 (class Symbol_table): Declare new functions.
16729 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16730 Change all callers.
16731 (Symbol::init_base_output_data): Likewise.
16732 (Symbol::init_base_output_segment): Likewise.
16733 (Symbol::init_base_constant): Likewise.
16734 (Symbol::init_base_undefined): New function.
16735 (Sized_symbol::init_object): Rename from init. Change all
16737 (Sized_symbol::init_output_data): Likewise.
16738 (Sized_symbol::init_output_segment): Likewise.
16739 (Sized_symbol::init_constant): Likewise.
16740 (Sized_symbol::init_undefined): New function.
16741 (Symbol_table::add_undefined_symbols_from_command_line): New
16743 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16745 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16746 (Symbol::output_section): Likewise.
16747 (Symbol::set_output_section): Likewise.
16748 (Symbol_table::sized_finalize_symbol): Likewise.
16749 (Symbol_table::sized_write_globals): Likewise.
16750 * resolve.cc (Symbol_table::should_override): Likewise.
16751 (Symbol::override_base_with_special): Likewise.
16753 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16754 symbol, change it to have default visibility.
16755 * testsuite/protected_1.cc: New file.
16756 * testsuite/protected_2.cc: New file.
16757 * testsuite/protected_3.cc: New file.
16758 * testsuite/protected_main_1.cc: New file.
16759 * testsuite/protected_main_2.cc: New file.
16760 * testsuite/protected_main_3.cc: New file.
16761 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16762 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16763 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16764 (protected_1.so): New target.
16765 (protected_1_pic.o, protected_2_pic.o): New targets.
16766 (protected_3_pic.o): New target.
16767 (check_PROGRAMS): Add protected_2.
16768 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16769 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16770 * testsuite/Makefile.in: Rebuild.
16772 * options.h (DEFINE_var): Add set_user_set_##varname__.
16773 (DEFINE_bool_alias): New macro.
16774 (class General_options): Define -Bstatic using DEFINE_bool_alias
16775 rather than DEFINE_special. Add --undefined as an alias for -z
16777 * options.cc (General_options::parse_Bstatic): Remove.
16779 * options.h (class General_options): Add --fatal-warnings.
16780 * main.cc (main): Implement --fatal-warnings.
16781 * errors.h (Errors::warning_count): New function.
16783 * options.h (class General_options): Add -Bsymbolic-functions.
16784 * symtab.h (Symbol::is_preemptible): Check for
16785 -Bsymbolic-functions.
16787 2008-05-05 Ian Lance Taylor <iant@google.com>
16789 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16790 as noVARNAME rather than no-VARNAME.
16791 (class General_options): Add option -z combreloc.
16792 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16794 (Output_reloc::sort_before) [SHT_REL]: New function.
16795 (Output_reloc::sort_before) [SHT_RELA]: New function.
16796 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16797 Sort_relocs_comparison.
16798 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16799 parameter. Change all callers.
16800 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16801 sort_relocs parameter. Change all callers.
16802 * output.cc (Output_reloc::get_address): New function, broken out
16804 (Output_reloc::write_rel): Call it.
16805 (Output_reloc::compare): New function.
16806 (Output_data_reloc_base::do_write): Optionally sort relocs.
16808 * configure.ac: If targ_extra_obj is set, link it in.
16809 * configure.tgt: Initialize all variables.
16810 (x86_64*): Set targ_extra_obj and targ_extra_size.
16811 * configure: Rebuild.
16813 * object.cc (Sized_relobj::include_section_group): Adjust section
16814 indexes read from group data. Build vector to pass to
16816 * layout.cc (Layout::layout_group): Add flags and shndxes
16817 parameters. Remove contents parameter. Change caller. Update
16818 explicit instantiations.
16819 * layout.h (class Layout): Update layout_group declaration.
16820 * output.cc (Output_data_group::Output_data_group): Add flags and
16821 input_shndxes parameters. Remove contents parameter. Change
16823 (Output_data_group::do_write): Change input_sections_ to
16825 * output.h (class Output_data_group): Update constructor
16826 declaration. Rename input_sections_ to input_shndxes_.
16827 * testsuite/many_sections_test.cc: Add template.
16829 2008-04-30 Cary Coutant <ccoutant@google.com>
16831 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16833 * layout.cc (Layout::include_section): Refactored check for debug
16835 (Layout::add_comdat): Add new parameters. Change type
16836 of signature parameter. Add object and shndx to signatures table.
16837 (Layout::find_kept_object): New function.
16838 * layout.h: Include <cstring>.
16839 (Layout::is_debug_info_section): New function.
16840 (Layout::add_comdat): Add new parameters.
16841 (Layout::find_kept_object): New function.
16842 (Layout::Kept_section): New struct.
16843 (Layout::Signatures): Change type of map range.
16844 * object.cc (Relobj::output_section_address): New function.
16845 (Sized_relobj::include_section_group): Add new parameters. Change
16846 calls to Layout::add_comdat. Change to build table of kept comdat
16847 groups and table mapping discarded sections to kept sections.
16848 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16849 (Sized_relobj::do_layout): Change calls to include_section_group and
16850 include_linkonce_section.
16851 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16852 value to zero when section is discarded.
16853 (Sized_relobj::map_to_kept_section): New function.
16854 * object.h (Relobj::output_section_address): New function.
16855 (Relobj::Comdat_group): New type.
16856 (Relobj::find_comdat_group): New function.
16857 (Relobj::Comdat_group_table): New type.
16858 (Relobj::Kept_comdat_section): New type.
16859 (Relobj::Kept_comdat_section_table): New type.
16860 (Relobj::add_comdat_group): New function.
16861 (Relobj::set_kept_comdat_section): New function.
16862 (Relobj::get_kept_comdat_section): New function.
16863 (Relobj::comdat_groups_): New field.
16864 (Relobj::kept_comdat_sections_): New field.
16865 (Symbol_value::input_value): Update comment.
16866 (Sized_relobj::map_to_kept_section) New function.
16867 (Sized_relobj::include_linkonce_section): Add new parameter.
16868 * target-reloc.h (Comdat_behavior): New type.
16869 (get_comdat_behavior): New function.
16870 (relocate_section): Add code to map a discarded section to the
16871 corresponding kept section when applying a relocation.
16873 2008-04-30 Craig Silverstein <csilvers@google.com>
16875 * dwarf_reader.cc (next_generation_count): New static var.
16876 (Addr2line_cache_entry): New struct.
16877 (addr2line_cache): New static var.
16878 (Dwarf_line_info::one_addr2line): Added caching.
16879 (Dwarf_line_info::clear_addr2line_cache): New function.
16880 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16881 cache-size parameter.
16882 (Dwarf_line_info::one_addr2line_cache): New function.
16883 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16884 new cache-size argument to one_addr2line(), and clear cache.
16886 2008-04-28 Cary Coutant <ccoutant@google.com>
16888 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16889 R_386_PC8 relocations.
16891 2008-04-23 Ian Lance Taylor <iant@google.com>
16893 * object.cc (Sized_relobj::include_section_group): Check for
16894 invalid section group.
16896 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16899 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16900 than read for file header.
16901 * archive.cc (Archive::include_member): Likewise.
16903 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
16905 * aclocal.m4: Regenerate.
16906 * configure: Regenerate.
16908 2008-04-19 Ian Lance Taylor <iant@google.com>
16910 * version.cc (version_string): Bump to 1.6.
16912 * testsuite/Makefile.am (many_sections_r_test): New target.
16913 (many_sections_r_test_SOURCES): Remove.
16914 (many_sections_r_test_DEPENDENCIES): Remove.
16915 (many_sections_r_test_LDFLAGS): Remove.
16916 (many_sections_r_test_LDADD): Remove.
16918 * object.cc (Sized_relobj::do_add_symbols): Always pass
16919 local_symbol_count_ to add_from_relobj.
16921 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16922 every thousand variables.
16923 * testsuite/Makefile.in: Rebuild.
16925 * object.cc (Xindex::initialize_symtab_xindex): New function.
16926 (Xindex::read_symtab_xindex): New function.
16927 (Xindex::sym_xindex_to_shndx): New function.
16928 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16930 (Sized_relobj::do_initialize_xindex): New function.
16931 (Sized_relobj::do_read_symbols): Adjust section links.
16932 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16933 parameter. Change all callers.
16934 (Sized_relobj::include_section_group): Adjust section links and
16935 symbol section indexes.
16936 (Sized_relobj::do_layout): Adjust section links.
16937 (Sized_relobj::do_count_local_symbols): Adjust section links and
16938 symbol section indexes.
16939 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16940 ordinary and special symbols.
16941 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16942 dynsym_xindex parameters. Change all callers. Adjust section
16943 links. Use SHN_XINDEX when needed.
16944 (Sized_relobj::get_symbol_location_info): Adjust section links.
16945 Don't get fooled by special symbols.
16946 * object.h (class Xindex): Define.
16947 (class Object): Add xindex_ parameter. Declare virtual functoin
16948 do_initialize_xindex.
16949 (Object::adjust_sym_shndx): New function.
16950 (Object::set_xindex): New protected function.
16951 (class Symbol_value): Add is_ordinary_shndx_ field.
16952 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16953 (Symbol_value::value): Assert ordinary section.
16954 (Symbol_value::initialize_input_to_output_map): Likewise.
16955 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16956 Change all callers.
16957 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16959 (class Sized_relobj): Update declarations.
16960 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16961 parameter. Change all callers.
16962 (Sized_relobj::adjust_shndx): New function.
16963 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16965 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16966 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16967 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16968 (Sized_dynobj::read_dynsym_section): Adjust section links.
16969 (Sized_dynobj::read_dynamic): Likewise.
16970 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16972 (Sized_dynobj::do_initialize_xindex): New function.
16973 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16974 do_initialize_xindex.
16975 (Sized_dynobj::adjust_shndx): New function.
16976 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16977 dynsym_xindex_ fields.
16978 (Layout::finalize): Add a call to set_section_indexes before
16979 creating the symtab sections.
16980 (Layout::set_section_indexes): Don't do anything if the section
16981 already has a section index.
16982 (Layout::create_symtab_sections): Add shnum parameter. Change
16983 caller. Create .symtab_shndx section if needed.
16984 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16986 (Layout::allocated_output_section_count): New function.
16987 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16989 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16990 fields. Update declarations.
16991 (Layout::symtab_xindex): New function.
16992 (Layout::dynsym_xindex): New function.
16993 (class Write_symbols_task): Add layout_ field.
16994 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16996 * output.cc (Output_section_headers::Output_section_headers): Add
16997 shstrtab_section parameter. Change all callers.
16998 (Output_section_headers::do_sized_write): Store overflow values
16999 for section count and section string table section index in
17000 section header zero.
17001 (Output_file_header::do_sized_write): Check for overflow of
17002 section count and section string table section index.
17003 (Output_symtab_xindex::do_write): New function.
17004 (Output_symtab_xindex::endian_do_write): New function.
17005 * output.h (class Output_section_headers): Add shstrtab_section_.
17006 Update declarations.
17007 (class Output_symtab_xindex): Define.
17008 (Output_section::has_out_shndx): New function.
17009 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17011 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17012 Change all callers.
17013 (Sized_symbol::init): Likewise.
17014 (Symbol::output_section): Check for ordinary symbol.
17015 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17016 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17018 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17019 Change all callers. Simplify handling of symbols from sections
17020 not included in the link.
17021 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17023 (Weak_alias_sorter::operator()): Assert that symbols are
17025 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17027 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17028 parameters. Change all callers.
17029 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17030 symbol distinction. Use SHN_XINDEX when needed.
17031 (Symbol_table::write_section_symbol): Add symtab_xindex
17032 parameter. Change all callers.
17033 (Symbol_table::sized_write_section_symbol): Likewise. Use
17034 SHN_XINDEX when needed.
17035 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17037 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17038 (Symbol::is_defined): Check is_ordinary.
17039 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17040 (Symbol::is_absolute, Symbol::is_common): Likewise.
17041 (class Sized_symbol): Update declarations.
17042 (class Symbol_table): Update declarations.
17043 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17044 parameters. Change all callers.
17045 (Sized_symbol::override): Likewise.
17046 (Symbol_table::override): Likewise.
17047 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17048 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17049 is_ordinary, and orig_st_shndx parameters. Change all callers.
17050 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17051 to be in an ordinary section.
17052 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17053 object and is_ordinary parameters. Change all callers.
17054 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17055 Change all callers. Don't add undefined or non-ordinary symbols
17057 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17058 Change all callers.
17059 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17061 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17062 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17063 (Sized_relobj::relocate_sections): Likewise.
17064 * target-reloc.h (scan_relocs): Adjust section symbol index.
17065 (scan_relocatable_relocs): Likewise.
17066 * i386.cc (Scan::local): Check for ordinary symbols.
17067 * sparc.cc (Scan::local): Likewise.
17068 * x86_64.cc (Scan::local): Likewise.
17069 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17070 to symbol_section_and_value.
17071 * testsuite/many_sections_test.cc: New file.
17072 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17073 (check_PROGRAMS): Add many_sections_test.
17074 (many_sections_test_SOURCES): Define.
17075 (many_sections_test_DEPENDENCIES): Define.
17076 (many_sections_test_LDFLAGS): Define.
17077 (BUILT_SOURCES): Add many_sections_define.h.
17078 (many_sections_define.h): New target.
17079 (BUILT_SOURCES): Add many_sections_check.h.
17080 (many_sections_check.h): New target.
17081 (check_PROGRAMS): Add many_sections_r_test.
17082 (many_sections_r_test_SOURCES): Define.
17083 (many_sections_r_test_DEPENDENCIES): Define.
17084 (many_sections_r_test_LDFLAGS): Define.
17085 (many_sections_r_test_LDADD): Define.
17086 (many_sections_r_test.o): New target.
17087 * testsuite/Makefile.in: Rebuild.
17089 2008-04-17 Cary Coutant <ccoutant@google.com>
17091 * errors.cc (Errors::info): New function.
17092 (gold_info): New function.
17093 * errors.h (Errors::info): New function.
17094 * gold.h (gold_info): New function.
17095 * object.cc (Input_objects::add_object): Print trace output.
17096 * options.cc (options::parse_set): New function.
17097 (General_options::parse_wrap): Deleted.
17098 (General_options::General_options): Deleted initializer.
17099 * options.h (options::String_set): New typedef.
17100 (options::parse_set): New function.
17101 (DEFINE_set): New macro.
17102 (General_options::wrap): Changed to use DEFINE_set. Changed
17103 callers of any_wrap_symbols and is_wrap_symbol.
17104 (General_options::trace, General_options::trace_symbol):
17106 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17107 (General_options::wrap_symbols_): Deleted.
17108 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17110 2008-04-17 David S. Miller <davem@davemloft.net>
17112 * options.cc (General_options::parse_V): New function.
17113 * options.h: Add entries for -V and -Qy.
17115 2008-04-17 Ian Lance Taylor <iant@google.com>
17117 * common.cc (Symbol_table::allocate_commons): Remove options
17118 parameter. Change caller.
17119 (Symbol_table::do_allocate_commons): Remove options parameter.
17120 Change caller. Just call do_allocate_commons_list twice.
17121 (Symbol_table::do_allocate_commons_list): New function, broken out
17122 of do_allocate_commons.
17123 * common.h (class Allocate_commons_task): Remove options_ field.
17124 Update constructor.
17125 * symtab.cc (Symbol_table::Symbol_table): Initialize
17127 (Symbol_table::add_from_object): Put TLS common symbols on
17129 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17130 which are IN_OUTPUT_DATA.
17131 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17132 allocate_commons and do_allocate_commons declarations. Declare
17133 do_allocate_commons_list.
17134 * gold.cc (queue_middle_tasks): Update creation of
17135 Allocate_commons_task to not pass options.
17136 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17137 (TLS_TEST_C_FLAGS): New variable.
17138 (tls_test_c_pic.o): New target.
17139 (tls_test_shared.so): Link in tls_test_c_pic.o.
17140 (tls_test_c_pic_ie.o): New target.
17141 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17142 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17143 (tls_test_c.o): New target.
17144 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17145 (tls_pic_test_LDADD): Likewise.
17146 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17147 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17148 (tls_test_c_gnu2.o): New target.
17149 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17151 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17152 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17153 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17154 * testsuite/tls_test.cc: Include "config.h".
17155 (t_last): Call t11_last.
17156 * testsuite/tls_test.h (t11, t11_last): Declare.
17157 * testsuite/tls_test_c.c: New file.
17158 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17159 * configure.ac: Check for OpenMP support.
17160 * configure, config.in, Makefile.in: Rebuild.
17161 * testsuite/Makefile.in: Rebuild.
17163 2008-04-16 Cary Coutant <ccoutant@google.com>
17165 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17166 (Target_i386::tls_base_symbol_defined_): New field.
17167 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17168 (Target_i386::Scan::global): Likewise.
17169 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17170 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17171 (Target_x86_64::tls_base_symbol_defined_): New field.
17172 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17173 (Target_x86_64::Scan::global): Likewise.
17175 2008-04-16 Cary Coutant <ccoutant@google.com>
17177 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17178 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17179 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17180 building shared libraries.
17181 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17182 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17183 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17184 * testsuite/Makefile.in: Rebuild.
17185 * testsuite/weak_undef.h: New file.
17186 * testsuite/weak_undef_file1.cc: Add extra test cases.
17187 * testsuite/weak_undef_file2.cc: Likewise.
17188 * testsuite/weak_undef_test.cc: Likewise.
17190 2008-04-16 David S. Miller <davem@davemloft.net>
17192 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17193 Add issued_non_pic_error_ field. Declare check_non_pic.
17194 (Target_sparc::Scan::check_non_pic): New function.
17195 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17196 (Target_sparc::Scan::global): Likewise.
17198 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17199 * configure: Rebuild.
17201 * options.h (DEFINE_enable): New macro.
17202 (new_dtags): New enable option.
17203 (initfirst, interpose, loadfltr, nodefaultlib,
17204 nodelete, nodlopen, nodump): New -z options.
17205 * layout.cc (Layout:finish_dynamic_section): If new
17206 dtags enabled, emit DT_RUNPATH. Also, emit a
17207 DT_FLAGS_1 containing any specified -z flags.
17209 2008-04-16 Ian Lance Taylor <iant@google.com>
17211 * copy-relocs.cc: New file.
17212 * copy-relocs.h: New file.
17213 * reloc.cc: Remove Copy_relocs code.
17214 * reloc.h: Likewise.
17215 * reloc-types.h (struct Reloc_types) [both versions]: Add
17216 get_reloc_addend_noerror.
17217 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17218 variants of add_global which take an addend which must be zero.
17219 * i386.cc: Include "copy-relocs.h".
17220 (class Target_i386): Change type of copy_relocs_ to variable,
17221 update initializer.
17222 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17223 Change all callers.
17224 (Target_i386::do_finalize_sections): Change handling of
17226 * sparc.cc: Include "copy-relocs.h".
17227 (class Target_sparc): Change type of copy_relocs_ to variable,
17228 update initializer.
17229 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17230 Change all callers.
17231 (Target_sparc::do_finalize_sections): Change handling of
17233 * x86_64.cc: Include "copy-relocs.h".
17234 (class Target_x86_64): Change type of copy_relocs_ to variable,
17235 update initializer.
17236 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17237 class. Change all callers.
17238 (Target_x86_64::do_finalize_sections): Change handling of
17240 * Makefile.am (CCFILES): Add copy-relocs.cc.
17241 (HFILES): Add copy-relocs.h.
17243 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17245 * testsuite/script_test_4.sh: Permit leading zeroes.
17247 2008-04-15 Ian Lance Taylor <iant@google.com>
17249 * script-sections.cc (Script_sections::create_segments): Use
17250 header_size_adjustment even when there is enough room for the
17252 * testsuite/script_test_4.sh: New file.
17253 * testsuite/script_test_4.t: New file.
17254 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17255 (check_DATA): Add script_test_4.stdout.
17256 (MOSTLYCLEANFILES): Likewise.
17257 (script_test_4): New target.
17258 (script_test_4.stdout): New target.
17259 * testsuite/Makefile.in: Rebuild.
17261 * sparc.cc: Add definitions for Output_data_plt_sparc class
17264 2008-04-14 David S. Miller <davem@davemloft.net>
17266 * sparc.cc: New file.
17267 * Makefile.am (TARGETSOURCES): Add sparc.cc
17268 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17269 * configure.tgt: Document targ_extra_size and
17270 targ_extra_big_endian. Add entries for sparc-* and
17272 * configure.ac: Handle targ_extra_size and
17273 targ_extra_big_endian.
17274 * Makefile.in: Rebuild.
17275 * configure: Likewise.
17276 * po/POTFILES.in: Likewise.
17277 * po/gold.pot: Likewise.
17279 2008-04-14 Ian Lance Taylor <iant@google.com>
17281 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17282 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17283 in the name/type/flags to section mapping. Don't call
17284 allocate_output_section.
17285 (Layout::choose_output_section): Change parameter from adjust_name
17286 to is_input_section. Don't permit input sections after sections
17287 are attached to segments. Don't call allocate_output_section.
17288 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17289 not write_enable_output_section.
17290 (Layout::make_output_section): Don't push to
17291 unattached_section_list_ nor call attach_to_segment. Call
17292 attach_section_to_segment if sections are attached.
17293 (Layout::attach_sections_to_segments): New function.
17294 (Layout::attach_section_to_segment): New function.
17295 (Layout::attach_allocated_section_to_segment): Rename from
17296 attach_to_segment. Remove flags parameter.
17297 (Layout::allocate_output_section): Remove function.
17298 (Layout::write_enable_output_section): Remove function.
17299 * layout.h (class Layout): Update for above changes. Add new
17300 field sections_are_attached_.
17301 * output.h (Output_section::update_flags_for_input_section): New
17303 * output.cc (Output_section::add_input_section): Call
17304 update_flags_for_input_section.
17305 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17307 2008-04-11 Cary Coutant <ccoutant@google.com>
17309 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17310 thought unnecessary.
17311 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17313 2008-04-11 Ian Lance Taylor <iant@google.com>
17315 * output.h (class Output_section_data): Remove inline definition
17317 * output.cc (Output_section_data::set_addralign): New function.
17319 2008-04-11 Cary Coutant <ccoutant@google.com>
17321 Add support for TLS descriptors for i386 and x86_64.
17322 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17323 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17324 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17326 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17327 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17328 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17330 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17331 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17332 Fix problem with initial-exec relocations.
17333 (Target_i386::Relocate::relocate_tls): Likewise.
17334 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17336 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17337 support for section-plus-offset dynamic table entries.
17338 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17339 (Output_data_dynamic::Dynamic_entry): Add support for
17340 section-plus-offset dynamic table entries.
17341 (Output_data_dynamic::Classification): Likewise.
17342 (Output_data_dynamic::classification_): Renamed offset_.
17343 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17344 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17345 (Target_x86_64::make_plt_section): New function.
17346 (Target_x86_64::reserve_tlsdesc_entries): New function.
17347 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17348 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17349 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17350 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17351 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17352 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17353 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17354 add extra PLT entry for TLS descriptors.
17355 (Output_data_plt_x86_64::got_): New field.
17356 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17357 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17359 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17361 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17362 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17363 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17364 R_386_TLS_DESC_CALL relocations.
17365 (Target_x86_64::Scan::global): Likewise.
17366 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17367 for TLS descriptors.
17368 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17369 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17370 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17371 GD-to-IE relaxation.
17372 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17373 and TLS_DESCRIPTORS.
17374 * Makefile.in: Rebuild.
17375 * configure: Rebuild.
17376 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17377 (tls_test_shared2.so): New target.
17378 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17379 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17380 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17381 (tls_shared_gd_to_ie_test_LDADD): New variable.
17382 (tls_shared_gnu2_gd_to_ie_test): New target.
17383 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17385 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17386 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17387 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17388 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17389 (tls_shared_gnu2_test): New target.
17390 (tls_test_gnu2_shared.so): New target.
17391 (tls_shared_gnu2_test_SOURCES): New variable.
17392 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17393 (tls_shared_gnu2_test_LDFLAGS): New variable.
17394 (tls_shared_gnu2_test_LDADD): New variable.
17395 * testsuite/Makefile.in: Rebuild.
17396 * testsuite/Makefile.
17398 2008-04-11 Ian Lance Taylor <iant@google.com>
17400 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17402 * testsuite/Makefile.in: Rebuild.
17404 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17406 * testsuite/script_test_2.cc (main): Adjust test.
17408 2008-04-11 David S. Miller <davem@davemloft.net>
17409 Ian Lance Taylor <iant@google.com>
17411 * options.h (General_options): Add entries for '-Y' and
17413 * options.cc (General_options:finalize): If -Y was used, add those
17414 entries to the library path instead of the default "/lib" and
17417 2008-04-11 David S. Miller <davem@davemloft.net>
17419 * testsuite/justsyms.t: Start at 0x100.
17420 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17421 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17423 * testsuite/script_test_2.cc: Adjust string and section length
17426 2008-04-09 Ian Lance Taylor <iant@google.com>
17429 * script-sections.cc (Sections_element::allocate_to_segment): Add
17431 (Output_section_definition::allocate_to_segment): Likewise.
17432 (Orphan_output_section::allocate_to_segment): Likewise.
17433 (Script_sections::attach_sections_using_phdrs_clause): Don't
17434 propagate non-PT_LOAD segments to orphan sections.
17435 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17436 readelf rather than objdump.
17437 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17438 .interp section and PT_INTERP segment are the same size.
17439 * testsuite/Makefile.in: Rebuild.
17441 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17442 aliases for symbols defined in the same object.
17443 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17444 (weak_alias_test_SOURCES): New variable.
17445 (weak_alias_test_DEPENDENCIES): New variable.
17446 (weak_alias_test_LDFLAGS): New variable.
17447 (weak_alias_test_LDADD): New variable.
17448 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17449 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17450 (weak_alias_test_3.o): New target.
17451 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17452 * testsuite/weak_alias_test_main.cc: New file.
17453 * testsuite/weak_alias_test_1.cc: New file.
17454 * testsuite/weak_alias_test_2.cc: New file.
17455 * testsuite/weak_alias_test_3.cc: New file.
17457 2008-04-08 Ian Lance Taylor <iant@google.com>
17459 * options.h (class General_options): Add --noinhibit-exec option.
17460 * main.cc (main): Check --noinhibit-exec.
17462 * options.h (class General_options): Define --wrap as a special
17463 option. Add wrap_symbols_ field.
17464 (General_options::any_wrap_symbols): New function.
17465 (General_options::is_wrap_symbol): New function.
17466 * options.cc (General_options::parse_wrap): New function.
17467 (General_options::General_options): Initialize wrap_symbols_.
17468 * symtab.cc (Symbol_table::wrap_symbol): New function.
17469 (Symbol_table::add_from_object): Handle --wrap.
17470 * symtab.h (class Symbol_table): Declare wrap_symbol.
17471 * target.h (Target::wrap_char): New function.
17472 (Target::Target_info): Add wrap_char field.
17473 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17474 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17475 * testsuite/testfile.cc (Target_test::test_target_info):
17478 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17481 * layout.h (class Layout): Add added_eh_frame_data_ field.
17482 * layout.cc (Layout::Layout): Initialize new field.
17483 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17484 output section until we find a section we merged successfully.
17485 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17486 that the size be non-zero.
17488 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17491 2008-04-08 Craig Silverstein <csilvers@google.com>
17493 * configure.ac: Export new conditional variable HAVE_ZLIB.
17494 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17496 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17497 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17499 2008-04-07 Ian Lance Taylor <iant@google.com>
17501 * version.cc (version_string): Set to "1.5".
17503 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17504 Add issued_non_pic_error_ field. Declare check_non_pic.
17505 (Target_x86_64::Scan::check_non_pic): New function.
17506 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17507 (Target_x86_64::Scan::global): Likewise.
17509 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17510 addend parameter. Change caller. Handle merge sections.
17511 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17512 Address to Addend. Don't add in the result of
17513 local_section_offset, pass down the addend and use the returned
17515 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17516 Update declarations of local_section_offset and symbol_value.
17517 * testsuite/two_file_test_1.cc (t18): New function.
17518 * testsuite/two_file_test_2.cc (f18): New function.
17519 * testsuite/two_file_test_main.cc (main): Call t18.
17520 * testsuite/two_file_test.h (t18, f18): Declare.
17522 * configure.ac: Don't test for objdump, c++filt, or readelf.
17523 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17525 (TEST_READELF): New variable.
17526 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17527 (check_PROGRAMS): Add two_file_strip_test.
17528 (two_file_strip_test): New target.
17529 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17530 (two_file_same_shared_strip_test_SOURCES): New variable.
17531 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17532 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17533 (two_file_same_shared_strip_test_LDADD): New variable.
17534 (two_file_shared_strip.so): New target.
17535 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17536 (ver_test_5.syms, ver_test_7.syms): Likewise.
17537 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17538 (strip_test_3.stdout): Use TEST_OBJDUMP.
17539 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17541 2008-04-04 Cary Coutant <ccoutant@google.com>
17543 * symtab.h (Symbol::is_weak_undefined): New function.
17544 (Symbol::is_strong_undefined): New function.
17545 (Symbol::is_absolute): New function.
17546 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17547 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17549 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17550 (weak_undef_test): New target.
17551 * testsuite/Makefile.in: Rebuild.
17552 * testsuite/weak_undef_file1.cc: New file.
17553 * testsuite/weak_undef_file2.cc: New file.
17554 * testsuite/weak_undef_test.cc: New file.
17556 2008-04-03 Craig Silverstein <csilvers@google.com>
17558 * compressed_output.h (class Output_compressed_section): Use
17560 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17562 (zlib_compressed_suffix): Removed.
17563 (Output_compressed_section::set_final_data_size): Use unsigned
17565 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17566 Fix linker invocation.
17567 (flagstest_o_specialfile_and_compress_debug_sections):
17569 * testsuite/Makefile.in: Regenerated.
17571 2008-04-02 David S. Miller <davem@davemloft.net>
17573 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17574 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17576 2008-04-02 Craig Silverstein <csilvers@google.com>
17580 2008-04-02 Ian Lance Taylor <iant@google.com>
17582 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17583 parameters. Update for new key type to views_. Change all
17585 (File_read::read): Adjust for byteshift in returned view.
17586 (File_read::add_view): New function, broken out of
17587 find_and_make_view.
17588 (File_read::make_view): New function, broken out of
17589 find_and_make_view.
17590 (File_read::find_or_make_view): Add offset and aligned
17591 parameters. Rewrite accordingly. Change all callers.
17592 (File_read::get_view): Add offset and aligned parameters. Adjust
17593 for byteshift in return value.
17594 (File_read::get_lasting_view): Likewise.
17595 * fileread.h (class File_read): Update declarations.
17596 (class File_read::View): Add byteshift_ field. Add byteshift to
17597 constructor. Add byteshift method.
17598 * archive.h (Archive::clear_uncached_views): New function.
17599 (Archive::get_view): Add aligned parameter. Change all callers.
17600 * object.h (Object::get_view): Add aligned parameter. Change all
17602 (Object::get_lasting_view): Likewise.
17604 * fileread.cc (File_read::release): Don't call clear_views if
17605 there are multiple objects.
17606 * fileread.h (File_read::clear_uncached_views): New function.
17607 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17610 2008-03-31 Cary Coutant <ccoutant@google.com>
17612 Add thin archive support.
17613 * archive.cc (Archive::armagt): New const.
17614 (Archive::setup): Remove task parameter and calls to unlock.
17615 (Archive::unlock_nested_archives): New function.
17616 (Archive::read_header): Add nested_off parameter. Change
17618 (Archive::interpret_header): Likewise.
17619 (Archive::include_all_members): Change to handle thin
17621 (Archive::include_member): Likewise.
17622 * archive.h (Archive::Archive): Add new parameters and
17624 (Archive::armagt): New const.
17625 (Archive::setup): Remove task parameter.
17626 (Archive::unlock_nested_archives): New function.
17627 (Archive::read_header): Add nested_off parameter.
17628 (Archive::interpret_header): Likewise.
17629 (Archive::Nested_archive_table): New typedef.
17630 (Archive::is_thin_archive_): New field.
17631 (Archive::nested_archives_): New field.
17632 (Archive::options_): New field.
17633 (Archive::dirpath_): New field.
17634 (Archive::task_): New field.
17635 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17636 for thin archives. Pass additional parameters to
17637 Archive::Archive. Unlock the archive file after calling
17640 2008-03-29 Ian Lance Taylor <iant@google.com>
17642 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17643 version symbol to be local.
17644 * testsuite/ver_test_4.sh: New file.
17645 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17646 (check_DATA): Add ver_test_4.syms.
17647 (ver_test_4.syms): New target.
17648 * testsuite/Makefile.in: Rebuild.
17651 (Output_section::Input_section_sort_entry::has_priority): New
17653 (Output_section::Input_section_sort_entry::match_file_name): New
17655 (Output_section::Input_section_sort_entry::match_section_name):
17657 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17659 (Output_section::Input_section_sort_entry::match_section_file):
17661 (Output_section::Input_section_sort_compare::operator()): Rewrite
17662 using new Input_section_sort_entry functions. Sort crtbegin and
17663 crtend first. Sort sections with no priority before sections with
17665 * testsuite/initpri1.c (d3): Check j != 4.
17666 (cd5): New constructor/destructor function.
17667 (main): Check j != 2.
17669 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17670 new symbol when resolving, don't call set_is_default.
17671 * testsuite/ver_test_7.cc: New file.
17672 * testsuite/ver_test_7.sh: New file.
17673 * testsuite/Makefile.am (ver_test_7.so): New target.
17674 (ver_test_7.o): New target.
17675 (check_SCRIPTS): Add ver_test_7.sh.
17676 (check_DATA): Add ver_test_7.syms.
17677 (ver_test_7.syms): New target.
17679 2008-03-28 Ian Lance Taylor <iant@google.com>
17681 * layout.cc (Layout::layout): If we see an input section with a
17682 name that needs sorting, set the must_sort flag for the output
17684 (Layout::make_output_section): If the name of the output section
17685 indicates that it might require sorting, set the may_sort flag.
17686 * output.h (Output_section::may_sort_attached_input_sections): New
17688 (Output_section::set_may_sort_attached_input_sections): New
17690 (Output_section::must_sort_attached_input_sections): New
17692 (Output_section::set_must_sort_attached_input_sections): New
17694 (class Output_section): Declare Input_section_sort_entry. Define
17695 Input_section_sort_compare. Declare
17696 sort_attached_input_sections. Add new fields:
17697 may_sort_attached_input_sections_,
17698 must_sort_attached_input_sections_,
17699 attached_input_sections_are_sorted_.
17700 * output.cc (Output_section::Output_section): Initialize new
17702 (Output_section::add_input_section): Add an entry to
17703 input_sections_ if may_sort or must_sort are true.
17704 (Output_section::set_final_data_size): Call
17705 sort_attached_input_sections if necessary.
17706 (Output_section::Input_section_sort_entry): Define new class.
17707 (Output_section::Input_section_sort_compare::operator()): New
17709 (Output_section::sort_attached_input_sections): New function.
17710 * configure.ac: Check whether the compiler supports constructor
17711 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17712 * testsuite/initpri1.c: New file.
17713 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17714 CONSTRUCTOR_PRIORITY.
17715 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17716 (initpri1_LDFLAGS): New variable.
17717 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17719 2008-03-27 Ian Lance Taylor <iant@google.com>
17721 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17722 * testsuite/common_test_1.c: New file.
17723 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17724 (common_test_1_SOURCES): New variable.
17725 (common_test_1_DEPENDENCIES): New variable.
17726 (common_test_1_LDFLAGS): New variable.
17728 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17729 and commons_ correctly when NAME/VERSION does not override
17731 * testsuite/ver_test_6.c: New file.
17732 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17733 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17734 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17736 2008-03-26 Ian Lance Taylor <iant@google.com>
17738 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17739 of an undefined symbol from a version script.
17740 * testsuite/Makefile.am (ver_test_5.so): New target.
17741 (ver_test_5.o): New target.
17742 (check_SCRIPTS): Add ver_test_5.sh.
17743 (check_DATA): Add ver_test_5.syms.
17744 (ver_test_5.syms): New target.
17745 * testsuite/ver_test_5.cc: New file.
17746 * testsuite/ver_test_5.script: New file.
17747 * testsuite/ver_test_5.sh: New file.
17748 * Makefile.in, testsuite/Makefile.in: Rebuild.
17751 Fix problems building gold with gcc 4.3.0.
17752 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17753 (gold_error_at_location, gold_warning_at_location): Use it.
17754 * configure.ac: Check whether we can compile and use a template
17755 function with a printf attribute.
17756 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17757 when jumping over bytes.
17758 * object.cc: Instantiate Object::read_section_data.
17759 * debug.h: Include <cstring>
17760 * dwarf_reader.cc: Include <algorithm>
17761 * main.cc: Include <cstring>.
17762 * options.cc: Include <cstring>.
17763 * output.cc: Include <cstring>.
17764 * script.cc: Include <cstring>.
17765 * script.h: Include <string>.
17766 * symtab.cc: Include <cstring> and <algorithm>.
17767 * target-select.cc: Include <cstring>.
17768 * version.cc: Include <string>.
17769 * testsuite/testmain.cc: Include <cstdlib>.
17770 * configure, config.in: Rebuild.
17772 2008-03-25 Ian Lance Taylor <iant@google.com>
17774 * options.cc: Include "../bfd/bfdver.h".
17775 (options::help): Print bug reporting address.
17777 * version.cc (print_version): Adjust output for current value of
17778 BFD_VERSION_STRING.
17782 * options.cc (options::help): Print list of supported targets.
17783 * target-select.h: Include <vector>.
17784 (class Target_selector): Make machine_, size_, and is_big_endian_
17785 fields const. Add bfd_name_ and instantiated_target_ fields.
17786 (Target_selector::Target_selector): Add bfd_name parameter.
17787 (Target_selector::recognize): Make non-virtual, call
17789 (Target_selector::recognize_by_name): Make non-virtual, call
17790 do_recognize_by_name.
17791 (Target_selector::supported_names): New function.
17792 (Target_selector::bfd_name): New function.
17793 (Target_selector::do_instantiate_target): New pure virtual
17795 (Target_selector::do_recognize): New virtual function.
17796 (Target_selector::do_recognize_by_name): New virtual function.
17797 (Target_selector::instantiate_target): New private function.
17798 (supported_target_names): Declare.
17799 * target-select.cc (Target_selector::Target_selector): Update for
17800 new parameter and fields.
17801 (select_target_by_name): Check that the name matches before
17802 calling recognize_by_name.
17803 (supported_target_names): New function.
17804 * i386.cc (class Target_selector_i386): Update Target_selector
17805 constructor call. Remove recognize and recognize_by_name. Add
17806 do_instantiate_target.
17807 * x86_64.cc (class Target_selector_x86_64): Likewise.
17808 * testsuite/testfile.cc (class Target_selector_test): Update for
17809 changes to Target_selector.
17811 * README: Rewrite, with some notes on unsupported features.
17813 2008-03-24 Cary Coutant <ccoutant@google.com>
17815 * i386.cc (Target_i386::Got_type): New enum declaration.
17816 (Target_i386::Scan::local): Updated callers of Output_data_got
17818 (Target_i386::Scan::global): Likewise.
17819 (Target_i386::Relocate::relocate): Likewise.
17820 (Target_i386::Relocate::relocate_tls): Likewise.
17821 * object.h (Got_offset_list): New class.
17822 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17823 (Sized_relobj::local_got_offset): Likewise.
17824 (Sized_relobj::set_local_got_offset): Likewise.
17825 (Sized_relobj::local_has_tls_got_offset): Removed.
17826 (Sized_relobj::local_tls_got_offset): Removed.
17827 (Sized_relobj::set_local_tls_got_offset): Removed.
17828 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17829 * output.cc (Output_data_got::add_global): Added got_type parameter.
17830 (Output_data_got::add_global_with_rel): Likewise.
17831 (Output_data_got::add_global_with_rela): Likewise.
17832 (Output_data_got::add_global_pair_with_rel): New function.
17833 (Output_data_got::add_global_pair_with_rela): New function.
17834 (Output_data_got::add_local): Added got_type parameter.
17835 (Output_data_got::add_local_with_rel): Likewise.
17836 (Output_data_got::add_local_with_rela): Likewise.
17837 (Output_data_got::add_local_pair_with_rel): New function.
17838 (Output_data_got::add_local_pair_with_rela): New function.
17839 (Output_data_got::add_global_tls): Removed.
17840 (Output_data_got::add_global_tls_with_rel): Removed.
17841 (Output_data_got::add_global_tls_with_rela): Removed.
17842 (Output_data_got::add_local_tls): Removed.
17843 (Output_data_got::add_local_tls_with_rel): Removed.
17844 (Output_data_got::add_local_tls_with_rela): Removed.
17845 * output.h (Output_data_got::add_global): Added got_type parameter.
17846 (Output_data_got::add_global_with_rel): Likewise.
17847 (Output_data_got::add_global_with_rela): Likewise.
17848 (Output_data_got::add_global_pair_with_rel): New function.
17849 (Output_data_got::add_global_pair_with_rela): New function.
17850 (Output_data_got::add_local): Added got_type parameter.
17851 (Output_data_got::add_local_with_rel): Likewise.
17852 (Output_data_got::add_local_with_rela): Likewise.
17853 (Output_data_got::add_local_pair_with_rel): New function.
17854 (Output_data_got::add_local_pair_with_rela): New function.
17855 (Output_data_got::add_global_tls): Removed.
17856 (Output_data_got::add_global_tls_with_rel): Removed.
17857 (Output_data_got::add_global_tls_with_rela): Removed.
17858 (Output_data_got::add_local_tls): Removed.
17859 (Output_data_got::add_local_tls_with_rel): Removed.
17860 (Output_data_got::add_local_tls_with_rela): Removed.
17861 * resolve.cc (Symbol::override_base_with_special): Removed
17862 reference to has_got_offset_ field.
17863 * symtab.cc (Symbol::init_fields): Replaced initialization
17864 of got_offset_ with got_offsets_. Removed initialization
17866 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
17867 (Symbol::got_offset): Likewise.
17868 (Symbol::set_got_offset): Likewise.
17869 (Symbol::has_tls_got_offset): Removed.
17870 (Symbol::tls_got_offset): Removed.
17871 (Symbol::set_tls_got_offset): Removed.
17872 (Symbol::got_offset_): Removed.
17873 (Symbol::tls_mod_got_offset_): Removed.
17874 (Symbol::tls_pair_got_offset_): Removed.
17875 (Symbol::got_offsets_): New field.
17876 (Symbol::has_got_offset): Removed.
17877 (Symbol::has_tls_mod_got_offset): Removed.
17878 (Symbol::has_tls_pair_got_offset): Removed.
17879 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17880 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17882 (Target_x86_64::Scan::global): Likewise.
17883 (Target_x86_64::Relocate::relocate): Likewise.
17884 (Target_x86_64::Relocate::relocate_tls): Likewise.
17886 2008-03-25 Ben Elliston <bje@au.ibm.com>
17888 * yyscript.y: Fix spelling error in comment.
17890 2008-03-24 Ian Lance Taylor <iant@google.com>
17892 * options.h (class General_options): Define build_id option.
17893 * layout.h (class Layout): Declare write_build_id, create_note,
17894 create_build_id. Add build_id_note_ member.
17895 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17896 "libiberty.h", "md5.h", "sha1.h".
17897 (Layout::Layout): Initialize eh_frame_data_,
17898 eh_frame_hdr_section_, and build_id_note_.
17899 (Layout::finalize): Call create_build_id.
17900 (Layout::create_note): New function, broken out of
17901 Layout::create_gold_note.
17902 (Layout::create_gold_note): Call create_note.
17903 (Layout::create_build_id): New function.
17904 (Layout::write_build_id): New function.
17905 (Close_task_runner::run): Call write_build_id.
17907 * x86_64.cc: Correct license to GPLv3.
17909 2008-03-23 Ian Lance Taylor <iant@google.com>
17911 * options.cc: Include "demangle.h".
17912 (parse_optional_string): New function.
17913 (parse_long_option): Handle takes_optional_argument.
17914 (parse_short_option): Update dash_z initializer. Handle
17915 takes_optional_argument.
17916 (General_options::General_options): Initialize do_demangle_.
17917 (General_options::finalize): Set do_demangle_. Handle demangling
17919 * options.h (parse_optional_string): Declare.
17920 (struct One_option): Add optional_arg field. Update constructor.
17921 Update call constructor calls. Add takes_optional_argument
17923 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17924 (DEFINE_optional_string): Define.
17925 (General_options::demangle): Change from DEFINE_bool to
17926 DEFINE_optional_string.
17927 (General_options::no_demangle): New function.
17928 (General_options::do_demangle): New function.
17929 (General_options::set_do_demangle): New function.
17930 (General_options::execstack_status_): Move definition to end of
17932 (General_options::static_): Likewise.
17933 (General_options::do_demangle_): New field.
17934 * object.cc (big_endian>::get_symbol_location_info): Call
17935 Options::do_demangle, not Options::demangle.
17936 * symtab.cc (demangle): Likewise.
17938 2008-03-22 Ian Lance Taylor <iant@google.com>
17940 * gold.h: Include <cstddef> and <sys/types.h>
17941 * options.h: Include <cstring>.
17943 2008-03-21 Ian Lance Taylor <iant@google.com>
17945 * Added source code to GNU binutils.
17947 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17949 Copying and distribution of this file, with or without modification,
17950 are permitted in any medium without royalty provided the copyright
17951 notice and this notice are preserved.
17957 version-control: never