1 2015-11-03 Alan Modra <amodra@gmail.com>
3 * po/POTFILES.in: Regenerate.
5 2015-10-30 Nick Clifton <nickc@redhat.com>
7 * po/zh_CN.po: New (simplified) Chinese translation.
9 2015-10-29 H.J. Lu <hongjiu.lu@intel.com>
12 * incremental.cc (Got_plt_view_info): Add got_entry_size.
13 (Local_got_offset_visitor::visit): Replace got_entry_size_
14 with info_.got_entry_size.
15 (Local_got_offset_visitor::got_entry_size_): Removed.
16 (Global_got_offset_visitor::visit): Replace got_entry_size_
17 with info_.got_entry_size.
18 (Global_got_offset_visitor::got_entry_size_): Removed.
19 (Output_section_incremental_inputs::write_got_plt): Initialize
20 view_info.got_entry_size.
21 * target.h (Sized_target::got_entry_size): New virtual function.
22 * x86_64.cc (Target_x86_64::got_entry_size): New function.
24 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
26 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
27 * testsuite/script_test_12a.c: Likewise.
28 * testsuite/script_test_1a.cc: Likewise.
29 * testsuite/script_test_2.cc: Likewise.
31 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
33 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
35 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
38 * stringpool.cc (Stringpool_template::new_key_offset): Align all
39 strings, even zero-length.
40 (Stringpool_template::set_string_offsets): Likewise.
42 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
45 * Makefile.am (TARGETSOURCES): Add s390.cc.
46 (ALL_TARGETOBJS): Add s390.o.
47 * Makefile.in: Regenerate.
48 * configure.ac: Add s390 support.
49 * configure: Regenerate.
50 * configure.tgt: Add s390-*-* and s390x-*-*.
51 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
54 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
56 * archive.cc (Archive::sym64name): New const.
57 (Archive::setup): Add support for SYM64 armap.
58 (Archive::read_armap): Likewise.
59 (Archive::interpret_header): Likewise.
60 (Archive::const_iterator::read_next_header): Likewise.
61 * archive.h (Archive::sym64name): New const.
62 (Archive::read_armap): Add mapsize template parameter.
64 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
66 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
67 target-specific entry size.
68 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
69 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
70 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
72 * target.h (Target::hash_entry_size): New method.
73 (Target::Target_info::hash_entry_size): New data member.
75 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
76 * arm.cc (Target_arm::arm_info): Likewise.
77 (Target_arm_nacl::arm_nacl_info): Likewise.
78 * i386.cc (Target_i386::i386_info): Likewise.
79 (Target_i386_nacl::i386_nacl_info): Likewise.
80 (Target_iamcu::iamcu_info): Likewise.
81 * mips.cc (Target_mips::mips_info): Likewise.
82 (Target_mips_nacl::mips_nacl_info): Likewise.
83 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
84 * sparc.cc (Target_sparc::sparc_info): Likewise.
85 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
86 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
87 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
88 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
90 2015-10-28 H.J. Lu <hongjiu.lu@intel.com>
93 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
94 and R_386_GOT32X relocations without base register.
96 2015-10.27 Han Shen <shenhan@google.com>
98 PR gold/19042 - unsupported reloc 311/312.
100 * aarch64.cc (Target_aarch64::Scan::local): Add support for
103 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
105 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
106 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
107 as R_X86_64_GOTPCREL.
108 (Target_x86_64<size>::Scan::local): Likewise.
109 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
111 (Target_x86_64<size>::Scan::global): Likewise.
112 (Target_x86_64<size>::Relocate::relocate): Likewise.
113 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
116 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
118 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
119 R_386_GOT32X the same as R_386_GOT32.
120 (Target_i386::Scan::local): Likewise.
121 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
122 (Target_i386::Scan::global): Likewise.
123 (Target_i386::Relocate::relocate): Likewise.
124 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
127 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
129 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
130 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
131 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
132 x86_64_mov_to_lea1.o.
133 * testsuite/Makefile.in: Regenerated.
135 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
138 * options.h (General_options): Remove "obsolete" from -m.
139 * parameters.cc (set_parameters_target): Check if input target
140 is compatible with output emulation set by "-m emulation".
142 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
145 * i386.cc (Target_iamcu): New class.
146 (Target_selector_iamcu): Likewise.
147 (Target_iamcu::iamcu_info): New variable.
148 (target_selector_iamcu): Likewise.
150 2015-10-07 Andreas Schwab <schwab@suse.de>
152 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
154 2015-10-06 Cary Coutant <ccoutant@gmail.com>
157 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
159 (Sparc_relocate_functions::gdop_lox10): Likewise.
160 (Target_sparc::Relocate::relocate): Use addend when computing
161 symbol value for R_SPARC_GOTDATA_OP*.
163 2015-09-07 Cary Coutant <ccoutant@gmail.com>
167 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
168 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
170 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
173 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
174 shared libraries into normal FUNC symbols.
175 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
176 symbols aren't from shared libraries.
178 2015-09-02 Alan Modra <amodra@gmail.com>
181 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
182 (Target_powerpc::Branch_info::make_stub): Determine whether long
183 branch stub is for save/restore function.
184 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
185 (Stub_table): Add need_save_res_.
186 (Stub_table:clear_stubs): Clear need_save_res_.
187 (Stub_table:set_address_and_size): Add save/restore section size.
188 (Stub_table::add_long_branch_entry): Add save_res param. Set
189 need_save_res_, but don't add space for save/restore stubs.
190 (Stub_table::find_long_branch_entry): Return offset to local copy
191 of save/restore func.
192 (Stub_table::do_write): Don't output save/restore stubs. Instead
193 copy the save/restore functions.
194 (Output_data_save_res:contents): New accessor.
195 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
197 2015-08-25 Cary Coutant <ccoutant@gmail.com>
200 * script-sections.cc (Memory_region::set_address): New method.
201 (Script_sections::find_memory_region): Add explicit_only parameter.
202 (Output_section_definition::set_section_addresses): Handle case where
203 script specifies both address and vma region.
204 * script-sections.h (Script_sections::find_memory_region): Add
205 explicit_only parameter.
207 2015-08-25 Cary Coutant <ccoutant@gmail.com>
210 * object.cc (Input_objects::add_object): Store objects in a map,
211 indexed by soname; update as-needed flag when necessary.
212 * object.h (Object::clear_as_needed): New method.
213 (Input_objects::so_names_): Change from set to map.
215 2015-08-25 Cary Coutant <ccoutant@gmail.com>
218 * expression.cc (Expression::Expression_eval_info): Add
219 is_valid_pointer field.
220 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
222 (Addr_expression::value_from_output_section): Check whether address
224 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
225 if evaluation failed due to address that is not yet valid.
226 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
229 2015-08-25 Cary Coutant <ccoutant@gmail.com>
233 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
235 2015-08-20 Alan Modra <amodra@gmail.com>
238 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
239 Subtract os->address() from addend.
240 * powerpc.cc (relocate_relocs): Likewise.
242 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
244 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
245 lazy_stub_normal_1, lazy_stub_normal_1_n64,
246 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
247 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
248 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
249 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
252 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
254 * configure: Regenerated.
256 2015-07-26 Doug Kwan <dougkwan@google.com>
258 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
259 disassembler output format.
261 2015-07-23 Ian Coolidge <icoolidge@google.com>
262 Plumb --pic-veneer option for gold.
264 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
266 * options.h (General_options): Add --pic-veneer option.
268 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
271 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
272 script_test_1a.cc script_test_1b.cc.
273 (script_test_11_r.o): Replace script_test_11.o with
274 script_test_11a.o script_test_11b.o.
275 (script_test_11.o): Removed.
276 (script_test_11a.o): New.
277 (script_test_11b.o): Likewise.
278 * testsuite/Makefile.in: Regenerated.
279 * testsuite/script_test_1.h: New file.
280 * testsuite/script_test_1b.cc: Likewise.
281 * testsuite/script_test_11.h: Likewise.
282 * testsuite/script_test_11b.c: Likewise.
283 * testsuite/script_test_1.cc: Renamed to ...
284 * testsuite/script_test_1a.cc: This.
285 Include "script_test_1.h".
286 (main): Call check_int and check_ptr.
287 * testsuite/script_test_11.c: Renamed to ...
288 * testsuite/script_test_11a.c: This.
289 Include "script_test_11.h".
290 (main): Call ptr_equal.
292 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
295 * testsuite/ifuncdep2.c (global): Change protected to hidden.
296 * testsuite/ifuncmod1.c (global): Likewise.
297 * testsuite/ifuncmod5.c (global): Likewise.
299 2015-07-22 Alan Modra <amodra@gmail.com>
301 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
303 2015-07-21 Cary Coutant <ccoutant@gmail.com>
306 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
307 forced local symbol even when oldsym != NULL.
308 (Symbol_table::do_define_in_output_segment): Likewise.
309 (Symbol_table::do_define_as_constant): Likewise.
311 2015-07-21 Cary Coutant <ccoutant@gmail.com>
314 * archive.cc (Library_base::should_include_member): Don't use entry
315 point for relocatable links, or if target is not yet valid.
316 * parameters.cc (Parameters::entry): Check target_valid().
318 2015-07-20 Han Shen <shenhan@google.com>
320 Optimize erratum 843419 fix.
322 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
323 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
324 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
325 (E843419_stub): New sub-class of Erratum_stub.
326 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
327 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
328 (AArch64_relobj::create_erratum_stub): Add 1 argument.
329 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
331 2015-07-20 Han Shen <shenhan@google.com>
333 Fix arm elf header flags wrt hardfp bit.
335 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
337 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
340 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
341 from input group section for relocatable link.
342 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
343 (check_DATA): Add pr18689.stdout.
344 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
345 (pr18689.stdout): New rule.
346 (pr18689a.o): Likewise.
347 (pr18689b.o): Likewise.
348 (pr18689.o): Likewise.
349 * testsuite/pr18689.c: New file.
350 * testsuite/pr18689.sh: Likewise.
351 * testsuite/Makefile.in: Regenerated.
353 2015-07-20 Yiran Wang <yiran@google.com>
354 Cary Coutant <ccoutant@gmail.com>
357 * resolve.cc (Symbol_table): Remove warning about references
358 from shared objects to hidden symbols.
359 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
360 * testsuite/Makefile.in: Regenerate.
361 * testsuite/hidden_test.sh: Check dynamic symbol table; update
362 expected error messages.
364 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
366 * compressed_output.cc (Output_compressed_section::set_final_data_size):
367 Make --compress-debug-sections=zlib the same as
368 --compress-debug-sections=zlib-gabi.
369 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
370 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
372 * testsuite/Makefile.in: Regenerated.
374 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
377 * compressed_output.cc (zlib_compress): Add argument for
378 compression header size. Set header size to compression header
379 size if it isn't 0. Don't write out the zlib header here.
380 (Output_compressed_section::set_final_data_size): Support
381 zlib-gnu and zlib-gabi compressions. Pass compression header
382 size to zlib_compress and write out compression header. Set
383 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
384 clear the SHF_COMPRESSED bit
385 * options.h (compress_debug_sections): Add zlib-gnu and
387 * output.h (Output_section::set_flags): New.
388 * testsuite/Makefile.am (check_PROGRAMS): Add
389 flagstest_compress_debug_sections_none,
390 flagstest_compress_debug_sections_gnu and
391 flagstest_compress_debug_sections_gabi.
392 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
393 flagstest_compress_debug_sections.stdout,
394 flagstest_compress_debug_sections.cmp,
395 flagstest_compress_debug_sections.check,
396 flagstest_compress_debug_sections_gnu.stdout,
397 flagstest_compress_debug_sections_gnu.cmp,
398 flagstest_compress_debug_sections_gnu.check,
399 flagstest_compress_debug_sections_gabi.stdout,
400 flagstest_compress_debug_sections_gabi.cmp and
401 flagstest_compress_debug_sections_gabi.check.
402 (flagstest_compress_debug_sections_none): New.
403 (flagstest_compress_debug_sections_none.stdout): Likewise.
404 (flagstest_compress_debug_sections.stdout): Likewise.
405 (flagstest_compress_debug_sections.check): Likewise.
406 (flagstest_compress_debug_sections.cmp): Likewise.
407 (flagstest_compress_debug_sections_gnu): Likewise.
408 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
409 (flagstest_compress_debug_sections_gnu.check): Likewise.
410 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
411 (flagstest_compress_debug_sections_gabi): Likewise.
412 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
413 (flagstest_compress_debug_sections_gnu.check): Likewise.
414 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
415 * testsuite/Makefile.in: Regenerated.
417 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
420 * compressed_output.h (decompress_input_section): Add arguments
421 for ELF class, big endian and sh_flags.
422 * compressed_output.cc (decompress_input_section): Likewise.
423 Support the SHF_COMPRESSED section.
424 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
426 * plugin.h (Pluginobj): Likewise.
427 * layout.cc (Layout::get_output_section_flags): Also clear the
429 * object.h (Compressed_section_info): Add flag to store sh_flags.
430 (Object): Add pure virtual elfsize and is_big_endian member
432 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
434 (build_compressed_section_map): Check SHF_COMPRESSED for
435 uncompressed size. Store sh_flags in Compressed_section_info.
436 Pass size, big_endian and sh_flags to decompress_input_section.
437 Skip the ".debug"/".zdebug" prefix when passing section name to
438 need_decompressed_section.
439 (Sized_relobj_file<size, big_endian>::do_find_special_section):
440 Don't check ".zdebug_*" sections.
441 (Object::decompressed_section_contents): Pass ELF class, big
442 endian and sh_flags to decompress_input_section.
443 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
445 * testsuite/Makefile.am (check_DATA): Add
446 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
447 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
448 gdb_index_test_2_gabi.stdout.
449 (debug_msg_cdebug_gabi.o): New.
450 (odr_violation1_cdebug_gabi.o): Likewise.
451 (odr_violation2_cdebug_gabi.o): Likewise.
452 (debug_msg_cdebug_gabi.err): Likewise.
453 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
454 (gdb_index_test_cdebug_gabi.o): Likewise.
455 (gdb_index_test_2_gabi): Likewise.
456 (gdb_index_test_2_gabi.stdout): Likewise.
457 * testsuite/gdb_index_test_2_gabi.sh: New file.
458 * testsuite/Makefile.in: Regenerated.
460 2015-07-09 Han Shen <shenhan@google.com>
462 Use "gold_info" instead of "gold_warning" for erratum fix.
464 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
466 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
468 2015-07-09 Han Shen <shenhan@google.com>
470 Drop missing symbol warning for arm/aarch64.
472 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
473 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
476 2015-07-07 Han Shen <shenhan@google.com>
478 Make gold aarch64 accept long form of mapping symbols.
480 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
483 2015-06-29 Doug Kwan <dougkwan@google.com>
485 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
486 at address expected by test.
487 * testsuite/arm_cortex_a8_b.s: Ditto.
488 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
489 * testsuite/arm_cortex_a8_bl.s: Ditto.
490 * testsuite/arm_cortex_a8_blx.s: Ditto.
491 * testsuite/arm_cortex_a8_local.s: Ditto.
492 * testsuite/arm_fix_v4bx.s: Ditto.
493 * testsuite/arm_unaligned_reloc.s: Ditto.
494 * testsuite/thumb_bl_out_of_range.s: Ditto.
495 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
496 * testsuite/thumb_blx_out_of_range.s: Ditto.
498 2015-06-29 Han Shen <shenhan@google.com>
500 Patch for erratum 843419 internal error.
502 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
503 (Erratum_stub::update_erratum_insn): New method.
504 (Stub_table::relocate_stubs): Modified to place relocated insn.
505 (AArch64_relobj::fix_errata): Modified gold_assert.
507 2015-06-12 Han Shen <shenhan@google.com>
511 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
512 defintion outside class definition.
513 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
514 (AArch64_insn_utilities::aarch64_op31): New member.
515 (AArch64_insn_utilities::aarch64_ra): New member.
516 (AArch64_insn_utilities::aarch64_mac): New member.
517 (AArch64_insn_utilities::aarch64_mlxl): New member.
518 (ST_E_835769): New global enum member.
519 (Stub_table::relocate_stubs): Add 835769 handler.
520 (Stub_template_repertoire::Stub_template_repertoire): Install new
522 (AArch64_relobj::scan_errata): This func is renamed from
524 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
525 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
526 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
527 (Target_aarch64::scan_erratum_835769_span): New method.
528 (Target_aarch64::create_erratum_stub): New method.
529 (Target_aarch64::is_erratum_835769_sequence): New method.
530 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
531 code into create_erratum_stub.
532 * options.h (fix_cortex_a53_835769): New option.
534 2015-06-11 Cary Coutant <ccoutant@gmail.com>
536 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
538 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
540 2015-06-11 Cary Coutant <ccoutant@gmail.com>
543 * layout.cc (corresponding_uncompressed_section_name): New function.
544 (Layout::choose_output_section): Call it.
545 * layout.h (corresponding_uncompressed_section_name): New function.
546 * script-sections.cc (Input_section_info::set_section_name): Check
547 for compressed debug section (.zdebug style).
549 2015-06-11 Jing Yu <jingyu@google.com>
551 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
552 * testsuite/Makefile.in: Regenerate.
554 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
556 * gold.h (is_cident): Correct typo.
558 2015-06-10 Han Shen <shenhan@google.com>
559 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
561 Now fixing for 843419 is fully functional.
563 The first part of the erratum fix CL is here -
564 https://sourceware.org/ml/binutils/2015-04/msg00229.html
566 * aarch64.cc(global enum): New constants representing stub types.
567 (Stub_template): New POD struct.
568 (Stub_template_repertoire): New class.
569 (Stub_base): New class.
570 (Erratum_stub): New class.
571 (Reloc_stub): Refactored to be a subclass of Stub_base.
572 (Reloc_stub::Stub_type): Removed.
573 (Reloc_stub::offset): Moved to Stub_base.
574 (Reloc_stub::set_offset): Moved to Stub_base.
575 (Reloc_stub::destination_address): Moved to Stub_base.
576 (Reloc_stub::set_destination_address): Moved to Stub_base.
577 (Reloc_stub::reset_destination_address): Moved to Stub_base.
578 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
579 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
580 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
581 (Reloc_stub::write): Moved to Stub_base.
582 (Reloc_stub::invalid_offset): Moved to Stub_base.
583 (Reloc_stub::invalid_address): Moved to Stub_base.
584 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
585 (Reloc_stub::stub_insns_): Moved to Stub_base.
586 (Reloc_stub::offset_): Moved to Stub_base.
587 (Reloc_stub::destination_address_): Moved to Stub_base.
588 (Stub_table::The_aarch64_relobj): New typedef.
589 (Stub_table::The_erratum_stub): New typedef.
590 (Stub_table::The_erratum_stub_less): New typedef.
591 (Stub_table::The_erratum_stub_set): New typedef.
592 (Stub_table::The_erratum_stub_set_iter): New typedef.
593 (Stub_table::empty): Added emptiness testing for erratum stubs.
594 (Stub_table::add_erratum_stub): New method to add an erratum stub.
595 (Stub_table::find_erratum_stub): New method.
596 (Stub_table::find_erratum_stubs_for_input_section): New method.
597 (Stub_table::erratum_stub_address): New method.
598 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
599 (Stub_table::do_addralign): Modified to handle erratum stubs.
600 (Stub_table::erratum_stubs_): New member.
601 (Stub_table::erratum_stub_size_): New member.
602 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
603 (Stub_table::do_write): Modified to handle erratum stubs.
604 (AArch64_relobj::The_erratum_stub): New typedef.
605 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
606 (AArch64_relobj::fix_errata): New method.
607 (Target_aarch64::The_reloc_stub_type): Removed.
608 (Target_aarch64::The_erratum_stub): New typede.
609 (AArch64_relocate_functions::construct_b): New method.
611 2015-06-08 Nick Clifton <nickc@redhat.com>
613 * po/fr.po: New French Translation.
615 2015-06-07 Cary Coutant <ccoutant@gmail.com>
618 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
619 callers. Don't use STT_COMMON to check for common symbols.
620 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
621 symbol that's not in a common section.
622 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
625 2015-06-04 Cary Coutant <ccoutant@gmail.com>
628 * Makefile.am (diststuff): Add target.
629 * Makefile.in: Regenerate.
631 2015-06-04 Cary Coutant <ccoutant@gmail.com>
634 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
635 temporary locals in merge sections.
636 * options.cc (General_options::parse_discard_all): New method.
637 (General_options::parse_discard_locals): New method.
638 (General_options::parse_discard_none): New method.
639 (General_options::General_options): Initialize discard_locals_.
640 * options.h (--discard-all): Convert to special option.
641 (--discard-locals): Likewise.
642 (--discard-none): New option.
643 (General_options::discard_all): New method.
644 (General_options::discard_locals): New method.
645 (General_options::discard_sec_merge): New method.
646 (General_options::Discard_locals): New enum.
647 (General_options::discard_locals_): New data member.
649 2015-06-03 Cary Coutant <cary@google.com>
651 * script-sections.cc (Script_sections::Script_sections): Initialize
653 (Script_sections::create_note_and_tls_segments): Set flag when
654 segments are created.
655 (Script_sections::expected_segment_count): Count PT_INTERP.
656 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
657 segments are created.
658 * script-sections.h (Script_sections::segments_created_): New data
661 2015-06-03 Cary Coutant <ccoutant@gmail.com>
665 (Output_section_element_input::set_section_addresses): When there
666 are several patterns with no sort spec, put all sections in the same
668 * testsuite/Makefile.am (script_test_12): New testcase.
669 (script_test_12i): New testcase.
670 * testsuite/Makefile.in: Regenerate.
671 * testsuite/script_test_12.t: New test linker script.
672 * testsuite/script_test_12i.t: New test linker script.
673 * testsuite/script_test_12a.c: New test source file.
674 * testsuite/script_test_12b.c: New test source file.
676 2015-06-02 Cary Coutant <ccoutant@gmail.com>
678 * nacl.h (Sniff_file): Switch parameters to get_view to get an
681 2015-06-03 Cary Coutant <ccoutant@gmail.com>
684 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
685 separate task to schedule the build id computation.
686 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
687 add Output_file and offset.
688 (Hash_task::run): Get and release the input views.
689 (Hash_task::is_runnable): Always return NULL (always runnable).
690 (Layout::queue_build_id_tasks): Remove.
691 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
692 parameters; use them instead of class members.
693 (Build_id_task_runner::run): New function.
694 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
696 * layout.h (Layout::queue_build_id_tasks): Remove.
697 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
699 (Layout::array_of_hashes_): Remove.
700 (Layout::size_of_array_of_hashes_): Remove.
701 (Layout::input_view_): Remove.
702 (Build_id_task_runner): New class.
703 (Close_task_runner::Close_task_runner): Add array_of_hashes and
704 size_of_hashes parameters.
705 (Close_task_runner::array_of_hashes_): New data member.
706 (Close_task_runner::size_of_hashes_): New data member.
707 * testsuite/Makefile.am
708 (flagstest_compress_debug_sections_and_build_id_tree): New test.
709 * testsuite/Makefile.in: Regenerate.
711 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
713 * merge.cc (get_input_merge_map): Update for data structure change.
714 (get_or_make_input_merge_map): Update for data structure change.
715 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
716 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
718 2015-05-16 Alan Modra <amodra@gmail.com>
720 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
721 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
722 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
723 (lis_0): Rename from lis_0_0.
725 2015-04-29 Cary Coutant <cary@google.com>
726 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
728 * gc.h (Garbage_collection::is_section_garbage): Change Object*
730 (Garbage_collection::add_reference): Likewise.
731 (Garbage_collection::gc_process_relocs): Likewise. Don't push
732 object/shndx pair onto *secvec for dynamic objects. Don't follow
733 relocations pointing to dynamic objects for GC.
734 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
735 (Icf::unfold_section): Likewise.
736 (Icf::is_section_folded): Likewise.
737 (Icf::get_folded_section): Likewise.
738 * icf.h: (Icf::get_folded_section): Likewise.
739 (Icf::unfold_section): Likewise.
740 (Icf::is_section_folded): Likewise.
741 (Icf::section_has_function_pointers): Likewise.
742 (Icf::set_section_has_function_pointers): Likewise.
743 * object.h (Section_id): Likewise.
744 (Const_section_id): Likewise.
745 * output.cc (Output_section::update_section_layout): Likewise.
746 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
748 * plugin.cc (update_section_order): Likewise.
749 (unique_segment_for_sections): Likewise.
750 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
751 (Target_powerpc::do_gc_add_reference): Likewise.
752 (Target_powerpc::gc_process_relocs): Likewise.
753 (Target_powerpc::do_gc_add_reference): Likewise.
754 * symtab.cc (Symbol_table::is_section_folded): Likewise.
755 (Symbol_table::gc_mark_symbol): Likewise.
756 * symtab.h: (Symbol_table::is_section_folded): Likewise.
757 * target.h: (Sized_target::gc_add_reference): Likewise.
758 (Sized_target::do_gc_add_reference): Likewise.
760 2015-04-29 Nick Clifton <nickc@redhat.com>
762 * po/fi.po: Updated Finnish translation.
764 2015-04-28 Alan Modra <amodra@gmail.com>
766 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
767 than unsigned int for find_global_entry result temp. Compare
768 against invalid_address.
769 (Target_powerpc::do_plt_address_for_global): Likewise.
770 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
771 on plt call stub existence for debug info. Do assert for plt
772 and global entry stub existence if an alloc section.
774 2015-04-28 Alan Modra <amodra@gmail.com>
776 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
777 on missing global entry stub due to bogus debug info.
779 2015-04-27 Han Shen <shenhan@google.com>
781 * options.h (--fix-cortex-a53-843419): Rename option.
782 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
784 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
786 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
789 * output.cc (Output_section::is_input_address_mapped): Assume a missing
791 * testsuite/Makefile.am: Add the eh_test test.
792 * testsuite/Makefile.in: Regenerate.
793 * testsuite/eh_test_a.cc: New test.
794 * testsuite/eh_test_b.cc: New test.
796 2015-04-23 Sriraman Tallam <tmsriram@google.com>
798 * options.h (--weak-unresolved-symbols): New option.
799 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
800 binding to weak with new option.
801 * symtab.h (is_weak_undefined): Check for new option.
802 (is_strong_undefined): Check for new option.
803 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
804 * testsuite/Makefile.in: Regenerate.
805 * testsuite/weak_unresolved_symbols_test.cc: New file.
807 2015-04-20 Ian Coolidge <icoolidge@google.com>
809 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
812 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
814 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
816 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
817 * object.cc (Sized_relobj_file::do_layout): Use push_back.
818 * powerpc.cc (process_gc_mark): Use push_back.
819 (Target_powerpc::do_gc_mark_symbol): Use push_back.
820 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
822 2015-04-16 Han Shen <shenhan@google.com>
824 * aarch64.cc (AArch64_insn_utilities): New utility class.
825 (AArch64_relobj::Mapping_symbol_position): New struct.
826 (AArch64_relobj::Mapping_symbol_info): New typedef.
827 (AArch64_relobj::do_count_local_symbols): New function overriding
828 parent's implementation.
829 (AArch64_relobj::mapping_symbol_info_): New member
830 (AArch64_relobj::scan_erratum_843419): New method.
831 (Target_aarch64::scan_erratum_843419_span): New method.
832 (Target_aarch64::is_erratum_843419_sequence): New method.
833 * options.h (fix_cortex_a53): New option.
835 2015-04-09 Cary Coutant <ccoutant@google.com>
837 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
839 * testsuite/Makefile.am (tls_pie_test.sh): New test.
840 * testsuite/Makefile.in: Regenerate.
841 * testsuite/tls_pie_test.sh: New.
843 2015-04-09 Cary Coutant <ccoutant@google.com>
845 * debug.h (DEBUG_LOCATION): New.
846 (DEBUG_ALL): Include DEBUG_LOCATION.
847 (debug_string_to_enum): Add DEBUG_LOCATION.
848 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
849 output to print correct context.
850 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
851 up to 4 more locations at the beginning of the function.
852 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
853 result before sorting list of line numbers.
854 * testsuite/debug_msg.sh: Allow range of line numbers for
855 canonical results on optimized code.
857 2015-04-07 HC Yen <hc.yen@mediatek.com>
859 Add AArch32 support for gold linker.
861 * arm.cc: Add V8 arch combine table.
863 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
865 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
867 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
869 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
870 to find by using the return value of insert.
872 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
874 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
877 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
880 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
881 (Target_x86_64::Scan::local): Don't create GOT entry, when we
882 can convert mov to lea.
883 (Target_x86_64::Scan::global): Ditto.
884 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
885 %reg to lea foo(%rip), %reg if possible.
886 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
887 * testsuite/x86_64_mov_to_lea1.s: New.
888 * testsuite/x86_64_mov_to_lea2.s: Ditto.
889 * testsuite/x86_64_mov_to_lea3.s: Ditto.
890 * testsuite/x86_64_mov_to_lea4.s: Ditto.
891 * testsuite/x86_64_mov_to_lea.sh: Ditto.
893 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
895 * configure: Regenerated.
897 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
900 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
901 (Target_i386::Scan::local): Don't create GOT entry, when we
902 can convert GOT to GOTOFF.
903 (Target_i386::Scan::global): Ditto.
904 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
905 lea foo@GOTOFF(%reg), %reg if possible.
906 * testsuite/Makefile.am (i386_mov_to_lea): New test.
907 * testsuite/i386_mov_to_lea1.s: New.
908 * testsuite/i386_mov_to_lea2.s: Ditto.
909 * testsuite/i386_mov_to_lea3.s: Ditto.
910 * testsuite/i386_mov_to_lea4.s: Ditto.
911 * testsuite/i386_mov_to_lea5.s: Ditto.
912 * testsuite/i386_mov_to_lea.sh: Ditto.
914 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
916 * Makefile.am (ZLIB): New.
918 (AM_CFLAGS): Add $(ZLIBINC).
919 (AM_CXXFLAGS): Likewise.
920 (ldadd_varldadd_var): Add $(ZLIB).
921 (incremental_dump_LDADD): Likewise.
922 (dwp_LDADD): Likewise.
923 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
925 (zlib_compress): Don't check HAVE_ZLIB_H.
926 (zlib_decompress): Likewise.
927 * options.h (compress_debug_sections): Likewise.
928 * configure.ac (AM_CONDITIONAL): Removed.
929 * testsuite/Makefile.am (ZLIB): New.
930 (LDADD): Add $(ZLIB).
931 Don't check HAVE_ZLIB.
932 * Makefile.in: Regenerated.
933 * config.in: Likewise.
934 * configure: Likewise.
935 * testsuite/Makefile.in: Likewise.
937 2015-03-30 Jing Yu <jingyu@google.com>
939 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
940 TLSLD_ADD_DTPREL_LO12_NC.
941 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
942 _TLS_MODULE_BASE_ point to the start of tls segment.
943 (Target_aarch64::optimize_tls_reloc): Add cases for
944 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
945 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
946 (Target_aarch64::Scan::local): Likewise.
947 (Target_aarch64::Scan::global): Likewise.
948 (Target_aarch64::Relocate::relocate): Likewise.
949 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
950 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
953 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
955 * merge.cc (Object_merge_map::add_mapping): call
956 Object_merge_map::Input_merge_map::add_mapping.
957 (Object_merge_map::Input_merge_map::add_mapping): New.
958 (Output_merge_data::do_add_input_section): Call
959 get_or_make_input_merge_map before a loop.
960 (Output_merge_string<Char_type>::finalize_merged_data): Call
961 get_or_make_input_merge_map before a loop.
962 * merge.h (Object_merge_map): Make Input_merge_map public.
963 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
964 (Relobj::get_or_create_merge_map): New.
965 * object.h (Relobj::get_or_create_merge_map): New.
967 2015-03-24 Alan Modra <amodra@gmail.com>
970 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
971 relocation errors for branches to strong undefined symbols.
973 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
975 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
976 (Object_merge_map::is_merge_section_for): Remove.
977 (Object_merge_map::find_merge_section): New.
978 * merge.h (Object_merge_map::is_merge_section_for): Remove.
979 (Object_merge_map::find_merge_section): New.
980 (Object_merge_map::get_input_merge_map): Add a const version.
981 * object.cc (Relobj::is_merge_section_for): Remove.
982 (Relobj::find_merge_section): New.
983 * object.h (Relobj::is_merge_section_for): Remove.
984 (Relobj::find_merge_section): New.
986 (Output_section::Input_section::is_merge_section_for): Remove.
987 (Output_section::add_merge_input_section): Don't call
988 add_merge_input_section.
989 (Output_section::find_merge_section): Return const. Use
990 object->find_merge_section.
991 (Output_section::build_lookup_maps): Don't build a map for
993 (Output_section::is_input_address_mapped): Return false if
994 section is not found.
995 (Output_section::find_starting_output_address): Use
996 find_merge_section instead of is_merge_section_for.
997 (Output_section::add_script_input_section): Don't build a map for
999 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1000 (Output_section_lookup_maps::find_merge_section): Remove.
1001 (Output_section_lookup_maps::add_merge_input_section) Remove.
1002 (Output_section::find_merge_section): Return const.
1004 2015-03-22 Cary Coutant <cary@google.com>
1007 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1008 non-SIB form of lea, with nop after the call.
1010 2015-03-21 Cary Coutant <cary@google.com>
1013 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1015 (Output_segment::set_section_addresses): Don't align size of relro
1018 2015-03-21 Cary Coutant <cary@google.com>
1021 * stringpool.cc (Stringpool_template): Don't optimize if section
1022 alignment is greater than sizeof(char).
1024 2015-03-21 Cary Coutant <cary@google.com>
1027 * script-c.h (script_include_directive): Add first_token parameter.
1028 * script.cc (script_include_directive): Add first_token parameter, and
1029 pass it to read_script_file.
1030 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1031 (PARSING_MEMORY_DEF): New tokens.
1032 (top): Add new productions for INCLUDE files.
1033 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1034 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1035 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1036 (section_cmd): Pass PARSING_SECTION_CMDS.
1037 (file_or_sections_cmd): Remove.
1038 (memory_def): Pass PARSING_MEMORY_DEF.
1039 * testsuite/Makefile.am (memory_test_2): New test.
1040 * testsuite/Makefile.in: Regenerate.
1041 * testsuite/memory_test_inc.t: New script file.
1042 * testsuite/memory_test_inc_1.t.src: New script file.
1043 * testsuite/memory_test_inc_2.t.src: New script file.
1044 * testsuite/memory_test_inc_3.t.src: New script file.
1046 2015-03-21 Cary Coutant <cary@google.com>
1048 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1049 (Sized_relobj_dwo::setup): Build compressed section map.
1050 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1051 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1053 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1054 compressed_sections_ field.
1055 (build_compressed_section_map): Take Object instead of
1056 Sized_relobj_file parameter; add decompress_if_needed parameter.
1057 (Sized_relobj_file::do_find_special_sections): Store compressed
1058 section map in parent Object.
1059 (Sized_relobj_file::do_decompressed_section_contents): Move
1060 implementation to Object::decompressed_section_contents.
1061 (Sized_relobj_file::do_discard_decompressed_sections): Move
1062 implementation to Object::discard_decompressed_sections.
1063 * object.h (build_compressed_section_map): Declare.
1064 (Object::Object): Add compressed_sections_ field.
1065 (Object::section_is_compressed): Move implementation here.
1066 (Object::decompressed_section_contents): De-virtualize.
1067 (Object::discard_decompressed_sections): De-virtualize.
1068 (Object::do_section_is_compressed): Delete.
1069 (Object::do_decompressed_section_contents): Delete.
1070 (Object::set_compressed_sections): New method.
1071 (Object::compressed_sections): New method.
1072 (Object::compressed_sections_): New data member.
1073 (Compressed_section_info, Compressed_section_map): Move to top of file.
1074 (Sized_relobj_file::do_section_is_compressed): Delete.
1075 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1076 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1077 (Sized_relobj_file::compressed_sections_): Move to Object class.
1079 2015-03-21 Cary Coutant <ccoutant@google.com>
1082 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1085 2015-03-11 Cary Coutant <ccoutant@google.com>
1087 * options.cc (General_options::finalize): Don't allow -z relro
1088 with incremental linking.
1089 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1090 (incremental_test_2): Likewise.
1091 (incremental_test_3): Likewise.
1092 (incremental_test_4): Likewise.
1093 (incremental_test_5): Likewise.
1094 (incremental_test_6): Likewise.
1095 (incremental_copy_test): Likewise.
1096 (incremental_common_test_1): Likewise.
1097 (incremental_comdat_test_1): Likewise.
1098 * testsuite/Makefile.in: Regenerate.
1100 2015-03-09 Cary Coutant <ccoutant@google.com>
1103 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1104 return enum indicating whether .eh_frame section is empty, optimizable,
1105 unrecognized, or an end marker. Adjust explicit instantiations.
1106 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1107 (Eh_frame::add_ehframe_input_section): Change return type.
1108 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1109 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1110 to the .eh_frame output section until we see the end marker.
1111 (Layout::finalize_eh_frame_section): New.
1112 * layout.h: (Layout::finalize_eh_frame_section): New.
1114 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1116 * output.cc (Relobj::initialize_input_to_output_map<size>):
1117 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1119 2015-03-04 Cary Coutant <ccoutant@google.com>
1121 * parameters.cc (Parameters::set_target_once): Call
1122 Target::select_as_default_target just once from here...
1123 (set_parameters_target): ...instead of from here.
1125 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1127 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1128 Output_section_data instead of a Merge_map.
1129 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1130 (Eh_frame::read_cie): Use add_merge_mapping instead of
1131 Merge_map::add_mapping.
1132 (Eh_frame::read_fde): Ditto.
1133 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1134 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1135 merge_map_->get_output_offset.
1136 (Eh_frame::do_is_merge_section_for): Delete.
1137 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1138 instead of a Merge_map.
1139 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1141 (Eh_frame::do_is_merge_section_for): Delete.
1142 (Eh_frame::merge_map_): Delete.
1143 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1144 and use a Output_section_data instead of a Merge_map.
1145 (Object_merge_map::add_mapping): Ditto.
1146 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1147 (Object_merge_map::is_merge_section_for): Pass in and use a
1148 Output_section_data instead of a Merge_map.
1149 (Merge_map): Delete.
1150 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1151 of merge_map_.get_output_offset.
1152 (Output_merge_base::do_is_merge_section_for): Delete.
1153 (Output_merge_data::do_add_input_section): Use
1154 object->add_merge_mapping instead of add_mapping.
1155 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1156 * merge.h (Merge_map): Delete forward declaration.
1157 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1158 instead of a Merge_map.
1159 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1160 (Object_merge_map::is_merge_section_for): Pass in and use a
1161 Output_section_data instead of a Merge_map.
1162 (Input_merge_map::Object_merge_map::merge_map): Replace with
1164 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1165 Output_section_data instead of a Merge_map.
1166 (Merge_map): Delete.
1167 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1168 (Output_merge_base::do_is_merge_section_for): Delete.
1169 (Output_merge_base::add_mapping): Delete.
1170 (Output_merge_base::merge_map_): Delete.
1171 * object.cc (Relobj::initialize_input_to_output_map): New.
1172 (Relobj::initialize_input_to_output_map): New.
1173 (Relobj::merge_output_offset): New.
1174 (Relobj::is_merge_section_for): New.
1175 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1177 * object.h (Relobj::merge_map): Delete.
1178 (initialize_input_to_output_map): New.
1179 (set_merge_map): Delete.
1180 (add_merge_mapping): New.
1181 (merge_output_offset): New.
1182 (is_merge_section_for): New.
1183 * output.cc (Output_section::Input_section::is_merge_section_for):
1184 Use object->is_merge_section_for.
1185 * output.h (Output_section_data::is_merge_section_for): Delete.
1186 (Output_section_data::do_is_merge_section_for): Delete.
1187 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1188 Use object->initialize_input_to_output_map.
1189 (Merged_symbol_value<size>::value_from_output_section): Use
1190 object->merge_output_offset.
1192 2015-03-02 Peter Collingbourne <pcc@google.com>
1193 Cary Coutant <ccoutant@google.com>
1195 * output.cc (Output_section::add_merge_input_section): Do not
1196 attempt to merge sections with an entsize of 0.
1198 2015-03-02 Khem Raj <raj.khem@gmail.com>
1200 * attributes.h (class Output_attributes_section_data ): Add
1201 do_print_to_mapfile function.
1203 2015-02-24 Alan Modra <amodra@gmail.com>
1206 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1207 complain if value is not a multiple of four.
1208 (Target_powerpc::Relocate::relocate): Correct handling of
1209 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1211 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1213 * configure.ac (default_size): Set to 32 for x32.
1214 * configure: Regenerated.
1216 2015-02-18 Alan Modra <amodra@gmail.com>
1219 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1222 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1224 * gc.h (Garbage_collection::add_reference): Don't use find.
1226 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1228 * object.cc (write_local_symbols): avoid std::vector copy.
1230 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1232 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1234 2015-02-09 Mark Wielaard <mjw@redhat.com>
1236 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1237 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1239 2015-02-16 Cary Coutant <ccoutant@google.com>
1243 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1244 DF_SYMBOLIC if --dynamic-list option is used.
1245 * options.cc (General_options::finalize): --dynamic-list is not
1246 mutually exclusive with -Bsymbolic.
1247 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1248 listed in --dynamic-list.
1249 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1250 -Bsymbolic-functions.
1251 * testsuite/Makefile.in: Regenerate.
1253 2015-02-16 Cary Coutant <ccoutant@google.com>
1256 * incremental.cc: Remove redundant include of "output.h".
1258 2015-02-12 Jing Yu <jingyu@google.com>
1260 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1261 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1263 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1264 TLSLE_MOVW_* relocations.
1265 (Target_aarch64::Scan::global): Likewise.
1266 (Target_aarch64::Relocate::relocate): Likewise.
1267 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1268 for new TLSLE_MOVW_* relocations.
1270 2015-02-11 Will Newton <will.newton@linaro.org>
1273 * arm.cc (Target_arm::make_plt_section): Create an ARM
1274 state mapping symbol at the start of the PLT.
1276 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1278 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1279 Replace two_file_shared_2.so with two_file_shared_1.so.
1280 * testsuite/Makefile.in: Regenerated.
1282 2015-02-09 Alan Modra <amodra@gmail.com>
1284 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1285 plugin_test_thin.a and defsym_test.
1286 * testsuite/Makefile.in: Regenerate.
1288 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1290 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1293 2015-02-04 Peter Collingbourne <pcc@google.com>
1295 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1296 forwarding symbols when computing symbol resolution info for plugins.
1297 * plugin.h (Plugin_manager::symtab): New method.
1298 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1300 2015-02-03 Cary Coutant <ccoutant@google.com>
1301 Peter Collingbourne <pcc@google.com>
1304 * archive.cc (Thin_archive_object_unlocker): New class.
1305 (Archive::include_member): Unlock external members of thin archives.
1306 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1307 (plugin_test_2): Likewise.
1308 (plugin_test_3): Likewise.
1309 (plugin_test_4): Likewise.
1310 (plugin_test_5): Likewise.
1311 (plugin_test_6): Likewise.
1312 (plugin_test_7): Likewise.
1313 (plugin_test_8): Likewise.
1314 (plugin_test_9): Likewise.
1315 (plugin_test_10): Likewise.
1316 (plugin_test_11): New test case.
1317 * testsuite/Makefile.in: Regenerate.
1318 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1319 file to decide whether to claim file.
1320 (all_symbols_read_hook): Likewise.
1321 * testsuite/plugin_test_1.sh: Adjust expected output.
1322 * testsuite/plugin_test_2.sh: Likewise.
1323 * testsuite/plugin_test_3.sh: Likewise.
1324 * testsuite/plugin_test_6.sh: Likewise.
1325 * testsuite/plugin_test_tls.sh: Likewise.
1326 * testsuite/plugin_test_11.sh: New testcase.
1328 2015-02-03 Cary Coutant <ccoutant@google.com>
1330 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1331 file descriptors when debugging enabled. Add debug output.
1332 (Descriptors::release): Add debug output.
1333 (Descriptors::close_some_descriptor): Likewise.
1334 (Descriptors::close_all): Likewise.
1335 * fileread.cc (File_read::lock): Likewise.
1336 (File_read::unlock): Likewise.
1338 2015-02-02 Cary Coutant <ccoutant@google.com>
1340 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1341 executable output file.
1343 2015-01-22 Han Shen <shenhan@google.com>
1345 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1346 (Target_arm::do_plt_address_for_global): New method.
1347 (Target_arm::do_plt_address_for_local): New method.
1348 (Target_arm::rel_irelative_section): New method.
1349 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1350 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1351 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1352 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1353 (Target_arm::Scan::check_non_pic): Add ifunc support.
1354 (Target_arm::Scan::local): Add ifunc support.
1355 (Target_arm::Scan::global): Add ifunc support.
1356 (Target_arm::make_plt_section): New method.
1357 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1358 (Target_arm::make_local_ifunc_plt_entry): New method.
1359 (Target_arm::got_irelative_): New member.
1360 (Target_arm::rel_irelative_): New member.
1361 (Target_arm::got_section): Add creation for got_irelative_.
1362 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1363 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1364 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1365 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1366 (Output_data_plt_arm::IRelative_data): New type.
1367 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1368 (Output_data_plt_arm::add_entry): Add more parameters.
1369 (Output_data_plt_arm::add_relocation): New method.
1370 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1371 (Output_data_plt_arm::rel_irelative): New method.
1372 (Output_data_plt_arm::entry_count): Modified.
1373 (Output_data_plt_arm::address_for_global): New method.
1374 (Output_data_plt_arm::address_for_local): New method.
1376 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1377 (Output_data_plt_arm::insert_irelative_data): New method.
1378 (Output_data_plt_arm::irelative_rel_): New member.
1379 (Output_data_plt_arm::got_): New member.
1380 (Output_data_plt_arm::got_irelative_): New member.
1381 (Output_data_plt_arm::irelative_count_): New member.
1382 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1383 (Output_data_plt_arm::irelative_data_vec_): New member.
1384 (Output_data_plt_arm::do_write): Write out irelative entries.
1385 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1386 more parameters to ctor.
1387 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1388 more parameters to ctor.
1389 * output.h (Output_data_reloc::add_local_relative): New method.
1390 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1392 2015-01-29 Alan Modra <amodra@gmail.com>
1394 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1395 and GOT_TLSGD to LE optimization.
1397 2015-01-28 Cary Coutant <ccoutant@google.com>
1399 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1400 for undef TLS symbols.
1401 (Target_x86_64::Relocate::relocate_tls): Likewise.
1402 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1404 2015-01-25 Cary Coutant <ccoutant@google.com>
1406 * output.cc (Output_segment::set_section_addresses): Fix calculation
1407 of size of relro segment.
1409 2015-01-22 Alan Modra <amodra@gmail.com>
1411 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1412 condition for need of ifunc plt entry.
1413 (Target_powerpc::Scan::global <got relocs>): Likewise.
1415 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1417 * mips.cc (reloc_high): Add r_sym.
1418 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1419 reloc_high constructor.
1420 (Mips_relocate_functions::relgot16_local): Likewise.
1421 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1422 r_type to decide whether LO16 matches HI16.
1423 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1424 rello16 and relgot16_local.
1426 2015-01-09 Cary Coutant <ccoutant@google.com>
1428 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1429 unless alignment is larger than page size.
1431 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1432 Cary Coutant <ccoutant@google.com>
1435 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1436 (DEFAULT_TARGET_X32): Set for x32.
1437 * x86_64.cc (cmp_insn_32): New.
1438 (lea_r10_insn_32): Likewise.
1439 (lea_r11_insn_32): Likewise.
1440 (cmp_insn_64): Likewise.
1441 (lea_r10_insn_64): Likewise.
1442 (lea_r11_insn_64): Likewise.
1443 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1444 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1445 (check_DATA): Add split_x32 files.
1446 (split_x32_[1234n].o): New targets.
1447 (split_x32_[124]): New targets.
1448 (split_x32_[1234r].stdout): New targets.
1449 * testsuite/split_x32.sh: New file.
1450 * testsuite/split_x32_1.s: Likewise.
1451 * testsuite/split_x32_2.s: Likewise.
1452 * testsuite/split_x32_3.s: Likewise.
1453 * testsuite/split_x32_4.s: Likewise.
1454 * testsuite/split_x32_n.s: Likewise.
1455 * configure: Regenerated.
1456 * testsuite/Makefile.in: Likewise.
1458 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1461 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1464 2015-01-02 Alan Modra <amodra@gmail.com>
1466 * version.cc (print_version): Just print current year.
1467 * dwp.cc (print_version): Likewise.
1469 2015-01-01 Alan Modra <amodra@gmail.com>
1471 Update year range in copyright notice of all files.
1473 2014-12-25 Alan Modra <amodra@gmail.com>
1475 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1477 (Target_arm::merge_object_attributes, ): Likewise.
1479 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1481 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1482 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1483 AEABI_VFP_args_vfp to check that.
1484 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1485 value and replace hardcoded values by enum values.
1487 2014-12-22 Cary Coutant <ccoutant@google.com>
1489 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1491 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1494 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1495 to "return i * i * 3;".
1497 2014-12-16 Cary Coutant <ccoutant@google.com>
1499 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1500 (Mapfile::print_output_data): Use current_data_size() to avoid
1501 assert for sections requiring postprocessing; if address is not valid,
1503 (Mapfile::print_output_section): Use current_data_size(); print note
1504 that addresses and sizes are before compression.
1506 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1508 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1509 Cast current_group_size to unsigned long when reporting error.
1511 2014-12-10 Jing Yu <jingyu@google.com>
1513 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1514 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1515 Update error message.
1516 (Target_aarch64::do_relax): Use absolute value of option
1517 stub_group_size. Replace local variable with class member
1520 2014-12-04 Alan Modra <amodra@gmail.com>
1522 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1523 addend of PLTREL24 reloc when not generating a plt stub. Make
1524 max_branch_offset an "Address".
1525 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1526 (Target_powerpc::Relocate::relocate): Likewise.
1528 2014-12-04 Alan Modra <amodra@gmail.com>
1531 * symtab.cc (Symbol::set_undefined): Remove assertion.
1532 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1533 on symbols defined in discarded sections, instead return false.
1534 Rearrange params, update all callers.
1535 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1536 branches to syms in discarded sections.
1537 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1538 undefined and flag as discarded.
1539 (Target_powerpc::Relocate::relocate): Localize variable.
1541 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1544 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1545 * testsuite/Makefile.in: Regenerated.
1547 2014-12-03 Alan Modra <amodra@gmail.com>
1550 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1551 when adding dynamic relocations against section symbols.
1553 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1555 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1556 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1557 * options.h (General_options): New -z option (global).
1559 2014-12-01 Cary Coutant <ccoutant@google.com>
1562 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1564 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1565 given but some inputs require executable stack.
1567 2014-11-26 Cary Coutant <ccoutant@google.com>
1569 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1570 .debug_str_offsets; strip .debug_gnu_pubnames and
1571 .debug_gnu_pubtypes.
1572 (lines_only_debug_sections): Strip all four new sections.
1574 2014-11-26 Jing Yu <jingyu@google.com>
1576 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1577 register to be x0 when to relax TLSDESC_LD64_LO12.
1579 2014-11-26 Alan Modra <amodra@gmail.com>
1581 * powerpc.cc (struct Stub_table_owner): New.
1582 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1583 unsigned int vector. Update all references.
1584 (powerpc_relobj::set_stub_table): Take an unsigned int param
1585 rather than a Stub_table. Update callers.
1586 (Powerpc_relobj::clear_stub_table): New function.
1587 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1588 stub_group_size_ vars.
1589 (Target_powerpc::new_stub_table): Delete.
1590 (max_branch_delta): New function, extracted from..
1591 (Target_powerpc::Relocate::relocate): ..here..
1592 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1593 status on whether stub created successfully.
1594 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1596 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1597 reduce on relax failure.
1598 (Target_powerpc::group_sections): Add "no_size_errors" param.
1599 Use stub_group_size_. Set up group info in a temp vector,
1600 before building Stub_table vector. Account for input sections
1601 possibly already converted to relaxed sections.
1602 (Stub_table::init): Delete. Merge into..
1603 (Stub_table::Stub_table): ..here.
1604 (Stub_table::can_reach_stub): New function.
1605 (Stub_table::add_plt_call_entry): Add "from" parameter and
1606 return true iff stub could be reached.
1607 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1609 (Stub_table::clear_stubs): Add "all" param.
1611 2014-11-26 Alan Modra <amodra@gmail.com>
1613 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1614 (Target_powerpc::group_sections): Use it.
1616 2014-11-25 Cary Coutant <ccoutant@google.com>
1618 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1619 (Binary_to_elf::write_symbol): Add st_size parameter.
1620 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1622 2014-11-25 Cary Coutant <ccoutant@google.com>
1625 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1626 (Sized_relobj_file::do_layout): Handle deferred sections properly
1627 during GC pass 1. Don't add reloc sections to deferred list twice.
1628 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1629 (Sized_relobj_file::is_deferred_layout_): New data member.
1631 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1634 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1635 Check PC-relative offset overflow in PLT entry.
1637 2014-11-21 Alan Modra <amodra@gmail.com>
1639 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1640 for undefined weaks.
1642 2014-11-20 Alan Modra <amodra@gmail.com>
1644 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1645 from --stub-group-size parameter divided by 1024.
1646 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1647 template parameter. Update all uses.
1648 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1649 has_stub_value. Set for long branches. Don't report overflow for
1650 branch to undefined weak symbols. Print info message on
1651 overflowing branch to stub.
1653 2014-11-20 Alan Modra <amodra@gmail.com>
1655 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1657 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1659 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1660 entry for R_X86_64_GOTPLT64.
1661 (Target_x86_64<size>::Relocate::relocate): Update comments for
1664 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1666 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1667 * plugin.h: add lock definition
1669 2014-10-29 Han Shen <shenhan@google.com>
1670 Jing Yu <jingyu@google.com>
1672 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1673 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1674 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1676 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1678 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1679 (Target_aarch64::tls_ld_to_le): New method.
1680 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1682 (Output_data_plt_aarch64::irelative_rel_): New data member.
1683 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1684 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1685 (Output_data_plt_aarch64::add_relocation): New method.
1686 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1687 offset. Add got_irelative size to got size.
1688 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1689 type string with the new typename.
1690 (AArch64_relocate_functions::update_adr): Replace parameter x with
1692 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1693 (AArch64_relocate_functions::reloc_common): New method.
1694 (AArch64_relocate_funcsions::rela_general): Extract common part out
1695 into reloc_common method.
1696 (AArch64_relocate_functions::rela_general): Likewise.
1697 (AArch64_relocate_functions::pcrela_general): Likewise.
1698 (AArch64_relocate_functions::adr): New method.
1699 (AArch64_relocate_functions::adrp): Calculate immed before calling
1701 (AArch64_relocate_functions::adrp): Likewise.
1702 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1703 comparing x to 0. Calculate immed from ~x when x < 0.
1704 (Target_aarch64::optimize_tls_reloc): Add new cases for
1705 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1706 TLSLD_MOVW_DTPREL_G0_NC.
1707 (Target_aarch64::possible_function_pointer_reloc): Implement this
1709 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1711 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1712 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1713 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1714 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1715 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1716 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1717 (Target_aarch64::make_plt_entry): Call add_entry with two more
1719 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1720 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1721 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1722 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1723 (Target_aarch64::Relocate::relocate_tls): Add cases for
1724 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1725 TLSLD_MOVW_DTPREL_G0_NC.
1726 * testsuite/icf_safe_so_test.cc: Correct test comment.
1727 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1729 2014-10-22 Alan Modra <amodra@gmail.com>
1731 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1734 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1736 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1738 2014-10-17 Cary Coutant <ccoutant@google.com>
1740 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1741 Add "typename" keyword.
1743 2014-10-15 Han Shen <shenhan@google.com>
1744 Jing Yu <jingyu@google.com>
1746 Patch for gold aarch64 backend to support relaxation.
1747 * aarch64-reloc.def: Change format.
1748 * aarch64.cc (class Reloc_stub): New class.
1749 (class Stub_table): New class.
1750 (class AArch64_relobj): New class.
1751 (class AArch64_input_section): New class.
1752 (class AArch64_output_section): New class.
1753 (Target_aarch64::new_stub_table): New method.
1754 (Target_aarch64::new_aarch64_input_section): New method.
1755 (Target_aarch64::find_aarch64_input_section): New method.
1756 (Target_aarch64::scan_section_for_stubs): New method.
1757 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1758 (Target_aarch64::relocate_stub): New method.
1759 (Target_aarch64::current_target): New method.
1760 (Target_aarch64::do_make_elf_object): New method.
1761 (Target_aarch64::do_may_relax): New method.
1762 (Target_aarch64::do_relax): New method.
1763 (Target_aarch64::group_sections): New method.
1764 (Target_aarch64::scan_reloc_for_stub): New method.
1765 (Target_aarch64::do_make_output_section): New method.
1766 (Target_aarch64::stub_tables_): New data member.
1767 (Target_aarch64::aarch64_input_section_map_): New data member.
1768 (AArch64_relocate_functions::maybe_apply_stub): New method.
1770 2014-09-30 Cary Coutant <ccoutant@google.com>
1773 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1775 2014-09-30 Kito Cheng <kito@0xlab.org>
1778 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1779 hash table before sysv-style hash table.
1781 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1783 * options.h (--pic-executable): Add negative to alias to -no-pie.
1785 2014-09-26 Cary Coutant <ccoutant@google.com>
1788 * object.cc (Sized_relobj_file): Compute value of section symbols
1789 for TLS sections the same as TLS symbols.
1791 2014-09-25 Cary Coutant <ccoutant@google.com>
1794 * resolve.cc (Symbol_table::resolve): Override common placeholder
1795 symbols, but adjust sizes.
1796 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1797 symbols to common lists.
1799 2014-09-24 Alan Modra <amodra@gmail.com>
1801 * po/POTFILES.in: Regenerate.
1803 2014-09-23 Taiju Tsuiki <tzik@google.com>
1804 Cary Coutant <ccoutant@google.com>
1807 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1808 on input_sections_blocker.
1809 * layout.cc (Write_sections_task::locks): Unblock
1810 input_sections_blocker_.
1811 * layout.h (Write_sections_task::Write_sections_task): Add
1812 input_sections_blocker.
1813 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1815 * testsuite/Makefile.in: Regenerate.
1817 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1819 * testsuite/Makefile.am (plugin_test_10): New test.
1820 * testsuite/Makefile.in: Regenerate
1821 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1822 * testsuite/plugin_test_10.sh: New file.
1824 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1826 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1827 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1828 during the replacement phase.
1830 2014-09-17 Han Shen <shenhan@google.com>
1831 Jing Yu <jingyu@google.com>
1833 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1834 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1835 * aarch64.cc (Target_aarch64): Add data members
1836 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1837 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1839 (Target_aarch64::do_reloc_symbol_index): New method.
1840 (Target_aarch64::do_reloc_addend): New method.
1841 (Target_aarch64::add_tlsdesc_info): New method.
1842 (Target_aarch64::do_dynsym_value): New method.
1843 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1844 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1845 (Target_aarch64::make_data_plt): Add new parameters: got,
1846 got_irelative. Pass them to do_make_data_plt.
1847 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1848 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1849 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1850 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1851 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1852 (Target_aarch64::got_tlsdesc_section): New method.
1853 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1854 (Target_aarch64::define_tls_base_symbol): New method.
1855 (Target_aarch64::reserve_tlsdesc_entries): New method.
1856 (Target_aarch64::got_mod_index_entry): New method.
1857 (Target_aarch64::rela_tlsdesc_section): New method.
1858 (Target_aarch64::rela_irelative_section): New method.
1859 (Target_aarch64::Tlsdesc_info): New struct.
1860 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1861 relocations and tlsdesc relocations.
1862 (Target_aarch64::optimize_tls_reloc): Implement method.
1863 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1864 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1866 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1867 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1868 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1869 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1870 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1871 (Output_data_plt_aarch64::rela_irelative): New method.
1872 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1873 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1874 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1875 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1876 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1877 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1878 (Output_data_plt_aarch64_standard): New member variables:
1879 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1880 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1881 New parameter: got, got_irelative.
1882 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1883 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1884 (Output_data_plt_aarch64::do_write): Replace got_address with
1885 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1886 (AArch64_relocate_functions::update_movnz): New method.
1887 (AArch64_relocate_functions): Correct format.
1888 (AArch64_relocate_functions::movnz): New method.
1889 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1890 before the switch. Add new cases to switch.
1891 Check ie_to_le relaxation on tlsie relocations. Add code handling
1892 tlsgd tlsdesc cases.
1893 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1894 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1895 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1896 Call reloc_name_in_error_message to print unsupported reloc.
1897 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1899 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1900 relocs. Fill in some more dynamic tags.
1901 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1902 Skip call tls_get_addr when tlsgd is relaxed.
1903 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1904 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1905 tlsdesc->ie relaxation.
1907 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1909 * mips.cc (Target_mips_nacl): New class.
1910 (Target_selector_mips_nacl): New class.
1911 (target_selector_mips32): Rename from target_selector_mips32be and use
1912 Target_selector_mips_nacl instead of Target_selector_mips.
1913 (target_selector_mips32el): Rename from target_selector_mips32 and use
1914 Target_selector_mips_nacl instead of Target_selector_mips.
1915 (target_selector_mips64): Rename from target_selector_mips64be and use
1916 Target_selector_mips_nacl instead of Target_selector_mips.
1917 (target_selector_mips64el): Rename from target_selector_mips64 and use
1918 Target_selector_mips_nacl instead of Target_selector_mips.
1919 (Target_mips::mips_info): Add const attribute.
1921 2014-09-02 Cary Coutant <ccoutant@google.com>
1923 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1924 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1925 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1926 (Sized_incr_dynobj::do_section_name): Likewise.
1927 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1928 (Sized_incr_dynobj::do_section_name): Likewise.
1929 * object.h (Object::section_name): Likewise.
1930 (Object::do_section_name): Likewise.
1931 (Sized_relobj_file::do_section_name): Likewise.
1932 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1933 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1935 2014-09-02 Cary Coutant <ccoutant@google.com>
1938 * ehframe.cc (Fde::write): Add output_offset parameter.
1939 (Cie::write): Likewise.
1940 (Eh_frame::set_final_data_size): Account for offset within output
1942 (Eh_frame::do_sized_write): Likewise.
1943 * ehframe.h (Fde::write): Add output_offset parameter.
1944 (Cie::write): Likewise.
1945 * output.cc (Output_section::Input_section_sort_entry): Remove
1946 section_has_name_; add output_section_name parameter. Use
1947 output section name for non-input sections.
1948 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1949 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1950 (Output_section::Input_section_sort_compare): Remove logic for
1951 sections without names.
1952 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1953 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1955 (Output_section::Input_section_sort_section_name_compare): Likewise.
1957 2014-08-29 Han Shen <shenhan@google.com>
1958 Jing Yu <jingyu@google.com>
1960 * aarch64-reloc-property.cc
1961 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1962 reference reloc property in the table.
1963 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1965 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1966 2 new overloaded methods.
1967 (Output_data_got_aarch64::do_write): Add code to write out
1969 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1971 (Output_data_got_aarch64::static_relocs): New vector to
1973 (Target_aarch64::TCB_SIZE): New const static memeber.
1974 (Target_aarch64::tcb_size): New method.
1975 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1976 (Target_aarch64::Relocate::relocate_tls): New method.
1977 (Target_aarch64::Scan::local): Add code handling new reloc types.
1978 (Target_aarch64::Scan::global): Add code handling new reloc types.
1980 2014-08-13 Sriraman Tallam <tmsriram@google.com>
1982 * options.h (-no-pie): Add option.
1984 2014-08-08 Jing Yu <jingyu@google.com>
1985 Han Shen <shenhan@google.com>
1987 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1988 (DEFFILES): add aarch64-reloc.def.
1989 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1990 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1991 * Makefile.in: Regenerate.
1992 * aarch64-reloc-property.cc: New file.
1993 * aarch64-reloc-property.h: New file.
1994 * aarch64-reloc.def: New file.
1995 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1996 with tab to make the format consistent.
1997 (Output_data_got_aarch64::symbol_table_): New method.
1998 (Target_aarch64::do_plt_address_for_global): New method.
1999 (Target_aarch64::do_plt_address_for_local): New method.
2000 (Target_aarch64::do_select_as_default_target): New method.
2001 (Target_aarch64::do_make_data_plt): New method.
2002 (Target_aarch64::make_data_plt): New method.
2003 (Output_data_plt_aarch64::has_irelative_section): New method.
2004 (Output_data_plt_aarch64::address_for_global): New method.
2005 (Output_data_plt_aarch64::address_for_local): New method.
2006 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2007 (Output_data_plt_aarch64::add_entry): Implement contents.
2008 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2009 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2010 the got_pov entry to plt0.
2011 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2013 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2014 (AArch64_howto): New struct.
2015 (aarch64_howto[]): New static const array.
2016 (AArch64_relocate_functions): New class.
2017 (Target_aarch64::Scan::get_reference_flags): Remove method.
2018 (Target_aarch64::Scan::local): Implement to support a few relocations.
2019 (Target_aarch64::Scan::global): Implement to support a few relocations.
2020 (Target_aarch64::make_plt_section): Implement contents.
2021 (Target_aarch64::make_plt_entry): Implement contents.
2022 (Target_aarch64::do_finalize_sections): Implement contents.
2023 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2024 (Target_aarch64::relocate_section): Implement contents.
2026 2014-08-06 Alan Modra <amodra@gmail.com>
2028 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2030 2014-08-06 Alan Modra <amodra@gmail.com>
2033 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2035 2014-07-21 Sriraman Tallam <tmsriram@google.com>
2037 * object.cc (Relobj::is_section_name_included): Add
2038 ".rodata.nptl_version" to not garbage collect this section.
2040 2014-07-08 Cary Coutant <ccoutant@google.com>
2042 * expression.cc (struct Expression::Expression_eval_info): Add
2043 new fields type_pointer, vis_pointer, and nonvis_pointer.
2044 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2045 nonvis_pointer parameters. Adjust all calls.
2046 (Symbol_expression::value): Update type, visibility, and nonvis bits
2048 * script.cc (Symbol_assignment::sized_finalize): Update type,
2049 visibility, and remaining st_other bits for new symbol.
2050 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2051 vis_pointer, and nonvis_pointer parameters.
2052 * symtab.h (Symbol::set_type): New method.
2054 * testsuite/Makefile.am (defsym_test): New test.
2055 * testsuite/Makefile.in: Regenerate.
2056 * testsuite/defsym_test.c: New file.
2057 * testsuite/defsym_test.sh: New file.
2059 2014-07-08 Cary Coutant <ccoutant@google.com>
2062 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2063 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2064 (Sized_dynobj::base_read_symbols): ...new method.
2065 * object.h (Sized_relobj_file::base_read_symbols): New method.
2066 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2067 (Sized_relobj_file::base_read_symbols): ...new method.
2068 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2069 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2070 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2072 2014-07-04 Alan Modra <amodra@gmail.com>
2074 * po/POTFILES.in: Regenerate.
2076 2014-07-02 Jing Yu <jingyu@google.com>
2078 * aarch64.cc: New file
2079 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2080 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2081 * Makefile.in: Regenerate.
2082 * configure.tgt: Add entries for aarch64*.
2083 * configure.ac: Likewise.
2084 * configure: Likewise.
2086 2014-06-27 Alan Modra <amodra@gmail.com>
2088 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2090 2014-06-24 Cary Coutant <ccoutant@google.com>
2092 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2094 (Dwo_file::sized_read_unit_index): Likewise.
2096 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2098 * mips.cc: New file.
2099 * Makefile.am (TARGETSOURCES): Add mips.cc
2100 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2101 * configure.tgt: Add entries for mips*.
2102 * configure.ac: Likewise.
2103 * Makefile.in: Regenerate.
2104 * configure: Likewise.
2106 2014-06-09 Cary Coutant <ccoutant@google.com>
2108 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2109 unit_length is within section bounds.
2111 2014-06-09 Cary Coutant <ccoutant@google.com>
2114 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2117 2014-06-07 Alan Modra <amodra@gmail.com>
2119 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2121 2014-06-06 Cary Coutant <ccoutant@google.com>
2123 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2124 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2125 (Dwarf_pubnames_table::read_header): Likewise.
2126 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2127 .debug_gnu_pubtypes.
2129 2014-06-05 Joel Brobecker <brobecker@adacore.com>
2131 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2132 * Makefile.in, configure: Regenerate.
2134 2014-06-03 Alan Modra <amodra@gmail.com>
2136 * powerpc.cc (addis_12_2): Define.
2137 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2139 2014-06-03 Alan Modra <amodra@gmail.com>
2141 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2144 2014-06-02 Alan Modra <amodra@gmail.com>
2146 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2147 Only ignore relocs on ELFv1.
2148 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2150 2014-05-30 Cary Coutant <ccoutant@google.com>
2152 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2153 * testsuite/Makefile.in: Regenerate.
2154 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2156 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2159 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2160 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2162 2014-05-15 Alan Modra <amodra@gmail.com>
2164 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2165 Compare FDE contents with DW_CFA_nop rather than 0.
2167 2014-05-13 Sriraman Tallam <tmsriram@google.com>
2169 * symtab.h (may_need_copy_reloc): Remove check for position independent
2171 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2172 position independence before pc absolute may_need_copy_reloc call.
2173 Add check for executable output befor pc relative may_need_copy_reloc
2179 * powerpc.cc: Add check for no position independence before
2180 may_need_copy_reloc calls.
2181 * testsuite/pie_copyrelocs_test.cc: New file.
2182 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2183 * Makefile.am (pie_copyrelocs_test): New test.
2184 * Makefile.in: Regenerate.
2186 2014-05-08 Martin Liška <mliska@suse.cz>
2188 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2190 2014-05-06 Cary Coutant <ccoutant@google.com>
2193 * i386.cc (Output_data_got_plt_i386): New class.
2194 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2195 parameter. Change all callers.
2196 (Output_data_plt_i386::layout_): Remove.
2197 (Output_data_plt_i386::got_plt_): Change type.
2198 (Target_i386::got_plt_): Change type. Change all references.
2199 (Target_i386::got_section): Create instance of new class.
2200 (Output_data_got_plt_i386::do_write): New function.
2201 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2202 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2203 parameter. Change all callers.
2204 (Output_data_plt_x86_64::layout_): Remove.
2205 (Output_data_plt_x86_64::got_plt_): Change type.
2206 (Target_x86_64::got_plt_): Change type. Change all references.
2207 (Target_x86_64::got_section): Create instance of new class.
2208 (Output_data_got_plt_x86_64::do_write): New function.
2209 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2210 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2213 2014-05-05 Cary Coutant <ccoutant@google.com>
2215 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2216 if we have pubnames/pubtypes.
2218 2014-05-02 Cary Coutant <ccoutant@google.com>
2220 * defstd.cc (in_segment): Define __ehdr_start here...
2221 * layout.cc (Layout::finalize): ...Instead of here. Set the
2222 output segment when known.
2223 * resolve.cc (Symbol::override_base_with_special): Remember
2224 the original binding.
2225 * symtab.cc (Symbol::set_output_segment): New function.
2226 (Symbol::set_undefined): New function.
2227 * symtab.h (Symbol::is_weak_undefined): Check original undef
2229 (Symbol::is_strong_undefined): New function.
2230 (Symbol::set_output_segment): New function.
2231 (Symbol::set_undefined): New function.
2232 * target-reloc.h (is_strong_undefined): Remove.
2233 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2234 Check for hidden undefs.
2235 (relocate_section): Call Symbol::is_strong_undefined.
2237 * testsuite/Makefile.am (ehdr_start_test_1)
2238 (ehdr_start_test_2, ehdr_start_test_3)
2239 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2240 * testsuite/Makefile.in: Regenerate.
2241 * testsuite/ehdr_start_def.cc: New source file.
2242 * testsuite/ehdr_start_test.cc: New source file.
2243 * testsuite/ehdr_start_test.t: New linker script.
2244 * testsuite/ehdr_start_test_4.sh: New shell script.
2246 2014-04-23 Cary Coutant <ccoutant@google.com>
2249 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2251 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2253 * layout.cc (Layout::include_section): Allow a target to decide
2254 whether to include a section.
2255 * target.h (Target::should_include_section): New function.
2256 (Target::do_should_include_section): New function.
2258 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2260 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2262 (Copy_relocs::emit): ... here.
2263 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2264 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2265 (Copy_reloc_entry::entries_): Change from private to protected.
2267 2014-04-02 Sriraman Tallam <tmsriram@google.com>
2269 * icf.cc (get_section_contents): Replace copies of reloc
2270 vectors with const references.
2272 2014-04-02 Cary Coutant <ccoutant@google.com>
2274 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2275 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2276 * configure: Regenerate.
2277 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2278 -fno-use-linker-plugin.
2279 (LINK1, CXXLINK1): Add it to the link command.
2280 * testsuite/Makefile.in: Regenerate.
2282 2014-03-12 Alan Modra <amodra@gmail.com>
2284 * Makefile.in: Regenerate.
2286 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2288 * symtab.h (Symbol::set_nonvis): New function.
2290 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2292 * symtab.cc (Sized_symbol<32>::init_output_data):
2293 Instantiate the template.
2294 (Sized_symbol<64>::init_output_data): Likewise.
2296 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2298 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2299 adjust dynamic symbol value.
2300 * target.h (Target::adjust_dyn_symbol): New function.
2301 (Target::do_adjust_dyn_symbol): New function.
2303 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2305 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2306 Get the value of DYNAMIC_CUSTOM dynamic entry.
2307 * output.h (Output_data_dynamic::add_custom): New function.
2308 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2310 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2311 * target.h (Target::dynamic_tag_custom_value): New function.
2312 (Target::do_dynamic_tag_custom_value): New function.
2314 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2316 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2318 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2319 (Target::do_has_custom_set_dynsym_indexes): New function.
2320 (Target::set_dynsym_indexes): New function.
2321 (Target::do_set_dynsym_indexes): New function.
2323 2014-03-07 Alan Modra <amodra@gmail.com>
2325 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2326 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2327 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2328 (Powerpc_relocate_functions::has_overflow_bitfield,
2329 overflowed): Use the above.
2330 (Target_powerpc::Relocate::relocate): Correct overflow checking
2331 for a number of relocations. Modify overflow test for 16-bit
2332 fields in instructions to signed/unsigned according to whether
2333 the field takes a signed or unsigned value.
2335 2014-03-05 Alan Modra <amodra@gmail.com>
2337 Update copyright years.
2339 2014-03-05 Alan Modra <amodra@gmail.com>
2341 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2342 R_PPC64_ADDR64_LOCAL.
2343 (Target_powerpc::Relocate::relocate): Likewise.
2345 2014-03-03 Alan Modra <amodra@gmail.com>
2347 * dwp.cc (print_version): Update copyright year to current.
2349 2014-02-10 Alan Modra <amodra@gmail.com>
2351 * po/gold.pot: Regenerate.
2353 2014-02-06 Cary Coutant <ccoutant@google.com>
2355 Fix problem where -u is ignored when a weak undef is seen.
2357 * archive.cc (Library_base::should_include_member): Reorder
2358 code to check for -u option if a weak undef has already been seen.
2359 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2360 * testsuite/Makefile.in: Regenerate.
2361 * testsuite/weak_undef_file3.cc: New file.
2362 * testsuite/weak_undef_file4.cc: New file.
2363 * testsuite/weak_undef_test_2.cc: New file.
2365 2014-02-05 Cary Coutant <ccoutant@google.com>
2367 Fix issues with gold undefined symbol diagnostics.
2370 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2372 * target-reloc.h (is_strong_undefined): New function.
2373 (relocate_section): Move undef vtable symbol check from here.
2374 Check for is_strong_undefined.
2376 2014-02-05 Cary Coutant <ccoutant@google.com>
2378 Fix problems with the --dynamic-list option.
2381 * options.cc (General_options::parse_dynamic_list):
2382 Set have_dynamic_list_.
2383 (General_options::General_options): Initialize have_dynamic_list_.
2384 (General_options::finalize): Turn off -Bsymbolic and
2385 -Bsymbolic-functions if --dynamic-list provided.
2386 * options.h (General_options::have_dynamic_list): New function.
2387 (General_options::have_dynamic_list_): New data member.
2388 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2392 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2393 in --dynamic-list, mark it.
2395 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2396 (dynamic_list_2): New test case.
2397 * testsuite/Makefile.in: Regenerate.
2398 * testsuite/dynamic_list_2.cc: New file.
2399 * testsuite/dynamic_list_2.t: New file.
2400 * testsuite/dynamic_list_lib1.cc: New file.
2401 * testsuite/dynamic_list_lib2.cc: New file.
2402 * testsuite/gc_dynamic_list_test.c: New file.
2403 * testsuite/gc_dynamic_list_test.sh: New file.
2404 * testsuite/gc_dynamic_list_test.t: New file.
2406 2014-01-28 Cary Coutant <ccoutant@google.com>
2408 Add .gdb_index version 7 support.
2410 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2411 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2413 (Dwarf_ranges_table::read_ranges_table): Likewise.
2414 (Dwarf_pubnames_table::read_section): Check for GNU-style
2415 sections, and for compressed debug sections.
2416 (Dwarf_pubnames_table::read_header): Compute end address of table.
2417 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2418 for end of list by offset, not by offset == 0.
2419 (Dwarf_info_reader::do_read_string_table): Check for compressed
2421 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2422 Initialize new data members.
2423 (Dwarf_pubnames_table::next_name): return flag_byte.
2424 (Dwarf_pubnames_table::end_of_table_): New data member.
2425 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2426 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2427 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2428 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2429 read skeleton type unit DIEs.
2430 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2431 (Gdb_index::do_write): Write flag_byte.
2432 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2433 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2434 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2435 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2437 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2439 * version.cc (print_version): Update copyright year to 2014.
2441 2013-12-19 Dimitry Andric <dimitry@andric.com>
2443 * stringpool.cc (Stringpool_template::reserve): Add
2444 HAVE_UNORDERED_MAP case.
2445 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2447 2013-12-18 Cary Coutant <ccoutant@google.com>
2449 * configure.ac: Check for <unordered_set> and <unordered_map>.
2450 * config.in: Regenerate.
2451 * configure: Regenerate.
2452 * system.h: Use <unordered_set> and <unordered_map> if available.
2454 2013-12-10 Roland McGrath <mcgrathr@google.com>
2456 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2457 with $(INSTALL_PROGRAM_ENV).
2458 * Makefile.in: Regenerate.
2460 2013-11-22 Cary Coutant <ccoutant@google.com>
2462 * configure.ac: Add check for which library is needed for
2464 * configure: Regenerate.
2466 2013-11-22 Cary Coutant <ccoutant@google.com>
2468 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2470 * testsuite/Makefile.in: Regenerate.
2472 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2474 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2475 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2476 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2477 (Target_x86_64<size>::Scan::local): Likewise.
2478 (Target_x86_64<size>::Scan::global): Likewise.
2479 (Target_x86_64<size>::Relocate::relocate): Likewise.
2480 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2482 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2485 * testsuite/Makefile.am (check_PROGRAMS): Add
2486 exception_x86_64_bnd_test.
2487 (exception_x86_64_bnd_test_SOURCES): New macro.
2488 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2489 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2490 (exception_x86_64_bnd_test_LDADD): Likewise.
2491 (exception_x86_64_bnd_1.o): New rule.
2492 (exception_x86_64_bnd_2.o): Likewise.
2493 * testsuite/Makefile.in: Regenerated.
2495 2013-11-15 Alan Modra <amodra@gmail.com>
2497 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2499 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2500 Only call ppc64_local_entry_offset for 64-bit. Restrict
2501 symval_for_branch lookup to ELFv1.
2502 (Stub_table::add_plt_call_entry): Use unsigned int off.
2503 (Output_data_glink::Address, invalid_address): New.
2504 (Output_data_glink::add_eh_frame): Move out of line. Add
2506 (Output_data_glink::add_global_entry, find_global_entry,
2507 global_entry_address): New functions.
2508 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2509 ge_size): New variables.
2510 (Output_data_glink::set_final_data_size): Add global entry
2512 (Output_data_glink::do_write): Write global entry stubs.
2513 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2514 parameter. Return true for ELFv2. Adjust callers.
2515 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2516 ELFv1. Similarly for ifunc and dynamic relocation processing
2517 specific to ELFv1. Recognize that symbols are defined on
2518 their plt entries for ELFv2.
2519 (Target_powerpc::symval_for_branch): Assert if called for
2521 (Target_powerpc::Relocate::relocate): Use global entry plt
2522 stub for symbol value if such exists on ELFv2.
2523 (Target_powerpc::Relocate::relocate): Don't call
2524 symval_for_branch when ELFv2. Do adjust for local entry
2526 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2528 (Target_powerpc::do_plt_address_for_global): Similarly.
2530 2013-11-14 Cary Coutant <ccoutant@google.com>
2532 Revert patch -- this did not fix the problem, and there is
2535 2013-11-14 Cary Coutant <ccoutant@google.com>
2538 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2539 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2540 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2541 updating fde_offsets_.
2542 (Eh_frame_hdr::lock_): New data member.
2544 2013-11-14 Cary Coutant <ccoutant@google.com>
2546 * dwp.cc (Dwo_file_entry): New type.
2547 (File_list): Use Dwo_file_entry.
2548 (Dwo_file::verify): New function.
2549 (Dwo_file::verify_dwo_list): New function.
2550 (Dwo_file::sized_verify_dwo_list): New function.
2551 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2553 (Dwp_options): New enum type.
2554 (dwp_options): Add --verify-only.
2557 * dwp.h (gold_info): Add declaration.
2559 2013-11-14 Cary Coutant <ccoutant@google.com>
2562 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2563 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2564 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2565 updating fde_offsets_.
2566 (Eh_frame_hdr::lock_): New data member.
2568 2013-11-06 Cary Coutant <ccoutant@google.com>
2571 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2572 before reloc sections.
2574 2013-11-04 Alan Modra <amodra@gmail.com>
2576 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2577 (Symbol::needs_dynamic_reloc): Test new flag.
2578 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2579 (Target_powerpc::Scan::get_reference_flags): Add target param.
2580 Return FUNC_DESC_ABI for 64-bit ELFv1.
2581 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2583 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2584 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2586 2013-10-31 Cary Coutant <ccoutant@google.com>
2588 Restore support for dwp v2 DWARF package file format.
2590 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2591 tu_length parameter. Adjust all callers.
2592 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2593 * dwp.cc: Include dwarf.h.
2594 (Section_bounds): New struct type.
2595 (Unit_set): New struct type.
2596 (Dwo_file::Dwo_file): Initialize new data member.
2597 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2598 Combine and rename to...
2599 (Dwo_file::read_unit_index): ...this.
2600 (Dwo_file::sized_read_compunit_index)
2601 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2602 (Dwo_file::sized_read_unit_index): ...this.
2603 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2604 parameters; add section_id parameter.
2605 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2606 (Dwo_file::add_unit_set): ...this.
2607 (Dwo_file::shndx_map_): Remove.
2608 (Dwo_file::sect_offsets_): New data member.
2609 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2610 (Dwp_output_file::add_section): Rename to...
2611 (Dwp_output_file::add_contribution): ...this.
2612 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2613 (Dwp_output_file::add_tu_set): Likewise.
2614 (Dwp_output_file::Contribution): New type.
2615 (Dwp_output_file::Section::contributions): New data member.
2616 (Dwp_output_file::Cu_or_tu_set): Remove.
2617 (Dwp_output_file::Section::Section): New ctor.
2618 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2619 (Dwp_output_file::Dwp_index::Section_table): New type.
2620 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2621 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2623 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2624 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2625 (Dwp_output_file::Dwp_index::section_table): New member function.
2626 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2627 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2628 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2629 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2630 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2631 (Dwp_output_file::Dwp_index::section_table_): New data member.
2632 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2633 (Dwp_output_file::add_output_section): New member function.
2634 (Dwp_output_file::write_new_section): New member function.
2635 (Dwp_output_file::write_contributions): New member function.
2636 (Dwp_output_file::section_id_map_): New data member.
2637 (class Dwo_id_info_reader): Remove.
2638 (class Unit_reader): New class.
2639 (get_dwarf_section_name): New function.
2640 (Dwo_file::read_executable): Adjust initializations of class data.
2641 (Dwo_file::read): Add support for v2 package file format.
2642 (Dwo_file::read_unit_index): Likewise.
2643 (Dwo_file::sized_read_unit_index): Likewise.
2644 (Dwo_file::copy_section): Likewise.
2645 (Dwo_file::add_unit_set): Likewise.
2646 (Dwp_output_file::add_output_section): Likewise.
2647 (Dwp_output_file::add_contribution): Likewise.
2648 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2650 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2652 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2654 (Dwp_output_file::initialize): Remove unused function.
2655 (Dwp_output_file::finalize): Add support for v2 package file format.
2656 (Dwp_output_file::write_index): Likewise.
2657 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2660 2013-10-31 Cary Coutant <ccoutant@google.com>
2662 * configure.ac: Fix check for -fmerge-constants.
2663 * configure.ac: Regenerate.
2665 2013-10-30 Roland McGrath <mcgrathr@google.com>
2667 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2668 Correct 9-byte nop sequence to match what the assembler generates.
2670 2013-10-30 Alan Modra <amodra@gmail.com>
2672 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2673 ppc64_local_entry_offset, ppc64_local_entry_offset,
2674 do_read_symbols): New functions.
2675 (Powerpc_relobj::e_flags_, st_other_): New vars.
2676 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2677 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2678 (Powerpc_relobj::e_flags_): New var.
2679 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2680 and adjust for ELFv2.
2681 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2682 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2683 (Powerpc_dynobj::do_find_special_sections): Likewise.
2684 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2685 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2686 to ELFv2 local entry.
2687 (Target_powerpc::do_relax): No thread safe barriers needed for
2689 (Output_data_plt_powerpc::initial_plt_entry_size_,
2690 plt_entry_size): Delete. Replace all uses with
2691 first_plt_entry_offset() and plt_entry_size().
2692 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2693 reserved_size parm. Update callers.
2694 (Output_data_plt_powerpc::entry_count): Update.
2695 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2696 and use Target_powerpc::first_plt_entry_offset().
2697 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2698 rename to plt_entry_size.
2699 (Output_data_plt_powerpc::add_ifunc_entry,
2700 add_local_ifunc_entry): Adjust reloc for ELFv2.
2701 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2702 (glink_eh_frame_fde_64v2): New.
2703 (Stub_table::plt_call_size): Support ELFv2 sizing.
2704 (Output_data_glink::add_eh_frame): Use the new FDE.
2705 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2706 (Stub_table::do_write): Write ELFv2 stubs and glink.
2707 (Target_powerpc::Relocate::relocate): Replaces nop after call
2708 with ld 2,24(1) and adjust local offset destination for ELFv2.
2710 2013-10-30 Alan Modra <amodra@gmail.com>
2712 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2713 (Target_powerpc::Scan::global, local): Likewise.
2714 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2715 on all ppc64 @h and @ha relocs.
2717 2013-10-14 Alan Modra <amodra@gmail.com>
2719 * output.h (Output_data_got::add_constant): Tidy.
2720 (Output_data_got::add_constant_pair): New function.
2721 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2722 methods used so as to first call reserve_ent().
2724 2013-10-11 Roland McGrath <mcgrathr@google.com>
2726 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2727 add_got_entry and add_got_entry_pair.
2729 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2730 (HAVE_PUBNAMES): Likewise.
2731 * configure: Regenerate.
2733 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2734 * testsuite/Makefile.in: Regenerate.
2736 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2737 Remove const from declaration.
2738 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2739 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2740 * output.h (Output_file_header): Remove const from member target_
2741 and corresponding constructor argument.
2742 * output.cc (Output_file_header::Output_file_header): Update prototype.
2743 (Output_file_header::do_sized_write): Use this->target_ in place
2744 of parameters()->target().
2746 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2748 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2749 * configure: Regenerate.
2750 * Makefile.in: Regenerate.
2751 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2752 * testsuite/merge_string_literals_2.c: Likewise.
2753 * testsuite/Makefile.am
2754 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2755 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2756 literal -fmerge-constants.
2757 * testsuite/Makefile.in: Regenerate.
2759 * i386.cc (Target_i386): Remove unused member dynbss_.
2760 * arm.cc (Target_arm): Likewise.
2761 * powerpc.cc (Target_powerpc): Likewise.
2762 * sparc.cc (Target_sparc): Likewise.
2763 * tilegx.cc (Target_tilegx): Likewise.
2764 * x86_64.cc (Target_x86_64): Likewise.
2765 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2766 type_signature_, type_offset_.
2767 * plugin.h (Plugin_hook): Remove unused member layout_.
2768 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2770 (Read_member): Remove unused members input_objects_, symtab_,
2772 (Check_library): Remove unused member symtab_.
2773 * archive.h (Lib_group): Remove unused member lib_.
2774 * archive.cc (Lib_group::Lib_group): Update initializer.
2775 * incremental.h (Incremental_binary): Remove unused member target_.
2776 (Incremental_script_entry): Removed unused member script_.
2777 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2778 * icf.h (Icf): Remove unused member num_tracked_relocs.
2780 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2781 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2783 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2785 * archive.h: Use struct rather than class for forward declaration
2786 of Read_symbols_data.
2788 2013-10-07 Cary Coutant <ccoutant@google.com>
2791 * testsuite/Makefile.am (icf_test): Fix dependencies.
2792 (icf_safe_test): Likewise.
2793 (icf_safe_so_test): Likewise.
2794 (large_symbol_alignment): Add empty _LDADD rule.
2795 * testsuite/Makefile.in: Regenerate.
2797 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2800 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2801 relocation for R_X86_64_32 on x32.
2803 2013-08-27 Roland McGrath <mcgrathr@google.com>
2805 * output.cc (Output_segment::set_section_addresses): Take new
2806 Target* argument. If target->isolate_execinstr() and the segment
2807 is executable and starts at a target->abi_pagesize() boundary,
2808 pad its end out to a target->abi_pagesize() boundary with code fill.
2809 * output.h (Output_segment::set_section_addresses): Update decl.
2810 * layout.h (Layout::check_output_data_for_reset_values): Take new
2811 argument RELAX_OUTPUTS.
2812 (Layout): New member relax_output_list_.
2813 (Layout::add_relax_output): New method.
2814 * layout.cc (Layout::Layout): Update constructor.
2815 (Layout::reset_relax_output): New method.
2816 (Layout::clean_up_after_relaxation): Call it.
2817 (Layout::prepare_for_relaxation): Update caller.
2818 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2819 Call reset_relax_output before re-processing segments for
2820 isolate_execinstr case.
2821 (Layout::write_data): Handle relax_output_list_.
2822 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2823 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2825 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2828 * object.h: Fix typos.
2830 2013-08-16 Roland McGrath <mcgrathr@google.com>
2832 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2833 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2835 2013-08-07 Cary Coutant <ccoutant@google.com>
2837 Revert support for v2 DWP files:
2839 2013-03-01 Cary Coutant <ccoutant@google.com>
2841 Add dwp support for v2 DWARF package file format.
2842 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2843 tu_length parameter. Adjust all callers.
2844 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2845 * dwp.cc: Include dwarf.h.
2846 (Section_bounds): New struct type.
2847 (Unit_set): New struct type.
2848 (Dwo_file::Dwo_file): Initialize new data member.
2849 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2850 Combine and rename to...
2851 (Dwo_file::read_unit_index): ...this.
2852 (Dwo_file::sized_read_compunit_index)
2853 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2854 (Dwo_file::sized_read_unit_index): ...this.
2855 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2856 parameters; add section_id parameter.
2857 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2858 (Dwo_file::add_unit_set): ...this.
2859 (Dwo_file::shndx_map_): Remove.
2860 (Dwo_file::sect_offsets_): New data member.
2861 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2862 (Dwp_output_file::add_section): Rename to...
2863 (Dwp_output_file::add_contribution): ...this.
2864 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2865 (Dwp_output_file::add_tu_set): Likewise.
2866 (Dwp_output_file::Contribution): New type.
2867 (Dwp_output_file::Section::contributions): New data member.
2868 (Dwp_output_file::Cu_or_tu_set): Remove.
2869 (Dwp_output_file::Section::Section): New ctor.
2870 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2871 (Dwp_output_file::Dwp_index::Section_table): New type.
2872 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2873 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2875 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2876 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2877 (Dwp_output_file::Dwp_index::section_table): New member function.
2878 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2879 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2880 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2881 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2882 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2883 (Dwp_output_file::Dwp_index::section_table_): New data member.
2884 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2885 (Dwp_output_file::add_output_section): New member function.
2886 (Dwp_output_file::write_new_section): New member function.
2887 (Dwp_output_file::write_contributions): New member function.
2888 (Dwp_output_file::section_id_map_): New data member.
2889 (class Dwo_id_info_reader): Remove.
2890 (class Unit_reader): New class.
2891 (get_dwarf_section_name): New function.
2892 (Dwo_file::read_executable): Adjust initializations of class data.
2893 (Dwo_file::read): Add support for v2 package file format.
2894 (Dwo_file::read_unit_index): Likewise.
2895 (Dwo_file::sized_read_unit_index): Likewise.
2896 (Dwo_file::copy_section): Likewise.
2897 (Dwo_file::add_unit_set): Likewise.
2898 (Dwp_output_file::add_output_section): Likewise.
2899 (Dwp_output_file::add_contribution): Likewise.
2900 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2902 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2904 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2906 (Dwp_output_file::initialize): Remove unused function.
2907 (Dwp_output_file::finalize): Add support for v2 package file format.
2908 (Dwp_output_file::write_index): Likewise.
2909 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2912 2013-07-31 Cary Coutant <ccoutant@google.com>
2914 * object.cc (Sized_relobj::do_output_section_address): New function.
2915 (Sized_relobj): Instantiate explicitly.
2916 * object.h (Object::output_section_address): New function.
2917 (Object::do_output_section_address): New function.
2918 (Sized_relobj::do_output_section_address): New function.
2919 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2921 2013-07-30 Cary Coutant <ccoutant@google.com>
2922 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2924 * parameters.cc (Parameters::entry): Return target-specific entry
2926 * target.h (Target::entry_symbol_name): New function.
2927 (Target_info::entry_symbol_name): New data member.
2929 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2930 * i386.cc (Target_i386::i386_info): Likewise.
2931 (Target_i386_nacl::i386_nacl_info): Likewise.
2932 * sparc.cc (Target_sparc::sparc_info): Likewise.
2933 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2934 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2935 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2936 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2938 2013-07-22 Sterling Augustine <saugustine@google.com>
2940 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2941 Convert parameter shndx to local variable. Add parameters symtab
2942 and symtab_size. Scan over section names. Find relocation
2943 section corresponding to current section. Create and initialize
2944 reloc_mapper_ and reloc_type_.
2945 (Dwarf_pubnames_table::read_header): Add assertion. Change
2946 unit_length to off_t. Initialize member unit_length_. Fill in field
2948 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2949 Initialize new fields unit_length_ and cu_offset_.
2950 (Dwarf_pubnames_table::read_section): Update prototype.
2951 (Dwarf_pubnames_table::cu_offset): New member function.
2952 (Dwarf_pubnames_table::subsection_size): Likewise.
2953 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2955 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2956 member functions public.
2957 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2958 Update comment. Rework logic. Move repeated parts to...
2959 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2960 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2961 pubtypes_table_, and stmt_list_offset.
2962 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2963 Gdb_index::find_pubtype_offset,
2964 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2965 (Gdb_index::pubnames_read): Update prototype and rework logic.
2966 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2968 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2969 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2970 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2971 Gdb_index::map_pubtable_to_dies):
2973 (Gdb_index::pubnames_read): Update declaration.
2974 (Gdb_index::Pubname_offset_map): New type.
2975 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2976 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2977 Gdb_index::stmt_list_offset): Declare.
2978 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2979 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2980 Gdb_index::pubtypes_offset_): Remove.
2982 2013-07-19 Roland McGrath <mcgrathr@google.com>
2984 * options.h (General_options): Add -Trodata-segment option.
2985 * parameters.cc (Parameters::check_rodata_segment): New function.
2986 (Parameters::set_target_once): Call it.
2987 * parameters.h (Parameters): Declare it (private member function).
2988 * layout.cc (load_seg_unusable_for_headers): New function, broken
2989 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2990 then validate rodata segment rather than text segment.
2991 (relaxation_loop_body): Call that.
2992 (is_text_segment): New function. Don't admit a non-executable
2993 segment if TARGET->isolate_execinstr().
2994 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2996 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
2999 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3000 * nacl.h (Sniff_file::View::View): Request aligned view.
3002 2013-07-11 Cary Coutant <ccoutant@google.com>
3004 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3005 correct BRLT entry size.
3007 2013-07-03 Alan Modra <amodra@gmail.com>
3009 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3012 2013-07-01 Cary Coutant <ccoutant@google.com>
3014 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3016 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3017 (Dwarf_ranges_table::lookup_reloc): New function.
3018 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3020 (Dwarf_ranges_table::lookup_reloc): New function.
3021 (Dwarf_ranges_table::reloc_type_): New data member.
3023 2013-06-27 Jing Yu <jingyu@google.com>
3026 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3028 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3029 (Target_powerpc::do_relax): Call the above.
3031 2013-06-27 Cary Coutant <ccoutant@google.com>
3033 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3034 on garbage collected .opd section.
3036 2013-06-27 Alan Modra <amodra@gmail.com>
3038 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3040 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3041 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3043 2013-06-14 Cary Coutant <ccoutant@google.com>
3045 * resolve.cc (Symbol::override_base): Don't override st_type
3046 from plugin placeholder symbols.
3047 (Symbol_table::resolve): Likewise.
3048 (Symbol_table::should_override): Don't complain about TLS mismatch
3049 if the TO symbol is a plugin placeholder.
3050 * testsuite/Makefile.am (plugin_test_tls): New test.
3051 * testsuite/Makefile.in: Regenerate.
3052 * testsuite/plugin_test_tls.sh: New test script.
3053 * testsuite/two_file_test_2_tls.cc: New test source.
3054 * testsuite/two_file_test_tls.cc: New test source.
3056 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3058 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3059 the maximum segment alignment is larger than the page size.
3060 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3061 correctly aligns the symbols with large alignemnt.
3062 * testsuite/Makefile.in: Regenerate.
3063 * testsuite/large_symbol_alignment.cc: New file.
3065 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3066 Sriraman Tallam <tmsriram@google.com>
3068 * options.h (sort_section): New option.
3069 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3070 Rename from Input_section_sort_section_name_special_ordering_compare.
3071 (Input_section_sort_section_name_compare): New struct.
3072 * output.cc (Output_section::Input_section_sort_section_name_compare::
3073 operator()): New function.
3074 (Output_section::sort_attached_input_sections): Use new sort function
3075 for .text if --sort-section=name is specified.
3076 * layout.cc (Layout::make_output_section):
3077 Add sorting by name when --sort-section=name is specified.
3078 * testsuite/Makefile.am (text_section_grouping): Test option
3079 --sort-section=name.
3080 * testsuite/Makefile.in: Regenerate.
3081 * testsuite/section_sorting_name.cc: New file.
3082 * testsuite/section_sorting_name.sh: New file.
3084 2013-05-21 Cary Coutant <ccoutant@google.com>
3086 * symtab.h (Symbol::is_cxx_vtable): New function.
3087 * target-reloc.h (relocate_section): Check for vtable symbol.
3088 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3089 * testsuite/Makefile.in: Regenerate.
3090 * testsuite/missing_key_func.cc: New test source.
3091 * testsuite/missing_key_func.sh: New test script.
3093 2013-05-21 Cary Coutant <ccoutant@google.com>
3095 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3096 type of enclosing symbol.
3097 (Relocate_info::location): Check symbol type when describing symbol.
3098 * object.h (Symbol_location_info): Remove unused line_number;
3099 add enclosing_symbol_type.
3100 * testsuite/debug_msg.sh: Adjust expected output.
3102 2013-05-13 Cary Coutant <ccoutant@google.com>
3104 * configure.ac: Export DEFAULT_TARGET.
3105 * configure: Regenerate.
3106 * Makefile.in: Regenerate.
3107 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3108 * testsuite/Makefile.in: Regenerate.
3109 * testsuite/debug_msg.sh: Delete duplicate tests.
3110 Don't check undef_int error message match for powerpc where the
3111 source file and line number aren't available.
3113 2013-05-10 Roland McGrath <mcgrathr@google.com>
3115 * options.h (General_options): Add --rosegment-gap option.
3116 * options.cc (finalize): --rosegment-gap implies --rosegment.
3117 * layout.cc (set_segment_offsets): Let user option override
3118 target->rosegment_gap().
3120 2013-05-10 Roland McGrath <mcgrathr@google.com>
3122 * options.h (General_options): Remove leading space from help
3123 messages for -nostdlib and --rosegment.
3125 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3128 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3130 2013-05-03 Alan Modra <amodra@gmail.com>
3132 * merge.cc (Output_merge_string::do_add_input_section): Correct
3133 scan for number of strings. Rename vars to avoid shadowing.
3134 Include missing terminator in input_size_.
3136 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3138 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3139 Restore empty string handling.
3141 2013-05-01 Cary Coutant <ccoutant@google.com>
3143 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3144 uninitialized warning.
3146 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3148 * output.cc (Output_section::add_merge_input_section): Allow
3149 to merge sections if the alignment is more than character size.
3150 * merge.h (Output_merge_string::Output_merge_string): Remove
3152 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3153 only not-null strings. Check the alignment of strings.
3155 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3156 alignment as the argument.
3157 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3158 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3159 Align non-zero length strings according to the addralign_.
3160 (Stringpool_template<Stringpool_char>::set_string_offsets):
3161 Updating offsets according to the given alignment.
3162 * testsuite/Makefile.am (text_section_grouping): Test if string
3163 literals are getting merged.
3164 * testsuite/Makefile.in: Regenerate.
3165 * testsuite/merge_string_literals_1.c: New file.
3166 * testsuite/merge_string_literals_2.c: Ditto.
3167 * testsuite/merge_string_literals.sh: Ditto.
3169 2013-04-26 Ian Lance Taylor <iant@google.com>
3171 * target-reloc.h (relocate_section): If the reloc offset is out of
3172 range, pass VIEW as NULL to relocate.relocate.
3173 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3174 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3175 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3176 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3177 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3178 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3180 2013-04-26 Geoff Pike <gpike@chromium.org>
3182 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3183 * layout.cc (Hash_task): New class.
3184 (Layout::queue_build_id_tasks): New function.
3185 (Layout::write_build_id): Handle single-thread portion of build ID
3186 computation. (In some cases, all of it is single-threaded.) Replace
3187 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3188 functionality in fewer lines of code.
3189 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3190 * options.h (General_options): make "--build-id" default to tree
3191 rather than sha1. Add two new options related to --build-id=tree:
3192 --build-id-chunk-size-for-treehash and
3193 --build-id-min-file-size-for-treehash.
3194 * Makefile.am: add testing of --build-id=tree and related new options
3195 (these tests will be invoked by "make check").
3196 * Makefile.in: Regenerate.
3198 2013-04-25 Alan Modra <amodra@gmail.com>
3200 * configure.tgt: Add powerpcle and powerpc64le.
3202 2013-04-22 Alan Modra <amodra@gmail.com>
3205 * layout.cc (Layout::segment_precedes): Allow more than one
3206 segment with the same type and flags.
3208 2013-04-15 Cary Coutant <ccoutant@google.com>
3210 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3211 allocate space in file for BSS sections.
3213 2013-04-15 Cary Coutant <ccoutant@google.com>
3215 * script-sections.cc (Orphan_output_section): Reset address
3216 to zero after each orphaned section for relocatable links.
3218 2013-04-15 Cary Coutant <ccoutant@google.com>
3220 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3221 section starting address for relocatable link.
3222 * testsuite/Makefile.am (script_test_11): New test.
3223 * testsuite/Makefile.in: Regenerate.
3224 * testsuite/script_test_11.c: New source file.
3225 * testsuite/script_test_11.t: New linker script.
3227 2013-04-13 Alan Modra <amodra@gmail.com>
3229 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3230 owner when sections are not adjacent and exceed group size.
3231 (Target_powerpc::group_sections): Handle corner case.
3232 (Target_powerpc::Branch_info::make_stub): Handle case where
3233 stub table doesn't exist due to branches in non-exec sections.
3234 (Target_powerpc::Relocate::relocate): Likewise.
3236 2013-04-11 Alan Modra <amodra@gmail.com>
3239 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3240 .branch_lt to match bfd ld. Adjust comments throughout file.
3242 2013-04-04 Ian Lance Taylor <iant@google.com>
3245 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3246 sections before checking whether they are included in the link.
3248 2013-03-29 Sriraman Tallam <tmsriram@google.com>
3250 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3251 object before calling the plugin claim_file handler. Pass the elf
3252 object of the archive to the plugin. Delete the elf object if the
3253 plugin claims the file.
3255 2013-03-21 Alan Modra <amodra@gmail.com>
3257 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3258 segment when omagic.
3260 2013-03-21 Alan Modra <amodra@gmail.com>
3262 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3264 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3265 uninitialized" warning.
3267 2013-03-20 Alan Modra <amodra@gmail.com>
3269 * symtab.h (Symbol::clear_version): New function.
3270 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3271 is_needed by weak references. Clear version for symbols defined
3272 in as-needed objects that are not needed.
3274 2013-03-15 Alan Modra <amodra@gmail.com>
3276 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3277 static and public. Add report_err param. Return false for data refs.
3278 (Target_powerpc::rela_dyn_section): New overloaded function.
3279 (Target_powerpc::plt_, iplt_): Elucidate.
3280 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3281 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3282 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3283 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3284 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3285 push_branch and make_plt_entry for ifunc syms when
3286 reloc_needs_plt_for_ifunc.
3287 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3288 for ifunc unless reloc_needs_plt_for_ifunc.
3290 2013-03-15 Alan Modra <amodra@gmail.com>
3292 * gc.h (gc_process_relocs): Don't look through function descriptors.
3293 * icf.cc (get_section_contents): Do so here instead.
3295 2013-03-13 Alan Modra <amodra@gmail.com>
3297 * powerpc.cc (is_branch_reloc): Forward declare.
3298 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3299 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3300 false for 64-bit, true for 32-bit non-branch relocs.
3301 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3302 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3304 (icf_safe_test): Generate linker map file as well as nm output.
3305 (icf_safe_so_test): Likewise.
3306 * testsuite/Makefile.in: Regenerate.
3307 * testsuite/icf_test.sh: Parse linker map file to determine
3309 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3310 * testsuite/icf_safe_so_test.sh: Likewise.
3311 (X86_32_or_ARM_specific_safe_fold): Merge into..
3312 (arch_specific_safe_fold): ..this.
3313 (X86_64_specific_safe_fold): Delete unused function.
3315 2013-03-12 Alan Modra <amodra@gmail.com>
3317 * gc.h (gc_process_relocs): Look through function descriptors
3318 to determine shndx, symvalue and addend used by ICF. Tidy
3319 variable duplication.
3321 2013-03-11 Alan Modra <amodra@gmail.com>
3323 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3324 * layout.cc (Layout_task_runner::run): ..to here.
3325 * symtab.h (struct Symbol_location): Extract from..
3326 (class Symbol_table): ..here.
3327 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3328 * target.h (class Target): Add function_location and
3329 do_function_location functions.
3330 (class Sized_target): Add do_function_location.
3331 * object.h (class Sized_relobj_file): Move find_shdr..
3332 (class Object): ..to here.
3333 * object.cc: Likewise. Update to suit. Instantiate.
3334 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3335 * powerpc.cc (class Powerpc_dynobj): New.
3336 (Target_powerpc::do_function_location): New function.
3337 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3338 (Powerpc_dynobj::do_read_symbols): New function.
3339 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3341 2013-03-08 Ian Lance Taylor <iant@google.com>
3343 * options.cc (General_options::string_to_object_format): Accept
3346 2013-03-08 Alan Modra <amodra@gmail.com>
3348 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3349 pointer to Post_fde.
3350 (struct Post_fde): Move definition to here..
3351 * ehframe.cc (struct Post_fde): ..from here.
3352 (Cie::write): Don't alloc Post_fde.
3353 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3355 2013-03-07 Alan Modra <amodra@gmail.com>
3357 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3358 relocation referencing .LC0.
3359 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3361 2013-03-07 Alan Modra <amodra@gmail.com>
3363 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3364 always_inline. Add assembly for powerpc to avoid GOT.
3366 2013-03-07 Alan Modra <amodra@gmail.com>
3368 * testsuite/script_test_10.sh: Don't test .bss section
3371 2013-03-06 Alan Modra <amodra@gmail.com>
3373 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3374 (Target_powerpc::symval_for_branch): Add symtab param. Update
3375 all callers. Handle folded sections.
3376 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3378 (Global_symbol_visitor_opd::operator()): Likewise.
3380 2013-03-04 Alan Modra <amodra@gmail.com>
3382 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3383 * testsuite/Makefile.in: Regenerate.
3385 2013-03-01 Cary Coutant <ccoutant@google.com>
3387 Add dwp support for v2 DWARF package file format.
3388 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3389 tu_length parameter. Adjust all callers.
3390 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3391 * dwp.cc: Include dwarf.h.
3392 (Section_bounds): New struct type.
3393 (Unit_set): New struct type.
3394 (Dwo_file::Dwo_file): Initialize new data member.
3395 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3396 Combine and rename to...
3397 (Dwo_file::read_unit_index): ...this.
3398 (Dwo_file::sized_read_compunit_index)
3399 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3400 (Dwo_file::sized_read_unit_index): ...this.
3401 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3402 parameters; add section_id parameter.
3403 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3404 (Dwo_file::add_unit_set): ...this.
3405 (Dwo_file::shndx_map_): Remove.
3406 (Dwo_file::sect_offsets_): New data member.
3407 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3408 (Dwp_output_file::add_section): Rename to...
3409 (Dwp_output_file::add_contribution): ...this.
3410 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3411 (Dwp_output_file::add_tu_set): Likewise.
3412 (Dwp_output_file::Contribution): New type.
3413 (Dwp_output_file::Section::contributions): New data member.
3414 (Dwp_output_file::Cu_or_tu_set): Remove.
3415 (Dwp_output_file::Section::Section): New ctor.
3416 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3417 (Dwp_output_file::Dwp_index::Section_table): New type.
3418 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3419 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3421 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3422 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3423 (Dwp_output_file::Dwp_index::section_table): New member function.
3424 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3425 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3426 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3427 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3428 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3429 (Dwp_output_file::Dwp_index::section_table_): New data member.
3430 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3431 (Dwp_output_file::add_output_section): New member function.
3432 (Dwp_output_file::write_new_section): New member function.
3433 (Dwp_output_file::write_contributions): New member function.
3434 (Dwp_output_file::section_id_map_): New data member.
3435 (class Dwo_id_info_reader): Remove.
3436 (class Unit_reader): New class.
3437 (get_dwarf_section_name): New function.
3438 (Dwo_file::read_executable): Adjust initializations of class data.
3439 (Dwo_file::read): Add support for v2 package file format.
3440 (Dwo_file::read_unit_index): Likewise.
3441 (Dwo_file::sized_read_unit_index): Likewise.
3442 (Dwo_file::copy_section): Likewise.
3443 (Dwo_file::add_unit_set): Likewise.
3444 (Dwp_output_file::add_output_section): Likewise.
3445 (Dwp_output_file::add_contribution): Likewise.
3446 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3448 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3450 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3452 (Dwp_output_file::initialize): Remove unused function.
3453 (Dwp_output_file::finalize): Add support for v2 package file format.
3454 (Dwp_output_file::write_index): Likewise.
3455 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3458 2013-03-01 Cary Coutant <ccoutant@google.com>
3460 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3461 function into class definition in header file.
3462 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3463 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3465 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3467 2013-02-28 Alan Modra <amodra@gmail.com>
3469 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3470 * target.cc (Target::do_plt_fde_location): New function.
3471 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3472 accessor function, and constructor param.
3473 (struct Post_fde, Post_fdes): Declare.
3474 (Cie::write): Add post_fdes param.
3475 * ehframe.cc (Fde::write): Use plt_fde_location.
3476 (struct Post_fde): Define.
3477 (Cie::write): Stash FDEs added post merge mapping.
3478 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3479 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3480 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3482 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3483 (Target_powerpc::has_glink): New function.
3484 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3485 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3486 glink_eh_frame_fde_32, default_fde): New data.
3487 (Stub_table::eh_frame_added_): New var.
3488 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3490 (Stub_table::add_eh_frame): New function.
3491 (Output_data_glink::add_eh_frame): New function.
3492 (Target_powerpc::make_glink_section): Call add_eh_frame.
3494 2013-02-15 Ian Lance Taylor <iant@google.com>
3496 * options.h (DEFINE_uint64_alias): Define.
3497 (class General_options): Add -Ttext-segment as an alias for
3500 2013-02-15 Alan Modra <amodra@gmail.com>
3502 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3503 (Stub_table::do_write): ..here, two places.
3504 (Stub_table::plt_call_size): Use it here too.
3506 2013-02-11 Ian Lance Taylor <iant@google.com>
3508 * descriptors.cc (Descriptors::close_all): New function.
3509 * descriptors.h (class Descriptors): Declare close_all.
3510 (close_all_descriptors): New inline function.
3511 * plugin.cc: Include "descriptors.h".
3512 (Plugin_manager::cleanup): Call close_all_descriptors.
3514 2013-02-06 Alan Modra <amodra@gmail.com>
3516 * README: Update coding style link.
3518 2013-01-28 Cary Coutant <ccoutant@google.com>
3520 * dwp.cc (File_list): New typedef.
3521 (Dwo_name_info_reader): New class.
3522 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3523 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3524 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3525 (Dwo_file::read_executable): New function.
3526 (Dwo_file::read): Move common setup code to ...
3527 (Dwo_file::make_object): ... here.
3528 (dwp_options): Add --exec/-e.
3532 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3534 * layout.cc (Layout::layout): Check for option text_reorder.
3535 (Layout::make_output_section): Ditto.
3536 * options.h (text_reorder): New option.
3537 * output.cc (Input_section_sort_compare): Remove special ordering
3540 Input_section_sort_section_name_special_ordering_compare::
3541 operator()): New function.
3542 (Output_section::sort_attached_input_sections): Use new sort function
3544 * output.h (Input_section_sort_section_name_special_ordering_compare):
3546 * testsuite/Makefile.am (text_section_grouping): Test option
3548 * testsuite/Makefile.in: Regenerate.
3549 * testsuite/text_section_grouping.sh: Check order of functions without
3550 default text reordering.
3552 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3554 * options.h (General_options): Change default to true for new_dtags.
3556 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3558 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3559 when enable_new_dtags is false. Only add DT_RUNPATH when
3560 enable_new_dtags is true.
3562 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3564 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3565 used in declaration and definition consistent.
3566 (Target_powerpc::symval_for_branch): Ditto.
3568 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3570 * testsuite/plugin_final_layout.cc: Fix comment.
3572 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3574 * layout.cc (Layout::layout): Do not do default sorting for
3575 text sections when section ordering is specified.
3576 (make_output_section): Ditto.
3577 * testsuite/plugin_final_layout.cc: Name the function sections
3578 to catch reordering issues.
3580 2013-01-15 Alan Modra <amodra@gmail.com>
3582 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3585 2013-01-15 Alan Modra <amodra@gmail.com>
3587 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3588 * testsuite/Makefile.in: Regenerate.
3590 2013-01-14 Alan Modra <amodra@gmail.com>
3592 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3593 * testsuite/Makefile.in: Regenerate.
3595 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3598 Fix mingw gold build with plugins enabled
3599 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3600 * configure.ac: Export DLOPEN_LIBS and add headers check.
3601 * plugin.cc: Handle non-dlfcn case.
3602 * Makefile.in: Regenerate.
3603 * config.in: Regenerate.
3604 * configure: Regenerate.
3605 * testsuite/Makefile.in: Regenerate.
3607 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3609 * output.h (sort_attached_input_sections): Change to be public.
3610 * script-sections.cc
3611 (Output_section_definition::set_section_addresses): Sort
3612 attached input sections according to section order before linker
3613 script assigns section addresses.
3614 (Orphan_output_section::set_section_addresses): Sort
3615 attached input sections according to section order before linker
3616 script assigns section addresses.
3617 * Makefile.am (final_layout.sh): Use a simple linker script to
3618 check if section ordering still works.
3619 * Makefile.in: Regenerate.
3621 2013-01-09 Ben Cheng <bccheng@google.com>
3623 * arm.cc (Target_arm::attributes_accept_div): New function.
3624 (Target_arm::attributes_forbid_div): New function.
3625 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3626 attribute using the same new functions as what bfd/elf32_arm.c
3629 2013-01-07 Cary Coutant <ccoutant@google.com>
3632 * output.cc (Output_section::add_input_section): For incremental
3633 updates, don't track input sections that are allocated from patch
3636 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3637 Ian Lance Taylor <iant@google.com>
3640 * configure.ac (--enable-ld): Removed.
3641 (install_as_default): Set to yes only for --enable-gold=default
3643 * configure: Regenerated.
3645 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3647 * options.h (General_options): Add -fuse-ld= for GCC linker
3648 option compatibility.
3650 2013-01-04 Cary Coutant <ccoutant@google.com>
3652 * configure.ac: Fix typo restoring CXXFLAGS.
3653 * configure: Regenerate.
3655 2013-01-04 Cary Coutant <ccoutant@google.com>
3657 * testsuite/Makefile.am (CXXLINK_S): New macro.
3658 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3659 * testsuite/Makefile.in: Regenerate.
3661 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3663 * version.cc (print_version): Update copyright year to 2013.
3665 2012-12-20 Ian Lance Taylor <iant@google.com>
3667 * layout.cc (Layout::special_ordering_of_input_section): New
3669 (Layout::layout): If input section requires special ordering, must
3670 sort input sections.
3671 (Layout::make_output_section): May sort .text input sections.
3672 (Layout::is_section_name_prefix_grouped): Remove.
3673 * layout.h (class Layout): Declare
3674 special_ordering_of_input_section. Don't declare
3675 is_section_name_prefix_grouped.
3676 * output.cc (Output_section::add_input_section): Revert last
3678 (Output_section::Input_section_sort::match_file_name): Don't crash
3679 if called on output section data.
3680 (Output_section::Input_section_sort_compare): Sort based on
3682 (Output_section::Input_section_sort_section_order_index_compare):
3684 (Output_section::sort_attached_input_sections): Likewise.
3686 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3688 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3689 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3690 * output.cc (Output_section::add_input_section): Check if section
3691 name contains special prefix. Keep input sections to sort such
3693 (Output_section::Input_section_sort_section_order_index_compare
3694 ::operator()): Group sections according to prefixes.
3695 (Output_section::sort_attached_input_sections): Add condition to
3696 Input_section_entry constructor call.
3697 * testsuite/Makefile.am (text_section_grouping): New test.
3698 * testsuite/Makefile.in: Regenerate.
3699 * testsuite/text_section_grouping.cc: New file.
3700 * testsuite/text_section_grouping.sh: New file.
3702 2012-12-17 Nick Clifton <nickc@redhat.com>
3704 * Makefile.am: Add copyright notice.
3707 * configure.ac: Likewise.
3708 * ftruncate.c: Likewise.
3709 * Makefile.in: Regenerate.
3711 2012-12-14 Cary Coutant <ccoutant@google.com>
3713 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3714 --no-as-needed flag.
3715 (exception_separate_shared_12_test): Likewise.
3716 (incremental_copy_test): Likewise.
3717 * testsuite/Makefile.in: Regenerate.
3719 2012-12-14 Cary Coutant <ccoutant@google.com>
3721 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3722 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3724 2012-12-12 Alan Modra <amodra@gmail.com>
3726 * powerpc.cc (class Track_tls): New.
3727 (class Relocate, class Scan): Inherit Track_tls.
3728 (Target_powerpc::Scan::local, global): Track tls optimization
3729 and avoid creating plt entry for __tls_get_addr if all uses
3731 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3733 2012-12-12 Alan Modra <amodra@gmail.com>
3735 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3736 Replace no_toc_optimize with toc_optimize.
3737 * output.h (Output_section::input_sections): Provide non-const variant.
3738 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3739 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3741 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3742 (class Sort_toc_sections): New.
3743 (Target_powerpc::do_finalize_sections): Sort toc sections.
3744 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3746 2012-12-10 Roland McGrath <mcgrathr@google.com>
3748 * testsuite/binary_unittest.cc (read_all): New function.
3749 (Sized_binary_test): Use it instead of ::read.
3750 * fileread.cc (do_read): Don't assume pread always reads the whole
3751 amount in a single call.
3753 2012-12-10 Alan Modra <amodra@gmail.com>
3755 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3756 Set EM_PPC64 or EM_PPC here.
3757 (Target_selector_powerpc::do_recognize): Delete.
3759 2012-12-10 Alan Modra <amodra@gmail.com>
3761 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3763 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3765 2012-12-07 Roland McGrath <mcgrathr@google.com>
3767 * testsuite/binary_unittest.cc (Sized_binary_test):
3768 Use open_descriptor rather than ::open.
3770 2012-12-07 Alan Modra <amodra@gmail.com>
3772 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3773 typedef and invalid_address constant.
3774 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3775 instantiate constants.
3777 2012-12-06 Roland McGrath <mcgrathr@google.com>
3779 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3780 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3781 * aclocal.m4: Regenerate.
3782 * configure: Regenerate.
3783 * Makefile.in: Regenerate.
3784 * testsuite/Makefile.in: Regenerate.
3786 2012-12-07 Alan Modra <amodra@gmail.com>
3788 * options.h (General_options): Add no_toc_optimize.
3789 * powerpc.cc (ok_lo_toc_insn): New function.
3790 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3792 2012-12-06 Alan Modra <amodra@gmail.com>
3794 * options.h (General_options): Add plt_align, plt_static_chain,
3795 plt_thread_safe. Update stub_group_size help text.
3796 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3797 for new plt_thread_safe_ var.
3798 (use_plt_offset): Correct comments.
3799 (Target_powerpc::do_relax): Look for thread creation symbols to
3800 determine default plt_thread_safe value. Clear plt call stubs
3801 as well as branch stubs each iteration.
3802 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3804 (l, hi, ha, write_insn): Move earlier.
3805 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3806 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3808 (Stub_table::update_size): Adjust.
3809 (Stub_table::prev_size, set_prev_size): Delete.
3810 (Stub_table::stub_align): Let --plt-align affect result.
3811 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3812 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3813 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3814 (Stub_table::do_write): Support more stub variants.
3816 2012-12-04 Alan Modra <amodra@gmail.com>
3818 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3819 (Target_powerpc::do_define_standard_symbols): New function.
3821 2012-12-03 Alan Modra <amodra@gmail.com>
3823 * output.h: Formatting, whitespace.
3825 2012-12-03 Alan Modra <amodra@gmail.com>
3827 * layout.h (Layout::get_executable_sections): Declare.
3828 * layout.cc (Layout::get_executable_sections): New function.
3829 * arm.cc (Target_arm::group_sections): Use it.
3830 (Arm_output_section::group_sections): Delete now redundant test.
3831 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3832 param to handle relative relocs.
3833 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3834 (Output_data_reloc::add_absolute): Adjust.
3835 (Output_data_reloc::add_relative): New function.
3836 (Output_data::reset_data_size): New function.
3837 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3838 (Output_section::set_addralign): New function.
3839 (Output_section::checkpoint_set_addralign): New function.
3840 (Output_section::clear_section_offsets_need_adjustment): New function.
3841 (Output_section::input_sections): Make public.
3842 * powerpc.cc (class Output_data_brlt_powerpc): New.
3843 (class Stub_table, class Stub_control): New.
3844 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3845 stub_table_, set_stub_table, stub_table): New vectors and accessor
3847 (Target_powerpc::do_may_relax, do_relax, push_branch,
3848 new_stub_table, stub_tables, brlt_section, group_sections,
3849 add_branch_lookup_table, find_branch_lookup_table,
3850 write_branch_lookup_table, make_brlt_section): New functions.
3851 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3852 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3853 branch_info_): New vars.
3854 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3855 make call stubs here.
3856 (Output_data_glink): Remove all call stub handling from this class.
3857 (Target_powerpc::Scan::local, global): Save interesting branch
3858 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3859 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3860 functions on final link.
3861 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3862 Handle long branch destinations too.
3863 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3864 do_plt_address_for_local): Adjust lookup of plt call stubs.
3866 2012-11-30 Alan Modra <amodra@gmail.com>
3868 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3869 relocs against protected symbols when building 32-bit shared libs.
3871 2012-11-30 Alan Modra <amodra@gmail.com>
3873 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3874 param. Call got_section() to make .got. Update all callers
3875 and their callers and so on.
3877 2012-11-30 Alan Modra <amodra@gmail.com>
3879 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3880 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3881 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3882 value if it already exists.
3884 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3887 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3889 2012-11-14 Roland McGrath <mcgrathr@google.com>
3891 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3892 than bfc instruction for data sandboxing.
3894 2012-11-08 Alan Modra <amodra@gmail.com>
3896 * po/POTFILES.in: Regenerate.
3898 2012-11-05 Alan Modra <amodra@gmail.com>
3900 * configure.ac: Apply 2012-09-10 change to config.in here.
3901 * configure: Regenerate.
3903 2012-11-05 Alan Modra <amodra@gmail.com>
3905 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3906 (struct Opd_ent): Use "Address" rather than "Offset".
3907 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3908 (Target_powerpc::got_section): Make public.
3909 (Target_powerpc::scan_relocs): Move code setting symbols..
3910 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3911 Create _SDA_BASE_ only when referenced.
3913 2012-11-02 Roland McGrath <mcgrathr@google.com>
3915 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3918 2012-11-01 Roland McGrath <mcgrathr@google.com>
3920 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3921 for offset_in_output_section parameter.
3922 (Sized_target::relocate_special_relocatable): Likewise.
3923 * arm.cc (Target_arm::relocate_relocs): Likewise.
3924 (Target_arm::relocate_special_relocatable): Likewise.
3925 * i386.cc (Target_i386::relocate_relocs): Likewise.
3926 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3927 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3928 * target-reloc.h (relocate_relocs): Likewise.
3929 * testsuite/testfile.cc (Target_test): Likewise.
3930 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3931 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3933 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3934 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3936 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3937 parameter, which is unused in the [!F_SETFD] case.
3939 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3940 SYMNDX to off_t before comparing it to this->data_size().
3941 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3942 * incremental.cc (Output_section_incremental_inputs::do_write):
3943 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3945 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3947 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3949 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3950 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3953 2012-10-29 Cary Coutant <ccoutant@google.com>
3955 * dwp.cc (usage): Add file and exit status parameters;
3956 add --help and --version options.
3957 (print_version): New function.
3958 (main): Add --help and --version options.
3960 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3962 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3963 final_layout_sequence.txt.
3964 * testsuite/Makefile.in: Regenerated.
3966 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3968 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3969 COMPILE generated by automake.
3971 (CXXCOMPILE1): Likewise.
3972 (CXXLINK1): Likewise.
3973 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3975 (CXXCOMPILE): Likewise.
3976 (CXXLINK): Likewise.
3977 * testsuite/Makefile.in: Regenerated.
3979 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3981 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3982 on bad fwrite return.
3984 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3986 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3989 2012-10-23 Cary Coutant <ccoutant@google.com>
3991 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3992 * testsuite/Makefile.in: Regenerate.
3993 * testsuite/dwp_test.h: New source file.
3994 * testsuite/dwp_test_1.cc: New source file.
3995 * testsuite/dwp_test_1.s: New source file.
3996 * testsuite/dwp_test_1.sh: New source file.
3997 * testsuite/dwp_test_1b.cc: New source file.
3998 * testsuite/dwp_test_1b.s: New source file.
3999 * testsuite/dwp_test_2.cc: New source file.
4000 * testsuite/dwp_test_2.s: New source file.
4001 * testsuite/dwp_test_2.sh: New source file.
4002 * testsuite/dwp_test_main.cc: New source file.
4003 * testsuite/dwp_test_main.s: New source file.
4005 2012-10-23 Cary Coutant <ccoutant@google.com>
4007 * dwp.h: New header file.
4008 * dwp.cc: New source file.
4009 * gold.h: Move shared declarations to system.h.
4010 * system.h: New header file.
4011 * Makefile.am: Add dwp.
4012 * Makefile.in: Regenerate.
4014 2012-10-23 Cary Coutant <ccoutant@google.com>
4016 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4017 Dwarf_info_reader::read_from_pointer.
4018 (Dwarf_pubnames_table::read_header): Likewise.
4019 (Dwarf_pubnames_table::next_name): Likewise.
4020 (Dwarf_die::read_attributes): Likewise.
4021 (Dwarf_die::skip_attributes): Likewise.
4022 (Dwarf_info_reader::read_from_pointer): New function template.
4023 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4024 (Dwarf_pubnames_table): Likewise.
4025 (Dwarf_info_reader::read_from_pointer): New function template.
4026 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4027 Dwarf_pubnames_table ctor.
4029 2012-10-23 Cary Coutant <ccoutant@google.com>
4031 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4033 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4035 (Dwarf_info_reader::set_abbrev_shndx): New method.
4036 (Dwarf_info_reader::abbrev_shndx_): New data member.
4038 2012-10-23 Cary Coutant <ccoutant@google.com>
4040 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4041 from object, not parameters.
4042 (Dwarf_info_reader::parse): Likewise.
4043 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4044 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4045 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4048 2012-10-23 Cary Coutant <ccoutant@google.com>
4050 * fileread.cc (Input_file::Input_file): New constructor.
4051 * fileread.h (class Input_file): Add new constructor.
4053 2012-10-18 Alan Modra <amodra@gmail.com>
4056 * object.cc (Relobj::is_section_name_included): Also match
4057 .sdata personality section.
4059 2012-10-18 Alan Modra <amodra@gmail.com>
4061 * target-reloc.h (class Default_comdat_behavior): New, package up..
4062 (get_comdat_behaviour): ..this.
4063 (relocate_section): Add Relocate_comdat_behavior template arg,
4064 adjust code to suit.
4065 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4066 (Target_arm::scan_reloc_section): Likewise.
4067 * i386.cc (Target_i386::relocate_section): Likewise.
4068 * sparc.cc (Target_sparc::relocate_section): Likewise.
4069 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4070 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4071 * powerpc.cc (class Relocate_comdat_behavior): New.
4072 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4073 gold::relocate_section with new template arg.
4075 2012-10-18 Alan Modra <amodra@gmail.com>
4077 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4078 dynamic relocs for GOT_TPREL got entries, without symbol if
4080 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4081 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4082 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4084 2012-10-17 Alan Modra <amodra@gmail.com>
4087 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4089 2012-10-16 Sriraman Tallam <tmsriram@google.com>
4091 * layout.cc (Layout::include_section): Keep sections marked
4092 SHF_EXCLUDE when doing relocatable links.
4094 2012-10-16 Alan Modra <amodra@gmail.com>
4096 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4097 (Target_powerpc::do_finalize_sections): Call it.
4098 (Output_data_save_res): New class and supporting functions.
4099 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4100 normal symbols defined in object files.
4102 2012-10-12 Alan Modra <amodra@gmail.com>
4104 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4105 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4106 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4107 section if scan_opd_relocs not yet called.
4108 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4110 2012-10-12 Alan Modra <amodra@gmail.com>
4112 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4113 add_local_ifunc_entry): Revert last change.
4114 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4116 2012-10-05 Alan Modra <amodra@gmail.com>
4118 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4119 do_plt_address_for_global): New functions.
4120 (Output_data_got_powerpc::do_write): Don't segfault when linking
4122 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4123 add_local_ifunc_entry): Return true on adding entry..
4124 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4125 glink->add_entry call. Remove unused symtab param. Adjust calls.
4126 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4127 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4128 set up symbols here.
4129 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4130 syms here. Do so even when no .iplt. Don't segfault when linking
4132 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4133 new variants without reloc param.
4134 (Glink_sym_ent::Glink_sym_ent): Likewise.
4135 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4136 reloc when refs will resolve to plt call stub.
4137 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4138 R_PPC_PLTREL24 to resolve locally.
4139 (Target_powerpc::Scan::global): Correct ifunc handling.
4140 (Target_powerpc::Relocate::relocate): Correct local sym glink
4141 lookup. Don't destroy "value" when we have a plt call stub,
4142 and when checking plt call validity.
4143 (Target_powerpc::do_dynsym_value): Simplify.
4145 2012-10-05 Alan Modra <amodra@gmail.com>
4147 * i386.cc (Output_data_plt_i386::address_for_global,
4148 address_for_local): Add plt offset to returned value. Adjust uses.
4149 * sparc.cc (Output_data_plt_sparc::address_for_global,
4150 address_for_local): Likewise.
4151 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4152 address_for_local): Likewise.
4153 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4154 address_for_local): Likewise.
4155 * target.h (Target::plt_address_for_global, plt_address_for_local):
4157 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4158 (Output_data_got::Got_entry::write): Nor here.
4159 * output.h: Comment fix.
4161 2012-10-02 Jiong Wang <jiwang@tilera.com>
4163 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4164 global_offset_table_ value for larget got.
4165 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4167 2012-09-29 Alan Modra <amodra@gmail.com>
4169 * powerpc.cc (Target_powerpc::iplt_): New output section.
4170 (Target_powerpc::iplt_section, make_iplt_section,
4171 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4172 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4173 Target_powerpc::plt_entry_count): Count iplt entries too.
4174 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4175 reloc section in constructor. New params.
4176 (Target_powerpc::make_plt_section): Create reloc section here instead.
4177 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4179 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4180 (Output_data_glink::add_entry, find_entry): New functions to
4181 deal with local syms.
4182 (Glink_sym_ent): Add support for local syms.
4183 (Output_data_glink::do_write): Handle ifunc plt entries.
4184 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4185 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4186 (Target_powerpc::Relocate::relocate): Likewise.
4187 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4189 2012-09-25 Alan Modra <amodra@gmail.com>
4191 * object.h (Sized_relobj_file::adjust_local_symbol,
4192 do_adjust_local_symbol): New functions.
4193 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4194 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4195 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4196 and irregular opd entry spacing.
4197 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4198 (Global_symbol_visitor_opd): New functor.
4199 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4200 on deleted opd entries.
4202 2012-09-15 Jiong Wang <jiwang@tilera.com>
4204 * tilegx.cc: New file.
4205 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4206 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4207 * configure.tgt: Add entries for tilegx*.
4208 * configure.ac: Likewise.
4209 * Makefile.in: Rebuild.
4210 * configure: Likewise.
4211 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4214 2012-09-13 Alan Modra <amodra@gmail.com>
4216 * target-reloc.h (scan_relocs): Call scan.local for relocs
4217 against symbols in discarded sections. Pass is_discarded
4219 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4220 Add is_discarded param.
4221 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4222 is_discarded to flag opd entry as discarded. Don't emit dyn
4223 relocs on such entries.
4224 (Target_powerpc::Scan::global): Similarly detect and handle
4226 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4227 opd_ent_. Update all uses.
4228 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4229 (Target_powerpc::relocate_section): Zero out discarded opd
4232 2012-09-12 Ian Lance Taylor <iant@google.com>
4235 * output.cc: Rename Output_data_got template parameter from size
4236 to got_size for all functions. Compile all variants of
4238 (Output_data_got::Got_entry::write): Correct use of size for
4239 symbol value. Use local_is_tls rather than casting to
4241 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4242 (class Sized_relobj_file): Add do_local_is_tls.
4243 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4245 2012-09-11 Alan Modra <amodra@gmail.com>
4248 * layout.cc (Layout::set_segment_offsets): When using
4249 common-page-size alignment, ensure we are on a new max-page-size
4251 * output.cc (Output_segment::set_section_addresses): Use
4252 abi_pagesize, not common_pagesize for relro boundary.
4253 (Output_segment::set_offset): Likewise.
4255 2012-09-11 Alan Modra <amodra@gmail.com>
4257 * output.h (Output_data_got::add_global_tls, add_local_tls,
4258 add_local_tls_pair): New functions.
4259 (Output_data_got::add_local_pair_with_rel): Remove second
4260 reloc param. Expand comment.
4261 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4262 use_plt_or_tls_offset_, similarly for constructor param.
4263 (Output_data_got::Got_entry::write): Add got_index param.
4264 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4265 add_local_tls_pair): New functions.
4266 (Output_data_got::Got_entry::write): Handle tls symbols
4267 with use_plt_or_tls_offset_ set specially.
4268 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4269 (Output_data_got::do_write): Replace iterator with index, pass
4270 index to entry write function.
4271 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4272 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4273 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4275 * i386.cc (Target_i386::Scan::local): Likewise.
4276 * sparc.cc (Target_sparc::Scan::local): Likewise.
4277 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4278 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4279 do_tls_offset_for_global): New functions.
4280 (Target_powerpc::Scan::local): Correct TLS relocations and got
4282 (Target_powerpc::Scan::global): Don't emit unnecessary
4283 dynamic relocations on TLS GOT entries.
4285 2012-09-10 Matthias Klose <doko@ubuntu.com>
4287 * config.in: Disable sanity check for kfreebsd.
4289 2012-09-10 Sterling Augustine <saugustine@google.com>
4291 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4292 (Gdb_index::pubtypes_read): New parameter.
4293 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4295 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4298 2012-09-09 Alan Modra <amodra@gmail.com>
4300 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4301 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4302 * gc.h (gc_process_relocs): Call target gc_add_reference.
4303 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4304 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4305 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4307 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4308 to cater for when we don't need code offset. Update use.
4309 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4310 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4311 set_opd_valid): New functions.
4312 (Target_powerpc::do_gc_add_reference): New function.
4313 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4315 (Target_powerpc::do_gc_mark_symbol): New function.
4317 2012-09-06 Cary Coutant <ccoutant@google.com>
4319 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4320 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4321 (Dwarf_die::skip_attributes): Likewise.
4322 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4323 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4325 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4327 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4329 * testsuite/script_test_3.t: Add .got.plt output section
4331 * testsuite/script_test_4.t: Likewise.
4333 2012-09-05 Alan Modra <amodra@gmail.com>
4335 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4336 update all uses and lose "enum" when using type.
4338 2012-09-05 Alan Modra <amodra@gmail.com>
4340 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4341 * configure: Regenerate.
4342 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4343 (plugin_final_layout.stdout): Likewise.
4344 (memory_test): Set page sizes to 0x1000.
4345 * testsuite/Makefile.in: Regenerate.
4346 * testsuite/discard_locals_test.sh: Add FIXME comment.
4347 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4348 * testsuite/pr14265.t: Add .got output section statement.
4349 * testsuite/script_test_2.t: Likewise.
4350 * testsuite/script_test_3.t: Likewise.
4351 * testsuite/script_test_4.t: Likewise.
4352 * testsuite/script_test_5.t: Likewise.
4353 * testsuite/script_test_6.t: Likewise.
4354 * testsuite/script_test_7.t: Likewise.
4355 * testsuite/script_test_9.t: Likewise.
4357 2012-09-05 Alan Modra <amodra@gmail.com>
4359 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4360 (Powerpc_relocate_functions::Status): New typedef.
4361 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4362 (Target_powerpc::Scan::local): Handle REL64.
4363 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4364 for REL32 and REL64.
4365 (Target_powerpc::symval_for_branch): New function, extracted from..
4366 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4367 checks. Report overflow errors.
4369 2012-09-05 Alan Modra <amodra@gmail.com>
4371 * object.h (Sized_relobj_file::emit_relocs): Delete.
4372 (Sized_relobj_file::emit_relocs_reltype): Delete.
4373 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4374 relocate_relocs for --emit-relocs.
4375 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4376 * output.h: Update comment.
4377 (Output_segment::first_section): New function.
4378 (Output_segment::first_section_load_address): Use first_section.
4379 * output.cc (Output_segment::first_section): New function extracted..
4380 (Output_segment::first_section_load_address): ..from here. Delete.
4381 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4382 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4383 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4384 adjust call to target.h function.
4385 * i386.cc (Target_i386): Likewise.
4386 * sparc.cc (Target_sparc): Likewise.
4387 * x86_64.cc (Target_x86_64): Likewise.
4388 * powerpc.cc (Target_powerpc): Likewise.
4389 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4390 first tls section has section symbol for optimised local dynamic
4392 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4393 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4395 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4396 Rename to relocate_relocs. Update error message.
4398 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4400 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4403 2012-08-31 Alan Modra <amodra@gmail.com>
4405 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4406 (Powerpc_relobj::toc_base_offset): New stub function.
4407 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4408 got_mod_index_offset to tlsld_got_offset. Update all refs.
4409 (Target_powerpc::Relocate::enum skip_tls): New.
4410 (Target_powerpc::call_tls_get_addr_): New var.
4411 (Target_powerpc::is_branch_reloc): Move to file scope.
4412 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4413 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4415 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4416 (powerpc_info): Correct common_pagesize for ppc64.
4417 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4418 (Powerpc_relocate_functions): Add overflow check enums and functions.
4419 Add non-shift version of rela, rela_ua. Delete all rel public
4420 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4421 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4422 addr16_ha3, addr14 functions.
4423 (Output_data_got_powerpc::add_constant_pair): New function.
4424 (Output_data_got_powerpc::got_base_offset): Likewise.
4425 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4426 (instruction constants): Sort, add some more.
4427 (Output_data_glink::do_write): Add and use Address typedef. Use
4428 object->toc_base_offset() stub for 64-bit.
4429 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4430 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4431 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4432 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4433 Always treat .opd relocs as against locally defined symbol.
4434 Correct condition for RELATIVE relocs.
4435 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4436 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4437 for 32-bit syms with a plt entry. Correct ppc64 toc base
4438 calculations. Handle TLS relocs, and more. Add overflow
4439 checking and adjust for Powerpc_relocate_functions changes.
4440 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4441 Reinstate --emit-relocs code with FIXME.
4443 2012-08-30 Alan Modra <amodra@gmail.com>
4445 * layout.cc (Layout::set_segment_offsets): Set p_align to
4446 abi_pagesize, not common_pagesize.
4447 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4448 to determine whether file header can go in segment.
4450 2012-08-30 Alan Modra <amodra@gmail.com>
4452 * output.h (Output_reloc::Output_reloc <output section>): Add
4453 is_relative param. Adjust calls.
4454 (Output_reloc::add_output_section_relative): New functions.
4455 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4457 (Output_reloc::symbol_value): Handle SECTION_CODE.
4459 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4461 * gold.cc (queue_middle_tasks): Call layout again when unique
4462 segments for sections is desired.
4463 * layout.cc (Layout::Layout): Initialize new members.
4464 (Layout::get_output_section_flags): New function.
4465 (Layout::choose_output_section): Call get_output_section_flags.
4466 (Layout::layout): Make output section for mapping to a unique segment.
4467 (Layout::insert_section_segment_map): New function.
4468 (Layout::attach_allocated_section_to_segment): Make unique segment for
4469 output sections marked so.
4470 (Layout::segment_precedes): Check for unique segments when sorting.
4471 * layout.h (Layout::Unique_segment_info): New struct.
4472 (Layout::Section_segment_map): New typedef.
4473 (Layout::insert_section_segment_map): New function.
4474 (Layout::get_output_section_flags): New function.
4475 (Layout::is_unique_segment_for_sections_specified): New function.
4476 (Layout::set_unique_segment_for_sections_specified): New function.
4477 (Layout::unique_segment_for_sections_specified_): New member.
4478 (Layout::section_segment_map_): New member.
4479 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4480 Rename is_gc_pass_one to is_pass_one.
4481 Rename is_gc_pass_two to is_pass_two.
4482 Rename is_gc_or_icf to is_two_pass.
4483 Check for which pass based on whether symbols data is present.
4484 Make it two pass when unique segments for sections is desired.
4485 * output.cc (Output_section::Output_section): Initialize new
4487 * output.h (Output_section::is_unique_segment): New function.
4488 (Output_section::set_is_unique_segment): New function.
4489 (Output_section::is_unique_segment_): New member.
4490 (Output_section::extra_segment_flags): New function.
4491 (Output_section::set_extra_segment_flags): New function.
4492 (Output_section::extra_segment_flags_): New member.
4493 (Output_section::segment_alignment): New function.
4494 (Output_section::set_segment_alignment): New function.
4495 (Output_section::segment_alignment_): New member.
4496 (Output_segment::Output_segment): Initialize is_unique_segment_.
4497 (Output_segment::is_unique_segment): New function.
4498 (Output_segment::set_is_unique_segment): New function.
4499 (Output_segment::is_unique_segment_): New member.
4500 * plugin.cc (allow_unique_segment_for_sections): New function.
4501 (unique_segment_for_sections): New function.
4502 (Plugin::load): Add new functions to transfer vector.
4503 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4504 * Makefile.in: Regenerate.
4505 * testsuite/plugin_final_layout.sh: Check if unique segment
4506 functionality works.
4507 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4509 (allow_unique_segment_for_sections): New global.
4510 (unique_segment_for_sections): New global.
4511 (claim_file_hook): Call allow_unique_segment_for_sections.
4512 (all_symbols_read_hook): Call unique_segment_for_sections.
4514 2012-08-22 Cary Coutant <ccoutant@google.com>
4516 * layout.cc (Layout::include_section): Don't assert on GROUP
4517 sections with --emit-relocs.
4519 2012-08-21 Cary Coutant <ccoutant@google.com>
4521 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4522 if --export-dynamic-symbol names an undef symbol.
4524 2012-08-18 Alan Modra <amodra@gmail.com>
4526 * powerpc.cc: Formatting and white space.
4527 (Powerpc_relobj): Rename got2_section_ to special_.
4528 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4529 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4530 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4531 (Target_powerpc): Add Address typedef and invalid_address. Use
4533 (Target_powerpc::is_branch_reloc): New function.
4534 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4535 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4536 for dst_mask, value and addend.
4537 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4538 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4539 (Output_data_glink::do_write): Correct toc base. Don't try to use
4540 uint16_t for 24-bit offset. Use get_output_section_offset and
4542 (Target_powerpc::Scan::local): Handle more relocs.
4543 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4544 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4545 Plug in toc restoring insn after plt calls. Translate branches
4546 to function descriptor symbols to corresponding entry point.
4547 (Target_powerpc::relocate_for_relocatable): Check return from
4548 get_output_section_offset.
4549 * symtab.h: Comment typo.
4551 2012-08-14 Ian Lance Taylor <iant@google.com>
4553 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4554 unsupported_relocal_local to call unsupported_reloc_global.
4556 2012-08-14 Nick Clifton <nickc@redhat.com>
4559 * script-sections.cc (Sections_element::output_section_name): Add
4560 keep return parameter.
4561 (Output_section_element::match_name): Add keep return parameter.
4562 Return the value of the keep_ member.
4563 * script-sections.h (class Output_section): Update
4564 output_section_name prototype.
4565 * layout.cc (Layout::keep_input_section): New public member
4567 (Layout::choose_output_section): Pass keep parameter to
4568 output_section_name.
4569 * layout.h (class Layout): Add keep_input_section.
4570 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4572 * testsuite/Makefile.am: Add a test.
4573 * testsuite/Makefile.in: Regenerate.
4574 * testsuite/pr14265.c: Source file for the test.
4575 * testsuite/pr14265.t: Linker script for the test.
4576 * testsuite/pr14265.sh: Shell script for the test.
4578 2012-08-14 Alan Modra <amodra@gmail.com>
4580 * target.h (Target::output_section_name): New function.
4581 (Target::do_output_section_name): New function.
4582 * layout.cc (Layout::choose_output_section): Call the above.
4583 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4585 2012-08-14 Alan Modra <amodra@gmail.com>
4587 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4588 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4589 for replace_constant call.
4590 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4591 (Output_data_glink::do_print_to_mapfile): New function.
4592 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4593 (Target_powerpc::Relocate::relocate): Likewise.
4595 2012-08-14 Alan Modra <amodra@gmail.com>
4597 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4598 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4599 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4600 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4601 all references to shndx_. Handle special case for R_PPC_PLTREL24
4603 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4604 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4605 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4607 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4608 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4610 2012-08-12 Alan Modra <amodra@gmail.com>
4612 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4613 (glink insn constants): Use uint32_t.
4614 (Output_data_glink::add_entry): Use insert, not [] operator.
4616 2012-08-11 Alan Modra <amodra@gmail.com>
4618 * object.h (Sized_relobj_file::find_shdr): New function.
4619 (Sized_relobj_file::find_special_sections): New function.
4620 * object.cc (Sized_relobj_file::find_shdr): New function.
4621 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4622 (Sized_relobj_file::find_special_sections): New function, split out..
4623 (Sized_relobj_file::do_read_symbols): ..from here.
4624 * output.h (Output_data_got::replace_constant): New function.
4625 (Output_data_got::num_entries): New function.
4626 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4627 (Output_data_got::got_offset): Protected rather than private.
4628 (Output_data_got::replace_got_entry): New function.
4629 * output.cc (Output_data_got::replace_got_entry): New function.
4630 * powerpc.cc (class Powerpc_relobj): New.
4631 (class Powerpc_relocate_functions): Delete all psymval variants or
4632 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4633 Implement _ha functions using corresponding _hi function.
4634 (Powerpc_relobj::find_special_sections): New function.
4635 (Target_powerpc::do_make_elf_object): New function.
4636 (class Output_data_got_powerpc): New.
4637 (class Output_data_glink): New.
4638 (class Powerpc_scan_relocatable_reloc): New.
4639 Many more changes througout file.
4641 2012-08-09 Nick Clifton <nickc@redhat.com>
4643 * po/vi.po: Updated Vietnamese translation.
4645 2012-08-07 Ian Lance Taylor <iant@google.com>
4647 * layout.cc (Layout::add_target_dynamic_tags): If
4648 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4651 2012-07-30 Nick Clifton <nickc@redhat.com>
4653 * po/gold.pot: Updated template.
4654 * po/es.po: Updated Spanish translation.
4656 2012-07-18 Cary Coutant <ccoutant@google.com>
4659 * configure.ac: Add check for -gpubnames support.
4660 * configure: Regenerate.
4661 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4662 support; force -gno-pubnames.
4663 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4665 (gdb_index_test_4): New test.
4666 * testsuite/Makefile.in: Regenerate.
4667 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4668 * testsuite/gdb_index_test_2.sh: Likewise.
4669 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4670 * testsuite/gdb_index_test_4.sh: New script.
4671 * testsuite/gdb_index_test_comm.sh: New script with common code;
4672 don't look for space after colon.
4674 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4676 * gold.cc (queue_middle_tasks): Update function order only after
4677 deferred objects due to plugins are processed.
4679 2012-07-11 Ian Lance Taylor <iant@google.com>
4681 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4682 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4683 (Target_arm::scan_reloc_for_stub): Likewise.
4684 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4685 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4686 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4687 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4688 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4690 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4691 Ian Lance Taylor <iant@google.com>
4694 * configure.ac: Test whether std::tr1::hash<off_t> works.
4695 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4697 * output.h (class Output_fill): Add virtual destructor.
4698 * configure, config.in: Rebuild.
4700 2012-06-22 Roland McGrath <mcgrathr@google.com>
4702 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4704 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4706 * plugin.cc (Plugin::load): Handle position independent executables.
4708 2012-06-06 Cary Coutant <ccoutant@google.com>
4710 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4712 (lines_only_debug_sections): Likewise.
4713 (gdb_fast_lookup_sections): New static array.
4714 (is_gdb_debug_section): Rename formal parameter.
4715 (is_lines_only_debug_section): Likewise.
4716 (is_gdb_fast_lookup_section): New function.
4717 (Layout::include_section): Check for ".zdebug_" prefix; pass
4718 section name suffix to is_gdb_debug_section, et al.; check for
4719 fast-lookup sections when building .gdb_index.
4720 * options.h (--strip-debug-gdb): Update GDB version number.
4722 2012-06-06 Cary Coutant <ccoutant@google.com>
4724 * configure.ac: Add check for fallocate.
4725 * configure: Regenerate.
4726 * config.in: Regenerate.
4728 * options.h (class General_options): Add --mmap-output-file and
4729 --posix-fallocate options.
4730 * output.cc: (posix_fallocate): Remove; replace with...
4731 (gold_fallocate): New function.
4732 (Output_file::map_no_anonymous): Call gold_fallocate.
4733 (Output_file::map): Check --mmap-output-file option.
4735 2012-06-05 Jing Yu <jingyu@google.com>
4737 * gold.h (textdomain): Add do {} to empty while(0).
4738 (bindtextdomain): Likewise.
4740 2012-06-04 Cary Coutant <ccoutant@google.com>
4742 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4745 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4747 * symtab.cc (Symbol_table::define_special_symbol):
4748 Initialize *poldsym to prevent uninitialized variable errors.
4750 2012-05-23 Cary Coutant <ccoutant@google.com>
4752 * layout.cc (Layout::section_name_mapping): Add rules to handle
4753 exact match on .data.rel.ro.local or .data.rel.ro.
4754 (Layout::output_section_name): Check for exact matches.
4756 2012-05-23 Cary Coutant <ccoutant@google.com>
4758 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4761 2012-05-22 Cary Coutant <ccoutant@google.com>
4763 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4764 object before exporting symbol.
4766 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4768 * testsuite/tls_test.cc: Include "config.h" first.
4769 * testsuite/tls_test_c.c: Likewise.
4771 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4772 Nick Clifton <nickc@redhat.com>
4775 * configure.in: Add check that sysdep.h has been included before
4776 any system header files.
4777 * configure: Regenerate.
4778 * config.in: Regenerate.
4780 2012-05-14 Cary Coutant <ccoutant@google.com>
4782 * layout.cc (Layout::make_output_section): Mark .tdata section
4784 * testsuite/relro_test.cc: Add a TLS variable.
4786 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4789 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4790 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4793 2012-05-08 Cary Coutant <ccoutant@google.com>
4795 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4796 (lines_only_debug_sections): Likewise.
4798 2012-05-02 Roland McGrath <mcgrathr@google.com>
4800 * nacl.cc: New file.
4802 * Makefile.am (CCFILES, HFILES): Add them.
4803 * Makefile.in: Regenerate.
4804 * i386.cc (Output_data_plt_i386_nacl): New class.
4805 (Output_data_plt_i386_nacl_exec): New class.
4806 (Output_data_plt_i386_nacl_dyn): New class.
4807 (Target_i386_nacl): New class.
4808 (Target_selector_i386_nacl): New class.
4809 (target_selector_i386): Use it instead of Target_selector_i386.
4810 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4811 (Target_x86_64_nacl): New class.
4812 (Target_selector_x86_64_nacl): New class.
4813 (target_selector_x86_64, target_selector_x32): Use it instead of
4814 Target_selector_x86_64.
4815 * arm.cc (Output_data_plt_arm_nacl): New class.
4816 (Target_arm_nacl): New class.
4817 (Target_selector_arm_nacl): New class.
4818 (target_selector_arm, target_selector_armbe): Use it instead of
4819 Target_selector_arm.
4821 * target-select.cc (select_target): Take new Input_file* and off_t
4822 arguments, pass them on to recognize method of selector.
4823 * object.cc (make_elf_sized_object): Update caller.
4824 * parameters.cc (parameters_force_valid_target): Likewise.
4825 * incremental.cc (make_sized_incremental_binary): Likewise.
4826 * target-select.h: Update decl.
4827 (Target_selector::recognize): Take new Input_file* argument,
4828 pass it on to do_recognize.
4829 (Target_selector::do_recognize): Take new Input_file* argument.
4830 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4831 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4832 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4833 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4835 * target.h (Target::Target_info): New members isolate_execinstr
4837 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4838 * arm.cc (Target_arm::arm_info): Update initializer.
4839 * i386.cc (Target_i386::i386_info): Likewise.
4840 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4841 * sparc.cc (Target_sparc::sparc_info): Likewise.
4842 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4843 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4844 * layout.cc (Layout::attach_allocated_section_to_segment):
4845 Take new const Target* argument. If target->isolate_execinstr(), act
4847 (Layout::find_first_load_seg): Take new const Target* argument;
4848 if target->isolate_execinstr(), reject PF_X segments.
4849 (Layout::relaxation_loop_body): Update caller.
4850 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4851 reset file offset to zero when we hit LOAD_SEG, and then do a second
4852 loop over the segments before LOAD_SEG to reassign offsets after
4853 addresses have been determined. Handle target->rosegment_gap().
4854 (Layout::attach_section_to_segment): Take new const Target* argument;
4855 pass it to attach_allocated_section_to_segment.
4856 (Layout::make_output_section): Update caller.
4857 (Layout::attach_sections_to_segments): Take new const Target* argument;
4858 pass it to attach_section_to_segment.
4859 * gold.cc (queue_middle_tasks): Update caller.
4860 * layout.h (Layout): Update method decls with new arguments.
4862 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4863 Target_info pointer to use.
4864 (Target_arm::do_make_data_plt): New virtual method.
4865 (Target_arm::make_data_plt): New method that calls it.
4866 (Target_arm::make_plt_entry): Use it.
4867 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4868 for the section alignment.
4869 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4871 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4872 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4874 (Output_data_plt_arm::get_plt_entry_size): Call it.
4875 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4876 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4877 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4879 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4880 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4881 method instead of sizeof(plt_entry).
4882 (Output_data_plt_arm::add_entry): Likewise.
4883 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4884 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4886 (Target_arm::plt_entry_size): Likewise.
4887 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4889 (Output_data_plt_arm_standard): ... here, new class.
4890 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4891 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4892 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4894 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4895 Take additional argument for the PLT entry size.
4896 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4897 Use get_plt_entry_size method rather than plt_entry_size variable.
4898 (Output_data_plt_x86_64::reserve_slot): Likewise.
4899 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4900 (Output_data_plt_x86_64::add_entry): Likewise.
4901 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4902 (Output_data_plt_x86_64::address_for_global): Likewise.
4903 (Output_data_plt_x86_64::address_for_local): Likewise.
4904 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4905 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4906 Make method non-static.
4907 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4909 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4910 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4911 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4912 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4914 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4915 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4917 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4918 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4920 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4921 (Output_data_plt_x86_64::plt_entry_size)
4922 (Output_data_plt_x86_64::first_plt_entry)
4923 (Output_data_plt_x86_64::plt_entry)
4924 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4925 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4926 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4927 (Output_data_plt_x86_64_standard): ... here, new class.
4928 (Target_x86_64::Target_x86_64): Take optional argument for the
4929 Target_info pointer to use.
4930 (Target_x86_64::do_make_data_plt): New virtual method.
4931 (Target_x86_64::make_data_plt): New method to call it.
4932 (Target_x86_64::init_got_plt_for_update): Use that.
4933 Call this->plt_->add_eh_frame method here.
4934 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4935 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4936 rather than static method.
4937 (Target_x86_64::plt_entry_size): Likewise.
4938 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4939 rather than plt_entry_size variable. Move guts of PLT filling to...
4940 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4941 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4942 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4944 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4945 additional argument for the section alignment.
4946 Don't do add_eh_frame_for_plt here.
4947 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4948 non-static. Use get_plt_entry_size method rather than plt_entry_size
4950 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4952 (Output_data_plt_i386::get_plt_entry_size): Call it.
4953 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4954 (Output_data_plt_i386::add_eh_frame): New method to call it.
4955 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4957 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4958 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4960 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4961 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4962 method instead of plt_entry_size.
4963 (Output_data_plt_i386::plt_entry_size)
4964 (Output_data_plt_i386::plt_eh_frame_fde_size)
4965 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4966 (Output_data_plt_i386_standard): ... here, new class.
4967 (Output_data_plt_i386_exec): New class.
4968 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4969 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4970 (Output_data_plt_i386::exec_plt_entry): Move to ...
4971 (Output_data_plt_i386_exec::plt_entry): ... here.
4972 (Output_data_plt_i386_dyn): New class.
4973 (Output_data_plt_i386::first_plt_entry): Move to ...
4974 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4975 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4976 (Output_data_plt_i386_dyn::plt_entry): ... here.
4977 (Target_i386::Target_i386): Take optional argument for the Target_info
4979 (Target_i386::do_make_data_plt): New virtual method.
4980 (Target_i386::make_data_plt): New method to call it.
4981 (Target_i386::make_plt_section): Use that.
4982 Call this->plt_->add_eh_frame method here.
4983 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4984 rather than plt_entry_size variable.
4985 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4986 (Output_data_plt_i386::address_for_local): Likewise.
4987 (Output_data_plt_i386::do_write): Likewise.
4988 Move guts of PLT filling to...
4989 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4990 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4991 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4992 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4994 2012-05-01 Cary Coutant <ccoutant@google.com>
4996 * dwarf_reader.cc (Dwarf_die::read_attributes)
4997 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4998 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4999 * reduced_debug_output.cc
5000 (Output_reduced_debug_info_section::get_die_end): Remove
5001 DW_FORM_GNU_ref_index. Add default case.
5003 2012-04-26 Mark Wielaard <mjw@redhat.com>
5005 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5006 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5007 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5008 DW_AT_high_pc as offset from DW_AT_low_pc.
5010 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5011 * testsuite/Makefile.in: Regenerate.
5012 * testsuite/gdb_index_test_3.c: New test source file.
5013 * testsuite/gdb_index_test_3.sh: New test source file.
5015 2012-04-25 Ian Lance Taylor <iant@google.com>
5017 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5019 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5020 as a class, not a struct.
5021 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5022 (Target_arm::apply_cortex_a8_workaround): Likewise.
5023 * gc.h: Declare Reloc_types as a struct, not a class.
5024 * object.h: Declare Symbols_data as a struct.
5025 * reloc.h: Declare Read_relocs_data as a struct.
5026 * target.h: Declare Relocate_info as a struct.
5028 2012-04-24 David S. Miller <davem@davemloft.net>
5030 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5031 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5034 2012-04-24 Cary Coutant <ccoutant@google.com>
5036 * incremental-dump.cc (find_input_containing_global): Replace
5037 magic number with symbolic constant.
5038 (dump_incremental_inputs): Update version number.
5039 * incremental.cc (Output_section_incremental_inputs): Update version
5040 number; import symbolic constants from Incremental_inputs_reader.
5041 (Incremental_inputs::create_data_sections): Align relocations
5042 section correctly for 64-bit targets.
5043 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5044 constants; add padding.
5045 (Output_section_incremental_inputs::write_header): Add assert for
5047 (Output_section_incremental_inputs::write_input_files): Add assert
5048 for input_entry_size.
5049 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5050 add assert for object_info_size, input_section_entry_size,
5051 global_sym_entry_size.
5052 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5053 for data structure sizes; use them.
5054 (Incremental_input_entry_reader): Import symbolic constants from
5055 Incremental_inputs_reader; use them.
5057 2012-04-23 David S. Miller <davem@davemloft.net>
5059 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5061 (Target_sparc::Target_sparc): Initialize new fields.
5062 (Target_sparc::do_make_elf_object): New function.
5063 (Target_sparc::do_adjust_elf_header): New function.
5065 2012-04-23 Cary Coutant <ccoutant@google.com>
5067 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5068 CU range table of gdb index.
5070 2012-04-20 David S. Miller <davem@davemloft.net>
5072 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5075 2012-04-16 David S. Miller <davem@davemloft.net>
5077 * sparc.cc (Target_sparc::got_address): New function.
5078 (Sparc_relocate_functions::gdop_hix22): New function.
5079 (Sparc_relocate_functions::gdop_lox10): New function.
5080 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5082 (Target_sparc::Scan::local): Likewise if the global symbol is not
5083 preemptible and is not IFUNC.
5084 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5085 transformations for local and non-preemptible non-IFUNC global
5088 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5089 writing out 64-bit part of ranges.
5091 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5092 -fpic and -fpie respectively.
5093 * Makefile.in: Regenerate.
5095 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5096 (Target_sparc::Target_sparc): Initialize new field.
5097 (Target_sparc::do_plt_section_for_global): New function.
5098 (Target_sparc::do_plt_section_for_local): New function.
5099 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5100 (Target_sparc::make_plt_section): New function, broken out of
5101 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5102 (Target_sparc::make_plt_entry): Call make_plt_section.
5103 (Target_sparc::make_local_ifunc_plt_entry): New function.
5104 (Target_sparc::rela_ifunc_section): New function.
5105 (Target_sparc::plt_section): Remove const.
5106 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5107 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5108 and ifunc_count_ fields.
5109 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5110 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5111 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5112 (Output_data_plt_sparc::rela_ifunc): New function.
5113 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5114 (Output_data_plt_sparc::has_ifunc_section): New function.
5115 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5116 (Output_data_plt_sparc::address_for_global): New function.
5117 (Output_data_plt_sparc::address_for_local): New function.
5118 (Output_data_plt_sparc::plt_index_to_offset): New function.
5119 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5121 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5123 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5124 R_SPARC_JMP_IREL to switch.
5125 (Target_sparc::Scan::check_non_pic): Likewise.
5126 (Target_sparc::Scan::local): Handle IFUNC symbols.
5127 (Target_sparc::Scan::local): Likewise.
5128 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5129 and plt_address_for_local.
5130 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5131 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5133 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5134 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5135 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5136 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5138 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5139 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5141 * sparc.cc (Target_sparc::Scan::global): Likewise.
5142 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5144 2012-04-16 Cary Coutant <ccoutant@google.com>
5146 * archive.cc (Library_base::should_include_member): Check for
5147 --export-dynamic-symbol.
5148 * options.h (class General_options): Add --export-dynamic-symbol.
5149 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5150 --export-dynamic-symbol.
5151 (Symbol_table::gc_mark_undef_symbols): Likewise.
5152 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5154 2012-04-12 David S. Miller <davem@davemloft.net>
5156 * sparc.cc (Reloc::wdisp10): New relocation method.
5157 (Reloc::h34): Likewise.
5158 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5159 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5161 (Target_sparc::Scan::local): Likewise.
5162 (Target_sparc::Scan::global): Likewise.
5163 (Target_sparc::Relocate::relocate): Likewise.
5165 2012-04-09 Cary Coutant <ccoutant@google.com>
5167 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5170 2012-04-06 Ian Lance Taylor <iant@google.com>
5172 * timer.cc: #include <unistd.h>.
5174 2012-04-06 Roland McGrath <mcgrathr@google.com>
5176 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5177 * config.in: Regenerate.
5178 * configure: Regenerate.
5180 2012-04-05 Nick Clifton <nickc@redhat.com>
5182 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5183 (AM_LC_MESSAGES): Add.
5184 * aclocal.m4: Regenerate.
5185 * config.in: Regenerate.
5186 * configure: Regenerate.
5188 2012-03-21 Cary Coutant <ccoutant@google.com>
5190 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5191 * Makefile.in: Regenerate.
5192 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5193 (Sized_elf_reloc_mapper::symbol_section): New function.
5194 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5195 (make_elf_reloc_mapper): New function.
5196 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5197 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5198 (Dwarf_abbrev_table::do_get_abbrev): New function.
5199 (Dwarf_ranges_table::read_ranges_table): New function.
5200 (Dwarf_ranges_table::read_range_list): New function.
5201 (Dwarf_pubnames_table::read_section): New function.
5202 (Dwarf_pubnames_table::read_header): New function.
5203 (Dwarf_pubnames_table::next_name): New function.
5204 (Dwarf_die::Dwarf_die): New function.
5205 (Dwarf_die::read_attributes): New function.
5206 (Dwarf_die::skip_attributes): New function.
5207 (Dwarf_die::set_name): New function.
5208 (Dwarf_die::set_linkage_name): New function.
5209 (Dwarf_die::attribute): New function.
5210 (Dwarf_die::string_attribute): New function.
5211 (Dwarf_die::int_attribute): New function.
5212 (Dwarf_die::uint_attribute): New function.
5213 (Dwarf_die::ref_attribute): New function.
5214 (Dwarf_die::child_offset): New function.
5215 (Dwarf_die::sibling_offset): New function.
5216 (Dwarf_info_reader::check_buffer): New function.
5217 (Dwarf_info_reader::parse): New function.
5218 (Dwarf_info_reader::do_parse): New function.
5219 (Dwarf_info_reader::do_read_string_table): New function.
5220 (Dwarf_info_reader::lookup_reloc): New function.
5221 (Dwarf_info_reader::get_string): New function.
5222 (Dwarf_info_reader::visit_compilation_unit): New function.
5223 (Dwarf_info_reader::visit_type_unit): New function.
5224 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5225 Sized_elf_reloc_mapper.
5226 (Sized_dwarf_line_info::symbol_section): Remove function.
5227 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5228 (Sized_dwarf_line_info::read_line_mappings): Remove object
5229 parameter, adjust callers.
5230 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5231 * dwarf_reader.h: Include <sys/types.h>.
5232 (class Track_relocs): Remove forward declaration.
5233 (class Elf_reloc_mapper): New class.
5234 (class Sized_elf_reloc_mapper): New class.
5235 (class Dwarf_abbrev_table): New class.
5236 (class Dwarf_range_list): New class.
5237 (class Dwarf_ranges_table): New class.
5238 (class Dwarf_pubnames_table): New class.
5239 (class Dwarf_die): New class.
5240 (class Dwarf_info_reader): New class.
5241 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5242 (Sized_dwarf_line_info::symbol_section): Remove member function.
5243 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5245 * gdb-index.cc: New source file.
5246 * gdb-index.h: New source file.
5247 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5248 and .debug_types sections, call Layout::add_to_gdb_index.
5249 (Sized_relobj_incr::do_section_name): Implement.
5250 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5251 return type; Implement.
5252 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5254 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5255 parameter list and return type.
5256 (Sized_incr_dynobj::do_section_contents): Likewise.
5257 * layout.cc: Include gdb-index.h.
5258 (Layout::Layout): Initialize gdb_index_data_.
5259 (Layout::init_fixed_output_section): Check for .gdb_index section.
5260 (Layout::add_to_gdb_index): New function. Instantiate.
5261 * layout.h: Add forward declaration for class Gdb_index.
5262 (Layout::add_to_gdb_index): New member function.
5263 (Layout::gdb_index_data_): New data member.
5264 * main.cc: Include gdb-index.h.
5265 (main): Print statistics for gdb index.
5266 * object.cc (Object::section_contents): Move code into
5267 do_section_contents.
5268 (need_decompressed_section): Check for sections needed when building
5270 (build_compressed_section_map): Likewise.
5271 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5273 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5274 sections; call Layout::add_to_gdb_index.
5275 (Sized_relobj_file::do_decompressed_section_contents): Call
5276 do_section_contents directly.
5277 * object.h (Object::do_section_contents): Adjust parameter list and
5279 (Object::do_decompressed_section_contents): Call do_section_contents
5281 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5283 * options.h (class General_options): Add --gdb-index option.
5284 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5285 list and return type.
5286 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5287 * reloc.h (Track_relocs::checkpoint): New function.
5288 (Track_relocs::reset): New function.
5290 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5292 * testsuite/Makefile.in: Regenerate.
5293 * testsuite/gdb_index_test.cc: New test source file.
5294 * testsuite/gdb_index_test_1.sh: New test source file.
5295 * testsuite/gdb_index_test_2.sh: New test source file.
5297 2012-03-19 Doug Kwan <dougkwan@google.com>
5299 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5300 (Target_arm::do_finalize_sections): Remove code which defines
5301 __exidx_start and __exidx_end. Make symbol table parameter
5302 anonymous as it is not used.
5303 * gold.cc (queue_middle_tasks): Call target hook to define any
5304 target-specific symbols.
5305 * target.h (Target::define_standard_symbols): New method.
5306 (Target::do_define_standard_symbols): Same.
5307 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5308 * testsuite/Makefile.in: Regenerate.
5309 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5311 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5312 relocations are generated for __exidx_start and __exidx_end.
5314 2012-03-16 Doug Kwan <dougkwan@google.com>
5316 * testsuite/Makefile.am: Disable test initpri3b.
5317 * testsuite/Makefile.in: Regenerate.
5319 2012-03-15 Doug Kwan <dougkwan@google.com>
5321 * arm.cc (Target_arm::got_section): Make .got section read-only
5324 2012-03-15 Ian Lance Taylor <iant@google.com>
5327 * layout.cc (Layout::make_output_section): Correctly mark
5328 SHT_INIT_ARRAY, et. al., as relro.
5330 2012-03-14 Doug Kwan <dougkwan@google.com>
5332 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5333 dynamic relocations for protected symbols in shared objects.
5335 2012-03-13 Ian Lance Taylor <iant@google.com>
5337 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5338 keep the larger alignment.
5340 2012-03-12 Cary Coutant <ccoutant@google.com>
5342 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5343 handling of DW_LNE_define_file.
5345 2012-03-12 Cary Coutant <ccoutant@google.com>
5347 * reduced_debug_output.cc
5348 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5351 2012-02-29 Cary Coutant <ccoutant@google.com>
5353 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5355 2012-02-29 Cary Coutant <ccoutant@google.com>
5357 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5358 Call Object::decompressed_section_contents.
5359 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5361 (Sized_dwarf_line_info::buffer_start_): New data member.
5362 * merge.cc (Output_merge_data::do_add_input_section): Call
5363 Object::decompressed_section_contents.
5364 (Output_merge_string::do_add_input_section): Likewise.
5365 * object.cc (need_decompressed_section): New function.
5366 (build_compressed_section_map): Decompress sections needed later.
5367 (Sized_relobj_file::do_decompressed_section_contents): New function.
5368 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5369 * object.h (Object::decompressed_section_contents): New function.
5370 (Object::discard_decompressed_sections): New function.
5371 (Object::do_decompressed_section_contents): New function.
5372 (Object::do_discard_decompressed_sections): New function.
5373 (Compressed_section_info): New type.
5374 (Compressed_section_map): Include decompressed section contents.
5375 (Sized_relobj_file::do_decompressed_section_contents): New function.
5376 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5378 2012-02-16 Cary Coutant <ccoutant@google.com>
5380 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5381 * testsuite/Makefile.in: Regenerate.
5383 2012-02-14 Cary Coutant <ccoutant@google.com>
5385 * options.cc (General_options::finalize): Disallow -pie and -static.
5387 2012-02-03 Doug Kwan <dougkwan@google.com>
5389 * arm.cc (Arm_relocate_functions::abs8,
5390 Arm_relocate_functions::abs16): Use
5391 Bits::has_signed_unsigned_overflow32.
5392 (Arm_relocate_functions::thm_abs8): Correct range of
5394 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5397 2012-02-02 Doug Kwan <dougkwan@google.com>
5399 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5400 position independent outputs, not just shared objects.
5402 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5404 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5405 * configure: Regenerated.
5407 2012-01-27 Ian Lance Taylor <iant@google.com>
5409 * reloc.h (Bits): New class with static functions, copied from
5410 namespace utils in arm.cc.
5411 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5414 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5416 * incremental.cc (write_info_blocks): Correct relocation offset.
5418 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5420 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5421 (Relocate::tls_gd_to_le): Likewise.
5423 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5425 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5427 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5429 * configure.ac: Check if -mcmodel=medium works.
5430 * configure: Regenerated.
5432 2012-01-24 Cary Coutant <ccoutant@google.com>
5434 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5436 (read_unsigned_LEB_128_x): ... this new function.
5437 (read_signed_LEB_128): Replaced with inline definition and ...
5438 (read_signed_LEB_128_x): ... this new function.
5439 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5440 (read_unsigned_LEB_128): Add inline definition.
5441 (read_signed_LEB_128_x): New function.
5442 (read_signed_LEB_128): Add inline definition.
5443 * testsuite/Makefile.am (leb128_unittest): New unit test.
5444 * testsuite/Makefile.in: Regenerate.
5445 * testsuite/leb128_unittest.cc: New unit test.
5447 2012-01-23 Ian Lance Taylor <iant@google.com>
5450 * i386.cc (Target_i386::do_code_fill): When using a jmp
5451 instruction, pad with nop instructions.
5452 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5454 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5456 * x86_64.cc (gc_process_relocs): Add typename on types used in
5458 (scan_relocs): Likewise.
5459 (relocate_section): Likewise.
5460 (apply_relocation): Likewise.
5462 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5464 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5465 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5468 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5470 * x86_64.cc: Initial support for x32.
5472 2012-01-03 Cary Coutant <ccoutant@google.com>
5474 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5475 Use abstract base class for GOT.
5476 * gold/output.h (class Output_data_got_base): New abstract base class.
5477 (class Output_data_got): Derive from new base class, adjust ctors.
5478 (Output_data_got::reserve_slot): Make virtual; rename to
5479 do_reserve_slot; Adjust callers.
5480 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5481 pointer to abstract base class.
5482 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5484 2011-12-18 Ian Lance Taylor <iant@google.com>
5486 * object.h (Relobj::local_symbol_value): New function.
5487 (Relobj::local_plt_offset): New function.
5488 (Relobj::local_has_got_offset): New function.
5489 (Relobj::local_got_offset): New function.
5490 (Relobj::set_local_got_offset): New function.
5491 (Relobj::do_local_symbol_value): New pure virtual function.
5492 (Relobj::do_local_plt_offset): Likewise.
5493 (Relobj::do_local_has_got_offset): Likewise.
5494 (Relobj::do_local_got_offset): Likewise.
5495 (Relobj::do_set_local_got_offset): Likewise.
5496 (Sized_relobj::do_local_has_got_offset): Rename from
5497 local_has_got_offset.
5498 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5499 (Sized_relobj::do_set_local_got_offset): Rename from
5500 set_local_got_offset.
5501 (Sized_relobj_file::do_local_plt_offset): Rename from
5503 (Sized_relobj_file::do_local_symbol_value): New function.
5504 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5506 * output.cc (Output_data_got::Got_entry::write): Change object to
5507 Relobj. Use local_symbol_value.
5508 (Output_data_got::add_global_with_rel): Change rel_dyn to
5509 Output_data_reloc_generic*. Use add_global_generic.
5510 (Output_data_got::add_global_with_rela): Remove. Change all
5511 callers to use add_global_with_rel.
5512 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5513 Output_data_reloc_generic*. Use add_global_generic.
5514 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5515 callers to use add_global_pair_with_rel.
5516 (Output_data_got::add_local): Change object to Relobj*.
5517 (Output_data_got::add_local_plt): Likewise.
5518 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5519 change rel_dyn to Output_data_reloc_generic*. Use
5521 (Output_data_got::add_local_with_rela): Remove. Change all
5522 callers to use all_local_with_rel.
5523 (Output_data_got::add_local_pair_with_rel): Change object to
5524 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5525 add_output_section_generic.
5526 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5527 callers to use add_local_pair_with_rel.
5528 (Output_data_got::reserve_local): Change object to Relobj*.
5529 * output.h: (class Output_data_reloc_generic): Add pure virtual
5530 declarations for add_global_generic, add_local_generic,
5531 add_output_section_generic.
5532 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5533 functions for Output_data_reloc_generic. Update declarations for
5534 changes listed in output.cc.
5535 (class Output_data_got): Change template parameter to got_size.
5536 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5537 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5539 (Sized_relobj_incr::do_local_plt_offset): New function.
5540 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5543 2011-12-17 Cary Coutant <ccoutant@google.com>
5545 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5546 * resolve.cc (Symbol_table::resolve): Likewise.
5547 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5549 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5551 2011-12-16 Ian Lance Taylor <iant@google.com>
5553 * output.h (Output_data_reloc_generic::add): Only call
5554 add_dynamic_reloc if this is a dynamic reloc section.
5556 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5559 * target-reloc.h (apply_relocation): Replace <64, false> with
5562 2011-11-25 Nick Clifton <nickc@redhat.com>
5564 * po/it.po: New Italian translation.
5566 2011-11-17 Sterling Augustine <saugustine@google.com>
5568 * script.cc (script_include_directive): Implement.
5569 (read_script_file): New local variables name and search_path. Update
5570 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5571 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5572 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5574 2011-11-11 Sterling Augustine <saugustine@google.com>
5576 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5577 (file_or_sections_cmd): Likewise.
5579 2011-11-11 Doug Kwan <dougkwan@google.com>
5581 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5582 if --just-symbols is given.
5584 2011-11-10 Doug Kwan <dougkwan@google.com>
5587 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5588 when processing data relocs.
5589 * reloc.h (Relocate_functions::rel_unaligned): New method.
5590 (Relocate_functions::pcrel_unaligned): Ditto.
5591 (Relocate_functions::rel32_unaligned): Ditto.
5592 (Relocate_functions::pcrel32_unaligned): Ditto.
5594 2011-11-09 Doug Kwan <dougkwan@google.com>
5597 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5598 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5599 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5600 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5601 (Relocate_functions::rel_unaligned): New.
5602 (Relocate_functions::rel32_unaligned): New.
5603 * target-reloc.h (relocate_for_relocatable): Add code to handle
5604 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5605 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5606 arm_unaligned_reloc_r): New targets.
5607 * testsuite/Makefile.in: Regenerate.
5608 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5611 2011-11-02 Ian Lance Taylor <iant@google.com>
5613 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5615 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5616 * options.cc (General_options::finalize): Use library search path
5617 from configure script if specified. If not native and no sysroot,
5618 only search TOOLLIBDIR.
5619 * options.h (Search_directory::Search_directory): Change name to
5621 (General_options::add_to_library_path_with_sysroot): Change arg to
5623 * configure, Makefile.in, config.in: Rebuild.
5625 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5627 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5628 we are working around the ARM1176 Erratum.
5629 * options.h (General_options::fix_arm1176): Add option.
5630 * testsuite/Makefile.am: Add testcases, and keep current ones
5632 * testsuite/Makefile.in: Regenerate.
5633 * testsuite/arm_fix_1176.s: New file.
5634 * testsuite/arm_fix_1176.sh: Likewise.
5636 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5638 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5640 (Target_arm::may_use_blx): Remove method.
5641 (Target_arm::set_may_use_blx): Likewise.
5642 (Target_arm::may_use_v4t_interworking): New method.
5643 (Target_arm::may_use_v5t_interworking): Likewise.
5644 (Target_arm::may_use_blx_): Remove member variable.
5645 (Arm_relocate_functions::arm_branch_common): Check for v5T
5647 (Arm_relocate_functions::thumb_branch_common): Likewise.
5648 (Reloc_stub::stub_type_for_reloc): Likewise.
5649 (Target_arm::do_finalize_sections): Correct interworking checks.
5650 * testsuite/Makefile.am: Add new tests.
5651 * testsuite/Makefile.in: Regenerate.
5652 * testsuite/arm_farcall_arm_arm.s: New test.
5653 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5654 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5655 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5656 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5657 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5658 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5659 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5661 2011-10-31 Cary Coutant <ccoutant@google.com>
5664 * expression.cc (Expression::eval_with_dot): Add
5665 is_section_dot_assignment parameter.
5666 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5667 absolute and assigning to dot within a section.
5668 * script-sections.cc
5669 (Output_section_element_assignment::set_section_addresses): Pass
5670 dot_section to set_if_absolute.
5671 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5672 as is_section_dot_assignment flag to eval_with_dot.
5673 (Output_section_element_dot_assignment::set_section_addresses):
5675 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5676 parameter. Also set value if relative to dot_section; set the
5677 symbol's output_section.
5678 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5679 parameter. Adjust all callers.
5680 (Expression::eval_maybe_dot): Likewise.
5681 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5683 * testsuite/script_test_2.t: Test assignment of an absolute value
5684 to dot within an output section element.
5686 2011-10-31 Cary Coutant <ccoutant@google.com>
5688 * options.h (class General_options): Add --[no-]gnu-unique options.
5689 * symtab.cc (Symbol_table::sized_write_globals): Convert
5690 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5692 2011-10-31 Cary Coutant <ccoutant@google.com>
5695 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5696 unnecessary assertion.
5697 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5699 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5701 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5703 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5705 Change to just keep the section associated with symbol.
5706 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5707 they are externally visible and --export-dynamic is turned on.
5708 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5710 2011-10-19 Ian Lance Taylor <iant@google.com>
5713 * script-sections.cc
5714 (Output_section_element_dot_assignment::needs_output_section): New
5717 2011-10-19 Ian Lance Taylor <iant@google.com>
5720 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5721 --section-start option was seen.
5722 * options.h (General_options::any_section_start): New function.
5724 2011-10-18 David S. Miller <davem@davemloft.net>
5727 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5728 member to track relocation locations that have moved during TLS
5729 reloc optimizations.
5730 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5731 (Target_sparc::Relocate::relocate): Adjust view down by 4
5732 bytes if it matches reloc_adjust_addr_.
5733 (Target_sparc::Relocate::relocate_tls): Always move the
5734 __tls_get_addr call delay slot instruction forward 4 bytes when
5735 performing relaxation.
5737 2011-10-18 Cary Coutant <ccoutant@google.com>
5739 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5740 (Output_file::map_no_anonymous): Check for non-zero
5741 return code from posix_fallocate.
5743 2011-10-17 Cary Coutant <ccoutant@google.com>
5746 * plugin.cc (is_visible_from_outside): Check for symbols
5747 referenced from dynamic objects.
5748 * resolve.cc (Symbol_table::resolve): Don't count references
5749 from dynamic objects as references from real ELF files.
5750 * testsuite/plugin_test_2.sh: Adjust expected result.
5752 2011-10-17 Cary Coutant <ccoutant@google.com>
5754 * gold.cc: Include timer.h.
5755 (queue_middle_tasks): Stamp time.
5756 (queue_final_tasks): Likewise.
5757 * main.cc (main): Store timer in parameters. Print timers
5759 * parameters.cc (Parameters::Parameters): Initialize timer_.
5760 (Parameters::set_timer): New function.
5761 (set_parameters_timer): New function.
5762 * parameters.h (Parameters::set_timer): New function.
5763 (Parameters::timer): New function.
5764 (Parameters::timer_): New data member.
5765 (set_parameters_timer): New function.
5766 * timer.cc (Timer::stamp): New function.
5767 (Timer::get_pass_time): New function.
5768 * timer.h (Timer::stamp): New function.
5769 (Timer::get_pass_time): New function.
5770 (Timer::pass_times_): New data member.
5772 2011-10-17 Cary Coutant <ccoutant@google.com>
5774 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5775 task for members of lib groups.
5777 2011-10-17 Cary Coutant <ccoutant@google.com>
5780 * fileread.cc (File_read::find_view): Add assert.
5781 (File_read::make_view): Move bounds check (replace with assert)...
5782 (File_read::find_or_make_view): ... to here.
5784 2011-10-12 Cary Coutant <ccoutant@google.com>
5786 * output.cc (Output_file::open_base_file): Handle case where
5787 ::read returns less than requested size.
5789 2011-10-10 Cary Coutant <ccoutant@google.com>
5791 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5792 Initialize defined_count_.
5793 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5794 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5795 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5796 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5797 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5798 * incremental.h (Sized_relobj_incr::defined_count_): New data
5800 (Sized_incr_dynobj::defined_count_): New data member.
5801 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5802 Return zeroes instead of internal error.
5804 2011-10-10 Cary Coutant <ccoutant@google.com>
5807 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5808 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5809 * output.h (class Output_reloc): Add use_plt_offset flag.
5810 (Output_reloc::type_): Adjust size of bit field.
5811 (Output_reloc::use_plt_offset_): New bit field.
5812 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5813 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5814 flag. Adjust all callers.
5815 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5816 creating RELATIVE relocations.
5818 2011-10-10 Nick Clifton <nickc@redhat.com>
5820 * po/es.po: Updated Spanish translation.
5821 * po/fi.po: Updated Finnish translation.
5823 2011-10-03 Diego Novillo <dnovillo@google.com>
5825 * options.cc (parse_uint): Fix dereference of RETVAL.
5827 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5829 * layout.h (section_order_map_): New member.
5830 (get_section_order_map): New member function.
5831 * output.cc (Output_section::add_input_section): Check for patterns
5832 only when --section-ordering-file is specified.
5833 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5834 output_sections have been formed.
5835 * layout.cc (Layout_Layout): Initialize section_order_map_.
5836 * plugin.cc (update_section_order): Store order in order_map. Do not
5838 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5839 * testsuite/Makefile.in: Regenerate.
5840 * testsuite/plugin_section_order.c: New file.
5841 * testsuite/plugin_final_layout.cc: New file.
5842 * testsuite/plugin_final_layout.sh: New file.
5844 2011-09-29 Cary Coutant <ccoutant@google.com>
5846 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5848 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
5849 symbols during incremental update.
5850 (Symbol_table::add_from_dynobj): Likewise.
5852 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5853 Ian Lance Taylor <iant@google.com>
5855 * symtab.cc (Symbol_table::define_special_symbol): Always
5856 canonicalize version string.
5858 2011-09-26 Cary Coutant <ccoutant@google.com>
5860 * gold.cc (queue_initial_tasks): Move option checks ...
5861 * options.cc (General_options::finalize): ... to here. Disable
5862 some options; make others fatal.
5864 2011-09-26 Cary Coutant <ccoutant@google.com>
5867 * plugin.cc (get_symbols_v2): New function.
5868 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5869 (is_referenced_from_outside): New function.
5870 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5871 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5872 (get_symbols): Pass version parameter.
5873 (get_symbols_v2): New function.
5874 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5876 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5877 (onload): Add LDPT_GET_SYMBOLS_V2.
5878 (all_symbols_read_hook): Use get_symbols_v2; check for
5879 LDPR_PREVAILING_DEF_IRONLY_EXP.
5880 * testsuite/plugin_test_3.sh: Update expected results.
5882 2011-09-23 Simon Baldwin <simonb@google.com>
5884 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5885 configuration options.
5886 * configure: Regenerate.
5887 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5888 * Makefile.in: Regenerate.
5889 * testsuite/Makefile.in: Regenerate.
5891 2011-09-19 Sriraman Tallam <tmsriram@google.com>
5893 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5895 2011-09-19 Cary Coutant <ccoutant@google.com>
5897 * incremental.cc (can_incremental_update): Fix typo in comment.
5898 * incremental.h (can_incremental_update): Likewise.
5900 2011-09-18 Cary Coutant <ccoutant@google.com>
5902 * incremental.cc (can_incremental_update): New function.
5903 * incremental.h (can_incremental_update): New function.
5904 * layout.cc (Layout::init_fixed_output_section): Call it.
5905 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5906 * object.cc (Sized_relobj_file::do_layout): Call
5907 can_incremental_update.
5909 2011-09-13 Cary Coutant <ccoutant@google.com>
5911 * configure.ac: Check for glibc support for gnu_indirect_function
5912 support with static linking, setting automake conditional
5914 * Makefile.in: Regenerate.
5915 * configure: Regenerate.
5917 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5918 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5920 * testsuite/Makefile.in: Regenerate.
5922 2011-09-13 Cary Coutant <ccoutant@google.com>
5924 * incremental.cc (Sized_relobj_incr::do_layout): Call
5925 report_comdat_group for kept comdat sections.
5926 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5927 * testsuite/Makefile.in: Regenerate.
5928 * testsuite/incr_comdat_test_1.cc: New source file.
5929 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5930 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5931 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5933 2011-09-13 Ian Lance Taylor <iant@google.com>
5935 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5936 variable external_symbols_offset.
5938 2011-09-12 Ian Lance Taylor <iant@google.com>
5940 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5941 triggered if object has no symbols.
5943 2011-09-09 David S. Miller <davem@davemloft.net>
5945 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5946 (Output_fill_debug_line::do_write): Likewise.
5948 2011-08-29 Cary Coutant <ccoutant@google.com>
5950 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5951 casts to match formatting specs.
5952 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5954 2011-08-26 Cary Coutant <ccoutant@google.com>
5956 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5957 remaining hole size when allocating.
5958 (Layout::make_output_section): Set fill methods for debug sections.
5959 * layout.h (Free_list::Free_list_node): Move from private to
5961 (Free_list::set_min_hole_size): New function.
5962 (Free_list::begin, Free_list::end): New functions.
5963 (Free_list::min_hole_): New data member.
5964 * output.cc: Include dwarf.h.
5965 (Output_fill_debug_info::do_minimum_hole_size): New function.
5966 (Output_fill_debug_info::do_write): New function.
5967 (Output_fill_debug_line::do_minimum_hole_size): New function.
5968 (Output_fill_debug_line::do_write): New function.
5969 (Output_section::Output_section): Initialize new data member.
5970 (Output_section::set_final_data_size): Ensure patch space is larger
5971 than minimum hole size.
5972 (Output_section::do_write): Fill holes in debug sections.
5973 * output.h (Output_fill): New class.
5974 (Output_fill_debug_info): New class.
5975 (Output_fill_debug_line): New class.
5976 (Output_section::set_free_space_fill): New function.
5977 (Output_section::free_space_fill_): New data member.
5978 * testsuite/Makefile.am (incremental_test_3): Add
5979 --incremental-patch option.
5980 (incremental_test_4): Likewise.
5981 (incremental_test_5): Likewise.
5982 (incremental_test_6): Likewise.
5983 (incremental_copy_test): Likewise.
5984 (incremental_common_test_1): Likewise.
5985 * testsuite/Makefile.in: Regenerate.
5987 2011-08-26 Nick Clifton <nickc@redhat.com>
5989 * po/es.po: Updated Spanish translation.
5991 2011-08-01 Cary Coutant <ccoutant@google.com>
5993 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5994 * gold/testsuite/Makefile.in: Regenerate.
5995 * gold/testsuite/justsyms_exec.c: New source file.
5996 * gold/testsuite/justsyms_lib.c: New source file.
5998 2011-08-01 Cary Coutant <ccoutant@google.com>
6000 * layout.cc (Layout::set_segment_offsets): Don't realign text
6001 segment if -Ttext was specified.
6002 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6004 * object.h (Sized_relobj_file::e_type): New function.
6005 (Sized_relobj_file::e_type_): New data member.
6006 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6007 base address for ET_EXEC files.
6008 * target.cc (Target::do_make_elf_object_implementation): Allow
6009 ET_EXEC files with --just-symbols option.
6011 2011-07-28 Cary Coutant <ccoutant@google.com>
6013 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6014 Add thread_number parameter.
6015 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6016 * workqueue-threads.cc
6017 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6018 current thread if its thread number is greater than desired thread
6020 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6021 Add thread_number parameter.
6022 (Workqueue::should_cancel_thread): Likewise.
6023 (Workqueue::find_runnable_or_wait): Pass thread_number to
6024 should_cancel_thread.
6025 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6028 2011-07-22 Sriraman Tallam <tmsriram@google.com>
6030 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6031 only after checking if it cannot be forced local.
6032 * symtab.h (is_externally_visible): Check if the symbol is not forced
6035 2011-07-15 Ian Lance Taylor <iant@google.com>
6037 * options.h (class General_options): Add --print-output-format.
6038 Move -EL next to -EB, for better --help output.
6039 * target-select.cc: Include <cstdio>, "options.h", and
6041 (Target_selector::do_target_bfd_name): New function.
6042 (print_output_format): New function.
6043 * target-select.h (class Target_selector): Update declarations.
6044 (Target_selector::target_bfd_name): New function.
6045 (print_output_format): Declare.
6046 * main.cc: Include "target-select.h".
6047 (main): Handle --print-output-format.
6048 * gold.cc: Include "target-select.h".
6049 (queue_initial_tasks): Handle --print-output-format when there are
6051 * parameters.cc (parameters_force_valid_target): Give a better
6052 error message if -EB/-EL does not match target.
6053 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6056 2011-07-15 Ian Lance Taylor <iant@google.com>
6058 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6059 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6060 (Output_data_plt_i386::do_write): Write address of .dynamic
6061 section to first entry in .got.plt section.
6062 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6063 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6065 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6066 section to first entry in .got.plt section.
6067 * layout.h (Layout::dynamic_section): New function.
6069 2011-07-13 Sriraman Tallam <tmsriram@google.com>
6071 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6073 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6074 input_section_position_, and input_section_glob_.
6075 (read_layout_from_file): Call function section_ordering_specified.
6076 * layout.h (is_section_ordering_specified): New function.
6077 (section_ordering_specified): New function.
6078 (section_ordering_specified_): New boolean member.
6079 * main.cc(main): Call load_plugins after layout object is defined.
6080 * output.cc (Output_section::add_input_section): Use
6081 function section_ordering_specified to check if section ordering is
6083 * output.cc (Output_section::add_relaxed_input_section): Use
6084 function section_ordering_specified to check if section ordering is
6086 (Output_section::update_section_layout): New function.
6087 (Output_section::sort_attached_input_sections): Check if input section
6089 * output.h (Output_section::update_section_layout): New function.
6090 * plugin.cc (get_section_count): New function.
6091 (get_section_type): New function.
6092 (get_section_name): New function.
6093 (get_section_contents): New function.
6094 (update_section_order): New function.
6095 (allow_section_ordering): New function.
6096 (Plugin::load): Add the new interfaces to the transfer vector.
6097 (Plugin_manager::load_plugins): New parameter.
6098 (Plugin_manager::all_symbols_read): New parameter.
6099 (Plugin_manager::claim_file): New parameter. Save the elf object for
6101 (Plugin_manager::get_elf_object): New function.
6102 (Plugin_manager::get_view): Change to directly use the bool to check
6103 if get_view is called from claim_file_hook.
6104 * plugin.h (input_objects): New function
6105 (Plugin__manager::load_plugins): New parameter.
6106 (Plugin_manager::claim_file): New parameter.
6107 (Plugin_manager::get_elf_object): New function.
6108 (Plugin_manager::in_claim_file_handler): New function.
6109 (Plugin_manager::in_claim_file_handler_): New member.
6110 (layout): New function.
6111 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6112 handler with an extra parameter. Make the elf object before calling
6114 * testsuite/plugin_test.c (get_section_count): New function pointer.
6115 (get_section_type): New function pointer.
6116 (get_section_name): New function pointer.
6117 (get_section_contents): New function pointer.
6118 (update_section_order): New function pointer.
6119 (allow_section_ordering): New function pointer.
6120 (onload): Check if the new interfaces exist.
6122 2011-07-13 Ian Lance Taylor <iant@google.com>
6124 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6126 * x86_64.cc (Target_x86_64::got_section): Likewise.
6127 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6128 (relro_now_test_SOURCES): New variable.
6129 (relro_now_test_DEPENDENCIES): New variable.
6130 (relro_now_test_LDFLAGS): New variable.
6131 (relro_now_test_LDADD): New variable.
6132 (relro_now_test.so): New target.
6133 * testsuite/Makefile.in: Rebuild.
6135 2011-07-12 Ian Lance Taylor <iant@google.com>
6138 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6139 GLOB_DAT relocation rather than a RELATIVE relocation for a
6140 protected symbol when creating a shared library.
6141 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6142 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6143 * testsuite/protected_main_1.cc (main): Test that protected
6144 function has same address.
6146 2011-07-11 Ian Lance Taylor <iant@google.com>
6149 * options.h (class General_options): Add -Bgroup.
6150 * options.cc (General_options::finalize): If -Bgroup is set,
6151 default to --unresolved-symbols=report-all.
6152 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6153 * target-reloc.h (issue_undefined_symbol_error): Handle
6154 --unresolved-symbols=report-all.
6156 2011-07-08 Ian Lance Taylor <iant@google.com>
6159 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6160 if linker script discards key sections.
6161 (Layout::create_dynamic_symtab): Likewise.
6162 (Layout::assign_local_dynsym_offsets): Likewise.
6163 (Layout::sized_create_version_sections): Likewise.
6164 (Layout::create_interp): Likewise.
6165 (Layout::finish_dynamic_section): Likewise.
6166 (Layout::set_dynamic_symbol_size): Likewise.
6168 2011-07-08 Ian Lance Taylor <iant@google.com>
6171 * options.h (class General_options): Add --unresolved-symbols.
6172 * target-reloc.h (issue_undefined_symbol_error): Check
6173 --unresolved-symbols. Add comments.
6175 2011-07-08 Ian Lance Taylor <iant@google.com>
6177 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6178 expression more complex.
6180 2011-07-08 Ian Lance Taylor <iant@google.com>
6183 * target-reloc.h (issue_undefined_symbol_error): New inline
6184 function, broken out of relocate_section.
6185 (relocate_section): Call issue_undefined_symbol_error.
6186 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6187 there is no TLS segment if we are about to issue an undefined
6189 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6191 2011-07-08 Ian Lance Taylor <iant@google.com>
6194 * resolve.cc (Symbol_table::should_override): Add fromtype
6195 parameter. Change all callers. Give error when linking together
6196 TLS and non-TLS symbol.
6197 (Symbol_table::should_override_with_special): Add fromtype
6198 parameter. Change all callers.
6199 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6200 there is no TLS segment if we have reported some errors.
6201 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6203 2011-07-08 Ian Lance Taylor <iant@google.com>
6206 * target.h (Target::plt_address_for_global): New function.
6207 (Target::plt_address_for_local): New function.
6208 (Target::plt_section_for_global): Remove.
6209 (Target::plt_section_for_local): Remove.
6210 (Target::do_plt_address_for_global): New virtual function.
6211 (Target::do_plt_address_for_local): New virtual function.
6212 (Target::do_plt_section_for_global): Remove.
6213 (Target::do_plt_section_for_local): Remove.
6214 (Target::register_global_plt_entry): Add Symbol_table and Layout
6216 * output.cc (Output_data_got::Got_entry::write): Use
6217 plt_address_for_global and plt_address_for_local.
6218 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6219 address of output section.
6220 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6221 got_irelative_, and irelative_count_ fields. Update
6223 (Output_data_plt_i386::has_irelative_section): New function.
6224 (Output_data_plt_i386::entry_count): Add irelative_count_.
6225 (Output_data_plt_i386::set_final_data_size): Likewise.
6226 (class Target_i386): Add got_irelative_ and rel_irelative_
6227 fields. Update declarations.
6228 (Target_i386::Target_i386): Initialize new fields.
6229 (Target_i386::do_plt_address_for_global): New function replacing
6230 do_plt_section_for_global.
6231 (Target_i386::do_plt_address_for_local): New function replacing
6232 do_plt_section_for_local.
6233 (Target_i386::got_section): Create got_irelative_.
6234 (Target_i386::rel_irelative_section): New function.
6235 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6236 fields. Don't define __rel_iplt_{start,end}.
6237 (Output_data_plt_i386::add_entry): Add symtab and layout
6238 parameters. Change all callers. Use different PLT and GOT for
6240 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6241 layout parameters. Change all callers. Use different PLT and
6243 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6244 (Output_data_plt_i386::rel_irelative): New function.
6245 (Output_data_plt_i386::address_for_global): New function.
6246 (Output_data_plt_i386::address_for_local): New function.
6247 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6248 IRELATIVE GOT when changing IFUNC GOT entries.
6249 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6251 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6252 if we didn't create an IRELATIVE GOT.
6253 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6254 plt_address_for_local.
6255 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6256 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6257 got_irelative_, and irelative_count_ fields. Update
6259 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6260 Initialize new fields. Remove symtab parameter. Change all
6262 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6264 (Output_data_plt_x86_64::has_irelative_section): New function.
6265 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6266 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6267 fields. Update declarations.
6268 (Target_x86_64::Target_x86_64): Initialize new fields.
6269 (Target_x86_64::do_plt_address_for_global): New function replacing
6270 do_plt_section_for_global.
6271 (Target_x86_64::do_plt_address_for_local): New function replacing
6272 do_plt_section_for_local.
6273 (Target_x86_64::got_section): Create got_irelative_.
6274 (Target_x86_64::rela_irelative_section): New function.
6275 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6276 all callers. Don't create __rel_iplt_{start,end}.
6277 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6278 parameters. Change all callers. Use different PLT and GOT for
6280 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6281 layout parameters. Change all callers. Use different PLT and
6283 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6284 parameters. Change all callers. Use different PLT and GOT for
6286 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6287 (Output_data_plt_x86_64::rela_irelative): New function.
6288 (Output_data_plt_x86_64::address_for_global): New function.
6289 (Output_data_plt_x86_64::address_for_local): New function.
6290 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6291 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6292 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6293 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6295 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6297 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6298 symbols if we didn't create an IRELATIVE GOT.
6299 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6300 plt_address_for_local.
6301 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6302 * testsuite/ifuncvar1.c: New test file.
6303 * testsuite/ifuncvar2.c: New test file.
6304 * testsuite/ifuncvar3.c: New test file.
6305 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6306 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6307 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6308 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6309 * testsuite/Makefile.in: Rebuild.
6311 2011-07-07 Cary Coutant <ccoutant@google.com>
6313 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6314 (two_file_test_1_ndebug.o): Likewise.
6315 (two_file_test_1b_ndebug.o): Likewise.
6316 (two_file_test_2_ndebug.o): Likewise.
6317 (two_file_test_main_ndebug.o): Likewise.
6318 (incremental_test_2): Link with no-debug versions.
6320 2011-07-06 Cary Coutant <ccoutant@google.com>
6322 * gold/incremental.cc
6323 (Output_section_incremental_inputs::write_info_blocks): Check for
6324 hidden and internal symbols.
6326 2011-07-06 Cary Coutant <ccoutant@google.com>
6328 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6329 Check disposition for startup file.
6330 (Incremental_inputs::report_command_line): Ignore
6331 --incremental-startup-unchanged option.
6332 * options.cc (General_options::parse_incremental_startup_unchanged):
6334 (General_options::General_options): Initialize new data member.
6335 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6336 (General_options): Add --incremental-startup-unchanged option.
6337 (General_options::incremental_startup_disposition): New function.
6338 (General_options::incremental_startup_disposition_): New data member.
6340 2011-07-06 Cary Coutant <ccoutant@google.com>
6342 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6343 input file index to Script_info ctor.
6344 (Sized_incremental_binary::do_file_has_changed): Find the
6345 command-line argument for files named in scripts.
6346 * incremental.h (Script_info::Script_info): New ctor
6347 with input file index.
6348 (Script_info::input_file_index): New function.
6349 (Script_info::input_file_index_): New data member.
6350 (Incremental_binary::get_library): Add const.
6351 (Incremental_binary::get_script_info): Add const.
6352 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6353 * testsuite/Makefile.am (incremental_test_5): New test case.
6354 (incremental_test_6): New test case.
6355 * testsuite/Makefile.in: Regenerate.
6357 2011-07-06 Cary Coutant <ccoutant@google.com>
6359 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6360 debug output when command lines differ.
6362 2011-07-06 Cary Coutant <ccoutant@google.com>
6364 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6365 --incremental-patch option.
6366 * layout.cc (Free_list::allocate): Extend allocation beyond original
6368 (Layout::make_output_section): Mark sections that should get
6370 * options.cc (parse_percent): New function.
6371 * options.h (parse_percent): New function.
6372 (DEFINE_percent): New macro.
6373 (General_options): Add --incremental-patch option.
6374 * output.cc (Output_section::Output_section): Initialize new data
6376 (Output_section::add_input_section): Print section name when out
6378 (Output_section::add_output_section_data): Likewise.
6379 (Output_section::set_final_data_size): Add patch space when
6380 doing --incremental-full.
6381 (Output_section::do_reset_address_and_file_offset): Remove patch
6383 (Output_segment::set_section_list_addresses): Print debug output
6384 only if --incremental-update.
6385 * output.h (Output_section::set_is_patch_space_allowed): New function.
6386 (Output_section::is_patch_space_allowed_): New data member.
6387 (Output_section::patch_space_): New data member.
6388 * parameters.cc (Parameters::incremental_full): New function.
6389 * parameters.h (Parameters::incremental_full): New function
6390 * testsuite/Makefile.am (incremental_test_2): Add test for
6391 --incremental-patch option.
6392 * testsuite/Makefile.in: Regenerate.
6393 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6394 (t18): Remove function body.
6396 2011-07-05 Doug Kwan <dougkwan@google.com>
6399 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6400 Arm_Address type for relocation result.
6401 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6403 (Arm_relocate_functions::abs32): Use unaligned access.
6404 (Arm_relocate_functions::rel32): Ditto.
6405 (Arm_relocate_functions::prel31): Ditto.
6406 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6407 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6408 static data relocations.
6409 * testsuite/Makefile.in: Regnerate.
6410 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6412 2011-07-05 Ian Lance Taylor <iant@google.com>
6415 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6416 symbols if necessary.
6417 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6419 2011-07-05 Ian Lance Taylor <iant@google.com>
6422 * resolve.cc (Symbol::override_base_with_special): Simply override
6423 version with special symbol version, ignoring previous version.
6425 2011-07-05 Ian Lance Taylor <iant@google.com>
6427 * object.cc (Sized_relobj_file::include_section_group): Add
6428 information to comment about signature location.
6430 2011-07-02 Ian Lance Taylor <iant@google.com>
6433 * options.h (class General_options): Add -f and -F.
6434 * options.cc (General_options::finalize): Fatal error if -f/-F
6435 are used without -shared.
6436 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6438 2011-07-02 Ian Lance Taylor <iant@google.com>
6440 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6442 2011-07-01 Ian Lance Taylor <iant@google.com>
6446 * resolve.cc (Symbol::override_base_with_special): Don't override
6447 the version if the overriding symbol has a different name.
6448 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6449 all callers. If we give an error about an undefined version,
6450 define the base version if necessary.
6451 * dynobj.h (class Versions): Update declaration.
6452 * testsuite/weak_alias_test_5.cc: New file.
6453 * testsuite/weak_alias_test.script: New file.
6454 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6455 and versioned_alias have the right value, and call t2.
6456 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6457 weak_alias_test_5.so.
6458 (weak_alias_test_LDADD): Likewise.
6459 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6460 * testsuite/Makefile.in: Rebuild.
6462 2011-07-01 Ian Lance Taylor <iant@google.com>
6465 * options.h (class General_options): Support -z notext.
6466 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6468 (two_file_shared_nonpic.so): Likewise.
6469 (two_file_shared_mixed.so): Likewise.
6470 (two_file_shared_mixed_1.so): Likewise.
6471 (weak_undef_lib_nonpic.so): Likewise.
6472 (alt/weak_undef_lib_nonpic.so): Likewise.
6473 (tls_test_shared_nonpic.so): Likewise.
6474 * testsuite/Makefile.in: Rebuild.
6476 2011-07-01 Ian Lance Taylor <iant@google.com>
6479 * configure.ac: Test whether static linking works, setting
6480 the automake conditional HAVE_STATIC.
6481 * testsuite/Makefile.am: Disable tests using -static if
6482 HAVE_STATIC is not true.
6483 * configure, testsuite/Makefile.in: Rebuild.
6485 2011-07-01 Ian Lance Taylor <iant@google.com>
6488 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6489 Assert if we see DW_EH_PE_indirect.
6490 * target.h (Target::ehframe_datarel_base): New function.
6491 (Target::do_ehframe_datarel_base): New target function.
6492 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6493 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6496 2011-07-01 Ian Lance Taylor <iant@google.com>
6499 * options.h (class General_options): Add
6500 --ld-generated-unwind-info.
6501 * ehframe.cc (Fde::write): Add address parameter. Change all
6502 callers. If associated with PLT, fill in address and size.
6503 (Cie::set_output_offset): Only add merge mapping if there is an
6505 (Cie::write): Add address parameter. Change all callers.
6506 (Eh_frame::add_ehframe_for_plt): New function.
6507 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6508 input_offset_ fields into union u_, with new plt field.
6509 (Fde::Fde): Adjust for new union field.
6510 (Fde::Fde) [Output_data version]: New constructor.
6511 (Fde::add_mapping): Only add merge mapping if there is an object.
6512 (class Cie): Update declarations.
6513 (class Eh_frame): Declare add_ehframe_for_plt.
6514 * layout.cc (Layout::layout_eh_frame): Break out code into
6515 make_eh_frame_section, and call it.
6516 (Layout::make_eh_frame_section): New function.
6517 (Layout::add_eh_frame_for_plt): New function.
6518 * layout.h (class Layout): Update declarations.
6519 * merge.cc (Merge_map::add_mapping): Add assertion.
6520 * i386.cc: Include "dwarf.h".
6521 (class Output_data_plt_i386): Make first_plt_entry,
6522 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6523 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6524 and plt_eh_frame_fde.
6525 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6526 boundary. Call add_eh_frame_for_plt if appropriate.
6527 * x86_64.cc: Include "dwarf.h".
6528 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6529 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6530 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6531 and plt_eh_frame_fde.
6532 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6535 2011-06-29 Ian Lance Taylor <iant@google.com>
6538 * object.cc (Sized_relobj_file::layout_section): Change shdr
6539 parameter to be const.
6540 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6542 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6543 appropriate. Call layout_eh_frame_section.
6544 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6546 * object.h (class Sized_relobj_file): Update declarations.
6548 2011-06-29 Ian Lance Taylor <iant@google.com>
6551 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6553 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6555 2011-06-29 Ian Lance Taylor <iant@google.com>
6558 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6560 * layout.cc (Layout::layout_eh_frame): Likewise.
6562 2011-06-29 Ian Lance Taylor <iant@google.com>
6565 * layout.cc (Layout::symtab_section_shndx): New function.
6566 * layout.h (class Layout): Declare symtab_section_shndx.
6567 * output.cc (Output_section::write_header): Call it.
6569 2011-06-29 Ian Lance Taylor <iant@google.com>
6572 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6573 symbols which are not used in a relocation.
6575 2011-06-28 Ian Lance Taylor <iant@google.com>
6578 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6579 script create indistinguishable segments.
6580 (Layout::set_segment_offsets): Use stable_sort when sorting
6581 segments. Pass this to Compare_segments constructor.
6582 * layout.h (class Layout): Make segment_precedes non-static.
6583 (class Compare_segments): Change from struct to class. Add
6584 layout_ field. Add constructor.
6585 * script-sections.cc
6586 (Script_sections::attach_sections_using_phdrs_clause): Rename
6587 local orphan to is_orphan. Don't report failure to put empty
6588 section in segment. On attachment failure, report name of
6589 section, and attach to first PT_LOAD segment.
6591 2011-06-28 Ian Lance Taylor <iant@google.com>
6594 * target-select.cc (Target_selector::Target_selector): Add
6595 emulation parameter. Change all callers.
6596 (select_target_by_bfd_name): Rename from select_target_by_name.
6598 (select_target_by_emulation): New function.
6599 (supported_emulation_names): New function.
6600 * target-select.h (class Target_selector): Add emulation_ field.
6601 Update declarations.
6602 (Target_selector::recognize_by_bfd_name): Rename from
6603 recognize_by_name. Change all callers.
6604 (Target_selector::supported_bfd_names): Rename from
6605 supported_names. Change all callers.
6606 (Target_selector::recognize_by_emulation): New function.
6607 (Target_selector::supported_emulations): New function.
6608 (Target_selector::emulation): New function.
6609 (Target_selector::do_recognize_by_bfd_name): Rename from
6610 do_recognize_by_name. Change all callers.
6611 (Target_selector::do_supported_bfd_names): Rename from
6612 do_supported_names. Change all callers.
6613 (Target_selector::do_recognize_by_emulation): New function.
6614 (Target_selector::do_supported_emulations): New function.
6615 (select_target_by_bfd_name): Change name in declaration.
6616 (select_target_by_emulation): Declare.
6617 (supported_emulation_names): Declare.
6618 * parameters.cc (parameters_force_valid_target): Try to find
6619 target based on emulation from -m option.
6620 * options.h (class General_options): Change doc string for -m.
6621 * options.cc (help): Print emulations.
6622 (General_options::parse_V): Likewise.
6623 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6624 Add emulation parameter. Change all callers.
6626 2011-06-28 Ian Lance Taylor <iant@google.com>
6628 * target.h (class Target): Add osabi_ field.
6629 (Target::osabi): New function.
6630 (Target::set_osabi): New function.
6631 (Target::Target): Initialize osabi_.
6632 (Target::do_adjust_elf_header): Make pure virtual.
6633 (Sized_target::do_adjust_elf_header): Declare.
6634 * target.cc (Sized_target::do_adjust_elf_header): New function.
6635 (class Sized_target): Instantiate all versions.
6636 * freebsd.h (class Target_freebsd): Remove.
6637 (Target_selector_freebsd::do_recognize): Call set_osabi on
6639 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6640 (Target_selector_freebsd::set_osabi): Remove.
6641 * i386.cc (class Target_i386): Inherit from Sized_target rather
6642 than Target_freebsd.
6643 * x86_64.cc (class Target_x86_64): Likewise.
6645 2011-06-28 Ian Lance Taylor <iant@google.com>
6647 * target.h (Target::can_check_for_function_pointers): Rewrite.
6649 (Target::can_icf_inline_merge_sections): Likewise.
6650 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6651 (Target::Target_info): Add can_icf_inline_merge_sections field.
6652 (Target::do_can_check_for_function_pointers): New virtual
6654 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6655 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6656 from can_check_for_function_pointers, move in file.
6657 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6658 section_may_have_icf_unsafe_poineters, move in file.
6659 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6660 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6661 Rename from can_check_for_function_pointers, move in file.
6662 (Target_i386::can_icf_inline_merge_sections): Remove.
6663 (Target_i386::i386_info): Initialize
6664 can_icf_inline_merge_sections.
6665 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6666 Initialize can_icf_inline_merge_sections.
6667 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6668 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6669 Rename from can_check_for_function_pointers, move in file.
6670 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6671 (Target_x86_64::x86_64_info): Initialize
6672 can_icf_inline_merge_sections.
6673 * testsuite/testfile.cc (Target_test::test_target_info):
6675 * icf.cc (get_section_contents): Correct formatting.
6677 2011-06-27 Ian Lance Taylor <iant@google.com>
6679 * symtab.cc (Symbol::versioned_name): New function.
6680 (Symbol_table::add_to_final_symtab): Use versioned_name when
6682 (Symbol_table::sized_write_symbol): Likewise.
6683 * symtab.h (class Symbol): Declare versioned_name.
6684 * stringpool.h (class Stringpool_template): Add variant of add
6685 which takes a std::basic_string.
6686 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6687 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6688 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6689 (ver_test_12.o): New target.
6690 * testsuite/Makefile.in: Rebuild.
6692 2011-06-27 Doug Kwan <dougkwan@google.com>
6694 * arm.cc (Arm_relocate_functions::thm_jump8,
6695 Arm_relocate_functions::thm_jump11): Use a wider signed
6696 type to compute offset.
6697 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6699 * testsuite/Makefile.in: Regenerate.
6700 * testsuite/arm_branch_in_range.sh: Check test results of
6701 arm_thm_jump11 and arm_thm_jump8.
6702 * testsuite/arm_thm_jump11.s: New test source file.
6703 * testsuite/arm_thm_jump11.t: New linker script.
6704 * testsuite/arm_thm_jump8.s: New test source file.
6705 * testsuite/arm_thm_jump8.t: New linker script.
6707 2011-06-24 Ian Lance Taylor <iant@google.com>
6709 * layout.cc: Include "object.h".
6710 (ctors_sections_in_init_array): New static variable.
6711 (Layout::is_ctors_in_init_array): New function.
6712 (Layout::layout): Add entry to ctors_sections_in_init_array if
6714 * layout.h (class Layout): Declare is_ctors_in_init_array.
6715 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6716 is_ctors_reverse_view is set.
6717 (Sized_relobj_file::write_sections): Add layout parameter. Change
6718 all callers. Set is_ctors_reverse_view field of View_size.
6719 (Sized_relobj_file::reverse_words): New function.
6720 * object.h (Sized_relobj_file::View_size): Add
6721 is_ctors_reverse_view field.
6722 (class Sized_relobj_file): Update declarations.
6723 * testsuite/initpri3.c: New test.
6724 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6726 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6727 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6728 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6729 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6730 * testsuite/Makefile.in: Rebuild.
6732 2011-06-24 Cary Coutant <ccoutant@google.com>
6734 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6735 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6736 (debug_msg_cdebug.err): New targets.
6737 * testsuite/Makefile.in: Regenerate.
6738 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6739 Fix checks for link with shared library.
6741 2011-06-24 Doug Kwan <dougkwan@google.com>
6743 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6744 skip empty text sections.
6745 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6747 2011-06-22 Ian Lance Taylor <iant@google.com>
6750 * options.h (class General_options): Add --ctors-in-init-array.
6751 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6752 friends as SHT_PROGBITS for merging sections.
6753 (Layout::layout): Remove special handling of .init_array and
6754 friends. Don't sort if doing relocatable link. Sort for .ctors
6755 and .dtors if ctors_in_init_array.
6756 (Layout::make_output_section): Force correct section types for
6757 .init_array and friends. Don't sort if doing relocatable link,
6758 Don't sort .ctors and .dtors if ctors_in_init_array.
6759 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6760 (Layout::output_section_name): Add relobj parameter. Change all
6761 callers. Handle .ctors. and .dtors. in code rather than table.
6762 Handle .ctors and .dtors if ctors_in_init_array.
6763 (Layout::match_file_name): New function, moved from output.cc.
6764 * layout.h (class Layout): Update declarations.
6765 * output.cc: Include "layout.h".
6766 (Input_section_sort_entry::get_priority): New function.
6767 (Input_section_sort_entry::match_file_name): Just call
6768 Layout::match_file_name.
6769 (Output_section::Input_section_sort_init_fini_compare::operator()):
6770 Handle .ctors and .dtors. Sort by explicit priority rather than
6772 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6773 * testsuite/initpri2.c: New test.
6774 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6775 (check_PROGRAMS): Add initpri2.
6776 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6777 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6778 * configure, testsuite/Makefile.in: Rebuild.
6780 2011-06-19 Ian Lance Taylor <iant@google.com>
6783 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6784 .interp section to a PT_INTERP segment even if we have seen a
6785 --dynamic-linker option. Don't do it if we have seen a PHDRS
6786 clause in a linker script.
6787 (Layout::finalize): Don't create a .interp section if we've
6788 already create a PT_INTERP segment.
6789 (Layout::create_interp): Always call choose_output_section (revert
6790 patch of 2011-06-17). Don't create PT_INTERP segment.
6791 * script-sections.cc
6792 (Script_sections::create_note_and_tls_segments): Add a .interp
6793 section to a PT_INTERP segment even if we have seen a
6794 --dynamic-linker option.
6796 2011-06-18 Ian Lance Taylor <iant@google.com>
6798 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6799 merely because a non-PT_LOAD segment has a dynamic reloc.
6801 2011-06-18 Ian Lance Taylor <iant@google.com>
6803 * layout.cc (Layout::finish_dynamic_section): Don't create
6804 DT_FLAGS entry if not needed.
6806 2011-06-18 Ian Lance Taylor <iant@google.com>
6809 * layout.cc (Layout::layout_eh_frame): Correct handling of
6810 writable .eh_frame section.
6812 2011-06-17 Ian Lance Taylor <iant@google.com>
6815 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6816 symbol is redefined with the exact same object and value.
6818 2011-06-17 Ian Lance Taylor <iant@google.com>
6821 * layout.h (class Layout): Add interp_segment_ field.
6822 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6823 (Layout::attach_allocated_section_to_segment): If making shared
6824 library, put .interp section in PT_INTERP segment.
6825 (Layout::finalize): Also call create_interp if -dynamic-linker
6827 (Layout::create_interp): Assert that there is no PT_INTERP
6828 segment. If not using a SECTIONS clause, use make_output_section.
6829 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6830 * script-sections.cc
6831 (Script_sections::create_note_and_tls_segments): If making shared
6832 library, put .interp section in PT_INTERP segment.
6834 2011-06-17 Ian Lance Taylor <iant@google.com>
6836 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6837 when making a shared library.
6839 2011-06-17 Ian Lance Taylor <iant@google.com>
6841 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6842 parameter. Change all callers. Don't issue warning about PC32
6843 against locally defined symbol.
6845 2011-06-16 Ian Lance Taylor <iant@google.com>
6847 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6848 occurs in same object.
6850 2011-06-14 Alan Modra <amodra@gmail.com>
6852 * po/POTFILES.in: Regenerate.
6854 2011-06-09 Ian Lance Taylor <iant@google.com>
6856 * script-sections.cc
6857 (Orphan_output_section::set_section_addresses): For a relocatable
6858 link set address to 0.
6860 2011-06-09 Cary Coutant <ccoutant@google.com>
6863 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6864 used with --compress-debug-sections.
6865 * gold/object.cc (Sized_relobj_file::do_layout): Report
6866 uncompressed size of compressed input sections.
6868 2011-06-08 Cary Coutant <ccoutant@google.com>
6871 * testsuite/two_file_test_2_v1.cc: Change initialization of
6872 v2 to keep it in .data.
6874 2011-06-07 Cary Coutant <ccoutant@google.com>
6876 * common.cc (Symbol_table::do_allocate_commons_list): Call
6878 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6879 (Errors::fallback): New function.
6880 (gold_fallback): New function.
6881 * errors.h (Errors::fallback): New function.
6882 * gold.cc (gold_exit): Change status parameter to enum; adjust
6884 (queue_initial_tasks): Call gold_fallback.
6885 * gold.h: Include cstdlib.
6886 (Exit_status): New enum type.
6887 (gold_exit): Change status parameter to enum.
6888 (gold_fallback): New function.
6889 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6890 (Layout::create_symtab_sections): Likewise.
6891 (Layout::create_shdrs): Likewise.
6892 * main.cc (main): Adjust call to gold_exit.
6893 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6894 (Output_data_got::add_got_entry_pair): Likewise.
6895 (Output_section::add_input_section): Likewise.
6896 (Output_section::add_output_section_data): Likewise.
6897 (Output_segment::set_section_list_addresses): Likewise.
6898 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6900 2011-06-07 Cary Coutant <ccoutant@google.com>
6902 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6903 for incremental links.
6904 * output.cc (Output_segment::set_section_list_addresses): Remove
6905 FIXME and test for TLS or BSS.
6907 2011-06-07 Cary Coutant <ccoutant@google.com>
6909 * testsuite/Makefile.am: Add incremental_copy_test,
6910 incremental_common_test_1.
6911 * testsuite/Makefile.in: Regenerate.
6912 * testsuite/common_test_1_v1.c: New source file.
6913 * testsuite/common_test_1_v2.c: New source file.
6914 * testsuite/copy_test_v1.cc: New source file.
6916 2011-06-07 Cary Coutant <ccoutant@google.com>
6918 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6919 update, allocate common from bss section's free list.
6920 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6921 linker-defined symbols.
6922 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6923 Skip GOT and PLT entries that are no longer referenced.
6924 (Output_section_incremental_inputs::write_info_blocks): Mark
6925 linker-defined symbols.
6926 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6927 * output.cc (Output_section::allocate): New function.
6928 * output.h (Output_section::allocate): New function.
6929 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6930 linker-defined symbols.
6931 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6932 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6933 (Symbol::init_base_output_data): Likewise.
6934 (Symbol::init_base_output_segment): Likewise.
6935 (Symbol::init_base_constant): Likewise.
6936 (Sized_symbol::init_output_data): Likewise.
6937 (Sized_symbol::init_output_segment): Likewise.
6938 (Sized_symbol::init_constant): Likewise.
6939 (Symbol_table::do_define_in_output_data): Likewise.
6940 (Symbol_table::do_define_in_output_segment): Likewise.
6941 (Symbol_table::do_define_as_constant): Likewise.
6942 * symtab.h (Symbol::is_predefined): New function.
6943 (Symbol::init_base_output_data): Add is_predefined parameter.
6944 (Symbol::init_base_output_segment): Likewise.
6945 (Symbol::init_base_constant): Likewise.
6946 (Symbol::is_predefined_): New data member.
6947 (Sized_symbol::init_output_data): Add is_predefined parameter.
6948 (Sized_symbol::init_output_segment): Likewise.
6949 (Sized_symbol::init_constant): Likewise.
6950 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6952 2011-06-07 Cary Coutant <ccoutant@google.com>
6954 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6955 instead of emit_copy_reloc.
6956 (Copy_relocs::emit_copy_reloc): Refactor.
6957 (Copy_relocs::make_copy_reloc): New function.
6958 (Copy_relocs::add_copy_reloc): Remove.
6959 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6961 (Copy_relocs::make_copy_reloc): New function.
6962 (Copy_relocs::add_copy_reloc): Remove.
6963 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6964 unchanged input files.
6965 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6966 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6967 Reserve BSS space for COPY relocations.
6968 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6969 (Output_section_incremental_inputs::write_info_blocks): Record
6970 whether a symbol is copied from a shared object.
6971 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6972 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6973 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6974 (Incremental_input_entry_reader::get_output_symbol_index): Add
6976 (Incremental_binary::emit_copy_relocs): New function.
6977 (Incremental_binary::do_emit_copy_relocs): New function.
6978 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6980 (Sized_incremental_binary::add_copy_reloc): New function.
6981 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6982 (Sized_incremental_binary::Copy_reloc): New struct.
6983 (Sized_incremental_binary::Copy_relocs): New typedef.
6984 (Sized_incremental_binary::copy_relocs_): New data member.
6985 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6986 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6987 * target.h (Sized_target::emit_copy_reloc): New function.
6988 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6990 2011-06-02 Cary Coutant <ccoutant@google.com>
6993 * gold/archive.cc (Archive::Archive): Initialize new data member.
6994 (Archive::include_all_members): Return if archive has already been
6996 * gold/archive.h (Archive::include_all_members_): New data member.
6998 2011-06-02 Nick Clifton <nickc@redhat.com>
7000 * dynobj.h: Fix spelling mistake in comment.
7001 * output.cc: Likewise.
7003 2011-05-31 Doug Kwan <dougkwan@google.com>
7007 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
7008 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7009 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7010 redundant arm_exidx_test.so.
7011 * testsuite/Makefile.in: Regenerate.
7012 (check_SCRIPTS): Add pr12826.sh
7013 (check_DATA): Add pr12826.stdout
7014 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7015 * testsuite/pr12826.sh: New file.
7016 * testsuite/pr12826_1.s: Ditto.
7017 * testsuite/pr12826_1.s: Ditto.
7019 2011-05-30 Ian Lance Taylor <iant@google.com>
7021 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7024 2011-05-29 Ian Lance Taylor <iant@google.com>
7027 * testsuite/Makefile.am: Use different file name for two_file_test
7028 temporary file for each incremental test.
7029 * testsuite/Makefile.in: Rebuild.
7031 2011-05-29 Ian Lance Taylor <iant@google.com>
7033 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7034 binary input file is empty.
7036 2011-05-27 Ian Lance Taylor <iant@google.com>
7038 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7039 (ver_test_9.so): Likewise.
7040 * testsuite/Makefile.in: Rebuild.
7042 2011-05-26 Cary Coutant <ccoutant@google.com>
7044 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7045 * incremental.cc (Incremental_inputs::report_input_section): Fix
7046 comment, indentation.
7047 (Incremental_inputs::report_comdat_group): New function.
7048 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7049 of data for incremental input file entry.
7050 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7051 group count, COMDAT group signatures.
7052 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7053 an unchanged input file.
7054 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7055 Initialize new data member.
7056 (Incremental_object_entry::add_comdat_group): New function.
7057 (Incremental_object_entry::get_comdat_group_count): New function.
7058 (Incremental_object_entry::get_comdat_signature_key): New function.
7059 (Incremental_object_entry::groups_): New data member.
7060 (Incremental_inputs::report_comdat_group): New function.
7061 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7062 data for incremental input file entry.
7063 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7064 (Incremental_input_entry_reader::get_input_section): Adjust size of
7065 data for incremental input file entry.
7066 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7067 (Incremental_input_entry_reader::get_comdat_group_signature): New
7069 * object.cc (Sized_relobj::include_section_group): Report kept
7070 COMDAT groups for incremental links.
7072 2011-05-24 David Meyer <pdox@google.com>
7074 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7075 with name parameter. Add found_name parameter.
7076 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7077 * dirsearch.h (class Dirsearch): Update declaration.
7079 2011-05-24 Ian Lance Taylor <iant@google.com>
7081 * archive.cc (Library_base::should_include_member): Pull in object
7082 from archive if it defines the entry symbol.
7083 * parameters.cc (Parameters::entry): New function.
7084 * parameters.h (class Parameters): Declare entry.
7085 * output.h (class Output_file_header): Remove entry_ field.
7086 * output.cc (Output_file_header::Output_file_header): Remove entry
7087 parameter. Change all callers.
7088 (Output_file_header::entry): Use parameters->entry.
7089 * gold.cc (queue_middle_tasks): Likewise.
7090 * plugin.cc (Plugin_hook::run): Likewise.
7092 2011-05-24 Cary Coutant <ccoutant@google.com>
7094 * gold.cc (queue_initial_tasks): Pass incremental base filename
7095 to Output_file::open_base_file; don't print error message.
7096 * incremental-dump.cc (main): Adjust call to
7097 Output_file::open_for_modification.
7098 * incremental-dump.cc (main): Likewise.
7099 * incremental.cc (Incremental_inputs::report_command_line):
7100 Ignore --incremental-base option when comparing command lines.
7101 Ignore parameter when given as separate argument.
7102 * options.h (class General_options): Add --incremental-base.
7103 * output.cc (Output_file::Output_file):
7104 (Output_file::open_base_file): Add base_name and writable parameters;
7105 read base file into new file; print error message here.
7106 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7108 * output.h (Output_file::open_for_modification): Rename to...
7109 (Output_file::open_base_file): ...this; add base_name and
7110 writable parameters; adjust all callers.
7111 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7113 * testsuite/Makefile.am (incremental_test_4): Test
7115 * testsuite/Makefile.in: Regenerate.
7117 2011-05-24 Cary Coutant <ccoutant@google.com>
7119 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7121 * testsuite/Makefile.in: Regenerate.
7122 * testsuite/two_file_test_1_v1.cc: New test source file.
7123 * testsuite/two_file_test_1b_v1.cc: New test source file.
7124 * testsuite/two_file_test_2_v1.cc: New test source file.
7126 2011-05-24 Cary Coutant <ccoutant@google.com>
7128 * dynobj.h (Dynobj::do_dynobj): New function.
7129 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7130 flag and soname for shared objects.
7131 * incremental.cc (Incremental_inputs::report_object): Make
7132 either Incremental_object_entry or Incremental_dynobj_entry; add
7133 soname to string table.
7134 (Incremental_inputs::report_input_section): Add assertion.
7135 (Output_section_incremental_inputs::set_final_data_size): Adjust
7136 type of input file entry for shared libraries; adjust size of
7137 shared library info entry.
7138 (Output_section_incremental_inputs::write_input_files): Write
7139 as_needed flag for shared libraries.
7140 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7141 of input file entry for shared libraries; write soname.
7142 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7143 soname from incremental info.
7144 * incremental.h (enum Incremental_input_flags): Add
7145 INCREMENTAL_INPUT_AS_NEEDED.
7146 (Incremental_input_entry::Incremental_input_entry): Initialize new
7148 (Incremental_input_entry::set_as_needed): New function.
7149 (Incremental_input_entry::as_needed): New function.
7150 (Incremental_input_entry::do_dynobj_entry): New function.
7151 (Incremental_input_entry::as_needed_): New data member.
7152 (Incremental_object_entry::Incremental_object_entry): Don't check
7154 (Incremental_object_entry::do_type): Likewise.
7155 (class Incremental_dynobj_entry): New class.
7156 (Incremental_input_entry_reader::as_needed): New function.
7157 (Incremental_input_entry_reader::get_soname): New function.
7158 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7159 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7160 size of shared library info entry.
7161 * layout.cc (Layout::finish_dynamic_section): Don't test for
7162 incremental link when adding DT_NEEDED entries.
7163 * object.h (Object::Object): Initialize new data member.
7164 (Object::dynobj): New function.
7165 (Object::set_as_needed): New function.
7166 (Object::as_needed): New function.
7167 (Object::do_dynobj): New function.
7168 (Object::as_needed_): New data member.
7170 2011-05-24 Cary Coutant <ccoutant@google.com>
7172 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7173 info; adjust display of GOT entries.
7174 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7175 vector of input objects; remove file_status_.
7176 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7177 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7178 got_plt reader; call target hooks to reserve GOT entries.
7179 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7180 of input file info header and GOT info entry.
7181 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7183 (Got_plt_view_info::got_descriptor): Remove.
7184 (Got_plt_view_info::sym_index): New data member.
7185 (Got_plt_view_info::input_index): New data member.
7186 (Local_got_offset_visitor::visit): Write input file index.
7187 (Global_got_offset_visitor::visit): Write 0 for input file index.
7188 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7189 with sym_index and input_index.
7190 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7191 incremental info GOT entry; replace got_descriptor with input_index.
7192 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7193 map from input file index to object.
7194 (Sized_relobj_incr::do_layout): Replace direct data member reference
7195 with accessor function.
7196 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7197 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7198 Adjust size of input file info header.
7199 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7200 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7201 (Incremental_input_entry_reader::get_input_section): Adjust size of
7202 input file info header.
7203 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7204 of incremental info GOT entry.
7205 (Incremental_got_plt_reader::get_got_desc): Remove.
7206 (Incremental_got_plt_reader::get_got_symndx): New function.
7207 (Incremental_got_plt_reader::get_got_input_index): New function.
7208 (Sized_incremental_binary::Sized_incremental_binary): Remove
7209 file_status_; add input_objects_.
7210 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7211 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7212 (Sized_incremental_binary::file_is_unchanged): Remove.
7213 (Sized_incremental_binary::set_input_object): New function.
7214 (Sized_incremental_binary::input_object): New function.
7215 (Sized_incremental_binary::file_status_): Remove.
7216 (Sized_incremental_binary::input_objects_): New data member.
7217 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7219 (Sized_relobj_incr::invalid_address): Move to base class.
7220 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7222 (Sized_relobj_incr::do_output_section_offset): Likewise.
7223 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7224 (Sized_relobj_incr::section_offsets_): Likewise.
7225 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7227 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7228 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7229 with accessor function.
7230 (Sized_relobj_file::do_layout): Likewise.
7231 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7232 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7233 (Sized_relobj_file::compute_final_local_value): Replace refs to
7234 section_offsets_ with accessor function.
7235 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7236 * object.h (Relobj::Relobj): Initialize new data members.
7237 (Relobj::add_dyn_reloc): New function.
7238 (Relobj::first_dyn_reloc): New function.
7239 (Relobj::dyn_reloc_count): New function.
7240 (Relobj::first_dyn_reloc_): New data member.
7241 (Relobj::dyn_reloc_count_): New data member.
7242 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7244 (Sized_relobj::Address): New typedef.
7245 (Sized_relobj::invalid_address): Move here from child class.
7246 (Sized_relobj::Sized_relobj): Initialize new data members.
7247 (Sized_relobj::sized_relobj): New function.
7248 (Sized_relobj::is_output_section_offset_invalid): Move here from
7250 (Sized_relobj::get_output_section_offset): Likewise.
7251 (Sized_relobj::local_has_got_offset): Likewise.
7252 (Sized_relobj::local_got_offset): Likewise.
7253 (Sized_relobj::set_local_got_offset): Likewise.
7254 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7255 (Sized_relobj::clear_got_offsets): New function.
7256 (Sized_relobj::section_offsets): Move here from child class.
7257 (Sized_relobj::do_output_section_offset): Likewise.
7258 (Sized_relobj::do_set_section_offset): Likewise.
7259 (Sized_relobj::Local_got_offsets): Likewise.
7260 (Sized_relobj::local_got_offsets_): Likewise.
7261 (Sized_relobj::section_offsets_): Likewise.
7262 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7264 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7266 (Sized_relobj_file::sized_relobj): New function
7267 (Sized_relobj_file::local_has_got_offset): Move to base class.
7268 (Sized_relobj_file::local_got_offset): Likewise.
7269 (Sized_relobj_file::set_local_got_offset): Likewise.
7270 (Sized_relobj_file::get_output_section_offset): Likewise.
7271 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7272 (Sized_relobj_file::do_output_section_offset): Likewise.
7273 (Sized_relobj_file::do_set_section_offset): Likewise.
7274 (Sized_relobj_file::Local_got_offsets): Likewise.
7275 (Sized_relobj_file::local_got_offsets_): Likewise.
7276 (Sized_relobj_file::section_offsets_): Likewise.
7277 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7279 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7280 (Output_reloc::get_symbol_index): Likewise.
7281 (Output_reloc::local_section_offset): Likewise.
7282 (Output_reloc::get_address): Likewise.
7283 (Output_reloc::symbol_value): Likewise.
7284 (Output_data_got::reserve_slot): Move to class definition.
7285 (Output_data_got::reserve_local): New function.
7286 (Output_data_got::reserve_slot_for_global): Remove.
7287 (Output_data_got::reserve_global): New function.
7288 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7289 (all constructors, two instantiations).
7290 (Output_reloc::get_relobj): New function (two instantiations).
7291 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7292 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7293 (Output_data_reloc::add_global): Adjust type of relobj.
7294 (Output_data_reloc::add_global_relative): Likewise.
7295 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7296 (Output_data_reloc::add_local): Likewise.
7297 (Output_data_reloc::add_local_relative): Likewise.
7298 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7299 (Output_data_reloc::add_local_section): Likewise.
7300 (Output_data_reloc::add_output_section): Likewise.
7301 (Output_data_reloc::add_absolute): Likewise.
7302 (Output_data_reloc::add_target_specific): Likewise.
7303 (Output_data_got::reserve_slot): Move definition here.
7304 (Output_data_got::reserve_local): New function.
7305 (Output_data_got::reserve_global): New function.
7306 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7307 section_offsets_ with accessor function.
7308 (Sized_relobj_file::write_sections): Likewise.
7309 (Sized_relobj_file::do_relocate_sections): Likewise.
7310 * target.h (Sized_target::reserve_local_got_entry): New function.
7311 (Sized_target::reserve_global_got_entry): New function.
7312 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7313 (Target_x86_64::reserve_global_got_entry): New function.
7314 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7316 2011-05-23 Cary Coutant <ccoutant@google.com>
7318 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7319 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7320 bit when checking got_type.
7321 * incremental.cc (Sized_incremental_binary::setup_readers):
7322 Store symbol table and string table locations; initialize bit vector
7323 of file status flags.
7324 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7326 (Sized_incremental_binary::do_process_got_plt): New function.
7327 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7328 (Output_section_incremental_inputs::set_final_data_size): Record
7329 file index for each input file.
7330 (Output_section_incremental_inputs::write_got_plt): Store file index
7331 instead of input entry offset for each GOT entry.
7333 (Incremental_input_entry::Incremental_input_entry): Initialize new
7335 (Incremental_input_entry::set_offset): Store file index.
7336 (Incremental_input_entry::get_file_index): New function.
7337 (Incremental_input_entry::file_index_): New data member.
7338 (Incremental_binary::process_got_plt): New function.
7339 (Incremental_binary::do_process_got_plt): New function.
7340 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7342 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7343 (Sized_incremental_binary::set_file_is_unchanged): New function.
7344 (Sized_incremental_binary::file_is_unchanged): New function.
7345 (Sized_incremental_binary::do_process_got_plt): New function.
7346 (Sized_incremental_binary::file_status_): New data member.
7347 (Sized_incremental_binary::main_symtab_loc_): New data member.
7348 (Sized_incremental_binary::main_strtab_loc_): New data member.
7349 * output.cc (Output_data_got::Got_entry::write): Add case
7351 (Output_data_got::add_global): Call add_got_entry.
7352 (Output_data_got::add_global_plt): Likewise.
7353 (Output_data_got::add_global_with_rel): Likewise.
7354 (Output_data_got::add_global_with_rela): Likewise.
7355 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7356 (Output_data_got::add_global_pair_with_rela): Likewise.
7357 (Output_data_got::add_local): Call add_got_entry.
7358 (Output_data_got::add_local_plt): Likewise.
7359 (Output_data_got::add_local_with_rel): Likewise.
7360 (Output_data_got::add_local_with_rela): Likewise.
7361 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7362 (Output_data_got::add_local_pair_with_rela): Likewise.
7363 (Output_data_got::reserve_slot): New function.
7364 (Output_data_got::reserve_slot_for_global): New function.
7365 (Output_data_got::add_got_entry): New function.
7366 (Output_data_got::add_got_entry_pair): New function.
7367 (Output_section::add_output_section_data): Edit FIXME.
7369 (Output_section_data_build::Output_section_data_build): New
7370 constructor with size parameter.
7371 (Output_data_space::Output_data_space): Likewise.
7372 (Output_data_got::Output_data_got): Initialize new data member; new
7373 constructor with size parameter.
7374 (Output_data_got::add_constant): Call add_got_entry.
7375 (Output_data_got::reserve_slot): New function.
7376 (Output_data_got::reserve_slot_for_global): New function.
7377 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7378 (Output_data_got::add_got_entry): New function.
7379 (Output_data_got::add_got_entry_pair): New function.
7380 (Output_data_got::free_list_): New data member.
7381 * target.h (Sized_target::init_got_plt_for_update): New function.
7382 (Sized_target::register_global_plt_entry): New function.
7383 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7384 Initialize new data member; call init; add constructor with PLT count.
7385 (Output_data_plt_x86_64::init): New function.
7386 (Output_data_plt_x86_64::add_relocation): New function.
7387 (Output_data_plt_x86_64::reserve_slot): New function.
7388 (Output_data_plt_x86_64::free_list_): New data member.
7389 (Target_x86_64::init_got_plt_for_update): New function.
7390 (Target_x86_64::register_global_plt_entry): New function.
7391 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7392 incremental updates.
7393 (Output_data_plt_x86_64::add_relocation): New function.
7394 * testsuite/object_unittest.cc (Object_test): Set default options.
7396 2011-05-16 Ian Lance Taylor <iant@google.com>
7398 * options.h (class General_options): Make -i a synonym for -r.
7400 2011-05-16 Ian Lance Taylor <iant@google.com>
7402 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7404 2011-05-10 Cary Coutant <ccoutant@google.com>
7406 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7409 2011-05-06 Ian Lance Taylor <iant@google.com>
7411 * layout.cc (Layout::layout): If the output section flags change,
7412 update the ordering.
7414 2011-04-25 Cary Coutant <ccoutant@google.com>
7416 * incremental-dump.cc (dump_incremental_inputs): Print local
7417 symbol info for each input file.
7419 (Output_section_incremental_inputs::set_final_data_size): Add local
7420 symbol info to input file entries in incremental info.
7421 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7422 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7423 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7424 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7426 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7427 (Sized_incr_relobj::do_relocate): Write the local symbols.
7428 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7429 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7430 Adjust size of input file header.
7431 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7432 (Incremental_inputs_reader::get_local_symbol_count): New function.
7433 (Incremental_inputs_reader::get_input_section): Adjust size of input
7435 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7436 (Sized_incr_relobj::This): New typedef.
7437 (Sized_incr_relobj::sym_size): New const data member.
7438 (Sized_incr_relobj::Local_symbol): New struct.
7439 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7440 (Sized_incr_relobj::do_local_symbol_offset): New function.
7441 (Sized_incr_relobj::local_symbol_count_): New data member.
7442 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7443 (Sized_incr_relobj::local_symbol_index_): New data member.
7444 (Sized_incr_relobj::local_symbol_offset_): New data member.
7445 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7446 (Sized_incr_relobj::local_symbols_): New data member.
7447 * object.h (Relobj::output_local_symbol_count): New function.
7448 (Relobj::local_symbol_offset): New function.
7449 (Relobj::do_output_local_symbol_count): New function.
7450 (Relobj::do_local_symbol_offset): New function.
7451 (Sized_relobj::do_output_local_symbol_count): New function.
7452 (Sized_relobj::do_local_symbol_offset): New function.
7454 2011-04-22 Vladimir Simonov <sv@sw.ru>
7456 * descriptors.cc (set_close_on_exec): New function.
7457 (Descriptors::open): Use set_close_on_exec.
7458 * output.cc (S_ISLNK): Define if not defined.
7460 2011-04-22 Cary Coutant <ccoutant@google.com>
7462 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7464 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7465 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7466 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7468 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7469 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7470 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7472 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7474 (Incremental_binary::apply_incremental_relocs): New function.
7475 (Incremental_binary::do_apply_incremental_relocs): New function.
7476 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7478 (Sized_incremental_binary::add_global_symbol): New function.
7479 (Sized_incremental_binary::global_symbol): New function.
7480 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7481 (Sized_incremental_binary::symbol_map_): New data member.
7482 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7483 * target.h (Sized_target::apply_relocation): New function.
7484 * target-reloc.h (apply_relocation): New function.
7485 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7487 2011-04-22 Doug Kwan <dougkwan@google.com>
7489 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7490 flag of a SHT_ARM_EXIDX section.
7491 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7492 * testsuite/Makefile.in: Regenerate.
7493 * testsuite/arm_exidx_test.s: New file.
7494 * testsuite/arm_exidx_test.sh: Same.
7496 2011-04-20 Cary Coutant <ccoutant@google.com>
7499 * archive.h (Incremental_archive_entry::Archive_member):
7500 Initialize arg_serial_ (second constructor).
7502 2011-04-17 Ian Lance Taylor <iant@google.com>
7504 * object.cc (Relocate_info::location): Simplify location string.
7505 * errors.cc (Errors::error_at_location): Don't print program
7507 (Errors::warning_at_location): Likewise.
7508 (Errors::undefined_symbol): Likewise.
7509 * testsuite/debug_msg.sh: Update accordingly.
7511 2011-04-14 Cary Coutant <ccoutant@google.com>
7513 * gold/layout.cc (Layout::symtab_section_offset): New function.
7514 * gold/layout.h (Layout::symtab_section_offset): New function.
7515 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7517 2011-04-12 Ian Lance Taylor <iant@google.com>
7519 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7520 with MREMAP_MAYMOVE.
7521 * output.h (class Output_file): Add map_is_allocated_ field.
7522 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7523 not available, provide stubs. If mremap is not available, #define
7525 (MREMAP_MAYMOVE): Define if not defined.
7526 (Output_file::Output_file): Initialize map_is_allocated_.
7527 (Output_file::resize): Check map_is_allocated_.
7528 (Output_file::map_anonymous): If mmap fails, use malloc.
7529 (Output_file::unmap): Don't do anything for an anonymous map.
7530 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7531 is not available, provide stubs.
7532 (File_read::View::~View): Use free rather than delete[].
7533 (File_read::make_view): Use malloc rather than new[]. If mmap
7535 (File_read::find_or_make_view): Use malloc rather than new[].
7536 * gold.h: Remove HAVE_REMAP code.
7537 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7538 exists. Rename mremap to gold_mremap. If mmap is not available
7540 * configure, config.in: Rebuild.
7542 2011-04-11 Ian Lance Taylor <iant@google.com>
7544 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7545 initialize local variable v.
7547 2011-04-11 Cary Coutant <ccoutant@google.com>
7549 * archive.cc (Archive::include_member): Adjust call to
7551 (Add_archive_symbols::run): Track argument serial numbers.
7552 (Lib_group::include_member): Likewise.
7553 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7554 * archive.h (Incremental_archive_entry::Archive_member):
7555 Initialize arg_serial_.
7556 (Archive_member::arg_serial_): New data member.
7557 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7558 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7560 (Sized_dynobj::do_for_all_local_got_entries): New function.
7561 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7563 * fileread.cc (get_mtime): New function.
7564 * fileread.h (get_mtime): New function.
7565 * gold.cc (queue_initial_tasks): Check for incremental update.
7566 (process_incremental_input): New function.
7567 (queue_middle_tasks): Don't force valid target for incremental
7569 * incremental-dump.cc (find_input_containing_global): Adjust
7570 size of symbol info entry.
7571 (dump_incremental_inputs): Dump argument serial number and
7572 in_system_directory flag; bias shndx by 1; print symbol names
7573 when dumping per-file symbol lists; use new symbol info readers.
7575 (Output_section_incremental_inputs:update_data_size): New function.
7576 (Sized_incremental_binary::setup_readers): Setup input readers
7577 for each input file; build maps for files added from libraries
7579 (Sized_incremental_binary::check_input_args): New function.
7580 (Sized_incremental_binary::do_check_inputs): Build map of argument
7581 serial numbers to input arguments.
7582 (Sized_incremental_binary::do_file_has_changed): Rename
7583 do_file_is_unchanged to this; compare file modification times.
7584 (Sized_incremental_binary::do_init_layout): New function.
7585 (Sized_incremental_binary::do_reserve_layout): New function.
7586 (Sized_incremental_binary::do_get_input_reader): Remove.
7587 (Sized_incremental_binary::get_symtab_view): New function.
7588 (Incremental_checker::can_incrementally_link_output_file): Remove.
7589 (Incremental_inputs::report_command_line): Exclude --debug options.
7590 (Incremental_inputs::report_archive_begin): Add parameter; track
7591 argument serial numbers; don't put input file entry for archive
7592 before archive members.
7593 (Incremental_inputs::report_archive_end): Put input file entry
7594 for archive after archive members.
7595 (Incremental_inputs::report_object): Add parameter; track argument
7596 serial numbers and in_system_directory flag.
7597 (Incremental_inputs::report_script): Add parameter; track argument
7599 (Output_section_incremental_inputs::set_final_data_size): Adjust
7600 size of symbol info entry; check for forwarding symbols.
7601 (Output_section_incremental_inputs::write_input_files): Write
7602 in_system_directory flag and argument serial number.
7603 (Output_section_incremental_inputs::write_info_blocks): Map section
7604 indices between incremental info and original input file; store
7605 input section index for each symbol.
7606 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7607 change operator() to visit().
7608 (class Global_got_offset_visitor): Likewise.
7609 (class Global_symbol_visitor_got_plt):
7610 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7612 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7613 (Sized_incr_relobj::do_read_symbols): New function.
7614 (Sized_incr_relobj::do_layout): New function.
7615 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7616 (Sized_incr_relobj::do_add_symbols): New function.
7617 (Sized_incr_relobj::do_should_include_member): New function.
7618 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7619 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7620 (Sized_incr_relobj::do_section_size): New function.
7621 (Sized_incr_relobj::do_section_name): New function.
7622 (Sized_incr_relobj::do_section_contents): New function.
7623 (Sized_incr_relobj::do_section_flags): New function.
7624 (Sized_incr_relobj::do_section_entsize): New function.
7625 (Sized_incr_relobj::do_section_address): New function.
7626 (Sized_incr_relobj::do_section_type): New function.
7627 (Sized_incr_relobj::do_section_link): New function.
7628 (Sized_incr_relobj::do_section_info): New function.
7629 (Sized_incr_relobj::do_section_addralign): New function.
7630 (Sized_incr_relobj::do_initialize_xindex): New function.
7631 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7632 (Sized_incr_relobj::do_read_relocs): New function.
7633 (Sized_incr_relobj::do_gc_process_relocs): New function.
7634 (Sized_incr_relobj::do_scan_relocs): New function.
7635 (Sized_incr_relobj::do_count_local_symbols): New function.
7636 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7637 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7638 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7639 (Sized_incr_relobj::do_relocate): New function.
7640 (Sized_incr_relobj::do_set_section_offset): New function.
7641 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7642 (Sized_incr_dynobj::do_read_symbols): New function.
7643 (Sized_incr_dynobj::do_layout): New function.
7644 (Sized_incr_dynobj::do_add_symbols): New function.
7645 (Sized_incr_dynobj::do_should_include_member): New function.
7646 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7647 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7648 (Sized_incr_dynobj::do_section_size): New function.
7649 (Sized_incr_dynobj::do_section_name): New function.
7650 (Sized_incr_dynobj::do_section_contents): New function.
7651 (Sized_incr_dynobj::do_section_flags): New function.
7652 (Sized_incr_dynobj::do_section_entsize): New function.
7653 (Sized_incr_dynobj::do_section_address): New function.
7654 (Sized_incr_dynobj::do_section_type): New function.
7655 (Sized_incr_dynobj::do_section_link): New function.
7656 (Sized_incr_dynobj::do_section_info): New function.
7657 (Sized_incr_dynobj::do_section_addralign): New function.
7658 (Sized_incr_dynobj::do_initialize_xindex): New function.
7659 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7660 (make_sized_incremental_object): New function.
7661 (Incremental_library::copy_unused_symbols): New function.
7662 (Incremental_library::do_for_all_unused_symbols): New function.
7663 * incremental.h (enum Incremental_input_flags): New type.
7664 (class Incremental_checker): Remove.
7665 (Incremental_input_entry::Incremental_input_entry): Add argument
7667 (Incremental_input_entry::arg_serial): New function.
7668 (Incremental_input_entry::set_is_in_system_directory): New function.
7669 (Incremental_input_entry::is_in_system_directory): New function.
7670 (Incremental_input_entry::arg_serial_): New data member.
7671 (Incremental_input_entry::is_in_system_directory_): New data member.
7672 (class Script_info): Move here from script.h.
7673 (Script_info::Script_info): Add filename parameter.
7674 (Script_info::filename): New function.
7675 (Script_info::filename_): New data member.
7676 (Incremental_script_entry::Incremental_script_entry): Add argument
7678 (Incremental_object_entry::Incremental_object_entry): Likewise.
7679 (Incremental_object_entry::add_input_section): Build list of input
7680 sections with map to original shndx.
7681 (Incremental_object_entry::get_input_section_index): New function.
7682 (Incremental_object_entry::shndx_): New data member.
7683 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7684 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7685 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7687 (Incremental_inputs::report_archive_begin): Likewise.
7688 (Incremental_inputs::report_object): Likewise.
7689 (Incremental_inputs::report_script): Likewise.
7690 (class Incremental_global_symbol_reader): New class.
7691 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7692 and store flags and input file type.
7693 (Incremental_input_entry_reader::arg_serial): New function.
7694 (Incremental_input_entry_reader::type): Extract type from flags.
7695 (Incremental_input_entry_reader::is_in_system_directory): New function.
7696 (Incremental_input_entry_reader::get_input_section_count): Call
7697 accessor function for type.
7698 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7699 function for type; adjust size of global symbol entry.
7700 (Incremental_input_entry_reader::get_global_symbol_count): Call
7701 accessor function for type.
7702 (Incremental_input_entry_reader::get_object_count): Likewise.
7703 (Incremental_input_entry_reader::get_object_offset): Likewise.
7704 (Incremental_input_entry_reader::get_member_count): Likewise.
7705 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7706 (Incremental_input_entry_reader::get_member_offset): Likewise.
7707 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7708 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7709 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7710 (Incremental_input_entry_reader::get_global_symbol_reader): New
7712 (Incremental_input_entry_reader::get_output_symbol_index): New
7714 (Incremental_input_entry_reader::type_): Remove.
7715 (Incremental_input_entry_reader::flags_): New data member.
7716 (Incremental_inputs_reader::input_file_offset): New function.
7717 (Incremental_inputs_reader::input_file_index): New function.
7718 (Incremental_inputs_reader::input_file): Call input_file_offset.
7719 (Incremental_inputs_reader::input_file_at_offset): New function.
7720 (Incremental_relocs_reader::get_r_type): Reformat.
7721 (Incremental_relocs_reader::get_r_shndx): Reformat.
7722 (Incremental_relocs_reader::get_r_offset): Reformat.
7723 (Incremental_relocs_reader::data): New function.
7724 (Incremental_binary::Incremental_binary): Initialize new data members.
7725 (Incremental_binary::check_inputs): Add cmdline parameter.
7726 (Incremental_binary::file_is_unchanged): Remove.
7727 (Input_reader::arg_serial): New function.
7728 (Input_reader::get_unused_symbol_count): New function.
7729 (Input_reader::get_unused_symbol): New function.
7730 (Input_reader::do_arg_serial): New function.
7731 (Input_reader::do_get_unused_symbol_count): New function.
7732 (Input_reader::do_get_unused_symbol): New function.
7733 (Incremental_binary::input_file_count): New function.
7734 (Incremental_binary::get_input_reader): Change signature to use
7735 index instead of filename.
7736 (Incremental_binary::file_has_changed): New function.
7737 (Incremental_binary::get_input_argument): New function.
7738 (Incremental_binary::get_library): New function.
7739 (Incremental_binary::get_script_info): New function.
7740 (Incremental_binary::init_layout): New function.
7741 (Incremental_binary::reserve_layout): New function.
7742 (Incremental_binary::output_file): New function.
7743 (Incremental_binary::do_check_inputs): New function.
7744 (Incremental_binary::do_file_is_unchanged): Remove.
7745 (Incremental_binary::do_file_has_changed): New function.
7746 (Incremental_binary::do_init_layout): New function.
7747 (Incremental_binary::do_reserve_layout): New function.
7748 (Incremental_binary::do_input_file_count): New function.
7749 (Incremental_binary::do_get_input_reader): Change signature.
7750 (Incremental_binary::input_args_map_): New data member.
7751 (Incremental_binary::library_map_): New data member.
7752 (Incremental_binary::script_map_): New data member.
7753 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7755 (Sized_incremental_binary::output_section): New function.
7756 (Sized_incremental_binary::inputs_reader): Add const.
7757 (Sized_incremental_binary::symtab_reader): Add const.
7758 (Sized_incremental_binary::relocs_reader): Add const.
7759 (Sized_incremental_binary::got_plt_reader): Add const.
7760 (Sized_incremental_binary::get_symtab_view): New function.
7761 (Sized_incremental_binary::Inputs_reader): New typedef.
7762 (Sized_incremental_binary::Input_entry_reader): New typedef.
7763 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7764 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7765 (Sized_incremental_binary::do_file_has_changed): New function.
7766 (Sized_incremental_binary::do_init_layout): New function.
7767 (Sized_incremental_binary::do_reserve_layout): New function.
7768 (Sized_input_reader::Inputs_reader): Remove.
7769 (Sized_input_reader::Input_entry_reader): Remove.
7770 (Sized_input_reader::do_arg_serial): New function.
7771 (Sized_input_reader::do_get_unused_symbol_count): New function.
7772 (Sized_input_reader::do_get_unused_symbol): New function.
7773 (Sized_incremental_binary::do_input_file_count): New function.
7774 (Sized_incremental_binary::do_get_input_reader): Change signature;
7775 use index instead of filename.
7776 (Sized_incremental_binary::section_map_): New data member.
7777 (Sized_incremental_binary::input_entry_readers_): New data member.
7778 (class Sized_incr_relobj): New class.
7779 (class Sized_incr_dynobj): New class.
7780 (make_sized_incremental_object): New function.
7781 (class Incremental_library): New class.
7782 * layout.cc (Free_list::num_lists): New static data member.
7783 (Free_list::num_nodes): New static data member.
7784 (Free_list::num_removes): New static data member.
7785 (Free_list::num_remove_visits): New static data member.
7786 (Free_list::num_allocates): New static data member.
7787 (Free_list::num_allocate_visits): New static data member.
7788 (Free_list::init): New function.
7789 (Free_list::remove): New function.
7790 (Free_list::allocate): New function.
7791 (Free_list::dump): New function.
7792 (Free_list::print_stats): New function.
7793 (Layout_task_runner::run): Resize output file for incremental updates.
7794 (Layout::Layout): Initialize new data members.
7795 (Layout::set_incremental_base): New function.
7796 (Layout::init_fixed_output_section): New function.
7797 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7798 incremental updates.
7799 (Layout::create_gold_note): Do not create gold note section for
7800 incremental updates.
7801 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7802 for incremental updates.
7803 (Layout::set_section_offsets): For incremental updates, allocate space
7805 (Layout::create_symtab_sections): Layout with offsets relative to
7806 start of section; for incremental updates, allocate space from free
7808 (Layout::create_shdrs): For incremental updates, allocate space from
7810 (Layout::finish_dynamic_section): For incremental updates, do not
7811 check --as-needed (fixed in subsequent patch).
7812 * layout.h (class Free_list): New class.
7813 (Layout::set_incremental_base): New function.
7814 (Layout::incremental_base): New function.
7815 (Layout::init_fixed_output_section): New function.
7816 (Layout::allocate): New function.
7817 (Layout::incremental_base_): New data member.
7818 (Layout::free_list_): New data member.
7819 * main.cc (main): Print Free_list statistics.
7820 * object.cc (Relobj::finalize_incremental_relocs): Add
7821 clear_counts parameter; clear counts only when clear_counts is set.
7822 (Sized_relobj::Sized_relobj): Initialize new base class.
7823 (Sized_relobj::do_layout): Don't report special sections.
7824 (Sized_relobj::do_for_all_local_got_entries): New function.
7825 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7826 symtab_off to all symbol table offsets.
7827 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7828 * object.h (class Got_offset_list): Move to top of file.
7829 (Object::Object): Allow case where input_file == NULL.
7830 (Object::~Object): Likewise.
7831 (Object::input_file): Assert that input_file != NULL.
7832 (Object::lock): Allow case where input_file == NULL.
7833 (Object::unlock): Likewise.
7834 (Object::is_locked): Likewise.
7835 (Object::token): Likewise.
7836 (Object::release): Likewise.
7837 (Object::is_incremental): New function.
7838 (Object::get_mtime): New function.
7839 (Object::for_all_local_got_entries): New function.
7840 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7841 (Object::set_is_in_system_directory): New function.
7842 (Object::is_in_system_directory): New function.
7843 (Object::do_is_incremental): New function.
7844 (Object::do_get_mtime): New function.
7845 (Object::do_for_all_local_got_entries): New function.
7846 (Object::is_in_system_directory_): New data member.
7847 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7848 (class Sized_relobj_base): New class.
7849 (class Sized_relobj): Derive from Sized_relobj_base.
7850 (class Sized_relobj::Symbols): Redeclare from base class.
7851 (class Sized_relobj::local_got_offset_list): Remove.
7852 (class Sized_relobj::Output_sections): Redeclare from base class.
7853 (class Sized_relobj::do_for_all_local_got_entries): New function.
7854 (class Sized_relobj::write_local_symbols): Add offset parameter.
7855 (class Sized_relobj::local_symbol_offset_): Update comment.
7856 (class Sized_relobj::local_dynsym_offset_): Update comment.
7857 * options.cc (Input_arguments::add_file): Remove const.
7858 * options.h (Input_file_argument::Input_file_argument):
7859 Initialize arg_serial_ (all constructors).
7860 (Input_file_argument::set_arg_serial): New function.
7861 (Input_file_argument::arg_serial): New function.
7862 (Input_file_argument::arg_serial_): New data member.
7863 (Input_arguments::Input_arguments): Initialize file_count_.
7864 (Input_arguments::add_file): Remove const.
7865 (Input_arguments::number_of_input_files): New function.
7866 (Input_arguments::file_count_): New data member.
7867 (Command_line::number_of_input_files): Call
7868 Input_arguments::number_of_input_files.
7869 * output.cc (Output_segment_headers::Output_segment_headers):
7871 (Output_section::Input_section::current_data_size): New function.
7872 (Output_section::Output_section): Initialize new data members.
7873 (Output_section::add_input_section): Don't do merge sections for
7874 an incremental link; allocate space from free list for an
7876 (Output_section::add_output_section_data): Allocate space from
7877 free list for an incremental update.
7878 (Output_section::update_data_size): New function.
7879 (Output_section::set_fixed_layout): New function.
7880 (Output_section::reserve): New function.
7881 (Output_segment::set_section_addresses): Remove const.
7882 (Output_segment::set_section_list_addresses): Remove const; allocate
7883 space from free list for an incremental update.
7884 (Output_segment::set_offset): Adjust size of RELRO segment for an
7886 * output.h (Output_data::current_data_size): Move here from
7888 (Output_data::pre_finalize_data_size): New function.
7889 (Output_data::update_data_size): New function.
7890 (Output_section_headers::update_data_size): new function.
7891 (Output_section_data_build::current_data_size): Move to Output_data.
7892 (Output_data_strtab::update_data_size): New function.
7893 (Output_section::current_data_size): Move to Output_data.
7894 (Output_section::set_fixed_layout): New function.
7895 (Output_section::has_fixed_layout): New function.
7896 (Output_section::reserve): New function.
7897 (Output_section::update_data_size): New function.
7898 (Output_section::has_fixed_layout_): New data member.
7899 (Output_section::free_list_): New data member.
7900 (Output_segment::set_section_addresses): Remove const.
7901 (Output_segment::set_section_list_addresses): Remove const.
7902 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7904 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7906 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7907 parameter when calling Add_symbols constructor; store argument
7908 serial number for members of a lib group.
7909 (Add_symbols::locks): Allow case where token == NULL.
7910 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7911 (Read_member::~Read_member): New function.
7912 (Read_member::is_runnable): New function.
7913 (Read_member::locks): New function.
7914 (Read_member::run): New function.
7915 (Check_script::~Check_script): New function.
7916 (Check_script::is_runnable): New function.
7917 (Check_script::locks): New function.
7918 (Check_script::run): New function.
7919 (Check_library::~Check_library): New function.
7920 (Check_library::is_runnable): New function.
7921 (Check_library::locks): New function.
7922 (Check_library::run): New function.
7923 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7924 (Add_symbols::library_): New data member.
7925 (class Read_member): New class.
7926 (class Check_script): New class.
7927 (class Check_library): New class.
7928 * reloc.cc (Read_relocs::is_runnable): Allow case where
7930 (Read_relocs::locks): Likewise.
7931 (Scan_relocs::locks): Likewise.
7932 (Relocate_task::locks): Likewise.
7933 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7935 (Sized_relobj::incremental_relocs_scan): Fix comment.
7936 (Sized_relobj::do_relocate): Pass output file offset to
7937 write_local_symbols.
7938 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7939 from class declaration.
7940 * script.cc (read_input_script): Allocate Script_info; pass
7941 argument serial number to report_script.
7942 * script.h (class Script_info): Move to incremental.h.
7943 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7944 * symtab.h (Symbol_table::add_from_incrobj): New function.
7945 (Symbol_table::set_file_offset): New function.
7947 2011-04-05 Cary Coutant <ccoutant@google.com>
7949 * incremental-dump.cc (dump_incremental_inputs): Change signature
7950 to take a Sized_incremental_binary; change caller. Use readers
7951 in Sized_incremental_binary.
7953 (Sized_incremental_binary::find_incremental_inputs_sections):
7954 Rename do_find_incremental_inputs_sections to this.
7955 (Sized_incremental_binary::setup_readers): New function.
7956 (Sized_incremental_binary::do_check_inputs): Check
7957 has_incremental_info_ flag; move setup code to setup_readers;
7959 (Sized_incremental_binary::do_file_is_unchanged): New function.
7960 (Sized_incremental_binary::do_get_input_reader): New function.
7961 * incremental.h (class Incremental_binary): Move to end of file.
7962 (Incremental_binary::file_is_unchanged): New function.
7963 (Incremental_binary::do_file_is_unchanged): New function.
7964 (Incremental_binary::Input_reader): New class.
7965 (Incremental_binary::get_input_reader): New function.
7966 (class Sized_incremental_binary): Move to end of file.
7967 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7968 input section reader classes.
7969 (Sized_incremental_binary::has_incremental_info): New function.
7970 (Sized_incremental_binary::inputs_reader): New function.
7971 (Sized_incremental_binary::symtab_reader): New function.
7972 (Sized_incremental_binary::relocs_reader): New function.
7973 (Sized_incremental_binary::got_plt_reader): New function.
7974 (Sized_incremental_binary::do_file_is_unchanged): New function.
7975 (Sized_incremental_binary::Sized_input_reader): New class.
7976 (Sized_incremental_binary::get_input_reader): New function.
7977 (Sized_incremental_binary::find_incremental_inputs_sections):
7978 Rename do_find_incremental_inputs_sections to this.
7979 (Sized_incremental_binary::setup_readers): New function.
7980 (Sized_incremental_binary::has_incremental_info_): New data member.
7981 (Sized_incremental_binary::inputs_reader_): New data member.
7982 (Sized_incremental_binary::symtab_reader_): New data member.
7983 (Sized_incremental_binary::relocs_reader_): New data member.
7984 (Sized_incremental_binary::got_plt_reader_): New data member.
7985 (Sized_incremental_binary::current_input_file_): New data member.
7987 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7990 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7993 2011-03-30 Cary Coutant <ccoutant@google.com>
7995 * archive.cc (Archive::include_member): Adjust call to report_object.
7996 (Add_archive_symbols::run): Add script_info to call to
7997 report_archive_begin.
7998 (Lib_group::include_member): Adjust call to report_object.
7999 (Add_lib_group_symbols::run): Adjust call to report_object.
8000 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8001 blocks. Add object count for script input files.
8002 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8003 script_info parameter; change all callers.
8004 (Incremental_inputs::report_object): Add script_info parameter;
8006 (Incremental_inputs::report_script): Store backpointer to
8007 incremental info entry.
8008 (Output_section_incremental_inputs::set_final_data_size): Record
8009 additional information for scripts.
8010 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8011 * incremental.h (Incremental_script_entry::add_object): New function.
8012 (Incremental_script_entry::get_object_count): New function.
8013 (Incremental_script_entry::get_object): New function.
8014 (Incremental_script_entry::objects_): New data member; adjust
8016 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8017 (Incremental_inputs::report_object): Add script_info parameter.
8018 (Incremental_inputs_reader::get_object_count): New function.
8019 (Incremental_inputs_reader::get_object_offset): New function.
8020 * options.cc (Input_arguments::add_file): Return reference to
8022 * options.h (Input_argument::set_script_info): New function.
8023 (Input_argument::script_info): New function.
8024 (Input_argument::script_info_): New data member; adjust all
8026 (Input_file_group::add_file): Return reference to new input argument.
8027 (Input_file_lib::add_file): Likewise.
8028 (Input_arguments::add_file): Likewise.
8029 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8030 * script.cc (Parser_closure::Parser_closure): Add script_info
8031 parameter; adjust all callers.
8032 (Parser_closure::script_info): New function.
8033 (Parser_closure::script_info_): New data member.
8034 (read_input_script): Report scripts earlier to incremental info.
8035 (script_add_file): Set script_info in Input_argument.
8036 (script_add_library): Likewise.
8037 * script.h (Script_options::Script_info): Rewrite class.
8039 2011-03-29 Cary Coutant <ccoutant@google.com>
8041 * archive.cc (Library_base::should_include_member): Move
8042 method here from class Archive.
8043 (Archive::Archive): Initialize base class.
8044 (Archive::should_include_member): Move to base class.
8045 (Archive::do_for_all_unused_symbols): New function.
8046 (Add_archive_symbols::run): Remove redundant access to
8048 (Lib_group::Lib_group): Initialize base class.
8049 (Lib_group::do_filename): New function.
8050 (Lib_group::include_member): Pass pointer to Lib_group to
8052 (Lib_group::do_for_all_unused_symbols): New function.
8053 (Add_lib_group_symbols::run): Report archive information for
8055 * archive.h (class Library_base): New base class.
8056 (class Archive): Derive from Library_base.
8057 (Archive::filename): Move to base class.
8058 (Archive::set_incremental_info): Likewise.
8059 (Archive::incremental_info): Likewise.
8060 (Archive::Should_include): Likewise.
8061 (Archive::should_include_member): Likewise.
8062 (Archive::Armap_entry): Remove.
8063 (Archive::Unused_symbol_iterator): Remove.
8064 (Archive::unused_symbols_begin): Remove.
8065 (Archive::unused_symbols_end): Remove.
8066 (Archive::do_filename): New function.
8067 (Archive::do_get_mtime): New function.
8068 (Archive::do_for_all_unused_symbols): New function.
8069 (Archive::task_): Move to base class.
8070 (Archive::incremental_info_): Likewise.
8071 (class Lib_group): Derive from Library_base.
8072 (Lib_group::do_filename): New function.
8073 (Lib_group::do_get_mtime): New function.
8074 (Lib_group::do_for_all_unused_symbols): New function.
8075 (Lib_group::task_): Move to base class.
8076 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8078 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8080 * incremental.cc (Incremental_inputs::report_archive_begin):
8081 Use Library_base; call library's get_mtime; add incremental inputs
8082 entry before members.
8083 (class Unused_symbol_visitor): New class.
8084 (Incremental_inputs::report_archive_end): Use Library_base; use
8085 visitor class to record unused symbols; don't add incremental inputs
8086 entry after members.
8087 (Incremental_inputs::report_object): Use Library_base.
8089 (Incremental_archive_entry::Incremental_archive_entry): Remove
8090 unused Archive parameter.
8091 (Incremental_inputs::report_archive_begin): Use Library_base.
8092 (Incremental_inputs::report_archive_end): Likewise.
8093 (Incremental_inputs::report_object): Likewise.
8094 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8096 * object.h (Object::for_all_global_symbols): New function.
8097 (Object::do_for_all_global_symbols): New function.
8098 (Sized_relobj::do_for_all_global_symbols): New function.
8099 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8101 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8104 2011-03-27 Ian Lance Taylor <iant@google.com>
8106 * archive.cc (Archive::interpret_header): Return -1 if something
8107 goes wrong. Change callers accordingly.
8109 2011-03-25 Cary Coutant <ccoutant@google.com>
8111 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8112 * testsuite/Makefile.in: Regenerate.
8114 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
8116 * plugin.cc (get_view): New.
8117 (Plugin::load): Pass get_view to the plugin.
8118 (Plugin_manager::get_view): New.
8120 2011-03-21 Ian Lance Taylor <iant@google.com>
8122 * testsuite/final_layout.sh: Rewrite to not use dc.
8123 * testsuite/relro_test.sh: Fail if dc is not present.
8125 2011-03-21 Sriraman Tallam <tmsriram@google.com>
8127 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8129 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8130 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8132 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8133 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8135 2011-03-14 Ian Lance Taylor <iant@google.com>
8137 * script-sections.cc (Sort_output_sections::script_compare):
8138 Rename from is_before, change return type.
8139 (Sort_output_sections::operator()): Adjust accordingly.
8141 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8144 * testsuite/odr_violation2.cc: Add comment to make all error line
8145 numbers double digits.
8146 * testsuite/debug_msg.sh: Adjust expected errors.
8148 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8150 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8151 but mark earlier ones as non-canonical
8152 (offset_to_iterator): Update search target and example
8153 (do_addr2line): Return extra lines in a vector*
8154 (format_file_lineno): Extract from do_addr2line
8155 (one_addr2line): Add vector* out-param
8156 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8157 when a lineno entry appeared last for its instruction
8158 (Dwarf_line_info): Add vector* out-param
8159 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8160 * symtab.cc (Odr_violation_compare): Include the lineno in the
8162 (linenos_from_loc): New. Combine the canonical line for an
8163 address with its other lines.
8164 (True_if_intersect): New. Helper functor to make
8165 std::set_intersection a query.
8166 (detect_odr_violations): Compare sets of lines instead of just
8167 one line for each function. This became less deterministic, but
8168 has fewer false positives.
8169 * symtab.h: Declarations.
8170 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8171 mix an optimized and non-optimized object in the same binary
8172 (odr_violation2.so): Same.
8173 * testsuite/Makefile.in: Regenerate from Makefile.am.
8174 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8175 * testsuite/debug_msg.sh: Update line numbers and add
8177 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8178 non-optimized context.
8179 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8180 isn't inlined, and use OdrDerived in an optimized context.
8181 * testsuite/odr_header1.h: Defines OdrDerived, where
8182 optimization will change the
8183 first-instruction-in-the-destructor's file and line number.
8184 * testsuite/odr_header2.h: Defines OdrBase.
8186 2011-03-09 Ian Lance Taylor <iant@google.com>
8188 * fileread.cc (File_read::clear_views): Don't delete the whole
8191 2011-03-08 Ian Lance Taylor <iant@google.com>
8194 * fileread.cc: #include <climits>.
8195 (GOLD_IOV_MAX): Define.
8196 (File_read::read_multiple): Limit number of entries by iov_max.
8197 * fileread.h (class File_read): Always set max_readv_entries to
8200 2011-03-07 Ian Lance Taylor <iant@google.com>
8203 * options.h (class General_options): Add -dy and -dn.
8205 2011-03-02 Cary Coutant <ccoutant@google.com>
8207 * testsuite/script_test_9.t: Add TLS segment.
8209 2011-03-02 Simon Baldwin <simonb@google.com>
8211 * configure.ac: Add check for gnu_indirect_function support in
8212 the toolchain building binutils.
8213 * configure: Rebuild.
8215 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
8217 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8218 plugin only symbols.
8219 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8220 in plugin files as not needed in the symbol table.
8222 2011-02-11 Sriraman Tallam <tmsriram@google.com>
8224 * output.cc (Output_section::add_input_section): Delay fill
8225 generation for section ordering.
8227 2011-02-09 Ian Lance Taylor <iant@google.com>
8230 * object.h (class Sized_relobj): Remove clear_local_symbols.
8231 * reloc.cc (Sized_relobj::do_relocate): Don't call
8232 clear_local_symbols.
8234 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
8236 * plugin.cc (is_visible_from_outside): Return true for symbols
8239 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8241 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8244 2011-02-02 Sriraman Tallam <tmsriram@google.com>
8246 * icf.h (is_section_foldable_candidate): Change type of parameter
8248 * icf.cc (Icf::find_identical_sections): Change type of local variable
8249 section_name to be std::string.
8250 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8252 2011-01-25 Ian Lance Taylor <iant@google.com>
8254 * script.cc (script_add_extern): Rewrite to use
8255 add_symbol_reference.
8257 2011-01-25 Doug Kwan <dougkwan@google.com>
8259 * icf.cc (get_section_contents): Always lock section's object.
8261 2011-01-24 Ian Lance Taylor <iant@google.com>
8263 * options.h (class General_options): Accept
8264 --no-detect-odr-violations.
8266 2011-01-24 Ian Lance Taylor <iant@google.com>
8268 * version.cc (version_string): Bump to 1.11.
8270 2011-01-24 Ian Lance Taylor <iant@google.com>
8272 * plugin.cc (class Plugin_rescan): Define new class.
8273 (Plugin_manager::claim_file): Set any_claimed_.
8274 (Plugin_manager::save_archive): New function.
8275 (Plugin_manager::save_input_group): New function.
8276 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8278 (Plugin_manager::new_undefined_symbol): New function.
8279 (Plugin_manager::rescan): New function.
8280 (Plugin_manager::rescannable_defines): New function.
8281 (Plugin_manager::add_input_file): Set any_added_.
8282 * plugin.h (class Plugin_manager): define new fields rescannable_,
8283 undefined_symbols_, any_claimed_, and any_added_. Declare
8284 Plugin_rescan as friend. Declare new functions.
8285 (Plugin_manager::Rescannable): Define type.
8286 (Plugin_manager::Rescannable_list): Define type.
8287 (Plugin_manager::Undefined_symbol_list): Define type.
8288 (Plugin_manager::Plugin_manager): Initialize new fields.
8289 * archive.cc (Archive::defines_symbol): New function.
8290 (Add_archive_symbols::run): Pass archive to plugins if any.
8291 * archive.h (class Archive): Declare defines_symbol.
8292 * readsyms.cc (Input_group::~Input_group): New function.
8293 (Finish_group::run): Pass input_group to plugins if any.
8294 * readsyms.h (class Input_group): Declare destructor.
8295 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8298 2011-01-10 Ian Lance Taylor <iant@google.com>
8300 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8302 (Layout::set_segment_offsets): Reset increase_relro before calling
8303 set_section_addresses a second time.
8305 2011-01-04 Cary Coutant <ccoutant@google.com>
8307 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8308 sections before NOBITS sections.
8310 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8312 * version.cc (print_version): Update copyright to 2011.
8314 2010-12-23 Cary Coutant <ccoutant@google.com>
8316 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8317 of OS to this->add. Add OD parameter to second form of the function.
8319 2010-12-20 Ian Lance Taylor <iant@google.com>
8321 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8322 second of two consecutive entries with same offset.
8324 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8326 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8327 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8328 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8329 to avoid unneeded links against $(LDADD).
8330 * testsuite/Makefile.in: Regenerate.
8332 2010-12-15 Ian Lance Taylor <iant@google.com>
8335 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8336 for R_X86_64_32 and R_X86_64_PC32.
8337 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8338 ver_matching_def_pic.o.
8339 (ver_matching_def_pic.o): New target.
8341 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8343 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8344 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8345 Move definition before File_read::View member definitions.
8346 (File_read::View::~View): Initialize and hold lock before
8347 updating current_mapped_bytes.
8349 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8351 * dwarf_reader.cc: Remove outdated comment.
8352 * gold-threads.cc: Fix typo in error message.
8353 * archive.cc: Fix typos in comments.
8354 * archive.h: Likewise.
8355 * arm-reloc-property.cc: Likewise.
8356 * arm-reloc-property.h: Likewise.
8357 * arm-reloc.def: Likewise.
8359 * attributes.h: Likewise.
8360 * cref.cc: Likewise.
8361 * ehframe.cc: Likewise.
8362 * fileread.h: Likewise.
8364 * i386.cc: Likewise.
8366 * incremental.h: Likewise.
8367 * int_encoding.cc: Likewise.
8368 * layout.h: Likewise.
8369 * main.cc: Likewise.
8370 * merge.h: Likewise.
8371 * object.cc: Likewise.
8372 * object.h: Likewise.
8373 * options.cc: Likewise.
8374 * readsyms.cc: Likewise.
8375 * reduced_debug_output.cc: Likewise.
8376 * reloc.cc: Likewise.
8377 * script-sections.cc: Likewise.
8378 * sparc.cc: Likewise.
8379 * symtab.h: Likewise.
8380 * target-reloc.h: Likewise.
8381 * target.cc: Likewise.
8382 * target.h: Likewise.
8383 * timer.cc: Likewise.
8384 * timer.h: Likewise.
8385 * x86_64.cc: Likewise.
8387 2010-12-09 Cary Coutant <ccoutant@google.com>
8389 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8391 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8392 parameter; change all callers.
8393 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8394 * options.h (warn_execstack): New option.
8396 2010-12-07 Doug Kwan <dougkwan@google.com>
8398 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8399 like function call relocations.
8401 2010-12-07 Ian Lance Taylor <iant@google.com>
8403 * archive.cc (Archive::get_elf_object_for_member): Permit
8404 punconfigured to be NULL.
8405 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8406 (Archive::include_member): Pass NULL to get_elf_object_for_member
8407 if we searched for the archive and this is the first included
8410 2010-12-01 Ian Lance Taylor <iant@google.com>
8412 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8413 track_relocs_type_ field.
8414 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8415 Set track_relocs_type_.
8416 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8417 contents when using RELA relocs.
8418 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8420 * reloc.cc (Track_relocs::next_addend): New function.
8421 * reloc.h (class Track_relocs): Declare next_addend.
8423 2010-12-01 Ian Lance Taylor <iant@google.com>
8425 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8428 2010-12-01 Ian Lance Taylor <iant@google.com>
8430 * README: Update compilers known to work and fail.
8432 2010-11-23 Matthias Klose <doko@ubuntu.com>
8434 * configure.in: For --enable-gold, handle value `default' instead of
8435 `both*'. Always install ld as ld.bfd, install as ld if gold is
8437 * configure: Regenerate.
8439 2010-11-18 Doug Kwan <dougkwan@google.com>
8441 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8442 and right_alignment to be zero. Store result alignment only if it is
8443 greater than existing alignment.
8445 2010-11-16 Cary Coutant <ccoutant@google.com>
8448 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8449 Check for ".zdebug_line".
8451 2010-11-16 Doug Kwan <dougkwan@google.com>
8452 Cary Coutant <ccoutant@google.com>
8454 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8455 by reference; adjust all callers.
8456 * output.cc (Output_segment::set_section_addresses): Adjust references
8457 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8459 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8460 end at page boundary.
8462 2010-11-16 Cary Coutant <ccoutant@google.com>
8465 * layout.cc (Layout::choose_output_section): Transform names of
8466 compressed sections even when using a script with a SECTIONS clause.
8467 (Layout::output_section_name): Remove code to transform
8468 compressed debug section names.
8469 * output.cc (Output_section::add_input_section): Use uncompressed
8470 section size when tracking input sections.
8472 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8474 * symtab.h (Symbol::NON_PIC_REF): Remove.
8475 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8476 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8477 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8478 (Symbol::use_plt_offset): Take a flags argument and pass it
8479 directly to needs_dynamic_reloc. Restrict check for undefined
8480 weak symbols to function calls.
8481 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8482 (Target_arm::Scan::global): Use it.
8483 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8484 (Target_arm::Relocate::relocate): Likewise.
8485 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8486 parameter with an r_type parameter. Use get_reference_flags
8488 (Target_arm::Relocate::relocate): Update accordingly.
8489 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8490 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8491 (Target_i386::Scan::global): Likewise.
8492 (Target_i386::Relocate::relocate): Likewise.
8493 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8494 parameter with an r_type parameter. Use get_reference_flags
8496 (Target_i386::Relocate::relocate): Update accordingly.
8497 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8498 (Target_powerpc::Scan::global): Use it.
8499 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8500 (Target_powerpc::Relocate::relocate): Likewise.
8501 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8502 (Target_sparc::Scan::global): Use it.
8503 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8504 (Target_sparc::Relocate::relocate): Likewise.
8505 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8506 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8507 (Target_x86_64::Scan::global): Likewise.
8508 (Target_x86_64::Relocate::relocate): Likewise.
8510 2010-11-08 Doug Kwan <dougkwan@google.com>
8511 Cary Coutant <ccoutant@google.com>
8513 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8514 (Arm_exidx_merge_section::section_contents_): New data member.
8515 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8516 (Arm_input_section::~Arm_input_section): De-allocate memory.
8517 (Arm_input_section::original_contents_): New data member.
8518 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8519 in parameters instead of calling Object::section_contents without
8521 (Arm_output_section::group_section): New parameter TASK. Pass it
8522 to callees that need locking objects.
8523 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8524 to lock EXIDX input sections. Fix a formatting issue. Call
8525 Arm_exidx_merged_section::build_contents to create merged section
8527 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8528 to lock object of stub table owner.
8529 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8530 TEXT_SIZE to initialize data member TEXT_SIZE_.
8531 (Arm_exidx_input_section::addralign): Fix typo in comment.
8532 (Arm_exidx_input_section::text_size): New method.
8533 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8534 that require locking objects. Lock objects before scanning for stubs
8535 and updating local symbols.
8536 (Arm_input_section<big_endian>::init): Copy contents of original
8538 (Arm_input_section<big_endian>::do_write): Use saved contents of
8539 original input section instead of calling Object::section_contents
8541 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8542 size without calling Object::section_size().
8543 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8544 for size. Allocate a buffer for merged EXIDX entries.
8545 (Arm_exidx_merged_section::build_contents): New method.
8546 (Arm_exidx_merged_section::do_write): Move merge section contents
8547 building code to Arm_exidx_merged_section::build_contetns. Write
8548 out contetns in buffer instead of building it on the fly.
8549 (Arm_relobj::make_exidx_input_section): Also pass text section size
8550 to Arm_exidx_input_section constructor.
8551 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8552 (Arm_dynobj::do_read_symbols): Fix memory leak.
8553 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8554 * target.h: (class Task): Add forward declaration.
8555 (Target::relax): Add new parameter TASK and pass it to
8557 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8559 2010-11-05 Cary Coutant <ccoutant@google.com>
8562 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8563 object when reading from the file.
8564 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8566 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8567 when reading section contents.
8568 (get_section_contents): Likewise.
8569 (icf::find_identical_sections): Likewise.
8570 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8571 object when reading from the file.
8572 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8573 the object when doing deferred section layout.
8575 2010-11-03 Nick Clifton <nickc@redhat.com>
8578 * script.h (class Symbol_assignment: name): New member. Returns
8579 the name of the symbol.
8580 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8581 Returns true if the given symbol name is on the list of
8582 assignments wating to be processed.
8583 * archive.cc (should_incldue_member): If the symbol is undefined,
8584 check to see if it is on the list of symbols pending assignment.
8586 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8588 * script-sections.cc (Script_sections::find_memory_region): Check
8589 for a NULL output section pointer.
8591 2010-10-29 Doug Kwan <dougkwan@google.com>
8593 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8594 Output_section::add_relaxed_input_section.
8595 * output.cc (Output_section::add_relaxed_input_section): Add new
8596 arguments LAYOUT and NAME. Set section order index.
8597 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8598 Copy section order index.
8599 * output.h (Output_section::add_relaxed_input_section): Add new
8600 arguments LAYOUT and NAME.
8602 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8604 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8605 NATIVE_OR_CROSS_LINKER.
8606 * testsuite/Makefile.in: Regenerate.
8608 2010-10-20 Doug Kwan <dougkwan@google.com>
8610 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8611 without SHF_LINK_ORDER flags.
8612 * layout.cc (Layout::choose_output_section): Do not filter
8613 SHF_LINK_ORDER flag in a relocatable link.
8615 2010-10-17 Cary Coutant <ccoutant@google.com>
8617 * output.h (Output_segment::set_section_addresses): Change function
8618 signature. Update all callers.
8619 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8621 (Output_segment::set_section_addresses): Align after last TLS
8622 section. Add padding before last relro section instead of after.
8624 2010-10-17 Doug Kwan <dougkwan@google.com>
8626 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8627 GOT output section to be writable.
8629 2010-10-14 Cary Coutant <ccoutant@google.com>
8631 * debug.h (DEBUG_INCREMENTAL): New flag.
8632 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8633 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8635 * incremental.cc (report_command_line): Ignore all forms of
8637 * layout.cc (Layout::Layout): Check parameters for incremental link
8639 * options.cc (General_options::parse_incremental): New function.
8640 (General_options::parse_no_incremental): New function.
8641 (General_options::parse_incremental_full): New function.
8642 (General_options::parse_incremental_update): New function.
8643 (General_options::incremental_mode_): New data member.
8644 (General_options::finalize): Check incremental_mode_.
8645 * options.h (General_options): Update help text for --incremental.
8646 Add --no-incremental, --incremental-full, --incremental-update.
8647 (General_options::Incremental_mode): New enum type.
8648 (General_options::incremental_mode): New function.
8649 (General_options::incremental_mode_): New data member.
8650 * parameters.cc (Parameters::incremental_mode_): New data member.
8651 (Parameters::set_options): Set incremental_mode_.
8652 (Parameters::set_incremental_full): New function.
8653 (Parameters::incremental): New function.
8654 (Parameters::incremental_update): New function.
8655 (set_parameters_incremental_full): New function.
8656 * parameters.h (Parameters::set_incremental_full): New function.
8657 (Parameters::incremental): New function.
8658 (Parameters::incremental_update): New function.
8659 (Parameters::incremental_mode_): New data member.
8660 (set_parameters_incremental_full): New function.
8661 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8662 incremental link mode.
8663 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8664 (Sized_relobj::do_relocate_sections): Likewise.
8665 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8667 * testsuite/Makefile.in: Regenerate.
8668 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8670 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8672 * script-sections.h (class Script_sections): Make
8673 Sections_elements typedef public.
8674 * script-sections.cc (class Sort_output_sections): Add elements_
8675 field. Add constructor which sets it; change all callers.
8676 (Sort_output_sections::is_before): New function.
8677 (Sort_output_sections::operator()): Call is_before.
8678 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8680 * testsuite/script_test_10.sh: New test. Test script section
8682 * testsuite/script_test_10.t: Likewise.
8683 * testsuite/script_test_10.s: Likewise.
8684 * testsuite/Makefile.am: Wrap the cross linker tests and the
8685 common tests into NATIVE_OR_CROSS_LINKER.
8686 (check_SCRIPTS): Add script_test_10.sh.
8687 (check_DATA): Add script_test_10.stdout.
8688 (script_test_10.o, script_test_10): New targets.
8689 (script_test_10.stdout): New target.
8690 * configure, testsuite/Makefile.in: Regenerate.
8692 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8694 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8695 error for the deprecated relocations.
8696 (Target_arm::Scan::global): Likewise.
8697 (Target_arm::Relocate::relocate): Likewise.
8699 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8701 * fileread.cc (Input_file::find_file): Initialize *found_name
8702 and *namep when using the fallback search for case 4.
8704 2010-10-11 Cary Coutant <ccoutant@google.com>
8706 * options.h (class General_options): Redefine -z lazy as an alias for
8707 the negation of -z now.
8709 2010-10-11 Ian Lance Taylor <iant@google.com>
8711 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8714 2010-10-06 Nick Clifton <nickc@redhat.com>
8716 * script-sections.cc(class Memory_region): Remove
8717 current_lma_offset_ field. Rename current_vma_offset_ to
8718 current_offset_. Add last_section_ field.
8719 (Memory_region::get_current_vma_address): Rename to
8720 get_current_address.
8721 (Memory_region::get_current_lma_address): Delete.
8722 (Memory_region::increment_vma_offset): Rename to
8724 (Memory_region::increment_lma_offset): Delete.
8725 (Memory_region::attributes_compatible): New method. Returns
8726 true if the provided section is compatible with the region.
8727 (Memory_region::get_last_section): New method. Returns the last
8728 section to use the region.
8729 (Memory_region::set_last_section): New method. Stores the last
8730 section to use the region.
8731 (Script_sections::block_in_region): New method. Returns true if
8732 a block of memory is contained within a region.
8733 (Script_sections::find_memory_region): New method. Locates a
8734 memory region to be used to set a VMA or LMA address.
8735 (Output_section_definition::set_section_addresses): Add code to
8736 check for addresses set by memory regions.
8737 (Output_segment::set_section_addresses): Remove memory region
8739 (Script_sections::create_segment): Add a warning if a header
8740 segment is created outside of any region.
8741 * script-sections.h (class Script_sections): Add prototypes for
8742 find_memory_region and block_in_region methods.
8743 * testsuite/memory_test.s: Use .long instead of .word.
8744 * testsuite/memory_test.t: Add some more output sections.
8745 * testsuite/memory_test.sh: Update expected output.
8747 2010-10-02 Doug Kwan <dougkwan@google.com>
8749 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8750 defintion to symtab.h
8751 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8752 declaration to defintion.
8754 2010-10-01 Nick Clifton <nickc@redhat.com>
8756 * expression.cc (eval): Replace dummy argument with NULL.
8757 (eval_maybe_dot): Check for a NULL result section pointer.
8758 (Symbol_expression::value): Likewise.
8759 (Dot_expression::value): Likewise.
8760 (BINARY_EXPRESSION): Likewise.
8761 (Max_expression::value): Likewise.
8762 (Min_expression::value): Likewise.
8763 (Absolute_expression::value): Likewise.
8764 (Addr_expression::value_from_output_section): Likewise.
8765 (Loaddddr_expression::value_from_output_section): Likewise.
8766 (Segment_start_expression::value): Likewise.
8767 * script-sections.cc
8768 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8770 (Sections_elememt_dot_assignment::set_section_addresses):
8772 (Output_data_expression::do_write_to_buffer): Likewise.
8773 (Output_section_definition::finalize_symbols): Likewise.
8774 (Output_section_definition::set_section_addresses): Likewise.
8776 2010-09-30 Doug Kwan <dougkwan@google.com>
8778 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8780 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8782 * target.h (Target::can_icf_inline_merge_sections): New virtual
8784 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8786 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8788 * icf.cc (get_section_contents): Inline merge sections only when
8791 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8793 * configure: Regenerate.
8795 2010-09-17 Ian Lance Taylor <iant@google.com>
8797 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8798 * testsuite/Makefile.am (memory_test.o): New target.
8799 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8801 * testsuite/Makefile.in: Rebuild.
8803 2010-09-17 Doug Kwan <dougkwan@google.com>
8805 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8806 defintion if relocation uses GOT entries of the symbol.
8807 * testsuite/icf_safe_test.sh: Fix test.
8808 * testsuite/icf_safe_so_test.sh: Fix test.
8810 2010-09-16 Cary Coutant <ccoutant@google.com>
8812 * script_sections.cc (class Memory_region): Remove "NULL" from
8813 vector initializations.
8815 2010-09-15 Cary Coutant <ccoutant@google.com>
8817 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8818 Resolve forwarding symbols.
8820 2010-09-15 Doug Kwan <dougkwan@google.com>
8822 * gold/testsuite/script_test_3.t: Add ARM special sections.
8823 * gold/testsuite/script_test_4.t: Same.
8824 * gold/testsuite/script_test_5.t: Same.
8825 * gold/testsuite/script_test_6.t: Same.
8826 * gold/testsuite/script_test_7.t: Same.
8827 * gold/testsuite/script_test_7.t: Same.
8828 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8830 2010-09-14 Cary Coutant <ccoutant@google.com>
8832 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8833 (Target_x86_64::Relocate::relocate_tls): Replace check for
8834 saw_tls_block_reloc_ with test for executable section.
8836 2010-09-12 Cary Coutant <ccoutant@google.com>
8838 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8839 position-independent executables to shared libraries need dynamic
8841 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8842 position-independent executables.
8843 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8844 * testsuite/Makefile.in: Regenerate.
8846 2010-09-10 Nick Clifton <nickc@redhat.com>
8849 * testsuite/memory_test.t: Discard any sections that are not
8852 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8855 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8856 "This::" to work around a bug in gcc 4.2.
8858 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8860 2010-09-09 Rafael Espindola <espindola@google.com>
8862 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8863 sections with different PF_X flags in the same segment.
8864 (Layout::find_first_load_seg): Search all segments to find the first
8866 * options.h (rosegment): New.
8868 2010-09-08 Rafael Espindola <espindola@google.com>
8870 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
8872 2010-09-08 Doug Kwan <dougkwan@google.com>
8874 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8875 (Arm_relobj::do_relocate_sections): Add new parameter for output
8876 file to match the parent.
8877 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8878 of local symbols instead of input values. Update code to track
8879 changes in gold::relocate_section.
8880 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8881 (Sized_relobj::compute_final_local_value_internal): New methods.
8882 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8883 body into private version of Sized_relobj::compute_final_local_value.
8884 Call the inline method.
8885 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8886 merged symbol value if there is one.
8887 (Symbol_value::has_output_value): New method defintiion.
8888 (Sized_relobj::Compute_final_local_value_status): New enum type.
8889 (Sized_relobj::compute_final_local_value): New methods.
8890 (Sized_relobj::compute_final_local_value_internal): New methods.
8891 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8892 and arm_cortex_a8.sh.
8893 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8894 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8896 * Makefile.in: Regenerate.
8897 * testsuite/arm_bl_out_of_range.s: Update test.
8898 * testsuite/thumb_bl_out_of_range.s: Ditto.
8899 * testsuite/thumb_blx_out_of_range.s: Ditto.
8900 * testsuite/arm_branch_out_of_range.sh: New file.
8901 * testsuite/arm_cortex_a8.sh: Ditto.
8902 * testsuite/arm_cortex_a8_b.s: Ditto.
8903 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8904 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8905 * testsuite/arm_cortex_a8_bl.s: Ditto.
8906 * testsuite/arm_cortex_a8_blx.s: Ditto.
8907 * testsuite/arm_cortex_a8_local.s: Ditto.
8908 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8909 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8911 2010-09-08 Rafael Espindola <espindola@google.com>
8913 * Makefile.am (memory_test.stdout): Run readelf with -W.
8914 * Makefile.in: Regenerate.
8915 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8918 2010-09-08 Rafael Espindola <espindola@google.com>
8920 * script-sections.cc (Script_sections::add_memory_region): Convert
8921 field precision to int.
8922 * script.cc (script_set_section_region, script_set_section_region):
8923 Convert field precision to int.
8925 2010-09-08 Rafael Espindola <espindola@google.com>
8927 * arm.cc (do_finalize_sections): Create the __exidx_start and
8928 __exdix_end symbols even when the section is missing.
8930 2010-09-08 Nick Clifton <nickc@redhat.com>
8932 * README: Remove claim that MEMORY is not supported.
8933 * expression.cc (script_exp_function_origin)
8934 (script_exp_function_length): Move from here to ...
8935 * script.cc: ... here.
8936 (script_set_section_region, script_add_memory)
8937 (script_parse_memory_attr, script_include_directive): New
8939 * script-sections.cc
8940 (class Memory_region): New class.
8941 (class Output_section_definition): Add set_memory_region,
8942 set_section_vma, set_section_lma and get_section_name methods.
8943 (class Script_Sections): Add add_memory_region,
8944 find_memory_region, find_memory_region_origin,
8945 find_memory_region_length and set_memory_region methods.
8946 Have set_section_addresses method walk the list of set memory
8948 Extend the print methos to display memory regions.
8949 * script-sections.h: Add prototypes for new methods.
8950 Add enum for MEMORY region attributes.
8951 * yyscript.y: Add support for parsing MEMORY regions.
8952 * script-c.h: Add prototypes for new functions.
8953 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8954 * testsuite/Makefile.in: Regenerate.
8955 * testsuite/memory_test.sh: New script.
8956 * testsuite/memory_test.s: New assembler source file.
8957 * testsuite/memory_test.t: New linker script.
8959 2010-08-27 Doug Kwan <dougkwan@google.com>
8961 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8962 reference override an existing dynamic weak reference.
8963 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8964 * testsuite/Makefile.in: Regenerate.
8965 * testsuite/dyn_weak_ref.sh: New file.
8966 * testsuite/dyn_weak_ref_1.c: Ditto.
8967 * testsuite/dyn_weak_ref_2.c: Ditto.
8969 2010-08-27 Ian Lance Taylor <iant@google.com>
8971 * incremental.h (class Incremental_input_entry): Add virtual
8974 2010-08-27 Ian Lance Taylor <iant@google.com>
8976 * testsuite/start_lib_test_3.c: Mark t3 as used.
8978 2010-08-27 Nick Clifton <nickc@redhat.com>
8980 * options.cc (version_script): Fix small typo in previous
8983 2010-08-25 Nick Clifton <nickc@redhat.com>
8985 * archive.cc: Formatting fixes: Remove whitespace between
8986 typename and following asterisk. Remove whitespace between
8987 function name and opening parenthesis.
8988 * archive.h: Likewise.
8990 * attributes.cc: Likewise.
8991 * attributes.h: Likewise.
8992 * common.cc: Likewise.
8993 * copy-relocs.cc: Likewise.
8994 * dirsearch.h: Likewise.
8995 * dynobj.cc: Likewise.
8996 * ehframe.cc: Likewise.
8997 * ehframe.h: Likewise.
8998 * expression.cc: Likewise.
8999 * fileread.cc: Likewise.
9000 * fileread.h: Likewise.
9002 * gold-threads.cc: Likewise.
9003 * gold.cc: Likewise.
9004 * i386.cc: Likewise.
9006 * incremental-dump.cc: Likewise.
9007 * incremental.cc: Likewise.
9008 * layout.cc: Likewise.
9009 * layout.h: Likewise.
9010 * main.cc: Likewise.
9011 * merge.cc: Likewise.
9012 * merge.h: Likewise.
9013 * object.cc: Likewise.
9014 * object.h: Likewise.
9015 * options.cc: Likewise.
9016 * options.h: Likewise.
9017 * output.cc: Likewise.
9018 * output.h: Likewise.
9019 * plugin.cc: Likewise.
9020 * plugin.h: Likewise.
9021 * powerpc.cc: Likewise.
9022 * reloc.cc: Likewise.
9023 * script-c.h: Likewise.
9024 * script-sections.cc: Likewise.
9025 * script.cc: Likewise.
9026 * stringpool.cc: Likewise.
9027 * symtab.cc: Likewise.
9028 * symtab.h: Likewise.
9029 * target.cc: Likewise.
9030 * timer.cc: Likewise.
9031 * timer.h: Likewise.
9032 * version.cc: Likewise.
9033 * x86_64.cc: Likewise.
9035 2010-08-24 Nick Clifton <nickc@redhat.com>
9038 * layout.cc (segment_precedes): Sort segments by their physical
9039 addresses, if they have been set.
9041 2010-08-23 Cary Coutant <ccoutant@google.com>
9043 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9045 (Lib_group::include_member): Unlock object after deleting its
9047 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9050 2010-08-19 Neil Vachharajani <nvachhar@google.com>
9051 Cary Coutant <ccoutant@google.com>
9053 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9054 constructor, and set_blocker.
9055 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9057 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9058 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9059 * testsuite/Makefile.am (start_lib_test): New test case.
9060 * testsuite/Makefile.in: Regenerate.
9061 * testsuite/start_lib_test_main.c: New file.
9062 * testsuite/start_lib_test_1.c: New file.
9063 * testsuite/start_lib_test_2.c: New file.
9064 * testsuite/start_lib_test_3.c: New file.
9066 2010-08-19 Ian Lance Taylor <iant@google.com>
9068 * Makefile.in: Rebuild with automake 1.11.1.
9069 * aclocal.m4: Likewise.
9070 * testsuite/Makefile.in: Likewise.
9072 2010-08-19 Ian Lance Taylor <iant@google.com>
9075 * i386.cc (class Output_data_plt_i386): Update declarations.
9076 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9077 local_ifuncs_ fields.
9078 (Target_i386::do_plt_section_for_global): New function.
9079 (Target_i386::do_plt_section_for_local): New function.
9080 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9081 parameter; change all callers. Initialize global_ifuncs_ and
9082 local_ifuncs_. If doing a static link define __rel_iplt_start and
9084 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9085 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9086 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9088 (Target_i386::make_plt_section): New function, broken out of
9089 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9090 (Target_i386::make_plt_entry): Call make_plt_section.
9091 (Target_i386::make_local_ifunc_plt_entry): New function.
9092 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9093 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9094 R_386_IRELATIVE to switch.
9095 (Target_i386::Scan::global): Likewise.
9096 (Target_i386::Relocate::relocate): Likewise.
9097 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9099 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9100 (Target_x86_64::do_plt_section_for_global): New function.
9101 (Target_x86_64::do_plt_section_for_local): New function.
9102 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9103 parameter; change all callers. If doing a static link define
9104 __rela_iplt_start and __rela_iplt_end.
9105 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9106 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9107 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9109 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9110 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9112 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9113 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9114 R_X86_64_IRELATIVE to switch.
9115 (Target_x86_64::Scan::global): Likewise.
9116 (Target_x86_64::Relocate::relocate): Likewise.
9117 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9119 * target.h (class Target): Add plt_section_for_global and
9120 plt_section_for_local functions. Add do_plt_section_for_global
9121 and do_plt_section_for_local virtual functions.
9122 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9123 clarifying comments.
9124 (Symbol::use_plt_offset): Handle IFUNC symbol.
9125 * object.cc (Sized_relobj::Sized_relobj): Initialize
9127 (Sized_relobj::local_has_plt_offset): New function.
9128 (Sized_relobj::local_plt_offset): New function.
9129 (Sized_relobj::set_local_plt_offset): New function.
9130 (Sized_relobj::do_count): Handle IFUNC symbol.
9131 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9132 a bit away from input_shndx_ field. Add set_is_func_symbol and
9133 is_ifunc_symbol functions.
9134 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9135 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9136 local_plt_offsets_ field.
9137 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9138 * output.h (class Output_section_data): Add non-const
9139 output_section function.
9140 (class Output_data_got): Update declarations.
9141 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9142 Add use_plt_offset parameter to global and local constructors.
9143 Change all callers. Change local_sym_index_ field to 31 bits.
9144 Change GSYM_CODE and CONSTANT_CODE accordingly.
9145 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9146 doing a static link don't set sh_link field.
9147 (Output_data_got::Got_entry::write): Use PLT offset if
9149 (Output_data_got::add_global_plt): New function.
9150 (Output_data_got::add_local_plt): New function.
9151 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9152 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9153 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9154 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9155 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9157 * testsuite/ifunc-sel.h: New file.
9158 * testsuite/ifuncmain1.c: New file.
9159 * testsuite/ifuncmain1vis.c: New file.
9160 * testsuite/ifuncmod1.c: New file.
9161 * testsuite/ifuncdep2.c: New file.
9162 * testsuite/ifuncmain2.c: New file.
9163 * testsuite/ifuncmain3.c: New file.
9164 * testsuite/ifuncmod3.c: New file.
9165 * testsuite/ifuncmain4.c: New file.
9166 * testsuite/ifuncmain5.c: New file.
9167 * testsuite/ifuncmod5.c: New file.
9168 * testsuite/ifuncmain6pie.c: New file.
9169 * testsuite/ifuncmod6.c: New file.
9170 * testsuite/ifuncmain7.c: New file.
9171 * configure, testsuite/Makefile.in: Rebuild.
9173 2010-08-18 Ian Lance Taylor <iant@google.com>
9176 (Output_section_incremental_inputs::write_input_files): Add cast
9177 to avoid signed/unsigned comparison warning.
9178 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9180 2010-08-12 Cary Coutant <ccoutant@google.com>
9182 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9184 2010-08-13 Ian Lance Taylor <iant@google.com>
9186 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9188 2010-08-12 Cary Coutant <ccoutant@google.com>
9189 Doug Kwan <dougkwan@google.com>
9191 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9192 defintion overrides non-weak undef, remember that the original undef
9194 * symtab.cc (Symbol_table::sized_write_global): For undef without
9195 an original weak binding, set binding to global in output.
9196 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9197 * testsuite/Makefile.in: Regenerate.
9198 * testsuite/strong_ref_weak_def.sh: New file.
9199 * testsuite/strong_ref_weak_def_1.c: Ditto.
9200 * testsuite/strong_ref_weak_def_2.c: Ditto.
9202 2010-08-12 Cary Coutant <ccoutant@google.com>
9204 * testsuite/incremental_test.sh: Rewrite.
9205 * testsuite/incremental_test_1.c: Rewrite.
9206 * testsuite/incremental_test_2.c: Rewrite.
9208 2010-08-12 Cary Coutant <ccoutant@google.com>
9210 * arm.cc (Target_arm::got_size): Add const.
9211 (Target_arm::got_entry_count): New function.
9212 (Target_arm::plt_entry_count): New function.
9213 (Target_arm::first_plt_entry_offset): New function.
9214 (Target_arm::plt_entry_size): New function.
9215 (Output_data_plt_arm::entry_count): New function.
9216 (Output_data_plt_arm::first_plt_entry_offset): New function.
9217 (Output_data_plt_arm::get_plt_entry_size): New function.
9218 * i386.cc (Target_i386::got_size): Add const.
9219 (Target_i386::got_entry_count): New function.
9220 (Target_i386::plt_entry_count): New function.
9221 (Target_i386::first_plt_entry_offset): New function.
9222 (Target_i386::plt_entry_size): New function.
9223 (Output_data_plt_i386::entry_count): New function.
9224 (Output_data_plt_i386::first_plt_entry_offset): New function.
9225 (Output_data_plt_i386::get_plt_entry_size): New function.
9226 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9227 find_incremental_inputs_sections. Dump incremental_got_plt section.
9228 * incremental.cc: Include target.h.
9229 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9230 parameter. Adjust all callers. Find incremental_got_plt section.
9231 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9233 (Output_section_incremental_inputs::set_final_data_size): Calculate
9234 size of incremental_got_plt section.
9235 (Output_section_incremental_inputs::do_write): Write the
9236 incremental_got_plt section.
9237 (Got_plt_view_info): New struct.
9238 (Local_got_offset_visitor): New class.
9239 (Global_got_offset_visitor): New class.
9240 (Global_symbol_visitor_got_plt): New class.
9241 (Output_section_incremental_inputs::write_got_plt): New function.
9242 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9243 Add parameter. Adjust all callers.
9244 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9245 (Incremental_inputs::got_plt_section): New function.
9246 (Incremental_inputs::got_plt_section_): New data member.
9247 (Incremental_got_plt_reader): New class.
9248 * layout.cc (Layout::create_incremental_info_sections): Add the
9249 incremental_got_plt section.
9250 * object.h (Got_offset_list::get_list): New function.
9251 (Got offset_list::for_all_got_offsets): New function.
9252 (Sized_relobj::local_got_offset_list): New function.
9253 * powerpc.cc (Target_powerpc::got_size): Add const.
9254 (Target_powerpc::got_entry_count): New function.
9255 (Target_powerpc::plt_entry_count): New function.
9256 (Target_powerpc::first_plt_entry_offset): New function.
9257 (Target_powerpc::plt_entry_size): New function.
9258 (Output_data_plt_powerpc::entry_count): New function.
9259 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9260 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9261 * sparc.cc (Target_sparc::got_size): Add const.
9262 (Target_sparc::got_entry_count): New function.
9263 (Target_sparc::plt_entry_count): New function.
9264 (Target_sparc::first_plt_entry_offset): New function.
9265 (Target_sparc::plt_entry_size): New function.
9266 (Output_data_plt_sparc::entry_count): New function.
9267 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9268 (Output_data_plt_sparc::get_plt_entry_size): New function.
9269 * symtab.h (Symbol::got_offset_list): New function.
9270 (Symbol_table::for_all_symbols): New function.
9271 * target.h (Sized_target::got_entry_count): New function.
9272 (Sized_target::plt_entry_count): New function.
9273 (Sized_target::plt_entry_size): New function.
9274 * x86_64.cc (Target_x86_64::got_size): Add const.
9275 (Target_x86_64::got_entry_count): New function.
9276 (Target_x86_64::plt_entry_count): New function.
9277 (Target_x86_64::first_plt_entry_offset): New function.
9278 (Target_x86_64::plt_entry_size): New function.
9279 (Output_data_plt_x86_64::entry_count): New function.
9280 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9281 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9283 2010-08-12 Cary Coutant <ccoutant@google.com>
9285 * archive.cc: Include incremental.h.
9286 (Archive::Archive): Initialize incremental_info_.
9287 (Archive::include_member): Record archive members in incremental info.
9288 (Add_archive_symbols::run): Record begin and end of an archive in
9290 (Lib_group::include_member): Record objects in incremental info.
9291 * archive.h (Incremental_archive_entry): Forward declaration.
9292 (Archive::set_incremental_info): New member function.
9293 (Archive::incremental_info): New member function.
9294 (Archive::Unused_symbol_iterator): New class.
9295 (Archive::unused_symbols_begin): New member function.
9296 (Archive::unused_symbols_end): New member function.
9297 (Archive::incremental_info_): New data member.
9298 * incremental-dump.cc (find_input_containing_global): New function.
9299 (dump_incremental_inputs): Dump new incremental info sections.
9300 * incremental.cc: Include symtab.h.
9301 (Output_section_incremental_inputs): New class.
9302 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9303 new incremental info sections.
9304 (Sized_incremental_binary::do_check_inputs): Likewise.
9305 (Incremental_inputs::report_archive): Remove.
9306 (Incremental_inputs::report_archive_begin): New function.
9307 (Incremental_inputs::report_archive_end): New function.
9308 (Incremental_inputs::report_object): New function.
9309 (Incremental_inputs::finalize_inputs): Remove.
9310 (Incremental_inputs::report_input_section): New function.
9311 (Incremental_inputs::report_script): Rewrite.
9312 (Incremental_inputs::finalize): Do nothing but finalize string table.
9313 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9314 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9315 (Incremental_inputs::create_data_sections): New function.
9316 (Incremental_inputs::relocs_entsize): New function.
9317 (Output_section_incremental_inputs::set_final_data_size): New function.
9318 (Output_section_incremental_inputs::do_write): New function.
9319 (Output_section_incremental_inputs::write_header): New function.
9320 (Output_section_incremental_inputs::write_input_files): New function.
9321 (Output_section_incremental_inputs::write_info_blocks): New function.
9322 (Output_section_incremental_inputs::write_symtab): New function.
9323 * incremental.h (Incremental_script_entry): Forward declaration.
9324 (Incremental_object_entry): Forward declaration.
9325 (Incremental_archive_entry): Forward declaration.
9326 (Incremental_inputs): Forward declaration.
9327 (Incremental_inputs_header_data): Remove.
9328 (Incremental_inputs_header): Remove.
9329 (Incremental_inputs_header_write): Remove.
9330 (Incremental_inputs_entry_data): Remove.
9331 (Incremental_inputs_entry): Remove.
9332 (Incremental_inputs_entry_write): Remove.
9333 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9334 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9335 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9336 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9338 (Incremental_input_entry): New class.
9339 (Incremental_script_entry): New class.
9340 (Incremental_object_entry): New class.
9341 (Incremental_archive_entry): New class.
9342 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9343 (Incremental_inputs::report_inputs): Remove.
9344 (Incremental_inputs::report_archive): Remove.
9345 (Incremental_inputs::report_archive_begin): New function.
9346 (Incremental_inputs::report_archive_end): New function.
9347 (Incremental_inputs::report_object): Change prototype.
9348 (Incremental_inputs::report_input_section): New function.
9349 (Incremental_inputs::report_script): Change prototype.
9350 (Incremental_inputs::get_reloc_count): New function.
9351 (Incremental_inputs::set_reloc_count): New function.
9352 (Incremental_inputs::create_data_sections): New function.
9353 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9354 (Incremental_inputs::inputs_section): New function.
9355 (Incremental_inputs::symtab_section): New function.
9356 (Incremental_inputs::relocs_section): New function.
9357 (Incremental_inputs::get_stringpool): Add const.
9358 (Incremental_inputs::command_line): Add const.
9359 (Incremental_inputs::inputs): Remove.
9360 (Incremental_inputs::command_line_key): New function.
9361 (Incremental_inputs::input_file_count): New function.
9362 (Incremental_inputs::input_files): New function.
9363 (Incremental_inputs::relocs_entsize): New function.
9364 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9365 (Incremental_inputs::finalize_inputs): Remove.
9366 (Incremental_inputs::Input_info): Remove.
9367 (Incremental_inputs::lock_): Remove.
9368 (Incremental_inputs::inputs_): Change type.
9369 (Incremental_inputs::inputs_map_): Remove.
9370 (Incremental_inputs::current_object_entry_): New data member.
9371 (Incremental_inputs::inputs_section_): New data member.
9372 (Incremental_inputs::symtab_section_): New data member.
9373 (Incremental_inputs::relocs_section_): New data member.
9374 (Incremental_inputs::reloc_count_): New data member.
9375 (Incremental_inputs_reader): New class.
9376 (Incremental_symtab_reader): New class.
9377 (Incremental_relocs_reader): New class.
9378 * layout.cc (Layout::finalize): Move finalization of incremental info
9379 and creation of incremental info sections to follow finalization of
9380 symbol table. Set offsets for postprocessing sections.
9381 (Layout::create_incremental_info_sections): Call
9382 Incremental_inputs::create_data_sections. Add incremental symtab
9383 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9384 sections to layout after input sections.
9385 * layout.h (struct Timespec): Forward declaration.
9386 (Layout::incremental_inputs): Add const.
9387 (Layout::create_incremental_info_sections): Add parameter.
9388 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9389 * object.cc: Include incremental.h.
9390 (Relobj::finalize_incremental_relocs): New function.
9391 (Sized_relobj::do_layout): Record input sections in incremental info.
9392 * object.h (Object::output_section): New function.
9393 (Object::output_section_offset): Moved from Relobj.
9394 (Object::get_incremental_reloc_base): New function.
9395 (Object::get_incremental_reloc_count): New function.
9396 (Object::do_output_section): New function.
9397 (Object::do_output_section_offset): Moved from Relobj.
9398 (Object::do_get_incremental_reloc_base): New function.
9399 (Object::do_get_incremental_reloc_count): New function.
9400 (Object::Object): Initialize new data members.
9401 (Relobj::output_section): Renamed do_output_section and moved to
9403 (Relobj::output_section_offset): Moved to Object.
9404 (Relobj::do_get_incremental_reloc_base): New function.
9405 (Relobj::do_get_incremental_reloc_count): New function.
9406 (Relobj::allocate_incremental_reloc_counts): New function.
9407 (Relobj::count_incremental_reloc): New function.
9408 (Relobj::finalize_incremental_relocs): New function.
9409 (Relobj::next_incremental_reloc_index): New function.
9410 (Relobj::reloc_counts_): New data member.
9411 (Relobj::reloc_bases_): New data member.
9412 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9413 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9414 (Sized_relobj::incremental_relocs_scan): New function.
9415 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9416 (Sized_relobj::incremental_relocs_write): New function.
9417 (Sized_relobj::incremental_relocs_write_reltype): New function.
9418 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9420 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9421 archives and object files elsewhere.
9422 (Add_symbols::run): Report object files here.
9423 (Finish_group::run): Report end of archive at end of group.
9424 * reloc.cc: Include layout.h, incremental.h.
9425 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9426 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9427 (Sized_relobj::incremental_relocs_scan): New function.
9428 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9429 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9430 (Sized_relobj::incremental_relocs_write): New function.
9431 (Sized_relobj::incremental_relocs_write_reltype): New function.
9432 * script.cc (read_input_script): Rewrite test for incremental link.
9433 Change call to Incremental_inputs::report_script.
9434 * symtab.h (Symbol_table::first_global_index): New function.
9435 (Symbol_table::output_count): New function.
9437 2010-08-12 Doug Kwan <dougkwan@google.com>
9439 * arm.cc (Target_arm::merge_object_attributes): Check command line
9440 options --no-wchar-size-warning and --no-enum-size-warning.
9441 * options.h (General_options): Add ld-compatible options
9442 --no-enum-size-warning and --no-wchar-size-warning.
9444 2010-08-04 Ian Lance Taylor <iant@google.com>
9446 * x86_64.cc (Target_x86_64::Scan::local): Use
9447 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9448 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9449 (Target_x86_64::Scan::global): Likewise.
9450 (Target_x86_64::Relocate::relocate): Likewise.
9451 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9454 2010-08-03 Cary Coutant <ccoutant@google.com>
9456 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9457 to reserve space in merged_strings vector. Keep total input size
9459 (Output_merge_string::do_print_merge_stats): Print total input size.
9460 * merge.h (Output_merge_string): Add input_size_ field.
9461 * stringpool.cc (Stringpool_template::string_length): Move
9462 implementations out of Stringpool_template class and place in
9464 * stringpool.h (string_length): Move out of Stringpool_template.
9466 2010-08-03 Ian Lance Taylor <iant@google.com>
9469 * layout.cc (relaxation_loop_body): If address of load segment is
9470 set, adjust address to include headers if possible.
9472 2010-08-03 Ian Lance Taylor <iant@google.com>
9474 * version.cc (version_string): Bump to 1.10.
9476 2010-08-03 Ian Lance Taylor <iant@google.com>
9479 * layout.h (enum Output_section_order): Define.
9480 (class Layout): Update declarations.
9481 * layout.cc (Layout::get_output_section): Add order parameter.
9482 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9483 is_first_non_relro parameters. Change all callers.
9484 (Layout::choose_output_section): Likewise.
9485 (Layout::add_output_section_data): Likewise.
9486 (Layout::make_output_section): Likewise. Set order.
9487 (Layout::default_section_order): New function.
9488 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9489 * output.cc (Output_section::Output_section): Initialize order_.
9490 Don't initialize deleted fields.
9491 (Output_segment::Output_segment): Don't initialize deleted
9493 (Output_segment::add_output_section_to_load): New function
9494 replacing add_output_section. Change all callers to call this or
9495 add_output_section_to_nonload.
9496 (Output_segment::add_output_section_to_nonload): New function.
9497 (Output_segment::remove_output_section): Rewrite.
9498 (Output_segment::add_initial_output_data): Likewise.
9499 (Output_segment::has_any_data_sections): Likewise.
9500 (Output_segment::is_first_section_relro): Likewise.
9501 (Output_segment::maximum_alignment): Likewise.
9502 (Output_segment::has_dynamic_reloc): New function replacing
9503 dynamic_reloc_count. Change all callers.
9504 (Output_segment::has_dynamic_reloc_list): New function replacing
9505 dynamic_reloc_count_list. Change all callers.
9506 (Output_segment::set_section_addresses): Rewrite.
9507 (Output_segment::set_offset): Rewrite.
9508 (Output_segment::find_first_and_last_list): Remove.
9509 (Output_segment::set_tls_offsets): Rewrite.
9510 (Output_segment::first_section_load_address): Likewise.
9511 (Output_segment::output_section_count): Likewise.
9512 (Output_segment::section_with_lowest_load_address): Likewise.
9513 (Output_segment::write_section_headers): Likewise.
9514 (Output_segment::print_sections_to_map): Likewise.
9515 * output.h (class Output_data): Remove dynamic_reloc_count_
9516 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9517 (Output_data::add_dynamic_reloc): Rewrite.
9518 (Output_data::has_dynamic_reloc): New function.
9519 (Output_data::dynamic_reloc_count): Remove.
9520 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9521 is_last_relro_, is_first_non_relro_, is_interp_,
9522 is_dynamic_linker_section_ fields. Add order and set_order
9523 functions. Remove is_relro_local, set_is_relro_local,
9524 is_last_relro, set_is_last_relro, is_first_non_relro,
9525 set_is_first_non_relro functions, is_interp, set_is_interp,
9526 is_dynamic_linker_section, and set_is_dynamic_linker_section
9528 (class Output_segment): Change Output_data_list from std::list to
9529 std:;vector. Add output_lists_ field. Remove output_data_ and
9530 output_bss_ fields. Update declarations.
9532 2010-08-02 Ian Lance Taylor <iant@google.com>
9534 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9535 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9536 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9538 2010-08-02 Ian Lance Taylor <iant@google.com>
9541 * script.cc (Script_options::Script_options): Initialize
9542 symbol_definitions_ and symbol_references_.
9543 (Script_options::add_symbol_assignment): Update
9544 symbol_definitions_ and symbol_references_.
9545 (Script_options::add_symbol_reference): New function.
9546 (script_symbol): New function.
9547 * script.h (class Script_options): Add symbol_definitions_ and
9548 symbol_references_ fields.
9549 (Script_options::referenced_const_iterator): New type.
9550 (Script_options::referenced_begin): New function.
9551 (Script_options::referenced_end): New function.
9552 (Script_options::is_referenced): New function.
9553 (Script_options::any_unreferenced): New function.
9554 * script-c.h (script_symbol): Declare.
9555 * yyscript.y (exp): Call script_symbol.
9556 * symtab.cc: Include "script.h".
9557 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9558 Change all callers. Check symbols referenced by scripts.
9559 (Symbol_table::add_undefined_symbols_from_command_line): Add
9560 layout parameter. Change all callers.
9561 (Symbol_table::do_add_undefined_symbols_from_command_line):
9562 Likewise. Break out loop body. Check symbols referenced by
9564 (Symbol_table::add_undefined_symbol_from_command_line): New
9565 function broken out of
9566 do_add_undefined_symbols_from_command_line.
9567 * symtab.h (class Symbol_table): Update declarations.
9568 * archive.cc: Include "layout.h".
9569 (Archive::should_include_member): Add layout parameter. Change
9570 all callers. Check for symbol mentioned in expression.
9571 * archive.h (class Archive): Update declaration.
9572 * object.cc (Sized_relobj::do_should_include_member): Add layout
9574 * object.h (Object::should_include_member): Add layout parameter.
9576 (Object::do_should_include_member): Add layout parameter.
9577 (class Sized_relobj): Update declaration.
9578 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9580 * dynobj.h (class Sized_dynobj): Update declaration.
9581 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9583 * plugin.h (class Sized_pluginobj): Update declaration.
9585 2010-08-02 Ian Lance Taylor <iant@google.com>
9588 * output.cc (Output_segment::set_offset): Search for the first and
9589 last sections rather than assuming that the list is in order.
9590 (Output_segment::find_first_and_last_list): New function.
9591 * output.h (class Output_segment): Update declarations.
9592 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9593 (relro_strip_test_SOURCES): New variable.
9594 (relro_strip_test_DEPENDENCIES): New variable.
9595 (relro_strip_test_LDFLAGS): New variable.
9596 (relro_strip_test_LDADD): New variable.
9597 (relro_strip_test.so): New target.
9599 2010-08-02 Ian Lance Taylor <iant@google.com>
9601 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9602 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9603 (Target_i386::got_tlsdesc_section): New function.
9604 (Target_i386::got_section): Create space for GOT entries for
9605 TLSDESC relocations.
9606 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9608 (Target_i386::Scan::global): Likewise.
9609 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9611 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9612 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9613 (Target_x86_64::got_tlsdesc_section): New function.
9614 (Target_x86_64::got_section): Create space for GOT entries for
9615 TLSDESC relocations.
9616 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9618 (Target_x86_64::Scan::global): Likewise.
9619 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9622 2010-08-02 Ian Lance Taylor <iant@google.com>
9624 * testsuite/final_layout.sh: Use dc to convert from hex to
9627 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9629 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9630 paramter to the call to gold::gc_process_relocs.
9631 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9632 paramter to the call to gold::gc_process_relocs.
9633 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9634 parameter to the call to gold::gc_process_relocs.
9635 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9636 template parameter to the call to gold::gc_process_relocs.
9637 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9638 paramter to the call to gold::gc_process_relocs.
9639 * gc.h (get_embedded_addend_size): New function.
9640 (gc_process_relocs): Save the size of the reloc for use by ICF.
9641 * icf.cc (get_section_contents): Get the addend from the text section
9642 for SHT_REL relocation sections.
9643 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9644 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9645 * int_encoding.h (read_from_pointer): New overloaded function.
9646 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9647 * testsuite/icf_sht_rel_addend_test.sh: New file.
9648 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9649 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9651 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9653 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9654 * Makefile.in: Regenerate.
9655 * testsuite/Makefile.in: Regenerate.
9657 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9659 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9660 * gold/testsuite/debug_msg.cc: Likewise.
9661 * gold/testsuite/odr_violation1.cc
9662 * gold/testsuite/odr_violation2.cc
9664 2010-07-21 Cary Coutant <ccoutant@google.com>
9666 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9667 string, and length fields.
9668 (Output_merge_string::Merged_strings_list): New type.
9669 (Output_merge_string::Merged_strings_lists): New typedef.
9670 (Output_merge_string): Replace merged_strings_ with
9671 merged_strings_lists_.
9672 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9673 Merged_strings_list per input object and section. Don't store pointer
9674 to the string. Don't store length with each merged string entry.
9675 (Output_merge_string::finalize_merged_data): Loop over list of merged
9676 strings lists. Recompute length of each merged string.
9678 2010-07-15 Cary Coutant <ccoutant@google.com>
9680 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9683 2010-07-14 Ian Lance Taylor <iant@google.com>
9685 * descriptors.cc (Descriptors::open): Report correct name in error
9688 2010-07-13 Doug Kwan <dougkwan@google.com>
9690 * arm.cc (Arm_input_section::Arm_input_section): For a
9691 SHT_ARM_EXIDX section, always keeps the input sections.
9692 (Arm_input_section::set_exidx_section_link): New method.
9693 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9694 has_errors_ to false.
9695 (Arm_exidx_input_section::has_errors,
9696 Arm_exidx_input_section::set_has_errors): New methods.
9697 (Arm_exidx_input_section::has_errors_): New data member.
9698 (Arm_relobj::get_exidx_shndx_list): New method.
9699 (Arm_output_section::append_text_sections_to_list): Do not skip
9700 section without SHF_EXECINSTR.
9701 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9703 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9704 section header. Make error messages more verbose. Check for
9705 a non-executable section linked to an EXIDX section.
9706 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9707 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9708 check that there is no deferred EXIDX section if we exit early.
9709 Instead of not making an EXIDX section in case of an error, make one
9710 and set the has_errors flag of it.
9711 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9712 in a relocatable link.
9713 (Target_arm::do_relax): Look for the EXIDX output section instead of
9714 assuming that it is called .ARM.exidx.
9715 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9716 section list. Do not check for SHF_EXECINSTR section flags but
9717 skip any input section with errors.
9718 * output.cc (Output_section::Output_section): Initialize
9719 always_keeps_input_sections_ to false.
9720 (Output_section::add_input_section): Check for
9721 always_keeps_input_sections_.
9722 * output.h (Output_section::always_keeps_input_sections,
9723 Output_section::set_always_keeps_input_sections): New methods.
9724 (Output_section::always_keeps_input_sections): New data member.
9726 2010-07-13 Rafael Espindola <espindola@google.com>
9728 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9729 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9731 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9732 Ian Lance Taylor <iant@google.com>
9734 * output.h (Output_section_lookup_maps::add_merge_section):
9735 Correct check of whether value was inserted.
9736 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9737 (Output_section_lookup_maps::add_relaxed_input_section):
9739 * arm.cc (Target_arm::got_section): Remove used local os.
9740 * i386.cc (Target_i386::got_section): Likewise.
9741 * x86_64.cc (Target_x86_64::got_section): Likewise.
9742 * sparc.cc (Target_sparc::got_section): Likewise.
9743 (Target_sparc::relocate): Remove unused local have_got_offset.
9744 * powerpc.cc (Target_powerpc::relocate): Likewise.
9746 2010-07-13 Ian Lance Taylor <iant@google.com>
9748 * compressed_output.cc (zlib_decompress): Fix signature in
9751 * archive.cc (Archive::include_member): Unlock an external member
9752 of a thin archive. Don't bother to delete an object we know is
9755 2010-07-12 Cary Coutant <ccoutant@google.com>
9757 * compressed_output.cc (zlib_decompress): New function.
9758 (get_uncompressed_size): New function.
9759 (decompress_input_section): New function.
9760 * compressed_output.h (get_uncompressed_size): New function.
9761 (decompress_input_section): New function.
9762 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9763 Handle compressed debug sections.
9764 * layout.cc (is_compressed_debug_section): New function.
9765 (Layout::output_section_name): Map compressed section names to
9767 * layout.h (is_compressed_debug_section): New function.
9768 (is_debug_info_section): Recognize compressed debug sections.
9769 * merge.cc: Include compressed_output.h.
9770 (Output_merge_data::do_add_input_section): Handle compressed
9772 (Output_merge_string::do_add_input_section): Handle compressed
9774 * object.cc: Include compressed_output.h.
9775 (Sized_relobj::Sized_relobj): Initialize new data members.
9776 (build_compressed_section_map): New function.
9777 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9778 * object.h (Object::section_is_compressed): New method.
9779 (Object::do_section_is_compressed): New method.
9780 (Sized_relobj::Compressed_section_map): New type.
9781 (Sized_relobj::do_section_is_compressed): New method.
9782 (Sized_relobj::compressed_sections_): New data member.
9783 * output.cc (Output_section::add_input_section): Handle compressed
9785 * reloc.cc: Include compressed_output.h.
9786 (Sized_relobj::write_sections): Handle compressed debug sections.
9788 2010-07-08 Cary Coutant <ccoutant@google.com>
9790 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9791 weak when resolving to a dynamic def.
9792 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9793 for weak undef/dynamic def cases. Adjust callers.
9794 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9795 undef_binding_weak_.
9796 (Symbol_table::sized_write_globals): Adjust symbol binding.
9797 (Symbol_table::sized_write_symbol): Add binding parameter.
9798 * symtab.h (Symbol::set_undef_binding): New method.
9799 (Symbol::is_undef_binding_weak): New method.
9800 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9801 (Symbol_table::should_override): Add new parameter.
9802 (Symbol_table::sized_write_symbol): Add new parameter.
9804 * testsuite/weak_undef_file1.cc: Add new test case.
9805 * testsuite/weak_undef_file2.cc: Fix header comment.
9806 * testsuite/weak_undef_test.cc: Add new test case.
9808 2010-06-29 Doug Kwan <dougkwan@google.com>
9810 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9811 Initialize USE_SYMBOL_.
9812 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9814 (Arm_reloc_property::uses_symbol_): New data member declaration.
9815 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9816 uses symbol value and symbol is undefined but not weakly undefined.
9818 2010-06-28 Rafael Espindola <espindola@google.com>
9820 * plugin.cc (Plugin::load): Use dlerror.
9822 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9824 * symtab.cc (detect_odr_violations): When reporting an ODR
9825 violation, report an object where the symbol is defined.
9827 2010-06-25 Doug Kwan <dougkwan@google.com>
9829 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9830 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9832 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9833 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9834 target hook to detect function points.
9835 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9836 * icf.h (Icf::check_section_for_function_pointers): Change type of
9837 parameter SECTION_NAME to const reference to std::string. Use
9838 target hook to determine if section may have unsafe pointers.
9839 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9842 2010-06-21 Rafael Espindola <espindola@google.com>
9844 * fileread.cc (Input_file::find_fie): New
9845 (Input_file::open): Use Input_file::find_fie.
9846 * fileread.h (Input_file::find_fie): New
9847 * plugin.cc (set_extra_library_path): New.
9848 (Plugin::load): Add set_extra_library_path to the transfer vector.
9849 (Plugin_manager::set_extra_library_path): New.
9850 (Plugin_manager::add_input_file): Use the extra search path if set.
9851 (set_extra_library_path(): New.
9852 * plugin.h (Plugin_manager): Add set_extra_library_path and
9855 2010-06-19 Cary Coutant <ccoutant@google.com>
9857 * layout.cc (gdb_sections): Add .debug_types.
9858 (lines_only_debug_sections): Likewise.
9860 2010-06-18 Rafael Espindola <espindola@google.com>
9862 * plugin.cc (add_input_file,add_input_library)
9863 (Plugin_manager::add_input_file): Make filename arguments const.
9864 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9867 2010-06-16 Doug Kwan <dougkwan@google.com>
9869 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9870 .ARM.attributes section if we have not merged any input
9871 attributes sections.
9873 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9875 * arm.cc: Allow combining objects with no EABI version
9878 2010-06-15 Rafael Espindola <espindola@google.com>
9880 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9882 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9884 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9885 (struct iovec): Correct !HAVE_READV definition.
9887 2010-06-10 Cary Coutant <ccoutant@google.com>
9889 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9890 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9892 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9895 * symtab.h (Symbol::is_placeholder): New member function.
9896 * target-reloc.h (relocate_section): Check for placeholder symbols.
9898 * testsuite/Makefile.am (plugin_test_8): New test.
9899 (plugin_test_9): New test.
9900 * testsuite/Makefile.in: Regenerate.
9902 2010-06-09 Nick Clifton <nickc@redhat.com>
9904 * yyscript.y (input_list_element): Allow strings prefixed with
9905 the '-' character. Treat these as libraries.
9906 * script.cc (script_add_library): New function. Adds a library
9907 specified by "-l<name>" found in an input script.
9908 * script-c.h: Add prototype for script_add_library.
9910 2010-06-07 Doug Kwan <dougkwan@google.com>
9912 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9913 Restrict stub-group size to be within long conditional branch
9914 range when working around cortex-A8 erratum.
9916 2010-06-07 Damien Diederen <dd@crosstwine.com>
9918 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9921 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9925 (Output_section::Input_section_sort_entry::compare_section_ordering):
9926 Change to return non-zero correctly.
9927 (Output_section::Input_section_sort_section_order_index_compare
9928 ::operator()): Change to fix ambiguity in comparisons.
9930 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9932 * gold.h (is_wildcard_string): New function.
9933 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9934 (Layout::layout_eh_frame): Ditto.
9935 (Layout::find_section_order_index): New method.
9936 (Layout::read_layout_from_file): New method.
9937 * layout.h (Layout::find_section_order_index): New method.
9938 (Layout::read_layout_from_file): New method.
9939 (Layout::input_section_position_): New private member.
9940 (Layout::input_section_glob_): New private member.
9941 * main.cc (main): Call read_layout_from_file here.
9942 * options.h (--section-ordering-file): New option.
9943 * output.cc (Output_section::input_section_order_specified_): New
9945 (Output_section::Output_section): Initialize new member.
9946 (Output_section::add_input_section): Add new parameter.
9947 Keep input sections when --section-ordering-file is used.
9948 (Output_section::set_final_data_size): Sort input sections when
9949 section ordering file is specified.
9950 (Output_section::Input_section_sort_entry): Add new parameter.
9952 (Output_section::Input_section_sort_entry::compare_section_ordering):
9954 (Output_section::Input_section_sort_compare::operator()): Change to
9955 consider section_order_index.
9956 (Output_section::Input_section_sort_init_fini_compare::operator()):
9957 Change to consider section_order_index.
9958 (Output_section::Input_section_sort_section_order_index_compare
9959 ::operator()): New method.
9960 (Output_section::sort_attached_input_sections): Change to sort
9961 according to section order when specified.
9962 (Output_section::add_input_section<32, true>): Add new parameter.
9963 (Output_section::add_input_section<64, true>): Add new parameter.
9964 (Output_section::add_input_section<32, false>): Add new parameter.
9965 (Output_section::add_input_section<64, false>): Add new parameter.
9966 * output.h (Output_section::add_input_section): Add new parameter.
9967 (Output_section::input_section_order_specified): New
9969 (Output_section::set_input_section_order_specified): New method.
9970 (Input_section::Input_section): Initialize section_order_index_.
9971 (Input_section::section_order_index): New method.
9972 (Input_section::set_section_order_index): New method.
9973 (Input_section::section_order_index_): New member.
9974 (Input_section::Input_section_sort_section_order_index_compare): New
9976 (Output_section::input_section_order_specified_): New member.
9977 * script-sections.cc (is_wildcard_string): Delete and move modified
9979 (Output_section_element_input::Output_section_element_input): Modify
9980 call to is_wildcard_string.
9981 (Output_section_element_input::Input_section_pattern
9982 ::Input_section_pattern): Ditto.
9983 (Output_section_element_input::Output_section_element_input): Ditto.
9984 * testsuite/Makefile.am (final_layout): New test case.
9985 * testsuite/Makefile.in: Regenerate.
9986 * testsuite/final_layout.cc: New file.
9987 * testsuite/final_layout.sh: New file.
9989 2010-06-01 Rafael Espindola <espindola@google.com>
9991 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9993 2010-06-01 Rafael Espindola <espindola@google.com>
9995 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9996 visibility of symbols.
9998 2010-05-27 Doug Kwan <dougkwan@google.com>
10000 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10001 from start of output section instead of address for a local symbol
10002 in a merged or relaxed section when doing a relocatable link.
10004 2010-05-26 Rafael Espindola <espindola@google.com>
10007 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10008 adding sections the garbage collector removed.
10009 * gold/testsuite/Makefile.am: Add test.
10010 * gold/testsuite/Makefile.in: Regenerate.
10011 * gold/testsuite/plugin_test_7.sh: New.
10012 * gold/testsuite/plugin_test_7_1.c: New.
10013 * gold/testsuite/plugin_test_7_2.c: New.
10015 2010-05-26 Rafael Espindola <espindola@google.com>
10017 * script-sections.cc (Output_section_definition::set_section_addresses):
10018 Check for --section-start.
10020 2010-05-26 Doug Kwan <dougkwan@google.com>
10022 * arm.cc (Arm_scan_relocatable_relocs): New class.
10023 (Target_arm::relocate_special_relocatable): New method.
10024 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10025 (Arm_relocate_functions::thumb_branch_common): Same.
10026 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10027 instead of Default_scan_relocatable_relocs.
10028 * target-reloc.h (relocate_for_relocatable): Let target handle
10029 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10030 * target.h (Sized_target::relocate_special_relocatable): New method.
10032 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10034 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10036 2010-05-23 Doug Kwan <dougkwan@google.com>
10038 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10040 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10041 with a direct branch, not a conditional branch, to a stub.
10042 * merge.cc (Output_merge_base::record_input_section): New method
10044 (Output_merge_data::do_add_input_section): Record input section if
10045 keeps-input-sections flag is set.
10046 (Output_merge_string::do_add_input_section): Ditto.
10047 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10048 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10050 (Output_merge_base::keeps_input_sections,
10051 Output_merge_base::set_keeps_input_sections,
10052 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10053 method definitions.
10054 (Output_merge_base::Input_sections): New type declaration.
10055 (Output_merge_base::input_sections_begin,
10056 Output_merge_base::input_sections_end,
10057 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10058 (Output_merge_base::bool keeps_input_sections_,
10059 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10060 Output_merge_base::input_sections_): New data members.
10061 (Output_merge_data::do_set_keeps_input_sections): New method
10063 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10064 * output.cc (Output_section::Input_section::relobj): Move method
10065 defintion from class declaration to here and handle merge sections.
10066 (Output_section::Input_section::shndx): Ditto.
10067 (Output_section::Output_section): Remove initializations of removed
10068 data members and initialize new data member LOOKUP_MAPS_.
10069 (Output_section::add_input_section): Set keeps-input-sections flag
10070 for a newly created merge output section as appropriate. Adjust code
10071 to use Output_section_lookup_maps class.
10072 (Output_section::add_relaxed_input_section): Adjst code for lookup
10073 maps code refactoring.
10074 (Output_section::add_merge_input_section): Add a new parameter
10075 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10076 class. If adding input section to a newly created merge output
10077 section fails, remove the new merge section.
10078 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
10079 Adjust code for use of the Output_section_lookup_maps class.
10080 (Output_section::find_merge_section): Ditto.
10081 (Output_section::build_lookup_maps): New method defintion.
10082 (Output_section::find_relaxed_input_section): Adjust code to use
10083 Output_section_lookup_maps class.
10084 (Output_section::get_input_sections): Export merge sections. Adjust
10085 code to use Output_section_lookup_maps class.
10086 (Output_section:::add_script_input_section): Adjust code to use
10087 Output_section_lookup_maps class. Update lookup maps for merge
10089 (Output_section::discard_states): Use Output_section_lookup_maps.
10090 (Output_section::restore_states): Same.
10091 * output.h (Merge_section_properties): Move class defintion out of
10093 (Output_section_lookup_maps): New class.
10094 (Output_section::Input_section::is_merge_section): New method
10096 (Output_section::Input_section::relobj): Move defintion out of class
10097 defintion. Declare method only.
10098 (Output_section::Input_section::shndx): Ditto.
10099 (Output_section::Input_section::output_merge_base): New method defintion.
10100 (Output_section::Input_section::u2_.pomb): New union field.
10101 (Output_section::Merge_section_by_properties_map,
10102 Output_section::Output_section_data_by_input_section_map,
10103 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10105 (Output_section::add_merge_input_section): Add new parameter
10106 KEEPS_INPUT_SECTIONS.
10107 (Output_section::build_lookup_maps): New method declaration.
10108 (Output_section::merge_section_map_,
10109 Output_section::merge_section_by_properties_map_,
10110 Output_section::relaxed_input_section_map_,
10111 Output_section::is_relaxed_input_section_map_valid_): Remove data
10113 (Output_section::lookup_maps_): New data member.
10115 2010-05-21 Doug Kwan <dougkwan@google.com>
10118 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10119 avoid a compilation error.
10121 2010-05-19 Rafael Espindola <espindola@google.com>
10123 * script-sections.cc (Output_section_definition::allocate_to_segment):
10124 Update the phdrs_list even when the output section is NULL.
10125 * testsuite/Makefile.am: Add test.
10126 * testsuite/Makefile.in: Regenerate.
10127 * testsuite/script_test_9.cc: New.
10128 * testsuite/script_test_9.sh: New.
10129 * testsuite/script_test_9.t: New.
10131 2010-05-19 Doug Kwan <dougkwan@google.com>
10133 * arm.cc (Arm_input_section::original_size): New method.
10134 (Arm_input_section::do_addralign): Add a cast.
10135 (Arm_input_section::do_output_offset): Remove static cast.
10136 (Arm_input_section::original_addralign,
10137 Arm_input_section::original_size_): Change type to uint32_t.
10138 (Arm_input_section::init): Add safe casts for section alignment
10140 (Arm_input_section::set_final_data_size): Do not set address and
10141 offset of stub table.
10142 (Arm_output_section::fix_exidx_coverage): Change use of of
10143 Output_section::Simple_input_section to that of
10144 Output_section::Input_section.
10145 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10146 except for the first pass.
10147 * output.cc (Output_section::get_input_sections): Change type of
10148 input_sections to std::list<Input_section>.
10149 (Output_section::add_script_input_section): Rename from
10150 Output_section::add_simple_input_section. Change type of SIS
10151 parameter from Simple_input_section to Input_section.
10152 * output.h (Output_section::Simple_input_section): Remove class.
10153 (Output_section::Input_section): Change class visibility to public.
10154 (Output_section::Input_section::addralign): Use stored alignments
10155 for special input sections if set.
10156 (Output_section::Input_section::set_addralign): New method.
10157 (Output_section::get_input_sections): Change parameter type from
10158 list of Simple_input_section to list of Input_section.
10159 (Output_section::add_script_input_section): Rename from
10160 Output_section::add_simple_input_section. Change first parameter's
10161 type from Simple_input_section to Input_section and remove the
10162 second and third parameters.
10163 * script-sections.cc (Input_section::Input_section_list): Change
10164 type to list of Output_section::Input_section/
10165 (Input_section_info::Input_section_info): Change parameter type of
10166 INPUT_SECTION to Output_section::Input_section.
10167 (Input_section_info::input_section): Change return type.
10168 (Input_section_info::input_section_): Change type to
10169 Output_section::Input_section.
10170 (Output_section_element_input::set_section_addresses): Adjust code
10171 to use Output_section::Input_section instead of
10172 Output_section::Simple_input_section. Adjust code for renaming
10173 of Output_section::add_simple_input_section.
10174 (Orphan_output_section::set_section_addresses): Ditto.
10176 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10178 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10179 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10181 2010-05-18 Rafael Espindola <espindola@google.com>
10183 * options.cc (General_options::finalize): Handle -nostdlib.
10184 * options.h (nostdlib): New option.
10185 * script.cc (script_add_search_dir): Handle -nostdlib.
10187 2010-05-12 Doug Kwan <dougkwan@google.com>
10189 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10190 attributes section only if there no attributes section after merging.
10191 (Target_arm::merge_object_attributes): Move value of
10192 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
10193 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10194 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10195 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10196 and arm_attr_merge_7.stdout.
10197 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10198 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10199 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10200 arm_attr_merge_7b.o): New rules.
10201 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10203 * testsuite/Makefile.in: Regenerate.
10204 * testsuite/arm_attr_merge.sh: New file.
10205 * testsuite/arm_attr_merge_[67][ab].s: Same.
10207 2010-05-05 Nick Clifton <nickc@redhat.com>
10209 * po/es.po: Updated Spanish translation.
10211 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10213 * Makefile.am (install-exec-local): Properly install gold as
10214 default cross linker.
10215 * Makefile.in: Regenerated.
10217 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10218 Nick Clifton <nickc@redhat.com>
10220 * configure.ac (install_as_default): Define and set to false
10221 unless --enable-gold or --enable-gold=both/gold has been
10223 * configure: Regenerate.
10225 * Makefile.am (install-exec-local): Install the executable as
10226 'ld.gold'. If install_as_default is true then also install it as
10228 * Makefile.in: Regenerated.
10230 2010-04-24 Ian Lance Taylor <iant@google.com>
10232 * layout.cc (Layout::layout_reloc): In relocatable link don't
10233 combine reloc sections for grouped sections.
10235 2010-04-23 Sriraman Tallam <tmsriram@google.com>
10237 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10238 sections that are not ordinary to icf.
10239 * icf.cc (get_section_contents): Handle relocation pointing to section
10240 with no object or shndx information.
10241 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10242 * testsuite/Makefile.in: Regenerate.
10243 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10244 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10246 2010-04-22 Ian Lance Taylor <iant@google.com>
10248 * expression.cc (Expression::Expression_eval_info): Add
10249 result_alignment_pointer field.
10250 (Expression::eval_with_dot): Add result_alignment_pointer
10251 parameter. Change all callers.
10252 (Expression::eval_maybe_dot): Likewise.
10253 (class Binary_expression): Add alignment_pointer parameter to
10254 left_value and right_value. Change all callers.
10255 (BINARY_EXPRESSION): Set result alignment.
10256 (class Trinary_expression): Add alignment_pointer parameter to
10257 arg2_value and arg3_value. Change all callers.
10258 (Trinary_cond::value): Set result alignment.
10259 (Max_expression::value, Min_expression::value): Likewise.
10260 (Align_expression::value): Likewise.
10261 * script-sections.cc (class Sections_element): Add dot_alignment
10262 parameter to set_section_addresses virtual function. Update
10264 (class Output_section_element): Likewise.
10265 (Script_sections::create_segments): Add dot_alignment parameter.
10266 Change all callers.
10267 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10268 (Script_sections::set_phdrs_clause_addresses): Likewise.
10269 * script-sections.h: Update declarations.
10270 * script.h: Update declarations.
10271 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10273 * testsuite/script_test_3.t: Set large alignment.
10274 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10275 segment has expected alignment.
10277 2010-04-22 Nick Clifton <nickc@redhat.com>
10279 * po/gold.pot: Updated by the Translation project.
10280 * po/vi.po: Updated Vietnamese translation.
10282 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10284 * testsuite/Makefile.am (check_PROGRAMS): Add
10285 icf_virtual_function_folding_test.
10286 * testsuite/Makefile.in: Regenerated.
10288 2010-04-15 Andrew Haley <aph@redhat.com>
10290 * options.h (merge_exidx_entries): New option.
10291 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10292 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10293 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10294 (Target_arm::merge_exidx_entries): New function.
10295 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10296 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10297 to Arm_exidx_fixup constructor.
10298 Add new arg, merge_exidx_entries.
10299 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10300 Arm_output_section::fix_exidx_coverage.
10302 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10304 * icf.cc (get_section_contents): Check for preemptible functions.
10305 Ignore addend when appropriate.
10306 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10308 (add_from_relobj): Check for section folded.
10309 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10310 * symtab.h (should_add_dynsym_entry): Add new parameter.
10311 * target-reloc.h (scan_relocs): Check for section folded.
10312 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10313 Check reloc types for function pointers in shared objects.
10314 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10316 (icf_preemptible_functions_test): New test case.
10317 (icf_string_merge_test): New test case.
10318 * testsuite.Makefile.in: Regenerate.
10319 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10320 bar_glob. Refactor code.
10321 * testsuite/icf_preemptible_functions_test.cc: New file.
10322 * testsuite/icf_preemptible_functions_test.sh: New file.
10323 * testsuite/icf_string_merge_test.cc: New file.
10324 * testsuite/icf_string_merge_test.sh: New file.
10325 * testsuite/icf_virtual_function_folding_test.cc: New file.
10326 * testsuite/icf_virtual_function_folding_test.sh: New file.
10328 2010-04-14 Doug Kwan <dougkwan@google.com>
10330 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10331 for local symbol recounting if we remove a section due to ICF.
10332 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10333 there are no regular objects in input.
10335 2010-04-13 Doug Kwan <dougkwan@google.com>
10337 * arm.cc (Arm_input_section::set_final_data_size): Compute
10338 accurate final data size instead of using current data size.
10340 2010-04-09 Doug Kwan <dougkwan@google.com>
10342 * layout.cc (Layout::choose_output_section): Handle script section
10344 (Layout::make_output_section_for_script): Add section type parameter.
10345 Handle script section types.
10346 * layout.h (Layout::make_output_section_for_script): Add section
10348 * output.cc (Output_section::Output_section): Initialize data member
10350 (Output_section::do_reset_address_and_file_offset): Do not set address
10351 to 0 if section is a NOLOAD section.
10352 * output.h (Output_section::is_noload): New method.
10353 (Output_section::set_is_noload): Ditto.
10354 (Output_section::is_noload_): New data member.
10355 * script-c.h (Script_section_type): New enum type.
10356 (struct Parser_output_section_header): Add new file section_type.
10357 * script-sections.cc (Sections_element::output_section_name): Add
10358 parameter for returning script section type.
10359 (Output_section_definition::output_section_name): Ditto.
10360 (Output_section_definition::section_type)P; New method.
10361 (Output_section_definiton::script_section_type_name): Ditto.
10362 (Output_section_definition::script_section_type_): New data member.
10363 (Output_section_definition::Output_section_definition): Initialize
10364 data member Output_section_definition::script_section_type_.
10365 (Output_section_definition::create_sections): Pass script section type
10366 to Layout::make_output_section_for_script.
10367 (Output_section_definition::output_section_name): Return script
10368 section type to caller.
10369 (Output_section_definition::set_section_address): Do not advance
10370 dot value and load address if section type is NOLOAD. Set address
10371 of NOLOAD sections regardless of section flags.
10372 (Output_section_definition::print): Print section type if it is
10373 not SCRIPT_SECTION_TYPE_NONE.
10374 (Output_section_definition::section_type): New method.
10375 (Output_section_definition::script_section_type_name): Ditto.
10376 (Script_sections::output_section_name): Add new parameter
10377 PSECTION_TYPE for returning script section type. Pass it to
10378 section elements. Handle discard sections.
10379 (Sort_output_sections::operator()): Handle NOLOAD sections.
10380 * script-sections.h (Script_sections::Section_type): New enum type.
10381 (Script_sections::output_section_name): Add a new parameter for
10382 returning script section type.
10383 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10385 * yyscript.y (union): Add new field SECTION_TYPE.
10386 (COPY, DSECT, INFO, NOLOAD): New tokens.
10387 (opt_address_and_section_type): Change type to output_section_header.
10388 (section_type): New non-terminal
10389 (section_header): Handle section type.
10390 (opt_address_and_section_type): Return section type value.
10392 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10394 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10395 * testsuite/plugin_common_test_2.c (foo): Likewise.
10397 2010-04-08 Doug Kwan <dougkwan@google.com>
10399 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10401 * output.cc (Output_section::add_merge_input_section): Simplify
10402 code and return status of Output_merge_base::add_input_section.
10403 Update merge section map only if Output_merge_base::add_input_section
10406 2010-04-07 Doug Kwan <dougkwan@google.com>
10408 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10409 if section is marked as containing instructions but has no mapping
10411 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10412 correct section index.
10413 (Arm_relobj::find_linked_text_section): Ditto.
10415 2010-04-07 Cary Coutant <ccoutant@google.com>
10417 * archive.cc (include_member): Destroy Read_symbols_data object before
10419 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10420 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10421 (Read_symbols_data::~Read_symbols_data) New destructor.
10422 (Section_relocs::Section_relocs) New constructor.
10423 (Section_relocs::~Section_relocs) New destructor.
10424 (Read_relocs_data::Read_relocs_data) New constructor.
10425 (Read_relocs_data::~Read_relocs_data) New destructor.
10426 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10427 pointers to NULL after deleting.
10429 2010-04-07 Doug Kwan <dougkwan@google.com>
10431 * arm.cc: Replace "endianity" with "endianness" in comments.
10432 (Arm_exidx_cantunwind): Ditto.
10433 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10434 (Arm_relobj::merge_flags_and_attributes): New method.
10435 (Arm_relobj::merge_flags_and_attributes_): New data member.
10436 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10437 (Arm_relobj::scan_sections_for_stubs): Ditto.
10438 (Arm_relobj::do_read_symbols): Check to see if we really want to
10439 merge processor-specific flags and attributes. Exit early if
10440 an object is empty except for section names and the undefined symbol.
10441 (Target_arm::do_finalize_sections): Move check for ELF format to
10442 Arm_relobj::do_read_symbols. Merge processor specific flags and
10443 attributes from a regular object only when we have determined that
10444 it is aapropriate. Do not create an .ARM.attributes section in
10445 output if there is no regular input object.
10446 (Target_arm::merge_processor_specific_flags): Check
10447 --warn-mismatch before printing any error.
10448 (Target_arm::merge_object_attributes): Ditto.
10449 * gold.cc (queue_middle_tasks): Handle the case in which there is
10450 no regular object in input.
10451 * options.cc (General_options::parse_EB): New method.
10452 (General_options::parse_EL): Same.
10453 (General_options::General_options): Initialize endianness_.
10454 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10456 (General_options::Endianness): New enum.
10457 (General_options::endianness): New method.
10458 (General_options::endianness_): New data member.
10459 * parameters.cc (Parameters::set_options): Check target endianness.
10460 (Parameters::set_target_once): Ditto.
10461 (Parameters::check_target_endianness): New method.
10462 (parameters_force_valid_target): If either -EL or -EB is specified,
10463 use it to define endianness of default target.
10464 * parameters.h (Parameters::check_target_endianness): New method
10466 * target.h (class Target): Change "endianity" to "endianness"
10469 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10471 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10472 * configure: Regenerate.
10473 * Makefile.in: Regenerate.
10474 * testsuite/Makefile.in: Regenerate.
10476 2010-04-06 Cary Coutant <ccoutant@google.com>
10479 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10480 prevailing definitions of common symbols.
10481 * testsuite/plugin_test_6.sh: New test case.
10482 * testsuite/plugin_common_test_1.c: New test case.
10483 * testsuite/plugin_common_test_2.c: New test case.
10484 * testsuite/Makefile.am (plugin_test_6): New test case.
10485 * testsuite/Makefile.in: Regenerate.
10487 2010-04-06 Nick Clifton <nickc@redhat.com>
10489 * po/vi.po: New Vietnamese translation.
10491 2010-03-30 Doug Kwan <dougkwan@google.com>
10493 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10495 2010-03-25 Doug Kwan <dougkwan@google.com>
10497 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10498 to avoid a conversion warning on a 32-bit host.
10500 2010-03-24 Ian Lance Taylor <iant@google.com>
10502 * testsuite/script_test_3.t: Add a TLS segment.
10503 * testsuite/Makefile.am (check_PROGRAMS): Add
10504 tls_phdrs_script_test.
10505 (tls_phdrs_script_test_SOURCES): Define.
10506 (tls_phdrs_script_test_DEPENDENCIES): Define.
10507 (tls_phdrs_script_test_LDFLAGS): Define.
10508 (tls_phdrs_script_test_LDADD): Define.
10509 * testsuite/Makefile.in: Rebuild.
10511 2010-03-23 Cary Coutant <ccoutant@google.com>
10513 * fileread.cc (find_or_make_view): Fix comment.
10515 2010-03-23 Ian Lance Taylor <iant@google.com>
10517 * script-sections.cc (class Orphan_section_placement): Define
10518 PLACE_TLS and PLACE_TLS_BSS.
10519 (Orphan_section_placement::Orphan_section_placement): Initialize
10521 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10522 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10523 (tls_script_test_SOURCES): Define.
10524 (tls_script_test_DEPENDENCIES): Define.
10525 (tls_script_test_LDFLAGS): Define.
10526 (tls_script_test_LDADD): Define.
10527 * testsuite/Makefile.in: Rebuild.
10529 2010-03-22 Doug Kwan <dougkwan@google.com>
10531 * arm.cc (Arm_relocate_functions::abs8,
10532 Arm_relocate_functions::abs16): Use correct check for overflow
10533 specified in the ARM ELF specs.
10534 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10535 target of a BLX instruction specially.
10536 (Reloc_stub::stub_type_for_reloc): Ditto.
10537 (Relocate::relocate): Use symbolic names instead of numeric relocation
10538 codes to report error.
10539 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10541 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10542 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10543 thumb2_blx_out_of_range.stdout
10544 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10545 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10546 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10547 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10548 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10549 thumb2_blx_in_range, thumb2_blx_in_range.o,
10550 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10551 thumb2_blx_out_of_range.o): New rules.
10552 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10553 thumb2_blx_in_range and thumb2_blx_out_of_range.
10554 * testsuite/Makefile.in: Regenerate.
10555 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10556 * testsuite/thumb_blx_in_range.s: New file.
10557 * testsuite/thumb_blx_out_of_range.s: New file.
10559 2010-03-22 Rafael Espindola <espindola@google.com>
10561 * archive.cc (Should_include): Move to archive.h.
10562 (should_include_member): Make it a member of Archive.
10564 (Add_lib_group_symbols): New.
10565 * archive.h: Include options.h.
10566 (Archive_member): Moved from Archive.
10567 (Should_include): Moved from archive.cc.
10569 (Add_lib_group_symbols): New.
10570 * dynobj.cc (do_should_include_member): New.
10571 * dynobj.h (do_should_include_member): New.
10572 * gold.cc (queue_initial_tasks): Update call to queue.
10573 * main.cc (main): Print lib group stats.
10574 * object.cc (do_should_include_member): New.
10575 * object.h: Include archive.h.
10576 (Object::should_include_member): New.
10577 (Object::do_should_include_member): New.
10578 (Sized_relobj::do_should_include_member): New.
10579 * options.cc (General_options::parse_start_lib): New.
10580 (General_options::parse_end_lib): New.
10581 (Input_arguments::add_file): Handle lib groups.
10582 (Input_arguments::start_group): Check we are not in a lib.
10583 (Input_arguments::start_lib): New.
10584 (Input_arguments::end_lib): New.
10585 * options.h (General_options): Add start_lib and end_lib.
10586 (Input_argument::lib_): New.
10587 (Input_argument::lib): New.
10588 (Input_argument::is_lib): New.
10589 (Input_file_lib): New.
10590 (Input_arguments::in_lib_): New.
10591 (Input_arguments::in_lib): New.
10592 (Input_arguments::start_lib): New.
10593 (Input_arguments::end_lib_): New.
10594 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10595 in unused members as preempted.
10596 (Sized_pluginobj::do_should_include_member): New.
10597 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10598 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10599 return the blocker.
10600 (Read_symbols::do_whole_lib_group): New.
10601 (Read_symbols::do_lib_group): New.
10602 (Read_symbols::do_read_symbols): Handle lib groups.
10603 (Read_symbols::get_name): Handle lib groups.
10604 * readsyms.h (Read_symbols): Add an archive member pointer.
10605 (Read_symbols::do_whole_lib_group): New.
10606 (Read_symbols::do_lib_group): New.
10607 (Read_symbols::member_): New.
10608 * script.cc (read_input_script): Update call to queue_soon.
10610 2010-03-19 Doug Kwan <dougkwan@google.com>
10612 * arm.cc (Stub_table::Stub_table): Initialize new data members
10613 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10614 (Stub_table::add_reloc_stub): Assign stub offset and update
10615 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10616 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10618 (Stub_table::update_data_size_and_addralign): Use
10619 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10620 instead of going over all reloc stubs.
10621 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10622 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10623 Stringpool_template::offset_ to size of Stringpool_char.
10624 (Stringpool_template::new_key_offset): Remove code to initialize
10625 Stringpool_template::offset_.
10626 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10627 Stringpool_template::offset_ to zero.
10629 2010-03-15 Doug Kwan <dougkwan@google.com>
10631 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10633 (Stringpool_template::new_key_offset): New method.
10634 (Stringpool_template::add_string): Assign offsets when adding new
10636 (Stringpool_template::set_string_offsets): Do not set string offsets
10637 when not optimizing.
10638 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10640 (Chunked_vector::clear): Clear size_.
10641 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10642 (Chunked_vector::size): Return size_.
10643 (Chunked_vector::push_back): Use size_ to find insert position.
10644 (Chunked_vector::size_): New data member.
10645 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10646 (Stringpool_template::new_key_offset): New method declaration.
10647 (Stringpool_template::offset_): New data member.
10649 2010-03-15 Rafael Espindola <espindola@google.com>
10651 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10652 Add_symbols' constructor.
10653 * readsyms.h (Add_symbols): Remove the input_group member.
10655 2010-03-10 Ian Lance Taylor <iant@google.com>
10657 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10658 target to ask whether a reference to a symbol requires a stack
10660 * target.h (Target::is_call_to_non_split): New function.
10661 (Target::do_is_call_to_non_split): Declare virtual function.
10662 * target.cc: Include "symtab.h".
10663 (Target::do_is_call_to_non_split): New function.
10664 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10666 2010-03-10 Cary Coutant <ccoutant@google.com>
10668 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10669 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10670 (File_read::open[2]): Add whole_file_view_ to list of views.
10671 (File_read::make_view): Remove test of whole_file_view_.
10672 (File_read::find_or_make_view): Create whole_file_view_ if
10674 (File_read::clear_views): Replace bool parameter with enum;
10675 adjust all callers. Don't delete views with permanent data;
10676 do delete cached views and views from archives if
10677 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10678 if clearing the corresponding view.
10679 * fileread.h (File_read::Clear_views_mode): New enum.
10680 (File_read::View::is_permanent_view): New method.
10681 (File_read::clear_views): Replace bool parameter
10682 with enum; adjust all callers.
10683 * options.h (General_options): Change keep_files_mapped option;
10684 add map_whole_files.
10685 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10686 releasing the file.
10687 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10690 2010-03-10 David S. Miller <davem@davemloft.net>
10692 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10694 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10696 * icf.cc (get_section_contents): Add '@' marker after processing the
10699 2010-03-08 Doug Kwan <dougkwan@google.com>
10701 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10702 due to a conversion warning.
10703 (Arm_relobj::update_output_local_symbol_count): Check for local
10704 symbol with unset output index.
10706 2010-03-05 Ian Lance Taylor <iant@google.com>
10708 * options.h (class General_options): Add --spare-dynamic-tags.
10709 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10710 --spare-dynamic-tags.
10712 2010-03-05 Ian Lance Taylor <iant@google.com>
10714 * incremental.cc: Include "libiberty.h".
10716 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10718 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10719 function, is_info_ member.
10720 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10721 (Versions::Versions): Update caller.
10722 (Versions::define_base_version): Likewise.
10723 (Versions::add_def): Likewise.
10725 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10727 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10728 (Scan::possible_function_pointer_reloc): New function.
10729 (Scan::local_reloc_may_be_function_pointer): Change to call
10730 possible_function_pointer_reloc.
10731 (Scan::global_reloc_may_be_function_pointer): Ditto.
10732 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10733 relocations in ".data.rel.ro._ZTV" section.
10734 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10735 * testsuite/icf_safe_so_test.cc: Ditto.
10736 * testsuite/icf_safe_test.cc: Ditto.
10737 * testsuite/icf_safe_test.sh: Ditto.
10739 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10740 Ian Lance Taylor <iant@google.com>
10742 * target-reloc.h (relocate_section): Check the symbol table index
10743 for -1U before setting the local symbol index.
10744 (scan_relocatable_relocs): If copying the relocation, record that
10745 the local symbol is required.
10746 * object.h (Symbol_value::is_output_symtab_index_set): New
10748 (Symbol_value::may_be_discarded_from_output_symtab): New
10750 (Symbol_value::has_output_symtab_entry): New function.
10751 (Symbol_value::needs_output_symtab_entry): Remove.
10752 (Symbol_value::output_symtab_index): Make sure the symbol index is
10754 (Symbol_value::set_output_symtab_index): Make sure the symbol
10755 index is not set. Make sure the new index is valid.
10756 (Symbol_value::set_must_have_output_symtab_entry): New function.
10757 (Symbol_value::has_output_dynsym_entry): New function.
10758 (Symbol_value::set_output_dynsym_index): Make sure the new index
10760 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10761 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10762 local symbol if permitted.
10763 (Sized_relobj::do_finalize_local_symbols): Call
10764 is_output_symtab_index_set rather than needs_output_symtab_entry.
10765 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10766 rather than needs_output_symtab_entry. Call
10767 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10768 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10769 is_output_symtab_index_set rather than needs_output_symtab_entry.
10770 * testsuite/discard_locals_relocatable_test.c: New file.
10771 * testsuite/discard_locals_test.sh: Test -r.
10772 * testsuite/Makefile.am (check_DATA): Add
10773 discard_locals_relocatable_test1.syms,
10774 discard_local_relocatable_test2.syms.
10775 (MOSTLYCLEANFILES): Likewise. Also add
10776 discard_locals_relocatable_test1.lout and
10777 discard_locals_relocatable_test2.out.
10778 (discard_locals_relocatable_test1.syms): New target.
10779 (discard_locals_relocatable_test.o): New target.
10780 (discard_locals_relocatable_test1.out): New target.
10781 (discard_locals_relocatable_test2.syms): New target.
10782 (discard_locals_relocatable_test2.out): New target.
10783 (various): Add missing ../ld-new dependencies.
10784 * testsuite/Makefile.in: Rebuild.
10786 2010-03-03 Nick Clifton <nickc@redhat.com>
10788 * po/fi.po: New Finnish translation.
10790 2010-03-01 Doug Kwan <dougkwan@google.com>
10792 * layout.cc (Layout::Layout): Force section types of .init_array*,
10793 .preinit_array* and .fini_array* sections.
10794 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10795 Fix check of return value of std::string::find.().
10796 (Output_section::Input_section_sort_compare::operator()): Remove
10797 comment about .init_array.
10798 (Output_section::Input_section_sort_init_fini_compare::operator()):
10800 (Output_section::sort_attached_input_sections): Handle .init_array
10801 and .fini_array specially.
10802 * output.h (Output_section::Inut_section_sort_compare): Update
10804 (Output_section::Input_section_sort_init_fini_compare): New struct.
10806 2010-02-26 Doug Kwan <dougkwan@google.com>
10808 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10809 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10810 * testsuite/debug_msg.sh: Avoid matching source line number for
10811 use of global variable undef_int.
10813 2010-02-26 Doug Kwan <dougkwan@google.com>
10815 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10816 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10817 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10818 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10819 * options.cc (General_options::General_options): Initialize member
10821 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10822 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10823 and rm_no_fix_v4bx.stdout
10824 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10825 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10826 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10827 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10828 and arm_no_fix_v4bx.
10829 * Makefile.in: Regenerate.
10830 * testsuite/arm_fix_v4bx.s: New file.
10831 * testsuite/arm_fix_v4bx.sh: Ditto.
10833 2010-02-24 Doug Kwan <dougkwan@google.com>
10835 * arm.cc (Target_arm::got_section): Make the .got section the first
10836 non RELRO section in the data segment.
10837 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10838 suffixes of section names.
10840 2010-02-24 Doug Kwan <dougkwan@google.com>
10842 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10843 flags and attributes merging if an input file is a binary file.
10844 * fileread.cc (Input_file::open): Record format of original file.
10845 * fileread.h (Input_file::Format): New enum type.
10846 (Input_file::Input_file): Initialize data member format_.
10847 (Input_file::format): New method definition.
10848 (Input_file::format_):: New data member.
10850 2010-02-24 Doug Kwan <dougkwan@google.com>
10852 * arm.cc (Arm_output_data_got): New class.
10853 (ARM_TCB_SIZE): New constant
10854 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10855 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10856 If user uses a script with a SECTIONS clause, issue only a warning
10857 for a misplaced EXIDX input section. Otherwise, issue an error.
10858 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
10859 garbage collection.
10860 (Target_arm::got_mode_index_entry): Handle static linking.
10861 (Target_arm::Scan::local): Ditto.
10862 (Target_arm::Scan::global): Ditto.
10863 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10864 all incorrectly implemented relocations.
10865 (Target_arm::fix_exidx_coverage): Pass layout to
10866 Arm_output_section::fix_exidx_coverage.
10867 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10868 from ".ARM.exidx." and ".ARM.extab.".
10870 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10872 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10873 section if it does not already exist.
10874 * attributes.cc (Attributes_section_data::Attributes_section_data):
10875 Don't crash if size is zero.
10877 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10878 Ian Lance Taylor <iant@google.com>
10880 * gold.cc (queue_middle_tasks): If no input files were opened,
10882 * workqueue.h (Task_function::Task_function): Assert that there is
10885 2010-02-22 Doug Kwan <dougkwan@google.com>
10887 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10888 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10889 types to avoid warnings due to different uint64_t implementations
10890 on different hosts.
10892 2010-02-21 Doug Kwan <dougkwan@google.com>
10894 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10895 handling of the maximum backward branch offset.
10896 (Arm_relocate_functions::thumb_branch_common): Ditto.
10897 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10898 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
10899 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
10900 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10901 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10902 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10903 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10904 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10905 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10906 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10907 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10908 thumb2_bl_out_of_range.o): New rules.
10909 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10910 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10911 thumb2_bl_out_of_range
10912 * testsuite/Makefile.in: Regenerate.
10913 * testsuite/arm_bl_in_range.s: New file.
10914 * testsuite/arm_bl_out_of_range.s: Ditto.
10915 * testsuite/arm_branch_in_range.sh: Ditto.
10916 * testsuite/arm_branch_range.t: Ditto.
10917 * testsuite/thumb2_branch_range.t: Ditto.
10918 * testsuite/thumb_bl_in_range.s: Ditto.
10919 * testsuite/thumb_bl_out_of_range.s: Ditto.
10920 * testsuite/thumb_branch_range.t: Ditto.
10922 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10924 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10925 Add reloc offset information.
10926 * icf.cc (get_section_contents): Change iterators to point to the new
10927 vectors. Add reloc offset information to the contents.
10928 * icf.h (Icf::Sections_reachable_info): New typedef.
10929 (Icf::Sections_reachable_list): New typedef.
10930 (Icf::Offset_info): New typedef.
10931 (Icf::Reloc_info): New struct typedef.
10932 (Icf::Reloc_info_list): New typedef.
10933 (Icf::symbol_reloc_list): Delete method.
10934 (Icf::addend_reloc_list): Delete method.
10935 (Icf::section_reloc_list): Delete method.
10936 (Icf::reloc_info_list): New method.
10937 (Icf::reloc_info_list_): New member.
10939 2010-02-19 Doug Kwan <dougkwan@google.com>
10941 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10942 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10943 * arm.cc (Arm_relocation_functions): New forward declaration.
10944 (Target_arm::Target_arm): Initialize new data members
10945 got_mod_index_offset_ and tls_base_symbol_defined_.
10946 (Target_arm::Relocate::relocate_tls): New method.
10947 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10948 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10950 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
10951 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10952 (Target_arm::got_mod_index_offset_,
10953 Target_arm::tls_base_symbol_defined_): New data members.
10954 (Target_arm::Scan::local, Target::Scan::global,
10955 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10958 2010-02-18 Doug Kwan <dougkwan@google.com>
10960 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10961 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10962 text section as a parameter becuase some broken tools may not set
10963 the link in section header.
10964 (Target_arm::has_got_section): New method.
10965 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10966 without any mapping symbol as data only. Remove warning.
10967 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10968 link in its section header, try to discover the link by inspecting the
10969 REL31 relocation at the beginning of the section.
10970 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10972 (Target_arm::Scan::global): Treat any reference to the symbol
10973 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10975 2010-02-12 Sriraman Tallam <tmsriram@google.com>
10977 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10978 (Scan::global_reloc_may_be_function_pointer): New function.
10979 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10980 (Scan::global_reloc_may_be_function_pointer): New function.
10981 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10982 (Scan::global_reloc_may_be_function_pointer): New function.
10983 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10984 (Scan::global_reloc_may_be_function_pointer): New function.
10985 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10986 (Scan::global_reloc_may_be_function_pointer): New function.
10987 (Scan::possible_function_pointer_reloc): New function.
10988 (Target_x86_64::can_check_for_function_pointers): New function.
10989 * gc.h (gc_process_relocs): Scan relocation types to determine if
10990 function pointers were taken for targets that support it.
10991 * icf.cc (Icf::find_identical_sections): Include functions for
10992 folding in safe ICF whose pointer is not taken.
10993 * icf.h (Secn_fptr_taken_set): New typedef.
10994 (fptr_section_id_): New member.
10995 (section_has_function_pointers): New function.
10996 (set_section_has_function_pointers): New function.
10997 (check_section_for_function_pointers): New function.
10998 * options.h: Fix comment for safe ICF option.
10999 * target.h (can_check_for_function_pointers): New function.
11000 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11001 Modify icf_safe_test for X86-64.
11002 * testsuite/Makefile.in: Regenerate.
11003 * testsuite/icf_safe_so_test.cc: New file.
11004 * testsuite/icf_safe_so_test.sh: New file.
11005 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11006 (main): Change to take pointer to function kept_func_3.
11007 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11008 folding is done correctly for X86-64.
11010 2010-02-12 David S. Miller <davem@davemloft.net>
11012 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11013 is_symbolless parameter.
11014 (Output_reloc<SHT_REL>::is_symbolless): New.
11015 (Output_reloc<SHT_REL>::is_symbolless_): New.
11016 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11017 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11018 (Output_reloc<SHT_RELA>::is_symbolless): New.
11019 (Output_data_reloc::add_global): Handle is_symbolless.
11020 (Output_data_reloc::add_global_relative): Likewise.
11021 (Output_data_reloc::add_local): Likewise.
11022 (Output_data_reloc::add_local_relative): Likewise.
11023 (Output_data_reloc::add_symbolless_global_addend): New.
11024 (Output_data_reloc::add_symbolless_local_addend): New.
11025 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11027 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11028 instead of ->is_relative_
11029 (Output_reloc::write): Likewise.
11030 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11031 (Output_reloc::write_rel): Simplify.
11033 * sparc.cc (Target_sparc::Scan::local): Use
11034 ->add_symbolless_local_addend as needed.
11035 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11036 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11037 based upon relocation offset.
11039 2010-02-11 Doug Kwan <dougkwan@google.com>
11041 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11042 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11043 beginning of function.
11044 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11045 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11046 parameter is_32bit in calls to should_apply_static_reloc.
11047 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11048 (check_DATA): Add arm_abs_global.stdout.
11049 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11050 arm_abs_global.stdout): New rules.
11051 (MOSTLLYCLEANFILES): Add arm_abs_global
11052 * Makefile.in: Regenerate.
11053 * testsuite/arm_abs_global.s: New file.
11054 * testsuite/arm_abs_global.sh: Ditto.
11055 * testsuite/arm_abs_lib.s: Ditto.
11057 2010-02-11 Ian Lance Taylor <iant@google.com>
11059 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11061 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11062 Allocate_commons_task first.
11063 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11064 task, rather than symtab_lock_.
11065 (Gc_process_relocs::~Gc_process_relocs): New function.
11066 (Gc_process_relocs::is_runnable): Check this_blocker_.
11067 (Gc_process_relocs::locks): Use next_blocker_ rather than
11069 (Scan_relocs::~Scan_relocs): New function.
11070 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11072 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11074 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11075 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11076 constructor accordingly.
11077 (class Gc_process_relocs): Likewise.
11078 (class Scan_relocs): Likewise.
11079 * common.h (class Allocate_commons_task): Remove symtab_lock_
11080 field, and corresponding constructor parameter.
11081 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11083 (Allocate_commons_task::locks): Likewise.
11085 2010-02-11 Ian Lance Taylor <iant@google.com>
11087 * gold-threads.h (class Once): Define.
11088 (class Initialize_lock): Rewrite as child of Once.
11089 * gold-threads.cc (class Once_initialize): Define.
11090 (once_pointer_control): New static variable.
11091 (once_pointer, once_arg): New static variables.
11092 (c_run_once): New static function.
11093 (Once::Once, Once::run_once, Once::internal_run): New functions.
11094 (class Initialize_lock_once): Remove.
11095 (initialize_lock_control): Remove.
11096 (initialize_lock_pointer): Remove.
11097 (initialize_lock_once): Remove.
11098 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11099 (Initialize_lock::initialize): Rewrite.
11100 (Initialize_lock::do_run_once): New function.
11101 * archive.cc (Archive::interpret_header): Only clear name if it is
11103 * fileread.cc: Include "gold-threads.h"
11104 (file_counts_lock): New static variable.
11105 (file_counts_initialize_lock): Likewise.
11106 (File_read::release): Only increment counts when using --stats.
11107 Use a lock around the increment.
11108 * parameters.cc (class Set_parameters_target_once): Define.
11109 (set_parameters_target_once): New static variable.
11110 (Parameters::Parameters): Move here from parameters.h.
11111 (Parameters::set_target): Rewrite.
11112 (Parameters::set_target_once): New function.
11113 (Parameters::clear_target): Move here and rewrite.
11114 * parameters.h (class Parameters): Update declarations. Add
11115 set_parameters_target_once_ field.
11116 (Parameters::Parameters): Move to parameters.cc.
11117 (Parameters::clear_target): Likewise.
11118 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11120 (Start_group::~Start_group): New function.
11121 (Start_group::is_runnable): New function.
11122 (Start_group::locks, Start_group::run): New functions.
11123 (Finish_group::run): Change saw_undefined to size_t.
11124 * readsyms.h (class Start_group): Define.
11125 (class Finish_group): Change saw_undefined_ field to size_t.
11126 (Finish_group::Finish_group): Remove saw_undefined and
11127 this_blocker parameters. Change all callers.
11128 (Finish_group::set_saw_undefined): New function.
11129 (Finish_group::set_blocker): New function.
11130 * symtab.h (class Symbol_table): Change saw_undefined to return
11131 size_t. Change saw_undefined_ field to size_t.
11132 * target-select.cc (Set_target_once::do_run_once): New function.
11133 (Target_selector::Target_selector): Initialize set_target_once_
11134 field. Don't initialize lock_ and initialize_lock_ fields.
11135 (Target_selector::instantiate_target): Rewrite.
11136 (Target_selector::set_target): New function.
11137 * target-select.h (class Set_target_once): Define.
11138 (class Target_selector): Update declarations. Make
11139 Set_target_once a friend. Remove lock_ and initialize_lock_
11140 fields. Add set_target_once_ field.
11142 2010-02-10 Ian Lance Taylor <iant@google.com>
11144 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11145 queueing any tasks.
11146 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11147 (queue_middle_tasks): Add all blockers before queueing any tasks.
11148 (queue_final_tasks): Likewise.
11149 * token.h (Task_token::add_blockers): New function.
11150 * object.h (Input_objects::number_of_relobjs): New function.
11152 2010-02-10 Ian Lance Taylor <iant@google.com>
11154 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11155 shared, not if not position independent.
11156 * x86_64.cc (Relocate::relocate_tls): Likewise.
11157 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11158 (tls_pie_pic_test): New target.
11159 * testsuite/Makefile.in: Rebuild.
11161 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11162 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11163 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11164 * testsuite/Makefile.in: Rebuild.
11166 2010-02-09 David S. Miller <davem@davemloft.net>
11168 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11169 R_SPARC_RELATIVE using ->add_local_relative().
11170 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11172 * output.h (Output_data_dynamic::add_section_size): New method
11173 that takes two Output_data objects.
11174 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11175 entry param. Handle it in initializers.
11176 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11177 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11178 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11180 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11181 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11182 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11183 for dynrel_includes_plt.
11184 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11185 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11186 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11188 (Target_sparc::do_finalize_sections): Update to pass true for
11189 dynrel_includes_plt.
11190 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11191 output before .rela.plt
11192 (Target_powerpc::do_finalize_sections): Update to pass true for
11193 dynrel_includes_plt when 32-bit.
11195 2010-02-08 Doug Kwan <dougkwan@google.com>
11197 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11199 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11200 Arm_relobj::scan_section_for_cortex_a8_stubs,
11201 Arm_relobj::do_relocation_section): Instead of calling
11202 Output_section::output_address, use faster
11203 Arm_relobj::simple_input_section_output_address.
11205 2010-02-08 David S. Miller <davem@davemloft.net>
11207 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11208 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11209 relocation helper function.
11211 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11212 just like R_SPARC_GOT{10,13,22}.
11213 (Target_sparc::Scan::local): Likewise.
11214 (Target_sparc::Relocate:relocate): Likewise.
11216 2010-02-06 Ian Lance Taylor <iant@google.com>
11218 * configure.ac: Rewrite targetobjs duplicate removal code to use
11219 only shell constructs.
11220 * configure: Rebuild.
11222 2010-02-05 Doug Kwan <dougkwan@google.com>
11225 * arm.cc (Arm_relobj::section_is_scannable): New method.
11226 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11227 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11229 2010-02-04 Doug Kwan <dougkwan@google.com>
11232 * arm-reloc-property.cc (cstdio): Include.
11233 * configure.ac (targetobjs): Remove duplicates.
11234 * configure: Regenerate.
11235 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11236 big and little endian version for a given address size.
11238 2010-02-03 Doug Kwan <dougkwan@google.com>
11240 * arm-reloc-property.cc
11241 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11243 * arm-reloc-property.h
11244 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11245 New method definition.
11246 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11248 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11250 (GOT_PREL): Change implemented to Y.
11251 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11252 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11253 (Arm_relocate_functions::movw_abs_nc): Remove method.
11254 (Arm_relocate_functions::movt_abs): Ditto.
11255 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11256 (Arm_relocate_functions::thm_movt_abs): Ditto.
11257 (Arm_relocate_functions::movw_rel_nc): Ditto.
11258 (Arm_relocate_functions::movw_rel): Ditto.
11259 (Arm_relocate_functions::movt_rel): Ditto.
11260 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11261 (Arm_relocate_functions:thm_movw_rel): Ditto.
11262 (Arm_relocate_functions:thm_movt_rel): Ditto.
11263 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11264 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11265 New method definitions.
11266 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11267 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11268 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11269 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11270 (Target_arm::Relocate::relocate): Check for non-static or
11271 unimplemented relocation code and exit early. Change calls to
11272 Target_arm::reloc_uses_thumb_bit and
11273 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11274 instead. Refactor code to handle similar relocations to increase
11275 code sharing. Remove check for unsupported relocation code in switch
11277 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11278 relocation property table to find out size. Change error message to
11279 print out the name of a relocation code instead of the numeric value.
11280 (Target_arm::scan_reloc_for_stub): Use relocation property table
11281 instead of calling Target_arm::reloc_uses_thumb_bit().
11283 2010-02-02 Doug Kwan <dougkwan@google.com>
11285 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11286 types of relaxed input section.
11288 2010-02-02 Doug Kwan <dougkwan@google.com>
11290 * Makefile.am (HFILES): Add arm-reloc-property.h.
11292 (TARGETSOURCES): Add arm-reloc-property.cc
11293 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11294 (libgold_a_SOURCES): $(DEFFILES)
11295 * Makefile.in: Regenerate.
11296 * arm-reloc-property.cc: New file.
11297 * arm-reloc-property.h: New file.
11298 * arm-reloc.def: New file.
11299 * arm.cc: Update comments.
11300 (arm-reloc-property.h): New included header.
11301 (arm_reloc_property_table): New global variable.
11302 (Target_arm::do_select_as_default_target): New method definition.
11303 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11304 arm-reloc-property to targ_extra_obj.
11305 * parameters.cc (set_parameters_target): Call
11306 Target::select_as_default_target().
11307 * target.h (Target::select_as_default_target): New method definition.
11308 (Target::do_select_as_default_target): Same.
11310 2010-02-01 Doug Kwan <dougkwan@google.com>
11312 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11313 first_output_text_section_.
11314 (Arm_exidx_fixup::first_output_text_section): New method definition.
11315 (Arm_exidx_fixup::first_output_text_section_): New data member.
11316 (Arm_exidx_fixup::process_exidx_section): Record the first text
11317 output section seen.
11318 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11319 and entsize in output section header.
11321 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11323 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11324 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11325 (Arm_relocate_functions::thm_alu11): New Method.
11326 (Arm_relocate_functions::thm_pc8): New Method.
11327 (Arm_relocate_functions::thm_pc12): New Method.
11328 (Target_arm::Scan::local): Handle the relocations.
11329 (Target_arm::Scan::global): Likewise.
11330 (Target_arm::Relocate::relocate): Likewise.
11331 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11333 2010-01-29 Doug Kwan <dougkwan@google.com>
11335 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11336 of relocation types as ld.
11338 2010-01-29 Doug Kwan <dougkwan@google.com>
11340 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11342 (Arm_relocate_functions::thumb_branch_common): Ditto.
11343 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11344 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11345 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11346 Arm_relocate_functions::jump24): Remove.
11347 (Target_arm::Relocate::relocate): Adjust code to call
11348 Arm_relocation_functions::arm_branch_common and
11349 Arm_relocation_functions::thumb_branch_common instead of their removed
11350 wrappers. Merge switch-cases together to reduce source code size.
11352 2010-01-29 Doug Kwan <dougkwan@google.com>
11354 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11355 output_local_symbol_count_needs_update_.
11356 (Arm_relobj::output_local_symbol_count_needs_update,
11357 Arm_relobj::set_output_local_symbol_count_needs_update,
11358 Arm_relobj::update_output_local_symbol_count): New methods.
11359 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11361 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11362 of pointed function as in a R_ARM_PREL31 relocation.
11363 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11364 for output local symbol count updating.
11365 (Target_arm::do_relax): Update output local symbol counts in objects
11367 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11369 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11371 * arm.cc: Added support for the ARM relocations:
11372 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11373 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11374 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11376 (Arm_relocate_functions::movw_rel): New method.
11377 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11378 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11380 (Arm_relocate_functions::thm_movw_rel): New method.
11381 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11383 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11385 (Target_arm::Scan::global): Likewise.
11386 (Target_arm::Relocate::relocate): Likewise.
11387 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11390 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11392 * arm.cc: Added support for ARM group relocations.
11393 (Target_arm::reloc_needs_sym_origin): New method.
11394 (Arm_relocate_functions::calc_grp_kn): New method.
11395 (Arm_relocate_functions::calc_grp_residual): New method.
11396 (Arm_relocate_functions::calc_grp_gn): New method.
11397 (Arm_relocate_functions::arm_grp_alu): New Method.
11398 (Arm_relocate_functions::arm_grp_ldr): New Method.
11399 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11400 (Arm_relocate_functions::arm_grp_ldc): New Method.
11401 (Target_arm::Scan::local): Handle the ARM group relocations.
11402 (Target_arm::Scan::global): Likewise.
11403 (Target_arm::Relocate::relocate): Likewise.
11404 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11407 2010-01-26 Doug Kwan <dougkwan@google.com>
11409 * arm.cc (set): Include.
11410 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11412 (Arm_output_section::Text_section_list): New type.
11413 (Arm_output_section::append_text_sections_to_list): New method.
11414 (Arm_output_section::fix_exidx_coverage): Ditto.
11415 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11416 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11417 Relobj::set_section_offset() instead of
11418 Sized_relobj::invalidate_section_offset().
11419 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11420 parameter for section headers. Ignore relocation sections for
11421 unallocated sections and EXIDX sections.
11422 (Target_arm::fix_exidx_coverage): New method.
11423 (Target_arm::output_section_address_less_than): New type.
11424 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11425 linked text section instead of the EXIDX section.
11426 (Arm_output_section::create_stub_group): Add an assertion to check
11427 that this is not an EXIDX output section.
11428 (Arm_output_section::append_text_sections_to_list): New method.
11429 (Arm_output_section::fix_exidx_coverage): Ditto.
11430 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11431 Arm_relobj::section_needs_reloc_stub_scanning.
11432 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11434 (Target_arm::fix_exidx_coverage): New method.
11435 * object.h (Relobj::set_output_section): New method.
11436 (Sized_relobj::invalidate_section_offset): Remove method.
11437 (Sized_relobj::do_invalidate_section_offset): Remove method.
11438 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11440 2010-01-25 Doug Kwan <dougkwan@google.com>
11442 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11443 Fix warning due to signed and unsigned comparison on a 32-bit host.
11445 2010-01-22 Doug Kwan <dougkwan@google.com>
11447 * arm.cc (Target_arm::do_relax): Record an output section for section
11448 offset adjustment it contains any stub table that has changed.
11449 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11450 offsets in an output section if necessary.
11451 * output.cc (Output_section::Output_section): Initialize
11452 section_offsets_need_adjustments_.
11453 (Output_section::add_input_section_for_script): Renamed to
11454 Output_section::add_simple_input_section.
11455 (Output_section::save_states): Add a comment.
11456 (Output_section::discard_states): New method defintion.
11457 (Output_section::adjust_section_offsets): Same.
11458 * output.h (Output_section::add_input_section_for_script): Renamed to
11459 Output_section::add_simple_input_section.
11460 (Output_section::discard_states): New method declaration.
11461 (Output_section::adjust_section_offsets): Same.
11462 (Output_section::section_offsets_need_adjustment,
11463 Output_section::set_section_offsets_need_adjustment): New method
11465 (Output_section::section_offsets_need_adjustment_): New data member.
11466 * script-sections.cc
11467 (Output_section_element_input::set_section_address): Adjust code for
11468 renaming of Output_section::add_input_section_for_script.
11469 (Orphan_output_section::set_section_address): Same.
11471 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11473 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11474 Fix_v4bx enum values .
11475 * gold/options.h (General_options): New option definitions.
11476 (General_options::fix_v4bx): New method.
11477 (General_options::Fix_v4bx): New enum.
11478 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11479 (General_options::parse_fix_v4bx_interworking): New method.
11481 2010-01-22 Doug Kwan <dougkwan@google.com>
11483 * arm.cc (Arm_exidx_fixup): New class.
11485 2010-01-21 Doug Kwan <dougkwan@google.com>
11487 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11489 (Arm_exidx_section_offset_map): New type.
11491 2010-01-21 Doug Kwan <dougkwan@google.com>
11493 * arm.cc (Arm_exidx_input_section): New class.
11494 (Arm_relobj::exidx_input_section_by_link,
11495 Arm_relobj::exidx_input_section_by_shndx,
11496 Arm_relobj::make_exidx_input_section): New methods.
11497 (read_arm_attributes_section): Remove.
11498 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11499 information about them.
11500 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11503 2010-01-20 Doug Kwan <dougkwan@google.com>
11505 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11506 Input_section_specifier to Section_id.
11507 (Target_arm::new_arm_input_section: Adjust code for change of key
11509 (Target_arm::find_arm_input_section): Ditto.
11510 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11511 (Section_id): Remove.
11512 (Garbage_collection::Section_id_hash): Remove.
11513 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11514 (Section_id): Remove.
11515 (Icf::Section_id_hash): Remove.
11516 * object.h (Section_id, Const_section_id, Section_id_hash,
11517 Const_section_id_hash): New type definitions.
11518 * output.cc (Output_section::add_relaxed_input_section): Change to
11519 use Const_section_id instead of Input_section_specifier as key type.
11520 (Output_section::add_merge_input_section): Ditto.
11521 (Output_section::build_relaxation_map): Change to use Section_id
11522 instead of Input_section_specifier as key type.
11523 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11525 (Output_section::convert_input_sections_to_relaxed_sections): Change
11526 to use Const_section_id instead of Input_section_specifier as key type.
11527 (Output_section::find_merge_section): Ditto.
11528 (Output_section::find_relaxed_input_section): Ditto.
11529 * output.h (Input_section_specifier): Remove class.
11530 (Output_section::Output_section_data_by_input_section_map): Change
11531 key type to Const_section_id.
11532 (Output_section::Output_relaxed_input_section_by_input_section_map):
11534 (Output_section::Relaxation_map): Change key type to Section_id.
11536 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11538 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11539 (class Arm_v4bx_stub): New class.
11540 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11541 (Stub_factory::make_arm_v4bx_stub): New method.
11542 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11543 (Stub_table::empty): Handle v4bx stubs.
11544 (Stub_table::add_arm_v4bx_stub): New method.
11545 (Stub_table::find_arm_v4bx_stub): New method.
11546 (Arm_relocate_functions::v4bx): New method.
11547 (Target_arm::fix_v4bx): New method.
11548 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11549 (Stub_table::relocate_stubs): Likewise.
11550 (Stub_table::do_write): Likewise.
11551 (Stub_table::update_data_size_and_addralign): Likewise.
11552 (Stub_table::finalize_stubs): Likewise.
11553 (Target_arm::Scan::local): Likewise.
11554 (Target_arm::Scan::global): Likewise.
11555 (Target_arm::do_finalize_sections): Likewise.
11556 (Target_arm::Relocate::relocate): Likewise.
11557 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11559 (Target_arm::scan_reloc_for_stub): Likewise.
11560 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11562 2010-01-19 Ian Lance Taylor <iant@google.com>
11564 * output.cc (Output_section_headers::do_sized_write): Write large
11565 segment count to sh_info field.
11566 (Output_file_header::do_sized_write): For large segment count,
11567 write PN_XNUM to e_phnum field.
11569 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11571 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11572 (Arm_relocate_functions::thm_jump8): New function.
11573 (Arm_relocate_functions::thm_jump11): New function.
11574 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11576 (Target_arm::Scan::global): Likewise.
11577 (Target_arm::Relocate::relocate): Likewise.
11578 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11581 2010-01-14 Doug Kwan <dougkwan@google.com>
11583 * arm.cc (map, utility): Include headers.
11584 (Target_arm::apply_cortex_a8_workaround): New method.
11585 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11586 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11587 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11588 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11589 the --[no-]fix-cortex-a8 command line options.
11590 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11591 (Target_arm::relocate_stub): Use addend in instruction template.
11592 * options.h (DEFINE_bool): Set the user-set flag.
11593 (General_options): Add --[no-]-fix-cortex options.
11594 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11595 : Update fast look-up map after conversion.
11597 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11599 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11600 in the first pass of do_layout.
11602 2010-01-13 Doug Kwan <dougkwan@google.com>
11604 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11605 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11606 apparent compiler problem of not folding static constant integral
11607 data members of elfcpp::Elf_sizes<32>.
11609 2010-01-13 Doug Kwan <dougkwan@google.com>
11611 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11612 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11613 Arm_relobj::scan_section_for_cortex_a8_erratum,
11614 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11615 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11616 sections to scan for relocation stubs into a new method
11617 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11618 relocation and Cortex-A8 stub scanning.
11619 (Target_arm::do_relax): Force stubs to be after stubbed sections
11620 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11621 the beginning of a new relaxation pass. Update a comment.
11622 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11624 2010-01-12 Ian Lance Taylor <iant@google.com>
11626 * target-reloc.h (visibility_error): New inline function.
11627 (relocate_section): Call visibility_error.
11628 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11629 (MOSTLYCLEANFILES): Likewise.
11630 (protected_4_pic.o, protected_3.err): New targets.
11631 * testsuite/protected_4.cc: New file.
11633 2010-01-12 Doug Kwan <dougkwan@google.com>
11635 * arm.cc (Cortex_a8_reloc): New class.
11636 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11637 and cortex_a8_relocs_info_.
11638 (Target_arm::fix_cortex_a8): New method definition.
11639 (Target_arm::Cortex_a8_relocs_info): New type.
11640 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11641 New data member declarations.
11642 (Target_arm::scan_reloc_for_stub): Record information about
11643 relocations for THUMB branches that might be exempted from the
11644 Cortex-A8 workaround.
11645 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11646 at the beginning of a relaxation pass.
11648 2010-01-12 Doug Kwan <dougkwan@google.com>
11650 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11651 (Arm_relobj::Mapping_symbol_position,
11652 Arm_reloj::Mapping_symbol_position_less,
11653 Arm_relobj::Mapping_symbols_info): New types.
11654 (Target_arm::is_mapping_symbol_name): New method definition.
11655 (Arm_relobj::do_count_local_symbols): Save information about mapping
11658 2010-01-11 Doug Kwan <dougkwan@google.com>
11660 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11661 Arm_relocate_functions::thumb32_branch_upper,
11662 Arm_relocate_functions::thumb32_branch_lower,
11663 Arm_relocate_functions::thumb32_cond_branch_offset,
11664 Arm_relocate_functions::thumb32_cond_branch_upper,
11665 Arm_relocate_functions::thumb32_cond_branch_lower,
11666 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11667 branch offset encoding.
11668 (Arm_relocate_functions::thumb_branch_common): Use new branch
11669 offset encoding methods to avoid code duplication.
11670 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11671 (Stub_addend_reader::operator()): Use new branch encoding method
11672 to avoid code duplication.
11674 2010-01-11 Doug Kwan <dougkwan@google.com>
11676 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11677 (Target_arm::do_finalize_sections): Define special EXIDX section
11678 symbols only if referenced.
11679 * gc.h (Garbage_collection::add_reference): New method.
11680 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11683 2010-01-11 Ian Lance Taylor <iant@google.com>
11685 * script.cc (Version_script_info::build_expression_list_lookup):
11686 Change complaing about duplicate wildcard match from error to
11689 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11691 (Version_script_info::Version_script_info): Initialize globs_,
11692 default_version_, default_is_global_, and exact_. Don't
11693 initialize globals_ or locals_.
11694 (Version_script_info::build_lookup_tables): Build local symbols
11696 (Version_script_info::unquote): New function.
11697 (Version_script_info::add_exact_match): New function.
11698 (Version_script_info::build_expression_list_lookup): Remove lookup
11699 parameter. Add is_global parameter. Change all callers. Handle
11700 wildcard pattern specially. Unquote pattern. Call
11702 (Version_script_info::get_name_to_match): New function.
11703 (Version_script_info::get_symbol_version): New function.
11704 (Version_script_info::get_symbol_version_helper): Remove.
11705 (Version_script_info::check_unmatched_names): Call unquote.
11706 * script.h (class Version_script_info): Change get_symbol_version
11707 to be non-inline and add is_global parameter; change all callers.
11708 Rewrite symbol_is_local. Update declarations. Define struct
11709 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11710 Remove globals_ and locals_ members. Add exact_, globs_,
11711 default_version_, is_global_.
11712 (Version_script_info::Glob): Remove pattern, add expression and
11713 is_global. Update constructor. Change all callers.
11714 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11716 (Versions::symbol_section_contents): If a symbol is undefined, or
11717 defined in a dynamic object, set the version index to
11719 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11721 (Symbol_table::add_from_pluginobj): Likewise.
11722 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11724 2010-01-11 Doug Kwan <dougkwan@google.com>
11726 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11727 (incremental_dump_LDADD): Add linking option for libintl.
11728 * Makefile.in: Regenerate.
11730 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11733 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11735 * testsuite/Makefile.in: Regenerated.
11737 2010-01-10 Doug Kwan <dougkwan@google.com>
11739 * options.h (DEFINE_var): Use parentheses around argument varname__
11740 in macro body to avoid any unintended subsequent substitutions.
11742 2010-01-10 Ian Lance Taylor <iant@google.com>
11744 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11745 candidates before doing symbol resolution.
11747 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11748 ODR candidates if only one is weak.
11750 2010-01-08 Ian Lance Taylor <iant@google.com>
11752 * script.cc (Version_script_info::build_expression_list_lookup):
11753 Don't warn about ambiguous version, just record the ambiguity.
11754 (Version_script_info::get_symbol_version_helper): Give error if
11755 version is ambiguous.
11757 2010-01-08 Doug Kwan <dougkwan@google.com>
11759 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11760 prev_data_size_ and prev_addralign_. Remove initializer for
11761 deleted data member has_been_changed_.
11762 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11763 to determine if the table is empty.
11764 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11766 (Stub_table::add_reloc_stub): Define method in class definition
11767 instead of just declaring it there.
11768 (Stub_table::add_cortex_a8_stub): New method definition.
11769 (Stub_table::update_data_size_and_addralign): Ditto.
11770 (Stub_table::finalize_stubs): Ditto.
11771 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11772 (Stub_table::do_addralign_): Return address alignment in the
11773 (Stub_table::do_reset_address_and_file_offset): Define method in
11774 class definition instead of declaring it there. Set current data
11775 size to be the data size of the previous pass.
11776 (Stub_table::set_final_data_size): Use current data size as the
11778 (Stub_table::relocate_stub): Change parameter type of stub from
11779 Reloc_stub pointer to Stub pointer.
11780 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11781 (Stub_table::Cortex_a8_stub_list): New typedef.
11782 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11783 Stub_table::prev_addralign_): New data member.
11784 (Arm_relobj::Arm_relobj): Initialize data member
11785 section_has_cortex_a8_workaround_.
11786 (Arm_relobj::section_has_cortex_a8_workaround,
11787 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11789 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11791 (Target_arm::relocate_stub): Change parameter type of stub from
11792 Reloc_stub pointer to Stub pointer.
11793 (Insn_template::size, Insn_template::alignment): Handle
11794 THUMB16_SPECIAL_TYPE.
11795 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11796 Stub_table::update_data_size_and_addralign,
11797 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11799 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11800 (Stub_table::do_write): Ditto.
11801 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11803 2010-01-08 Ian Lance Taylor <iant@google.com>
11806 * symtab.h (class Symbol): Remove fields is_target_special_ and
11807 has_plt_offset_. Add field is_defined_in_discarded_section_.
11808 (Symbol::is_defined_in_discarded_section): New function.
11809 (Symbol::set_is_defined_in_discarded_section): New function.
11810 (Symbol::has_plt_offset): Rewrite.
11811 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11812 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11813 Don't initialize is_target_special_ or has_plt_offset_.
11814 Initialize is_defined_in_discarded_section_.
11815 (Symbol_table::add_from_relobj): If appropriate, set
11816 is_defined_in_discarded_section.
11817 * resolve.cc (Symbol::override_base_with_special): Don't test
11818 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11819 * target-reloc.h (relocate_section): Do special handling for
11820 symbols defined in discarded sections for global symbols as well
11823 2010-01-08 Ian Lance Taylor <iant@google.com>
11825 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11826 the SHT_SYMTAB case.
11828 2010-01-08 Ian Lance Taylor <iant@google.com>
11830 * object.cc (Sized_relobj::do_layout): Don't get confused if
11831 layout_eh_frame returns NULL.
11833 2010-01-08 Ian Lance Taylor <iant@google.com>
11836 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11837 dynamic symbol table, use the normal symbol table.
11838 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11841 2010-01-08 Ian Lance Taylor <iant@google.com>
11844 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11847 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11849 * version.cc (print_version): Change to "Copyright 2010".
11851 2010-01-08 Ian Lance Taylor <iant@google.com>
11855 * i386.cc (class Target_i386): Change return type of plt_section
11857 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11858 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11859 tls_desc_rel_ field.
11860 (Output_data_plt_i386::rel_tls_desc): New function.
11861 (Target_i386::rel_tls_desc_section): New function.
11862 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11863 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11864 R_386_TLS_DESC reloc in rel_tls_desc_section.
11865 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11866 Define struct Tlsdesc_info.
11867 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11868 (Target_x86_64::do_reloc_symbol_index): New function.
11869 (Target_x86_64::add_tlsdesc_info): New function.
11870 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11871 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11872 tlsdesc_rel_ field.
11873 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11875 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11876 (Target_x86_64::rela_tlsdesc_section): New function.
11877 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11879 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11880 (Target_x86_64::do_reloc_addend): New function.
11881 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11882 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11883 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11884 (Output_reloc::type): New function.
11885 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11886 (Output_reloc::is_target_specific): New function.
11887 (Output_reloc::target_arg): New function.
11888 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11889 absolute relocs and target specific relocs.
11890 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11891 add_target_specific.
11892 (class Output_data_reloc) [SHT_RELA]: Likewise.
11893 * output.cc (Output_reloc::Output_reloc): Add four new versions
11894 for absolute relocs and target specific relocs.
11895 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11896 (Output_reloc::get_symbol_index): Likewise.
11897 (Output_reloc::local_section_offset): Check that local_sym_index_
11898 is not TARGET_CODE or 0.
11899 (Output_reloc::symbol_value): Likewise.
11900 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11902 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11903 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11905 * layout.cc (add_target_dynamic_tags): Use output section for
11906 DT_PLTRELSZ and DT_JMPREL.
11908 2010-01-07 Ian Lance Taylor <iant@google.com>
11911 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11913 (class Output_data_reloc_generic): Define.
11914 (class Output_data_reloc_base): Change base class to
11915 Output_data_reloc_generic. Change add() method to call
11916 bump_relative_reloc_count for a relative reloc. Remove
11917 sort_relocs_ field.
11918 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11920 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11921 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11923 * layout.h (class Layout): Update declaration.
11925 2010-01-07 Ian Lance Taylor <iant@google.com>
11927 * output.h (class Output_data): Add const version of
11928 output_section and do_output_section.
11929 (class Output_section_data): Add const version of
11931 (class Output_section): Likewise.
11932 * layout.cc (Layout::add_target_dynamic_tags): New function.
11933 * layout.h (class Layout): Update declarations.
11934 * arm.cc (Target_arm::do_finalize_sections): Use
11935 add_target_dynamic_tags.
11936 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11937 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11938 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11939 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11941 2010-01-07 Ian Lance Taylor <iant@google.com>
11944 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11947 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11948 Ian Lance Taylor <iant@google.com>
11951 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11952 Xindex::read_symtab_xindex.
11954 2010-01-07 Doug Kwan <dougkwan@google.com>
11956 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11957 (Insn_template::thumb16_bcond_insn): New method declaration.
11958 (Insn_template): Fix spelling.
11959 (Stub::thumb16_special): New method declaration.
11960 (Stub::do_write): Define virtual method which was previously pure
11962 (Stub::do_thumb16_special): New method declaration.
11963 (Stub::do_fixed_endian_write): New template member.
11964 (Reloc_stub::do_write): Remove.
11965 (Reloc_stub::do_fixed_endian_write): Remove.
11966 (Cortex_a8_stub): New class definition.
11967 (Stub_factory::make_cortex_a8_stub): New method definition.
11968 (Stub_factory::Stub_factory): Add missing static storage class
11969 qualifier for elf32_arm_stub_a8_veneer_blx.
11971 2010-01-07 Ian Lance Taylor <iant@google.com>
11974 * options.h (class General_options): Add --warn-unresolved-symbols
11975 and --error-unresolved-symbols.
11976 * errors.cc (Errors::undefined_symbol): Implement
11977 --warn-unresolved-symbols.
11979 * options.h (class General_options): Add -z text and -z textoff.
11980 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11982 2010-01-06 Sriraman Tallam <tmsriram@google.com>
11984 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11985 (Garbage_collection::cident_sections): New function.
11986 (Garbage_collection::add_cident_section): New function.
11987 (Garbage_collection::cident_sections_): New member.
11988 (gc_process_relocs): Add references to sections whose names are C
11990 * gold.h (cident_section_start_prefix): New constant.
11991 (cident_section_stop_prefix): New constant.
11992 (is_cident): New function.
11993 * layout.cc (Layout::define_section_symbols): Replace string constants
11994 with the newly defined constants.
11995 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11997 * testsuite/Makefile.am: Add gc_orphan_section_test.
11998 * testsuite/Makefile.in: Regenerate.
11999 * testsuite/gc_orphan_section_test.cc: New file.
12000 * testsuite/gc_orphan_section_test.sh: New file.
12002 2010-01-06 Ian Lance Taylor <iant@google.com>
12005 * options.h (class General_options): Add --warn-shared-textrel.
12006 * layout.cc (Layout::finish_dynamic_section): Implement
12007 --warn-shared-textrel.
12010 * options.h (class General_options): Add --warn-multiple-gp.
12012 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12014 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12015 $(THREADSLIB) and $(LIBDL).
12016 * Makefile.in: Rebuild.
12018 2010-01-06 Ian Lance Taylor <iant@google.com>
12021 * options.cc (General_options::parse_section_start): New function.
12022 (General_options::section_start): New function.
12023 (General_options::General_options): Initialize all members.
12024 * options.h: Include <map>
12025 (class General_options): Add --section-start. Add section_starts_
12027 * layout.cc (Layout::attach_allocated_section_to_segment): If
12028 --section-start was used, set the address of the segment. Remove
12029 local sort_sections.
12030 (Layout::relaxation_loop_body): If the address of the load segment
12031 has been set by --section-start, don't use it.
12032 * output.h (Output_segment::update_flags_for_output_section): New
12034 * output.cc (Output_segment::add_output_section): Call
12035 update_flags_for_output_section.
12037 2010-01-05 Ian Lance Taylor <iant@google.com>
12040 * options.h (class General_options): Add --undefined-version.
12041 * script.cc (struct Version_expression): Add was_matched_by_symbol
12043 (Version_script_info::matched_symbol): New function.
12044 (Version_script_info::get_symbol_version_helper): Call
12046 (Version_script_info::check_unmatched_names): New function.
12047 * script.h (class Version_script_info): Update declarations.
12048 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12050 * options.h (class General_options): Use DEFINE_bool_alias for
12051 allow_multiple_definition.
12052 * resolve.cc (Symbol_table::should_override): Don't test
12053 allow_multiple_definition.
12056 * options.h (class General_options): Add --cref.
12057 * main.cc (main): Print cref table if --cref. Don't close mapfile
12058 until after printing cref table.
12059 * cref.cc: Include "symtab.h".
12060 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12061 (Cref_table_compare::operator()): New function.
12062 (Cref_inputs::gather_cref): New function.
12063 (filecol): New static const.
12064 (Cref_inputs::print_cref): New function.
12065 (Cref::print_cref): New function.
12066 * cref.h: Include <cstdio>.
12067 (class Cref): Update declarations.
12068 * mapfile.h (Mapfile::file): New function.
12069 * object.h (class Object): Define Symbols. Declare virtual
12070 do_get_global_symbols.
12071 (Object::get_global_symbols): New function.
12072 * object.cc (Input_objects::add_object): Pass object to cref_ if
12074 (Input_objects::archive_start): Likewise.
12075 (Input_objects::archive_stop): Likewise.
12076 (Input_objects::print_cref): New function.
12077 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12078 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12080 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12082 * plugin.h (class Sized_pluginobj): Update declarations.
12084 2010-01-05 Ian Lance Taylor <iant@google.com>
12086 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12087 to is_default_version. Rename insdef to insdefault.
12088 (Symbol_table::add_from_relobj): Rename def to is_default_version
12089 and local to is_forced_local.
12090 (Symbol_table::add_from_pluginobj): Likewise.
12091 (Symbol_table::add_from_dynobj): Likewise.
12092 (Symbol_table::define_special_symbol): Rename insdef to
12095 2010-01-04 Ian Lance Taylor <iant@google.com>
12098 * options.h (class General_options): Add
12099 --allow-multiple-definition and -z muldefs.
12100 * resolve.cc (Symbol_table::should_override): Don't warn about a
12101 multiple symbol definition if --allow-multiple-definition or -z
12105 * options.h (class General_options): Add --add-needed and
12106 --copy-dt-needed-entries. Tweak --as-needed help entry.
12107 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12108 error if --copy-dt-needed-entries aka --add-needed is used and
12109 would cause a change in behaviour.
12112 * options.h (class General_options): Add -G as a short version of
12113 --shared. Add no-op options -assert, -g, and -i.
12115 2010-01-04 Sriraman Tallam <tmsriram@google.com>
12117 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12118 check for .text or .gnu.linkonce.t sections.
12119 * icf.cc (Icf::find_identical_sections): Ditto.
12120 Change the detection for mangled function name within the section
12122 * icf.h (is_section_foldable_candidate): New function.
12124 2009-12-30 Ian Lance Taylor <iant@google.com>
12127 * options.h (class General_options): Permit two dashes with
12128 --retain-symbols-file.
12130 2009-12-30 Ian Lance Taylor <iant@google.com>
12133 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12134 don't put the file header and segment headers in the text
12138 * common.cc (Sort_commons::operator()): Stabilize sort when both
12140 (Symbol_table::do_allocate_commons_list): When allocating common
12141 symbols, skip a symbol which is no longer common.
12142 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12143 an object before checking its type.
12144 * testsuite/common_test_2.c: New file.
12145 * testsuite/common_test_3.c: New file.
12146 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12147 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12148 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12149 (common_test_2_pic.o, common_test_2.so): New targets.
12150 (common_test_3_pic.o, common_test_3.so): New targets.
12151 * testsuite/Makefile.in: Rebuild.
12154 * script.cc (read_input_script): If we see a new SECTIONS clause,
12155 and we have added an input section, give an error.
12156 * layout.h (class Layout): Add have_added_input_section function.
12157 Add have_added_input_section_ field.
12158 * layout.cc (Layout::Layout): Initialize
12159 have_added_input_section_.
12160 (Layout::layout): Set have_added_input_section_.
12161 (Layout::layout_eh_frame): Likewise.
12163 2009-12-30 Ian Lance Taylor <iant@google.com>
12166 * options.h (class General_options): Add --sort-common option.
12167 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12168 * common.cc (Sort_common): Add sort_order parameter to
12169 constructor. Add sort_order_ field.
12170 (Sort_commons::operator): Check sort_order_.
12171 (Symbol_table::allocate_commons): Determine the sort order.
12172 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12173 Change all callers.
12174 (Symbol_table::do_allocate_commons_list): Likewise.
12176 2009-12-30 Ian Lance Taylor <iant@google.com>
12179 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12180 symbols from this object, don't change the visibility of an
12182 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12184 2009-12-30 Ian Lance Taylor <iant@google.com>
12187 * script.h (class Version_script_info): Define Language enum.
12188 Update declarations. Define Glob, Exact, and Lookup types. Add
12189 new fields globals_, locals_, and is_finalized_.
12190 * script.cc: Various formatting fixes.
12191 (class Parser_closure): Change language_stack_ from a vector of
12192 std::string to one of Version_script_info::Language. Adjust all
12194 (class Lazy_demangler): Remove.
12195 (struct Version_expression): Change language from std::string to
12196 Version_script_info::Language.
12197 (Version_script_info::Version_script_info): New function.
12198 (Version_script_info::~Version_script_info): Don't call clear.
12199 (Version_script_info::finalize): New function.
12200 (Version_script_info::build_lookup_tables): New function.
12201 (Version_script_info::build_expression_list_lookup): New
12203 (Version_script_info::get_symbol_version_helper): Rewrite to use
12205 (Version_script_info::print_expression_list): Adjust to use
12206 Version_script_info::Language.
12207 (script_push_lex_into_version_mode): Check that the version script
12208 has not been finalized.
12209 (version_script_push_lang): Change language string to
12210 Version_script_info::Language.
12211 * options.cc (Command_line::version_script): New function.
12212 * options.h (class General_options): Add finalize_dynamic_list
12213 function. Change version_script from declaration to definition.
12214 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12215 * testsuite/version_script.map: Remove duplicate def of foo.
12216 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12217 version_script.map.
12218 * testsuite/Makefile.in: Rebuild.
12220 2009-12-30 Ian Lance Taylor <iant@google.com>
12223 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12224 if the input symbol index is 0, make the output symbol index 0.
12226 2009-12-30 Ian Lance Taylor <iant@google.com>
12229 * options.h (class General_options): Add -x/--discard-all.
12230 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12231 --discard-all. If the local symbol needs a dynamic entry, check
12232 that before handling --discard-locals.
12234 2009-12-30 Ian Lance Taylor <iant@google.com>
12237 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12239 (Output_segment::add_output_section): Don't change the flags if
12240 the type is PT_TLS.
12243 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12244 GNU hash table if they need a dynamic value. Otherwise, don't add
12245 them if they are defined in a dynamic object or are forced local.
12247 2009-12-29 Ian Lance Taylor <iant@google.com>
12250 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12251 .gnu.hash table for a 32-bit target.
12254 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12255 regular and a dynamic object only needs a dynamic symbol table
12256 entry if it is externally visible.
12259 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12260 constructor. Add global_offset_table_ field.
12261 (Target_i386::got_section): Set global_offset_table_.
12262 (Target_i386::do_finalize_sections): Set global_offset_table_
12264 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12265 in constructor. Add global_offset_table_ field.
12266 (Target_x86_64::got_section): Set global_offset_table_.
12267 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12270 * layout.cc (Layout::Layout): Initialize increase_relro_.
12271 (Layout::get_output_section): Add is_relro, is_last_relro, and
12272 is_first_non_relro parameters. Change all callers.
12273 (Layout::choose_output_section): Likewise.
12274 (Layout::add_output_section_data): Likewise.
12275 (Layout::make_output_section): Likewise.
12276 (Layout::set_segment_offsets): Clear increase_relro when using a
12278 * layout.h (class Layout): Add increase_relro method. Add
12279 increase_relro_ field. Update declarations.
12280 * output.cc (Output_section::Output_section): Initialize
12281 is_last_relro_ and is_first_non_relro_.
12282 (Output_segment::add_output_section): Group relro sections is
12283 do_sort is true. Handle is_last_relro and is_first_non_relro.
12284 (Output_segment::maximum_alignment): Remove relro handling.
12285 (Output_segment::set_section_addresses): Add increase_relro
12286 parameter. Change all callers. Add initial alignment to align
12287 relro sections on separate page. Remove old relro handling.
12288 (Output_segment::set_section_list_addresses): Remove in_relro
12289 parameter. Change all callers.
12290 (Output_segment::set_offset): Add increase parameter. Change all
12291 callers. Remove old relro handling.
12292 * output.h (class Output_section): Add new methods: is_last_relro,
12293 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12294 Add is_last_relro_ and is_first_non_relro_ fields.
12295 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12296 Create separate .got.plt section. Call increase_relro.
12297 * x86_64.cc (Target_x86_64::got_section): Likewise.
12298 * testsuite/relro_script_test.t: Add .got.plt.
12301 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12302 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12303 (Layout::finalize): Call set_dynamic_symbol_size.
12304 (Layout::set_dynamic_symbol_size): New function.
12305 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12306 set_dynamic_symbol_size.
12309 * output.h (class Output_section): Add is_entsize_zero_ field.
12310 * output.cc (Output_section::Output_section): Initialize
12312 (Output_section::set_entsize): If two different entsizes are
12313 requested, force it to zero.
12314 (Output_section::add_input_section): Set flags for .debug_str
12315 before updating section flags. Set entsize.
12316 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12317 and SHF_STRING if all input sections have those flags.
12319 2009-12-29 Rafael Espindola <espindola@google.com>
12321 * main.cc (main): Fix the sys time reporting.
12322 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12325 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12327 * options.cc (General_options::parse_version): Allow -v to exit
12328 without an error if there is nothing to link.
12330 2009-12-29 Ian Lance Taylor <iant@google.com>
12332 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12333 using a version of gcc before 4.1.
12334 * configure: Rebuild.
12336 2009-12-28 Chris Demetriou <cgd@google.com>
12338 * attributes.cc (Output_attributes_section_data::do_write): Use
12339 std::vector::front rather than std::vector::data.
12341 2009-12-28 Ian Lance Taylor <iant@google.com>
12343 * symtab.h (class Symbol_table): Add enum Defined.
12344 * resolve.cc (Symbol_table::should_override): Add defined
12345 parameter. Change all callers. Test whether object is NULL
12346 before calling a method on it.
12347 (Symbol_table::report_resolve_problem): Add defined parameter.
12348 Change all callers.
12349 (Symbol_table::should_override_with_special): Likewise.
12350 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12351 parameter. Change all callers.
12352 (Symbol_table::do_define_in_output_data): Likewise.
12353 (Symbol_table::define_in_output_segment): Likewise.
12354 (Symbol_table::do_define_in_output_segment): Likewise.
12355 (Symbol_table::define_as_constant): Likewise.
12356 (Symbol_table::do_define_as_constant): Likewise.
12357 * script.h (class Symbol_assignment): Add is_defsym parameter to
12358 constructor; change all callers.
12359 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12360 parameter. Change all callers. Add is_defsym_ field.
12361 (class Parser_closure): Add parsing_defsym parameter to
12362 constructor; change all callers. Add parsing_defsym accessor
12363 function. Add parsing_defsym_ field.
12365 2009-12-28 Ian Lance Taylor <iant@google.com>
12367 * gold.cc (queue_middle_tasks): Fix formatting.
12368 * object.cc (Relobj::is_section_name_included): Likewise.
12370 2009-12-23 Ian Lance Taylor <iant@google.com>
12372 * i386.cc (Target_i386::do_calls_non_split): Recognize
12373 -fsplit-stack prologue for a function with a static chain.
12374 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12375 -fsplit-stack prologue when using %r11.
12377 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12379 * options.cc (General_options::parse_version): Make -v continue and do
12380 the link like GNU ld does.
12382 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12384 * Makefile.am (CCFILES): Add timer.cc.
12385 (HFILES): Add timer.h.
12386 * configure.ac: Check for sysconf and times.
12387 * main.cc: include timer.h.
12388 (main): Use Timer instead of get_run_time.
12391 * workqueue.cc: include timer.h.
12392 (Workqueue::find_and_run_task):
12393 Report user, sys and wall time.
12394 * Makefile.in: Regenerate.
12395 * config.in: Regenerate.
12396 * configure: Regenerate.
12398 2009-12-16 Doug Kwan <dougkwan@google.com>
12400 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12402 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12403 relaxed input sections.
12404 * output.cc (Output_section::find_relaxed_input_section): Change
12405 return type to Output_relaxed_input_section pointer. Adjust code
12406 for new type of relaxed_input_section_map_.
12407 * output.h (Output_section::find_relaxed_input_section): Change
12408 return type to Output_relaxed_input_section pointer.
12409 (Output_section::Output_relaxed_input_section_by_input_section_map):
12411 (Output_section::relaxed_input_section_map_): Change type to
12412 Output_section::Output_relaxed_input_section_by_input_section_map.
12413 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12416 2009-12-15 Ian Lance Taylor <iant@google.com>
12418 * layout.cc (Layout::create_shstrtab): Only write out after input
12419 sections if we are compressing debug sections.
12421 2009-12-15 Ian Lance Taylor <iant@google.com>
12423 * archive.cc (Archive::add_symbols): Only look up a symbol without
12424 a version if there is, in fact, a version.
12426 2009-12-14 Ian Lance Taylor <iant@google.com>
12428 Revert -Wshadow changes, all changes from:
12429 2009-12-11 Doug Kwan <dougkwan@google.com>
12430 2009-12-11 Nick Clifton <nickc@redhat.com>
12431 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12433 2009-12-11 Doug Kwan <dougkwan@google.com>
12435 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12437 * attributes.cc (Object_attribute::size): Ditto.
12438 (Attributes_section_data::size): Ditto.
12439 (Attributes_section_data::Attributes_section_data): Ditto.
12440 (Output_attributes_section_data::do_write): Ditto.
12441 * attributes.h (Object_attribute::set_type): Ditto.
12442 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12444 2009-12-11 Nick Clifton <nickc@redhat.com>
12446 * archive.cc: Fix shadowed variable warnings.
12447 * arm.cc: Likewise.
12448 * compressed_output.cc: Likewise.
12449 * compressed_output.h: Likewise.
12450 * configure: Likewise.
12451 * dwarf_reader.cc: Likewise.
12452 * dynobj.cc: Likewise.
12453 * dynobj.h: Likewise.
12454 * ehframe.cc: Likewise.
12455 * ehframe.h: Likewise.
12456 * errors.cc: Likewise.
12457 * expression.cc: Likewise.
12458 * fileread.cc: Likewise.
12459 * fileread.h: Likewise.
12460 * freebsd.h: Likewise.
12461 * i386.cc: Likewise.
12462 * icf.cc: Likewise.
12463 * incremental.h: Likewise.
12464 * layout.cc: Likewise.
12465 * layout.h: Likewise.
12466 * mapfile.cc: Likewise.
12467 * merge.cc: Likewise.
12468 * merge.h: Likewise.
12469 * object.cc: Likewise.
12470 * object.h: Likewise.
12471 * options.h: Likewise.
12472 * output.cc: Likewise.
12473 * output.h: Likewise.
12474 * parameters.cc: Likewise.
12475 * plugin.cc: Likewise.
12476 * powerpc.cc: Likewise.
12477 * reduced_debug_output.cc: Likewise.
12478 * reduced_debug_output.h: Likewise.
12479 * reloc.cc: Likewise.
12480 * reloc.h: Likewise.
12481 * resolve.cc: Likewise.
12482 * script-sections.cc: Likewise.
12483 * script.cc: Likewise.
12484 * script.h: Likewise.
12485 * sparc.cc: Likewise.
12486 * symtab.cc: Likewise.
12487 * symtab.h: Likewise.
12488 * target-select.cc: Likewise.
12489 * target-select.h: Likewise.
12490 * token.h: Likewise.
12491 * workqueue.cc: Likewise.
12492 * workqueue.h: Likewise.
12493 * x86_64.cc: Likewise.
12495 2009-12-10 Doug Kwan <dougkwan@google.com>
12497 * arm.cc (attributes.h): New include.
12498 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12499 (Arm_relobj::~Arm_relobj): Delete object pointed by
12500 attributes_section_data_.
12501 (Arm_relobj::attributes_section_data): New method definition.
12502 (Arm_relobj::attributes_section_data_): New data member declaration.
12503 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12504 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12505 attributes_section_data_.
12506 (Arm_dynobj::attributes_section_data): New method definition.
12507 (Arm_dynobj::attributes_section_data_): New data member declaration.
12508 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12509 initialization value of may_use_blx_ to false.
12510 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12511 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12512 object attributes to compute results instead of hard-coding.
12513 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12514 Target_arm::get_secondary_compatible_arch,
12515 Target_arm::set_secondary_compatible_arch
12516 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12517 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12518 New method declarations.
12519 (Target_arm::get_aeabi_object_attribute): New method definition.
12520 (Target_arm::attributes_section_data_): New data member declaration.
12521 (read_arm_attributes_section): New template definition.
12522 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12523 (Arm_dynobj::do_read_symbols): Ditto.
12524 (Target_arm::do_finalize_sections): Merge attributes sections from
12525 input. Check for BLX use after attributes section merging.
12526 Fix __exidx_start and __exidx_end visibility. Create an
12527 .ARM.attributes section if necessary.
12528 (Target_arm::get_secondary_compatible_arch,
12529 Target_arm::set_secondary_compatible_arch,
12530 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12531 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12532 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12533 New method definitions.
12535 2009-12-09 Ian Lance Taylor <iant@google.com>
12537 * plugin.cc (Plugin::load): Don't cast from void* to a function
12540 2009-12-09 Ian Lance Taylor <iant@google.com>
12542 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12543 information fields.
12545 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12547 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12548 Replace two_file_shared_1.so with two_file_shared_2.so.
12549 * testsuite/Makefile.in: Regenerated.
12551 2009-12-08 Doug Kwan <dougkwan@google.com>
12553 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12554 (HFILES): Add attributes.h and int_encoding.h.
12555 * Makefile.in: Regenerate.
12556 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12557 function definitions to int_encoding.cc
12558 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12559 prototypes to int_encoding.h
12560 * reduced_debug_output.cc (int_encoding.h): New include.
12561 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12562 function definitions to int_encoding.cc
12563 (insert_into_vector, read_from_pointer): Move template definitions to
12565 * attributes.cc: New file.
12566 * attributes.h: New file.
12567 * int_encoding.cc: New file.
12568 * int_encoding.h: New file.
12570 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12573 * incremental-dump.cc (dump_incremental_inputs): New.
12574 (main): Use dump_incremental_inputs.
12576 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12579 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12580 checking elfcpp::STT_FUNC.
12581 (Target_i386::Relocate::relocate): Likewise.
12582 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12584 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12585 symbols from shared libraries into normal FUNC symbols.
12587 * symtab.h (Symbol): Add is_func and use it.
12589 2009-12-05 Doug Kwan <dougkwan@google.com>
12591 * arm.cc (Target_arm::arm_info): Initialize new fields
12592 attributes_section and attributes_vendor.
12593 * i386.cc (Target_i386::i386_info): Same.
12594 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12595 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12596 fields attributes_section and attributes_vendor.
12597 * sparc.cc (Target_sparc::sparc_info): Same.
12598 * target.h (Target::attributes_section, Target::attributes_vendor,
12599 Target::is_attributes_section, Target::attribute_arg_type,
12600 Target::attributes_order): New method definitions.
12601 (Target::Target_info::attributes_section,
12602 Target::Target_info::attributes_vendor): New fields.
12603 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12604 virtual method definitions.
12605 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12606 attributes_section and attributes_vendor.
12607 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12609 2009-12-05 Doug Kwan <dougkwan@google.com>
12611 * arm.cc: Update comments about interworking and stub generation.
12612 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12613 considered as non-PIC.
12614 (Arm_relocate_functions::base_abs): Fix formatting.
12615 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12616 of function to use GOT entry address instead of offset.
12617 (Target_arm::Scan::global): Issue an error if a symbol would need a
12618 PLT does not get one because it is untyped. Remove code to create
12619 dynamic symbols for relative branches.
12620 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12621 takes unsigned integer instead of boolean.
12623 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12625 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12626 (two_file_test_LDADD): Likewise.
12627 (common_test_1_LDADD): Likewise.
12628 (exception_test_LDADD) Likewise.
12629 (weak_test_LDADD): Likewise.
12630 (many_sections_test_LDADD): Likewise.
12631 (initpri1_LDADD): Likewise.
12632 (script_test_1_LDADD): Likewise.
12633 (script_test_2_LDADD): Likewise.
12634 (justsyms_LDADD): Likewise.
12635 (binary_test_LDADD): Likewise.
12636 (large_LDADD): Likewise.
12637 * testsuite/Makefile.in: Regenerated.
12639 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12641 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12642 (Symbol_table::override_with_special): Likewise.
12643 (Symbol_table::add_from_object): Likewise.
12645 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12647 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12648 Don't set the data_offset twice.
12650 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12652 * testsuite/Makefile.in: Regenerate.
12654 2009-12-03 Doug Kwan <dougkwan@google.com>
12656 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12657 (Target_arm::do_finalize_sections): Add parameter for symbol table
12658 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12659 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12660 parameter for symbol table pointer.
12661 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12662 an additional parameter for a pointer to symbol table.
12663 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12664 parameter for a symbol table pointer.
12665 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12666 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12668 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12669 parameter for a symbol table pointer.
12671 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12673 * incremental.cc (Incremental_inputs_header)
12674 (Incremental_inputs_header_write, Incremental_inputs_entry)
12675 (Incremental_inputs_entry_write): Move ...
12676 * incremental.h (Incremental_inputs_header)
12677 (Incremental_inputs_header_write, Incremental_inputs_entry)
12678 (Incremental_inputs_entry_write): here.
12680 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12682 * incremental.cc (make_sized_incremental_binary): Set the target.
12683 Error if it is incompatible.
12684 * output.h (Output_file): Add filename method.
12686 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12688 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12689 from the get_* methods.
12691 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12693 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12694 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12695 Write 0 for the data_offset of scripts.
12697 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12699 * testsuite/Makefile.am: Add the incremental_test.sh test.
12700 * testsuite/incremental_test.sh: New.
12701 * testsuite/incremental_test_1.c: New.
12702 * testsuite/incremental_test_2.c: New.
12704 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12706 * incremental-dump.cc (main): Fix typos.
12708 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12711 * incremental-dump.cc (main): Use llu to print 64 bit values.
12713 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12714 H.J. Lu <hongjiu.lu@intel.com>
12716 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12718 (incremental_dump_LDADD): Likewise.
12719 * Makefile.in: Regenerated.
12721 2009-11-25 Doug Kwan <dougkwan@google.com>
12725 2009-11-25 Doug Kwan <dougkwan@google.com>
12727 * arm.cc (Target_arm::Target_arm): Move method definition
12728 outside of class definition. Add code to handle
12729 --target1-rel, --target1-abs and --target2= options.
12730 (Target_arm::get_reloc_reloc_type): Change method to be
12731 non-static and const.
12732 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12733 New data member declaration.
12734 (Target_arm::Scan::local, Target_arm::Scan::global,
12735 Target_arm::Relocate::relocate,
12736 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12737 Adjust call to Target_arm::get_real_reloc_type.
12738 (Target_arm::get_real_reloc_type): Use command line options
12739 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12740 * options.h (--target1-rel, --target1-abs, --target2): New
12743 2009-11-25 Doug Kwan <dougkwan@google.com>
12745 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12746 class definition. Add code to handle --target1-rel, --target1-abs
12747 and --target2= options.
12748 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12750 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12751 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): Adjust
12755 call to Target_arm::get_real_reloc_type.
12756 (Target_arm::get_real_reloc_type): Use command line options to
12757 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12758 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12761 2009-11-25 Doug Kwan <dougkwan@google.com>
12763 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12764 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12765 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12767 (Arm_relocate_functions::thm_call): Replace body with a call to
12768 Arm_relocate_functions::thumb_branch_common.
12769 (Arm_relocate_functions::thm_jump24,
12770 Arm_relocate_functions::thm_xpc22): New method definitions.
12771 (Arm_relocate_functions::thumb_branch_common): New method definition.
12772 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12774 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12775 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12777 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12779 * Makefile.am: Build incremental-dump
12780 * Makefile.in: Regenerate.
12781 * incremental-dump.cc: New.
12782 * incremental.cc (Incremental_inputs_header_data,
12783 Incremental_inputs_entry_data): Move to incremental.h
12784 * incremental.h: (Incremental_inputs_header_data,
12785 Incremental_inputs_entry_data): Move from incremental.cc
12787 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12789 * incremental.cc (Incremental_inputs_header,
12790 Incremental_inputs_header_write, Incremental_inputs_entry,
12791 Incremental_inputs_entry_write): Add a typedef with the data type.
12793 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12795 * incremental.cc (Incremental_inputs_header,
12796 Incremental_inputs_header_write, Incremental_inputs_entry,
12797 Incremental_inputs_entry_write): Update comment about which
12798 type has the filed descriptions.
12800 2009-11-15 Doug Kwan <dougkwan@google.com>
12802 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12803 (Arm_relocate_functions::arm_branch_common): Change method defintion
12804 in class definition to a method declaration and update list of formal
12806 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12807 Arm_relocation_functions::jump24): Adjust call to
12808 Arm_relocate_functions::arm_branch_common. Update list of formal
12810 (Arm_relocate_functions::xpc25): New method definition.
12811 (Arm_relocate_functions::arm_branch_common): Move method defintion
12812 out from class definition. Use stubs for mode-switching and extending
12814 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12815 specially. Change code to enable use of stubs in ARM branches.
12817 2009-11-10 Doug Kwan <dougkwan@google.com>
12819 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12820 in method declaration.
12821 (Target_arm::relocate_stub): New method declaration.
12822 (Target_arm::default_target): Change to return a pointer instead of
12824 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12825 Target_arm::default_target.
12826 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12828 (Target_arm::relocate_section): Adjust view.
12829 (Target_arm::relocate_stub): New method definition.
12831 2009-11-10 Doug Kwan <dougkwan@google.com>
12833 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12835 * incremental.cc (open_incremental_binary): Initialized local
12836 variables to avoid warnings.
12837 * object.cc (make_elf_object): Ditto.
12838 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12841 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12844 * testsuite/plugin_test.c: Include "config.h".
12846 2009-11-09 Doug Kwan <dougkwan@google.com>
12848 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12849 (arm_symbol_value): Remove.
12850 (Arm_relocate_functions::arm_branch_common,
12851 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12852 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12853 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12854 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12855 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12856 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12857 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12858 Arm_relocate_functions::thm_mobw_abs_nc,
12859 Arm_relocate_functions::thm_mov_abs,
12860 Arm_relocate_functions::movw_prel_nc,
12861 Arm_relocate_functions::thm_movt_abs,
12862 Arm_relocate_functions::movt_prel,
12863 Arm_relocate_functions::thm_movw_prel_nc,
12864 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12865 (Target_arm::Relocate::relocate): Only decompose address into two
12866 parts if relocation type uses the thumb-bit and pass the actual
12867 bit instead of a flag indicating that the thumb-bit is used. Adjust
12868 calls to methods in Arm_relocate_functions for this change.
12870 2009-11-08 Ian Lance Taylor <iant@google.com>
12873 * reloc.cc: Instantiate
12874 Sized_relobj::initialize_input_to_output_maps and
12875 Sized_relobj:free_input_to_output_maps.
12877 2009-11-06 Ian Lance Taylor <iant@google.com>
12880 * defstd.cc (in_segment): Set only_if_ref true for "end".
12882 2009-11-06 Doug Kwan <dougkwan@google.com>
12884 * arm.cc (class Reloc_stub): Correct a comment.
12885 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12886 (Target_arm::scan_section_for_stubs): New method declaration.
12887 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12888 Change methods from private to protected.
12889 (Target_arm::do_may_relax): New method definition.
12890 (Target_arm::do_relax, Target_arm::group_sections,
12891 Target_arm::scan_reloc_for_stub,
12892 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12893 (Target_arm::arm_input_section_map_): New data member declaration.
12894 (Target_arm::scan_reloc_for_stub,
12895 Target_arm::scan_reloc_section_for_stubs,
12896 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12897 Target_arm::do_relax): New method definitions.
12899 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12901 * configure.ac: Check for (struct stat)::st_mtim
12902 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12903 * config.in: Regenerate.
12904 * configure: Regenerate.
12906 2009-11-05 Ian Lance Taylor <iant@google.com>
12909 * output.cc (Output_segment::add_output_section): Add missing
12912 2009-11-04 Ian Lance Taylor <iant@google.com>
12915 * object.h (class Object): Add is_needed and set_is_needed
12916 methods. Add is_needed_ field. Make bool fields into bitfields.
12917 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12918 defined in a dynamic object and referenced by a regular object,
12919 set is_needed for the dynamic object.
12920 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12921 if the file is marked with as_needed and it is not needed.
12923 2009-11-04 Ian Lance Taylor <iant@google.com>
12926 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12927 tags if data is discarded by linker script.
12928 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12929 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12930 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12931 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12933 2009-11-04 Ian Lance Taylor <iant@google.com>
12935 * layout.cc (Layout::get_output_section): Add is_interp and
12936 is_dynamic_linker_section parameters. Change all callers.
12937 (Layout::choose_output_section): Likewise.
12938 (Layout::make_output_section): Likewise.
12939 (Layout::add_output_section_data): Add is_dynamic_linker_section
12940 parameter. Change all callers.
12941 * layout.h (class Layout): Update declarations.
12942 * output.h (class Output_section): Add is_interp, set_is_interp,
12943 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12944 Add is_interp_, is_dynamic_linker_section_ fields. Change
12945 generate_code_fills_at_write_ to a bitfield.
12946 * output.cc (Output_section::Output_sections): Initialize new
12948 (Output_segment::add_output_section): Add do_sort parameter.
12949 Change all callers.
12951 2009-11-03 Ian Lance Taylor <iant@google.com>
12954 * options.h (class General_options): Add --warn-common.
12955 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12956 merging two common symbols.
12957 (Symbol_table::should_override): Handle --warn-common when merging
12958 a common symbol with a defined symbol. Use report_resolve_problem
12959 for multiple definitions.
12960 (Symbol_table::report_resolve_problem): New function.
12961 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12963 2009-11-03 Doug Kwan <dougkwan@google.com>
12965 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12967 (Target_arm::stub_factory): New method definition.
12968 (Target_arm::new_arm_input_section,
12969 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12970 Target_arm::reloc_uses_thumb_bit): New method declarations.
12971 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
12972 New type definitions.
12973 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12974 member declarations.
12975 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12976 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12977 New method definitions.
12979 2009-11-03 Ian Lance Taylor <iant@google.com>
12981 * options.h (class General_options): Add --warn_constructors.
12983 2009-11-03 Ian Lance Taylor <iant@google.com>
12986 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12987 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12989 2009-11-03 Ian Lance Taylor <iant@google.com>
12992 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12993 --msgid-bugs-address.
12994 (install-pdf): New target.
12995 (install-data_yes): Look up one directory to find mkinstalldirs.
12997 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12999 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13002 2009-10-30 Doug Kwan <dougkwan@google.com>
13004 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13006 2009-10-30 Doug Kwan <dougkwan@google.com>
13008 * arm.cc (Stub_addend_reader): New struct template definition
13009 and partial specializations.
13010 (Stub_addend_reader::operator()): New method definition for a
13011 partially specialized template.
13013 2009-10-30 Doug Kwan <dougkwan@google.com>
13015 * arm.cc (Arm_relobj::processor_specific_flags): New method
13017 (Arm_relobj::do_read_symbols): New method declaration.
13018 (Arm_relobj::processor_specific_flags_): New data member declaration.
13019 (Arm_dynobj): New class definition.
13020 (Target_arm::do_finalize_sections): Add input_objects parameter.
13021 (Target_arm::do_adjust_elf_header): New method declaration.
13022 (Target_arm::are_eabi_versions_compatible,
13023 (Target_arm::merge_processor_specific_flags): New method declaration.
13024 (Target_arm::do_make_elf_object): New overloaded method definitions
13026 (Arm_relobj::do_read_symbols): New method definition.
13027 (Arm_dynobj::do_read_symbols): Ditto.
13028 (Target_arm::do_finalize_sections): Add input_objects parameters.
13029 Merge processor-specific flags from all input objects.
13030 (Target_arm::are_eabi_versions_compatible,
13031 Target_arm::merge_processor_specific_flags,
13032 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13033 New method definitions.
13034 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13035 Input_objects pointer type parameter.
13036 * layout.cc (Layout::finalize): Pass input objects to target's.
13037 finalize_sections function.
13038 * output.cc (Output_file_header::do_sized_write): Set ELF file
13039 header's processor-specific flags.
13040 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13041 Input_objects pointer type parameter.
13042 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13043 * target.h (Input_objects): New forward class declaration.
13044 (Target::processor_specific_flags,
13045 Target::are_processor_specific_flags_sect): New method definitions.
13046 (Target::finalize_sections): Add input_objects parameter.
13047 (Target::Target): Initialize processor_specific_flags_ and
13048 are_processor_specific_flags_set_.
13049 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13051 (Target::set_processor_specific_flags): New method definition.
13052 (Target::processor_specific_flags_,
13053 Target::are_processor_specific_flags_set_): New data member
13055 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13056 Input_objects pointer type parameter.
13058 2009-10-30 Doug Kwan <dougkwan@google.com>
13060 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13062 2009-10-28 Ian Lance Taylor <iant@google.com>
13064 * object.h (class Relobj): Drop options parameter from
13065 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13066 do_scan_relocs, do_relocate. Change all callers.
13067 (class Sized_relobj): Drop options parameters from
13068 do_gc_process_relocs, do_scan_relocs, do_relocate,
13069 do_relocate_sections, relocate_sections, emit_relocs_scan,
13070 emit_relocs_scan_reltype. Change all callers.
13071 (struct Relocate_info): Remove options field and all references to
13073 * reloc.h (class Read_relocs): Remove options constructor
13074 parameter and options_ field. Change all callers.
13075 (class Gc_process_relocs, class Scan_relocs): Likewise.
13076 (class Relocate_task): Likewise.
13077 * target-reloc.h (scan_relocs): Remove options parameter. Change
13079 (scan_relocatable_relocs): Likewise.
13080 * target.h (class Sized_target): Remove options parameter from
13081 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13083 * gc.h (gc_process_relocs): Remove options parameter. Change all
13085 * arm.cc: Update functions to remove options parameters.
13086 * i386.cc: Likewise.
13087 * powerpc.cc: Likewise.
13088 * sparc.cc: Likewise.
13089 * x86_64.cc: Likewise.
13090 * testsuite/testfile.cc: Likewise.
13092 2009-10-28 Doug Kwan <dougkwan@google.com>
13094 * arm.cc (Arm_relobj): New class definition.
13095 (Arm_relobj::scan_sections_for_stubs,
13096 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13097 New method definitions.
13099 2009-10-28 Cary Coutant <ccoutant@google.com>
13101 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13102 (Plugin::cleanup_done_): New member.
13103 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13104 (Plugin_manager::cleanup_done_): Remove.
13105 (Plugin_manager::add_input_file): Edit error message.
13106 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13107 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13109 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13111 * fileread.cc: (File_read::View::~View): Use the new
13112 data_ownership_ filed.
13113 (File_read::~File_read): Dispose the new whole_file_view_.
13114 (File_read::open): Mmap the whole file if needed.
13115 (File_read::open): Use whole_file_view_ instead of contents_.
13116 (File_read::find_view): Use whole_file_view_ if applicable.
13117 (File_read::do_read): Use whole_file_view_ instead of contents_.
13118 (File_read::make_view): Use whole_file_view_ instead of contents_,
13119 update File_read::View::View call.
13120 (File_read::find_or_make_view): Update File_read::View::View
13122 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13124 (File_read::View::Data_ownership): New enum.
13125 (File_read::View::View): Replace bool mapped_ with Data_ownership
13127 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13128 (File_read::View::data_ownership_): New field.
13129 (File_read::contents_): Remove (replaced by whole_file_view_).
13130 (File_read::whole_file_view_): New field.
13131 * options.h (class General_options): Add --keep-files-mapped.
13133 2009-10-27 Cary Coutant <ccoutant@google.com>
13135 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13136 * testsuite/Makefile.am (plugin_test_5): New test case.
13137 * testsuite/Makefile.in: Regenerate.
13139 2009-10-25 Doug Kwan <dougkwan@google.com>
13141 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13142 from private to protected to allow access by child class.
13143 (Sized_relobj::do_relocate_sections): New method declaration.
13144 (Sized_relobj::relocate_sections): Virtualize.
13145 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
13146 Sized_relobj::relocate_sections. Instantiate template explicitly
13147 for different target sizes and endianity.
13149 2009-10-24 Doug Kwan <dougkwan@google.com>
13151 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13152 (Arm_input_section::as_arm_input_section): New method.
13153 (Arm_output_section): New class definition.
13154 (Arm_output_section::create_stub_group,
13155 Arm_output_section::group_sections): New method definitions.
13157 2009-10-22 Doug Kwan <dougkwan@google.com>
13159 * arm.cc (Arm_input_section): New class definition.
13160 (Arm_input_section::init, Arm_input_section:do_write,
13161 Arm_input_section::set_final_data_size,
13162 Arm_input_section::do_reset_address_and_file_offset): New method
13165 2009-10-21 Doug Kwan <dougkwan@google.com>
13167 * arm.cc (Stub_table, Arm_input_section): New forward class
13169 (Stub_table): New class defintion.
13170 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13171 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13172 New method definition.
13174 2009-10-21 Doug Kwan <dougkwan@google.com>
13176 * arm.cc: Update copyright comments.
13177 (Target_arm): New forward class template declaration.
13178 (Arm_address): New type.
13179 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13180 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13181 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13183 (Insn_template): Same.
13184 (DEF_STUBS): New macro.
13185 (Stub_type): New enum type.
13186 (Stub_template): New class definition.
13188 (Reloc_stub): Same.
13189 (Stub_factory): Same.
13190 (Target_arm::Target_arm): Initialize may_use_blx_ and
13191 should_force_pic_veneer_.
13192 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13193 Target_arm::should_force_pic_veneer,
13194 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13195 Target_arm::using_thumb_only, Target_arm:;default_target): New
13197 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13198 New data member declarations.
13199 (Insn_template::size, Insn_template::alignment): New method defintions.
13200 (Stub_template::Stub_template): New method definition.
13201 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13202 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13203 (Stub_factory::Stub_factory): New method definition.
13204 * gold.h (string_hash): New template.
13205 * output.h (Input_section_specifier::hash_value): Use
13207 (Input_section_specifier::string_hash): Remove.
13208 * stringpool.cc (Stringpool_template::string_hash): Use
13211 2009-10-20 Doug Kwan <dougkwan@google.com>
13213 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13214 symbols of relaxed input sections.
13215 * output.h (Output_section::find_relaxed_input_section): Make
13218 2009-10-16 Doug Kwan <dougkwan@google.com>
13220 * dynobj.cc (Versions::Versions): Initialize version_script_.
13221 Only insert base version symbol definition for a shared object
13222 if version script defines any version versions.
13223 (Versions::define_base_version): New method definition.
13224 (Versions::add_def): Check that base version is not needed.
13225 (Versions::add_need): Define base version lazily.
13226 * dynobj.h (Versions::define_base_version): New method declaration.
13227 (Versions::needs_base_version_): New data member declaration.
13228 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13229 (check_DATA): Add no_version_test.stdout.
13230 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13232 * testsuite/Makefile.in: Regenerate.
13233 * testsuite/no_version_test.c: New file.
13234 * testsuite/no_version_test.sh: Ditto.
13236 2009-10-16 Doug Kwan <dougkwan@google.com>
13238 * expression.cc (class Segment_start_expression): New class definition.
13239 (Segment_start_expression::value): New method definition.
13240 (script_exp_function_segment_start): Return a new
13241 Segment_start_expression.
13242 * gold/script-c.h (script_saw_segment_start_expression): New function
13244 * script-sections.cc (Script_sections::Script_sections): Initialize
13245 SAW_SEGMENT_START_EXPRESSION_ to false.
13246 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13247 and -Tbbs options to specify section addresses if given in
13248 command line and no SEGMENT_START expression is seen in a script.
13249 * script-sections.h (Script_sections::saw_segment_start_expression,
13250 Script_sections::set_saw_segment_start_expression): New method
13252 (Script_sections::saw_segment_start_expression_): New data member
13254 * script.cc (script_saw_segment_start_expression): New function.
13255 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13256 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13257 script_test_7.sh and script_test_8.sh.
13258 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13259 script_test_8.stdout.
13260 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13261 (script_test_6, script_test_6.stdout, script_test_7,
13262 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13263 * Makefile.in: Regenerate.
13264 * testsuite/script_test_6.sh: New file.
13265 * testsuite/script_test_6.t: Same.
13266 * testsuite/script_test_7.sh: Same.
13267 * testsuite/script_test_7.t: Same.
13268 * testsuite/script_test_8.sh: Same.
13270 2009-10-16 Doug Kwan <dougkwan@google.com>
13272 * output.cc (Output_segment::set_section_list_address): Cast
13273 expressions to unsigned long long type to avoid format warnings.
13275 2009-10-15 Ian Lance Taylor <iant@google.com>
13277 * script.cc (Script_options::add_symbol_assignment): Always add a
13278 dot assignment to script_sections_.
13279 * script-sections.cc (Script_sections::add_dot_assignment):
13280 Initialize if necessary.
13282 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13283 program headers with no load segment if there is a linker script.
13285 * layout.cc (Layout::set_segment_offsets): Align the file offset
13286 to the segment aligment for -N or -n with no load segment.
13287 * output.cc (Output_segment::add_output_section): Don't crash if
13288 the first section is a TLS section.
13289 (Output_segment::set_section_list_addresses): Print an error
13290 message if the address moves backward in a linker script.
13291 * script-sections.cc
13292 (Output_section_element_input::set_section_addresses): Don't
13293 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13294 (Orphan_output_section::set_section_addresses): Likewise.
13296 2009-10-15 Doug Kwan <dougkwan@google.com>
13298 * layout.cc (Layout::finish_dynamic_section): Generate tags
13299 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13300 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13301 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13303 2009-10-14 Ian Lance Taylor <iant@google.com>
13305 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13307 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13308 data_shdr fields of relinfo.
13309 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13310 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13311 R_386_TLS_LDO_32, adjust based on section flags.
13312 (Target_i386::Relocate::fix_up_ldo): Remove.
13314 2009-10-13 Ian Lance Taylor <iant@google.com>
13316 Add support for -pie.
13317 * options.h (class General_options): Add -pie and
13319 (General_options::output_is_position_independent): Test -pie.
13320 (General_options::output_is_executable): Return true if not shared
13321 and not relocatable.
13322 (General_options::output_is_pie): Remove.
13323 * options.cc (General_options::finalize): Reject incompatible uses
13325 * gold.cc (queue_middle_tasks): A -pie link is not static.
13326 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13327 * symtab.cc (Symbol::final_value_is_known): Return false if
13328 output_is_position_independent.
13329 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13330 output_is_position_independent.
13331 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13332 output_is_position_independent.
13333 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13334 output_is_position_independent.
13335 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13337 (basic_pie_test.o, basic_pie_test): New targets.
13338 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13339 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13340 (two_file_pie_test): New target.
13341 * testsuite/Makefile.in: Rebuild.
13342 * README: Remove note saying that -pie is not supported.
13344 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13346 * options.h (class General_options): Add -init and -fini.
13347 * layout.cc (Layout::finish_dynamic_section): Emit
13348 given init and fini functions.
13350 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13352 * gc.h (gc_process_relocs): Check if icf is enabled using new
13354 * gold.cc (queue_initial_tasks): Likewise.
13355 (queue_middle_tasks): Likewise.
13356 * object.cc (do_layout): Likewise.
13357 * symtab.cc (is_section_folded): Likewise.
13358 * main.cc (main): Likewise.
13359 * reloc.cc (Read_relocs::run): Likewise.
13360 (Sized_relobj::do_scan_relocs): Likewise.
13361 * icf.cc (is_function_ctor_or_dtor): New function.
13362 (Icf::find_identical_sections): Check if function is ctor or dtor when
13363 safe icf is chosen.
13364 * options.h (General_options::icf): Change option to be an enum.
13365 (Icf_status): New enum.
13366 (icf_enabled): New method.
13367 (icf_safe_folding): New method.
13368 (set_icf_status): New method.
13369 (icf_status_): New variable.
13370 * (options.cc) (General_options::finalize): Set icf_status_.
13371 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13372 icf_test and icf_keep_unique_test to use the --icf enum flag.
13373 * testsuite/icf_safe_test.sh: New file.
13374 * testsuite/icf_safe_test.cc: New file.
13376 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13378 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13379 includes to gc.h and icf.h.
13380 * arm.cc: Include gc.h.
13381 * gold.cc: Likewise.
13382 * i386.cc: Likewise.
13383 * powerpc.cc: Likewise.
13384 * sparc.cc: Likewise.
13385 * x86_64.cc: Likewise.
13386 * gc.h: Include icf.h.
13388 2009-10-11 Ian Lance Taylor <iant@google.com>
13390 * plugin.cc: Include "gold.h" before other header files.
13392 2009-10-10 Chris Demetriou <cgd@google.com>
13394 * options.h (Input_file_argument::Input_file_type): New enum.
13395 (Input_file_argument::is_lib_): Replace with...
13396 (Input_file_argument::type_): New member.
13397 (Input_file_argument::Input_file_argument): Take Input_file_type
13398 'type' rather than boolean 'is_lib' as second argument.
13399 (Input_file_argument::is_lib): Use type_.
13400 (Input_file_argument::is_searched_file): New function.
13401 (Input_file_argument::may_need_search): Handle is_searched_file.
13402 * options.cc (General_options::parse_library): Support -l:filename.
13403 (General_options::parse_just_symbols): Update for Input_file_argument
13405 (Command_line::process): Likewise.
13406 * archive.cc (Archive::get_file_and_offset): Likewise.
13407 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13408 * script.cc (read_script_file, script_add_file): Likewise.
13409 * fileread.cc (Input_file::Input_file): Likewise.
13410 (Input_file::will_search_for): Handle is_searched_file.
13411 (Input_file::open): Likewise.
13412 * readsyms.cc (Read_symbols::get_name): Likewise.
13413 * testsuite/Makefile.am (searched_file_test): New test.
13414 * testsuite/Makefile.in: Regenerate.
13415 * testsuite/searched_file_test.cc: New file.
13416 * testsuite/searched_file_test_lib.cc: New file.
13418 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13419 Ian Lance Taylor <iant@google.com>
13421 * descriptor.cc: Include <cstdio> and "binary-io.h".
13422 (Descriptors::open): Open the files in binary mode always.
13423 * script.cc (Lex::get_token): Treat \r as whitespace.
13425 2009-10-09 Ian Lance Taylor <iant@google.com>
13427 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13429 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13430 Ian Lance Taylor <iant@google.com>
13432 * configure.ac: Check for readv function also.
13433 * fileread.cc (readv): Define if not HAVE_READV.
13434 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13436 * config.in: Regenerate.
13437 * configure: Regenerate.
13439 2009-10-09 Doug Kwan <dougkwan@google.com>
13441 * layout.cc (Layout::make_output_section): Call target hook to make
13442 ordinary output section.
13443 (Layout::finalize): Adjust parameter list of call the
13444 Target::may_relax().
13445 * layout.h (class Layout::section_list): New method.
13446 * merge.h (Output_merge_base::entsize): Change visibility to public.
13447 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13449 (Output_merge_string::do_is_string): New method.
13450 * object.cc (Sized_relobj::do_setup): renamed from
13451 Sized_relobj::set_up.
13452 * object.h (Sized_relobj::adjust_shndx,
13453 Sized_relobj::initializ_input_to_output_maps,
13454 Sized_relobj::free_input_to_output_maps): Change visibilities to
13456 (Sized_relobj::setup): Virtualize.
13457 (Sized_relobj::do_setup): New method declaration.
13458 (Sized_relobj::invalidate_section_offset,
13459 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13460 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13461 * options.cc (parse_int): New function.
13462 * options.h (parse_int): New declaration.
13463 (DEFINE_int): New macro.
13464 (stub_group_size): New option.
13465 * output.cc (Output_section::Output_section): Initialize memebers
13466 merge_section_map_, merge_section_by_properties_map_,
13467 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13468 (Output_section::add_input_section): Handled deferred code-fill
13469 generation and remove an old comment.
13470 (Output_section::add_relaxed_input_section): New method definition.
13471 (Output_section::add_merge_input_section): Use merge section by
13472 properties map to speed to search. Update merge section maps
13474 (Output_section::build_relaxation_map): New method definition.
13475 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13477 (Output_section::relax_input_section): Renamed to
13478 Output_section::convert_input_sections_to_relaxed_sections and change
13479 interface to take a vector of pointers to relaxed sections.
13480 (Output_section::find_merge_section,
13481 Output_section::find_relaxed_input_section): New method definitions.
13482 (Output_section::is_input_address_mapped,
13483 Output_section::output_offset, Output_section::output_address):
13484 Use output section data maps to speed up searching.
13485 (Output_section::find_starting_output_address): Add comments.
13486 (Output_section::do_write,
13487 Output_section::write_to_postprocessing_buffer): Do code-fill
13488 generation as appropriate.
13489 (Output_section::get_input_sections): Invalidate relaxed input section
13491 (Output_section::restore_states): Adjust type of checkpoint .
13492 Invalidate relaxed input section map.
13493 * output.h (Output_merge_base): New class declaration.
13494 (Input_section_specifier): New class defintion.
13495 (class Output_relaxed_input_section) Change base class to
13496 Output_section_data_build.
13497 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13498 base class initializer.
13499 (Output_section::add_relaxed_input_section): New method declaration.
13500 (Output_section::Input_section): Change visibility to protected.
13501 (Output_section::Input_section::relobj,
13502 Output_section::Input_section::shndx): Handle relaxed input sections.
13503 Output_section::input_sections) Change visibility to protected. Also
13504 define overload to return a non-const pointer.
13505 (Output_section::Merge_section_properties): New class defintion.
13506 (Output_section::Merge_section_by_properties_map,
13507 Output_section::Output_section_data_by_input_section_map,
13508 Output_section::Relaxation_map): New types.
13509 (Output_section::relax_input_section): Rename method to
13510 Output_section::convert_input_sections_to_relaxed_sections and change
13511 interface to take a vector of relaxed section pointers.
13512 (Output_section::find_merge_section,
13513 Output_section::find_relaxed_input_section,
13514 Output_section::build_relaxation_map,
13515 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13516 New method declarations.
13517 (Output_section::merge_section_map_
13518 Output_section::merge_section_by_properties_map_,
13519 Output_section::relaxed_input_section_map_,
13520 Output_section::is_relaxed_input_section_map_valid_,
13521 Output_section::generate_code_fills_at_write_): New data members.
13522 * script-sections.cc
13523 (Output_section_element_input::set_section_addresses): Call
13524 current_data_size and addralign methods of relaxed input sections.
13525 (Orphan_output_section::set_section_addresses): Call current_data_size
13526 and addralign methods of relaxed input sections.
13527 * symtab.cc (Symbol_table::compute_final_value): Extract template
13528 from the body of Symbol_table::sized_finalize_symbol.
13529 (Symbol_table::sized_finalized_symbol): Call
13530 Symbol_table::compute_final_value.
13531 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13532 (Symbol_table::compute_final_value): New templated method declaration.
13533 * target.cc (Target::do_make_output_section): New method defintion.
13534 * target.h (Target::make_output_section): New method declaration.
13535 (Target::relax): Add more parameters for input objects, symbol table
13536 and layout. Adjust call to do_relax.
13537 (Target::do_make_output_section): New method declaration.
13538 (Target::do_relax): Add parameters for input objects, symbol table
13541 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13543 * pread.c: Include stdio.h.
13545 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13547 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13550 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13552 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13553 Change read_shndx type to unsigned int.
13554 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13556 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13557 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13558 Change read_shndx type to unsigned int.
13559 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13561 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13562 * layout.cc (Layout::create_symtab_sections): Cast the result of
13563 local_symcount * symsize to off_t in the gold_assert.
13565 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13567 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13568 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13570 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13571 (Arm_relocate_functions::thm_abs5): New function.
13572 (Arm_relocate_functions::abs12): New function.
13573 (Arm_relocate_functions::abs16): New function.
13574 (Arm_relocate_functions::base_abs): New function.
13575 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13576 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13577 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13579 (Scan::global): Likewise.
13580 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13581 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13582 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13583 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13586 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13588 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13589 (Arm_relocate_functions::movt_prel): New function.
13590 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13591 (Arm_relocate_functions::thm_movt_prel): New function.
13592 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13593 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13594 (Scan::global, Relocate::relocate): Likewise.
13595 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13597 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13599 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13600 Incremental_checker.
13601 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13603 (class Incremental_inputs_header): New class.
13604 (Incremental_inputs_header_writer): Edit comment.
13605 (Incremental_inputs_entry): New class.
13606 (Incremental_inputs_entry_writer): Edit comment.
13607 (Sized_incremental_binary::do_find_incremental_inputs_section):
13608 Add *strtab_shndx parameter, fill it.
13609 (Sized_incremental_binary::do_check_inputs): New method.
13610 (Incremental_checker::can_incrementally_link_output_file): Use
13611 Sized_incremental_binary::check_inputs.
13612 (Incremental_inputs::report_command_line): Save command line in
13615 (Incremental_binary::find_incremental_inputs_section): New
13617 (Incremental_binary::do_find_incremental_inputs_section): Add
13618 strtab_shndx parameter.
13619 (Incremental_binary::do_check_inputs): New pure virtual method.
13620 (Sized_incremental_binary::do_check_inputs): Declare.
13621 (Incremental_checker::Incremental_checker): Add incremental_inputs
13622 parameter, use it to initialize incremental_inputs_.
13623 (Incremental_checker::incremental_inputs_): New field.
13624 (Incremental_checker::command_line): New method.
13625 (Incremental_checker::inputs): New method.
13626 (Incremental_checker::command_line_): New field.
13628 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13630 * incremental.cc: Include <cstdarg> and "target-select.h".
13631 (vexplain_no_incremental): New function.
13632 (explain_no_incremental): New function.
13633 (Incremental_binary::error): New method.
13634 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13636 (make_sized_incremental_binary): New function.
13637 (open_incremental_binary): New function.
13638 (can_incrementally_link_file): Add checks if output is ELF and has
13640 * incremental.h: Include "elfcpp_file.h" and "output.h".
13641 (Incremental_binary): New class.
13642 (Sized_incremental_binary): New class.
13643 (open_incremental_binary): Declare.
13644 * object.cc (is_elf_object): Use
13645 elfcpp::Elf_recognizer::is_elf_file.
13646 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13647 * output.h (Output_file::filesize): New method.
13649 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13651 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13653 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13654 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13656 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13658 (Arm_relocate_functions::movw_abs_nc): New function.
13659 (Arm_relocate_functions::movt_abs): New function.
13660 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13661 (Arm_relocate_functions::thm_movt_abs): New function.
13662 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13663 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13664 (Scan::global): Likewise.
13665 (Relocate::relocate): Likewise.
13666 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13668 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13670 * arm.cc (Arm_relocate_functions::got_prel) New function.
13671 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13672 (Relocate::relocate): Likewise.
13673 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13675 2009-10-06 Ian Lance Taylor <iant@google.com>
13677 * options.h (class General_options): Define
13678 split_stack_adjust_size parameter.
13679 * object.h (class Object): Add uses_split_stack_ and
13680 has_no_split_stack_ fields. Add uses_split_stack and
13681 has_no_split_stack accessor functions. Declare
13682 handle_split_stack_section.
13683 (class Reloc_symbol_changes): Define.
13684 (class Sized_relobj): Define Function_offsets. Declare
13685 split_stack_adjust, split_stack_adjust_reltype, and
13687 * object.cc (Object::handle_split_stack_section): New function.
13688 (Sized_relobj::do_layout): Call handle_split_stack_section.
13689 * dynobj.cc (Sized_dynobj::do_layout): Call
13690 handle_split_stack_section.
13691 * reloc.cc (Sized_relobj::relocate_sections): Call
13692 split_stack_adjust for executable sections in split_stack
13693 objects. Pass reloc_map to relocate_section.
13694 (Sized_relobj::split_stack_adjust): New function.
13695 (Sized_relobj::split_stack_adjust_reltype): New function.
13696 (Sized_relobj::find_functions): New function.
13697 * target-reloc.h: Include "object.h".
13698 (relocate_section): Add reloc_symbol_changes parameter. Change
13700 * target.h (class Target): Add calls_non_split method. Declare
13701 do_calls_non_split virtual method. Declare match_view and
13703 * target.cc: Include "elfcpp.h".
13704 (Target::do_calls_non_split): New function.
13705 (Target::match_view): New function.
13706 (Target::set_view_to_nop): New function.
13707 * gold.cc (queue_middle_tasks): Give an error if mixing
13708 split-stack and non-split-stack objects with -r.
13709 * i386.cc (Target_i386::relocate_section): Add
13710 reloc_symbol_changes parameter.
13711 (Target_i386::do_calls_non_split): New function.
13712 * x86_64.cc (Target_x86_64::relocate_section): Add
13713 reloc_symbol_changes parameter.
13714 (Target_x86_64::do_calls_non_split): New function.
13715 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13717 * powerpc.cc (Target_powerpc::relocate_section): Add
13718 reloc_symbol_changes parameter.
13719 * sparc.cc (Target_sparc::relocate_section): Add
13720 reloc_symbol_changes parameter.
13721 * configure.ac: Call AM_CONDITIONAL for the default target.
13722 * configure: Rebuild.
13723 * testsuite/Makefile.am (TEST_AS): New variable.
13724 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13725 (check_DATA): Add split_i386 and split_x86_64 files.
13726 (SPLIT_DEFSYMS): Define.
13727 (split_i386_[1234n].o): New targets.
13728 (split_i386_[124]): New targets.
13729 (split_i386_[1234r].stdout): New targets.
13730 (split_x86_64_[1234n].o): New targets.
13731 (split_x86_64_[124]): New targets.
13732 (split_x86_64_[1234r].stdout): New targets.
13733 (MOSTLYCLEANFILES): Add new executables.
13734 * testsuite/split_i386.sh: New file.
13735 * testsuite/split_x86_64.sh: New file.
13736 * testsuite/split_i386_1.s: New file.
13737 * testsuite/split_i386_2.s: New file.
13738 * testsuite/split_i386_3.s: New file.
13739 * testsuite/split_i386_4.s: New file.
13740 * testsuite/split_i386_n.s: New file.
13741 * testsuite/split_x86_64_1.s: New file.
13742 * testsuite/split_x86_64_2.s: New file.
13743 * testsuite/split_x86_64_3.s: New file.
13744 * testsuite/split_x86_64_4.s: New file.
13745 * testsuite/split_x86_64_n.s: New file.
13746 * testsuite/testfile.cc (Target_test): Update relocation_section
13748 * testsuite/Makefile.in: Rebuild.
13750 2009-10-06 Ian Lance Taylor <iant@google.com>
13752 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13753 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13754 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13755 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13756 the address on ldo_addrs_.
13757 (Target_i386::Relocate::fix_up_ldo): New function.
13759 2009-10-06 Rafael Espindola <espindola@google.com>
13761 * plugin.cc (add_input_library): New.
13762 (Plugin::load): Add add_input_library to tv.
13763 (Plugin_manager::add_input_file): Add the is_lib argument.
13764 (add_input_file): Update call to Plugin_manager::add_input_file.
13765 (add_input_library): New.
13766 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13768 2009-09-30 Doug Kwan <dougkwan@google.com>
13770 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13771 symbol and call Symbol::may_need_copy_reloc to determine if
13772 a copy reloc is needed.
13773 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13774 nocopyreloc is given in command line.
13775 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13776 given in command line.
13777 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13778 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13779 of the removed Target_i386::may_need_copy_reloc.
13780 * options.h (copyreloc): New option with default value false.
13781 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13782 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13783 instead of the removed Target_powerpc::may_need_copy_reloc.
13784 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13785 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13786 instead of the removed Target_sparc::may_need_copy_reloc.
13787 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13788 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13789 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13790 instead of the removed Target_x86_64::may_need_copy_reloc.
13792 2009-09-30 Ian Lance Taylor <iant@google.com>
13794 * object.h (class Object): Remove target_ field, and target,
13795 sized_target, and set_target methods.
13796 (Object::sized_target): Remove.
13797 (class Sized_relobj): Update declarations. Remove sized_target.
13798 * object.cc (Sized_relobj::setup): Remove target parameter.
13799 Change all callers.
13800 (Input_objects::add_object): Don't do anything with the target.
13801 (make_elf_sized_object): Add punconfigured parameter. Change all
13802 callers. Set or test parameter target.
13803 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13804 Change all callers.
13805 * parameters.cc (Parameters::set_target): Change parameter type to
13807 (Parameters::default_target): Remove.
13808 (set_parameters_target): Change parameter type to be non-const.
13809 (parameters_force_valid_target): New function.
13810 (parameters_clear_target): New function.
13811 * parameters.h (class Parameters): Update declarations. Remove
13812 default_target method. Add sized_target and clear_target
13813 methods. Change target_ to be non-const.
13814 (set_parameters_target): Update declaration.
13815 (parameters_force_valid_target): Declare.
13816 (parameters_clear_target): Declare.
13817 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13818 as NULL if we aren't searching.
13819 (Add_symbols::run): Don't check for compatible target.
13820 * fileread.cc (Input_file::open_binary): Call
13821 parameters_force_valid_target.
13822 * gold.cc (queue_middle_tasks): Likewise.
13823 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13824 set_target on object.
13825 * dynobj.h (class Sized_dynobj): Update declarations.
13826 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13827 make_elf_object returns NULL.
13828 (Archive::include_member): Don't check whether object target is
13830 * output.cc (Output_section::add_input_section): Get target from
13832 (Output_section::relax_input_section): Likewise.
13833 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13835 (Sized_relobj::do_scan_relocs): Likewise.
13836 (Sized_relobj::relocate_sections): Likewise.
13837 * resolve.cc (Symbol_table::resolve): Likewise.
13838 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13839 parameter. Change all callers.
13840 (Symbol_table::add_from_object): Get target from parameters.
13841 (Symbol_table::add_from_relobj): Don't check object target.
13842 (Symbol_table::add_from_dynobj): Likewise.
13843 (Symbol_table::define_special_symbol): Get target from
13845 * symtab.h (class Symbol_table): Update declaration.
13846 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13847 parameter. Change all callers. Clear parameter target.
13848 (Binary_test): Test target here.
13849 * testsuite/object_unittest.cc (gold_testsuite): Remove
13850 target_test_pointer parameter. Change all callers.
13851 (Object_test): Test target here.
13853 2009-09-26 Ian Lance Taylor <iant@google.com>
13855 * testsuite/initpri1.c: Don't try to use constructor priorities if
13856 compiling with gcc before 4.3.
13858 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13860 * testsuite/retain_symbols_file_test.sh (check_present): Change
13861 output file name to retain_symbols_file_test.stdout.
13862 (check_absent): Likewise.
13864 2009-09-18 Craig Silverstein <csilvers@google.com>
13866 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13867 * options.cc: Include <cerrno> and <fstream>.
13868 (General_options::finalize): Parse -retain-symbols-file tag.
13869 * options.h: New flag.
13870 (General_options): New method should_retain_symbol, new
13871 variable symbols_to_retain.
13872 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13873 should_retain_symbol map.
13874 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13875 * testsuite/Makefile.in: Regenerate.
13876 * testsuite/retain_symbols_file_test.sh: New file.
13878 2009-09-18 Nick Clifton <nickc@redhat.com>
13880 * po/es.po: Updated Spanish translation.
13882 2009-09-17 Doug Kwan <dougkwan@google.com>
13884 * debug.h (DEBUG_RELAXATION): New constant.
13885 (DEBUG_ALL): Add DEBUG_RELAXATION.
13886 (debug_string_to_enum): Add relaxation debug option.
13888 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13889 Layout::Relaxation_debug_check::read_sections,
13890 Layout::Relaxation_debug_check::read_sections): New method definitions.
13891 (Layout::Layout): Initialize data members
13892 record_output_section_data_from_scrips_,
13893 script_output_section_data_list_ and relaxation_debug_check_.
13894 (Layout::save_segments, Layout::restore_segments,
13895 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13896 Layout::relaxation_loop_body): New method definitions.
13897 (Layout::finalize): Support relaxation. Move section layout code to
13898 Layout::relaxation_loop_body.
13899 (Layout::set_asection_address_from_script): Move code for orphan
13900 section placement out.
13901 (Layout::place_orphan_sections_in_script): New method definition.
13902 * layout.h (Output_segment_headers, Output_file_header):
13903 New forward class declarations.
13904 (Layout::~Layout): Define.
13905 (Layout::new_output_section_data_from_script): New method definition.
13906 (Layout::place_orphan_sections_in_script): New method declaration.
13907 (Layout::Segment_states): New type declaration.
13908 (Layout::save_segments, Layout::restore_segments,
13909 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13910 Layout::relaxation_loop_body): New method declarations.
13911 (Layout::Output_section_data_list): New type declaration.
13912 (Layout::Relaxation_debug_check): New class definition.
13913 (Layout::record_output_section_data_from_script_,
13914 Layout::script_output_section_data_list_, Layout::segment_states_,
13915 Layout::relaxation_debug_check_): New data members.
13916 * output.cc: (Output_section_headers::do_size): New method definition.
13917 (Output_section_headers::Output_section_headers): Move size
13918 computation to Output_section_headers::do_size.
13919 (Output_segment_headers::do_size): New method definition.
13920 (Output_file_header::Output_file_header): Move size computation to
13921 Output_file_header::do_size and call it.
13922 (Output_file_header::do_size): New method definition.
13923 (Output_data_group::Output_data_group): Adjust call to
13924 Output_section_data.
13925 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13926 (Output_symtab_xindex::do_write): Add array bound check.
13927 (Output_section::Input_section::print_to_mapfile): Handle
13928 RELAXED_INPUT_SECTION_CODE.
13929 (Output_section::Output_section): Initialize data member checkpoint_.
13930 (Output_section::~Output_section): Delete checkpoint object pointed
13932 (Output_section::add_input_section): Always add an Input_section if
13934 (Output_section::add_merge_input_section): Add assert.
13935 (Output_section::relax_input_section): New method definition.
13936 (Output_section::set_final_data_size): Set load address to zero for
13937 an unallocated section.
13938 (Output_section::do_address_and_file_offset_have_reset_values):
13939 New method definition.
13940 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13941 Handle relaxed input section.
13942 (Output_section::sort_attached_input_sections): Checkpoint input
13943 section list lazily.
13944 (Output_section::get_input_sections): Change type of input_sections to
13945 list of Simple_input_section pointers. Checkpoint input section list
13946 lazily. Also handle relaxed input sections.
13947 (Output_section::add_input_section_for_script): Take a reference to
13948 a Simple_input_section object instead of Relobj pointer and section
13949 index as parameter. Handle relaxed input sections.
13950 (Output_section::save_states, Output_section::restore_states): New
13951 method definitions.
13952 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13953 (Output_data::is_data_size_fixed): New method definition.
13954 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13956 (Output_data::address_and_file_offset_have_reset_values): New method
13958 (Output_data::do_address_and_file_offset_have_reset_values): New method
13960 (Output_data::set_data_size): Check that data size is not fixed.
13961 (Output_data::fix_data_size): New method definition.
13962 (Output_data::is_data_size_fixed_): New data member.
13963 (Output_section_headers::set_final_data_size): New method definition.
13964 (Output_section_headers::do_size): New method declaration.
13965 (Output_segment_headers::set_final_data_size): New method definition.
13966 (Output_segment_headers::do_size): New method declaration.
13967 (Output_file_header::set_final_data_size)::New method definition.
13968 (Output_file_header::do_size)::New method declaration.
13969 (Output_section_data::Output_section_data): Add new parameter
13970 is_data_size_fixed and use it to fix data size.
13971 (Output_data_const::Output_data_const): Adjust call to base class
13972 constructor and fix data size.
13973 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13974 base class constructor and fix data size.
13975 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13976 base class constructor and fix data size.
13977 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13978 class constructor and fix data size.
13979 (Output_data_group::set_final_data_size): New method definition.
13980 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13981 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13982 class constructor and fix data size.
13983 (Output_relaxed_input_section): New class definition.
13984 (Output_section::Simple_input_section): New class definition.
13985 (Output_section::get_input_sections): Adjust parameter list.
13986 (Output_section::add_input_section_for_script): Same.
13987 (Output_section::save_states, Output_section::restore_states,
13988 Output_section::do_address_and_file_offset_have_reset_values,
13989 (Output_section::Input_section::Input_section): Handle
13990 RELAXED_INPUT_SECTION_CODE. Add new overload for
13991 Output_relaxed_input_section.
13992 (Output_section::Input_section::is_input_section,
13993 Output_section::Input_section::set_output_section): Handle relaxed
13995 (Output_section::Input_section::is_relaxed_input_section,
13996 Output_section::Input_section::output_section_data,
13997 Output_section::Input_section::relaxed_input_section): New method
13999 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14001 (Output_section::Input_section::u1_): Update comments.
14002 (Output_section::Input_section::u2_): Add new union member poris.
14003 (Output_section::Checkpoint_output_section): New classs definition.
14004 (Output_section::relax_input_section): New method declaration.
14005 (Output_section::checkpoint_): New data member.
14006 (Output_segment): Update comments.
14007 (Output_segment::Output_segment): Un-privatize copy constructor.
14008 (Output_segment::operator=): Un-privatize.
14009 * script-sections.cc (Output_section_element::Input_section_list):
14010 Change element type to Output_section::Simple_input_section.
14011 (Output_section_element_dot_assignment::set_section_addresses):
14012 Register output section data for relaxation clean up.
14013 (Output_data_exression::Output_data_expression): Adjust call to base
14014 constructor to fix data size.
14015 (Output_section_element_data::set_section_addresses): Register
14016 Output_data_expression object for relaxation clean up.
14017 (struct Input_section_info): Replace Relobj pointer and section index
14018 pair with Output_section::Simple_input_section and Convert struct to a
14020 (Input_section_sorter::operator()): Adjust access to
14021 Input_section_info data member to use accessors.
14022 (Output_section_element_input::set_section_addresses): Use layout
14023 parameter. Adjust code to use Output_section::Simple_input_section
14024 and Input_secction_info classes. Register filler for relaxation
14026 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14027 and section index pair with Output_section::Simple_input_section
14028 class. Adjust code accordingly.
14029 (Phdrs_element::release_segment): New method definition.
14030 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14032 (Script_sections::release_segments): New method definition.
14033 * gold/script-sections.h (Script_sections::release_segments): New
14034 method declaration.
14035 * gold/target.h (Target::may_relax, Target::relax,
14036 Target::do_may_relax, Target::do_relax): New method definitions.
14038 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14040 * arm.cc (has_signed_unsigned_overflow): New function.
14041 (Arm_relocate_functions::abs8): New function.
14042 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14043 (Target_arm::Scan::global): Likewise.
14044 (Target_arm::relocate::relocate): Likewise.
14045 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14048 2009-09-16 Cary Coutant <ccoutant@google.com>
14050 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14051 * testsuite/Makefile.in: Regenerate.
14053 2009-09-11 Nick Clifton <nickc@redhat.com>
14055 * po/gold.pot: Updated by the Translation project.
14057 2009-09-08 Cary Coutant <ccoutant@google.com>
14059 * output.cc (Output_file::open): Add execute permission to empty file.
14060 * testsuite/Makefile.am (permission_test): New test.
14061 * testsuite/Makefile.in: Regenerate.
14063 2009-09-02 Ian Lance Taylor <iant@google.com>
14065 * output.cc (Output_file::resize): Call map_no_anonymous rather
14068 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14070 * gold.cc: Include "incremental.h".
14071 (queue_initial_tasks): Call Incremental_checker methods.
14072 * incremental.cc: Include "output.h".
14073 (Incremental_checker::can_incrementally_link_output_file): New
14075 * incremental.h (Incremental_checker): New class.
14077 * output.cc (Output_file::open_for_modification): New method.
14078 (Output_file::map_anonymous): Changed return type to bool. Record
14079 map in base_ field.
14080 (Output_file::map_no_anonymous): New method, broken out of map.
14081 (Output_file::map): Use map_no_anonymous and map_anonymous.
14082 * output.h (class Output_file): Update declarations.
14084 2009-08-24 Cary Coutant <ccoutant@google.com>
14086 * options.h (Command_line::Pre_options): New class.
14087 (Command_line::pre_options): New member.
14088 * options.cc (gold::options::ready_to_register): New variable.
14089 (One_option::register_option): Do nothing if not registering options.
14090 Assert if same short option registered twice.
14091 (General_options::General_options): Turn off option registration when
14093 (Command_line::Pre_options::Pre_options): New constructor.
14095 2009-08-24 Cary Coutant <ccoutant@google.com>
14097 * options.h (General_options::no_keep_memory): Remove incorrect
14100 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14102 * Makefile.am (am__skiplex, am__skipyacc): New.
14103 * Makefile.in: Regenerate.
14105 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14107 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14108 (INCLUDES): ... this.
14109 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14110 (AM_CPPFLAGS): Renamed from ...
14111 (INCLUDE): ... this.
14112 * Makefile.in, testsuite/Makefile.in: Regenerate.
14114 * Makefile.in: Regenerate.
14115 * aclocal.m4: Likewise.
14116 * config.in: Likewise.
14117 * configure: Likewise.
14118 * testsuite/Makefile.in: Likewise.
14120 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14121 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14122 * Makefile.in: Regenerate.
14123 * testsuite/Makefile.in: Regenerate.
14125 2009-08-19 Cary Coutant <ccoutant@google.com>
14127 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14128 symbols in shared libraries overridden by hidden or internal symbols
14129 in the main program.
14131 2009-08-19 Chris Demetriou <cgd@google.com>
14133 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14134 checking source file names in error messages.
14136 2009-08-18 Doug Kwan <dougkwan@google.com>
14138 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14139 an elcpp::Ehdr as parameter. Adjust call to set_target.
14140 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14141 an elfcpp::Ehdr as parameter.
14142 * object.cc (Object::set_target): Remove the version that looks up
14143 a target and sets it.
14144 (Sized_relobj::setup): Take a Target object instead of
14145 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14146 (make_elf_sized_object): Find target and ask target to
14147 make an ELF object.
14148 * object.h: (Object::set_target): Remove the version that looks up
14149 a target and sets it.
14150 (Sized_relobj::setup): Take a Target object instead of
14151 an elfcpp:Ehdr as parameter.
14152 * target.cc: Include dynobj.h.
14153 (Target::do_make_elf_object_implementation): New.
14154 (Target::do_make_elf_object): New.
14155 * target.h (Target::make_elf_object): New template declaration.
14156 (Target::do_make_elf_object): New method declarations.
14157 (Target::do_make_elf_object_implementation): New template declaration.
14159 2009-08-14 Ian Lance Taylor <iant@google.com>
14161 * gold.h (FUNCTION_NAME): Define.
14162 (gold_unreachable): Use FUNCTION_NAME.
14164 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14166 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14167 symbol in the --keep-unique list is not found.
14169 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14171 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14172 been maked as --keep-unique.
14173 (Icf::unfold_section): New function.
14174 * icf.h (Icf::unfold_section): New function.
14175 * options.h (General_options::keep_unique): New option.
14176 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14177 * testsuite/Makefile.in: Regenerate.
14178 * testsuite/icf_keep_unique_test.sh: New file.
14179 * testsuite/icf_keep_unique_test.cc: New file.
14181 2009-08-12 Cary Coutant <ccoutant@google.com>
14184 * resolve.cc (Symbol_table::resolve): Check for references from
14185 dynamic objects to hidden and internal symbols.
14186 * testsuite/Makefile.am (hidden_test.sh): New test.
14187 * testsuite/Makefile.in: Regenerate.
14188 * testsuite/hidden_test.sh: New script.
14189 * testsuite/hidden_test_1.c: New test source.
14190 * testsuite/hidden_test_main.c: New test source.
14192 2009-08-11 Doug Kwan <dougkwan@google.com>
14194 * arm.cc: Update comments.
14195 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14196 segment to locate the .ARM.exidx section if present.
14198 2009-08-09 Doug Kwan <dougkwan@google.com>
14200 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14203 2009-08-07 Sriraman Tallam <tmsriram@google.com>
14204 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14207 2009-08-06 Sriraman Tallam <tmsriram@google.com>
14209 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14210 valid tls_segment only for non-debug-section relocations.
14211 * testsuite/Makefile.am: Add gc_tls_test.
14212 * testsuite/Makefile.in: Regenerate.
14213 * testsuite/gc_tls_test.cc: New file.
14214 * testsuite/gc_tls_test.sh: New file.
14216 2009-08-05 Sriraman Tallam <tmsriram@google.com>
14218 * icf.cc: New file.
14220 * Makefile.am (CCFILES): Add icf.cc.
14221 (HFILES): Add icf.h
14222 * Makefile.in: Regenerate.
14223 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14224 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14225 section, symbol and addend information for the relocs.
14226 * gold.cc (queue_middle_tasks): Call identical code folding.
14227 * gold.h: Add defines for multimap.
14228 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14229 to the call of finalize_local_symbols.
14230 * main.cc (main): Create object of class Icf.
14231 * object.cc (Sized_relobj::do_layout): Allow this function to be
14232 called twice during icf.
14233 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14234 to sections marked as identical by icf.
14235 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14237 (Sized_relobj::do_section_entsize): New function.
14238 * object.h (Object::section_entsize): New function.
14239 (Object::do_section_entsize): New pure virtual function.
14240 (Relobj::finalize_local_symbols): Add new parameter.
14241 (Relobj::do_section_entsize): New function.
14242 * options.h (General_options::icf): New option.
14243 (General_options::icf_iterations): New option.
14244 (General_options::print_icf_sections): New option.
14245 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14246 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14247 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14249 * symtab.cc (Symbol_table::is_section_folded): New function.
14250 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14251 to sections marked as identical by icf.
14252 * symtab.h (Symbol_table::set_icf): New function.
14253 (Symbol_table::icf): New function.
14254 (Symbol_table::is_section_folded): New function.
14255 (Symbol_table::icf_): New data member.
14256 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14257 * testsuite/Makefile.am: Add commands to build icf_test.
14258 * testsuite/Makefile.in: Regenerate.
14259 * testsuite/icf_test.sh: New file.
14260 * testsuite/icf_test.cc: New file.
14262 2009-07-24 Chris Demetriou <cgd@google.com>
14264 * layout.cc (is_compressible_debug_section): Fix incorrect
14265 comment about compressed section names.
14267 2009-07-20 Ian Lance Taylor <ian@airs.com>
14270 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14272 2009-07-16 Ian Lance Taylor <iant@google.com>
14275 * layout.h: #include <map>.
14276 (class Kept_section): Change from struct to class. Add accessors
14277 and setters. Add section size to Comdat_group mapping. Change
14278 Comdat_group to std::map. Add is_comdat_ field. Add
14279 linkonce_size field in union.
14280 (class Layout): Update declaration of find_or_add_kept_section.
14281 Don't declare find_kept_object.
14282 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14283 parameter. Add object, shndx, is_comdat, and is_group_name
14284 parameters. Change all callers. Adjust for new Kept_section.
14285 (Layout::find_kept_object): Remove.
14286 * object.cc (Sized_relobj::include_section_group): Update use of
14287 Kept_section. Rename secnum to shndx. Only record
14288 Kept_comdat_section if sections are the same size.
14289 (Sized_relobj::include_linkonce_section): Update use of
14290 Kept_section. Only record Kept_comdat_section if sections are the
14291 same size. Set size of linkonce section.
14292 (Sized_relobj::map_to_kept_section): Update call to
14293 get_kept_comdat_section.
14294 * object.h (class Sized_relobj): Rename fields in
14295 Kept_comdat_section to drop trailing underscores; change object
14296 field to Relobj*. Change Kept_comdat_section_table to store
14297 struct rather than pointer.
14298 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14299 Add kept_object and kept_shndx parameters. Change all callers.
14300 (Sized_relobj::get_kept_comdat_section): Change return type to
14301 bool. Add kept_object and kept_shndx parameters. Change all
14303 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14304 Layout::find_or_add_kept_section.
14306 2009-07-09 Ian Lance Taylor <iant@google.com>
14308 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14309 Reserve space in the hash table.
14311 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14313 * fileread.cc (File_read::get_mtime): New method.
14314 * fileread.h (Timespec): New structure.
14315 (File_read::get_mtime): New method.
14316 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14317 Renamed from timestamp_nsec.
14318 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14320 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14322 (Incremental_inputs::report_archive): Save mtime; style fix.
14323 (Incremental_inputs::report_obejct): Save mtime; style fix.
14324 (Incremental_inputs::report_script): Save mtime; style fix.
14325 (Incremental_inputs::finalize_inputs): Style fix.
14326 (Incremental_inputs::finalize): Style fix.
14327 (Incremental_inputs::create_input_section_data): Store inputs
14329 * incremental.h (Incremental_inputs::report_script): Add mtime
14331 (Incremental_inputs::Input_info::Input_info): Intialize only one
14333 (Incremental_inputs::Input_info::archive): Move to nameless
14335 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14336 (Incremental_inputs::Input_info::script): Move to nameless union.
14337 (Incremental_inputs::mtime): New field.
14338 * script.cc (read_input_script): Pass file mtime to
14340 * script.h (Script_info::inputs): Style fix.
14342 2009-07-01 Ian Lance Taylor <ian@airs.com>
14344 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14347 2009-06-24 Ian Lance Taylor <iant@google.com>
14350 * layout.cc (Layout::choose_output_section): If we find an
14351 existing section, update the flags.
14352 (Layout::create_notes): New function, broken out of
14354 (Layout::finalize): Don't create note sections.
14355 (Layout::create_note): Don't crash if linker script discards
14357 (Layout::create_gold_note): Likewise.
14358 (Layout::create_build_id): Likewise. Don't set
14359 after_input_sections on the section.
14360 (Layout::create_executable_stack_info): Remove target parameter.
14362 * layout.h (class Layout): Declare create_notes. Update
14363 declaration of create_executable_stack_info.
14364 * gold.cc (queue_middle_tasks): Call create_notes.
14365 * output.cc (Output_section::update_flags_for_input_section): Move
14366 here from output.h. If SHF_ALLOC flag is newly set, mark address
14368 * output.h (Output_data::mark_address_invalid): New function.
14369 (class Output_section): Only declare, not define,
14370 update_flags_for_input_section. Remove set_flags.
14372 2009-06-24 Ian Lance Taylor <iant@google.com>
14374 * script-sections.cc (Output_section_definition::
14375 set_section_addresses): Rename shadowing local load_address to
14378 2009-06-24 Ian Lance Taylor <iant@google.com>
14381 * reloc.cc (relocate_sections): Skip empty relocation sections.
14383 2009-06-23 Ian Lance Taylor <iant@google.com>
14386 * layout.cc (Layout::create_note): Use choose_output_section
14387 rather than make_output_section.
14389 2009-06-23 Ian Lance Taylor <iant@google.com>
14392 * options.cc (General_options::parse_V): Set printed_version_.
14393 (General_options::General_options): Initialize printed_version_.
14394 * options.h (class General_options): Add printed_version_ field.
14395 * gold.cc (queue_initial_tasks): If there are no input files,
14396 don't give a fatal error if we printed the version information.
14397 (queue_middle_tasks): If using -r with a shared object, give a
14398 fatal error rather than an ordinary error.
14400 2009-06-23 Ian Lance Taylor <iant@google.com>
14403 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14404 (Layout::make_output_section): Set have_stabstr_section_ if we see
14405 a .stab*str section.
14406 (Layout::finalize): Call link_stabs_sections.
14407 (Layout::link_stabs_sections): New file.
14408 * layout.h (class Layout): Add have_stabstr_section_ field.
14409 Declare link_stabs_sections.
14411 2009-06-23 Doug Kwan <dougkwan@google.com>
14413 * Makefile.am (libgold_a_LIBADD): New.
14414 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14415 * Makefile.in: Regenerate.
14416 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14417 * configure: Regenerate.
14418 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14419 * fileread.cc: Include sys/state.h
14420 * gold.h: Declare memmem and strndup if found missing.
14421 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14423 2009-06-23 Ian Lance Taylor <iant@google.com>
14425 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14426 * configure: Rebuild.
14428 2009-06-23 Ian Lance Taylor <iant@google.com>
14431 * object.cc (Object::section_contents): Don't try to get a view if
14432 the section has length zero.
14433 (Object::handle_gnu_warning_section): If the section is empty, use
14434 the name of the section as the warning.
14436 2009-06-23 Ian Lance Taylor <iant@google.com>
14439 * stringpool.h (class Stringpool_template): Add optimize_ field.
14440 (Stringpool_template::set_optimize): New function.
14441 * stringpool.cc (Stringpool_template::Stringpool_template):
14442 Initialize optimize_ field.
14443 (Stringpool_template::set_string_offsets): Test local optimize
14444 fild rather than parameter.
14445 * layout.cc (Layout::Layout): Call set_optimize on the section
14448 2009-06-22 Ian Lance Taylor <iant@google.com>
14451 * yyscript.y: Parse TARGET.
14452 * script.cc (script_set_target): New function.
14453 * script-c.h (script_set_target): Declare.
14454 * options.cc (General_options::string_to_object_format): Rename
14455 from string_to_object_format in anonymous namespace. Change
14457 * options.h (class General_options): Declare
14458 string_to_object_format.
14460 2009-06-22 Ian Lance Taylor <iant@google.com>
14462 * script-sections.cc (Script_sections::create_segments): Don't put
14463 program headers in a PT_LOAD segment if -n or -N.
14465 2009-06-22 Ian Lance Taylor <iant@google.com>
14468 * options.h (class General_options): Add -z lazy and -z now. Sort
14469 -z options into alphabetical order.
14470 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14472 2009-06-21 Ian Lance Taylor <iant@google.com>
14474 * layout.cc (Layout::make_output_section): Call
14475 Target::new_output_section.
14476 (Layout::attach_allocated_section_to_segment): Put large section
14477 sections in a separate load segment with the large segment flag
14479 (Layout::segment_precedes): Sort large data segments after other
14481 (align_file_offset): New static function.
14482 (Layout::set_segment_offsets): Use align_file_offset.
14483 * output.h (class Output_section): Add is_small_section_ and
14484 is_large_section_ fields.
14485 (Output_section::is_small_section): New function.
14486 (Output_section::set_is_small_section): New function.
14487 (Output_section::is_large_section): New function.
14488 (Output_section::set_is_large_section): New function.
14489 (Output_section::is_large_data_section): New function.
14490 (class Output_segment): Add is_large_data_segment_ field.
14491 (Output_segment::is_large_data_segment): New function.
14492 (Output_segment::set_is_large_data_segment): New function.
14493 * output.cc (Output_section::Output_section): Initialize new
14495 (Output_segment::Output_segment): Likewise.
14496 (Output_segment::add_output_section): Add assertion that large
14497 data sections always go in large data segments. Force small data
14498 sections to the end of the list of data sections. Force small BSS
14499 sections to the start of the list of BSS sections. For large BSS
14500 sections to the end of the list of BSS sections.
14501 * symtab.h (class Symbol): Declare is_common_shndx.
14502 (Symbol::is_defined): Check Symbol::is_common_shndx.
14503 (Symbol::is_common): Likewise.
14504 (class Symbol_table): Define enum Commons_section_type. Update
14505 declarations. Add small_commons_ and large_commons_ fields.
14506 * symtab.cc (Symbol::is_common_shndx): New function.
14507 (Symbol_table::Symbol_table): Initialize new fields.
14508 (Symbol_table::add_from_object): Put small and large common
14509 symbols in the right list.
14510 (Symbol_table::sized_finalized_symbol): Check
14511 Symbol::is_common_shndx.
14512 (Symbol_table::sized_write_globals): Likewise.
14513 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14514 common symbol lists. Don't call do_allocate_commons_list if the
14516 (Symbol_table::do_allocate_commons_list): Remove is_tls
14517 parameter. Add comons_section_type parameter. Change all
14518 callers. Handle small and large common symbols.
14519 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14520 Symbol::is_common_shndx.
14521 * resolve.cc (symbol_to_bits): Likewise.
14522 * target.h (Target::small_common_shndx): New function.
14523 (Target::small_common_section_flags): New function.
14524 (Target::large_common_shndx): New function.
14525 (Target::large_common_section_flags): New function.
14526 (Target::new_output_section): New function.
14527 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14528 small_common_section_flags, and large_common_section_flags
14530 (Target::do_new_output_section): New virtual function.
14531 * arm.cc (Target_arm::arm_info): Initialize new fields.
14532 * i386.cc (Target_i386::i386_info): Likewise.
14533 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14535 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14536 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14537 (Target_x86_64::do_new_output_section): New function.
14538 * configure.ac: Define conditional MCMODEL_MEDIUM.
14539 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14540 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14541 (large_LDFLAGS): Define.
14542 * testsuite/large.c: New file.
14543 * testsuite/testfile.cc (Target_test::test_target_info):
14544 Initialize new fields.
14545 * configure, testsuite/Makefile.in: Rebuild.
14547 2009-06-05 Doug Kwan <dougkwan@google.com>
14549 * Makefile.am (CCFILES): Add target.cc.
14550 * Makefile.in: Regenerate.
14551 * i386.cc (class Target_i386): Define new virtual method to
14552 override do_is_local_label_name in parent.
14553 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14554 local symbols if --discard-locals or -X is given.
14555 * options.h (class General_options): Declare new options
14556 '--discard-locals' and '-X' for discarding locals.
14557 * target.h (class Target): Define new methods is_local_label_name.
14558 Declare new virtual method do_is_local_label_name.
14559 * target.cc: New file.
14560 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14561 (check_SCRIPTS): Add discard_locals_test.sh.
14562 (check_DATA): Add discard_local_tests.syms.
14563 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14564 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14565 * testsuite/Makefile.in: Regenerate.
14566 * testsuite/discard_locals_test.c: New file.
14567 * testsuite/discard_locals_test.sh: Same.
14569 2009-06-05 Doug Kwan <dougkwan@google.com>
14571 * object.cc (Sized_relobj::Sized_relobj): Initialize
14572 discarded_eh_frame_shndx_ to -1U.
14573 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14575 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14576 a discarded .eh_frame section.
14577 (Sized_relobj::do_finalize_local_symbols): Ditto.
14578 * object.h (class Sized_relobj): Declare new member
14579 discarded_eh_frame_shndx_.
14580 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14581 (local_labels_test.o, local_labels_test): New rules.
14582 * testsuite/Makefile.in: Regenerate.
14584 2009-06-04 Doug Kwan <dougkwan@google.com>
14586 * layout.cc (Layout::section_name_mapping): Add mapping for
14587 special ARM sections.
14589 2009-06-03 Doug Kwan <dougkwan@google.com>
14591 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14592 (utils::has_overflow): Same.
14594 2009-06-03 Ian Lance Taylor <iant@google.com>
14596 * layout.cc (Layout::section_name_mapping): New array, replacing
14597 Layout::linkonce_mapping.
14598 (Layout::section_name_mapping_count): New variable, replacing
14599 Layout::linkonce_mapping_count.
14600 (Layout::linkonce_output_name): Remove.
14601 (Layout::output_section_name): Rewrite.
14602 * layout.h (class Layout): Rename Linkonce_mapping to
14603 Section_name_mapping, linkonce_mapping to section_name_mapping,
14604 linkonce_mapping_count to section_name_mapping_count. Don't
14605 declare linkonce_output_name.
14607 2009-06-03 Doug Kwan <dougkwan@google.com>
14609 * gold/arm.cc (namespace utils): New.
14610 (Target_arm::reloc_is_non_pic): Define new method.
14611 (class Arm_relocate_functions): New.
14612 (Target_arm::Relocate::relocate): Handle relocation types used by
14615 2009-06-03 Ian Lance Taylor <iant@google.com>
14617 * arm.cc (Target_arm::scan::global): Use || instead of |.
14619 2009-06-02 Doug Kwan <dougkwan@google.com>
14621 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14622 issued_non_pic_error_.
14623 (class Target_arm::Scan): Declare new method check_non_pic.
14624 Define new method symbol_needs_plt_entry.
14625 Declare new data member issued_non_pic_error_.
14626 (class Target_arm::Relocate): Declare new method
14627 should_apply_static_reloc.
14628 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14629 (Target_arm::Scan::check_non_pic): Define new method.
14630 (Target_arm::Scan::local): Handle a small subset of reloc types used
14632 (Target_arm::Scan::local): Same.
14633 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14635 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14637 * incremental.cc (Incremental_inputs::report_command_line): Filter
14638 out --incremental-* options.
14640 2009-05-29 Doug Kwan <dougkwan@google.com>
14642 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14644 (class Target_arm): Update comment.
14645 (Target_arm::Target_arm): Initialize new data members GOT_,
14646 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14647 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14648 and Target_arm::rel_dyn_section.
14649 Declare new_enum Target_arm::Got_type.
14650 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14652 Update commments for member do_dynsym_value.
14653 (Target_arm::got_size, Target_arm::plt_section,
14654 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14655 new methods inside class defintion.
14656 (Target_arm::got_section): Define new method.
14657 (Target_arm::rel_dyn_section): Same.
14658 (Output_data_plt_arm): New template class.
14659 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14660 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14661 (Output_data_plt_arm::add_entry): Same.
14662 (Output_data_plt_arm::first_plt_entry): Define new
14663 static data member for PLT instruction template.
14664 (Output_data_plt_arm::plt_entry): Same.
14665 (Output_data_plt_arm::do_write): Define new method.
14666 (Target_arm::make_plt_entry): Same.
14667 (Target_arm::do_finalize_sections): Same.
14668 (Target_arm::do_dynsym_value): Same.
14670 2009-05-28 Doug Kwan <dougkwan@google.com>
14672 * Makefile.am (TARGETSOURCES): Add arm.cc.
14673 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14674 * Makefile.in: Regenerate.
14675 * arm.cc: New file.
14676 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14678 2009-05-26 Doug Kwan <dougkwan@google.com>
14680 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14681 (General_options::check_excluded_libs): Strip off directories in
14682 archive name before matching like GNU ld does.
14683 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14684 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14685 (exclude_libs_test_LDFLAGS): Add linker option
14686 -Wl,--exclude-libs,libexclude_libs_test_3
14687 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14688 an explicit archive without using -l.
14689 (alt/libexclude_libs_test_3.a): New make rule.
14690 * testsuite/Makefile.in: Regenerate.
14691 * testsuite/exclude_libs_test.c : Declare lib3_default().
14693 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14694 * exclude_libs_test_3.c: New file.
14696 2009-05-26 Nick Clifton <nickc@redhat.com>
14698 * po/id.po: New Indonesian translation.
14699 * po/gold.pot: Updated template file.
14701 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14703 * testsuite/Makefile.am: Add -ffunction-sections to compile
14704 gc_comdat_test files. Add -Wl,--gc-sections to build
14706 * testsuite/Makefile.in: Regenerate.
14707 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14709 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14711 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14712 kept comdat section was garbage collected.
14713 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14714 * testsuite/Makefile.in: Regenerate.
14715 * testsuite/gc_comdat_test.sh: New file.
14716 * testsuite/gc_comdat_test_1.cc: New file.
14717 * testsuite/gc_comdat_test_2.cc: New file.
14719 2009-05-19 Doug Kwan <dougkwan@google.com>
14721 * archive.cc (Archive::Archive): Move constructor from archive.h
14722 to here. Initialize no_export_.
14723 (Archive::get_elf_object_for_member): Set no_export flag of object.
14724 * archive.h (Archive::Archive): Move constructor body to
14726 (Archive::no_export): New method.
14727 (Archive::no_export_): New field.
14728 * object.h (Object::Object): Initialize no_export_ to false.
14729 (Object::no_export, Object::set_no_export): New methods.
14730 (Object::no_export_): New field.
14731 * options.cc (General_options::parse_exclude_libs): New method.
14732 (General_options::check_excluded_libs) Same.
14733 * options.h (exclude_libs): New option.
14734 (General_options::check_excluded_libs): New method declaration.
14735 (General_options::excluded_libs_): New field.
14736 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14737 default or protected visibility if an object has no-export flag set.
14738 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14739 (check_SCRIPTS): Add exclude_libs_test.sh.
14740 (check_DATA): Add exclude_libs_test.syms.
14741 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14742 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14743 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14744 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14745 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14746 libexclude_libs_test_2.a): New rules.
14747 * testsuite/Makefile.in: Regenerate.
14748 * testsuite/exclude_libs_test.c: New file.
14749 * testsuite/exclude_libs_test.sh: Ditto.
14750 * testsuite/exclude_libs_test_1.c: Ditto.
14751 * testsuite/exclude_libs_test_2.c: Ditto.
14753 2009-05-15 Ian Lance Taylor <iant@google.com>
14755 * configure.ac: Check for declarations for cases where libiberty.h
14756 checks HAVE_DECL_xxx.
14757 * configure, config.in: Rebuild.
14759 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14761 * gold.h (Incremental_argument_list): Remove (invalid) forward
14763 * incremental.cc (Incremental_inputs::report_achive): New method.
14764 (Incremental_inputs::report_object): New method.
14765 (Incremental_inputs::report_script): New method.
14766 (Incremental_inputs::finalize_inputs): New method.
14767 (Incremental_inputs::finalize): Call finalize_inputs().
14768 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14769 Create inputs entries.
14770 * incremental.h (Incremental_input_type): New enum.
14771 (Incremental_inputs::Incremental_input): Initialize new fields.
14772 (Incremental_inputs::report_inputs): New method.
14773 (Incremental_inputs::report_achive): New method.
14774 (Incremental_inputs::report_object): New method.
14775 (Incremental_inputs::report_script): New method.
14776 (Incremental_inputs::finalize_inputs): New method.
14777 (Incremental_inputs::Input_info): New struct.
14778 (Incremental_inputs::Input_info_map): New typedef.
14779 (Incremental_inputs::lock_): New field.
14780 (Incremental_inputs::Inputs_): New field.
14781 (Incremental_inputs::Inputs_map): New field.
14782 * main.cc (main): Call Incremental_input::report_inputs.
14783 * options.h (Input_argument_list): Typedef moved from
14785 (Input_file_group::Files): Remove, use ::Input_argument_list.
14786 (Input_file_group::Input_argument_list): Remove, use
14787 ::Input_argument_list.
14788 * plugin.cc (Plugin_manager::add_input_file): Add error in
14790 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14792 * script.cc (read_input_script): Call
14793 Incremental_input::report_script.
14794 * script.h (Script_info): New class.
14796 2009-04-27 Ian Lance Taylor <iant@google.com>
14798 * x86_64.cc (do_adjust_output_section): Set entsize to
14801 2009-04-23 Elliott Hughes <enh@google.com>
14803 * output.cc (Output_file::close): After short writes, continue
14804 writing from the correct offset in the buffer being written.
14806 2009-04-23 Chris Demetriou <cgd@google.com>
14808 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14809 * configure: Regenerate.
14810 * config.in: Regenerate.
14811 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14812 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14814 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14816 * incremental.cc (Incremental_inputs_header_data): Renamed from
14817 Incremental_input_header_data.
14818 (Incremental_inputs_header_data::data_size): New field.
14819 (Incremental_inputs_header_data::put_input_file_count): Renamed
14820 from input_file_count.
14821 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14822 from command_line_offset.
14823 (Incremental_inputs_header_data::put_reserved): Renamed from
14825 (Incremental_inputs_entry_data): Renamed from
14826 Incremental_input_entry_data.
14827 (Incremental_inputs_entry_data::data_size): New field.
14828 (Incremental_inputs::report_command_line): New method.
14829 (Incremental_inputs::finalize): New method.
14830 (Incremental_inputs::create_incremental_inputs_data): New method.
14831 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14832 * incremental.h: New file.
14833 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14834 (Layout::finalize): Create incremental inputs section in
14835 incremental builds.
14836 (Layout::create_incremental_info_sections): New method.
14837 * layout.h (Layout::incremental_inputs): New method.
14838 (Layout::create_incremental_info_sections): New method.
14839 (Layout::incremental_inputs_): New field.
14840 * main.cc (main): Notify Incremental_input of the command line.
14842 2009-04-01 Ian Lance Taylor <iant@google.com>
14843 Mikolaj Zalewski <mikolajz@google.com>
14845 * gold.h (reserve_unordered_map): Define, three versions, one for
14846 each version of Unordered_map.
14847 * layout.cc (Layout::Layout): Remove options parameter. Add
14848 number_of_input_files parameter. Don't initialize options_.
14849 Initialize number_of_input_files_ and resized_signatures_. Move
14850 sections_are_attached_.
14851 (Layout::layout_group): Reserve space for group_signatures_.
14852 (Layout::find_or_add_kept_section): Change name parameter to be a
14853 reference. Resize signatures_ map when it gets large enough.
14854 (Layout::layout_eh_frame): Use parameters->options() instead of
14856 (Layout::make_output_section): Likewise.
14857 (Layout::attach_allocated_section_to_segment): Likewise.
14858 (Layout::finalize, Layout::create_executable_stack): Likewise.
14859 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14860 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14861 * layout.h (class Layout): Update declarations. Remove options_
14862 field. Add number_of_input_files_ and resized_signatures_
14863 fields. Move sections_are_attached_ field.
14864 * main.cc (main): Pass number of input files to Layout
14865 constructor. Don't pass options.
14867 2009-03-30 Ian Lance Taylor <iant@google.com>
14869 * ffsll.c (ffsll): Correct implementation.
14871 2009-03-27 Ian Lance Taylor <iant@google.com>
14873 * ffsll.c: New file.
14874 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14875 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14876 * ftruncate.c (ftruncate): Declare before definition.
14877 * mremap.c (mremap): Likewise.
14878 * pread.c (pread): Likewise.
14879 * configure, Makefile.in, config.in: Rebuild.
14881 * mremap.c: New file.
14882 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14883 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14884 (mremap): Declare if HAVE_MREMAP is not defined.
14885 * configure, Makefile.in, config.in: Rebuild.
14887 2009-03-27 Cary Coutant <ccoutant@google.com>
14889 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14890 position independent.
14891 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14892 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14894 2009-03-24 Cary Coutant <ccoutant@google.com>
14896 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14898 (needs_dynamic_reloc): Likewise.
14900 2009-03-24 Ian Lance Taylor <iant@google.com>
14902 * yyscript.y (file_cmd): Recognize EXTERN.
14903 (extern_name_list, extern_name_list_body): New nonterminals.
14904 * script.cc (script_add_extern): Define.
14905 * script-c.h (script_add_extern): Declare.
14907 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
14909 * object.cc (is_elf_object): Define.
14910 * object.h (is_elf_object): Declare.
14911 * archive.cc (Archive::get_elf_object_for_member): Call
14913 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14915 2009-03-24 Elliott Hughes <enh@google.com>
14917 * output.cc (Output_file::map_anonymous): Define.
14918 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14919 try an anonymous one. Report the size if the mmap fails.
14920 * output.h (class Output_file): Declare map_anonymous.
14922 2009-03-24 Ian Lance Taylor <iant@google.com>
14924 * target-select.cc (instantiate_target): Don't acquire the lock if
14925 the instantiated_target_ field has already been set.
14927 2009-03-23 Ian Lance Taylor <iant@google.com>
14929 * gold-threads.h (class Initialize_lock): Define.
14930 * gold-threads.cc (class Initialize_lock_once): Define.
14931 (initialize_lock_control): New static variable.
14932 (initialize_lock_pointer): New static variable.
14933 (initialize_lock_once): New static function.
14934 (Initialize_lock::Initialize_lock): Define.
14935 (Initialize_lock::initialize): Define.
14936 * target-select.h: Include "gold-threads.h".
14937 (class Target_selector): Add lock_ and initialize_lock_ fields.
14938 Don't define instantiate_target, just declare it.
14939 * target-select.cc (Target_selector::Target_selector): Initialize
14941 (Target_selector::instantiate_target): Define.
14942 * descriptors.h: Include "gold-threads.h".
14943 (class Descriptors): Add initialize_lock_ field.
14944 * descriptors.cc (Descriptors::Descriptors): Initialize new
14946 (Descriptors::open): Use initialize_lock_ field
14947 * errors.h (class Errors): Add initialize_lock_ field.
14948 * errors.cc (Errors::Errors): Initialize new field.
14949 (Errors::initialize_lock): Use initialize_lock_ field.
14950 * powerpc.cc (class Target_selector_powerpc): Remove
14951 instantiated_target_ field. In do_recognize call
14952 instantiate_target rather than do_instantiate_target. In
14953 do_instantiate_target just allocate a new target.
14954 * sparc.cc (class Target_selector_sparc): Likewise.
14956 * freebsd.h: New file.
14957 * i386.cc: Include "freebsd.h".
14958 (Target_i386): Derive from Target_freebsd rather than
14960 (Target_selector_i386): Derive from Target_selector_freebsd rather
14961 than Target_selector.
14962 * x86_64.cc: Include "freebsd.h".
14963 (Target_x86_64): Derive from Target_freebsd rather than
14965 (Target_selector_x86_64): Derive from Target_selector_freebsd
14966 rather than Target_selector.
14967 * target.h (class Target): Add adjust_elf_header and
14968 do_adjust_elf_header.
14969 * output.cc (Output_file_header:: do_sized_write): Call target
14970 adjust_elf_header routine.
14971 * configure.tgt: Set targ_osabi.
14972 * configure.ac: Define GOLD_DEFAULT_OSABI.
14973 * parameters.cc (Parameters::default_target): Pass
14974 GOLD_DEFAULT_OSABI to select_target.
14975 * target-select.h (class Target_selector): Make instantiate_target
14976 protected rather than private.
14977 * Makefile.am (HFILES): Add freebsd.h.
14978 * configure, Makefile.in, config.in: Rebuild.
14980 * merge.cc (do_add_input_section): Correct pend value. Change
14981 message about last entry not being null terminated from error to
14984 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14986 * incremental.cc: New file.
14987 * Makefile.am (CCFILES): Add incremental.cc.
14988 * Makefile.in: Rebuild.
14990 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14992 * layout.cc (Layout::output_section_name): Preserve names
14993 of '.note.' sections.
14995 2009-03-19 Ian Lance Taylor <iant@google.com>
14997 * descriptors.cc (Descriptors::open): Check that the options are
14998 valid before using them.
15000 2009-03-18 Ian Lance Taylor <iant@google.com>
15002 * script-sections.h: Include <list>.
15003 (class Script_sections): Change Sections_elements from std::vector
15004 to std::list. Typedef public Elements_iterator. Add
15005 orphan_section_placement_, data_segment_align_start_, and
15006 saw_data_segment_align_ fields. Remove data_segment_align_index_
15008 * script-sections.cc (class Orphan_section_placement): New class.
15009 (class Sections_element): Add virtual functions is_relro and
15010 orphan_section_init. Remove virtual function place_orphan_here.
15011 (class Output_section_definition): Add is_relro and
15012 orphan_section_init. Remove place_orphan_here.
15013 (class Orphan_output_section): Likewise.
15014 (Script_sections::Script_sections): Update for field changes.
15015 (Script_sections::data_segment_align): Set saw_data_segment_align_
15016 and data_segment_align_start_, not data_segment_align_index.
15017 (Script_sections::data_segment_relro_end): Check
15018 saw_data_segment_align_. Use data_segment_align_start_ rather
15019 than data_segment_align_index_.
15020 (Script_sections::place_orphan): Rewrite to use
15021 Orphan_section_placement.
15023 2009-03-17 Ian Lance Taylor <iant@google.com>
15025 * archive.cc (Archive::add_symbols): Check for a version attached
15026 to the symbol name in the archive map.
15027 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15028 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15029 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15030 (ver_test_11.a): New target.
15031 * testsuite/Makefile.in: Rebuild.
15033 * configure.ac: Check for chsize and posix_fallocate. Replace
15035 * ftruncate.c: New file, from gnulib.
15036 * output.cc (posix_fallocate): Define dummy version if not
15037 HAVE_POSIX_FALLOCATE.
15038 (Output_file::map): Call posix_fallocate rather than lseek and
15040 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15041 * configure, Makefile.in, config.in: Rebuild.
15043 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
15045 * layout.h (Layout::create_note): Add section_name parameter.
15046 * layout.cc (Layout::create_note): Likewise.
15047 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
15049 2009-03-17 Ian Lance Taylor <iant@google.com>
15051 * descriptors.cc: Include "options.h".
15052 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15053 (Descriptors::open): Always use O_CLOEXEC when opening a new
15054 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15055 then set FD_CLOEXEC.
15057 * sparc.cc (class Target_sparc): Add has_got_section.
15058 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15059 make sure we have a GOT section.
15061 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15062 (Target_sparc::Scan::local): Likewise.
15063 (Target_sparc::Scan::global): Likewise.
15064 (Target_sparc::Relocate::relocate): Likewise.
15065 (Target_sparc::Relocate::relocate_tls): Likewise.
15067 * symtab.cc (Symbol_table::define_default_version): New function,
15068 broken out of add_from_object.
15069 (Symbol_table::add_from_object): Call define_default_version.
15070 (Symbol_table::define_special_symbol): Add resolve_oldsym
15071 parameter. Change all callers. If the version for a symbol comes
15072 from a version script, resolve it with the symbol with the same
15073 name with no version. Also add the symbol without a version if
15075 (do_define_in_output_data): If resolving with oldsym, don't delete
15077 (do_define_in_output_segment): Likewise.
15078 (do_define_as_constant): Likewise.
15079 * symtab.h (class Symbol_table): Update declarations.
15081 2009-03-13 Ian Lance Taylor <iant@google.com>
15083 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15084 (Read_symbols::requeue): New function.
15085 (Read_symbols::do_read_symbols): If make_elf_object fails because
15086 the target type is not configured, and the file was searched for,
15087 issue a warning and retry with the next directory.
15088 (Add_symbols::run): If the file has an incompatible format, and
15089 it was searched for, requeue the Read_symbols task. On error,
15090 release the object.
15091 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15092 dirindex parameter to constructor. Change all callers. Declare
15093 incompatible_warning and requeue.
15094 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15095 input_argument_ and input_group_ fields. Add them to
15096 constructor. Change all callers.
15097 (class Read_script): Add dirindex_ field. Add it to constructor.
15098 Change all callers.
15099 * archive.cc (Archive::setup): Remove input_objects parameter.
15100 Change all callers.
15101 (Archive::get_file_and_offset): Likewise.
15102 (Archive::read_all_symbols): Likewise.
15103 (Archive::read_symbols): Likewise.
15104 (Archive::get_elf_object_for_member): Remove input_objects
15105 parameter. Add punconfigured parameter. Change all callers.
15106 (Archive::add_symbols): Change return type to bool. Check return
15107 value of include_member.
15108 (Archive::include_all_members): Likewise.
15109 (Archive::include_member): Change return type to bool. Return
15110 false if first included object has incompatible target. Set
15111 included_member_ field.
15112 (Add_archive_symbols::run): If add_symbols returns false, requeue
15114 * archive.h (class Archive): Add included_member_ field.
15115 Initialize it in constructor. Add input_file and searched_for
15116 methods. Update declarations.
15117 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15118 input_argument_ fields. Add them to constructor. Change all
15120 * script.cc: Include "target-select.h".
15121 (class Parser_closure): Add skip_on_incompatible_target_ and
15122 found_incompatible_target_ fields. Add
15123 skip_on_incompatible_target parameter to constructor. Change all
15124 callers. Add methods skip_on_incompatible_target,
15125 clear_skip_on_incompatible_target, found_incompatible_target, and
15126 set_found_incompatible_target.
15127 (read_input_script): Add dirindex parameter. Change all callers.
15128 If parser finds an incompatible target, requeue Read_symbols
15130 (script_set_symbol): Clear skip_on_incompatible_target in
15132 (script_add_assertion, script_parse_option): Likewise.
15133 (script_start_sections, script_add_phdr): Likewise.
15134 (script_check_output_format): New function.
15135 * script.h (read_input_script): Update declaration.
15136 * script-c.h (script_check_output_format): Declare.
15137 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15138 (ignore_cmd): Remove OUTPUT_FORMAT.
15139 * fileread.cc (Input_file::Input_file): Add explicit this.
15140 (Input_file::will_search_for): New function.
15141 (Input_file::open): Add pindex parameter. Change all callers.
15142 * fileread.h (class Input_file): Add input_file_argument method.
15143 Declare will_search_for. Update declarations.
15144 * object.cc (make_elf_object): Add punconfigured parameter.
15145 Change all callers.
15146 * object.h (class Object): Make input_file public. Add
15147 searched_for method.
15148 (make_elf_object): Update declaration.
15149 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15151 * dirsearch.h (class Dirsearch): Update declaration.
15152 * options.h (class General_options): Add --warn-search-mismatch.
15153 * parameters.cc (Parameters::is_compatible_target): New function.
15154 * parameters.h (class Parameters): Declare is_compatible_target.
15155 * workqueue.cc (Workqueue::add_blocker): New function.
15156 * workqueue.h (class Workqueue): Declare add_blocker.
15158 * fileread.cc (Input_file::open): Remove options parameter.
15159 Change all callers.
15160 (Input_file::open_binary): Likewise.
15161 * script.cc (read_input_script): Likewise.
15162 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15163 options parameter from constructor. Change all callers.
15164 (class Read_script): Likewise.
15165 * fileread.h (class Input_file): Update declarations.
15166 * script.h (read_input_script): Update declaration.
15168 2009-03-10 Nick Clifton <nickc@redhat.com>
15170 * po/es.po: New Spanish translation.
15172 2009-03-06 Cary Coutant <ccoutant@google.com>
15174 * options.cc (parse_short_option): Keep dash_z from registering itself.
15176 2009-03-03 Ian Lance Taylor <iant@google.com>
15179 * target-reloc.h (relocate_section): Pass output_section to
15181 * i386.cc (Target_i386::should_apply_static_reloc): Add
15182 output_section parameter. Change all callers.
15183 (Target_i386::Relocate::relocate): Add output_section parameter.
15184 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15185 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15186 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15187 * testsuite/two_file_shared.sh: New script.
15188 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15189 (check_DATA): Add two_file_shared.dbg.
15190 (two_file_shared.dbg): New target.
15191 * testsuite/Makefile.in: Rebuild.
15193 2009-03-01 Ian Lance Taylor <iant@google.com>
15195 * configure.ac: Check for byteswap.h.
15196 * configure: Rebuild.
15197 * config.in: Rebuild.
15199 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15201 * layout.cc (Layout::find_or_add_kept_section): New function.
15202 (Layout::add_comdat): Removed.
15203 * layout.h (struct Kept_section): Move out of class Layout.
15204 Remove trailing underscores from field names. Add group_sections
15205 field. Rename group_ field to is_group. Change all uses.
15206 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15207 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15208 comdat_groups_ field.
15209 (Sized_relobj::include_section_group): Use
15210 find_or_add_kept_section and Kept_section::group_sections.
15211 (Sized_relobj::include_linkonce_section): Likewise.
15212 * object.cc (class Sized_relobj): Don't define Comdat_group or
15213 Comdat_group_table. Remove find_comdat_group and
15214 add_comdat_group. Remove comdat_groups_ field.
15215 * plugin.cc (include_comdat_group): Use
15216 Layout::find_or_add_kept_section.
15218 2009-02-28 Ian Lance Taylor <iant@google.com>
15220 * README: --gc-sections and map files are now supported. Document
15221 some build requirements.
15224 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15225 relocatable link set the value of the section symbol to zero.
15226 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15227 relocatable link don't include the section address in the local
15230 2009-02-27 Ian Lance Taylor <iant@google.com>
15233 * options.h (class Search_directory): Add is_system_directory.
15234 (class General_options): Declare is_in_system_directory.
15235 * options.cc (get_relative_sysroot): Make static.
15236 (get_default_sysroot): Make static.
15237 (General_optoins::is_in_system_directory): New function.
15238 * fileread.cc (Input_file::is_in_system_directory): New function.
15239 * fileread.h (class Input_file): Declare is_in_system_directory.
15240 * object.h (class Object): Add is_in_system_directory.
15241 (class Input_objects): Remove system_library_directory_ field.
15242 * object.cc (Input_objects::add_object): Don't set
15243 system_library_directory_.
15244 (input_objects::found_in_system_library_directory): Remove.
15245 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15246 parameter. Change all callers.
15247 (Symbol_table::sized_write_globals): Likewise.
15248 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15249 Call Object::is_in_system_directory.
15250 * symtab.h (class Symbol_table): Update declarations.
15253 * descriptors.h (Open_descriptor): Add is_on_stack field.
15254 * descriptors.cc (Descriptors::open): If the descriptor is on the
15255 top of the stack, remove it. Initialize is_on_stack field.
15256 (Descriptors::release): Only add pod to stack if it is not on the
15258 (Descriptors::close_some_descriptor): Clear stack_next and
15259 is_on_stack fields.
15262 * output.cc (Output_section::find_starting_output_address): Rename
15263 from starting_output_address; add PADDR parameter; change return
15265 * output.h (class Output_section): Declare
15266 find_starting_output_address instead of starting_output_address.
15267 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15268 section symbol for which we can't find a merge section.
15271 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15272 hidden or internal, force the symbol to be local.
15273 * resolve.cc (Symbol::override_visibility): Define.
15274 (Symbol::override_base): Use override_visibility.
15275 (Symbol_table::resolve): Likewise.
15276 (Symbol::override_base_with_special): Likewise.
15277 (Symbol_table::override_with_special): If the visibility is hidden
15278 or internal, force the symbol to be local.
15279 * symtab.h (class Symbol): Add set_visibility and
15280 override_visibility.
15281 * testsuite/ver_test_1.sh: New file.
15282 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15283 (check_DATA): Add ver_test_1.syms.
15284 (ver_test_1.syms): New target.
15285 * testsuite/Makefile.in: Rebuild.
15287 2009-02-25 Cary Coutant <ccoutant@google.com>
15289 * layout.cc (Layout::choose_output_section): Don't rename sections
15290 when using a linker script that has a SECTIONS clause.
15291 * Makefile.in: Regenerate.
15293 * testsuite/Makefile.am (script_test_5.sh): New test case.
15294 * testsuite/Makefile.in: Regenerate.
15295 * testsuite/script_test_5.cc: New file.
15296 * testsuite/script_test_5.sh: New file.
15297 * testsuite/script_test_5.t: New file.
15299 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15301 * archive.cc (Archive::include_member): Update calls to add_symbols.
15302 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15303 the Layout argument.
15304 * dynobj.h (do_add_symbols): Add the Layout argument.
15305 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15307 * object.h (Object::add_symbols): Add the Layout argument.
15308 (Object::do_add_symbols): Add the Layout argument.
15309 (Sized_relobj::do_add_symbols): Add the Layout argument.
15310 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15311 Unify the two versions.
15312 (Add_plugin_symbols): Remove.
15313 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15314 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15315 (Add_plugin_symbols): Remove.
15316 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15317 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15318 (Add_symbols::run): Make it work with Pulginobj.
15320 2009-02-06 Ian Lance Taylor <iant@google.com>
15322 * object.cc (Sized_relobj::do_layout): Make info message start
15323 with lower case letter.
15325 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15327 * binary.cc: Fix file comment.
15329 * options.h (enum Incremental_disposition): Define.
15330 (class General_options): Add new options: --incremental,
15331 --incremental_changed, --incremental_unchanged,
15332 --incremental_unknown. Add incremental_disposition_ and
15333 implicit_incremental_ fields.
15334 (General_options::incremental_disposition): New function.
15335 (class Position_dependent_options): Add incremental_disposition
15337 (Position_dependent_options::copy_from_options): Set incremental
15339 * options.cc (General_options::parse_incremental_changed): New
15341 (General_options::parse_incremental_unchanged): New function.
15342 (General_options::parse_incremental_unknown): New function.
15343 (General_options::General_options): Initialize new fields
15344 incremental_disposition_ and implicit_incremental_.
15345 (General_options::finalize): Check for uasge of --incremental-*
15346 without --incremental.
15348 2009-02-06 Chris Demetriou <cgd@google.com>
15350 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15351 pointer and to report location as the file name associated with
15353 (gold_undefined_symbol_at_location): New function to replace the
15354 old gold_undefined_symbol functionality.
15355 * target-reloc.h (relocate_section): Update to use
15356 gold_undefined_symbol_at_location.
15357 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15358 Call gold_undefined_symbol function rather than gold_error.
15359 * errors.h (Errors::undefined_symbol): Take location as a
15360 string, rather than calculating it from a relocation.
15361 * errors.cc (Errors::fatal): Print "fatal error:" before the
15363 (Errors::error, Errors::error_at_location): Print "error: "
15364 before the formatted message.
15365 (Errors::undefined_symbol): Take location as a string, rather
15366 than calculating it from a relocation.
15367 (gold_undefined_symbol_at_location): New function akin to
15368 old gold_undefined_symbol, calculates location from relocation.
15369 (gold_undefined_symbol): Change to take only a Symbol pointer
15370 and to report location as the file name associated with the symbol.
15371 * testsuite/debug_msg.sh: Update for changed error messages.
15372 * testsuite/undef_symbol.sh: Likewise.
15374 2009-02-04 Duncan Sands <baldrick@free.fr>
15377 * reduced_debug_output.h
15378 (Output_reduced_debug_abbrev_section::failed): Use format for
15380 (Output_reduced_debug_info_section::faild): Likewise.
15382 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15384 * script.cc (Lazy_demangler): New class.
15385 (Version_script_info::get_symbol_version_helper): Demangle a
15388 2009-01-29 Cary Coutant <ccoutant@google.com>
15390 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15392 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15394 2009-01-28 Ian Lance Taylor <iant@google.com>
15396 * version.cc (version_string): Bump to 1.9.
15398 * gold.h: Include <cstring> and <stdint.h>.
15399 * version.cc: Include <cstdio>.
15400 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15402 * reduced_debug_output.cc (insert_into_vector): Rename from
15403 Insert_into_vector; change all callers. Use Swap_unaligned to
15404 avoid aliasing issue; remove union since it is unnecessary.
15406 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15408 * Makefile.am (CCFILES): Add gc.cc.
15409 (HFILES): Add gc.h.
15410 * Makefile.in: Regenerate.
15411 * gold.cc (Gc_runner): New class.
15412 (queue_initial_tasks): Call garbage collection related tasks
15413 when corresponding options are invoked.
15414 (queue_middle_gc_tasks): New function.
15415 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15416 processed early before laying out sections during garbage collection.
15417 * gold.h (queue_middle_gc_tasks): New function.
15418 (is_prefix_of): Move from "layout.cc".
15419 * i386.cc (Target_i386::gc_process_relocs): New function.
15420 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15421 * main.cc (main): Create object of class "Garbage_collection".
15422 * object.cc (Relobj::copy_symbols_data): New function.
15423 (Relobj::is_section_name_included): New function.
15424 (Sized_relobj::do_layout): Allow this function to be called twice
15425 during garbage collection and defer layout of section during the
15427 * object.h (Relobj::get_symbols_data): New function.
15428 (Relobj::is_section_name_included): New function.
15429 (Relobj::copy_symbols_data): New function.
15430 (Relobj::set_symbols_data): New function.
15431 (Relobj::get_relocs_data): New function.
15432 (Relobj::set_relocs_data): New function.
15433 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15434 (Relobj::gc_process_relocs): New function.
15435 (Relobj::do_gc_process_relocs): New pure virtual function.
15436 (Relobj::sd_): New data member.
15437 (Sized_relobj::is_output_section_offset_invalid): New function.
15438 (Sized_relobj::do_gc_process_relocs): New function.
15439 * options.h (General_options::gc_sections): Modify to not be a no-op.
15440 (General_options::print_gc_sections): New option.
15441 * plugin.cc (Plugin_finish::run): Remove function call to
15442 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15443 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15444 * reloc.cc (Read_relocs::run): Add task to process relocs and
15445 determine unreferenced sections when doing garbage collection.
15446 (Gc_process_relocs): New class.
15447 (Sized_relobj::do_gc_process_relocs): New function.
15448 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15449 sections that are garbage collected.
15450 * reloc.h (Gc_process_relocs): New class.
15451 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15452 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15453 symbols whose corresponding sections are garbage collected.
15454 (Symbol_table::Symbol_table): Add new parameter for the garbage
15456 (Symbol_table::gc_mark_undef_symbols): New function.
15457 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15458 (Symbol_table::gc_mark_dyn_syms): New function.
15459 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15461 (Symbol_table::add_from_object): Likewise.
15462 (Symbol_table::add_from_relobj): When building shared objects, do not
15463 treat externally visible symbols as garbage.
15464 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15465 table information for static and relocatable links.
15466 * symtab.h (Symbol_table::set_gc): New function.
15467 (Symbol_table::gc): New function.
15468 (Symbol_table::gc_mark_undef_symbols): New function.
15469 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15470 (Symbol_table::gc_mark_dyn_syms): New function.
15471 (Symbol_table::gc_): New data member.
15472 * target.h (Sized_target::gc_process_relocs): New pure virtual
15474 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15475 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15477 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15479 * options.h (General_options::gc_sections): Define as a no-op for now.
15480 (General_options::no_keep_memory): Ditto.
15481 (General_options::Bshareable): Define.
15482 * options.cc (General_options::finalize): Honor -Bshareable.
15484 2009-01-20 Andreas Schwab <schwab@suse.de>
15486 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15487 read the value in the contents, since we don't use it. Use the
15488 template endianness when writing.
15489 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15491 2009-01-19 Andreas Schwab <schwab@suse.de>
15493 * configure.tgt (powerpc64-*): Fix targ_obj.
15495 2009-01-15 Ian Lance Taylor <iant@google.com>
15497 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15498 local symbols when stripping all symbols.
15500 2009-01-14 Cary Coutant <ccoutant@google.com>
15502 * output.cc (Output_reloc): Add explicit instantiations.
15504 2009-01-14 Cary Coutant <ccoutant@google.com>
15506 * archive.cc (Archive::get_elf_object_for_member): Remove call
15507 to File_read::claim_for_plugin.
15508 * descriptors.cc (Descriptors::open): Remove reference to
15510 (Descriptors::claim_for_plugin): Remove.
15511 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15512 (Descriptors::is_claimed): Remove.
15513 (claim_descriptor_for_plugin): Remove.
15514 * fileread.cc (File_read::claim_for_plugin): Remove.
15515 * fileread.h (File_read::claim_for_plugin): Remove.
15516 (File_read::descriptor): Reopen descriptor if necessary.
15517 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15518 (Plugin_manager::all_symbols_read): Add task parameter. Change
15520 (Plugin_manager::get_input_file): New function.
15521 (Plugin_manager::release_input_file): New function.
15522 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15523 corresponding data member.
15524 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15525 and pass to base constructor. Change all callers.
15526 (get_input_file, release_input_file): New functions.
15527 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15528 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15529 (Plugin_manager::all_symbols_read): Add task parameter.
15530 (Plugin_manager::get_input_file): New function.
15531 (Plugin_manager::release_input_file): New function.
15532 (Plugin_manager::task_): New data member.
15533 (Pluginobj::Pluginobj): Add filesize parameter.
15534 (Pluginobj::filename): New function.
15535 (Pluginobj::descriptor): New function.
15536 (Pluginobj::filesize): New function.
15537 (Pluginobj::filesize_): New data member.
15538 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15539 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15540 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15542 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15543 with archive libraries.
15544 * testsuite/Makefile.in: Regenerate.
15545 * testsuite/plugin_test.c (struct sym_info): New type.
15546 (get_input_file, release_input_file): New static variables.
15547 (onload): Capture new transfer vector entries.
15548 (claim_file_hook): Stop reading at end of file according to filesize.
15549 Factor out parsing of readelf output into separate function.
15550 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15551 APIs and get the source file name from the symbol table. Convert
15552 source file name to corresponding object file name. Print info
15553 message when adding new input files.
15554 (parse_readelf_line): New function.
15555 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15556 * testsuite/plugin_test_2.sh: Likewise.
15557 * testsuite/plugin_test_3.sh: Likewise.
15558 * testsuite/plugin_test_4.sh: New test case.
15560 2009-01-07 Ian Lance Taylor <iant@google.com>
15562 * version.cc (version_string): Bump to 1.8.
15564 2008-12-23 Cary Coutant <ccoutant@google.com>
15566 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15567 * plugin.cc (Plugin_manager::finish): Rename as
15568 layout_deferred_objects. Move cleanup to separate function.
15569 (Plugin_manager::cleanup): New function.
15570 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15572 * plugin.h (Plugin_manager::finish): Rename as
15573 layout_deferred_objects.
15574 (Plugin_manager::cleanup): New function.
15575 (Plugin_manager::cleanup_done): New field.
15577 2008-12-23 Cary Coutant <ccoutant@google.com>
15579 * plugin.cc (is_visible_from_outside): New function.
15580 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15581 so we don't return "IR only" status for exported symbols or -r links.
15583 * testsuite/Makefile.am (plugin_test_3): New test case.
15584 * testsuite/Makefile.in: Regenerate.
15585 * testsuite/plugin_test_3.sh: New file.
15587 2008-12-22 Cary Coutant <ccoutant@google.com>
15589 * object.cc (Sized_relobj::layout_section): New function.
15590 (Sized_relobj::do_layout): Defer layout of input sections until after
15591 plugin has provided replacement files.
15592 (Sized_relobj::do_layout_deferred_sections): New function.
15593 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15594 (Relobj::layout_deferred_sections): New function.
15595 (Relobj::do_layout_deferred_sections): New function.
15596 (Sized_relobj::do_layout_deferred_sections): New function.
15597 (Sized_relobj::layout_section): New function.
15598 (Sized_relobj::Deferred_layout): New structure.
15599 (Sized_relobj::deferred_layout_): New field.
15600 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15601 Change all callers. Layout deferred sections.
15602 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15604 (Plugin_hook::run): Move code from do_plugin_hook inline.
15605 (Plugin_hook::do_plugin_hook): Remove.
15606 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15607 (Plugin_manager::finish): Renamed, was cleanup.
15608 (Plugin_manager::should_defer_layout): New function.
15609 (Plugin_manager::add_deferred_layout_object): New function.
15610 (Plugin_manager::Deferred_layout_list): New type.
15611 (Plugin_manager::deferred_layout_objects_): New field.
15612 (Plugin_hook::do_plugin_hook): Remove.
15614 2008-12-17 Ian Lance Taylor <iant@google.com>
15616 * options.h (class General_options): Add --no case for
15619 2008-12-16 Cary Coutant <ccoutant@google.com>
15621 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15623 (Plugin_manager::claim_file): Create plugin object even if
15624 plugin did not call the add_symbols callback.
15625 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15626 asking for more symbols than were added.
15627 * testsuite/Makefile.am (plugin_test_1): Add test case with
15629 (empty.syms): New target.
15630 * testsuite/Makefile.in: Regenerate.
15631 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15632 message. Don't call add_symbols if no globals.
15633 (all_symbols_read_hook): Don't provide replacement for empty
15636 2008-12-12 Ian Lance Taylor <iant@google.com>
15638 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15639 r_type == 0 for a local symbol with r_sym == 0.
15640 (scan_relocatable_relocs): Pass r_sym to
15641 local_non_section_strategy.
15642 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15645 * configure.ac: Update test for TLS descriptors: they are
15646 supported as of glibc 2.9.
15647 * configure: Rebuild.
15649 2008-12-11 Ian Lance Taylor <iant@google.com>
15652 * target-reloc.h (Default_scan_relocatable_relocs): For each
15653 function, map r_type == 0 to RELOC_DISCARD.
15655 2008-12-10 Cary Coutant <ccoutant@google.com>
15657 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15658 object to override a kept COMDAT group from a plugin object.
15660 2008-12-09 Ian Lance Taylor <iant@google.com>
15663 * yyscript.y (file_cmd): Handle INPUT.
15665 * testsuite/initpri1.c: Change all declarations to be full
15666 prototypes by adding void, to avoid compiler warnings.
15668 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15670 * options.cc (General_options::parse_plugin_opt): New.
15671 (General_options::add_plugin): The argument now is just the filename.
15672 (General_options::add_plugin_option): New.
15673 * options.h (plugin_opt): New.
15674 (add_plugin): Change argument name.
15675 (add_plugin_option): New.
15676 * plugin.cc (Plugin::load): Don't parse the plugin option.
15677 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15678 (Plugin::add_option): New.
15679 (Plugin::args_): Change type.
15680 (Plugin::filename_): New.
15681 (Plugin_manager::add_plugin_option): New.
15682 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15683 * testsuite/Makefile.in: Regenerate.
15685 2008-12-05 Cary Coutant <ccoutant@google.com>
15687 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15688 Handle --strip-lto-sections option.
15689 * options.h (strip_lto_sections): New option.
15691 2008-12-01 Cary Coutant <ccoutant@google.com>
15693 * plugin.cc (ld_plugin_message): Change format parameter to const.
15694 Fix mismatch between new[] and delete.
15696 2008-11-14 Cary Coutant <ccoutant@google.com>
15698 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15701 2008-11-05 Craig Silverstein <csilvers@google.com>
15703 * options.cc (General_options::parse_dynamic_list): New function.
15704 * options.h (General_options): New flags dynamic_list,
15705 dynamic_list_data, dynamic_list_cpp_new, and
15706 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15707 (General_options::in_dynamic_list): New function.
15708 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15709 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15710 (Lex::can_continue_name): Likewise.
15712 (read_script_file): New parameter script_options.
15713 (read_dynamic_list): New function.
15714 (Script_options::define_dynamic_list): New function.
15715 (dynamic_list_keyword_parsecodes): New variable.
15716 (dynamic_list_keywords): New variable.
15717 * script.h (Script_options::define_dynamic_list): New function
15719 (read_dynamic_list): New function prototype.
15720 * symtab.cc (strprefix): New macro.
15721 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15722 dynamic_list_data, dynamic_list_cpp_new, and
15723 dynamic_list_cpp_typeinfo.
15724 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15725 (dynamic_list_expr): New rule.
15726 (dynamic_list_nodes): Likewise.
15727 (dynamic_list_node): Likewise.
15728 * testsuite/Makefile.am (dynamic_list): New test.
15729 * testsuite/Makefile.in: Regenerated.
15730 * testsuite/dynamic_list.t: New file.
15731 * testsuite/dynamic_list.sh: New file.
15733 2008-11-05 Craig Silverstein <csilvers@google.com>
15735 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15736 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15737 (t11_last): Likewise.
15738 * testsuite/ver_test_6.c (main): Likewise.
15740 2008-10-07 Cary Coutant <ccoutant@google.com>
15742 * options.c (General_options::finalize): Add check for -static and
15744 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15747 2008-10-02 Cary Coutant <ccoutant@google.com>
15749 * plugin.cc (make_sized_plugin_object): Fix conditional
15750 compilation to work when not all targets are enabled.
15752 2008-09-29 Cary Coutant <ccoutant@google.com>
15754 * archive.cc (Archive::get_file_and_offset): Use filename instead
15755 of name to get library path.
15756 (Archive::include_member): Unlock external member of a thin archive.
15758 * testsuite/Makefile.am (TEST_AR): New variable.
15759 (thin_archive_test_1): New test.
15760 (thin_archive_test_2): New test.
15761 * testsuite/Makefile.in: Regenerate.
15762 * testsuite/thin_archive_main.cc: New file.
15763 * testsuite/thin_archive_test_1.cc: New file.
15764 * testsuite/thin_archive_test_2.cc: New file.
15765 * testsuite/thin_archive_test_3.cc: New file.
15766 * testsuite/thin_archive_test_4.cc: New file.
15768 2008-09-29 Cary Coutant <ccoutant@google.com>
15770 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15771 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15773 (Sized_relobj::do_finalize_local_symbols): Likewise.
15774 (Sized_relobj::map_to_kept_section): Likewise.
15775 * object.h (Sized_relobj::invalid_address): New constant.
15776 (Sized_relobj::do_output_section_offset): Check for invalid_address
15778 * output.cc (Output_reloc::local_section_offset): Use constant
15779 invalid_address instead of -1U.
15780 (Output_reloc::get_address): Likewise.
15781 (Output_section::output_address): Change -1U to -1ULL.
15782 * output.h (Output_reloc::invalid_address): New constant.
15783 * reloc.cc (Sized_relobj::write_sections): Use constant
15784 invalid_address instead of -1U.
15785 (Sized_relobj::relocate_sections): Likewise.
15786 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15787 values for merge sections.
15788 * target-reloc.h (relocate_for_relocatable): Use constant
15789 invalid_address instead of -1U.
15791 2008-09-19 Cary Coutant <ccoutant@google.com>
15793 Add plugin functionality for link-time optimization (LTO).
15794 * configure.ac (plugins): Add --enable-plugins option.
15795 * configure: Regenerate.
15796 * config.in: Regenerate.
15797 * Makefile.am (LIBDL): New variable.
15798 (CCFILES): Add plugin.cc.
15799 (HFILES): Add plugin.h.
15800 (ldadd_var): Add LIBDL.
15801 * Makefile.in: Regenerate.
15803 * archive.cc: Include "plugin.h".
15804 (Archive::setup): Don't preread archive symbols when using a plugin.
15805 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15806 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15808 (Archive::include_member): Add symbols from plugin objects.
15809 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15810 * descriptors.cc (Descriptors::open): Check for file descriptors
15811 abandoned by plugins.
15812 (Descriptors::claim_for_plugin): New function.
15813 * descriptors.h (Descriptors::claim_for_plugin): New function.
15814 (Open_descriptor::is_claimed): New field.
15815 (claim_descriptor_for_plugin): New function.
15816 * fileread.cc (File_read::claim_for_plugin): New function.
15817 * fileread.h (File_read::claim_for_plugin): New function.
15818 (File_read::descriptor): New function.
15819 * gold.cc: Include "plugin.h".
15820 (queue_initial_tasks): Add task to call plugin hooks for generating
15822 * main.cc: Include "plugin.h".
15823 (main): Load plugin libraries.
15824 * object.h (Pluginobj): Declare.
15825 (Object::pluginobj): New function.
15826 (Object::do_pluginobj): New function.
15827 (Object::set_target): New function.
15828 * options.cc: Include "plugin.h".
15829 (General_options::parse_plugin): New function.
15830 (General_options::General_options): Initialize plugins_ field.
15831 (General_options::add_plugin): New function.
15832 * options.h (Plugin_manager): Declare.
15833 (General_options): Add --plugin option.
15834 (General_options::has_plugins): New function.
15835 (General_options::plugins): New function.
15836 (General_options::add_plugin): New function.
15837 (General_options::plugins_): New field.
15838 * plugin.cc: New file.
15839 * plugin.h: New file.
15840 * readsyms.cc: Include "plugin.h".
15841 (Read_symbols::do_read_symbols): Check for archive before checking
15842 for ELF file. Call plugin hooks to claim files.
15843 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15844 from a real object file; force override when processing replacement
15846 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15847 (Symbol::init_base_object): Likewise.
15848 (Symbol::init_base_output_data): Likewise.
15849 (Symbol::init_base_output_segment): Likewise.
15850 (Symbol::init_base_constant): Likewise.
15851 (Symbol::init_base_undefined): Likewise.
15852 (Symbol::output_section): Assert that object is not a plugin.
15853 (Symbol_table::add_from_pluginobj): New function.
15854 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15856 (Symbol_table::sized_write_globals): Likewise.
15857 (Symbol_table::add_from_pluginobj): Instantiate template.
15858 * symtab.h (Sized_pluginobj): Declare.
15859 (Symbol::in_real_elf): New function.
15860 (Symbol::set_in_real_elf): New function.
15861 (Symbol::in_real_elf_): New field.
15862 (Symbol_table::add_from_pluginobj): New function.
15864 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15865 (LIBDL): New variable.
15866 (LDADD): Add LIBDL.
15867 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15868 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15869 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15870 (MOSTLYCLEANFILES): Likewise.
15871 * testsuite/Makefile.in: Regenerate.
15872 * testsuite/plugin_test.c: New file.
15873 * testsuite/plugin_test_1.sh: New file.
15874 * testsuite/plugin_test_2.sh: New file.
15876 2008-09-16 Ian Lance Taylor <iant@google.com>
15878 * target-reloc.h (relocate_section): Check whether a symbol is
15879 defined by the ABI before reporting an undefined symbol error.
15880 * target.h (Target::is_defined_by_abi): Make parameter const.
15881 (Target::do_is_defined_by_abi): Likewise.
15882 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15883 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15884 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15885 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15886 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15887 * testsuite/Makefile.in: Rebuild.
15889 * fileread.cc (make_view): Add casts to avoid warning.
15891 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15893 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15894 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15896 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15898 * options.h (General_options::output_is_executable): New.
15899 (General_options::output_is_pie): New.
15900 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15901 for shared libraries.
15902 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15904 2008-09-11 Chris Demetriou <cgd@google.com>
15906 * options.h (origin): New -z option.
15907 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15908 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15911 2008-09-05 Cary Coutant <ccoutant@google.com>
15913 * fileread.cc (File_read::make_view): Add check for attempt to map
15914 beyond end of file.
15916 2008-09-05 Cary Coutant <ccoutant@google.com>
15918 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15919 explicit instantiations.
15921 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15924 * options.cc (General_options::finalize): Allow undefined symbols
15925 in shlibs if linking -shared.
15928 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15929 symbols as not needing a dynsym entry.
15931 2008-08-20 Craig Silverstein <csilvers@google.com>
15933 * fileread.cc (File_read::open): Do not lock the file unless it
15934 was successfully opened.
15936 2008-08-14 Cary Coutant <ccoutant@google.com>
15938 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15939 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15940 * testsuite/tls_test.cc (struct int128): 128-bit struct
15941 for testing TLS relocs with non-zero addend.
15942 (v12): New TLS variable.
15944 (t_last): Add check for v12.
15945 * testsuite/tls_test.h (t12): New function.
15946 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15948 2008-08-13 Ian Lance Taylor <iant@google.com>
15950 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15951 set tls_segment_ or relro_segment_.
15952 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15954 * output.h (Output_section::clear_is_relro): New function.
15955 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15956 sections specially even when output_data_ is empty.
15957 (Output_segment::maximum_alignment): When first section is relro,
15958 only force alignment for PT_LOAD segments.
15959 * script.cc (script_data_segment_align): New function.
15960 (script_data_segment_relro_end): New function.
15961 * script-c.h (script_data_segment_align): Declare.
15962 (script_data_segment_relro_end): Declare.
15963 * script-sections.h (class Script_sections): Declare
15964 data_segment_align and data_segment_relro_end. Add fields
15965 segment_align_index_ and saw_relro_end_.
15966 * script-sections.cc (class Sections_element): Add set_is_relro
15967 virtual function. Add new bool* parameter to place_orphan_here.
15968 Add get_output_section virtual function.
15969 (class Output_section_definition): Add set_is_relro. Add new
15970 bool* parameter to place_orphan_here. Add get_output_section.
15971 Add is_relro_ field.
15972 (Output_section_definition::Output_section_definition): Initialize
15973 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15974 and is_relro_ fields.
15975 (Output_section_definition::place_orphan_here): Add is_relro
15977 (Output_section_definition::set_section_addresses): Set relro for
15979 (Output_section_definition::alternate_constraint): Likewise.
15980 (class Orphan_output_section): Add new bool* parameter to
15981 place_orphan_here. Add get_output_section.
15982 (Orphan_output_section::place_orphan_here): Add is_relro
15984 (Script_sections::Script_sections): Initialize
15985 data_segment_align_index_ and saw_relro_end_.
15986 (Script_sections::data_segment_align): New function.
15987 (Script_sections::data_segment_relro_end): New function.
15988 (Script_sections::place_orphan): Set or clear is_relro.
15989 (Script_sections::set_section_addresses): Force alignment of first
15991 * yyscript.y (exp): Call script_data_segment_align and
15992 script_data_segment_relro_end.
15993 * testsuite/relro_script_test.t: New file.
15994 * testsuite/relro_test.cc (using_script): Declare.
15995 (t1, t2): Test using_script.
15996 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15997 (relro_script_test_SOURCES): Define.
15998 (relro_script_test_DEPENDENCIES): Define.
15999 (relro_script_test_LDFLAGS): Define.
16000 (relro_script_test_LDADD): Define.
16001 (relro_script_test.so): New target.
16002 * testsuite/Makefile.in: Rebuild.
16004 2008-08-06 Cary Coutant <ccoutant@google.com>
16006 * archive.cc (Archive::total_archives, Archive::total_members)
16007 (Archive::total_members_loaded): New variables.
16008 (Archive::setup): Add parameter. Add option to preread
16010 (Archive::read_armap): Add counter.
16011 (Archive::get_file_and_offset): New function.
16012 (Archive::get_elf_object_for_member): New function.
16013 (Archive::read_all_symbols): New function.
16014 (Archive::read_symbols): New function.
16015 (Archive::add_symbols): Add counters.
16016 (Archive::include_all_members): Use armap to find members if it's
16018 (Archive::include_member): Skip reading symbols if already read.
16019 Factored code into Archive::get_file_and_offset and
16020 Archive::get_elf_object_for_member. Changed call to
16021 Mapfile::report_include_archive_member.
16022 (Archive::print_stats): New function.
16023 * archive.h: Declare Object and Read_symbols_data classes.
16024 (Archive::Archive): Add initializers for new members.
16025 (Archive::setup): Add parameter.
16026 (Archive::print_stats): New function.
16027 (Archive::total_archives, Archive::total_members)
16028 (Archive::total_members_loaded): New variables.
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::Archive_member): New class.
16034 (Archive::members_): New member.
16035 (Archive::num_members_): New member.
16036 * main.cc: Include archive.h.
16037 (main): Call Archive::print_stats.
16038 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16039 archive parameter; member_name is now the fully-decorated name.
16040 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16041 * options.h: (General_options): Add --preread-archive-symbols option.
16042 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16045 2008-08-04 Ian Lance Taylor <iant@google.com>
16047 * symtab.h (Symbol::use_plt_offset): New function.
16048 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16049 * powerpc.cc (Relocate::relocate): Likewise.
16050 * sparc.cc (Relocate::relocate): Likewise.
16051 * x86_64.cc (Relocate::relocate): Likewise.
16052 * testsuite/weak_plt.sh: New test.
16053 * testsuite/weak_plt_main.cc: New test.
16054 * testsuite/weak_plt_shared.cc: New test.
16055 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16056 (check_PROGRAMS): Add weak_plt.
16057 (check_DATA): Add weak_plt_shared.so.
16058 (weak_plt_main_pic.o, weak_plt): New targets.
16059 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16060 * testsuite/Makefile.in: Rebuild.
16062 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16064 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16065 * testsuite/Makefile.in: Rebuild.
16067 2008-08-04 Alan Modra <amodra@bigpond.net.au>
16069 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16070 * Makefile.in: Regenerate.
16071 * po/POTFILES.in: Regenerate.
16073 2008-07-29 Ian Lance Taylor <iant@google.com>
16075 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16076 symbols before other symbols.
16077 * testsuite/script_test_2.cc (test_addr): Declare.
16078 (test_addr_alias): Declare.
16079 (main): Check that test_addr and test_addr_alias have the right
16081 * testsuite/script_test_2.t: Define test_addr_alias and
16084 2008-07-24 Ian Lance Taylor <iant@google.com>
16087 * descriptors.cc: New file.
16088 * descriptors.h: New file.
16089 * gold-threads.h (class Hold_optional_lock): New class.
16090 * fileread.cc: Include "descriptors.h".
16091 (File_read::~File_read): Release descriptor rather than closing
16093 (File_read::open) [file]: Call open_descriptor rather than open.
16094 Set is_descriptor_opened_.
16095 (File_read::open) [memory]: Assert that descriptor is not open.
16096 (File_read::reopen_descriptor): New function.
16097 (File_read::release): Release descriptor.
16098 (File_read::do_read): Make non-const. Reopen descriptor.
16099 (File_read::read): Make non-const.
16100 (File_read::make_view): Reopen descriptor.
16101 (File_read::do_readv): Likewise.
16102 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16103 Update declarations.
16104 * layout.cc: Include "descriptors.h".
16105 (Layout::create_build_id): Use open_descriptor rather than open.
16106 * output.cc: Include "descriptors.h".
16107 (Output_file::open): Use open_descriptor rather than open.
16108 * archive.cc (Archive::const_iterator): Change Archive to be
16110 (Archive::begin, Archive::end): Make non-const.
16111 (Archive::count_members): Likewise.
16112 * archive.h (class Archive): Update declarations.
16113 * object.h (Object::read): Make non-const.
16114 * Makefile.am (CCFILES): Add descriptors.cc.
16115 (HFILES): Add descriptors.h.
16116 * Makefile.in: Rebuild.
16119 * gold.h: Always include <clocale>. Add Solaris workarounds
16120 following code in binutils/sysdep.h.
16123 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16124 this->eh_frame_hdr_ is NULL before using it.
16126 * dynobj.cc (Versions::Versions): Update comment.
16128 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16129 the base version name.
16131 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16132 array size plus one.
16133 (Stringpool_template::set_string_offsets): Subtract one from key
16134 before using it as an array index.
16135 (Stringpool_template::get_offset_with_length): Likewise.
16136 (Stringpool_template::write_to_buffer): Likewise.
16137 * stringpool.h (Stringpool_template::get_offset_from_key):
16140 2008-07-23 Ian Lance Taylor <iant@google.com>
16143 * object.h (Merged_symbol_value::value): Do our best to handle a
16147 * script.cc (Version_script_info::get_versions): Don't add empty
16148 version tag to return value.
16149 (Version_script_info::get_symbol_version_helper): Change return
16150 type to bool. Add pversion parameter. Change all callers.
16151 (script_register_vers_node): Don't require a non-NULL tag.
16152 * script.h (class Version_script_info): Update declarations.
16153 (Version_script_info::get_symbol_version): Change return type to
16154 bool. Add version parameter. Change all callers.
16155 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16156 handling. Handle an empty version from a version script.
16157 (Symbol_table::define_special_symbol): Likewise.
16158 * testsuite/ver_test_10.script: New file.
16159 * testsuite/ver_test_10.sh: New file.
16160 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16161 (check_DATA): Add ver_test_10.syms.
16162 (ver_test_10.syms, ver_test_10.so): New target.
16163 * testsuite/Makefile.in: Rebuild.
16165 2008-07-23 Simon Baldwin <simonb@google.com>
16167 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16168 to zero for undefined symbols from dynamic libraries.
16170 2008-07-23 Ian Lance Taylor <iant@google.com>
16172 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16173 Change all callers.
16174 * symtab.h (class Symbol_table): Update declaration.
16175 * testsuite/ver_test_9.cc: New file.
16176 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16177 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16178 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16179 (ver_test_9.so, ver_test_9.o): New targets.
16180 * testsuite/Makefile.in: Rebuild.
16182 2008-07-22 Ian Lance Taylor <iant@google.com>
16184 * options.h (class General_options): Define --check-sections.
16185 * layout.cc (Layout::set_segment_offsets): Handle
16188 * options.h (class General_options): Define -n/--nmagic and
16190 * options.cc (General_options::finalize): For -n/--nmagic or
16191 -N/--omagic, set -static.
16192 * layout.cc (Layout::attach_allocated_section_to_segment): If
16193 -N/--omagic, don't put read-only and read-write sections in
16194 different segments.
16195 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16196 finding a read-only segment.
16197 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16198 don't set the minimum segment alignment to the common page size,
16199 and don't set the file offset to the address modulo the page size.
16200 * script-sections.cc (Script_sections::create_segments): If
16201 -n/--omagic, don't put read-only and read-write sections in
16202 different segments.
16204 * cref.cc: New file.
16205 * cref.h: New file.
16206 * options.h (class General_options): Add --print-symbol-counts.
16207 * main.cc (main): Issue defined symbol report if requested.
16208 * archive.cc (Archive::interpret_header): Make into a const member
16210 (Archive::add_symbols): Call Input_objects::archive_start and
16212 (Archive::const_iterator): Define new class.
16213 (Archive::begin, Archive::end): New functions.
16214 (Archive::include_all_members): Rewrite to use iterator.
16215 (Archive::count_members): New function.
16216 * archive.h (class Archive): Update declarations.
16217 (Archive::filename): New function.
16218 * object.cc: Include "cref.h".
16219 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16220 (Sized_relobj::do_get_global_symbol_counts): New function.
16221 (Input_objects::add_object): Add object to cross-referencer.
16222 (Input_objects::archive_start): New function.
16223 (Input_objects::archive_stop): New function.
16224 (Input_objects::print_symbol_counts): New function.
16225 * object.h: Declare Cref and Archive.
16226 (Object::get_global_symbol_counts): New function.
16227 (Object::do_get_global_symbol_counts): New pure virtual function.
16228 (class Sized_relobj): Add defined_count_ field. Update
16230 (class Input_objects): Add cref_ field. Update constructor.
16231 Update declarations.
16232 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16234 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16236 (Sized_dynobj::do_get_global_symbol_counts): New function.
16237 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16238 defined_count_. Update declarations. Define Symbols typedef.
16239 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16240 parameter. Change all callers.
16241 (Symbol_table::add_from_dynobj): Add sympointers and defined
16242 parameters. Change all callers.
16243 * symtab.h (class Symbol_table): Update declarations.
16244 * Makefile.am (CCFILES): Add cref.cc.
16245 (HFILES): Add cref.h.
16246 * Makefile.in: Rebuild.
16248 2008-07-22 Simon Baldwin <simonb@google.com>
16250 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16251 to zero when writing undefined symbols.
16253 2008-07-22 Ian Lance Taylor <iant@google.com>
16255 * output.cc (Output_section::add_input_section): Don't try to
16256 merge empty merge sections.
16258 2008-07-21 Craig Silverstein <csilvers@google.com>
16260 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16261 Include symbol version in error message.
16263 2008-07-20 Chris Demetriou <cgd@google.com>
16265 * configure.ac (gold_cv_c_random_seed): New configured variable.
16266 (RANDOM_SEED_CFLAGS): New substituted variable.
16267 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16268 * configure: Rebuild.
16269 * Makefile.in: Likewise.
16270 * testsuite/Makefile.in: Likewise.
16272 2008-07-18 Ian Lance Taylor <iant@google.com>
16274 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16275 where we see NAME/NULL and NAME/VERSION as separate symbols.
16276 * testsuite/ver_test_main.cc (main): Call t4.
16277 (t4, t4_2a): Define.
16278 * testsuite/ver_test_2.cc (t4_2): Define.
16279 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16280 * testsuite/ver_test_4.cc (t4_2a): Define.
16281 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16282 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16284 2008-07-17 Ian Lance Taylor <iant@google.com>
16286 * dynobj.cc (Versions::add_def): If we give an error about a
16287 missing version, go ahead and create the version anyhow.
16289 2008-07-10 Ian Lance Taylor <iant@google.com>
16291 Handle output sections with more than 0x7fffffff bytes.
16292 * object.h (class Relobj): Change map_to_output_ to
16293 output_sections_, and just keep a section pointer. Change all
16294 uses. Move comdat group support to Sized_relobj.
16295 (Relobj::is_section_specially_mapped): Remove.
16296 (Relobj::output_section): Remove poff parameter. Change all
16298 (Relobj::output_section_offset): New function.
16299 (Relobj::set_section_offset): Rewrite.
16300 (Relobj::map_to_output): Remove.
16301 (Relobj::output_sections): New function.
16302 (Relobj::do_output_section_offset): New pure virtual function.
16303 (Relobj::do_set_section_offset): Likewise.
16304 (class Sized_relobj): Add section_offsets_ field. Add comdat
16305 group support from Relobj. Update declarations.
16306 (Sized_relobj::get_output_section_offset): New function.
16307 (Sized_relobj::do_output_section_offset): New function.
16308 (Sized_relobj::do_set_section_offset): New function.
16309 * object.cc (Relobj::output_section_address): Remove.
16310 (Sized_relobj::Sized_relobj): Initialize new fields.
16311 (Sized_relobj::include_section_group): Cast find_kept_object to
16313 (Sized_relobj::include_linkonce_section): Likewise.
16314 (Sized_relobj::do_layout): Use separate arrays for output section
16316 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16318 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16319 output_sections and section_offsets.
16320 (Sized_relobj::write_local_symbols): Likewise.
16321 (map_to_kept_section): Compute output address directly.
16322 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16323 output_sections and section_offsets.
16324 (Sized_relobj::write_sections): Likewise.
16325 (Sized_relobj::relocate_sections): Likewise.
16326 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16327 * output.h (class Output_reloc): Update declarations. Change
16328 u2_.relobj to Sized_relobj*.
16329 (class Output_data_reloc): Change add functions to use
16331 * output.cc (Output_reloc::Output_reloc): Change relobj to
16333 (Output_reloc::local_section_offset): Change return type to
16334 Elf_Addr. Use get_output_section_offset.
16335 (Output_reloc::get_address): Likewise.
16336 (Output_section::is_input_address_mapped): Don't call
16337 is_section_specially_mapped.
16338 (Output_section::output_offset): Likewise.
16339 (Output_section::output_address): Likewise.
16340 (Output_section::starting_output_address): Likewise.
16341 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16342 parameter to Sized_relobj*.
16343 (Copy_relocs::need_copy_reloc): Likewise.
16344 (Copy_relocs::save): Likewise.
16345 * copy-relocs.h (class Copy_relocs): Update declarations.
16346 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16347 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16348 * target-reloc.h (relocate_for_relocatable): Change
16349 offset_in_output_section type to Elf_Addr. Change code that uses
16351 * layout.cc (Layout::layout): Always set *off.
16352 * mapfile.cc (Mapfile::print_input_section): Use
16353 output_section_offset.
16354 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16356 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16357 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16358 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16360 2008-07-03 Ian Lance Taylor <iant@google.com>
16362 * layout.cc (Layout::include_section): Do not discard unrecognized
16363 SHT_STRTAB sections.
16365 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16367 * script.cc (Lex::can_continue_name): Make '?' allowable in
16368 version-script names.
16369 * testsuite/version_script.map: Change glob pattern to use '?'
16371 2008-06-30 Manish Singh <yosh@gimp.org>
16374 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16377 2008-06-30 Ian Lance Taylor <iant@google.com>
16381 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16382 versions]: Don't try to read the value in the contents, since we
16383 don't use it. Use the template endianness when writing.
16385 2008-06-25 Cary Coutant <ccoutant@google.com>
16387 * fileread.cc (File_read::make_view): Assert on zero-length view.
16388 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16389 symbol table when there are no symbols to read.
16391 2008-06-23 Craig Silverstein <csilvers@google.com>
16393 * version.cc (version_string): Bump to 1.7
16395 2008-06-18 Craig Silverstein <csilvers@google.com>
16397 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16398 constant 0xFFFF to type Valtype.
16399 (Powerpc_relocate_functions::rel16_ha): Likewise.
16401 2008-06-17 Ian Lance Taylor <iant@google.com>
16403 * output.h (Output_section::Input_section): Initialize p2align_ to
16404 zero for Output_section_data constructors.
16405 (Output_section::Input_section::addralign): If not an input
16406 section, return the alignment of the Output_section_data.
16407 * testsuite/copy_test.cc: New file.
16408 * testsuite/copy_test_1.cc: New file.
16409 * testsuite/copy_test_2.cc: New file.
16410 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16411 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16412 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16413 (copy_test_1_pic.o, copy_test_1.so): New targets.
16414 (copy_test_2_pic.o, copy_test_2.so): New targets.
16415 * testsuite/Makefile.in: Rebuild.
16417 * script-sections.cc (Script_sections::place_orphan): Initialize
16418 local variable exact.
16420 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16422 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16424 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16425 David S. Miller <davem@davemloft.net>
16427 * powerpc.cc: New file.
16428 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16429 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16430 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16431 * Makefile.in: Rebuild.
16433 2008-06-09 Ian Lance Taylor <iant@google.com>
16435 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16437 (throwing, orig_terminate): New static variables.
16438 (terminate_handler): New static function.
16439 (t2): Set terminate handler.
16441 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16444 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16447 2008-05-30 Cary Coutant <ccoutant@google.com>
16449 * archive.cc (Archive::include_all_members) Correct to step
16450 over symbol table and extended name table in thin archives.
16452 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16455 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16458 2008-05-28 Caleb Howe <cshowe@google.com>
16460 * reduced_debug_output.cc: New file.
16461 * reduced_debug_output.h: New file.
16462 * options.h (class General_options): Add --strip-debug-non-line.
16463 * options.cc (General_options::finalize): Add strip_debug_non_line
16464 to the strip heirarchy.
16465 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16467 * layout.cc: Include "reduced_debug_output.h".
16468 (Layout::Layout): Initialize new fields.
16469 (line_only_debug_sections): New static array.
16470 (is_lines_only_debug_sections): New static inline function.
16471 (Layout::include_section): Handle --strip-debug-non-line.
16472 (Layout::make_output_section): If --strip-debug-non-line, build
16473 new output sections for .debug_abbrev and .debug_info.
16474 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16475 gold. Warn about possible overflow.
16476 (read_signed_LEB_128): Likewise.
16477 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16478 (read_signed_LEB_128): Declare.
16479 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16480 (HFILES): Add reduced_debug_output.h.
16481 * Makefile.in: Rebuild.
16483 2008-05-21 Ian Lance Taylor <iant@google.com>
16485 * mapfile.cc: New file.
16486 * mapfile.h: New file.
16487 * options.h (class General_options): Add -M/--print-map and -Map.
16488 * options.cc (General_options::finalize): Make -M equivalent to
16490 * main.cc: Include <cstdio> and "mapfile.h".
16491 (main): Open mapfile if requested.
16492 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16493 constructor. Change caller.
16494 (queue_initial_tasks): Add mapfile parameter. Change caller.
16495 (queue_middle_tasks): Likewise.
16496 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16498 * archive.cc: Include "mapfile.h".
16499 (Archive::add_symbols): Add mapfile parameter. Change all
16500 callers. Pass mapfile, symbol, and reason to include_member.
16501 (Archive::include_all_members): Add mapfile parameter. Change all
16503 (Archive::include_member): Add mapfile, sym, and why parameters.
16504 Change all callers. Report inclusion to map file.
16505 * archive.h: Include "fileread.h".
16506 (class Archive): Update declarations.
16507 (Archive::file): New const method.
16508 (class Add_archive_symbols): Add mapfile_ field. Update
16509 constructor. Change all callers.
16510 * readsyms.h (class Read_symbols): Likewise.
16511 (class Finish_group): Likewise.
16512 (class Read_script): Likewise.
16513 * common.cc: Include "mapfile.h".
16514 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16516 (Symbol_table::do_allocate_commons): Likewise.
16517 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16518 symbol allocation to mapfile.
16519 * common.h (class Allocate_commons_task): Add mapfile_ field.
16520 Update constructor. Change all callers.
16521 * symtab.h (class Symbol_table): Update declarations.
16522 * layout.cc: Include "mapfile.h".
16523 (Layout_task_runner::run): Print information to mapfile.
16524 (Layout::create_gold_note): Change Output_data_fixed_space to
16525 Output_data_zero_fill.
16526 (Layout::create_build_id): Likewise.
16527 (Layout::print_to_mapfile): New function.
16528 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16529 constructor. Change caller.
16530 (class Layout): Declare print_to_mapfile.
16531 * output.cc (Output_section::Input_section::print_to_mapfile): New
16533 (Output_section::add_input_section): If producing a map, always
16534 add to input_sections_ list.
16535 (Output_section::do_print_to_mapfile): New function.
16536 (Output_segment::print_sections_to_mapfile): New function.
16537 (Output_segment::print_section_list_to_mapfile): New function.
16538 * output.h: Include "mapfile.h".
16539 (Output_data::print_to_mapfile): New function.
16540 (Output_data::do_print_to_mapfile): New virtual function.
16541 (Output_segment_headers::do_print_to_mapfile): New function.
16542 (Output_file_header::do_print_to_mapfile): New function.
16543 (Output_data_const::do_print_to_mapfile): New function.
16544 (class Output_data_const_buffer): Add map_name_ field. Update
16545 constructor. Change all callers. Add do_print_to_mapfile
16547 (class Output_data_fixed_space): Likewise.
16548 (class Output_data_space): Likewise.
16549 (class Output_data_zero_fill): New class.
16550 (Output_data_strtab::do_print_to_mapfile): New function.
16551 (Output_data_reloc_base::do_print_to_mapfile): New function.
16552 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16553 (Output_data_group::do_print_to_mapfile): New function.
16554 (Output_data_got::do_print_to_mapfile): New function.
16555 (Output_data_dynamic::do_print_to_mapfile): New function.
16556 (Output_symtab_xindex::do_print_to_mapfile): New function.
16557 (class Output_section): Declare do_print_to_mapflie. Declare
16558 print_to_mapfile in Input_section.
16559 (class Output_segment): Declare new functions.
16560 * object.h (Sized_relobj::symbol_count): New function.
16561 * script-sections.cc
16562 (Output_section_element_dot_assignment::set_section_addresses):
16563 Change Output_data_fixed_space to Output_data_zero_fill.
16564 (Output_data_expression::do_print_to_mapfile): New function.
16565 * script.cc (read_input_script): Add mapfile parameter. Change
16567 * script.h (read_input_script): Update declaration.
16568 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16569 (Eh_frame::do_print_to_mapfile): New function.
16570 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16571 (Output_merge_string::do_print_to_mapfile): New function.
16572 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16574 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16576 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16578 * Makefile.am (CCFILES): Add mapfile.cc.
16579 (HFILES): Add mapfile.h.
16580 * Makefile.in: Rebuild.
16582 2008-05-19 Ian Lance Taylor <iant@google.com>
16584 * options.h (class General_options): Add -z relro.
16585 * layout.cc (Layout::Layout): Initialize relro_segment_.
16586 (Layout::add_output_section_data): Return the output section.
16587 (Layout::make_output_section): Rcognize relro sections and mark
16588 them appropriately.
16589 (Layout::attach_allocated_section_to_segment): Put relro sections
16590 in a PT_GNU_RELRO segment.
16591 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16593 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16595 (Layout::linkonce_mapping): Map d.rel.ro.local to
16596 .data.rel.ro.local.
16597 (Layout::output_section_name): Us .data.rel.ro.local for any
16598 section which begins with that.
16599 * layout.h (class Layout): Update add_output_section_data
16600 declaration. Add relro_segment_ field.
16601 * output.cc (Output_section::Output_section): Initialize is_relro_
16602 and is_relro_local_ fields.
16603 (Output_segment::add_output_section): Group relro sections.
16604 (Output_segment::is_first_section_relro): New function.
16605 (Output_segment::maximum_alignment): If there is a relro section,
16606 align the segment to the common page size.
16607 (Output_segment::set_section_addresses): Track whether we are
16608 looking at relro sections. If the last section is a relro
16609 section, align to the common page size.
16610 (Output_segment::set_section_list_addresses): Add in_relro
16611 parameter. Change all callers. Align to the page size when
16612 moving from relro to non-relro section.
16613 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16615 * output.h (class Output_section): Add is_relro_ and
16616 is_relro_local_ fields.
16617 (Output_section::is_relro): New function.
16618 (Output_section::set_is_relro): New function.
16619 (Output_section::is_relro_local): New function.
16620 (Output_section::set_is_relro_local): New function.
16621 (class Output_segment): Update declarations.
16622 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16623 * sparc.cc (Target_sparc::got_section): Likewise.
16624 * x86_64.cc (Target_x86_64::got_section): Likewise.
16625 * testsuite/relro_test_main.cc: New file.
16626 * testsuite/relro_test.cc: New file.
16627 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16628 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16629 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16630 (relro_test.so, relro_test_pic.o): New targets.
16631 * testsuite/Makefile.in: Rebuild.
16633 2008-05-16 Ian Lance Taylor <iant@google.com>
16635 * output.cc (Output_segment::add_output_section): Remove front
16637 * output.h (class Output_segment): Remove
16638 add_initial_output_section and overloaded add_output_section.
16639 Update declaration of remaining add_output_section.
16640 * layout.cc (Layout::create_interp): Call add_output_section
16641 rather than add_initial_output_section.
16642 (Layout::finish_dynamic_section): Likewise.
16644 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16645 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16646 know the dynamic type.
16647 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16648 field. Initialize it in constructor.
16649 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16650 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16651 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16654 * output.cc (Output_reloc::get_address): Change return type to
16656 * output.h (class Output_reloc): Update get_address declaration.
16657 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16658 for section addresses.
16660 2008-05-09 Ian Lance Taylor <iant@google.com>
16663 * gold.cc (gold_nomem): Use return value of write.
16665 2008-05-08 Ian Lance Taylor <iant@google.com>
16667 * symtab.c (Symbol::init_base_output_data): Add version
16668 parameter. Change all callers.
16669 (Symbol::init_base_output_segment): Likewise.
16670 (Symbol::init_base_constant): Likewise.
16671 (Symbol::init_base_undefined): Likewise.
16672 (Sized_symbol::init_output_data): Likewise.
16673 (Sized_symbol::init_output_segment): Likewise.
16674 (Sized_symbol::init_constant): Likewise.
16675 (Sized_symbol::init_undefined): Likewise.
16676 (Symbol_table::do_define_in_output_data): If the new symbol has a
16677 version, mark it as the default.
16678 (Symbol_table::do_define_in_output_segment): Likewise.
16679 (Symbol_table::do_define_as_constant): Likewise.
16680 * symtab.h (class Symbol): Update declarations.
16681 (class Sized_symbol): Likewise.
16682 * resolve.cc (Symbol::override_version): New function.
16683 (Symbol::override_base): Call override_version.
16684 (Symbol::override_base_with_special): Likewise.
16685 * testsuite/ver_script_8.script: New file.
16686 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16687 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16688 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16689 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16691 2008-05-06 Ian Lance Taylor <iant@google.com>
16694 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16696 (class General_options): Remove existing --undefined, and add
16697 --no-undefined instead. Add new --undefined as synonym for -u.
16698 * archive.cc (Archive::add_symbols): Check whether symbol was
16700 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16701 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16702 all uses. Add IS_UNDEFINED. Update declarations to split
16703 different versions of init_base. Declare init_base_undefined.
16704 (Symbol::is_defined): Handle IS_UNDEFINED.
16705 (Symbol::is_undefined): Likewise.
16706 (Symbol::is_weak_undefined): Call is_undefined.
16707 (Symbol::is_absolute): Handle IS_CONSTANT.
16708 (class Sized_symbol): Update declarations to split different
16709 versions of init. Declare init_undefined.
16710 (class Symbol_table): Declare new functions.
16711 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16712 Change all callers.
16713 (Symbol::init_base_output_data): Likewise.
16714 (Symbol::init_base_output_segment): Likewise.
16715 (Symbol::init_base_constant): Likewise.
16716 (Symbol::init_base_undefined): New function.
16717 (Sized_symbol::init_object): Rename from init. Change all
16719 (Sized_symbol::init_output_data): Likewise.
16720 (Sized_symbol::init_output_segment): Likewise.
16721 (Sized_symbol::init_constant): Likewise.
16722 (Sized_symbol::init_undefined): New function.
16723 (Symbol_table::add_undefined_symbols_from_command_line): New
16725 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16727 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16728 (Symbol::output_section): Likewise.
16729 (Symbol::set_output_section): Likewise.
16730 (Symbol_table::sized_finalize_symbol): Likewise.
16731 (Symbol_table::sized_write_globals): Likewise.
16732 * resolve.cc (Symbol_table::should_override): Likewise.
16733 (Symbol::override_base_with_special): Likewise.
16735 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16736 symbol, change it to have default visibility.
16737 * testsuite/protected_1.cc: New file.
16738 * testsuite/protected_2.cc: New file.
16739 * testsuite/protected_3.cc: New file.
16740 * testsuite/protected_main_1.cc: New file.
16741 * testsuite/protected_main_2.cc: New file.
16742 * testsuite/protected_main_3.cc: New file.
16743 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16744 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16745 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16746 (protected_1.so): New target.
16747 (protected_1_pic.o, protected_2_pic.o): New targets.
16748 (protected_3_pic.o): New target.
16749 (check_PROGRAMS): Add protected_2.
16750 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16751 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16752 * testsuite/Makefile.in: Rebuild.
16754 * options.h (DEFINE_var): Add set_user_set_##varname__.
16755 (DEFINE_bool_alias): New macro.
16756 (class General_options): Define -Bstatic using DEFINE_bool_alias
16757 rather than DEFINE_special. Add --undefined as an alias for -z
16759 * options.cc (General_options::parse_Bstatic): Remove.
16761 * options.h (class General_options): Add --fatal-warnings.
16762 * main.cc (main): Implement --fatal-warnings.
16763 * errors.h (Errors::warning_count): New function.
16765 * options.h (class General_options): Add -Bsymbolic-functions.
16766 * symtab.h (Symbol::is_preemptible): Check for
16767 -Bsymbolic-functions.
16769 2008-05-05 Ian Lance Taylor <iant@google.com>
16771 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16772 as noVARNAME rather than no-VARNAME.
16773 (class General_options): Add option -z combreloc.
16774 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16776 (Output_reloc::sort_before) [SHT_REL]: New function.
16777 (Output_reloc::sort_before) [SHT_RELA]: New function.
16778 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16779 Sort_relocs_comparison.
16780 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16781 parameter. Change all callers.
16782 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16783 sort_relocs parameter. Change all callers.
16784 * output.cc (Output_reloc::get_address): New function, broken out
16786 (Output_reloc::write_rel): Call it.
16787 (Output_reloc::compare): New function.
16788 (Output_data_reloc_base::do_write): Optionally sort relocs.
16790 * configure.ac: If targ_extra_obj is set, link it in.
16791 * configure.tgt: Initialize all variables.
16792 (x86_64*): Set targ_extra_obj and targ_extra_size.
16793 * configure: Rebuild.
16795 * object.cc (Sized_relobj::include_section_group): Adjust section
16796 indexes read from group data. Build vector to pass to
16798 * layout.cc (Layout::layout_group): Add flags and shndxes
16799 parameters. Remove contents parameter. Change caller. Update
16800 explicit instantiations.
16801 * layout.h (class Layout): Update layout_group declaration.
16802 * output.cc (Output_data_group::Output_data_group): Add flags and
16803 input_shndxes parameters. Remove contents parameter. Change
16805 (Output_data_group::do_write): Change input_sections_ to
16807 * output.h (class Output_data_group): Update constructor
16808 declaration. Rename input_sections_ to input_shndxes_.
16809 * testsuite/many_sections_test.cc: Add template.
16811 2008-04-30 Cary Coutant <ccoutant@google.com>
16813 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16815 * layout.cc (Layout::include_section): Refactored check for debug
16817 (Layout::add_comdat): Add new parameters. Change type
16818 of signature parameter. Add object and shndx to signatures table.
16819 (Layout::find_kept_object): New function.
16820 * layout.h: Include <cstring>.
16821 (Layout::is_debug_info_section): New function.
16822 (Layout::add_comdat): Add new parameters.
16823 (Layout::find_kept_object): New function.
16824 (Layout::Kept_section): New struct.
16825 (Layout::Signatures): Change type of map range.
16826 * object.cc (Relobj::output_section_address): New function.
16827 (Sized_relobj::include_section_group): Add new parameters. Change
16828 calls to Layout::add_comdat. Change to build table of kept comdat
16829 groups and table mapping discarded sections to kept sections.
16830 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16831 (Sized_relobj::do_layout): Change calls to include_section_group and
16832 include_linkonce_section.
16833 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16834 value to zero when section is discarded.
16835 (Sized_relobj::map_to_kept_section): New function.
16836 * object.h (Relobj::output_section_address): New function.
16837 (Relobj::Comdat_group): New type.
16838 (Relobj::find_comdat_group): New function.
16839 (Relobj::Comdat_group_table): New type.
16840 (Relobj::Kept_comdat_section): New type.
16841 (Relobj::Kept_comdat_section_table): New type.
16842 (Relobj::add_comdat_group): New function.
16843 (Relobj::set_kept_comdat_section): New function.
16844 (Relobj::get_kept_comdat_section): New function.
16845 (Relobj::comdat_groups_): New field.
16846 (Relobj::kept_comdat_sections_): New field.
16847 (Symbol_value::input_value): Update comment.
16848 (Sized_relobj::map_to_kept_section) New function.
16849 (Sized_relobj::include_linkonce_section): Add new parameter.
16850 * target-reloc.h (Comdat_behavior): New type.
16851 (get_comdat_behavior): New function.
16852 (relocate_section): Add code to map a discarded section to the
16853 corresponding kept section when applying a relocation.
16855 2008-04-30 Craig Silverstein <csilvers@google.com>
16857 * dwarf_reader.cc (next_generation_count): New static var.
16858 (Addr2line_cache_entry): New struct.
16859 (addr2line_cache): New static var.
16860 (Dwarf_line_info::one_addr2line): Added caching.
16861 (Dwarf_line_info::clear_addr2line_cache): New function.
16862 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16863 cache-size parameter.
16864 (Dwarf_line_info::one_addr2line_cache): New function.
16865 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16866 new cache-size argument to one_addr2line(), and clear cache.
16868 2008-04-28 Cary Coutant <ccoutant@google.com>
16870 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16871 R_386_PC8 relocations.
16873 2008-04-23 Ian Lance Taylor <iant@google.com>
16875 * object.cc (Sized_relobj::include_section_group): Check for
16876 invalid section group.
16878 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16881 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16882 than read for file header.
16883 * archive.cc (Archive::include_member): Likewise.
16885 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
16887 * aclocal.m4: Regenerate.
16888 * configure: Regenerate.
16890 2008-04-19 Ian Lance Taylor <iant@google.com>
16892 * version.cc (version_string): Bump to 1.6.
16894 * testsuite/Makefile.am (many_sections_r_test): New target.
16895 (many_sections_r_test_SOURCES): Remove.
16896 (many_sections_r_test_DEPENDENCIES): Remove.
16897 (many_sections_r_test_LDFLAGS): Remove.
16898 (many_sections_r_test_LDADD): Remove.
16900 * object.cc (Sized_relobj::do_add_symbols): Always pass
16901 local_symbol_count_ to add_from_relobj.
16903 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16904 every thousand variables.
16905 * testsuite/Makefile.in: Rebuild.
16907 * object.cc (Xindex::initialize_symtab_xindex): New function.
16908 (Xindex::read_symtab_xindex): New function.
16909 (Xindex::sym_xindex_to_shndx): New function.
16910 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16912 (Sized_relobj::do_initialize_xindex): New function.
16913 (Sized_relobj::do_read_symbols): Adjust section links.
16914 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16915 parameter. Change all callers.
16916 (Sized_relobj::include_section_group): Adjust section links and
16917 symbol section indexes.
16918 (Sized_relobj::do_layout): Adjust section links.
16919 (Sized_relobj::do_count_local_symbols): Adjust section links and
16920 symbol section indexes.
16921 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16922 ordinary and special symbols.
16923 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16924 dynsym_xindex parameters. Change all callers. Adjust section
16925 links. Use SHN_XINDEX when needed.
16926 (Sized_relobj::get_symbol_location_info): Adjust section links.
16927 Don't get fooled by special symbols.
16928 * object.h (class Xindex): Define.
16929 (class Object): Add xindex_ parameter. Declare virtual functoin
16930 do_initialize_xindex.
16931 (Object::adjust_sym_shndx): New function.
16932 (Object::set_xindex): New protected function.
16933 (class Symbol_value): Add is_ordinary_shndx_ field.
16934 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16935 (Symbol_value::value): Assert ordinary section.
16936 (Symbol_value::initialize_input_to_output_map): Likewise.
16937 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16938 Change all callers.
16939 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16941 (class Sized_relobj): Update declarations.
16942 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16943 parameter. Change all callers.
16944 (Sized_relobj::adjust_shndx): New function.
16945 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16947 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16948 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16949 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16950 (Sized_dynobj::read_dynsym_section): Adjust section links.
16951 (Sized_dynobj::read_dynamic): Likewise.
16952 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16954 (Sized_dynobj::do_initialize_xindex): New function.
16955 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16956 do_initialize_xindex.
16957 (Sized_dynobj::adjust_shndx): New function.
16958 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16959 dynsym_xindex_ fields.
16960 (Layout::finalize): Add a call to set_section_indexes before
16961 creating the symtab sections.
16962 (Layout::set_section_indexes): Don't do anything if the section
16963 already has a section index.
16964 (Layout::create_symtab_sections): Add shnum parameter. Change
16965 caller. Create .symtab_shndx section if needed.
16966 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16968 (Layout::allocated_output_section_count): New function.
16969 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16971 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16972 fields. Update declarations.
16973 (Layout::symtab_xindex): New function.
16974 (Layout::dynsym_xindex): New function.
16975 (class Write_symbols_task): Add layout_ field.
16976 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16978 * output.cc (Output_section_headers::Output_section_headers): Add
16979 shstrtab_section parameter. Change all callers.
16980 (Output_section_headers::do_sized_write): Store overflow values
16981 for section count and section string table section index in
16982 section header zero.
16983 (Output_file_header::do_sized_write): Check for overflow of
16984 section count and section string table section index.
16985 (Output_symtab_xindex::do_write): New function.
16986 (Output_symtab_xindex::endian_do_write): New function.
16987 * output.h (class Output_section_headers): Add shstrtab_section_.
16988 Update declarations.
16989 (class Output_symtab_xindex): Define.
16990 (Output_section::has_out_shndx): New function.
16991 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16993 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16994 Change all callers.
16995 (Sized_symbol::init): Likewise.
16996 (Symbol::output_section): Check for ordinary symbol.
16997 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16998 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17000 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17001 Change all callers. Simplify handling of symbols from sections
17002 not included in the link.
17003 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17005 (Weak_alias_sorter::operator()): Assert that symbols are
17007 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17009 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17010 parameters. Change all callers.
17011 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17012 symbol distinction. Use SHN_XINDEX when needed.
17013 (Symbol_table::write_section_symbol): Add symtab_xindex
17014 parameter. Change all callers.
17015 (Symbol_table::sized_write_section_symbol): Likewise. Use
17016 SHN_XINDEX when needed.
17017 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17019 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17020 (Symbol::is_defined): Check is_ordinary.
17021 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17022 (Symbol::is_absolute, Symbol::is_common): Likewise.
17023 (class Sized_symbol): Update declarations.
17024 (class Symbol_table): Update declarations.
17025 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17026 parameters. Change all callers.
17027 (Sized_symbol::override): Likewise.
17028 (Symbol_table::override): Likewise.
17029 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17030 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17031 is_ordinary, and orig_st_shndx parameters. Change all callers.
17032 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17033 to be in an ordinary section.
17034 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17035 object and is_ordinary parameters. Change all callers.
17036 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17037 Change all callers. Don't add undefined or non-ordinary symbols
17039 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17040 Change all callers.
17041 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17043 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17044 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17045 (Sized_relobj::relocate_sections): Likewise.
17046 * target-reloc.h (scan_relocs): Adjust section symbol index.
17047 (scan_relocatable_relocs): Likewise.
17048 * i386.cc (Scan::local): Check for ordinary symbols.
17049 * sparc.cc (Scan::local): Likewise.
17050 * x86_64.cc (Scan::local): Likewise.
17051 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17052 to symbol_section_and_value.
17053 * testsuite/many_sections_test.cc: New file.
17054 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17055 (check_PROGRAMS): Add many_sections_test.
17056 (many_sections_test_SOURCES): Define.
17057 (many_sections_test_DEPENDENCIES): Define.
17058 (many_sections_test_LDFLAGS): Define.
17059 (BUILT_SOURCES): Add many_sections_define.h.
17060 (many_sections_define.h): New target.
17061 (BUILT_SOURCES): Add many_sections_check.h.
17062 (many_sections_check.h): New target.
17063 (check_PROGRAMS): Add many_sections_r_test.
17064 (many_sections_r_test_SOURCES): Define.
17065 (many_sections_r_test_DEPENDENCIES): Define.
17066 (many_sections_r_test_LDFLAGS): Define.
17067 (many_sections_r_test_LDADD): Define.
17068 (many_sections_r_test.o): New target.
17069 * testsuite/Makefile.in: Rebuild.
17071 2008-04-17 Cary Coutant <ccoutant@google.com>
17073 * errors.cc (Errors::info): New function.
17074 (gold_info): New function.
17075 * errors.h (Errors::info): New function.
17076 * gold.h (gold_info): New function.
17077 * object.cc (Input_objects::add_object): Print trace output.
17078 * options.cc (options::parse_set): New function.
17079 (General_options::parse_wrap): Deleted.
17080 (General_options::General_options): Deleted initializer.
17081 * options.h (options::String_set): New typedef.
17082 (options::parse_set): New function.
17083 (DEFINE_set): New macro.
17084 (General_options::wrap): Changed to use DEFINE_set. Changed
17085 callers of any_wrap_symbols and is_wrap_symbol.
17086 (General_options::trace, General_options::trace_symbol):
17088 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17089 (General_options::wrap_symbols_): Deleted.
17090 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17092 2008-04-17 David S. Miller <davem@davemloft.net>
17094 * options.cc (General_options::parse_V): New function.
17095 * options.h: Add entries for -V and -Qy.
17097 2008-04-17 Ian Lance Taylor <iant@google.com>
17099 * common.cc (Symbol_table::allocate_commons): Remove options
17100 parameter. Change caller.
17101 (Symbol_table::do_allocate_commons): Remove options parameter.
17102 Change caller. Just call do_allocate_commons_list twice.
17103 (Symbol_table::do_allocate_commons_list): New function, broken out
17104 of do_allocate_commons.
17105 * common.h (class Allocate_commons_task): Remove options_ field.
17106 Update constructor.
17107 * symtab.cc (Symbol_table::Symbol_table): Initialize
17109 (Symbol_table::add_from_object): Put TLS common symbols on
17111 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17112 which are IN_OUTPUT_DATA.
17113 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17114 allocate_commons and do_allocate_commons declarations. Declare
17115 do_allocate_commons_list.
17116 * gold.cc (queue_middle_tasks): Update creation of
17117 Allocate_commons_task to not pass options.
17118 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17119 (TLS_TEST_C_FLAGS): New variable.
17120 (tls_test_c_pic.o): New target.
17121 (tls_test_shared.so): Link in tls_test_c_pic.o.
17122 (tls_test_c_pic_ie.o): New target.
17123 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17124 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17125 (tls_test_c.o): New target.
17126 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17127 (tls_pic_test_LDADD): Likewise.
17128 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17129 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17130 (tls_test_c_gnu2.o): New target.
17131 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17133 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17134 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17135 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17136 * testsuite/tls_test.cc: Include "config.h".
17137 (t_last): Call t11_last.
17138 * testsuite/tls_test.h (t11, t11_last): Declare.
17139 * testsuite/tls_test_c.c: New file.
17140 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17141 * configure.ac: Check for OpenMP support.
17142 * configure, config.in, Makefile.in: Rebuild.
17143 * testsuite/Makefile.in: Rebuild.
17145 2008-04-16 Cary Coutant <ccoutant@google.com>
17147 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17148 (Target_i386::tls_base_symbol_defined_): New field.
17149 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17150 (Target_i386::Scan::global): Likewise.
17151 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17152 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17153 (Target_x86_64::tls_base_symbol_defined_): New field.
17154 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17155 (Target_x86_64::Scan::global): Likewise.
17157 2008-04-16 Cary Coutant <ccoutant@google.com>
17159 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17160 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17161 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17162 building shared libraries.
17163 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17164 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17165 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17166 * testsuite/Makefile.in: Rebuild.
17167 * testsuite/weak_undef.h: New file.
17168 * testsuite/weak_undef_file1.cc: Add extra test cases.
17169 * testsuite/weak_undef_file2.cc: Likewise.
17170 * testsuite/weak_undef_test.cc: Likewise.
17172 2008-04-16 David S. Miller <davem@davemloft.net>
17174 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17175 Add issued_non_pic_error_ field. Declare check_non_pic.
17176 (Target_sparc::Scan::check_non_pic): New function.
17177 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17178 (Target_sparc::Scan::global): Likewise.
17180 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17181 * configure: Rebuild.
17183 * options.h (DEFINE_enable): New macro.
17184 (new_dtags): New enable option.
17185 (initfirst, interpose, loadfltr, nodefaultlib,
17186 nodelete, nodlopen, nodump): New -z options.
17187 * layout.cc (Layout:finish_dynamic_section): If new
17188 dtags enabled, emit DT_RUNPATH. Also, emit a
17189 DT_FLAGS_1 containing any specified -z flags.
17191 2008-04-16 Ian Lance Taylor <iant@google.com>
17193 * copy-relocs.cc: New file.
17194 * copy-relocs.h: New file.
17195 * reloc.cc: Remove Copy_relocs code.
17196 * reloc.h: Likewise.
17197 * reloc-types.h (struct Reloc_types) [both versions]: Add
17198 get_reloc_addend_noerror.
17199 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17200 variants of add_global which take an addend which must be zero.
17201 * i386.cc: Include "copy-relocs.h".
17202 (class Target_i386): Change type of copy_relocs_ to variable,
17203 update initializer.
17204 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17205 Change all callers.
17206 (Target_i386::do_finalize_sections): Change handling of
17208 * sparc.cc: Include "copy-relocs.h".
17209 (class Target_sparc): Change type of copy_relocs_ to variable,
17210 update initializer.
17211 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17212 Change all callers.
17213 (Target_sparc::do_finalize_sections): Change handling of
17215 * x86_64.cc: Include "copy-relocs.h".
17216 (class Target_x86_64): Change type of copy_relocs_ to variable,
17217 update initializer.
17218 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17219 class. Change all callers.
17220 (Target_x86_64::do_finalize_sections): Change handling of
17222 * Makefile.am (CCFILES): Add copy-relocs.cc.
17223 (HFILES): Add copy-relocs.h.
17225 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17227 * testsuite/script_test_4.sh: Permit leading zeroes.
17229 2008-04-15 Ian Lance Taylor <iant@google.com>
17231 * script-sections.cc (Script_sections::create_segments): Use
17232 header_size_adjustment even when there is enough room for the
17234 * testsuite/script_test_4.sh: New file.
17235 * testsuite/script_test_4.t: New file.
17236 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17237 (check_DATA): Add script_test_4.stdout.
17238 (MOSTLYCLEANFILES): Likewise.
17239 (script_test_4): New target.
17240 (script_test_4.stdout): New target.
17241 * testsuite/Makefile.in: Rebuild.
17243 * sparc.cc: Add definitions for Output_data_plt_sparc class
17246 2008-04-14 David S. Miller <davem@davemloft.net>
17248 * sparc.cc: New file.
17249 * Makefile.am (TARGETSOURCES): Add sparc.cc
17250 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17251 * configure.tgt: Document targ_extra_size and
17252 targ_extra_big_endian. Add entries for sparc-* and
17254 * configure.ac: Handle targ_extra_size and
17255 targ_extra_big_endian.
17256 * Makefile.in: Rebuild.
17257 * configure: Likewise.
17258 * po/POTFILES.in: Likewise.
17259 * po/gold.pot: Likewise.
17261 2008-04-14 Ian Lance Taylor <iant@google.com>
17263 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17264 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17265 in the name/type/flags to section mapping. Don't call
17266 allocate_output_section.
17267 (Layout::choose_output_section): Change parameter from adjust_name
17268 to is_input_section. Don't permit input sections after sections
17269 are attached to segments. Don't call allocate_output_section.
17270 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17271 not write_enable_output_section.
17272 (Layout::make_output_section): Don't push to
17273 unattached_section_list_ nor call attach_to_segment. Call
17274 attach_section_to_segment if sections are attached.
17275 (Layout::attach_sections_to_segments): New function.
17276 (Layout::attach_section_to_segment): New function.
17277 (Layout::attach_allocated_section_to_segment): Rename from
17278 attach_to_segment. Remove flags parameter.
17279 (Layout::allocate_output_section): Remove function.
17280 (Layout::write_enable_output_section): Remove function.
17281 * layout.h (class Layout): Update for above changes. Add new
17282 field sections_are_attached_.
17283 * output.h (Output_section::update_flags_for_input_section): New
17285 * output.cc (Output_section::add_input_section): Call
17286 update_flags_for_input_section.
17287 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17289 2008-04-11 Cary Coutant <ccoutant@google.com>
17291 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17292 thought unnecessary.
17293 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17295 2008-04-11 Ian Lance Taylor <iant@google.com>
17297 * output.h (class Output_section_data): Remove inline definition
17299 * output.cc (Output_section_data::set_addralign): New function.
17301 2008-04-11 Cary Coutant <ccoutant@google.com>
17303 Add support for TLS descriptors for i386 and x86_64.
17304 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17305 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17306 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17308 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17309 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17310 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17312 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17313 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17314 Fix problem with initial-exec relocations.
17315 (Target_i386::Relocate::relocate_tls): Likewise.
17316 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17318 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17319 support for section-plus-offset dynamic table entries.
17320 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17321 (Output_data_dynamic::Dynamic_entry): Add support for
17322 section-plus-offset dynamic table entries.
17323 (Output_data_dynamic::Classification): Likewise.
17324 (Output_data_dynamic::classification_): Renamed offset_.
17325 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17326 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17327 (Target_x86_64::make_plt_section): New function.
17328 (Target_x86_64::reserve_tlsdesc_entries): New function.
17329 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17330 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17331 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17332 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17333 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17334 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17335 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17336 add extra PLT entry for TLS descriptors.
17337 (Output_data_plt_x86_64::got_): New field.
17338 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17339 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17341 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17343 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17344 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17345 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17346 R_386_TLS_DESC_CALL relocations.
17347 (Target_x86_64::Scan::global): Likewise.
17348 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17349 for TLS descriptors.
17350 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17351 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17352 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17353 GD-to-IE relaxation.
17354 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17355 and TLS_DESCRIPTORS.
17356 * Makefile.in: Rebuild.
17357 * configure: Rebuild.
17358 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17359 (tls_test_shared2.so): New target.
17360 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17361 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17362 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17363 (tls_shared_gd_to_ie_test_LDADD): New variable.
17364 (tls_shared_gnu2_gd_to_ie_test): New target.
17365 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17367 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17368 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17369 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17370 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17371 (tls_shared_gnu2_test): New target.
17372 (tls_test_gnu2_shared.so): New target.
17373 (tls_shared_gnu2_test_SOURCES): New variable.
17374 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17375 (tls_shared_gnu2_test_LDFLAGS): New variable.
17376 (tls_shared_gnu2_test_LDADD): New variable.
17377 * testsuite/Makefile.in: Rebuild.
17378 * testsuite/Makefile.
17380 2008-04-11 Ian Lance Taylor <iant@google.com>
17382 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17384 * testsuite/Makefile.in: Rebuild.
17386 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17388 * testsuite/script_test_2.cc (main): Adjust test.
17390 2008-04-11 David S. Miller <davem@davemloft.net>
17391 Ian Lance Taylor <iant@google.com>
17393 * options.h (General_options): Add entries for '-Y' and
17395 * options.cc (General_options:finalize): If -Y was used, add those
17396 entries to the library path instead of the default "/lib" and
17399 2008-04-11 David S. Miller <davem@davemloft.net>
17401 * testsuite/justsyms.t: Start at 0x100.
17402 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17403 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17405 * testsuite/script_test_2.cc: Adjust string and section length
17408 2008-04-09 Ian Lance Taylor <iant@google.com>
17411 * script-sections.cc (Sections_element::allocate_to_segment): Add
17413 (Output_section_definition::allocate_to_segment): Likewise.
17414 (Orphan_output_section::allocate_to_segment): Likewise.
17415 (Script_sections::attach_sections_using_phdrs_clause): Don't
17416 propagate non-PT_LOAD segments to orphan sections.
17417 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17418 readelf rather than objdump.
17419 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17420 .interp section and PT_INTERP segment are the same size.
17421 * testsuite/Makefile.in: Rebuild.
17423 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17424 aliases for symbols defined in the same object.
17425 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17426 (weak_alias_test_SOURCES): New variable.
17427 (weak_alias_test_DEPENDENCIES): New variable.
17428 (weak_alias_test_LDFLAGS): New variable.
17429 (weak_alias_test_LDADD): New variable.
17430 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17431 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17432 (weak_alias_test_3.o): New target.
17433 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17434 * testsuite/weak_alias_test_main.cc: New file.
17435 * testsuite/weak_alias_test_1.cc: New file.
17436 * testsuite/weak_alias_test_2.cc: New file.
17437 * testsuite/weak_alias_test_3.cc: New file.
17439 2008-04-08 Ian Lance Taylor <iant@google.com>
17441 * options.h (class General_options): Add --noinhibit-exec option.
17442 * main.cc (main): Check --noinhibit-exec.
17444 * options.h (class General_options): Define --wrap as a special
17445 option. Add wrap_symbols_ field.
17446 (General_options::any_wrap_symbols): New function.
17447 (General_options::is_wrap_symbol): New function.
17448 * options.cc (General_options::parse_wrap): New function.
17449 (General_options::General_options): Initialize wrap_symbols_.
17450 * symtab.cc (Symbol_table::wrap_symbol): New function.
17451 (Symbol_table::add_from_object): Handle --wrap.
17452 * symtab.h (class Symbol_table): Declare wrap_symbol.
17453 * target.h (Target::wrap_char): New function.
17454 (Target::Target_info): Add wrap_char field.
17455 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17456 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17457 * testsuite/testfile.cc (Target_test::test_target_info):
17460 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17463 * layout.h (class Layout): Add added_eh_frame_data_ field.
17464 * layout.cc (Layout::Layout): Initialize new field.
17465 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17466 output section until we find a section we merged successfully.
17467 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17468 that the size be non-zero.
17470 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17473 2008-04-08 Craig Silverstein <csilvers@google.com>
17475 * configure.ac: Export new conditional variable HAVE_ZLIB.
17476 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17478 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17479 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17481 2008-04-07 Ian Lance Taylor <iant@google.com>
17483 * version.cc (version_string): Set to "1.5".
17485 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17486 Add issued_non_pic_error_ field. Declare check_non_pic.
17487 (Target_x86_64::Scan::check_non_pic): New function.
17488 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17489 (Target_x86_64::Scan::global): Likewise.
17491 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17492 addend parameter. Change caller. Handle merge sections.
17493 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17494 Address to Addend. Don't add in the result of
17495 local_section_offset, pass down the addend and use the returned
17497 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17498 Update declarations of local_section_offset and symbol_value.
17499 * testsuite/two_file_test_1.cc (t18): New function.
17500 * testsuite/two_file_test_2.cc (f18): New function.
17501 * testsuite/two_file_test_main.cc (main): Call t18.
17502 * testsuite/two_file_test.h (t18, f18): Declare.
17504 * configure.ac: Don't test for objdump, c++filt, or readelf.
17505 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17507 (TEST_READELF): New variable.
17508 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17509 (check_PROGRAMS): Add two_file_strip_test.
17510 (two_file_strip_test): New target.
17511 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17512 (two_file_same_shared_strip_test_SOURCES): New variable.
17513 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17514 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17515 (two_file_same_shared_strip_test_LDADD): New variable.
17516 (two_file_shared_strip.so): New target.
17517 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17518 (ver_test_5.syms, ver_test_7.syms): Likewise.
17519 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17520 (strip_test_3.stdout): Use TEST_OBJDUMP.
17521 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17523 2008-04-04 Cary Coutant <ccoutant@google.com>
17525 * symtab.h (Symbol::is_weak_undefined): New function.
17526 (Symbol::is_strong_undefined): New function.
17527 (Symbol::is_absolute): New function.
17528 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17529 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17531 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17532 (weak_undef_test): New target.
17533 * testsuite/Makefile.in: Rebuild.
17534 * testsuite/weak_undef_file1.cc: New file.
17535 * testsuite/weak_undef_file2.cc: New file.
17536 * testsuite/weak_undef_test.cc: New file.
17538 2008-04-03 Craig Silverstein <csilvers@google.com>
17540 * compressed_output.h (class Output_compressed_section): Use
17542 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17544 (zlib_compressed_suffix): Removed.
17545 (Output_compressed_section::set_final_data_size): Use unsigned
17547 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17548 Fix linker invocation.
17549 (flagstest_o_specialfile_and_compress_debug_sections):
17551 * testsuite/Makefile.in: Regenerated.
17553 2008-04-02 David S. Miller <davem@davemloft.net>
17555 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17556 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17558 2008-04-02 Craig Silverstein <csilvers@google.com>
17562 2008-04-02 Ian Lance Taylor <iant@google.com>
17564 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17565 parameters. Update for new key type to views_. Change all
17567 (File_read::read): Adjust for byteshift in returned view.
17568 (File_read::add_view): New function, broken out of
17569 find_and_make_view.
17570 (File_read::make_view): New function, broken out of
17571 find_and_make_view.
17572 (File_read::find_or_make_view): Add offset and aligned
17573 parameters. Rewrite accordingly. Change all callers.
17574 (File_read::get_view): Add offset and aligned parameters. Adjust
17575 for byteshift in return value.
17576 (File_read::get_lasting_view): Likewise.
17577 * fileread.h (class File_read): Update declarations.
17578 (class File_read::View): Add byteshift_ field. Add byteshift to
17579 constructor. Add byteshift method.
17580 * archive.h (Archive::clear_uncached_views): New function.
17581 (Archive::get_view): Add aligned parameter. Change all callers.
17582 * object.h (Object::get_view): Add aligned parameter. Change all
17584 (Object::get_lasting_view): Likewise.
17586 * fileread.cc (File_read::release): Don't call clear_views if
17587 there are multiple objects.
17588 * fileread.h (File_read::clear_uncached_views): New function.
17589 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17592 2008-03-31 Cary Coutant <ccoutant@google.com>
17594 Add thin archive support.
17595 * archive.cc (Archive::armagt): New const.
17596 (Archive::setup): Remove task parameter and calls to unlock.
17597 (Archive::unlock_nested_archives): New function.
17598 (Archive::read_header): Add nested_off parameter. Change
17600 (Archive::interpret_header): Likewise.
17601 (Archive::include_all_members): Change to handle thin
17603 (Archive::include_member): Likewise.
17604 * archive.h (Archive::Archive): Add new parameters and
17606 (Archive::armagt): New const.
17607 (Archive::setup): Remove task parameter.
17608 (Archive::unlock_nested_archives): New function.
17609 (Archive::read_header): Add nested_off parameter.
17610 (Archive::interpret_header): Likewise.
17611 (Archive::Nested_archive_table): New typedef.
17612 (Archive::is_thin_archive_): New field.
17613 (Archive::nested_archives_): New field.
17614 (Archive::options_): New field.
17615 (Archive::dirpath_): New field.
17616 (Archive::task_): New field.
17617 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17618 for thin archives. Pass additional parameters to
17619 Archive::Archive. Unlock the archive file after calling
17622 2008-03-29 Ian Lance Taylor <iant@google.com>
17624 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17625 version symbol to be local.
17626 * testsuite/ver_test_4.sh: New file.
17627 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17628 (check_DATA): Add ver_test_4.syms.
17629 (ver_test_4.syms): New target.
17630 * testsuite/Makefile.in: Rebuild.
17633 (Output_section::Input_section_sort_entry::has_priority): New
17635 (Output_section::Input_section_sort_entry::match_file_name): New
17637 (Output_section::Input_section_sort_entry::match_section_name):
17639 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17641 (Output_section::Input_section_sort_entry::match_section_file):
17643 (Output_section::Input_section_sort_compare::operator()): Rewrite
17644 using new Input_section_sort_entry functions. Sort crtbegin and
17645 crtend first. Sort sections with no priority before sections with
17647 * testsuite/initpri1.c (d3): Check j != 4.
17648 (cd5): New constructor/destructor function.
17649 (main): Check j != 2.
17651 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17652 new symbol when resolving, don't call set_is_default.
17653 * testsuite/ver_test_7.cc: New file.
17654 * testsuite/ver_test_7.sh: New file.
17655 * testsuite/Makefile.am (ver_test_7.so): New target.
17656 (ver_test_7.o): New target.
17657 (check_SCRIPTS): Add ver_test_7.sh.
17658 (check_DATA): Add ver_test_7.syms.
17659 (ver_test_7.syms): New target.
17661 2008-03-28 Ian Lance Taylor <iant@google.com>
17663 * layout.cc (Layout::layout): If we see an input section with a
17664 name that needs sorting, set the must_sort flag for the output
17666 (Layout::make_output_section): If the name of the output section
17667 indicates that it might require sorting, set the may_sort flag.
17668 * output.h (Output_section::may_sort_attached_input_sections): New
17670 (Output_section::set_may_sort_attached_input_sections): New
17672 (Output_section::must_sort_attached_input_sections): New
17674 (Output_section::set_must_sort_attached_input_sections): New
17676 (class Output_section): Declare Input_section_sort_entry. Define
17677 Input_section_sort_compare. Declare
17678 sort_attached_input_sections. Add new fields:
17679 may_sort_attached_input_sections_,
17680 must_sort_attached_input_sections_,
17681 attached_input_sections_are_sorted_.
17682 * output.cc (Output_section::Output_section): Initialize new
17684 (Output_section::add_input_section): Add an entry to
17685 input_sections_ if may_sort or must_sort are true.
17686 (Output_section::set_final_data_size): Call
17687 sort_attached_input_sections if necessary.
17688 (Output_section::Input_section_sort_entry): Define new class.
17689 (Output_section::Input_section_sort_compare::operator()): New
17691 (Output_section::sort_attached_input_sections): New function.
17692 * configure.ac: Check whether the compiler supports constructor
17693 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17694 * testsuite/initpri1.c: New file.
17695 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17696 CONSTRUCTOR_PRIORITY.
17697 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17698 (initpri1_LDFLAGS): New variable.
17699 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17701 2008-03-27 Ian Lance Taylor <iant@google.com>
17703 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17704 * testsuite/common_test_1.c: New file.
17705 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17706 (common_test_1_SOURCES): New variable.
17707 (common_test_1_DEPENDENCIES): New variable.
17708 (common_test_1_LDFLAGS): New variable.
17710 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17711 and commons_ correctly when NAME/VERSION does not override
17713 * testsuite/ver_test_6.c: New file.
17714 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17715 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17716 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17718 2008-03-26 Ian Lance Taylor <iant@google.com>
17720 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17721 of an undefined symbol from a version script.
17722 * testsuite/Makefile.am (ver_test_5.so): New target.
17723 (ver_test_5.o): New target.
17724 (check_SCRIPTS): Add ver_test_5.sh.
17725 (check_DATA): Add ver_test_5.syms.
17726 (ver_test_5.syms): New target.
17727 * testsuite/ver_test_5.cc: New file.
17728 * testsuite/ver_test_5.script: New file.
17729 * testsuite/ver_test_5.sh: New file.
17730 * Makefile.in, testsuite/Makefile.in: Rebuild.
17733 Fix problems building gold with gcc 4.3.0.
17734 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17735 (gold_error_at_location, gold_warning_at_location): Use it.
17736 * configure.ac: Check whether we can compile and use a template
17737 function with a printf attribute.
17738 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17739 when jumping over bytes.
17740 * object.cc: Instantiate Object::read_section_data.
17741 * debug.h: Include <cstring>
17742 * dwarf_reader.cc: Include <algorithm>
17743 * main.cc: Include <cstring>.
17744 * options.cc: Include <cstring>.
17745 * output.cc: Include <cstring>.
17746 * script.cc: Include <cstring>.
17747 * script.h: Include <string>.
17748 * symtab.cc: Include <cstring> and <algorithm>.
17749 * target-select.cc: Include <cstring>.
17750 * version.cc: Include <string>.
17751 * testsuite/testmain.cc: Include <cstdlib>.
17752 * configure, config.in: Rebuild.
17754 2008-03-25 Ian Lance Taylor <iant@google.com>
17756 * options.cc: Include "../bfd/bfdver.h".
17757 (options::help): Print bug reporting address.
17759 * version.cc (print_version): Adjust output for current value of
17760 BFD_VERSION_STRING.
17764 * options.cc (options::help): Print list of supported targets.
17765 * target-select.h: Include <vector>.
17766 (class Target_selector): Make machine_, size_, and is_big_endian_
17767 fields const. Add bfd_name_ and instantiated_target_ fields.
17768 (Target_selector::Target_selector): Add bfd_name parameter.
17769 (Target_selector::recognize): Make non-virtual, call
17771 (Target_selector::recognize_by_name): Make non-virtual, call
17772 do_recognize_by_name.
17773 (Target_selector::supported_names): New function.
17774 (Target_selector::bfd_name): New function.
17775 (Target_selector::do_instantiate_target): New pure virtual
17777 (Target_selector::do_recognize): New virtual function.
17778 (Target_selector::do_recognize_by_name): New virtual function.
17779 (Target_selector::instantiate_target): New private function.
17780 (supported_target_names): Declare.
17781 * target-select.cc (Target_selector::Target_selector): Update for
17782 new parameter and fields.
17783 (select_target_by_name): Check that the name matches before
17784 calling recognize_by_name.
17785 (supported_target_names): New function.
17786 * i386.cc (class Target_selector_i386): Update Target_selector
17787 constructor call. Remove recognize and recognize_by_name. Add
17788 do_instantiate_target.
17789 * x86_64.cc (class Target_selector_x86_64): Likewise.
17790 * testsuite/testfile.cc (class Target_selector_test): Update for
17791 changes to Target_selector.
17793 * README: Rewrite, with some notes on unsupported features.
17795 2008-03-24 Cary Coutant <ccoutant@google.com>
17797 * i386.cc (Target_i386::Got_type): New enum declaration.
17798 (Target_i386::Scan::local): Updated callers of Output_data_got
17800 (Target_i386::Scan::global): Likewise.
17801 (Target_i386::Relocate::relocate): Likewise.
17802 (Target_i386::Relocate::relocate_tls): Likewise.
17803 * object.h (Got_offset_list): New class.
17804 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17805 (Sized_relobj::local_got_offset): Likewise.
17806 (Sized_relobj::set_local_got_offset): Likewise.
17807 (Sized_relobj::local_has_tls_got_offset): Removed.
17808 (Sized_relobj::local_tls_got_offset): Removed.
17809 (Sized_relobj::set_local_tls_got_offset): Removed.
17810 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17811 * output.cc (Output_data_got::add_global): Added got_type parameter.
17812 (Output_data_got::add_global_with_rel): Likewise.
17813 (Output_data_got::add_global_with_rela): Likewise.
17814 (Output_data_got::add_global_pair_with_rel): New function.
17815 (Output_data_got::add_global_pair_with_rela): New function.
17816 (Output_data_got::add_local): Added got_type parameter.
17817 (Output_data_got::add_local_with_rel): Likewise.
17818 (Output_data_got::add_local_with_rela): Likewise.
17819 (Output_data_got::add_local_pair_with_rel): New function.
17820 (Output_data_got::add_local_pair_with_rela): New function.
17821 (Output_data_got::add_global_tls): Removed.
17822 (Output_data_got::add_global_tls_with_rel): Removed.
17823 (Output_data_got::add_global_tls_with_rela): Removed.
17824 (Output_data_got::add_local_tls): Removed.
17825 (Output_data_got::add_local_tls_with_rel): Removed.
17826 (Output_data_got::add_local_tls_with_rela): Removed.
17827 * output.h (Output_data_got::add_global): Added got_type parameter.
17828 (Output_data_got::add_global_with_rel): Likewise.
17829 (Output_data_got::add_global_with_rela): Likewise.
17830 (Output_data_got::add_global_pair_with_rel): New function.
17831 (Output_data_got::add_global_pair_with_rela): New function.
17832 (Output_data_got::add_local): Added got_type parameter.
17833 (Output_data_got::add_local_with_rel): Likewise.
17834 (Output_data_got::add_local_with_rela): Likewise.
17835 (Output_data_got::add_local_pair_with_rel): New function.
17836 (Output_data_got::add_local_pair_with_rela): New function.
17837 (Output_data_got::add_global_tls): Removed.
17838 (Output_data_got::add_global_tls_with_rel): Removed.
17839 (Output_data_got::add_global_tls_with_rela): Removed.
17840 (Output_data_got::add_local_tls): Removed.
17841 (Output_data_got::add_local_tls_with_rel): Removed.
17842 (Output_data_got::add_local_tls_with_rela): Removed.
17843 * resolve.cc (Symbol::override_base_with_special): Removed
17844 reference to has_got_offset_ field.
17845 * symtab.cc (Symbol::init_fields): Replaced initialization
17846 of got_offset_ with got_offsets_. Removed initialization
17848 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
17849 (Symbol::got_offset): Likewise.
17850 (Symbol::set_got_offset): Likewise.
17851 (Symbol::has_tls_got_offset): Removed.
17852 (Symbol::tls_got_offset): Removed.
17853 (Symbol::set_tls_got_offset): Removed.
17854 (Symbol::got_offset_): Removed.
17855 (Symbol::tls_mod_got_offset_): Removed.
17856 (Symbol::tls_pair_got_offset_): Removed.
17857 (Symbol::got_offsets_): New field.
17858 (Symbol::has_got_offset): Removed.
17859 (Symbol::has_tls_mod_got_offset): Removed.
17860 (Symbol::has_tls_pair_got_offset): Removed.
17861 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17862 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17864 (Target_x86_64::Scan::global): Likewise.
17865 (Target_x86_64::Relocate::relocate): Likewise.
17866 (Target_x86_64::Relocate::relocate_tls): Likewise.
17868 2008-03-25 Ben Elliston <bje@au.ibm.com>
17870 * yyscript.y: Fix spelling error in comment.
17872 2008-03-24 Ian Lance Taylor <iant@google.com>
17874 * options.h (class General_options): Define build_id option.
17875 * layout.h (class Layout): Declare write_build_id, create_note,
17876 create_build_id. Add build_id_note_ member.
17877 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17878 "libiberty.h", "md5.h", "sha1.h".
17879 (Layout::Layout): Initialize eh_frame_data_,
17880 eh_frame_hdr_section_, and build_id_note_.
17881 (Layout::finalize): Call create_build_id.
17882 (Layout::create_note): New function, broken out of
17883 Layout::create_gold_note.
17884 (Layout::create_gold_note): Call create_note.
17885 (Layout::create_build_id): New function.
17886 (Layout::write_build_id): New function.
17887 (Close_task_runner::run): Call write_build_id.
17889 * x86_64.cc: Correct license to GPLv3.
17891 2008-03-23 Ian Lance Taylor <iant@google.com>
17893 * options.cc: Include "demangle.h".
17894 (parse_optional_string): New function.
17895 (parse_long_option): Handle takes_optional_argument.
17896 (parse_short_option): Update dash_z initializer. Handle
17897 takes_optional_argument.
17898 (General_options::General_options): Initialize do_demangle_.
17899 (General_options::finalize): Set do_demangle_. Handle demangling
17901 * options.h (parse_optional_string): Declare.
17902 (struct One_option): Add optional_arg field. Update constructor.
17903 Update call constructor calls. Add takes_optional_argument
17905 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17906 (DEFINE_optional_string): Define.
17907 (General_options::demangle): Change from DEFINE_bool to
17908 DEFINE_optional_string.
17909 (General_options::no_demangle): New function.
17910 (General_options::do_demangle): New function.
17911 (General_options::set_do_demangle): New function.
17912 (General_options::execstack_status_): Move definition to end of
17914 (General_options::static_): Likewise.
17915 (General_options::do_demangle_): New field.
17916 * object.cc (big_endian>::get_symbol_location_info): Call
17917 Options::do_demangle, not Options::demangle.
17918 * symtab.cc (demangle): Likewise.
17920 2008-03-22 Ian Lance Taylor <iant@google.com>
17922 * gold.h: Include <cstddef> and <sys/types.h>
17923 * options.h: Include <cstring>.
17925 2008-03-21 Ian Lance Taylor <iant@google.com>
17927 * Added source code to GNU binutils.
17929 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17931 Copying and distribution of this file, with or without modification,
17932 are permitted in any medium without royalty provided the copyright
17933 notice and this notice are preserved.
17939 version-control: never