1 2015-10-07 Andreas Schwab <schwab@suse.de>
3 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
5 2015-10-06 Cary Coutant <ccoutant@gmail.com>
8 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
10 (Sparc_relocate_functions::gdop_lox10): Likewise.
11 (Target_sparc::Relocate::relocate): Use addend when computing
12 symbol value for R_SPARC_GOTDATA_OP*.
14 2015-09-07 Cary Coutant <ccoutant@gmail.com>
18 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
19 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
21 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
24 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
25 shared libraries into normal FUNC symbols.
26 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
27 symbols aren't from shared libraries.
29 2015-09-02 Alan Modra <amodra@gmail.com>
32 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
33 (Target_powerpc::Branch_info::make_stub): Determine whether long
34 branch stub is for save/restore function.
35 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
36 (Stub_table): Add need_save_res_.
37 (Stub_table:clear_stubs): Clear need_save_res_.
38 (Stub_table:set_address_and_size): Add save/restore section size.
39 (Stub_table::add_long_branch_entry): Add save_res param. Set
40 need_save_res_, but don't add space for save/restore stubs.
41 (Stub_table::find_long_branch_entry): Return offset to local copy
43 (Stub_table::do_write): Don't output save/restore stubs. Instead
44 copy the save/restore functions.
45 (Output_data_save_res:contents): New accessor.
46 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
48 2015-08-25 Cary Coutant <ccoutant@gmail.com>
51 * script-sections.cc (Memory_region::set_address): New method.
52 (Script_sections::find_memory_region): Add explicit_only parameter.
53 (Output_section_definition::set_section_addresses): Handle case where
54 script specifies both address and vma region.
55 * script-sections.h (Script_sections::find_memory_region): Add
56 explicit_only parameter.
58 2015-08-25 Cary Coutant <ccoutant@gmail.com>
61 * object.cc (Input_objects::add_object): Store objects in a map,
62 indexed by soname; update as-needed flag when necessary.
63 * object.h (Object::clear_as_needed): New method.
64 (Input_objects::so_names_): Change from set to map.
66 2015-08-25 Cary Coutant <ccoutant@gmail.com>
69 * expression.cc (Expression::Expression_eval_info): Add
70 is_valid_pointer field.
71 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
73 (Addr_expression::value_from_output_section): Check whether address
75 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
76 if evaluation failed due to address that is not yet valid.
77 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
80 2015-08-25 Cary Coutant <ccoutant@gmail.com>
84 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
86 2015-08-20 Alan Modra <amodra@gmail.com>
89 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
90 Subtract os->address() from addend.
91 * powerpc.cc (relocate_relocs): Likewise.
93 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
95 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
96 lazy_stub_normal_1, lazy_stub_normal_1_n64,
97 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
98 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
99 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
100 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
103 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
105 * configure: Regenerated.
107 2015-07-26 Doug Kwan <dougkwan@google.com>
109 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
110 disassembler output format.
112 2015-07-23 Ian Coolidge <icoolidge@google.com>
113 Plumb --pic-veneer option for gold.
115 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
117 * options.h (General_options): Add --pic-veneer option.
119 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
122 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
123 script_test_1a.cc script_test_1b.cc.
124 (script_test_11_r.o): Replace script_test_11.o with
125 script_test_11a.o script_test_11b.o.
126 (script_test_11.o): Removed.
127 (script_test_11a.o): New.
128 (script_test_11b.o): Likewise.
129 * testsuite/Makefile.in: Regenerated.
130 * testsuite/script_test_1.h: New file.
131 * testsuite/script_test_1b.cc: Likewise.
132 * testsuite/script_test_11.h: Likewise.
133 * testsuite/script_test_11b.c: Likewise.
134 * testsuite/script_test_1.cc: Renamed to ...
135 * testsuite/script_test_1a.cc: This.
136 Include "script_test_1.h".
137 (main): Call check_int and check_ptr.
138 * testsuite/script_test_11.c: Renamed to ...
139 * testsuite/script_test_11a.c: This.
140 Include "script_test_11.h".
141 (main): Call ptr_equal.
143 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
146 * testsuite/ifuncdep2.c (global): Change protected to hidden.
147 * testsuite/ifuncmod1.c (global): Likewise.
148 * testsuite/ifuncmod5.c (global): Likewise.
150 2015-07-22 Alan Modra <amodra@gmail.com>
152 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
154 2015-07-21 Cary Coutant <ccoutant@gmail.com>
157 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
158 forced local symbol even when oldsym != NULL.
159 (Symbol_table::do_define_in_output_segment): Likewise.
160 (Symbol_table::do_define_as_constant): Likewise.
162 2015-07-21 Cary Coutant <ccoutant@gmail.com>
165 * archive.cc (Library_base::should_include_member): Don't use entry
166 point for relocatable links, or if target is not yet valid.
167 * parameters.cc (Parameters::entry): Check target_valid().
169 2015-07-20 Han Shen <shenhan@google.com>
171 Optimize erratum 843419 fix.
173 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
174 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
175 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
176 (E843419_stub): New sub-class of Erratum_stub.
177 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
178 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
179 (AArch64_relobj::create_erratum_stub): Add 1 argument.
180 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
182 2015-07-20 Han Shen <shenhan@google.com>
184 Fix arm elf header flags wrt hardfp bit.
186 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
188 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
191 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
192 from input group section for relocatable link.
193 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
194 (check_DATA): Add pr18689.stdout.
195 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
196 (pr18689.stdout): New rule.
197 (pr18689a.o): Likewise.
198 (pr18689b.o): Likewise.
199 (pr18689.o): Likewise.
200 * testsuite/pr18689.c: New file.
201 * testsuite/pr18689.sh: Likewise.
202 * testsuite/Makefile.in: Regenerated.
204 2015-07-20 Yiran Wang <yiran@google.com>
205 Cary Coutant <ccoutant@gmail.com>
208 * resolve.cc (Symbol_table): Remove warning about references
209 from shared objects to hidden symbols.
210 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
211 * testsuite/Makefile.in: Regenerate.
212 * testsuite/hidden_test.sh: Check dynamic symbol table; update
213 expected error messages.
215 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
217 * compressed_output.cc (Output_compressed_section::set_final_data_size):
218 Make --compress-debug-sections=zlib the same as
219 --compress-debug-sections=zlib-gabi.
220 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
221 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
223 * testsuite/Makefile.in: Regenerated.
225 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
228 * compressed_output.cc (zlib_compress): Add argument for
229 compression header size. Set header size to compression header
230 size if it isn't 0. Don't write out the zlib header here.
231 (Output_compressed_section::set_final_data_size): Support
232 zlib-gnu and zlib-gabi compressions. Pass compression header
233 size to zlib_compress and write out compression header. Set
234 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
235 clear the SHF_COMPRESSED bit
236 * options.h (compress_debug_sections): Add zlib-gnu and
238 * output.h (Output_section::set_flags): New.
239 * testsuite/Makefile.am (check_PROGRAMS): Add
240 flagstest_compress_debug_sections_none,
241 flagstest_compress_debug_sections_gnu and
242 flagstest_compress_debug_sections_gabi.
243 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
244 flagstest_compress_debug_sections.stdout,
245 flagstest_compress_debug_sections.cmp,
246 flagstest_compress_debug_sections.check,
247 flagstest_compress_debug_sections_gnu.stdout,
248 flagstest_compress_debug_sections_gnu.cmp,
249 flagstest_compress_debug_sections_gnu.check,
250 flagstest_compress_debug_sections_gabi.stdout,
251 flagstest_compress_debug_sections_gabi.cmp and
252 flagstest_compress_debug_sections_gabi.check.
253 (flagstest_compress_debug_sections_none): New.
254 (flagstest_compress_debug_sections_none.stdout): Likewise.
255 (flagstest_compress_debug_sections.stdout): Likewise.
256 (flagstest_compress_debug_sections.check): Likewise.
257 (flagstest_compress_debug_sections.cmp): Likewise.
258 (flagstest_compress_debug_sections_gnu): Likewise.
259 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
260 (flagstest_compress_debug_sections_gnu.check): Likewise.
261 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
262 (flagstest_compress_debug_sections_gabi): Likewise.
263 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
264 (flagstest_compress_debug_sections_gnu.check): Likewise.
265 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
266 * testsuite/Makefile.in: Regenerated.
268 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
271 * compressed_output.h (decompress_input_section): Add arguments
272 for ELF class, big endian and sh_flags.
273 * compressed_output.cc (decompress_input_section): Likewise.
274 Support the SHF_COMPRESSED section.
275 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
277 * plugin.h (Pluginobj): Likewise.
278 * layout.cc (Layout::get_output_section_flags): Also clear the
280 * object.h (Compressed_section_info): Add flag to store sh_flags.
281 (Object): Add pure virtual elfsize and is_big_endian member
283 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
285 (build_compressed_section_map): Check SHF_COMPRESSED for
286 uncompressed size. Store sh_flags in Compressed_section_info.
287 Pass size, big_endian and sh_flags to decompress_input_section.
288 Skip the ".debug"/".zdebug" prefix when passing section name to
289 need_decompressed_section.
290 (Sized_relobj_file<size, big_endian>::do_find_special_section):
291 Don't check ".zdebug_*" sections.
292 (Object::decompressed_section_contents): Pass ELF class, big
293 endian and sh_flags to decompress_input_section.
294 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
296 * testsuite/Makefile.am (check_DATA): Add
297 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
298 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
299 gdb_index_test_2_gabi.stdout.
300 (debug_msg_cdebug_gabi.o): New.
301 (odr_violation1_cdebug_gabi.o): Likewise.
302 (odr_violation2_cdebug_gabi.o): Likewise.
303 (debug_msg_cdebug_gabi.err): Likewise.
304 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
305 (gdb_index_test_cdebug_gabi.o): Likewise.
306 (gdb_index_test_2_gabi): Likewise.
307 (gdb_index_test_2_gabi.stdout): Likewise.
308 * testsuite/gdb_index_test_2_gabi.sh: New file.
309 * testsuite/Makefile.in: Regenerated.
311 2015-07-09 Han Shen <shenhan@google.com>
313 Use "gold_info" instead of "gold_warning" for erratum fix.
315 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
317 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
319 2015-07-09 Han Shen <shenhan@google.com>
321 Drop missing symbol warning for arm/aarch64.
323 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
324 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
327 2015-07-07 Han Shen <shenhan@google.com>
329 Make gold aarch64 accept long form of mapping symbols.
331 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
334 2015-06-29 Doug Kwan <dougkwan@google.com>
336 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
337 at address expected by test.
338 * testsuite/arm_cortex_a8_b.s: Ditto.
339 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
340 * testsuite/arm_cortex_a8_bl.s: Ditto.
341 * testsuite/arm_cortex_a8_blx.s: Ditto.
342 * testsuite/arm_cortex_a8_local.s: Ditto.
343 * testsuite/arm_fix_v4bx.s: Ditto.
344 * testsuite/arm_unaligned_reloc.s: Ditto.
345 * testsuite/thumb_bl_out_of_range.s: Ditto.
346 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
347 * testsuite/thumb_blx_out_of_range.s: Ditto.
349 2015-06-29 Han Shen <shenhan@google.com>
351 Patch for erratum 843419 internal error.
353 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
354 (Erratum_stub::update_erratum_insn): New method.
355 (Stub_table::relocate_stubs): Modified to place relocated insn.
356 (AArch64_relobj::fix_errata): Modified gold_assert.
358 2015-06-12 Han Shen <shenhan@google.com>
362 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
363 defintion outside class definition.
364 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
365 (AArch64_insn_utilities::aarch64_op31): New member.
366 (AArch64_insn_utilities::aarch64_ra): New member.
367 (AArch64_insn_utilities::aarch64_mac): New member.
368 (AArch64_insn_utilities::aarch64_mlxl): New member.
369 (ST_E_835769): New global enum member.
370 (Stub_table::relocate_stubs): Add 835769 handler.
371 (Stub_template_repertoire::Stub_template_repertoire): Install new
373 (AArch64_relobj::scan_errata): This func is renamed from
375 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
376 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
377 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
378 (Target_aarch64::scan_erratum_835769_span): New method.
379 (Target_aarch64::create_erratum_stub): New method.
380 (Target_aarch64::is_erratum_835769_sequence): New method.
381 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
382 code into create_erratum_stub.
383 * options.h (fix_cortex_a53_835769): New option.
385 2015-06-11 Cary Coutant <ccoutant@gmail.com>
387 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
389 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
391 2015-06-11 Cary Coutant <ccoutant@gmail.com>
394 * layout.cc (corresponding_uncompressed_section_name): New function.
395 (Layout::choose_output_section): Call it.
396 * layout.h (corresponding_uncompressed_section_name): New function.
397 * script-sections.cc (Input_section_info::set_section_name): Check
398 for compressed debug section (.zdebug style).
400 2015-06-11 Jing Yu <jingyu@google.com>
402 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
403 * testsuite/Makefile.in: Regenerate.
405 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
407 * gold.h (is_cident): Correct typo.
409 2015-06-10 Han Shen <shenhan@google.com>
410 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
412 Now fixing for 843419 is fully functional.
414 The first part of the erratum fix CL is here -
415 https://sourceware.org/ml/binutils/2015-04/msg00229.html
417 * aarch64.cc(global enum): New constants representing stub types.
418 (Stub_template): New POD struct.
419 (Stub_template_repertoire): New class.
420 (Stub_base): New class.
421 (Erratum_stub): New class.
422 (Reloc_stub): Refactored to be a subclass of Stub_base.
423 (Reloc_stub::Stub_type): Removed.
424 (Reloc_stub::offset): Moved to Stub_base.
425 (Reloc_stub::set_offset): Moved to Stub_base.
426 (Reloc_stub::destination_address): Moved to Stub_base.
427 (Reloc_stub::set_destination_address): Moved to Stub_base.
428 (Reloc_stub::reset_destination_address): Moved to Stub_base.
429 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
430 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
431 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
432 (Reloc_stub::write): Moved to Stub_base.
433 (Reloc_stub::invalid_offset): Moved to Stub_base.
434 (Reloc_stub::invalid_address): Moved to Stub_base.
435 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
436 (Reloc_stub::stub_insns_): Moved to Stub_base.
437 (Reloc_stub::offset_): Moved to Stub_base.
438 (Reloc_stub::destination_address_): Moved to Stub_base.
439 (Stub_table::The_aarch64_relobj): New typedef.
440 (Stub_table::The_erratum_stub): New typedef.
441 (Stub_table::The_erratum_stub_less): New typedef.
442 (Stub_table::The_erratum_stub_set): New typedef.
443 (Stub_table::The_erratum_stub_set_iter): New typedef.
444 (Stub_table::empty): Added emptiness testing for erratum stubs.
445 (Stub_table::add_erratum_stub): New method to add an erratum stub.
446 (Stub_table::find_erratum_stub): New method.
447 (Stub_table::find_erratum_stubs_for_input_section): New method.
448 (Stub_table::erratum_stub_address): New method.
449 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
450 (Stub_table::do_addralign): Modified to handle erratum stubs.
451 (Stub_table::erratum_stubs_): New member.
452 (Stub_table::erratum_stub_size_): New member.
453 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
454 (Stub_table::do_write): Modified to handle erratum stubs.
455 (AArch64_relobj::The_erratum_stub): New typedef.
456 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
457 (AArch64_relobj::fix_errata): New method.
458 (Target_aarch64::The_reloc_stub_type): Removed.
459 (Target_aarch64::The_erratum_stub): New typede.
460 (AArch64_relocate_functions::construct_b): New method.
462 2015-06-08 Nick Clifton <nickc@redhat.com>
464 * po/fr.po: New French Translation.
466 2015-06-07 Cary Coutant <ccoutant@gmail.com>
469 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
470 callers. Don't use STT_COMMON to check for common symbols.
471 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
472 symbol that's not in a common section.
473 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
476 2015-06-04 Cary Coutant <ccoutant@gmail.com>
479 * Makefile.am (diststuff): Add target.
480 * Makefile.in: Regenerate.
482 2015-06-04 Cary Coutant <ccoutant@gmail.com>
485 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
486 temporary locals in merge sections.
487 * options.cc (General_options::parse_discard_all): New method.
488 (General_options::parse_discard_locals): New method.
489 (General_options::parse_discard_none): New method.
490 (General_options::General_options): Initialize discard_locals_.
491 * options.h (--discard-all): Convert to special option.
492 (--discard-locals): Likewise.
493 (--discard-none): New option.
494 (General_options::discard_all): New method.
495 (General_options::discard_locals): New method.
496 (General_options::discard_sec_merge): New method.
497 (General_options::Discard_locals): New enum.
498 (General_options::discard_locals_): New data member.
500 2015-06-03 Cary Coutant <cary@google.com>
502 * script-sections.cc (Script_sections::Script_sections): Initialize
504 (Script_sections::create_note_and_tls_segments): Set flag when
505 segments are created.
506 (Script_sections::expected_segment_count): Count PT_INTERP.
507 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
508 segments are created.
509 * script-sections.h (Script_sections::segments_created_): New data
512 2015-06-03 Cary Coutant <ccoutant@gmail.com>
516 (Output_section_element_input::set_section_addresses): When there
517 are several patterns with no sort spec, put all sections in the same
519 * testsuite/Makefile.am (script_test_12): New testcase.
520 (script_test_12i): New testcase.
521 * testsuite/Makefile.in: Regenerate.
522 * testsuite/script_test_12.t: New test linker script.
523 * testsuite/script_test_12i.t: New test linker script.
524 * testsuite/script_test_12a.c: New test source file.
525 * testsuite/script_test_12b.c: New test source file.
527 2015-06-02 Cary Coutant <ccoutant@gmail.com>
529 * nacl.h (Sniff_file): Switch parameters to get_view to get an
532 2015-06-03 Cary Coutant <ccoutant@gmail.com>
535 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
536 separate task to schedule the build id computation.
537 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
538 add Output_file and offset.
539 (Hash_task::run): Get and release the input views.
540 (Hash_task::is_runnable): Always return NULL (always runnable).
541 (Layout::queue_build_id_tasks): Remove.
542 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
543 parameters; use them instead of class members.
544 (Build_id_task_runner::run): New function.
545 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
547 * layout.h (Layout::queue_build_id_tasks): Remove.
548 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
550 (Layout::array_of_hashes_): Remove.
551 (Layout::size_of_array_of_hashes_): Remove.
552 (Layout::input_view_): Remove.
553 (Build_id_task_runner): New class.
554 (Close_task_runner::Close_task_runner): Add array_of_hashes and
555 size_of_hashes parameters.
556 (Close_task_runner::array_of_hashes_): New data member.
557 (Close_task_runner::size_of_hashes_): New data member.
558 * testsuite/Makefile.am
559 (flagstest_compress_debug_sections_and_build_id_tree): New test.
560 * testsuite/Makefile.in: Regenerate.
562 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
564 * merge.cc (get_input_merge_map): Update for data structure change.
565 (get_or_make_input_merge_map): Update for data structure change.
566 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
567 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
569 2015-05-16 Alan Modra <amodra@gmail.com>
571 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
572 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
573 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
574 (lis_0): Rename from lis_0_0.
576 2015-04-29 Cary Coutant <cary@google.com>
577 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
579 * gc.h (Garbage_collection::is_section_garbage): Change Object*
581 (Garbage_collection::add_reference): Likewise.
582 (Garbage_collection::gc_process_relocs): Likewise. Don't push
583 object/shndx pair onto *secvec for dynamic objects. Don't follow
584 relocations pointing to dynamic objects for GC.
585 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
586 (Icf::unfold_section): Likewise.
587 (Icf::is_section_folded): Likewise.
588 (Icf::get_folded_section): Likewise.
589 * icf.h: (Icf::get_folded_section): Likewise.
590 (Icf::unfold_section): Likewise.
591 (Icf::is_section_folded): Likewise.
592 (Icf::section_has_function_pointers): Likewise.
593 (Icf::set_section_has_function_pointers): Likewise.
594 * object.h (Section_id): Likewise.
595 (Const_section_id): Likewise.
596 * output.cc (Output_section::update_section_layout): Likewise.
597 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
599 * plugin.cc (update_section_order): Likewise.
600 (unique_segment_for_sections): Likewise.
601 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
602 (Target_powerpc::do_gc_add_reference): Likewise.
603 (Target_powerpc::gc_process_relocs): Likewise.
604 (Target_powerpc::do_gc_add_reference): Likewise.
605 * symtab.cc (Symbol_table::is_section_folded): Likewise.
606 (Symbol_table::gc_mark_symbol): Likewise.
607 * symtab.h: (Symbol_table::is_section_folded): Likewise.
608 * target.h: (Sized_target::gc_add_reference): Likewise.
609 (Sized_target::do_gc_add_reference): Likewise.
611 2015-04-29 Nick Clifton <nickc@redhat.com>
613 * po/fi.po: Updated Finnish translation.
615 2015-04-28 Alan Modra <amodra@gmail.com>
617 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
618 than unsigned int for find_global_entry result temp. Compare
619 against invalid_address.
620 (Target_powerpc::do_plt_address_for_global): Likewise.
621 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
622 on plt call stub existence for debug info. Do assert for plt
623 and global entry stub existence if an alloc section.
625 2015-04-28 Alan Modra <amodra@gmail.com>
627 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
628 on missing global entry stub due to bogus debug info.
630 2015-04-27 Han Shen <shenhan@google.com>
632 * options.h (--fix-cortex-a53-843419): Rename option.
633 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
635 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
637 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
640 * output.cc (Output_section::is_input_address_mapped): Assume a missing
642 * testsuite/Makefile.am: Add the eh_test test.
643 * testsuite/Makefile.in: Regenerate.
644 * testsuite/eh_test_a.cc: New test.
645 * testsuite/eh_test_b.cc: New test.
647 2015-04-23 Sriraman Tallam <tmsriram@google.com>
649 * options.h (--weak-unresolved-symbols): New option.
650 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
651 binding to weak with new option.
652 * symtab.h (is_weak_undefined): Check for new option.
653 (is_strong_undefined): Check for new option.
654 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
655 * testsuite/Makefile.in: Regenerate.
656 * testsuite/weak_unresolved_symbols_test.cc: New file.
658 2015-04-20 Ian Coolidge <icoolidge@google.com>
660 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
663 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
665 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
667 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
668 * object.cc (Sized_relobj_file::do_layout): Use push_back.
669 * powerpc.cc (process_gc_mark): Use push_back.
670 (Target_powerpc::do_gc_mark_symbol): Use push_back.
671 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
673 2015-04-16 Han Shen <shenhan@google.com>
675 * aarch64.cc (AArch64_insn_utilities): New utility class.
676 (AArch64_relobj::Mapping_symbol_position): New struct.
677 (AArch64_relobj::Mapping_symbol_info): New typedef.
678 (AArch64_relobj::do_count_local_symbols): New function overriding
679 parent's implementation.
680 (AArch64_relobj::mapping_symbol_info_): New member
681 (AArch64_relobj::scan_erratum_843419): New method.
682 (Target_aarch64::scan_erratum_843419_span): New method.
683 (Target_aarch64::is_erratum_843419_sequence): New method.
684 * options.h (fix_cortex_a53): New option.
686 2015-04-09 Cary Coutant <ccoutant@google.com>
688 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
690 * testsuite/Makefile.am (tls_pie_test.sh): New test.
691 * testsuite/Makefile.in: Regenerate.
692 * testsuite/tls_pie_test.sh: New.
694 2015-04-09 Cary Coutant <ccoutant@google.com>
696 * debug.h (DEBUG_LOCATION): New.
697 (DEBUG_ALL): Include DEBUG_LOCATION.
698 (debug_string_to_enum): Add DEBUG_LOCATION.
699 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
700 output to print correct context.
701 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
702 up to 4 more locations at the beginning of the function.
703 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
704 result before sorting list of line numbers.
705 * testsuite/debug_msg.sh: Allow range of line numbers for
706 canonical results on optimized code.
708 2015-04-07 HC Yen <hc.yen@mediatek.com>
710 Add AArch32 support for gold linker.
712 * arm.cc: Add V8 arch combine table.
714 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
716 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
718 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
720 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
721 to find by using the return value of insert.
723 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
725 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
728 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
731 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
732 (Target_x86_64::Scan::local): Don't create GOT entry, when we
733 can convert mov to lea.
734 (Target_x86_64::Scan::global): Ditto.
735 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
736 %reg to lea foo(%rip), %reg if possible.
737 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
738 * testsuite/x86_64_mov_to_lea1.s: New.
739 * testsuite/x86_64_mov_to_lea2.s: Ditto.
740 * testsuite/x86_64_mov_to_lea3.s: Ditto.
741 * testsuite/x86_64_mov_to_lea4.s: Ditto.
742 * testsuite/x86_64_mov_to_lea.sh: Ditto.
744 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
746 * configure: Regenerated.
748 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
751 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
752 (Target_i386::Scan::local): Don't create GOT entry, when we
753 can convert GOT to GOTOFF.
754 (Target_i386::Scan::global): Ditto.
755 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
756 lea foo@GOTOFF(%reg), %reg if possible.
757 * testsuite/Makefile.am (i386_mov_to_lea): New test.
758 * testsuite/i386_mov_to_lea1.s: New.
759 * testsuite/i386_mov_to_lea2.s: Ditto.
760 * testsuite/i386_mov_to_lea3.s: Ditto.
761 * testsuite/i386_mov_to_lea4.s: Ditto.
762 * testsuite/i386_mov_to_lea5.s: Ditto.
763 * testsuite/i386_mov_to_lea.sh: Ditto.
765 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
767 * Makefile.am (ZLIB): New.
769 (AM_CFLAGS): Add $(ZLIBINC).
770 (AM_CXXFLAGS): Likewise.
771 (ldadd_varldadd_var): Add $(ZLIB).
772 (incremental_dump_LDADD): Likewise.
773 (dwp_LDADD): Likewise.
774 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
776 (zlib_compress): Don't check HAVE_ZLIB_H.
777 (zlib_decompress): Likewise.
778 * options.h (compress_debug_sections): Likewise.
779 * configure.ac (AM_CONDITIONAL): Removed.
780 * testsuite/Makefile.am (ZLIB): New.
781 (LDADD): Add $(ZLIB).
782 Don't check HAVE_ZLIB.
783 * Makefile.in: Regenerated.
784 * config.in: Likewise.
785 * configure: Likewise.
786 * testsuite/Makefile.in: Likewise.
788 2015-03-30 Jing Yu <jingyu@google.com>
790 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
791 TLSLD_ADD_DTPREL_LO12_NC.
792 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
793 _TLS_MODULE_BASE_ point to the start of tls segment.
794 (Target_aarch64::optimize_tls_reloc): Add cases for
795 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
796 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
797 (Target_aarch64::Scan::local): Likewise.
798 (Target_aarch64::Scan::global): Likewise.
799 (Target_aarch64::Relocate::relocate): Likewise.
800 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
801 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
804 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
806 * merge.cc (Object_merge_map::add_mapping): call
807 Object_merge_map::Input_merge_map::add_mapping.
808 (Object_merge_map::Input_merge_map::add_mapping): New.
809 (Output_merge_data::do_add_input_section): Call
810 get_or_make_input_merge_map before a loop.
811 (Output_merge_string<Char_type>::finalize_merged_data): Call
812 get_or_make_input_merge_map before a loop.
813 * merge.h (Object_merge_map): Make Input_merge_map public.
814 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
815 (Relobj::get_or_create_merge_map): New.
816 * object.h (Relobj::get_or_create_merge_map): New.
818 2015-03-24 Alan Modra <amodra@gmail.com>
821 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
822 relocation errors for branches to strong undefined symbols.
824 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
826 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
827 (Object_merge_map::is_merge_section_for): Remove.
828 (Object_merge_map::find_merge_section): New.
829 * merge.h (Object_merge_map::is_merge_section_for): Remove.
830 (Object_merge_map::find_merge_section): New.
831 (Object_merge_map::get_input_merge_map): Add a const version.
832 * object.cc (Relobj::is_merge_section_for): Remove.
833 (Relobj::find_merge_section): New.
834 * object.h (Relobj::is_merge_section_for): Remove.
835 (Relobj::find_merge_section): New.
837 (Output_section::Input_section::is_merge_section_for): Remove.
838 (Output_section::add_merge_input_section): Don't call
839 add_merge_input_section.
840 (Output_section::find_merge_section): Return const. Use
841 object->find_merge_section.
842 (Output_section::build_lookup_maps): Don't build a map for
844 (Output_section::is_input_address_mapped): Return false if
845 section is not found.
846 (Output_section::find_starting_output_address): Use
847 find_merge_section instead of is_merge_section_for.
848 (Output_section::add_script_input_section): Don't build a map for
850 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
851 (Output_section_lookup_maps::find_merge_section): Remove.
852 (Output_section_lookup_maps::add_merge_input_section) Remove.
853 (Output_section::find_merge_section): Return const.
855 2015-03-22 Cary Coutant <cary@google.com>
858 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
859 non-SIB form of lea, with nop after the call.
861 2015-03-21 Cary Coutant <cary@google.com>
864 * output.cc (Output_segment::is_first_section_relro): Don't ignore
866 (Output_segment::set_section_addresses): Don't align size of relro
869 2015-03-21 Cary Coutant <cary@google.com>
872 * stringpool.cc (Stringpool_template): Don't optimize if section
873 alignment is greater than sizeof(char).
875 2015-03-21 Cary Coutant <cary@google.com>
878 * script-c.h (script_include_directive): Add first_token parameter.
879 * script.cc (script_include_directive): Add first_token parameter, and
880 pass it to read_script_file.
881 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
882 (PARSING_MEMORY_DEF): New tokens.
883 (top): Add new productions for INCLUDE files.
884 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
885 Pass PARSING_LINKER_SCRIPT to script_include_directive.
886 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
887 (section_cmd): Pass PARSING_SECTION_CMDS.
888 (file_or_sections_cmd): Remove.
889 (memory_def): Pass PARSING_MEMORY_DEF.
890 * testsuite/Makefile.am (memory_test_2): New test.
891 * testsuite/Makefile.in: Regenerate.
892 * testsuite/memory_test_inc.t: New script file.
893 * testsuite/memory_test_inc_1.t.src: New script file.
894 * testsuite/memory_test_inc_2.t.src: New script file.
895 * testsuite/memory_test_inc_3.t.src: New script file.
897 2015-03-21 Cary Coutant <cary@google.com>
899 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
900 (Sized_relobj_dwo::setup): Build compressed section map.
901 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
902 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
904 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
905 compressed_sections_ field.
906 (build_compressed_section_map): Take Object instead of
907 Sized_relobj_file parameter; add decompress_if_needed parameter.
908 (Sized_relobj_file::do_find_special_sections): Store compressed
909 section map in parent Object.
910 (Sized_relobj_file::do_decompressed_section_contents): Move
911 implementation to Object::decompressed_section_contents.
912 (Sized_relobj_file::do_discard_decompressed_sections): Move
913 implementation to Object::discard_decompressed_sections.
914 * object.h (build_compressed_section_map): Declare.
915 (Object::Object): Add compressed_sections_ field.
916 (Object::section_is_compressed): Move implementation here.
917 (Object::decompressed_section_contents): De-virtualize.
918 (Object::discard_decompressed_sections): De-virtualize.
919 (Object::do_section_is_compressed): Delete.
920 (Object::do_decompressed_section_contents): Delete.
921 (Object::set_compressed_sections): New method.
922 (Object::compressed_sections): New method.
923 (Object::compressed_sections_): New data member.
924 (Compressed_section_info, Compressed_section_map): Move to top of file.
925 (Sized_relobj_file::do_section_is_compressed): Delete.
926 (Sized_relobj_file::do_decompressed_section_contents): Delete.
927 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
928 (Sized_relobj_file::compressed_sections_): Move to Object class.
930 2015-03-21 Cary Coutant <ccoutant@google.com>
933 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
936 2015-03-11 Cary Coutant <ccoutant@google.com>
938 * options.cc (General_options::finalize): Don't allow -z relro
939 with incremental linking.
940 * testsuite/Makefile.am (incremental_test): Add -z norelro.
941 (incremental_test_2): Likewise.
942 (incremental_test_3): Likewise.
943 (incremental_test_4): Likewise.
944 (incremental_test_5): Likewise.
945 (incremental_test_6): Likewise.
946 (incremental_copy_test): Likewise.
947 (incremental_common_test_1): Likewise.
948 (incremental_comdat_test_1): Likewise.
949 * testsuite/Makefile.in: Regenerate.
951 2015-03-09 Cary Coutant <ccoutant@google.com>
954 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
955 return enum indicating whether .eh_frame section is empty, optimizable,
956 unrecognized, or an end marker. Adjust explicit instantiations.
957 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
958 (Eh_frame::add_ehframe_input_section): Change return type.
959 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
960 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
961 to the .eh_frame output section until we see the end marker.
962 (Layout::finalize_eh_frame_section): New.
963 * layout.h: (Layout::finalize_eh_frame_section): New.
965 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
967 * output.cc (Relobj::initialize_input_to_output_map<size>):
968 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
970 2015-03-04 Cary Coutant <ccoutant@google.com>
972 * parameters.cc (Parameters::set_target_once): Call
973 Target::select_as_default_target just once from here...
974 (set_parameters_target): ...instead of from here.
976 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
978 * ehframe.cc (Cie::set_output_offset): Pass in and use a
979 Output_section_data instead of a Merge_map.
980 (Eh_frame::Eh_frame): Don't initialize merge_map_.
981 (Eh_frame::read_cie): Use add_merge_mapping instead of
982 Merge_map::add_mapping.
983 (Eh_frame::read_fde): Ditto.
984 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
985 (Eh_frame::do_output_offset): Use merge_output_offset istead of
986 merge_map_->get_output_offset.
987 (Eh_frame::do_is_merge_section_for): Delete.
988 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
989 instead of a Merge_map.
990 (Cie::set_output_offset): Pass in a Output_section_data instead of a
992 (Eh_frame::do_is_merge_section_for): Delete.
993 (Eh_frame::merge_map_): Delete.
994 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
995 and use a Output_section_data instead of a Merge_map.
996 (Object_merge_map::add_mapping): Ditto.
997 (Object_merge_map::get_output_offset): Remove the merge_map argument.
998 (Object_merge_map::is_merge_section_for): Pass in and use a
999 Output_section_data instead of a Merge_map.
1000 (Merge_map): Delete.
1001 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1002 of merge_map_.get_output_offset.
1003 (Output_merge_base::do_is_merge_section_for): Delete.
1004 (Output_merge_data::do_add_input_section): Use
1005 object->add_merge_mapping instead of add_mapping.
1006 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1007 * merge.h (Merge_map): Delete forward declaration.
1008 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1009 instead of a Merge_map.
1010 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1011 (Object_merge_map::is_merge_section_for): Pass in and use a
1012 Output_section_data instead of a Merge_map.
1013 (Input_merge_map::Object_merge_map::merge_map): Replace with
1015 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1016 Output_section_data instead of a Merge_map.
1017 (Merge_map): Delete.
1018 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1019 (Output_merge_base::do_is_merge_section_for): Delete.
1020 (Output_merge_base::add_mapping): Delete.
1021 (Output_merge_base::merge_map_): Delete.
1022 * object.cc (Relobj::initialize_input_to_output_map): New.
1023 (Relobj::initialize_input_to_output_map): New.
1024 (Relobj::merge_output_offset): New.
1025 (Relobj::is_merge_section_for): New.
1026 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1028 * object.h (Relobj::merge_map): Delete.
1029 (initialize_input_to_output_map): New.
1030 (set_merge_map): Delete.
1031 (add_merge_mapping): New.
1032 (merge_output_offset): New.
1033 (is_merge_section_for): New.
1034 * output.cc (Output_section::Input_section::is_merge_section_for):
1035 Use object->is_merge_section_for.
1036 * output.h (Output_section_data::is_merge_section_for): Delete.
1037 (Output_section_data::do_is_merge_section_for): Delete.
1038 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1039 Use object->initialize_input_to_output_map.
1040 (Merged_symbol_value<size>::value_from_output_section): Use
1041 object->merge_output_offset.
1043 2015-03-02 Peter Collingbourne <pcc@google.com>
1044 Cary Coutant <ccoutant@google.com>
1046 * output.cc (Output_section::add_merge_input_section): Do not
1047 attempt to merge sections with an entsize of 0.
1049 2015-03-02 Khem Raj <raj.khem@gmail.com>
1051 * attributes.h (class Output_attributes_section_data ): Add
1052 do_print_to_mapfile function.
1054 2015-02-24 Alan Modra <amodra@gmail.com>
1057 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1058 complain if value is not a multiple of four.
1059 (Target_powerpc::Relocate::relocate): Correct handling of
1060 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1062 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1064 * configure.ac (default_size): Set to 32 for x32.
1065 * configure: Regenerated.
1067 2015-02-18 Alan Modra <amodra@gmail.com>
1070 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1073 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1075 * gc.h (Garbage_collection::add_reference): Don't use find.
1077 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1079 * object.cc (write_local_symbols): avoid std::vector copy.
1081 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1083 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1085 2015-02-09 Mark Wielaard <mjw@redhat.com>
1087 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1088 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1090 2015-02-16 Cary Coutant <ccoutant@google.com>
1094 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1095 DF_SYMBOLIC if --dynamic-list option is used.
1096 * options.cc (General_options::finalize): --dynamic-list is not
1097 mutually exclusive with -Bsymbolic.
1098 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1099 listed in --dynamic-list.
1100 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1101 -Bsymbolic-functions.
1102 * testsuite/Makefile.in: Regenerate.
1104 2015-02-16 Cary Coutant <ccoutant@google.com>
1107 * incremental.cc: Remove redundant include of "output.h".
1109 2015-02-12 Jing Yu <jingyu@google.com>
1111 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1112 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1114 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1115 TLSLE_MOVW_* relocations.
1116 (Target_aarch64::Scan::global): Likewise.
1117 (Target_aarch64::Relocate::relocate): Likewise.
1118 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1119 for new TLSLE_MOVW_* relocations.
1121 2015-02-11 Will Newton <will.newton@linaro.org>
1124 * arm.cc (Target_arm::make_plt_section): Create an ARM
1125 state mapping symbol at the start of the PLT.
1127 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1129 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1130 Replace two_file_shared_2.so with two_file_shared_1.so.
1131 * testsuite/Makefile.in: Regenerated.
1133 2015-02-09 Alan Modra <amodra@gmail.com>
1135 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1136 plugin_test_thin.a and defsym_test.
1137 * testsuite/Makefile.in: Regenerate.
1139 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1141 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1144 2015-02-04 Peter Collingbourne <pcc@google.com>
1146 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1147 forwarding symbols when computing symbol resolution info for plugins.
1148 * plugin.h (Plugin_manager::symtab): New method.
1149 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1151 2015-02-03 Cary Coutant <ccoutant@google.com>
1152 Peter Collingbourne <pcc@google.com>
1155 * archive.cc (Thin_archive_object_unlocker): New class.
1156 (Archive::include_member): Unlock external members of thin archives.
1157 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1158 (plugin_test_2): Likewise.
1159 (plugin_test_3): Likewise.
1160 (plugin_test_4): Likewise.
1161 (plugin_test_5): Likewise.
1162 (plugin_test_6): Likewise.
1163 (plugin_test_7): Likewise.
1164 (plugin_test_8): Likewise.
1165 (plugin_test_9): Likewise.
1166 (plugin_test_10): Likewise.
1167 (plugin_test_11): New test case.
1168 * testsuite/Makefile.in: Regenerate.
1169 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1170 file to decide whether to claim file.
1171 (all_symbols_read_hook): Likewise.
1172 * testsuite/plugin_test_1.sh: Adjust expected output.
1173 * testsuite/plugin_test_2.sh: Likewise.
1174 * testsuite/plugin_test_3.sh: Likewise.
1175 * testsuite/plugin_test_6.sh: Likewise.
1176 * testsuite/plugin_test_tls.sh: Likewise.
1177 * testsuite/plugin_test_11.sh: New testcase.
1179 2015-02-03 Cary Coutant <ccoutant@google.com>
1181 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1182 file descriptors when debugging enabled. Add debug output.
1183 (Descriptors::release): Add debug output.
1184 (Descriptors::close_some_descriptor): Likewise.
1185 (Descriptors::close_all): Likewise.
1186 * fileread.cc (File_read::lock): Likewise.
1187 (File_read::unlock): Likewise.
1189 2015-02-02 Cary Coutant <ccoutant@google.com>
1191 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1192 executable output file.
1194 2015-01-22 Han Shen <shenhan@google.com>
1196 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1197 (Target_arm::do_plt_address_for_global): New method.
1198 (Target_arm::do_plt_address_for_local): New method.
1199 (Target_arm::rel_irelative_section): New method.
1200 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1201 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1202 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1203 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1204 (Target_arm::Scan::check_non_pic): Add ifunc support.
1205 (Target_arm::Scan::local): Add ifunc support.
1206 (Target_arm::Scan::global): Add ifunc support.
1207 (Target_arm::make_plt_section): New method.
1208 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1209 (Target_arm::make_local_ifunc_plt_entry): New method.
1210 (Target_arm::got_irelative_): New member.
1211 (Target_arm::rel_irelative_): New member.
1212 (Target_arm::got_section): Add creation for got_irelative_.
1213 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1214 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1215 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1216 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1217 (Output_data_plt_arm::IRelative_data): New type.
1218 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1219 (Output_data_plt_arm::add_entry): Add more parameters.
1220 (Output_data_plt_arm::add_relocation): New method.
1221 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1222 (Output_data_plt_arm::rel_irelative): New method.
1223 (Output_data_plt_arm::entry_count): Modified.
1224 (Output_data_plt_arm::address_for_global): New method.
1225 (Output_data_plt_arm::address_for_local): New method.
1227 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1228 (Output_data_plt_arm::insert_irelative_data): New method.
1229 (Output_data_plt_arm::irelative_rel_): New member.
1230 (Output_data_plt_arm::got_): New member.
1231 (Output_data_plt_arm::got_irelative_): New member.
1232 (Output_data_plt_arm::irelative_count_): New member.
1233 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1234 (Output_data_plt_arm::irelative_data_vec_): New member.
1235 (Output_data_plt_arm::do_write): Write out irelative entries.
1236 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1237 more parameters to ctor.
1238 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1239 more parameters to ctor.
1240 * output.h (Output_data_reloc::add_local_relative): New method.
1241 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1243 2015-01-29 Alan Modra <amodra@gmail.com>
1245 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1246 and GOT_TLSGD to LE optimization.
1248 2015-01-28 Cary Coutant <ccoutant@google.com>
1250 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1251 for undef TLS symbols.
1252 (Target_x86_64::Relocate::relocate_tls): Likewise.
1253 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1255 2015-01-25 Cary Coutant <ccoutant@google.com>
1257 * output.cc (Output_segment::set_section_addresses): Fix calculation
1258 of size of relro segment.
1260 2015-01-22 Alan Modra <amodra@gmail.com>
1262 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1263 condition for need of ifunc plt entry.
1264 (Target_powerpc::Scan::global <got relocs>): Likewise.
1266 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1268 * mips.cc (reloc_high): Add r_sym.
1269 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1270 reloc_high constructor.
1271 (Mips_relocate_functions::relgot16_local): Likewise.
1272 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1273 r_type to decide whether LO16 matches HI16.
1274 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1275 rello16 and relgot16_local.
1277 2015-01-09 Cary Coutant <ccoutant@google.com>
1279 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1280 unless alignment is larger than page size.
1282 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1283 Cary Coutant <ccoutant@google.com>
1286 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1287 (DEFAULT_TARGET_X32): Set for x32.
1288 * x86_64.cc (cmp_insn_32): New.
1289 (lea_r10_insn_32): Likewise.
1290 (lea_r11_insn_32): Likewise.
1291 (cmp_insn_64): Likewise.
1292 (lea_r10_insn_64): Likewise.
1293 (lea_r11_insn_64): Likewise.
1294 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1295 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1296 (check_DATA): Add split_x32 files.
1297 (split_x32_[1234n].o): New targets.
1298 (split_x32_[124]): New targets.
1299 (split_x32_[1234r].stdout): New targets.
1300 * testsuite/split_x32.sh: New file.
1301 * testsuite/split_x32_1.s: Likewise.
1302 * testsuite/split_x32_2.s: Likewise.
1303 * testsuite/split_x32_3.s: Likewise.
1304 * testsuite/split_x32_4.s: Likewise.
1305 * testsuite/split_x32_n.s: Likewise.
1306 * configure: Regenerated.
1307 * testsuite/Makefile.in: Likewise.
1309 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1312 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1315 2015-01-02 Alan Modra <amodra@gmail.com>
1317 * version.cc (print_version): Just print current year.
1318 * dwp.cc (print_version): Likewise.
1320 2015-01-01 Alan Modra <amodra@gmail.com>
1322 Update year range in copyright notice of all files.
1324 2014-12-25 Alan Modra <amodra@gmail.com>
1326 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1328 (Target_arm::merge_object_attributes, ): Likewise.
1330 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1332 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1333 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1334 AEABI_VFP_args_vfp to check that.
1335 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1336 value and replace hardcoded values by enum values.
1338 2014-12-22 Cary Coutant <ccoutant@google.com>
1340 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1342 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1345 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1346 to "return i * i * 3;".
1348 2014-12-16 Cary Coutant <ccoutant@google.com>
1350 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1351 (Mapfile::print_output_data): Use current_data_size() to avoid
1352 assert for sections requiring postprocessing; if address is not valid,
1354 (Mapfile::print_output_section): Use current_data_size(); print note
1355 that addresses and sizes are before compression.
1357 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1359 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1360 Cast current_group_size to unsigned long when reporting error.
1362 2014-12-10 Jing Yu <jingyu@google.com>
1364 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1365 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1366 Update error message.
1367 (Target_aarch64::do_relax): Use absolute value of option
1368 stub_group_size. Replace local variable with class member
1371 2014-12-04 Alan Modra <amodra@gmail.com>
1373 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1374 addend of PLTREL24 reloc when not generating a plt stub. Make
1375 max_branch_offset an "Address".
1376 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1377 (Target_powerpc::Relocate::relocate): Likewise.
1379 2014-12-04 Alan Modra <amodra@gmail.com>
1382 * symtab.cc (Symbol::set_undefined): Remove assertion.
1383 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1384 on symbols defined in discarded sections, instead return false.
1385 Rearrange params, update all callers.
1386 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1387 branches to syms in discarded sections.
1388 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1389 undefined and flag as discarded.
1390 (Target_powerpc::Relocate::relocate): Localize variable.
1392 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1395 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1396 * testsuite/Makefile.in: Regenerated.
1398 2014-12-03 Alan Modra <amodra@gmail.com>
1401 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1402 when adding dynamic relocations against section symbols.
1404 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1406 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1407 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1408 * options.h (General_options): New -z option (global).
1410 2014-12-01 Cary Coutant <ccoutant@google.com>
1413 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1415 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1416 given but some inputs require executable stack.
1418 2014-11-26 Cary Coutant <ccoutant@google.com>
1420 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1421 .debug_str_offsets; strip .debug_gnu_pubnames and
1422 .debug_gnu_pubtypes.
1423 (lines_only_debug_sections): Strip all four new sections.
1425 2014-11-26 Jing Yu <jingyu@google.com>
1427 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1428 register to be x0 when to relax TLSDESC_LD64_LO12.
1430 2014-11-26 Alan Modra <amodra@gmail.com>
1432 * powerpc.cc (struct Stub_table_owner): New.
1433 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1434 unsigned int vector. Update all references.
1435 (powerpc_relobj::set_stub_table): Take an unsigned int param
1436 rather than a Stub_table. Update callers.
1437 (Powerpc_relobj::clear_stub_table): New function.
1438 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1439 stub_group_size_ vars.
1440 (Target_powerpc::new_stub_table): Delete.
1441 (max_branch_delta): New function, extracted from..
1442 (Target_powerpc::Relocate::relocate): ..here..
1443 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1444 status on whether stub created successfully.
1445 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1447 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1448 reduce on relax failure.
1449 (Target_powerpc::group_sections): Add "no_size_errors" param.
1450 Use stub_group_size_. Set up group info in a temp vector,
1451 before building Stub_table vector. Account for input sections
1452 possibly already converted to relaxed sections.
1453 (Stub_table::init): Delete. Merge into..
1454 (Stub_table::Stub_table): ..here.
1455 (Stub_table::can_reach_stub): New function.
1456 (Stub_table::add_plt_call_entry): Add "from" parameter and
1457 return true iff stub could be reached.
1458 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1460 (Stub_table::clear_stubs): Add "all" param.
1462 2014-11-26 Alan Modra <amodra@gmail.com>
1464 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1465 (Target_powerpc::group_sections): Use it.
1467 2014-11-25 Cary Coutant <ccoutant@google.com>
1469 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1470 (Binary_to_elf::write_symbol): Add st_size parameter.
1471 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1473 2014-11-25 Cary Coutant <ccoutant@google.com>
1476 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1477 (Sized_relobj_file::do_layout): Handle deferred sections properly
1478 during GC pass 1. Don't add reloc sections to deferred list twice.
1479 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1480 (Sized_relobj_file::is_deferred_layout_): New data member.
1482 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1485 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1486 Check PC-relative offset overflow in PLT entry.
1488 2014-11-21 Alan Modra <amodra@gmail.com>
1490 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1491 for undefined weaks.
1493 2014-11-20 Alan Modra <amodra@gmail.com>
1495 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1496 from --stub-group-size parameter divided by 1024.
1497 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1498 template parameter. Update all uses.
1499 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1500 has_stub_value. Set for long branches. Don't report overflow for
1501 branch to undefined weak symbols. Print info message on
1502 overflowing branch to stub.
1504 2014-11-20 Alan Modra <amodra@gmail.com>
1506 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1508 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1510 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1511 entry for R_X86_64_GOTPLT64.
1512 (Target_x86_64<size>::Relocate::relocate): Update comments for
1515 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1517 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1518 * plugin.h: add lock definition
1520 2014-10-29 Han Shen <shenhan@google.com>
1521 Jing Yu <jingyu@google.com>
1523 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1524 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1525 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1527 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1529 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1530 (Target_aarch64::tls_ld_to_le): New method.
1531 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1533 (Output_data_plt_aarch64::irelative_rel_): New data member.
1534 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1535 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1536 (Output_data_plt_aarch64::add_relocation): New method.
1537 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1538 offset. Add got_irelative size to got size.
1539 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1540 type string with the new typename.
1541 (AArch64_relocate_functions::update_adr): Replace parameter x with
1543 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1544 (AArch64_relocate_functions::reloc_common): New method.
1545 (AArch64_relocate_funcsions::rela_general): Extract common part out
1546 into reloc_common method.
1547 (AArch64_relocate_functions::rela_general): Likewise.
1548 (AArch64_relocate_functions::pcrela_general): Likewise.
1549 (AArch64_relocate_functions::adr): New method.
1550 (AArch64_relocate_functions::adrp): Calculate immed before calling
1552 (AArch64_relocate_functions::adrp): Likewise.
1553 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1554 comparing x to 0. Calculate immed from ~x when x < 0.
1555 (Target_aarch64::optimize_tls_reloc): Add new cases for
1556 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1557 TLSLD_MOVW_DTPREL_G0_NC.
1558 (Target_aarch64::possible_function_pointer_reloc): Implement this
1560 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1562 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1563 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1564 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1565 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1566 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1567 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1568 (Target_aarch64::make_plt_entry): Call add_entry with two more
1570 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1571 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1572 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1573 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1574 (Target_aarch64::Relocate::relocate_tls): Add cases for
1575 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1576 TLSLD_MOVW_DTPREL_G0_NC.
1577 * testsuite/icf_safe_so_test.cc: Correct test comment.
1578 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1580 2014-10-22 Alan Modra <amodra@gmail.com>
1582 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1585 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1587 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1589 2014-10-17 Cary Coutant <ccoutant@google.com>
1591 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1592 Add "typename" keyword.
1594 2014-10-15 Han Shen <shenhan@google.com>
1595 Jing Yu <jingyu@google.com>
1597 Patch for gold aarch64 backend to support relaxation.
1598 * aarch64-reloc.def: Change format.
1599 * aarch64.cc (class Reloc_stub): New class.
1600 (class Stub_table): New class.
1601 (class AArch64_relobj): New class.
1602 (class AArch64_input_section): New class.
1603 (class AArch64_output_section): New class.
1604 (Target_aarch64::new_stub_table): New method.
1605 (Target_aarch64::new_aarch64_input_section): New method.
1606 (Target_aarch64::find_aarch64_input_section): New method.
1607 (Target_aarch64::scan_section_for_stubs): New method.
1608 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1609 (Target_aarch64::relocate_stub): New method.
1610 (Target_aarch64::current_target): New method.
1611 (Target_aarch64::do_make_elf_object): New method.
1612 (Target_aarch64::do_may_relax): New method.
1613 (Target_aarch64::do_relax): New method.
1614 (Target_aarch64::group_sections): New method.
1615 (Target_aarch64::scan_reloc_for_stub): New method.
1616 (Target_aarch64::do_make_output_section): New method.
1617 (Target_aarch64::stub_tables_): New data member.
1618 (Target_aarch64::aarch64_input_section_map_): New data member.
1619 (AArch64_relocate_functions::maybe_apply_stub): New method.
1621 2014-09-30 Cary Coutant <ccoutant@google.com>
1624 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1626 2014-09-30 Kito Cheng <kito@0xlab.org>
1629 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1630 hash table before sysv-style hash table.
1632 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1634 * options.h (--pic-executable): Add negative to alias to -no-pie.
1636 2014-09-26 Cary Coutant <ccoutant@google.com>
1639 * object.cc (Sized_relobj_file): Compute value of section symbols
1640 for TLS sections the same as TLS symbols.
1642 2014-09-25 Cary Coutant <ccoutant@google.com>
1645 * resolve.cc (Symbol_table::resolve): Override common placeholder
1646 symbols, but adjust sizes.
1647 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1648 symbols to common lists.
1650 2014-09-24 Alan Modra <amodra@gmail.com>
1652 * po/POTFILES.in: Regenerate.
1654 2014-09-23 Taiju Tsuiki <tzik@google.com>
1655 Cary Coutant <ccoutant@google.com>
1658 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1659 on input_sections_blocker.
1660 * layout.cc (Write_sections_task::locks): Unblock
1661 input_sections_blocker_.
1662 * layout.h (Write_sections_task::Write_sections_task): Add
1663 input_sections_blocker.
1664 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1666 * testsuite/Makefile.in: Regenerate.
1668 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1670 * testsuite/Makefile.am (plugin_test_10): New test.
1671 * testsuite/Makefile.in: Regenerate
1672 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1673 * testsuite/plugin_test_10.sh: New file.
1675 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1677 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1678 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1679 during the replacement phase.
1681 2014-09-17 Han Shen <shenhan@google.com>
1682 Jing Yu <jingyu@google.com>
1684 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1685 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1686 * aarch64.cc (Target_aarch64): Add data members
1687 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1688 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1690 (Target_aarch64::do_reloc_symbol_index): New method.
1691 (Target_aarch64::do_reloc_addend): New method.
1692 (Target_aarch64::add_tlsdesc_info): New method.
1693 (Target_aarch64::do_dynsym_value): New method.
1694 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1695 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1696 (Target_aarch64::make_data_plt): Add new parameters: got,
1697 got_irelative. Pass them to do_make_data_plt.
1698 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1699 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1700 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1701 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1702 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1703 (Target_aarch64::got_tlsdesc_section): New method.
1704 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1705 (Target_aarch64::define_tls_base_symbol): New method.
1706 (Target_aarch64::reserve_tlsdesc_entries): New method.
1707 (Target_aarch64::got_mod_index_entry): New method.
1708 (Target_aarch64::rela_tlsdesc_section): New method.
1709 (Target_aarch64::rela_irelative_section): New method.
1710 (Target_aarch64::Tlsdesc_info): New struct.
1711 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1712 relocations and tlsdesc relocations.
1713 (Target_aarch64::optimize_tls_reloc): Implement method.
1714 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1715 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1717 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1718 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1719 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1720 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1721 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1722 (Output_data_plt_aarch64::rela_irelative): New method.
1723 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1724 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1725 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1726 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1727 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1728 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1729 (Output_data_plt_aarch64_standard): New member variables:
1730 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1731 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1732 New parameter: got, got_irelative.
1733 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1734 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1735 (Output_data_plt_aarch64::do_write): Replace got_address with
1736 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1737 (AArch64_relocate_functions::update_movnz): New method.
1738 (AArch64_relocate_functions): Correct format.
1739 (AArch64_relocate_functions::movnz): New method.
1740 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1741 before the switch. Add new cases to switch.
1742 Check ie_to_le relaxation on tlsie relocations. Add code handling
1743 tlsgd tlsdesc cases.
1744 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1745 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1746 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1747 Call reloc_name_in_error_message to print unsupported reloc.
1748 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1750 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1751 relocs. Fill in some more dynamic tags.
1752 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1753 Skip call tls_get_addr when tlsgd is relaxed.
1754 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1755 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1756 tlsdesc->ie relaxation.
1758 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1760 * mips.cc (Target_mips_nacl): New class.
1761 (Target_selector_mips_nacl): New class.
1762 (target_selector_mips32): Rename from target_selector_mips32be and use
1763 Target_selector_mips_nacl instead of Target_selector_mips.
1764 (target_selector_mips32el): Rename from target_selector_mips32 and use
1765 Target_selector_mips_nacl instead of Target_selector_mips.
1766 (target_selector_mips64): Rename from target_selector_mips64be and use
1767 Target_selector_mips_nacl instead of Target_selector_mips.
1768 (target_selector_mips64el): Rename from target_selector_mips64 and use
1769 Target_selector_mips_nacl instead of Target_selector_mips.
1770 (Target_mips::mips_info): Add const attribute.
1772 2014-09-02 Cary Coutant <ccoutant@google.com>
1774 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1775 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1776 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1777 (Sized_incr_dynobj::do_section_name): Likewise.
1778 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1779 (Sized_incr_dynobj::do_section_name): Likewise.
1780 * object.h (Object::section_name): Likewise.
1781 (Object::do_section_name): Likewise.
1782 (Sized_relobj_file::do_section_name): Likewise.
1783 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1784 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1786 2014-09-02 Cary Coutant <ccoutant@google.com>
1789 * ehframe.cc (Fde::write): Add output_offset parameter.
1790 (Cie::write): Likewise.
1791 (Eh_frame::set_final_data_size): Account for offset within output
1793 (Eh_frame::do_sized_write): Likewise.
1794 * ehframe.h (Fde::write): Add output_offset parameter.
1795 (Cie::write): Likewise.
1796 * output.cc (Output_section::Input_section_sort_entry): Remove
1797 section_has_name_; add output_section_name parameter. Use
1798 output section name for non-input sections.
1799 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1800 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1801 (Output_section::Input_section_sort_compare): Remove logic for
1802 sections without names.
1803 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1804 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1806 (Output_section::Input_section_sort_section_name_compare): Likewise.
1808 2014-08-29 Han Shen <shenhan@google.com>
1809 Jing Yu <jingyu@google.com>
1811 * aarch64-reloc-property.cc
1812 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1813 reference reloc property in the table.
1814 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1816 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1817 2 new overloaded methods.
1818 (Output_data_got_aarch64::do_write): Add code to write out
1820 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1822 (Output_data_got_aarch64::static_relocs): New vector to
1824 (Target_aarch64::TCB_SIZE): New const static memeber.
1825 (Target_aarch64::tcb_size): New method.
1826 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1827 (Target_aarch64::Relocate::relocate_tls): New method.
1828 (Target_aarch64::Scan::local): Add code handling new reloc types.
1829 (Target_aarch64::Scan::global): Add code handling new reloc types.
1831 2014-08-13 Sriraman Tallam <tmsriram@google.com>
1833 * options.h (-no-pie): Add option.
1835 2014-08-08 Jing Yu <jingyu@google.com>
1836 Han Shen <shenhan@google.com>
1838 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1839 (DEFFILES): add aarch64-reloc.def.
1840 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1841 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1842 * Makefile.in: Regenerate.
1843 * aarch64-reloc-property.cc: New file.
1844 * aarch64-reloc-property.h: New file.
1845 * aarch64-reloc.def: New file.
1846 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1847 with tab to make the format consistent.
1848 (Output_data_got_aarch64::symbol_table_): New method.
1849 (Target_aarch64::do_plt_address_for_global): New method.
1850 (Target_aarch64::do_plt_address_for_local): New method.
1851 (Target_aarch64::do_select_as_default_target): New method.
1852 (Target_aarch64::do_make_data_plt): New method.
1853 (Target_aarch64::make_data_plt): New method.
1854 (Output_data_plt_aarch64::has_irelative_section): New method.
1855 (Output_data_plt_aarch64::address_for_global): New method.
1856 (Output_data_plt_aarch64::address_for_local): New method.
1857 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1858 (Output_data_plt_aarch64::add_entry): Implement contents.
1859 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1860 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1861 the got_pov entry to plt0.
1862 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1864 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1865 (AArch64_howto): New struct.
1866 (aarch64_howto[]): New static const array.
1867 (AArch64_relocate_functions): New class.
1868 (Target_aarch64::Scan::get_reference_flags): Remove method.
1869 (Target_aarch64::Scan::local): Implement to support a few relocations.
1870 (Target_aarch64::Scan::global): Implement to support a few relocations.
1871 (Target_aarch64::make_plt_section): Implement contents.
1872 (Target_aarch64::make_plt_entry): Implement contents.
1873 (Target_aarch64::do_finalize_sections): Implement contents.
1874 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1875 (Target_aarch64::relocate_section): Implement contents.
1877 2014-08-06 Alan Modra <amodra@gmail.com>
1879 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1881 2014-08-06 Alan Modra <amodra@gmail.com>
1884 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1886 2014-07-21 Sriraman Tallam <tmsriram@google.com>
1888 * object.cc (Relobj::is_section_name_included): Add
1889 ".rodata.nptl_version" to not garbage collect this section.
1891 2014-07-08 Cary Coutant <ccoutant@google.com>
1893 * expression.cc (struct Expression::Expression_eval_info): Add
1894 new fields type_pointer, vis_pointer, and nonvis_pointer.
1895 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1896 nonvis_pointer parameters. Adjust all calls.
1897 (Symbol_expression::value): Update type, visibility, and nonvis bits
1899 * script.cc (Symbol_assignment::sized_finalize): Update type,
1900 visibility, and remaining st_other bits for new symbol.
1901 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1902 vis_pointer, and nonvis_pointer parameters.
1903 * symtab.h (Symbol::set_type): New method.
1905 * testsuite/Makefile.am (defsym_test): New test.
1906 * testsuite/Makefile.in: Regenerate.
1907 * testsuite/defsym_test.c: New file.
1908 * testsuite/defsym_test.sh: New file.
1910 2014-07-08 Cary Coutant <ccoutant@google.com>
1913 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1914 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1915 (Sized_dynobj::base_read_symbols): ...new method.
1916 * object.h (Sized_relobj_file::base_read_symbols): New method.
1917 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1918 (Sized_relobj_file::base_read_symbols): ...new method.
1919 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1920 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1921 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1923 2014-07-04 Alan Modra <amodra@gmail.com>
1925 * po/POTFILES.in: Regenerate.
1927 2014-07-02 Jing Yu <jingyu@google.com>
1929 * aarch64.cc: New file
1930 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1931 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1932 * Makefile.in: Regenerate.
1933 * configure.tgt: Add entries for aarch64*.
1934 * configure.ac: Likewise.
1935 * configure: Likewise.
1937 2014-06-27 Alan Modra <amodra@gmail.com>
1939 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1941 2014-06-24 Cary Coutant <ccoutant@google.com>
1943 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1945 (Dwo_file::sized_read_unit_index): Likewise.
1947 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1949 * mips.cc: New file.
1950 * Makefile.am (TARGETSOURCES): Add mips.cc
1951 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1952 * configure.tgt: Add entries for mips*.
1953 * configure.ac: Likewise.
1954 * Makefile.in: Regenerate.
1955 * configure: Likewise.
1957 2014-06-09 Cary Coutant <ccoutant@google.com>
1959 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1960 unit_length is within section bounds.
1962 2014-06-09 Cary Coutant <ccoutant@google.com>
1965 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1968 2014-06-07 Alan Modra <amodra@gmail.com>
1970 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1972 2014-06-06 Cary Coutant <ccoutant@google.com>
1974 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1975 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1976 (Dwarf_pubnames_table::read_header): Likewise.
1977 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1978 .debug_gnu_pubtypes.
1980 2014-06-05 Joel Brobecker <brobecker@adacore.com>
1982 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1983 * Makefile.in, configure: Regenerate.
1985 2014-06-03 Alan Modra <amodra@gmail.com>
1987 * powerpc.cc (addis_12_2): Define.
1988 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1990 2014-06-03 Alan Modra <amodra@gmail.com>
1992 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1995 2014-06-02 Alan Modra <amodra@gmail.com>
1997 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1998 Only ignore relocs on ELFv1.
1999 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2001 2014-05-30 Cary Coutant <ccoutant@google.com>
2003 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2004 * testsuite/Makefile.in: Regenerate.
2005 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2007 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2010 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2011 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2013 2014-05-15 Alan Modra <amodra@gmail.com>
2015 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2016 Compare FDE contents with DW_CFA_nop rather than 0.
2018 2014-05-13 Sriraman Tallam <tmsriram@google.com>
2020 * symtab.h (may_need_copy_reloc): Remove check for position independent
2022 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2023 position independence before pc absolute may_need_copy_reloc call.
2024 Add check for executable output befor pc relative may_need_copy_reloc
2030 * powerpc.cc: Add check for no position independence before
2031 may_need_copy_reloc calls.
2032 * testsuite/pie_copyrelocs_test.cc: New file.
2033 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2034 * Makefile.am (pie_copyrelocs_test): New test.
2035 * Makefile.in: Regenerate.
2037 2014-05-08 Martin Liška <mliska@suse.cz>
2039 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2041 2014-05-06 Cary Coutant <ccoutant@google.com>
2044 * i386.cc (Output_data_got_plt_i386): New class.
2045 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2046 parameter. Change all callers.
2047 (Output_data_plt_i386::layout_): Remove.
2048 (Output_data_plt_i386::got_plt_): Change type.
2049 (Target_i386::got_plt_): Change type. Change all references.
2050 (Target_i386::got_section): Create instance of new class.
2051 (Output_data_got_plt_i386::do_write): New function.
2052 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2053 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2054 parameter. Change all callers.
2055 (Output_data_plt_x86_64::layout_): Remove.
2056 (Output_data_plt_x86_64::got_plt_): Change type.
2057 (Target_x86_64::got_plt_): Change type. Change all references.
2058 (Target_x86_64::got_section): Create instance of new class.
2059 (Output_data_got_plt_x86_64::do_write): New function.
2060 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2061 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2064 2014-05-05 Cary Coutant <ccoutant@google.com>
2066 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2067 if we have pubnames/pubtypes.
2069 2014-05-02 Cary Coutant <ccoutant@google.com>
2071 * defstd.cc (in_segment): Define __ehdr_start here...
2072 * layout.cc (Layout::finalize): ...Instead of here. Set the
2073 output segment when known.
2074 * resolve.cc (Symbol::override_base_with_special): Remember
2075 the original binding.
2076 * symtab.cc (Symbol::set_output_segment): New function.
2077 (Symbol::set_undefined): New function.
2078 * symtab.h (Symbol::is_weak_undefined): Check original undef
2080 (Symbol::is_strong_undefined): New function.
2081 (Symbol::set_output_segment): New function.
2082 (Symbol::set_undefined): New function.
2083 * target-reloc.h (is_strong_undefined): Remove.
2084 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2085 Check for hidden undefs.
2086 (relocate_section): Call Symbol::is_strong_undefined.
2088 * testsuite/Makefile.am (ehdr_start_test_1)
2089 (ehdr_start_test_2, ehdr_start_test_3)
2090 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2091 * testsuite/Makefile.in: Regenerate.
2092 * testsuite/ehdr_start_def.cc: New source file.
2093 * testsuite/ehdr_start_test.cc: New source file.
2094 * testsuite/ehdr_start_test.t: New linker script.
2095 * testsuite/ehdr_start_test_4.sh: New shell script.
2097 2014-04-23 Cary Coutant <ccoutant@google.com>
2100 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2102 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2104 * layout.cc (Layout::include_section): Allow a target to decide
2105 whether to include a section.
2106 * target.h (Target::should_include_section): New function.
2107 (Target::do_should_include_section): New function.
2109 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2111 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2113 (Copy_relocs::emit): ... here.
2114 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2115 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2116 (Copy_reloc_entry::entries_): Change from private to protected.
2118 2014-04-02 Sriraman Tallam <tmsriram@google.com>
2120 * icf.cc (get_section_contents): Replace copies of reloc
2121 vectors with const references.
2123 2014-04-02 Cary Coutant <ccoutant@google.com>
2125 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2126 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2127 * configure: Regenerate.
2128 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2129 -fno-use-linker-plugin.
2130 (LINK1, CXXLINK1): Add it to the link command.
2131 * testsuite/Makefile.in: Regenerate.
2133 2014-03-12 Alan Modra <amodra@gmail.com>
2135 * Makefile.in: Regenerate.
2137 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2139 * symtab.h (Symbol::set_nonvis): New function.
2141 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2143 * symtab.cc (Sized_symbol<32>::init_output_data):
2144 Instantiate the template.
2145 (Sized_symbol<64>::init_output_data): Likewise.
2147 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2149 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2150 adjust dynamic symbol value.
2151 * target.h (Target::adjust_dyn_symbol): New function.
2152 (Target::do_adjust_dyn_symbol): New function.
2154 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2156 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2157 Get the value of DYNAMIC_CUSTOM dynamic entry.
2158 * output.h (Output_data_dynamic::add_custom): New function.
2159 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2161 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2162 * target.h (Target::dynamic_tag_custom_value): New function.
2163 (Target::do_dynamic_tag_custom_value): New function.
2165 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2167 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2169 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2170 (Target::do_has_custom_set_dynsym_indexes): New function.
2171 (Target::set_dynsym_indexes): New function.
2172 (Target::do_set_dynsym_indexes): New function.
2174 2014-03-07 Alan Modra <amodra@gmail.com>
2176 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2177 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2178 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2179 (Powerpc_relocate_functions::has_overflow_bitfield,
2180 overflowed): Use the above.
2181 (Target_powerpc::Relocate::relocate): Correct overflow checking
2182 for a number of relocations. Modify overflow test for 16-bit
2183 fields in instructions to signed/unsigned according to whether
2184 the field takes a signed or unsigned value.
2186 2014-03-05 Alan Modra <amodra@gmail.com>
2188 Update copyright years.
2190 2014-03-05 Alan Modra <amodra@gmail.com>
2192 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2193 R_PPC64_ADDR64_LOCAL.
2194 (Target_powerpc::Relocate::relocate): Likewise.
2196 2014-03-03 Alan Modra <amodra@gmail.com>
2198 * dwp.cc (print_version): Update copyright year to current.
2200 2014-02-10 Alan Modra <amodra@gmail.com>
2202 * po/gold.pot: Regenerate.
2204 2014-02-06 Cary Coutant <ccoutant@google.com>
2206 Fix problem where -u is ignored when a weak undef is seen.
2208 * archive.cc (Library_base::should_include_member): Reorder
2209 code to check for -u option if a weak undef has already been seen.
2210 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2211 * testsuite/Makefile.in: Regenerate.
2212 * testsuite/weak_undef_file3.cc: New file.
2213 * testsuite/weak_undef_file4.cc: New file.
2214 * testsuite/weak_undef_test_2.cc: New file.
2216 2014-02-05 Cary Coutant <ccoutant@google.com>
2218 Fix issues with gold undefined symbol diagnostics.
2221 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2223 * target-reloc.h (is_strong_undefined): New function.
2224 (relocate_section): Move undef vtable symbol check from here.
2225 Check for is_strong_undefined.
2227 2014-02-05 Cary Coutant <ccoutant@google.com>
2229 Fix problems with the --dynamic-list option.
2232 * options.cc (General_options::parse_dynamic_list):
2233 Set have_dynamic_list_.
2234 (General_options::General_options): Initialize have_dynamic_list_.
2235 (General_options::finalize): Turn off -Bsymbolic and
2236 -Bsymbolic-functions if --dynamic-list provided.
2237 * options.h (General_options::have_dynamic_list): New function.
2238 (General_options::have_dynamic_list_): New data member.
2239 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2243 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2244 in --dynamic-list, mark it.
2246 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2247 (dynamic_list_2): New test case.
2248 * testsuite/Makefile.in: Regenerate.
2249 * testsuite/dynamic_list_2.cc: New file.
2250 * testsuite/dynamic_list_2.t: New file.
2251 * testsuite/dynamic_list_lib1.cc: New file.
2252 * testsuite/dynamic_list_lib2.cc: New file.
2253 * testsuite/gc_dynamic_list_test.c: New file.
2254 * testsuite/gc_dynamic_list_test.sh: New file.
2255 * testsuite/gc_dynamic_list_test.t: New file.
2257 2014-01-28 Cary Coutant <ccoutant@google.com>
2259 Add .gdb_index version 7 support.
2261 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2262 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2264 (Dwarf_ranges_table::read_ranges_table): Likewise.
2265 (Dwarf_pubnames_table::read_section): Check for GNU-style
2266 sections, and for compressed debug sections.
2267 (Dwarf_pubnames_table::read_header): Compute end address of table.
2268 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2269 for end of list by offset, not by offset == 0.
2270 (Dwarf_info_reader::do_read_string_table): Check for compressed
2272 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2273 Initialize new data members.
2274 (Dwarf_pubnames_table::next_name): return flag_byte.
2275 (Dwarf_pubnames_table::end_of_table_): New data member.
2276 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2277 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2278 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2279 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2280 read skeleton type unit DIEs.
2281 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2282 (Gdb_index::do_write): Write flag_byte.
2283 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2284 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2285 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2286 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2288 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2290 * version.cc (print_version): Update copyright year to 2014.
2292 2013-12-19 Dimitry Andric <dimitry@andric.com>
2294 * stringpool.cc (Stringpool_template::reserve): Add
2295 HAVE_UNORDERED_MAP case.
2296 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2298 2013-12-18 Cary Coutant <ccoutant@google.com>
2300 * configure.ac: Check for <unordered_set> and <unordered_map>.
2301 * config.in: Regenerate.
2302 * configure: Regenerate.
2303 * system.h: Use <unordered_set> and <unordered_map> if available.
2305 2013-12-10 Roland McGrath <mcgrathr@google.com>
2307 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2308 with $(INSTALL_PROGRAM_ENV).
2309 * Makefile.in: Regenerate.
2311 2013-11-22 Cary Coutant <ccoutant@google.com>
2313 * configure.ac: Add check for which library is needed for
2315 * configure: Regenerate.
2317 2013-11-22 Cary Coutant <ccoutant@google.com>
2319 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2321 * testsuite/Makefile.in: Regenerate.
2323 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2325 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2326 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2327 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2328 (Target_x86_64<size>::Scan::local): Likewise.
2329 (Target_x86_64<size>::Scan::global): Likewise.
2330 (Target_x86_64<size>::Relocate::relocate): Likewise.
2331 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2333 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2336 * testsuite/Makefile.am (check_PROGRAMS): Add
2337 exception_x86_64_bnd_test.
2338 (exception_x86_64_bnd_test_SOURCES): New macro.
2339 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2340 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2341 (exception_x86_64_bnd_test_LDADD): Likewise.
2342 (exception_x86_64_bnd_1.o): New rule.
2343 (exception_x86_64_bnd_2.o): Likewise.
2344 * testsuite/Makefile.in: Regenerated.
2346 2013-11-15 Alan Modra <amodra@gmail.com>
2348 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2350 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2351 Only call ppc64_local_entry_offset for 64-bit. Restrict
2352 symval_for_branch lookup to ELFv1.
2353 (Stub_table::add_plt_call_entry): Use unsigned int off.
2354 (Output_data_glink::Address, invalid_address): New.
2355 (Output_data_glink::add_eh_frame): Move out of line. Add
2357 (Output_data_glink::add_global_entry, find_global_entry,
2358 global_entry_address): New functions.
2359 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2360 ge_size): New variables.
2361 (Output_data_glink::set_final_data_size): Add global entry
2363 (Output_data_glink::do_write): Write global entry stubs.
2364 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2365 parameter. Return true for ELFv2. Adjust callers.
2366 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2367 ELFv1. Similarly for ifunc and dynamic relocation processing
2368 specific to ELFv1. Recognize that symbols are defined on
2369 their plt entries for ELFv2.
2370 (Target_powerpc::symval_for_branch): Assert if called for
2372 (Target_powerpc::Relocate::relocate): Use global entry plt
2373 stub for symbol value if such exists on ELFv2.
2374 (Target_powerpc::Relocate::relocate): Don't call
2375 symval_for_branch when ELFv2. Do adjust for local entry
2377 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2379 (Target_powerpc::do_plt_address_for_global): Similarly.
2381 2013-11-14 Cary Coutant <ccoutant@google.com>
2383 Revert patch -- this did not fix the problem, and there is
2386 2013-11-14 Cary Coutant <ccoutant@google.com>
2389 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2390 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2391 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2392 updating fde_offsets_.
2393 (Eh_frame_hdr::lock_): New data member.
2395 2013-11-14 Cary Coutant <ccoutant@google.com>
2397 * dwp.cc (Dwo_file_entry): New type.
2398 (File_list): Use Dwo_file_entry.
2399 (Dwo_file::verify): New function.
2400 (Dwo_file::verify_dwo_list): New function.
2401 (Dwo_file::sized_verify_dwo_list): New function.
2402 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2404 (Dwp_options): New enum type.
2405 (dwp_options): Add --verify-only.
2408 * dwp.h (gold_info): Add declaration.
2410 2013-11-14 Cary Coutant <ccoutant@google.com>
2413 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2414 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2415 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2416 updating fde_offsets_.
2417 (Eh_frame_hdr::lock_): New data member.
2419 2013-11-06 Cary Coutant <ccoutant@google.com>
2422 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2423 before reloc sections.
2425 2013-11-04 Alan Modra <amodra@gmail.com>
2427 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2428 (Symbol::needs_dynamic_reloc): Test new flag.
2429 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2430 (Target_powerpc::Scan::get_reference_flags): Add target param.
2431 Return FUNC_DESC_ABI for 64-bit ELFv1.
2432 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2434 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2435 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2437 2013-10-31 Cary Coutant <ccoutant@google.com>
2439 Restore support for dwp v2 DWARF package file format.
2441 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2442 tu_length parameter. Adjust all callers.
2443 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2444 * dwp.cc: Include dwarf.h.
2445 (Section_bounds): New struct type.
2446 (Unit_set): New struct type.
2447 (Dwo_file::Dwo_file): Initialize new data member.
2448 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2449 Combine and rename to...
2450 (Dwo_file::read_unit_index): ...this.
2451 (Dwo_file::sized_read_compunit_index)
2452 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2453 (Dwo_file::sized_read_unit_index): ...this.
2454 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2455 parameters; add section_id parameter.
2456 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2457 (Dwo_file::add_unit_set): ...this.
2458 (Dwo_file::shndx_map_): Remove.
2459 (Dwo_file::sect_offsets_): New data member.
2460 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2461 (Dwp_output_file::add_section): Rename to...
2462 (Dwp_output_file::add_contribution): ...this.
2463 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2464 (Dwp_output_file::add_tu_set): Likewise.
2465 (Dwp_output_file::Contribution): New type.
2466 (Dwp_output_file::Section::contributions): New data member.
2467 (Dwp_output_file::Cu_or_tu_set): Remove.
2468 (Dwp_output_file::Section::Section): New ctor.
2469 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2470 (Dwp_output_file::Dwp_index::Section_table): New type.
2471 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2472 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2474 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2475 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2476 (Dwp_output_file::Dwp_index::section_table): New member function.
2477 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2478 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2479 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2480 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2481 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2482 (Dwp_output_file::Dwp_index::section_table_): New data member.
2483 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2484 (Dwp_output_file::add_output_section): New member function.
2485 (Dwp_output_file::write_new_section): New member function.
2486 (Dwp_output_file::write_contributions): New member function.
2487 (Dwp_output_file::section_id_map_): New data member.
2488 (class Dwo_id_info_reader): Remove.
2489 (class Unit_reader): New class.
2490 (get_dwarf_section_name): New function.
2491 (Dwo_file::read_executable): Adjust initializations of class data.
2492 (Dwo_file::read): Add support for v2 package file format.
2493 (Dwo_file::read_unit_index): Likewise.
2494 (Dwo_file::sized_read_unit_index): Likewise.
2495 (Dwo_file::copy_section): Likewise.
2496 (Dwo_file::add_unit_set): Likewise.
2497 (Dwp_output_file::add_output_section): Likewise.
2498 (Dwp_output_file::add_contribution): Likewise.
2499 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2501 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2503 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2505 (Dwp_output_file::initialize): Remove unused function.
2506 (Dwp_output_file::finalize): Add support for v2 package file format.
2507 (Dwp_output_file::write_index): Likewise.
2508 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2511 2013-10-31 Cary Coutant <ccoutant@google.com>
2513 * configure.ac: Fix check for -fmerge-constants.
2514 * configure.ac: Regenerate.
2516 2013-10-30 Roland McGrath <mcgrathr@google.com>
2518 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2519 Correct 9-byte nop sequence to match what the assembler generates.
2521 2013-10-30 Alan Modra <amodra@gmail.com>
2523 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2524 ppc64_local_entry_offset, ppc64_local_entry_offset,
2525 do_read_symbols): New functions.
2526 (Powerpc_relobj::e_flags_, st_other_): New vars.
2527 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2528 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2529 (Powerpc_relobj::e_flags_): New var.
2530 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2531 and adjust for ELFv2.
2532 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2533 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2534 (Powerpc_dynobj::do_find_special_sections): Likewise.
2535 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2536 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2537 to ELFv2 local entry.
2538 (Target_powerpc::do_relax): No thread safe barriers needed for
2540 (Output_data_plt_powerpc::initial_plt_entry_size_,
2541 plt_entry_size): Delete. Replace all uses with
2542 first_plt_entry_offset() and plt_entry_size().
2543 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2544 reserved_size parm. Update callers.
2545 (Output_data_plt_powerpc::entry_count): Update.
2546 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2547 and use Target_powerpc::first_plt_entry_offset().
2548 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2549 rename to plt_entry_size.
2550 (Output_data_plt_powerpc::add_ifunc_entry,
2551 add_local_ifunc_entry): Adjust reloc for ELFv2.
2552 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2553 (glink_eh_frame_fde_64v2): New.
2554 (Stub_table::plt_call_size): Support ELFv2 sizing.
2555 (Output_data_glink::add_eh_frame): Use the new FDE.
2556 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2557 (Stub_table::do_write): Write ELFv2 stubs and glink.
2558 (Target_powerpc::Relocate::relocate): Replaces nop after call
2559 with ld 2,24(1) and adjust local offset destination for ELFv2.
2561 2013-10-30 Alan Modra <amodra@gmail.com>
2563 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2564 (Target_powerpc::Scan::global, local): Likewise.
2565 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2566 on all ppc64 @h and @ha relocs.
2568 2013-10-14 Alan Modra <amodra@gmail.com>
2570 * output.h (Output_data_got::add_constant): Tidy.
2571 (Output_data_got::add_constant_pair): New function.
2572 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2573 methods used so as to first call reserve_ent().
2575 2013-10-11 Roland McGrath <mcgrathr@google.com>
2577 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2578 add_got_entry and add_got_entry_pair.
2580 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2581 (HAVE_PUBNAMES): Likewise.
2582 * configure: Regenerate.
2584 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2585 * testsuite/Makefile.in: Regenerate.
2587 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2588 Remove const from declaration.
2589 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2590 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2591 * output.h (Output_file_header): Remove const from member target_
2592 and corresponding constructor argument.
2593 * output.cc (Output_file_header::Output_file_header): Update prototype.
2594 (Output_file_header::do_sized_write): Use this->target_ in place
2595 of parameters()->target().
2597 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2599 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2600 * configure: Regenerate.
2601 * Makefile.in: Regenerate.
2602 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2603 * testsuite/merge_string_literals_2.c: Likewise.
2604 * testsuite/Makefile.am
2605 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2606 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2607 literal -fmerge-constants.
2608 * testsuite/Makefile.in: Regenerate.
2610 * i386.cc (Target_i386): Remove unused member dynbss_.
2611 * arm.cc (Target_arm): Likewise.
2612 * powerpc.cc (Target_powerpc): Likewise.
2613 * sparc.cc (Target_sparc): Likewise.
2614 * tilegx.cc (Target_tilegx): Likewise.
2615 * x86_64.cc (Target_x86_64): Likewise.
2616 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2617 type_signature_, type_offset_.
2618 * plugin.h (Plugin_hook): Remove unused member layout_.
2619 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2621 (Read_member): Remove unused members input_objects_, symtab_,
2623 (Check_library): Remove unused member symtab_.
2624 * archive.h (Lib_group): Remove unused member lib_.
2625 * archive.cc (Lib_group::Lib_group): Update initializer.
2626 * incremental.h (Incremental_binary): Remove unused member target_.
2627 (Incremental_script_entry): Removed unused member script_.
2628 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2629 * icf.h (Icf): Remove unused member num_tracked_relocs.
2631 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2632 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2634 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2636 * archive.h: Use struct rather than class for forward declaration
2637 of Read_symbols_data.
2639 2013-10-07 Cary Coutant <ccoutant@google.com>
2642 * testsuite/Makefile.am (icf_test): Fix dependencies.
2643 (icf_safe_test): Likewise.
2644 (icf_safe_so_test): Likewise.
2645 (large_symbol_alignment): Add empty _LDADD rule.
2646 * testsuite/Makefile.in: Regenerate.
2648 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2651 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2652 relocation for R_X86_64_32 on x32.
2654 2013-08-27 Roland McGrath <mcgrathr@google.com>
2656 * output.cc (Output_segment::set_section_addresses): Take new
2657 Target* argument. If target->isolate_execinstr() and the segment
2658 is executable and starts at a target->abi_pagesize() boundary,
2659 pad its end out to a target->abi_pagesize() boundary with code fill.
2660 * output.h (Output_segment::set_section_addresses): Update decl.
2661 * layout.h (Layout::check_output_data_for_reset_values): Take new
2662 argument RELAX_OUTPUTS.
2663 (Layout): New member relax_output_list_.
2664 (Layout::add_relax_output): New method.
2665 * layout.cc (Layout::Layout): Update constructor.
2666 (Layout::reset_relax_output): New method.
2667 (Layout::clean_up_after_relaxation): Call it.
2668 (Layout::prepare_for_relaxation): Update caller.
2669 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2670 Call reset_relax_output before re-processing segments for
2671 isolate_execinstr case.
2672 (Layout::write_data): Handle relax_output_list_.
2673 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2674 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2676 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2679 * object.h: Fix typos.
2681 2013-08-16 Roland McGrath <mcgrathr@google.com>
2683 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2684 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2686 2013-08-07 Cary Coutant <ccoutant@google.com>
2688 Revert support for v2 DWP files:
2690 2013-03-01 Cary Coutant <ccoutant@google.com>
2692 Add dwp support for v2 DWARF package file format.
2693 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2694 tu_length parameter. Adjust all callers.
2695 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2696 * dwp.cc: Include dwarf.h.
2697 (Section_bounds): New struct type.
2698 (Unit_set): New struct type.
2699 (Dwo_file::Dwo_file): Initialize new data member.
2700 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2701 Combine and rename to...
2702 (Dwo_file::read_unit_index): ...this.
2703 (Dwo_file::sized_read_compunit_index)
2704 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2705 (Dwo_file::sized_read_unit_index): ...this.
2706 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2707 parameters; add section_id parameter.
2708 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2709 (Dwo_file::add_unit_set): ...this.
2710 (Dwo_file::shndx_map_): Remove.
2711 (Dwo_file::sect_offsets_): New data member.
2712 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2713 (Dwp_output_file::add_section): Rename to...
2714 (Dwp_output_file::add_contribution): ...this.
2715 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2716 (Dwp_output_file::add_tu_set): Likewise.
2717 (Dwp_output_file::Contribution): New type.
2718 (Dwp_output_file::Section::contributions): New data member.
2719 (Dwp_output_file::Cu_or_tu_set): Remove.
2720 (Dwp_output_file::Section::Section): New ctor.
2721 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2722 (Dwp_output_file::Dwp_index::Section_table): New type.
2723 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2724 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2726 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2727 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2728 (Dwp_output_file::Dwp_index::section_table): New member function.
2729 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2730 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2731 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2732 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2733 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2734 (Dwp_output_file::Dwp_index::section_table_): New data member.
2735 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2736 (Dwp_output_file::add_output_section): New member function.
2737 (Dwp_output_file::write_new_section): New member function.
2738 (Dwp_output_file::write_contributions): New member function.
2739 (Dwp_output_file::section_id_map_): New data member.
2740 (class Dwo_id_info_reader): Remove.
2741 (class Unit_reader): New class.
2742 (get_dwarf_section_name): New function.
2743 (Dwo_file::read_executable): Adjust initializations of class data.
2744 (Dwo_file::read): Add support for v2 package file format.
2745 (Dwo_file::read_unit_index): Likewise.
2746 (Dwo_file::sized_read_unit_index): Likewise.
2747 (Dwo_file::copy_section): Likewise.
2748 (Dwo_file::add_unit_set): Likewise.
2749 (Dwp_output_file::add_output_section): Likewise.
2750 (Dwp_output_file::add_contribution): Likewise.
2751 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2753 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2755 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2757 (Dwp_output_file::initialize): Remove unused function.
2758 (Dwp_output_file::finalize): Add support for v2 package file format.
2759 (Dwp_output_file::write_index): Likewise.
2760 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2763 2013-07-31 Cary Coutant <ccoutant@google.com>
2765 * object.cc (Sized_relobj::do_output_section_address): New function.
2766 (Sized_relobj): Instantiate explicitly.
2767 * object.h (Object::output_section_address): New function.
2768 (Object::do_output_section_address): New function.
2769 (Sized_relobj::do_output_section_address): New function.
2770 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2772 2013-07-30 Cary Coutant <ccoutant@google.com>
2773 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2775 * parameters.cc (Parameters::entry): Return target-specific entry
2777 * target.h (Target::entry_symbol_name): New function.
2778 (Target_info::entry_symbol_name): New data member.
2780 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2781 * i386.cc (Target_i386::i386_info): Likewise.
2782 (Target_i386_nacl::i386_nacl_info): Likewise.
2783 * sparc.cc (Target_sparc::sparc_info): Likewise.
2784 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2785 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2786 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2787 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2789 2013-07-22 Sterling Augustine <saugustine@google.com>
2791 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2792 Convert parameter shndx to local variable. Add parameters symtab
2793 and symtab_size. Scan over section names. Find relocation
2794 section corresponding to current section. Create and initialize
2795 reloc_mapper_ and reloc_type_.
2796 (Dwarf_pubnames_table::read_header): Add assertion. Change
2797 unit_length to off_t. Initialize member unit_length_. Fill in field
2799 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2800 Initialize new fields unit_length_ and cu_offset_.
2801 (Dwarf_pubnames_table::read_section): Update prototype.
2802 (Dwarf_pubnames_table::cu_offset): New member function.
2803 (Dwarf_pubnames_table::subsection_size): Likewise.
2804 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2806 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2807 member functions public.
2808 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2809 Update comment. Rework logic. Move repeated parts to...
2810 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2811 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2812 pubtypes_table_, and stmt_list_offset.
2813 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2814 Gdb_index::find_pubtype_offset,
2815 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2816 (Gdb_index::pubnames_read): Update prototype and rework logic.
2817 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2819 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2820 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2821 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2822 Gdb_index::map_pubtable_to_dies):
2824 (Gdb_index::pubnames_read): Update declaration.
2825 (Gdb_index::Pubname_offset_map): New type.
2826 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2827 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2828 Gdb_index::stmt_list_offset): Declare.
2829 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2830 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2831 Gdb_index::pubtypes_offset_): Remove.
2833 2013-07-19 Roland McGrath <mcgrathr@google.com>
2835 * options.h (General_options): Add -Trodata-segment option.
2836 * parameters.cc (Parameters::check_rodata_segment): New function.
2837 (Parameters::set_target_once): Call it.
2838 * parameters.h (Parameters): Declare it (private member function).
2839 * layout.cc (load_seg_unusable_for_headers): New function, broken
2840 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2841 then validate rodata segment rather than text segment.
2842 (relaxation_loop_body): Call that.
2843 (is_text_segment): New function. Don't admit a non-executable
2844 segment if TARGET->isolate_execinstr().
2845 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2847 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
2850 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2851 * nacl.h (Sniff_file::View::View): Request aligned view.
2853 2013-07-11 Cary Coutant <ccoutant@google.com>
2855 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2856 correct BRLT entry size.
2858 2013-07-03 Alan Modra <amodra@gmail.com>
2860 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2863 2013-07-01 Cary Coutant <ccoutant@google.com>
2865 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2867 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2868 (Dwarf_ranges_table::lookup_reloc): New function.
2869 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2871 (Dwarf_ranges_table::lookup_reloc): New function.
2872 (Dwarf_ranges_table::reloc_type_): New data member.
2874 2013-06-27 Jing Yu <jingyu@google.com>
2877 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2879 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2880 (Target_powerpc::do_relax): Call the above.
2882 2013-06-27 Cary Coutant <ccoutant@google.com>
2884 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2885 on garbage collected .opd section.
2887 2013-06-27 Alan Modra <amodra@gmail.com>
2889 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2891 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2892 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2894 2013-06-14 Cary Coutant <ccoutant@google.com>
2896 * resolve.cc (Symbol::override_base): Don't override st_type
2897 from plugin placeholder symbols.
2898 (Symbol_table::resolve): Likewise.
2899 (Symbol_table::should_override): Don't complain about TLS mismatch
2900 if the TO symbol is a plugin placeholder.
2901 * testsuite/Makefile.am (plugin_test_tls): New test.
2902 * testsuite/Makefile.in: Regenerate.
2903 * testsuite/plugin_test_tls.sh: New test script.
2904 * testsuite/two_file_test_2_tls.cc: New test source.
2905 * testsuite/two_file_test_tls.cc: New test source.
2907 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2909 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2910 the maximum segment alignment is larger than the page size.
2911 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2912 correctly aligns the symbols with large alignemnt.
2913 * testsuite/Makefile.in: Regenerate.
2914 * testsuite/large_symbol_alignment.cc: New file.
2916 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2917 Sriraman Tallam <tmsriram@google.com>
2919 * options.h (sort_section): New option.
2920 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2921 Rename from Input_section_sort_section_name_special_ordering_compare.
2922 (Input_section_sort_section_name_compare): New struct.
2923 * output.cc (Output_section::Input_section_sort_section_name_compare::
2924 operator()): New function.
2925 (Output_section::sort_attached_input_sections): Use new sort function
2926 for .text if --sort-section=name is specified.
2927 * layout.cc (Layout::make_output_section):
2928 Add sorting by name when --sort-section=name is specified.
2929 * testsuite/Makefile.am (text_section_grouping): Test option
2930 --sort-section=name.
2931 * testsuite/Makefile.in: Regenerate.
2932 * testsuite/section_sorting_name.cc: New file.
2933 * testsuite/section_sorting_name.sh: New file.
2935 2013-05-21 Cary Coutant <ccoutant@google.com>
2937 * symtab.h (Symbol::is_cxx_vtable): New function.
2938 * target-reloc.h (relocate_section): Check for vtable symbol.
2939 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2940 * testsuite/Makefile.in: Regenerate.
2941 * testsuite/missing_key_func.cc: New test source.
2942 * testsuite/missing_key_func.sh: New test script.
2944 2013-05-21 Cary Coutant <ccoutant@google.com>
2946 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2947 type of enclosing symbol.
2948 (Relocate_info::location): Check symbol type when describing symbol.
2949 * object.h (Symbol_location_info): Remove unused line_number;
2950 add enclosing_symbol_type.
2951 * testsuite/debug_msg.sh: Adjust expected output.
2953 2013-05-13 Cary Coutant <ccoutant@google.com>
2955 * configure.ac: Export DEFAULT_TARGET.
2956 * configure: Regenerate.
2957 * Makefile.in: Regenerate.
2958 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2959 * testsuite/Makefile.in: Regenerate.
2960 * testsuite/debug_msg.sh: Delete duplicate tests.
2961 Don't check undef_int error message match for powerpc where the
2962 source file and line number aren't available.
2964 2013-05-10 Roland McGrath <mcgrathr@google.com>
2966 * options.h (General_options): Add --rosegment-gap option.
2967 * options.cc (finalize): --rosegment-gap implies --rosegment.
2968 * layout.cc (set_segment_offsets): Let user option override
2969 target->rosegment_gap().
2971 2013-05-10 Roland McGrath <mcgrathr@google.com>
2973 * options.h (General_options): Remove leading space from help
2974 messages for -nostdlib and --rosegment.
2976 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2979 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2981 2013-05-03 Alan Modra <amodra@gmail.com>
2983 * merge.cc (Output_merge_string::do_add_input_section): Correct
2984 scan for number of strings. Rename vars to avoid shadowing.
2985 Include missing terminator in input_size_.
2987 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2989 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2990 Restore empty string handling.
2992 2013-05-01 Cary Coutant <ccoutant@google.com>
2994 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2995 uninitialized warning.
2997 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2999 * output.cc (Output_section::add_merge_input_section): Allow
3000 to merge sections if the alignment is more than character size.
3001 * merge.h (Output_merge_string::Output_merge_string): Remove
3003 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3004 only not-null strings. Check the alignment of strings.
3006 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3007 alignment as the argument.
3008 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3009 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3010 Align non-zero length strings according to the addralign_.
3011 (Stringpool_template<Stringpool_char>::set_string_offsets):
3012 Updating offsets according to the given alignment.
3013 * testsuite/Makefile.am (text_section_grouping): Test if string
3014 literals are getting merged.
3015 * testsuite/Makefile.in: Regenerate.
3016 * testsuite/merge_string_literals_1.c: New file.
3017 * testsuite/merge_string_literals_2.c: Ditto.
3018 * testsuite/merge_string_literals.sh: Ditto.
3020 2013-04-26 Ian Lance Taylor <iant@google.com>
3022 * target-reloc.h (relocate_section): If the reloc offset is out of
3023 range, pass VIEW as NULL to relocate.relocate.
3024 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3025 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3026 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3027 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3028 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3029 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3031 2013-04-26 Geoff Pike <gpike@chromium.org>
3033 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3034 * layout.cc (Hash_task): New class.
3035 (Layout::queue_build_id_tasks): New function.
3036 (Layout::write_build_id): Handle single-thread portion of build ID
3037 computation. (In some cases, all of it is single-threaded.) Replace
3038 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3039 functionality in fewer lines of code.
3040 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3041 * options.h (General_options): make "--build-id" default to tree
3042 rather than sha1. Add two new options related to --build-id=tree:
3043 --build-id-chunk-size-for-treehash and
3044 --build-id-min-file-size-for-treehash.
3045 * Makefile.am: add testing of --build-id=tree and related new options
3046 (these tests will be invoked by "make check").
3047 * Makefile.in: Regenerate.
3049 2013-04-25 Alan Modra <amodra@gmail.com>
3051 * configure.tgt: Add powerpcle and powerpc64le.
3053 2013-04-22 Alan Modra <amodra@gmail.com>
3056 * layout.cc (Layout::segment_precedes): Allow more than one
3057 segment with the same type and flags.
3059 2013-04-15 Cary Coutant <ccoutant@google.com>
3061 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3062 allocate space in file for BSS sections.
3064 2013-04-15 Cary Coutant <ccoutant@google.com>
3066 * script-sections.cc (Orphan_output_section): Reset address
3067 to zero after each orphaned section for relocatable links.
3069 2013-04-15 Cary Coutant <ccoutant@google.com>
3071 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3072 section starting address for relocatable link.
3073 * testsuite/Makefile.am (script_test_11): New test.
3074 * testsuite/Makefile.in: Regenerate.
3075 * testsuite/script_test_11.c: New source file.
3076 * testsuite/script_test_11.t: New linker script.
3078 2013-04-13 Alan Modra <amodra@gmail.com>
3080 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3081 owner when sections are not adjacent and exceed group size.
3082 (Target_powerpc::group_sections): Handle corner case.
3083 (Target_powerpc::Branch_info::make_stub): Handle case where
3084 stub table doesn't exist due to branches in non-exec sections.
3085 (Target_powerpc::Relocate::relocate): Likewise.
3087 2013-04-11 Alan Modra <amodra@gmail.com>
3090 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3091 .branch_lt to match bfd ld. Adjust comments throughout file.
3093 2013-04-04 Ian Lance Taylor <iant@google.com>
3096 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3097 sections before checking whether they are included in the link.
3099 2013-03-29 Sriraman Tallam <tmsriram@google.com>
3101 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3102 object before calling the plugin claim_file handler. Pass the elf
3103 object of the archive to the plugin. Delete the elf object if the
3104 plugin claims the file.
3106 2013-03-21 Alan Modra <amodra@gmail.com>
3108 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3109 segment when omagic.
3111 2013-03-21 Alan Modra <amodra@gmail.com>
3113 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3115 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3116 uninitialized" warning.
3118 2013-03-20 Alan Modra <amodra@gmail.com>
3120 * symtab.h (Symbol::clear_version): New function.
3121 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3122 is_needed by weak references. Clear version for symbols defined
3123 in as-needed objects that are not needed.
3125 2013-03-15 Alan Modra <amodra@gmail.com>
3127 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3128 static and public. Add report_err param. Return false for data refs.
3129 (Target_powerpc::rela_dyn_section): New overloaded function.
3130 (Target_powerpc::plt_, iplt_): Elucidate.
3131 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3132 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3133 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3134 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3135 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3136 push_branch and make_plt_entry for ifunc syms when
3137 reloc_needs_plt_for_ifunc.
3138 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3139 for ifunc unless reloc_needs_plt_for_ifunc.
3141 2013-03-15 Alan Modra <amodra@gmail.com>
3143 * gc.h (gc_process_relocs): Don't look through function descriptors.
3144 * icf.cc (get_section_contents): Do so here instead.
3146 2013-03-13 Alan Modra <amodra@gmail.com>
3148 * powerpc.cc (is_branch_reloc): Forward declare.
3149 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3150 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3151 false for 64-bit, true for 32-bit non-branch relocs.
3152 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3153 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3155 (icf_safe_test): Generate linker map file as well as nm output.
3156 (icf_safe_so_test): Likewise.
3157 * testsuite/Makefile.in: Regenerate.
3158 * testsuite/icf_test.sh: Parse linker map file to determine
3160 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3161 * testsuite/icf_safe_so_test.sh: Likewise.
3162 (X86_32_or_ARM_specific_safe_fold): Merge into..
3163 (arch_specific_safe_fold): ..this.
3164 (X86_64_specific_safe_fold): Delete unused function.
3166 2013-03-12 Alan Modra <amodra@gmail.com>
3168 * gc.h (gc_process_relocs): Look through function descriptors
3169 to determine shndx, symvalue and addend used by ICF. Tidy
3170 variable duplication.
3172 2013-03-11 Alan Modra <amodra@gmail.com>
3174 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3175 * layout.cc (Layout_task_runner::run): ..to here.
3176 * symtab.h (struct Symbol_location): Extract from..
3177 (class Symbol_table): ..here.
3178 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3179 * target.h (class Target): Add function_location and
3180 do_function_location functions.
3181 (class Sized_target): Add do_function_location.
3182 * object.h (class Sized_relobj_file): Move find_shdr..
3183 (class Object): ..to here.
3184 * object.cc: Likewise. Update to suit. Instantiate.
3185 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3186 * powerpc.cc (class Powerpc_dynobj): New.
3187 (Target_powerpc::do_function_location): New function.
3188 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3189 (Powerpc_dynobj::do_read_symbols): New function.
3190 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3192 2013-03-08 Ian Lance Taylor <iant@google.com>
3194 * options.cc (General_options::string_to_object_format): Accept
3197 2013-03-08 Alan Modra <amodra@gmail.com>
3199 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3200 pointer to Post_fde.
3201 (struct Post_fde): Move definition to here..
3202 * ehframe.cc (struct Post_fde): ..from here.
3203 (Cie::write): Don't alloc Post_fde.
3204 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3206 2013-03-07 Alan Modra <amodra@gmail.com>
3208 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3209 relocation referencing .LC0.
3210 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3212 2013-03-07 Alan Modra <amodra@gmail.com>
3214 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3215 always_inline. Add assembly for powerpc to avoid GOT.
3217 2013-03-07 Alan Modra <amodra@gmail.com>
3219 * testsuite/script_test_10.sh: Don't test .bss section
3222 2013-03-06 Alan Modra <amodra@gmail.com>
3224 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3225 (Target_powerpc::symval_for_branch): Add symtab param. Update
3226 all callers. Handle folded sections.
3227 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3229 (Global_symbol_visitor_opd::operator()): Likewise.
3231 2013-03-04 Alan Modra <amodra@gmail.com>
3233 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3234 * testsuite/Makefile.in: Regenerate.
3236 2013-03-01 Cary Coutant <ccoutant@google.com>
3238 Add dwp support for v2 DWARF package file format.
3239 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3240 tu_length parameter. Adjust all callers.
3241 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3242 * dwp.cc: Include dwarf.h.
3243 (Section_bounds): New struct type.
3244 (Unit_set): New struct type.
3245 (Dwo_file::Dwo_file): Initialize new data member.
3246 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3247 Combine and rename to...
3248 (Dwo_file::read_unit_index): ...this.
3249 (Dwo_file::sized_read_compunit_index)
3250 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3251 (Dwo_file::sized_read_unit_index): ...this.
3252 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3253 parameters; add section_id parameter.
3254 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3255 (Dwo_file::add_unit_set): ...this.
3256 (Dwo_file::shndx_map_): Remove.
3257 (Dwo_file::sect_offsets_): New data member.
3258 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3259 (Dwp_output_file::add_section): Rename to...
3260 (Dwp_output_file::add_contribution): ...this.
3261 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3262 (Dwp_output_file::add_tu_set): Likewise.
3263 (Dwp_output_file::Contribution): New type.
3264 (Dwp_output_file::Section::contributions): New data member.
3265 (Dwp_output_file::Cu_or_tu_set): Remove.
3266 (Dwp_output_file::Section::Section): New ctor.
3267 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3268 (Dwp_output_file::Dwp_index::Section_table): New type.
3269 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3270 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3272 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3273 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3274 (Dwp_output_file::Dwp_index::section_table): New member function.
3275 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3276 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3277 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3278 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3279 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3280 (Dwp_output_file::Dwp_index::section_table_): New data member.
3281 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3282 (Dwp_output_file::add_output_section): New member function.
3283 (Dwp_output_file::write_new_section): New member function.
3284 (Dwp_output_file::write_contributions): New member function.
3285 (Dwp_output_file::section_id_map_): New data member.
3286 (class Dwo_id_info_reader): Remove.
3287 (class Unit_reader): New class.
3288 (get_dwarf_section_name): New function.
3289 (Dwo_file::read_executable): Adjust initializations of class data.
3290 (Dwo_file::read): Add support for v2 package file format.
3291 (Dwo_file::read_unit_index): Likewise.
3292 (Dwo_file::sized_read_unit_index): Likewise.
3293 (Dwo_file::copy_section): Likewise.
3294 (Dwo_file::add_unit_set): Likewise.
3295 (Dwp_output_file::add_output_section): Likewise.
3296 (Dwp_output_file::add_contribution): Likewise.
3297 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3299 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3301 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3303 (Dwp_output_file::initialize): Remove unused function.
3304 (Dwp_output_file::finalize): Add support for v2 package file format.
3305 (Dwp_output_file::write_index): Likewise.
3306 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3309 2013-03-01 Cary Coutant <ccoutant@google.com>
3311 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3312 function into class definition in header file.
3313 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3314 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3316 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3318 2013-02-28 Alan Modra <amodra@gmail.com>
3320 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3321 * target.cc (Target::do_plt_fde_location): New function.
3322 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3323 accessor function, and constructor param.
3324 (struct Post_fde, Post_fdes): Declare.
3325 (Cie::write): Add post_fdes param.
3326 * ehframe.cc (Fde::write): Use plt_fde_location.
3327 (struct Post_fde): Define.
3328 (Cie::write): Stash FDEs added post merge mapping.
3329 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3330 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3331 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3333 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3334 (Target_powerpc::has_glink): New function.
3335 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3336 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3337 glink_eh_frame_fde_32, default_fde): New data.
3338 (Stub_table::eh_frame_added_): New var.
3339 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3341 (Stub_table::add_eh_frame): New function.
3342 (Output_data_glink::add_eh_frame): New function.
3343 (Target_powerpc::make_glink_section): Call add_eh_frame.
3345 2013-02-15 Ian Lance Taylor <iant@google.com>
3347 * options.h (DEFINE_uint64_alias): Define.
3348 (class General_options): Add -Ttext-segment as an alias for
3351 2013-02-15 Alan Modra <amodra@gmail.com>
3353 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3354 (Stub_table::do_write): ..here, two places.
3355 (Stub_table::plt_call_size): Use it here too.
3357 2013-02-11 Ian Lance Taylor <iant@google.com>
3359 * descriptors.cc (Descriptors::close_all): New function.
3360 * descriptors.h (class Descriptors): Declare close_all.
3361 (close_all_descriptors): New inline function.
3362 * plugin.cc: Include "descriptors.h".
3363 (Plugin_manager::cleanup): Call close_all_descriptors.
3365 2013-02-06 Alan Modra <amodra@gmail.com>
3367 * README: Update coding style link.
3369 2013-01-28 Cary Coutant <ccoutant@google.com>
3371 * dwp.cc (File_list): New typedef.
3372 (Dwo_name_info_reader): New class.
3373 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3374 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3375 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3376 (Dwo_file::read_executable): New function.
3377 (Dwo_file::read): Move common setup code to ...
3378 (Dwo_file::make_object): ... here.
3379 (dwp_options): Add --exec/-e.
3383 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3385 * layout.cc (Layout::layout): Check for option text_reorder.
3386 (Layout::make_output_section): Ditto.
3387 * options.h (text_reorder): New option.
3388 * output.cc (Input_section_sort_compare): Remove special ordering
3391 Input_section_sort_section_name_special_ordering_compare::
3392 operator()): New function.
3393 (Output_section::sort_attached_input_sections): Use new sort function
3395 * output.h (Input_section_sort_section_name_special_ordering_compare):
3397 * testsuite/Makefile.am (text_section_grouping): Test option
3399 * testsuite/Makefile.in: Regenerate.
3400 * testsuite/text_section_grouping.sh: Check order of functions without
3401 default text reordering.
3403 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3405 * options.h (General_options): Change default to true for new_dtags.
3407 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3409 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3410 when enable_new_dtags is false. Only add DT_RUNPATH when
3411 enable_new_dtags is true.
3413 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3415 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3416 used in declaration and definition consistent.
3417 (Target_powerpc::symval_for_branch): Ditto.
3419 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3421 * testsuite/plugin_final_layout.cc: Fix comment.
3423 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3425 * layout.cc (Layout::layout): Do not do default sorting for
3426 text sections when section ordering is specified.
3427 (make_output_section): Ditto.
3428 * testsuite/plugin_final_layout.cc: Name the function sections
3429 to catch reordering issues.
3431 2013-01-15 Alan Modra <amodra@gmail.com>
3433 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3436 2013-01-15 Alan Modra <amodra@gmail.com>
3438 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3439 * testsuite/Makefile.in: Regenerate.
3441 2013-01-14 Alan Modra <amodra@gmail.com>
3443 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3444 * testsuite/Makefile.in: Regenerate.
3446 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3449 Fix mingw gold build with plugins enabled
3450 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3451 * configure.ac: Export DLOPEN_LIBS and add headers check.
3452 * plugin.cc: Handle non-dlfcn case.
3453 * Makefile.in: Regenerate.
3454 * config.in: Regenerate.
3455 * configure: Regenerate.
3456 * testsuite/Makefile.in: Regenerate.
3458 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3460 * output.h (sort_attached_input_sections): Change to be public.
3461 * script-sections.cc
3462 (Output_section_definition::set_section_addresses): Sort
3463 attached input sections according to section order before linker
3464 script assigns section addresses.
3465 (Orphan_output_section::set_section_addresses): Sort
3466 attached input sections according to section order before linker
3467 script assigns section addresses.
3468 * Makefile.am (final_layout.sh): Use a simple linker script to
3469 check if section ordering still works.
3470 * Makefile.in: Regenerate.
3472 2013-01-09 Ben Cheng <bccheng@google.com>
3474 * arm.cc (Target_arm::attributes_accept_div): New function.
3475 (Target_arm::attributes_forbid_div): New function.
3476 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3477 attribute using the same new functions as what bfd/elf32_arm.c
3480 2013-01-07 Cary Coutant <ccoutant@google.com>
3483 * output.cc (Output_section::add_input_section): For incremental
3484 updates, don't track input sections that are allocated from patch
3487 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3488 Ian Lance Taylor <iant@google.com>
3491 * configure.ac (--enable-ld): Removed.
3492 (install_as_default): Set to yes only for --enable-gold=default
3494 * configure: Regenerated.
3496 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3498 * options.h (General_options): Add -fuse-ld= for GCC linker
3499 option compatibility.
3501 2013-01-04 Cary Coutant <ccoutant@google.com>
3503 * configure.ac: Fix typo restoring CXXFLAGS.
3504 * configure: Regenerate.
3506 2013-01-04 Cary Coutant <ccoutant@google.com>
3508 * testsuite/Makefile.am (CXXLINK_S): New macro.
3509 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3510 * testsuite/Makefile.in: Regenerate.
3512 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3514 * version.cc (print_version): Update copyright year to 2013.
3516 2012-12-20 Ian Lance Taylor <iant@google.com>
3518 * layout.cc (Layout::special_ordering_of_input_section): New
3520 (Layout::layout): If input section requires special ordering, must
3521 sort input sections.
3522 (Layout::make_output_section): May sort .text input sections.
3523 (Layout::is_section_name_prefix_grouped): Remove.
3524 * layout.h (class Layout): Declare
3525 special_ordering_of_input_section. Don't declare
3526 is_section_name_prefix_grouped.
3527 * output.cc (Output_section::add_input_section): Revert last
3529 (Output_section::Input_section_sort::match_file_name): Don't crash
3530 if called on output section data.
3531 (Output_section::Input_section_sort_compare): Sort based on
3533 (Output_section::Input_section_sort_section_order_index_compare):
3535 (Output_section::sort_attached_input_sections): Likewise.
3537 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3539 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3540 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3541 * output.cc (Output_section::add_input_section): Check if section
3542 name contains special prefix. Keep input sections to sort such
3544 (Output_section::Input_section_sort_section_order_index_compare
3545 ::operator()): Group sections according to prefixes.
3546 (Output_section::sort_attached_input_sections): Add condition to
3547 Input_section_entry constructor call.
3548 * testsuite/Makefile.am (text_section_grouping): New test.
3549 * testsuite/Makefile.in: Regenerate.
3550 * testsuite/text_section_grouping.cc: New file.
3551 * testsuite/text_section_grouping.sh: New file.
3553 2012-12-17 Nick Clifton <nickc@redhat.com>
3555 * Makefile.am: Add copyright notice.
3558 * configure.ac: Likewise.
3559 * ftruncate.c: Likewise.
3560 * Makefile.in: Regenerate.
3562 2012-12-14 Cary Coutant <ccoutant@google.com>
3564 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3565 --no-as-needed flag.
3566 (exception_separate_shared_12_test): Likewise.
3567 (incremental_copy_test): Likewise.
3568 * testsuite/Makefile.in: Regenerate.
3570 2012-12-14 Cary Coutant <ccoutant@google.com>
3572 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3573 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3575 2012-12-12 Alan Modra <amodra@gmail.com>
3577 * powerpc.cc (class Track_tls): New.
3578 (class Relocate, class Scan): Inherit Track_tls.
3579 (Target_powerpc::Scan::local, global): Track tls optimization
3580 and avoid creating plt entry for __tls_get_addr if all uses
3582 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3584 2012-12-12 Alan Modra <amodra@gmail.com>
3586 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3587 Replace no_toc_optimize with toc_optimize.
3588 * output.h (Output_section::input_sections): Provide non-const variant.
3589 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3590 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3592 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3593 (class Sort_toc_sections): New.
3594 (Target_powerpc::do_finalize_sections): Sort toc sections.
3595 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3597 2012-12-10 Roland McGrath <mcgrathr@google.com>
3599 * testsuite/binary_unittest.cc (read_all): New function.
3600 (Sized_binary_test): Use it instead of ::read.
3601 * fileread.cc (do_read): Don't assume pread always reads the whole
3602 amount in a single call.
3604 2012-12-10 Alan Modra <amodra@gmail.com>
3606 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3607 Set EM_PPC64 or EM_PPC here.
3608 (Target_selector_powerpc::do_recognize): Delete.
3610 2012-12-10 Alan Modra <amodra@gmail.com>
3612 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3614 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3616 2012-12-07 Roland McGrath <mcgrathr@google.com>
3618 * testsuite/binary_unittest.cc (Sized_binary_test):
3619 Use open_descriptor rather than ::open.
3621 2012-12-07 Alan Modra <amodra@gmail.com>
3623 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3624 typedef and invalid_address constant.
3625 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3626 instantiate constants.
3628 2012-12-06 Roland McGrath <mcgrathr@google.com>
3630 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3631 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3632 * aclocal.m4: Regenerate.
3633 * configure: Regenerate.
3634 * Makefile.in: Regenerate.
3635 * testsuite/Makefile.in: Regenerate.
3637 2012-12-07 Alan Modra <amodra@gmail.com>
3639 * options.h (General_options): Add no_toc_optimize.
3640 * powerpc.cc (ok_lo_toc_insn): New function.
3641 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3643 2012-12-06 Alan Modra <amodra@gmail.com>
3645 * options.h (General_options): Add plt_align, plt_static_chain,
3646 plt_thread_safe. Update stub_group_size help text.
3647 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3648 for new plt_thread_safe_ var.
3649 (use_plt_offset): Correct comments.
3650 (Target_powerpc::do_relax): Look for thread creation symbols to
3651 determine default plt_thread_safe value. Clear plt call stubs
3652 as well as branch stubs each iteration.
3653 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3655 (l, hi, ha, write_insn): Move earlier.
3656 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3657 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3659 (Stub_table::update_size): Adjust.
3660 (Stub_table::prev_size, set_prev_size): Delete.
3661 (Stub_table::stub_align): Let --plt-align affect result.
3662 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3663 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3664 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3665 (Stub_table::do_write): Support more stub variants.
3667 2012-12-04 Alan Modra <amodra@gmail.com>
3669 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3670 (Target_powerpc::do_define_standard_symbols): New function.
3672 2012-12-03 Alan Modra <amodra@gmail.com>
3674 * output.h: Formatting, whitespace.
3676 2012-12-03 Alan Modra <amodra@gmail.com>
3678 * layout.h (Layout::get_executable_sections): Declare.
3679 * layout.cc (Layout::get_executable_sections): New function.
3680 * arm.cc (Target_arm::group_sections): Use it.
3681 (Arm_output_section::group_sections): Delete now redundant test.
3682 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3683 param to handle relative relocs.
3684 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3685 (Output_data_reloc::add_absolute): Adjust.
3686 (Output_data_reloc::add_relative): New function.
3687 (Output_data::reset_data_size): New function.
3688 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3689 (Output_section::set_addralign): New function.
3690 (Output_section::checkpoint_set_addralign): New function.
3691 (Output_section::clear_section_offsets_need_adjustment): New function.
3692 (Output_section::input_sections): Make public.
3693 * powerpc.cc (class Output_data_brlt_powerpc): New.
3694 (class Stub_table, class Stub_control): New.
3695 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3696 stub_table_, set_stub_table, stub_table): New vectors and accessor
3698 (Target_powerpc::do_may_relax, do_relax, push_branch,
3699 new_stub_table, stub_tables, brlt_section, group_sections,
3700 add_branch_lookup_table, find_branch_lookup_table,
3701 write_branch_lookup_table, make_brlt_section): New functions.
3702 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3703 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3704 branch_info_): New vars.
3705 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3706 make call stubs here.
3707 (Output_data_glink): Remove all call stub handling from this class.
3708 (Target_powerpc::Scan::local, global): Save interesting branch
3709 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3710 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3711 functions on final link.
3712 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3713 Handle long branch destinations too.
3714 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3715 do_plt_address_for_local): Adjust lookup of plt call stubs.
3717 2012-11-30 Alan Modra <amodra@gmail.com>
3719 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3720 relocs against protected symbols when building 32-bit shared libs.
3722 2012-11-30 Alan Modra <amodra@gmail.com>
3724 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3725 param. Call got_section() to make .got. Update all callers
3726 and their callers and so on.
3728 2012-11-30 Alan Modra <amodra@gmail.com>
3730 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3731 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3732 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3733 value if it already exists.
3735 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3738 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3740 2012-11-14 Roland McGrath <mcgrathr@google.com>
3742 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3743 than bfc instruction for data sandboxing.
3745 2012-11-08 Alan Modra <amodra@gmail.com>
3747 * po/POTFILES.in: Regenerate.
3749 2012-11-05 Alan Modra <amodra@gmail.com>
3751 * configure.ac: Apply 2012-09-10 change to config.in here.
3752 * configure: Regenerate.
3754 2012-11-05 Alan Modra <amodra@gmail.com>
3756 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3757 (struct Opd_ent): Use "Address" rather than "Offset".
3758 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3759 (Target_powerpc::got_section): Make public.
3760 (Target_powerpc::scan_relocs): Move code setting symbols..
3761 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3762 Create _SDA_BASE_ only when referenced.
3764 2012-11-02 Roland McGrath <mcgrathr@google.com>
3766 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3769 2012-11-01 Roland McGrath <mcgrathr@google.com>
3771 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3772 for offset_in_output_section parameter.
3773 (Sized_target::relocate_special_relocatable): Likewise.
3774 * arm.cc (Target_arm::relocate_relocs): Likewise.
3775 (Target_arm::relocate_special_relocatable): Likewise.
3776 * i386.cc (Target_i386::relocate_relocs): Likewise.
3777 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3778 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3779 * target-reloc.h (relocate_relocs): Likewise.
3780 * testsuite/testfile.cc (Target_test): Likewise.
3781 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3782 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3784 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3785 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3787 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3788 parameter, which is unused in the [!F_SETFD] case.
3790 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3791 SYMNDX to off_t before comparing it to this->data_size().
3792 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3793 * incremental.cc (Output_section_incremental_inputs::do_write):
3794 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3796 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3798 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3800 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3801 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3804 2012-10-29 Cary Coutant <ccoutant@google.com>
3806 * dwp.cc (usage): Add file and exit status parameters;
3807 add --help and --version options.
3808 (print_version): New function.
3809 (main): Add --help and --version options.
3811 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3813 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3814 final_layout_sequence.txt.
3815 * testsuite/Makefile.in: Regenerated.
3817 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3819 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3820 COMPILE generated by automake.
3822 (CXXCOMPILE1): Likewise.
3823 (CXXLINK1): Likewise.
3824 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3826 (CXXCOMPILE): Likewise.
3827 (CXXLINK): Likewise.
3828 * testsuite/Makefile.in: Regenerated.
3830 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3832 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3833 on bad fwrite return.
3835 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3837 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3840 2012-10-23 Cary Coutant <ccoutant@google.com>
3842 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3843 * testsuite/Makefile.in: Regenerate.
3844 * testsuite/dwp_test.h: New source file.
3845 * testsuite/dwp_test_1.cc: New source file.
3846 * testsuite/dwp_test_1.s: New source file.
3847 * testsuite/dwp_test_1.sh: New source file.
3848 * testsuite/dwp_test_1b.cc: New source file.
3849 * testsuite/dwp_test_1b.s: New source file.
3850 * testsuite/dwp_test_2.cc: New source file.
3851 * testsuite/dwp_test_2.s: New source file.
3852 * testsuite/dwp_test_2.sh: New source file.
3853 * testsuite/dwp_test_main.cc: New source file.
3854 * testsuite/dwp_test_main.s: New source file.
3856 2012-10-23 Cary Coutant <ccoutant@google.com>
3858 * dwp.h: New header file.
3859 * dwp.cc: New source file.
3860 * gold.h: Move shared declarations to system.h.
3861 * system.h: New header file.
3862 * Makefile.am: Add dwp.
3863 * Makefile.in: Regenerate.
3865 2012-10-23 Cary Coutant <ccoutant@google.com>
3867 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3868 Dwarf_info_reader::read_from_pointer.
3869 (Dwarf_pubnames_table::read_header): Likewise.
3870 (Dwarf_pubnames_table::next_name): Likewise.
3871 (Dwarf_die::read_attributes): Likewise.
3872 (Dwarf_die::skip_attributes): Likewise.
3873 (Dwarf_info_reader::read_from_pointer): New function template.
3874 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3875 (Dwarf_pubnames_table): Likewise.
3876 (Dwarf_info_reader::read_from_pointer): New function template.
3877 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3878 Dwarf_pubnames_table ctor.
3880 2012-10-23 Cary Coutant <ccoutant@google.com>
3882 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3884 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3886 (Dwarf_info_reader::set_abbrev_shndx): New method.
3887 (Dwarf_info_reader::abbrev_shndx_): New data member.
3889 2012-10-23 Cary Coutant <ccoutant@google.com>
3891 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3892 from object, not parameters.
3893 (Dwarf_info_reader::parse): Likewise.
3894 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3895 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3896 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3899 2012-10-23 Cary Coutant <ccoutant@google.com>
3901 * fileread.cc (Input_file::Input_file): New constructor.
3902 * fileread.h (class Input_file): Add new constructor.
3904 2012-10-18 Alan Modra <amodra@gmail.com>
3907 * object.cc (Relobj::is_section_name_included): Also match
3908 .sdata personality section.
3910 2012-10-18 Alan Modra <amodra@gmail.com>
3912 * target-reloc.h (class Default_comdat_behavior): New, package up..
3913 (get_comdat_behaviour): ..this.
3914 (relocate_section): Add Relocate_comdat_behavior template arg,
3915 adjust code to suit.
3916 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3917 (Target_arm::scan_reloc_section): Likewise.
3918 * i386.cc (Target_i386::relocate_section): Likewise.
3919 * sparc.cc (Target_sparc::relocate_section): Likewise.
3920 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3921 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3922 * powerpc.cc (class Relocate_comdat_behavior): New.
3923 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3924 gold::relocate_section with new template arg.
3926 2012-10-18 Alan Modra <amodra@gmail.com>
3928 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3929 dynamic relocs for GOT_TPREL got entries, without symbol if
3931 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3932 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3933 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3935 2012-10-17 Alan Modra <amodra@gmail.com>
3938 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3940 2012-10-16 Sriraman Tallam <tmsriram@google.com>
3942 * layout.cc (Layout::include_section): Keep sections marked
3943 SHF_EXCLUDE when doing relocatable links.
3945 2012-10-16 Alan Modra <amodra@gmail.com>
3947 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3948 (Target_powerpc::do_finalize_sections): Call it.
3949 (Output_data_save_res): New class and supporting functions.
3950 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3951 normal symbols defined in object files.
3953 2012-10-12 Alan Modra <amodra@gmail.com>
3955 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3956 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3957 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3958 section if scan_opd_relocs not yet called.
3959 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3961 2012-10-12 Alan Modra <amodra@gmail.com>
3963 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3964 add_local_ifunc_entry): Revert last change.
3965 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3967 2012-10-05 Alan Modra <amodra@gmail.com>
3969 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3970 do_plt_address_for_global): New functions.
3971 (Output_data_got_powerpc::do_write): Don't segfault when linking
3973 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3974 add_local_ifunc_entry): Return true on adding entry..
3975 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3976 glink->add_entry call. Remove unused symtab param. Adjust calls.
3977 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3978 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3979 set up symbols here.
3980 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3981 syms here. Do so even when no .iplt. Don't segfault when linking
3983 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3984 new variants without reloc param.
3985 (Glink_sym_ent::Glink_sym_ent): Likewise.
3986 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3987 reloc when refs will resolve to plt call stub.
3988 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3989 R_PPC_PLTREL24 to resolve locally.
3990 (Target_powerpc::Scan::global): Correct ifunc handling.
3991 (Target_powerpc::Relocate::relocate): Correct local sym glink
3992 lookup. Don't destroy "value" when we have a plt call stub,
3993 and when checking plt call validity.
3994 (Target_powerpc::do_dynsym_value): Simplify.
3996 2012-10-05 Alan Modra <amodra@gmail.com>
3998 * i386.cc (Output_data_plt_i386::address_for_global,
3999 address_for_local): Add plt offset to returned value. Adjust uses.
4000 * sparc.cc (Output_data_plt_sparc::address_for_global,
4001 address_for_local): Likewise.
4002 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4003 address_for_local): Likewise.
4004 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4005 address_for_local): Likewise.
4006 * target.h (Target::plt_address_for_global, plt_address_for_local):
4008 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4009 (Output_data_got::Got_entry::write): Nor here.
4010 * output.h: Comment fix.
4012 2012-10-02 Jiong Wang <jiwang@tilera.com>
4014 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4015 global_offset_table_ value for larget got.
4016 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4018 2012-09-29 Alan Modra <amodra@gmail.com>
4020 * powerpc.cc (Target_powerpc::iplt_): New output section.
4021 (Target_powerpc::iplt_section, make_iplt_section,
4022 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4023 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4024 Target_powerpc::plt_entry_count): Count iplt entries too.
4025 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4026 reloc section in constructor. New params.
4027 (Target_powerpc::make_plt_section): Create reloc section here instead.
4028 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4030 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4031 (Output_data_glink::add_entry, find_entry): New functions to
4032 deal with local syms.
4033 (Glink_sym_ent): Add support for local syms.
4034 (Output_data_glink::do_write): Handle ifunc plt entries.
4035 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4036 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4037 (Target_powerpc::Relocate::relocate): Likewise.
4038 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4040 2012-09-25 Alan Modra <amodra@gmail.com>
4042 * object.h (Sized_relobj_file::adjust_local_symbol,
4043 do_adjust_local_symbol): New functions.
4044 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4045 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4046 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4047 and irregular opd entry spacing.
4048 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4049 (Global_symbol_visitor_opd): New functor.
4050 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4051 on deleted opd entries.
4053 2012-09-15 Jiong Wang <jiwang@tilera.com>
4055 * tilegx.cc: New file.
4056 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4057 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4058 * configure.tgt: Add entries for tilegx*.
4059 * configure.ac: Likewise.
4060 * Makefile.in: Rebuild.
4061 * configure: Likewise.
4062 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4065 2012-09-13 Alan Modra <amodra@gmail.com>
4067 * target-reloc.h (scan_relocs): Call scan.local for relocs
4068 against symbols in discarded sections. Pass is_discarded
4070 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4071 Add is_discarded param.
4072 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4073 is_discarded to flag opd entry as discarded. Don't emit dyn
4074 relocs on such entries.
4075 (Target_powerpc::Scan::global): Similarly detect and handle
4077 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4078 opd_ent_. Update all uses.
4079 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4080 (Target_powerpc::relocate_section): Zero out discarded opd
4083 2012-09-12 Ian Lance Taylor <iant@google.com>
4086 * output.cc: Rename Output_data_got template parameter from size
4087 to got_size for all functions. Compile all variants of
4089 (Output_data_got::Got_entry::write): Correct use of size for
4090 symbol value. Use local_is_tls rather than casting to
4092 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4093 (class Sized_relobj_file): Add do_local_is_tls.
4094 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4096 2012-09-11 Alan Modra <amodra@gmail.com>
4099 * layout.cc (Layout::set_segment_offsets): When using
4100 common-page-size alignment, ensure we are on a new max-page-size
4102 * output.cc (Output_segment::set_section_addresses): Use
4103 abi_pagesize, not common_pagesize for relro boundary.
4104 (Output_segment::set_offset): Likewise.
4106 2012-09-11 Alan Modra <amodra@gmail.com>
4108 * output.h (Output_data_got::add_global_tls, add_local_tls,
4109 add_local_tls_pair): New functions.
4110 (Output_data_got::add_local_pair_with_rel): Remove second
4111 reloc param. Expand comment.
4112 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4113 use_plt_or_tls_offset_, similarly for constructor param.
4114 (Output_data_got::Got_entry::write): Add got_index param.
4115 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4116 add_local_tls_pair): New functions.
4117 (Output_data_got::Got_entry::write): Handle tls symbols
4118 with use_plt_or_tls_offset_ set specially.
4119 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4120 (Output_data_got::do_write): Replace iterator with index, pass
4121 index to entry write function.
4122 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4123 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4124 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4126 * i386.cc (Target_i386::Scan::local): Likewise.
4127 * sparc.cc (Target_sparc::Scan::local): Likewise.
4128 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4129 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4130 do_tls_offset_for_global): New functions.
4131 (Target_powerpc::Scan::local): Correct TLS relocations and got
4133 (Target_powerpc::Scan::global): Don't emit unnecessary
4134 dynamic relocations on TLS GOT entries.
4136 2012-09-10 Matthias Klose <doko@ubuntu.com>
4138 * config.in: Disable sanity check for kfreebsd.
4140 2012-09-10 Sterling Augustine <saugustine@google.com>
4142 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4143 (Gdb_index::pubtypes_read): New parameter.
4144 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4146 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4149 2012-09-09 Alan Modra <amodra@gmail.com>
4151 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4152 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4153 * gc.h (gc_process_relocs): Call target gc_add_reference.
4154 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4155 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4156 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4158 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4159 to cater for when we don't need code offset. Update use.
4160 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4161 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4162 set_opd_valid): New functions.
4163 (Target_powerpc::do_gc_add_reference): New function.
4164 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4166 (Target_powerpc::do_gc_mark_symbol): New function.
4168 2012-09-06 Cary Coutant <ccoutant@google.com>
4170 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4171 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4172 (Dwarf_die::skip_attributes): Likewise.
4173 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4174 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4176 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4178 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4180 * testsuite/script_test_3.t: Add .got.plt output section
4182 * testsuite/script_test_4.t: Likewise.
4184 2012-09-05 Alan Modra <amodra@gmail.com>
4186 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4187 update all uses and lose "enum" when using type.
4189 2012-09-05 Alan Modra <amodra@gmail.com>
4191 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4192 * configure: Regenerate.
4193 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4194 (plugin_final_layout.stdout): Likewise.
4195 (memory_test): Set page sizes to 0x1000.
4196 * testsuite/Makefile.in: Regenerate.
4197 * testsuite/discard_locals_test.sh: Add FIXME comment.
4198 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4199 * testsuite/pr14265.t: Add .got output section statement.
4200 * testsuite/script_test_2.t: Likewise.
4201 * testsuite/script_test_3.t: Likewise.
4202 * testsuite/script_test_4.t: Likewise.
4203 * testsuite/script_test_5.t: Likewise.
4204 * testsuite/script_test_6.t: Likewise.
4205 * testsuite/script_test_7.t: Likewise.
4206 * testsuite/script_test_9.t: Likewise.
4208 2012-09-05 Alan Modra <amodra@gmail.com>
4210 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4211 (Powerpc_relocate_functions::Status): New typedef.
4212 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4213 (Target_powerpc::Scan::local): Handle REL64.
4214 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4215 for REL32 and REL64.
4216 (Target_powerpc::symval_for_branch): New function, extracted from..
4217 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4218 checks. Report overflow errors.
4220 2012-09-05 Alan Modra <amodra@gmail.com>
4222 * object.h (Sized_relobj_file::emit_relocs): Delete.
4223 (Sized_relobj_file::emit_relocs_reltype): Delete.
4224 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4225 relocate_relocs for --emit-relocs.
4226 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4227 * output.h: Update comment.
4228 (Output_segment::first_section): New function.
4229 (Output_segment::first_section_load_address): Use first_section.
4230 * output.cc (Output_segment::first_section): New function extracted..
4231 (Output_segment::first_section_load_address): ..from here. Delete.
4232 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4233 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4234 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4235 adjust call to target.h function.
4236 * i386.cc (Target_i386): Likewise.
4237 * sparc.cc (Target_sparc): Likewise.
4238 * x86_64.cc (Target_x86_64): Likewise.
4239 * powerpc.cc (Target_powerpc): Likewise.
4240 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4241 first tls section has section symbol for optimised local dynamic
4243 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4244 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4246 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4247 Rename to relocate_relocs. Update error message.
4249 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4251 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4254 2012-08-31 Alan Modra <amodra@gmail.com>
4256 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4257 (Powerpc_relobj::toc_base_offset): New stub function.
4258 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4259 got_mod_index_offset to tlsld_got_offset. Update all refs.
4260 (Target_powerpc::Relocate::enum skip_tls): New.
4261 (Target_powerpc::call_tls_get_addr_): New var.
4262 (Target_powerpc::is_branch_reloc): Move to file scope.
4263 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4264 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4266 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4267 (powerpc_info): Correct common_pagesize for ppc64.
4268 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4269 (Powerpc_relocate_functions): Add overflow check enums and functions.
4270 Add non-shift version of rela, rela_ua. Delete all rel public
4271 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4272 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4273 addr16_ha3, addr14 functions.
4274 (Output_data_got_powerpc::add_constant_pair): New function.
4275 (Output_data_got_powerpc::got_base_offset): Likewise.
4276 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4277 (instruction constants): Sort, add some more.
4278 (Output_data_glink::do_write): Add and use Address typedef. Use
4279 object->toc_base_offset() stub for 64-bit.
4280 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4281 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4282 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4283 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4284 Always treat .opd relocs as against locally defined symbol.
4285 Correct condition for RELATIVE relocs.
4286 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4287 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4288 for 32-bit syms with a plt entry. Correct ppc64 toc base
4289 calculations. Handle TLS relocs, and more. Add overflow
4290 checking and adjust for Powerpc_relocate_functions changes.
4291 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4292 Reinstate --emit-relocs code with FIXME.
4294 2012-08-30 Alan Modra <amodra@gmail.com>
4296 * layout.cc (Layout::set_segment_offsets): Set p_align to
4297 abi_pagesize, not common_pagesize.
4298 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4299 to determine whether file header can go in segment.
4301 2012-08-30 Alan Modra <amodra@gmail.com>
4303 * output.h (Output_reloc::Output_reloc <output section>): Add
4304 is_relative param. Adjust calls.
4305 (Output_reloc::add_output_section_relative): New functions.
4306 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4308 (Output_reloc::symbol_value): Handle SECTION_CODE.
4310 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4312 * gold.cc (queue_middle_tasks): Call layout again when unique
4313 segments for sections is desired.
4314 * layout.cc (Layout::Layout): Initialize new members.
4315 (Layout::get_output_section_flags): New function.
4316 (Layout::choose_output_section): Call get_output_section_flags.
4317 (Layout::layout): Make output section for mapping to a unique segment.
4318 (Layout::insert_section_segment_map): New function.
4319 (Layout::attach_allocated_section_to_segment): Make unique segment for
4320 output sections marked so.
4321 (Layout::segment_precedes): Check for unique segments when sorting.
4322 * layout.h (Layout::Unique_segment_info): New struct.
4323 (Layout::Section_segment_map): New typedef.
4324 (Layout::insert_section_segment_map): New function.
4325 (Layout::get_output_section_flags): New function.
4326 (Layout::is_unique_segment_for_sections_specified): New function.
4327 (Layout::set_unique_segment_for_sections_specified): New function.
4328 (Layout::unique_segment_for_sections_specified_): New member.
4329 (Layout::section_segment_map_): New member.
4330 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4331 Rename is_gc_pass_one to is_pass_one.
4332 Rename is_gc_pass_two to is_pass_two.
4333 Rename is_gc_or_icf to is_two_pass.
4334 Check for which pass based on whether symbols data is present.
4335 Make it two pass when unique segments for sections is desired.
4336 * output.cc (Output_section::Output_section): Initialize new
4338 * output.h (Output_section::is_unique_segment): New function.
4339 (Output_section::set_is_unique_segment): New function.
4340 (Output_section::is_unique_segment_): New member.
4341 (Output_section::extra_segment_flags): New function.
4342 (Output_section::set_extra_segment_flags): New function.
4343 (Output_section::extra_segment_flags_): New member.
4344 (Output_section::segment_alignment): New function.
4345 (Output_section::set_segment_alignment): New function.
4346 (Output_section::segment_alignment_): New member.
4347 (Output_segment::Output_segment): Initialize is_unique_segment_.
4348 (Output_segment::is_unique_segment): New function.
4349 (Output_segment::set_is_unique_segment): New function.
4350 (Output_segment::is_unique_segment_): New member.
4351 * plugin.cc (allow_unique_segment_for_sections): New function.
4352 (unique_segment_for_sections): New function.
4353 (Plugin::load): Add new functions to transfer vector.
4354 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4355 * Makefile.in: Regenerate.
4356 * testsuite/plugin_final_layout.sh: Check if unique segment
4357 functionality works.
4358 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4360 (allow_unique_segment_for_sections): New global.
4361 (unique_segment_for_sections): New global.
4362 (claim_file_hook): Call allow_unique_segment_for_sections.
4363 (all_symbols_read_hook): Call unique_segment_for_sections.
4365 2012-08-22 Cary Coutant <ccoutant@google.com>
4367 * layout.cc (Layout::include_section): Don't assert on GROUP
4368 sections with --emit-relocs.
4370 2012-08-21 Cary Coutant <ccoutant@google.com>
4372 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4373 if --export-dynamic-symbol names an undef symbol.
4375 2012-08-18 Alan Modra <amodra@gmail.com>
4377 * powerpc.cc: Formatting and white space.
4378 (Powerpc_relobj): Rename got2_section_ to special_.
4379 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4380 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4381 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4382 (Target_powerpc): Add Address typedef and invalid_address. Use
4384 (Target_powerpc::is_branch_reloc): New function.
4385 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4386 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4387 for dst_mask, value and addend.
4388 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4389 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4390 (Output_data_glink::do_write): Correct toc base. Don't try to use
4391 uint16_t for 24-bit offset. Use get_output_section_offset and
4393 (Target_powerpc::Scan::local): Handle more relocs.
4394 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4395 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4396 Plug in toc restoring insn after plt calls. Translate branches
4397 to function descriptor symbols to corresponding entry point.
4398 (Target_powerpc::relocate_for_relocatable): Check return from
4399 get_output_section_offset.
4400 * symtab.h: Comment typo.
4402 2012-08-14 Ian Lance Taylor <iant@google.com>
4404 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4405 unsupported_relocal_local to call unsupported_reloc_global.
4407 2012-08-14 Nick Clifton <nickc@redhat.com>
4410 * script-sections.cc (Sections_element::output_section_name): Add
4411 keep return parameter.
4412 (Output_section_element::match_name): Add keep return parameter.
4413 Return the value of the keep_ member.
4414 * script-sections.h (class Output_section): Update
4415 output_section_name prototype.
4416 * layout.cc (Layout::keep_input_section): New public member
4418 (Layout::choose_output_section): Pass keep parameter to
4419 output_section_name.
4420 * layout.h (class Layout): Add keep_input_section.
4421 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4423 * testsuite/Makefile.am: Add a test.
4424 * testsuite/Makefile.in: Regenerate.
4425 * testsuite/pr14265.c: Source file for the test.
4426 * testsuite/pr14265.t: Linker script for the test.
4427 * testsuite/pr14265.sh: Shell script for the test.
4429 2012-08-14 Alan Modra <amodra@gmail.com>
4431 * target.h (Target::output_section_name): New function.
4432 (Target::do_output_section_name): New function.
4433 * layout.cc (Layout::choose_output_section): Call the above.
4434 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4436 2012-08-14 Alan Modra <amodra@gmail.com>
4438 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4439 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4440 for replace_constant call.
4441 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4442 (Output_data_glink::do_print_to_mapfile): New function.
4443 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4444 (Target_powerpc::Relocate::relocate): Likewise.
4446 2012-08-14 Alan Modra <amodra@gmail.com>
4448 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4449 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4450 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4451 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4452 all references to shndx_. Handle special case for R_PPC_PLTREL24
4454 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4455 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4456 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4458 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4459 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4461 2012-08-12 Alan Modra <amodra@gmail.com>
4463 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4464 (glink insn constants): Use uint32_t.
4465 (Output_data_glink::add_entry): Use insert, not [] operator.
4467 2012-08-11 Alan Modra <amodra@gmail.com>
4469 * object.h (Sized_relobj_file::find_shdr): New function.
4470 (Sized_relobj_file::find_special_sections): New function.
4471 * object.cc (Sized_relobj_file::find_shdr): New function.
4472 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4473 (Sized_relobj_file::find_special_sections): New function, split out..
4474 (Sized_relobj_file::do_read_symbols): ..from here.
4475 * output.h (Output_data_got::replace_constant): New function.
4476 (Output_data_got::num_entries): New function.
4477 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4478 (Output_data_got::got_offset): Protected rather than private.
4479 (Output_data_got::replace_got_entry): New function.
4480 * output.cc (Output_data_got::replace_got_entry): New function.
4481 * powerpc.cc (class Powerpc_relobj): New.
4482 (class Powerpc_relocate_functions): Delete all psymval variants or
4483 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4484 Implement _ha functions using corresponding _hi function.
4485 (Powerpc_relobj::find_special_sections): New function.
4486 (Target_powerpc::do_make_elf_object): New function.
4487 (class Output_data_got_powerpc): New.
4488 (class Output_data_glink): New.
4489 (class Powerpc_scan_relocatable_reloc): New.
4490 Many more changes througout file.
4492 2012-08-09 Nick Clifton <nickc@redhat.com>
4494 * po/vi.po: Updated Vietnamese translation.
4496 2012-08-07 Ian Lance Taylor <iant@google.com>
4498 * layout.cc (Layout::add_target_dynamic_tags): If
4499 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4502 2012-07-30 Nick Clifton <nickc@redhat.com>
4504 * po/gold.pot: Updated template.
4505 * po/es.po: Updated Spanish translation.
4507 2012-07-18 Cary Coutant <ccoutant@google.com>
4510 * configure.ac: Add check for -gpubnames support.
4511 * configure: Regenerate.
4512 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4513 support; force -gno-pubnames.
4514 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4516 (gdb_index_test_4): New test.
4517 * testsuite/Makefile.in: Regenerate.
4518 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4519 * testsuite/gdb_index_test_2.sh: Likewise.
4520 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4521 * testsuite/gdb_index_test_4.sh: New script.
4522 * testsuite/gdb_index_test_comm.sh: New script with common code;
4523 don't look for space after colon.
4525 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4527 * gold.cc (queue_middle_tasks): Update function order only after
4528 deferred objects due to plugins are processed.
4530 2012-07-11 Ian Lance Taylor <iant@google.com>
4532 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4533 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4534 (Target_arm::scan_reloc_for_stub): Likewise.
4535 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4536 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4537 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4538 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4539 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4541 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4542 Ian Lance Taylor <iant@google.com>
4545 * configure.ac: Test whether std::tr1::hash<off_t> works.
4546 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4548 * output.h (class Output_fill): Add virtual destructor.
4549 * configure, config.in: Rebuild.
4551 2012-06-22 Roland McGrath <mcgrathr@google.com>
4553 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4555 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4557 * plugin.cc (Plugin::load): Handle position independent executables.
4559 2012-06-06 Cary Coutant <ccoutant@google.com>
4561 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4563 (lines_only_debug_sections): Likewise.
4564 (gdb_fast_lookup_sections): New static array.
4565 (is_gdb_debug_section): Rename formal parameter.
4566 (is_lines_only_debug_section): Likewise.
4567 (is_gdb_fast_lookup_section): New function.
4568 (Layout::include_section): Check for ".zdebug_" prefix; pass
4569 section name suffix to is_gdb_debug_section, et al.; check for
4570 fast-lookup sections when building .gdb_index.
4571 * options.h (--strip-debug-gdb): Update GDB version number.
4573 2012-06-06 Cary Coutant <ccoutant@google.com>
4575 * configure.ac: Add check for fallocate.
4576 * configure: Regenerate.
4577 * config.in: Regenerate.
4579 * options.h (class General_options): Add --mmap-output-file and
4580 --posix-fallocate options.
4581 * output.cc: (posix_fallocate): Remove; replace with...
4582 (gold_fallocate): New function.
4583 (Output_file::map_no_anonymous): Call gold_fallocate.
4584 (Output_file::map): Check --mmap-output-file option.
4586 2012-06-05 Jing Yu <jingyu@google.com>
4588 * gold.h (textdomain): Add do {} to empty while(0).
4589 (bindtextdomain): Likewise.
4591 2012-06-04 Cary Coutant <ccoutant@google.com>
4593 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4596 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4598 * symtab.cc (Symbol_table::define_special_symbol):
4599 Initialize *poldsym to prevent uninitialized variable errors.
4601 2012-05-23 Cary Coutant <ccoutant@google.com>
4603 * layout.cc (Layout::section_name_mapping): Add rules to handle
4604 exact match on .data.rel.ro.local or .data.rel.ro.
4605 (Layout::output_section_name): Check for exact matches.
4607 2012-05-23 Cary Coutant <ccoutant@google.com>
4609 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4612 2012-05-22 Cary Coutant <ccoutant@google.com>
4614 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4615 object before exporting symbol.
4617 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4619 * testsuite/tls_test.cc: Include "config.h" first.
4620 * testsuite/tls_test_c.c: Likewise.
4622 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4623 Nick Clifton <nickc@redhat.com>
4626 * configure.in: Add check that sysdep.h has been included before
4627 any system header files.
4628 * configure: Regenerate.
4629 * config.in: Regenerate.
4631 2012-05-14 Cary Coutant <ccoutant@google.com>
4633 * layout.cc (Layout::make_output_section): Mark .tdata section
4635 * testsuite/relro_test.cc: Add a TLS variable.
4637 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4640 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4641 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4644 2012-05-08 Cary Coutant <ccoutant@google.com>
4646 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4647 (lines_only_debug_sections): Likewise.
4649 2012-05-02 Roland McGrath <mcgrathr@google.com>
4651 * nacl.cc: New file.
4653 * Makefile.am (CCFILES, HFILES): Add them.
4654 * Makefile.in: Regenerate.
4655 * i386.cc (Output_data_plt_i386_nacl): New class.
4656 (Output_data_plt_i386_nacl_exec): New class.
4657 (Output_data_plt_i386_nacl_dyn): New class.
4658 (Target_i386_nacl): New class.
4659 (Target_selector_i386_nacl): New class.
4660 (target_selector_i386): Use it instead of Target_selector_i386.
4661 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4662 (Target_x86_64_nacl): New class.
4663 (Target_selector_x86_64_nacl): New class.
4664 (target_selector_x86_64, target_selector_x32): Use it instead of
4665 Target_selector_x86_64.
4666 * arm.cc (Output_data_plt_arm_nacl): New class.
4667 (Target_arm_nacl): New class.
4668 (Target_selector_arm_nacl): New class.
4669 (target_selector_arm, target_selector_armbe): Use it instead of
4670 Target_selector_arm.
4672 * target-select.cc (select_target): Take new Input_file* and off_t
4673 arguments, pass them on to recognize method of selector.
4674 * object.cc (make_elf_sized_object): Update caller.
4675 * parameters.cc (parameters_force_valid_target): Likewise.
4676 * incremental.cc (make_sized_incremental_binary): Likewise.
4677 * target-select.h: Update decl.
4678 (Target_selector::recognize): Take new Input_file* argument,
4679 pass it on to do_recognize.
4680 (Target_selector::do_recognize): Take new Input_file* argument.
4681 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4682 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4683 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4684 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4686 * target.h (Target::Target_info): New members isolate_execinstr
4688 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4689 * arm.cc (Target_arm::arm_info): Update initializer.
4690 * i386.cc (Target_i386::i386_info): Likewise.
4691 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4692 * sparc.cc (Target_sparc::sparc_info): Likewise.
4693 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4694 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4695 * layout.cc (Layout::attach_allocated_section_to_segment):
4696 Take new const Target* argument. If target->isolate_execinstr(), act
4698 (Layout::find_first_load_seg): Take new const Target* argument;
4699 if target->isolate_execinstr(), reject PF_X segments.
4700 (Layout::relaxation_loop_body): Update caller.
4701 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4702 reset file offset to zero when we hit LOAD_SEG, and then do a second
4703 loop over the segments before LOAD_SEG to reassign offsets after
4704 addresses have been determined. Handle target->rosegment_gap().
4705 (Layout::attach_section_to_segment): Take new const Target* argument;
4706 pass it to attach_allocated_section_to_segment.
4707 (Layout::make_output_section): Update caller.
4708 (Layout::attach_sections_to_segments): Take new const Target* argument;
4709 pass it to attach_section_to_segment.
4710 * gold.cc (queue_middle_tasks): Update caller.
4711 * layout.h (Layout): Update method decls with new arguments.
4713 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4714 Target_info pointer to use.
4715 (Target_arm::do_make_data_plt): New virtual method.
4716 (Target_arm::make_data_plt): New method that calls it.
4717 (Target_arm::make_plt_entry): Use it.
4718 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4719 for the section alignment.
4720 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4722 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4723 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4725 (Output_data_plt_arm::get_plt_entry_size): Call it.
4726 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4727 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4728 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4730 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4731 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4732 method instead of sizeof(plt_entry).
4733 (Output_data_plt_arm::add_entry): Likewise.
4734 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4735 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4737 (Target_arm::plt_entry_size): Likewise.
4738 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4740 (Output_data_plt_arm_standard): ... here, new class.
4741 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4742 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4743 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4745 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4746 Take additional argument for the PLT entry size.
4747 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4748 Use get_plt_entry_size method rather than plt_entry_size variable.
4749 (Output_data_plt_x86_64::reserve_slot): Likewise.
4750 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4751 (Output_data_plt_x86_64::add_entry): Likewise.
4752 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4753 (Output_data_plt_x86_64::address_for_global): Likewise.
4754 (Output_data_plt_x86_64::address_for_local): Likewise.
4755 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4756 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4757 Make method non-static.
4758 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4760 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4761 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4762 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4763 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4765 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4766 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4768 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4769 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4771 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4772 (Output_data_plt_x86_64::plt_entry_size)
4773 (Output_data_plt_x86_64::first_plt_entry)
4774 (Output_data_plt_x86_64::plt_entry)
4775 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4776 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4777 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4778 (Output_data_plt_x86_64_standard): ... here, new class.
4779 (Target_x86_64::Target_x86_64): Take optional argument for the
4780 Target_info pointer to use.
4781 (Target_x86_64::do_make_data_plt): New virtual method.
4782 (Target_x86_64::make_data_plt): New method to call it.
4783 (Target_x86_64::init_got_plt_for_update): Use that.
4784 Call this->plt_->add_eh_frame method here.
4785 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4786 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4787 rather than static method.
4788 (Target_x86_64::plt_entry_size): Likewise.
4789 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4790 rather than plt_entry_size variable. Move guts of PLT filling to...
4791 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4792 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4793 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4795 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4796 additional argument for the section alignment.
4797 Don't do add_eh_frame_for_plt here.
4798 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4799 non-static. Use get_plt_entry_size method rather than plt_entry_size
4801 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4803 (Output_data_plt_i386::get_plt_entry_size): Call it.
4804 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4805 (Output_data_plt_i386::add_eh_frame): New method to call it.
4806 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4808 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4809 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4811 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4812 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4813 method instead of plt_entry_size.
4814 (Output_data_plt_i386::plt_entry_size)
4815 (Output_data_plt_i386::plt_eh_frame_fde_size)
4816 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4817 (Output_data_plt_i386_standard): ... here, new class.
4818 (Output_data_plt_i386_exec): New class.
4819 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4820 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4821 (Output_data_plt_i386::exec_plt_entry): Move to ...
4822 (Output_data_plt_i386_exec::plt_entry): ... here.
4823 (Output_data_plt_i386_dyn): New class.
4824 (Output_data_plt_i386::first_plt_entry): Move to ...
4825 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4826 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4827 (Output_data_plt_i386_dyn::plt_entry): ... here.
4828 (Target_i386::Target_i386): Take optional argument for the Target_info
4830 (Target_i386::do_make_data_plt): New virtual method.
4831 (Target_i386::make_data_plt): New method to call it.
4832 (Target_i386::make_plt_section): Use that.
4833 Call this->plt_->add_eh_frame method here.
4834 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4835 rather than plt_entry_size variable.
4836 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4837 (Output_data_plt_i386::address_for_local): Likewise.
4838 (Output_data_plt_i386::do_write): Likewise.
4839 Move guts of PLT filling to...
4840 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4841 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4842 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4843 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4845 2012-05-01 Cary Coutant <ccoutant@google.com>
4847 * dwarf_reader.cc (Dwarf_die::read_attributes)
4848 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4849 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4850 * reduced_debug_output.cc
4851 (Output_reduced_debug_info_section::get_die_end): Remove
4852 DW_FORM_GNU_ref_index. Add default case.
4854 2012-04-26 Mark Wielaard <mjw@redhat.com>
4856 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4857 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4858 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4859 DW_AT_high_pc as offset from DW_AT_low_pc.
4861 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4862 * testsuite/Makefile.in: Regenerate.
4863 * testsuite/gdb_index_test_3.c: New test source file.
4864 * testsuite/gdb_index_test_3.sh: New test source file.
4866 2012-04-25 Ian Lance Taylor <iant@google.com>
4868 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4870 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4871 as a class, not a struct.
4872 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4873 (Target_arm::apply_cortex_a8_workaround): Likewise.
4874 * gc.h: Declare Reloc_types as a struct, not a class.
4875 * object.h: Declare Symbols_data as a struct.
4876 * reloc.h: Declare Read_relocs_data as a struct.
4877 * target.h: Declare Relocate_info as a struct.
4879 2012-04-24 David S. Miller <davem@davemloft.net>
4881 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4882 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4885 2012-04-24 Cary Coutant <ccoutant@google.com>
4887 * incremental-dump.cc (find_input_containing_global): Replace
4888 magic number with symbolic constant.
4889 (dump_incremental_inputs): Update version number.
4890 * incremental.cc (Output_section_incremental_inputs): Update version
4891 number; import symbolic constants from Incremental_inputs_reader.
4892 (Incremental_inputs::create_data_sections): Align relocations
4893 section correctly for 64-bit targets.
4894 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4895 constants; add padding.
4896 (Output_section_incremental_inputs::write_header): Add assert for
4898 (Output_section_incremental_inputs::write_input_files): Add assert
4899 for input_entry_size.
4900 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4901 add assert for object_info_size, input_section_entry_size,
4902 global_sym_entry_size.
4903 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4904 for data structure sizes; use them.
4905 (Incremental_input_entry_reader): Import symbolic constants from
4906 Incremental_inputs_reader; use them.
4908 2012-04-23 David S. Miller <davem@davemloft.net>
4910 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4912 (Target_sparc::Target_sparc): Initialize new fields.
4913 (Target_sparc::do_make_elf_object): New function.
4914 (Target_sparc::do_adjust_elf_header): New function.
4916 2012-04-23 Cary Coutant <ccoutant@google.com>
4918 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4919 CU range table of gdb index.
4921 2012-04-20 David S. Miller <davem@davemloft.net>
4923 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4926 2012-04-16 David S. Miller <davem@davemloft.net>
4928 * sparc.cc (Target_sparc::got_address): New function.
4929 (Sparc_relocate_functions::gdop_hix22): New function.
4930 (Sparc_relocate_functions::gdop_lox10): New function.
4931 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4933 (Target_sparc::Scan::local): Likewise if the global symbol is not
4934 preemptible and is not IFUNC.
4935 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4936 transformations for local and non-preemptible non-IFUNC global
4939 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4940 writing out 64-bit part of ranges.
4942 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4943 -fpic and -fpie respectively.
4944 * Makefile.in: Regenerate.
4946 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4947 (Target_sparc::Target_sparc): Initialize new field.
4948 (Target_sparc::do_plt_section_for_global): New function.
4949 (Target_sparc::do_plt_section_for_local): New function.
4950 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4951 (Target_sparc::make_plt_section): New function, broken out of
4952 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4953 (Target_sparc::make_plt_entry): Call make_plt_section.
4954 (Target_sparc::make_local_ifunc_plt_entry): New function.
4955 (Target_sparc::rela_ifunc_section): New function.
4956 (Target_sparc::plt_section): Remove const.
4957 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4958 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4959 and ifunc_count_ fields.
4960 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4961 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4962 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4963 (Output_data_plt_sparc::rela_ifunc): New function.
4964 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4965 (Output_data_plt_sparc::has_ifunc_section): New function.
4966 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4967 (Output_data_plt_sparc::address_for_global): New function.
4968 (Output_data_plt_sparc::address_for_local): New function.
4969 (Output_data_plt_sparc::plt_index_to_offset): New function.
4970 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4972 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4974 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4975 R_SPARC_JMP_IREL to switch.
4976 (Target_sparc::Scan::check_non_pic): Likewise.
4977 (Target_sparc::Scan::local): Handle IFUNC symbols.
4978 (Target_sparc::Scan::local): Likewise.
4979 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4980 and plt_address_for_local.
4981 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4982 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4984 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4985 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4986 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4987 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4989 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4990 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4992 * sparc.cc (Target_sparc::Scan::global): Likewise.
4993 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4995 2012-04-16 Cary Coutant <ccoutant@google.com>
4997 * archive.cc (Library_base::should_include_member): Check for
4998 --export-dynamic-symbol.
4999 * options.h (class General_options): Add --export-dynamic-symbol.
5000 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5001 --export-dynamic-symbol.
5002 (Symbol_table::gc_mark_undef_symbols): Likewise.
5003 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5005 2012-04-12 David S. Miller <davem@davemloft.net>
5007 * sparc.cc (Reloc::wdisp10): New relocation method.
5008 (Reloc::h34): Likewise.
5009 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5010 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5012 (Target_sparc::Scan::local): Likewise.
5013 (Target_sparc::Scan::global): Likewise.
5014 (Target_sparc::Relocate::relocate): Likewise.
5016 2012-04-09 Cary Coutant <ccoutant@google.com>
5018 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5021 2012-04-06 Ian Lance Taylor <iant@google.com>
5023 * timer.cc: #include <unistd.h>.
5025 2012-04-06 Roland McGrath <mcgrathr@google.com>
5027 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5028 * config.in: Regenerate.
5029 * configure: Regenerate.
5031 2012-04-05 Nick Clifton <nickc@redhat.com>
5033 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5034 (AM_LC_MESSAGES): Add.
5035 * aclocal.m4: Regenerate.
5036 * config.in: Regenerate.
5037 * configure: Regenerate.
5039 2012-03-21 Cary Coutant <ccoutant@google.com>
5041 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5042 * Makefile.in: Regenerate.
5043 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5044 (Sized_elf_reloc_mapper::symbol_section): New function.
5045 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5046 (make_elf_reloc_mapper): New function.
5047 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5048 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5049 (Dwarf_abbrev_table::do_get_abbrev): New function.
5050 (Dwarf_ranges_table::read_ranges_table): New function.
5051 (Dwarf_ranges_table::read_range_list): New function.
5052 (Dwarf_pubnames_table::read_section): New function.
5053 (Dwarf_pubnames_table::read_header): New function.
5054 (Dwarf_pubnames_table::next_name): New function.
5055 (Dwarf_die::Dwarf_die): New function.
5056 (Dwarf_die::read_attributes): New function.
5057 (Dwarf_die::skip_attributes): New function.
5058 (Dwarf_die::set_name): New function.
5059 (Dwarf_die::set_linkage_name): New function.
5060 (Dwarf_die::attribute): New function.
5061 (Dwarf_die::string_attribute): New function.
5062 (Dwarf_die::int_attribute): New function.
5063 (Dwarf_die::uint_attribute): New function.
5064 (Dwarf_die::ref_attribute): New function.
5065 (Dwarf_die::child_offset): New function.
5066 (Dwarf_die::sibling_offset): New function.
5067 (Dwarf_info_reader::check_buffer): New function.
5068 (Dwarf_info_reader::parse): New function.
5069 (Dwarf_info_reader::do_parse): New function.
5070 (Dwarf_info_reader::do_read_string_table): New function.
5071 (Dwarf_info_reader::lookup_reloc): New function.
5072 (Dwarf_info_reader::get_string): New function.
5073 (Dwarf_info_reader::visit_compilation_unit): New function.
5074 (Dwarf_info_reader::visit_type_unit): New function.
5075 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5076 Sized_elf_reloc_mapper.
5077 (Sized_dwarf_line_info::symbol_section): Remove function.
5078 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5079 (Sized_dwarf_line_info::read_line_mappings): Remove object
5080 parameter, adjust callers.
5081 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5082 * dwarf_reader.h: Include <sys/types.h>.
5083 (class Track_relocs): Remove forward declaration.
5084 (class Elf_reloc_mapper): New class.
5085 (class Sized_elf_reloc_mapper): New class.
5086 (class Dwarf_abbrev_table): New class.
5087 (class Dwarf_range_list): New class.
5088 (class Dwarf_ranges_table): New class.
5089 (class Dwarf_pubnames_table): New class.
5090 (class Dwarf_die): New class.
5091 (class Dwarf_info_reader): New class.
5092 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5093 (Sized_dwarf_line_info::symbol_section): Remove member function.
5094 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5096 * gdb-index.cc: New source file.
5097 * gdb-index.h: New source file.
5098 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5099 and .debug_types sections, call Layout::add_to_gdb_index.
5100 (Sized_relobj_incr::do_section_name): Implement.
5101 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5102 return type; Implement.
5103 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5105 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5106 parameter list and return type.
5107 (Sized_incr_dynobj::do_section_contents): Likewise.
5108 * layout.cc: Include gdb-index.h.
5109 (Layout::Layout): Initialize gdb_index_data_.
5110 (Layout::init_fixed_output_section): Check for .gdb_index section.
5111 (Layout::add_to_gdb_index): New function. Instantiate.
5112 * layout.h: Add forward declaration for class Gdb_index.
5113 (Layout::add_to_gdb_index): New member function.
5114 (Layout::gdb_index_data_): New data member.
5115 * main.cc: Include gdb-index.h.
5116 (main): Print statistics for gdb index.
5117 * object.cc (Object::section_contents): Move code into
5118 do_section_contents.
5119 (need_decompressed_section): Check for sections needed when building
5121 (build_compressed_section_map): Likewise.
5122 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5124 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5125 sections; call Layout::add_to_gdb_index.
5126 (Sized_relobj_file::do_decompressed_section_contents): Call
5127 do_section_contents directly.
5128 * object.h (Object::do_section_contents): Adjust parameter list and
5130 (Object::do_decompressed_section_contents): Call do_section_contents
5132 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5134 * options.h (class General_options): Add --gdb-index option.
5135 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5136 list and return type.
5137 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5138 * reloc.h (Track_relocs::checkpoint): New function.
5139 (Track_relocs::reset): New function.
5141 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5143 * testsuite/Makefile.in: Regenerate.
5144 * testsuite/gdb_index_test.cc: New test source file.
5145 * testsuite/gdb_index_test_1.sh: New test source file.
5146 * testsuite/gdb_index_test_2.sh: New test source file.
5148 2012-03-19 Doug Kwan <dougkwan@google.com>
5150 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5151 (Target_arm::do_finalize_sections): Remove code which defines
5152 __exidx_start and __exidx_end. Make symbol table parameter
5153 anonymous as it is not used.
5154 * gold.cc (queue_middle_tasks): Call target hook to define any
5155 target-specific symbols.
5156 * target.h (Target::define_standard_symbols): New method.
5157 (Target::do_define_standard_symbols): Same.
5158 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5159 * testsuite/Makefile.in: Regenerate.
5160 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5162 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5163 relocations are generated for __exidx_start and __exidx_end.
5165 2012-03-16 Doug Kwan <dougkwan@google.com>
5167 * testsuite/Makefile.am: Disable test initpri3b.
5168 * testsuite/Makefile.in: Regenerate.
5170 2012-03-15 Doug Kwan <dougkwan@google.com>
5172 * arm.cc (Target_arm::got_section): Make .got section read-only
5175 2012-03-15 Ian Lance Taylor <iant@google.com>
5178 * layout.cc (Layout::make_output_section): Correctly mark
5179 SHT_INIT_ARRAY, et. al., as relro.
5181 2012-03-14 Doug Kwan <dougkwan@google.com>
5183 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5184 dynamic relocations for protected symbols in shared objects.
5186 2012-03-13 Ian Lance Taylor <iant@google.com>
5188 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5189 keep the larger alignment.
5191 2012-03-12 Cary Coutant <ccoutant@google.com>
5193 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5194 handling of DW_LNE_define_file.
5196 2012-03-12 Cary Coutant <ccoutant@google.com>
5198 * reduced_debug_output.cc
5199 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5202 2012-02-29 Cary Coutant <ccoutant@google.com>
5204 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5206 2012-02-29 Cary Coutant <ccoutant@google.com>
5208 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5209 Call Object::decompressed_section_contents.
5210 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5212 (Sized_dwarf_line_info::buffer_start_): New data member.
5213 * merge.cc (Output_merge_data::do_add_input_section): Call
5214 Object::decompressed_section_contents.
5215 (Output_merge_string::do_add_input_section): Likewise.
5216 * object.cc (need_decompressed_section): New function.
5217 (build_compressed_section_map): Decompress sections needed later.
5218 (Sized_relobj_file::do_decompressed_section_contents): New function.
5219 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5220 * object.h (Object::decompressed_section_contents): New function.
5221 (Object::discard_decompressed_sections): New function.
5222 (Object::do_decompressed_section_contents): New function.
5223 (Object::do_discard_decompressed_sections): New function.
5224 (Compressed_section_info): New type.
5225 (Compressed_section_map): Include decompressed section contents.
5226 (Sized_relobj_file::do_decompressed_section_contents): New function.
5227 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5229 2012-02-16 Cary Coutant <ccoutant@google.com>
5231 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5232 * testsuite/Makefile.in: Regenerate.
5234 2012-02-14 Cary Coutant <ccoutant@google.com>
5236 * options.cc (General_options::finalize): Disallow -pie and -static.
5238 2012-02-03 Doug Kwan <dougkwan@google.com>
5240 * arm.cc (Arm_relocate_functions::abs8,
5241 Arm_relocate_functions::abs16): Use
5242 Bits::has_signed_unsigned_overflow32.
5243 (Arm_relocate_functions::thm_abs8): Correct range of
5245 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5248 2012-02-02 Doug Kwan <dougkwan@google.com>
5250 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5251 position independent outputs, not just shared objects.
5253 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5255 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5256 * configure: Regenerated.
5258 2012-01-27 Ian Lance Taylor <iant@google.com>
5260 * reloc.h (Bits): New class with static functions, copied from
5261 namespace utils in arm.cc.
5262 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5265 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5267 * incremental.cc (write_info_blocks): Correct relocation offset.
5269 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5271 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5272 (Relocate::tls_gd_to_le): Likewise.
5274 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5276 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5278 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5280 * configure.ac: Check if -mcmodel=medium works.
5281 * configure: Regenerated.
5283 2012-01-24 Cary Coutant <ccoutant@google.com>
5285 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5287 (read_unsigned_LEB_128_x): ... this new function.
5288 (read_signed_LEB_128): Replaced with inline definition and ...
5289 (read_signed_LEB_128_x): ... this new function.
5290 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5291 (read_unsigned_LEB_128): Add inline definition.
5292 (read_signed_LEB_128_x): New function.
5293 (read_signed_LEB_128): Add inline definition.
5294 * testsuite/Makefile.am (leb128_unittest): New unit test.
5295 * testsuite/Makefile.in: Regenerate.
5296 * testsuite/leb128_unittest.cc: New unit test.
5298 2012-01-23 Ian Lance Taylor <iant@google.com>
5301 * i386.cc (Target_i386::do_code_fill): When using a jmp
5302 instruction, pad with nop instructions.
5303 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5305 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5307 * x86_64.cc (gc_process_relocs): Add typename on types used in
5309 (scan_relocs): Likewise.
5310 (relocate_section): Likewise.
5311 (apply_relocation): Likewise.
5313 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5315 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5316 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5319 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5321 * x86_64.cc: Initial support for x32.
5323 2012-01-03 Cary Coutant <ccoutant@google.com>
5325 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5326 Use abstract base class for GOT.
5327 * gold/output.h (class Output_data_got_base): New abstract base class.
5328 (class Output_data_got): Derive from new base class, adjust ctors.
5329 (Output_data_got::reserve_slot): Make virtual; rename to
5330 do_reserve_slot; Adjust callers.
5331 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5332 pointer to abstract base class.
5333 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5335 2011-12-18 Ian Lance Taylor <iant@google.com>
5337 * object.h (Relobj::local_symbol_value): New function.
5338 (Relobj::local_plt_offset): New function.
5339 (Relobj::local_has_got_offset): New function.
5340 (Relobj::local_got_offset): New function.
5341 (Relobj::set_local_got_offset): New function.
5342 (Relobj::do_local_symbol_value): New pure virtual function.
5343 (Relobj::do_local_plt_offset): Likewise.
5344 (Relobj::do_local_has_got_offset): Likewise.
5345 (Relobj::do_local_got_offset): Likewise.
5346 (Relobj::do_set_local_got_offset): Likewise.
5347 (Sized_relobj::do_local_has_got_offset): Rename from
5348 local_has_got_offset.
5349 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5350 (Sized_relobj::do_set_local_got_offset): Rename from
5351 set_local_got_offset.
5352 (Sized_relobj_file::do_local_plt_offset): Rename from
5354 (Sized_relobj_file::do_local_symbol_value): New function.
5355 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5357 * output.cc (Output_data_got::Got_entry::write): Change object to
5358 Relobj. Use local_symbol_value.
5359 (Output_data_got::add_global_with_rel): Change rel_dyn to
5360 Output_data_reloc_generic*. Use add_global_generic.
5361 (Output_data_got::add_global_with_rela): Remove. Change all
5362 callers to use add_global_with_rel.
5363 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5364 Output_data_reloc_generic*. Use add_global_generic.
5365 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5366 callers to use add_global_pair_with_rel.
5367 (Output_data_got::add_local): Change object to Relobj*.
5368 (Output_data_got::add_local_plt): Likewise.
5369 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5370 change rel_dyn to Output_data_reloc_generic*. Use
5372 (Output_data_got::add_local_with_rela): Remove. Change all
5373 callers to use all_local_with_rel.
5374 (Output_data_got::add_local_pair_with_rel): Change object to
5375 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5376 add_output_section_generic.
5377 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5378 callers to use add_local_pair_with_rel.
5379 (Output_data_got::reserve_local): Change object to Relobj*.
5380 * output.h: (class Output_data_reloc_generic): Add pure virtual
5381 declarations for add_global_generic, add_local_generic,
5382 add_output_section_generic.
5383 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5384 functions for Output_data_reloc_generic. Update declarations for
5385 changes listed in output.cc.
5386 (class Output_data_got): Change template parameter to got_size.
5387 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5388 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5390 (Sized_relobj_incr::do_local_plt_offset): New function.
5391 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5394 2011-12-17 Cary Coutant <ccoutant@google.com>
5396 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5397 * resolve.cc (Symbol_table::resolve): Likewise.
5398 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5400 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5402 2011-12-16 Ian Lance Taylor <iant@google.com>
5404 * output.h (Output_data_reloc_generic::add): Only call
5405 add_dynamic_reloc if this is a dynamic reloc section.
5407 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5410 * target-reloc.h (apply_relocation): Replace <64, false> with
5413 2011-11-25 Nick Clifton <nickc@redhat.com>
5415 * po/it.po: New Italian translation.
5417 2011-11-17 Sterling Augustine <saugustine@google.com>
5419 * script.cc (script_include_directive): Implement.
5420 (read_script_file): New local variables name and search_path. Update
5421 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5422 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5423 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5425 2011-11-11 Sterling Augustine <saugustine@google.com>
5427 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5428 (file_or_sections_cmd): Likewise.
5430 2011-11-11 Doug Kwan <dougkwan@google.com>
5432 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5433 if --just-symbols is given.
5435 2011-11-10 Doug Kwan <dougkwan@google.com>
5438 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5439 when processing data relocs.
5440 * reloc.h (Relocate_functions::rel_unaligned): New method.
5441 (Relocate_functions::pcrel_unaligned): Ditto.
5442 (Relocate_functions::rel32_unaligned): Ditto.
5443 (Relocate_functions::pcrel32_unaligned): Ditto.
5445 2011-11-09 Doug Kwan <dougkwan@google.com>
5448 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5449 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5450 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5451 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5452 (Relocate_functions::rel_unaligned): New.
5453 (Relocate_functions::rel32_unaligned): New.
5454 * target-reloc.h (relocate_for_relocatable): Add code to handle
5455 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5456 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5457 arm_unaligned_reloc_r): New targets.
5458 * testsuite/Makefile.in: Regenerate.
5459 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5462 2011-11-02 Ian Lance Taylor <iant@google.com>
5464 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5466 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5467 * options.cc (General_options::finalize): Use library search path
5468 from configure script if specified. If not native and no sysroot,
5469 only search TOOLLIBDIR.
5470 * options.h (Search_directory::Search_directory): Change name to
5472 (General_options::add_to_library_path_with_sysroot): Change arg to
5474 * configure, Makefile.in, config.in: Rebuild.
5476 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5478 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5479 we are working around the ARM1176 Erratum.
5480 * options.h (General_options::fix_arm1176): Add option.
5481 * testsuite/Makefile.am: Add testcases, and keep current ones
5483 * testsuite/Makefile.in: Regenerate.
5484 * testsuite/arm_fix_1176.s: New file.
5485 * testsuite/arm_fix_1176.sh: Likewise.
5487 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5489 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5491 (Target_arm::may_use_blx): Remove method.
5492 (Target_arm::set_may_use_blx): Likewise.
5493 (Target_arm::may_use_v4t_interworking): New method.
5494 (Target_arm::may_use_v5t_interworking): Likewise.
5495 (Target_arm::may_use_blx_): Remove member variable.
5496 (Arm_relocate_functions::arm_branch_common): Check for v5T
5498 (Arm_relocate_functions::thumb_branch_common): Likewise.
5499 (Reloc_stub::stub_type_for_reloc): Likewise.
5500 (Target_arm::do_finalize_sections): Correct interworking checks.
5501 * testsuite/Makefile.am: Add new tests.
5502 * testsuite/Makefile.in: Regenerate.
5503 * testsuite/arm_farcall_arm_arm.s: New test.
5504 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5505 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5506 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5507 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5508 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5509 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5510 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5512 2011-10-31 Cary Coutant <ccoutant@google.com>
5515 * expression.cc (Expression::eval_with_dot): Add
5516 is_section_dot_assignment parameter.
5517 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5518 absolute and assigning to dot within a section.
5519 * script-sections.cc
5520 (Output_section_element_assignment::set_section_addresses): Pass
5521 dot_section to set_if_absolute.
5522 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5523 as is_section_dot_assignment flag to eval_with_dot.
5524 (Output_section_element_dot_assignment::set_section_addresses):
5526 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5527 parameter. Also set value if relative to dot_section; set the
5528 symbol's output_section.
5529 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5530 parameter. Adjust all callers.
5531 (Expression::eval_maybe_dot): Likewise.
5532 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5534 * testsuite/script_test_2.t: Test assignment of an absolute value
5535 to dot within an output section element.
5537 2011-10-31 Cary Coutant <ccoutant@google.com>
5539 * options.h (class General_options): Add --[no-]gnu-unique options.
5540 * symtab.cc (Symbol_table::sized_write_globals): Convert
5541 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5543 2011-10-31 Cary Coutant <ccoutant@google.com>
5546 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5547 unnecessary assertion.
5548 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5550 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5552 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5554 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5556 Change to just keep the section associated with symbol.
5557 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5558 they are externally visible and --export-dynamic is turned on.
5559 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5561 2011-10-19 Ian Lance Taylor <iant@google.com>
5564 * script-sections.cc
5565 (Output_section_element_dot_assignment::needs_output_section): New
5568 2011-10-19 Ian Lance Taylor <iant@google.com>
5571 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5572 --section-start option was seen.
5573 * options.h (General_options::any_section_start): New function.
5575 2011-10-18 David S. Miller <davem@davemloft.net>
5578 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5579 member to track relocation locations that have moved during TLS
5580 reloc optimizations.
5581 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5582 (Target_sparc::Relocate::relocate): Adjust view down by 4
5583 bytes if it matches reloc_adjust_addr_.
5584 (Target_sparc::Relocate::relocate_tls): Always move the
5585 __tls_get_addr call delay slot instruction forward 4 bytes when
5586 performing relaxation.
5588 2011-10-18 Cary Coutant <ccoutant@google.com>
5590 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5591 (Output_file::map_no_anonymous): Check for non-zero
5592 return code from posix_fallocate.
5594 2011-10-17 Cary Coutant <ccoutant@google.com>
5597 * plugin.cc (is_visible_from_outside): Check for symbols
5598 referenced from dynamic objects.
5599 * resolve.cc (Symbol_table::resolve): Don't count references
5600 from dynamic objects as references from real ELF files.
5601 * testsuite/plugin_test_2.sh: Adjust expected result.
5603 2011-10-17 Cary Coutant <ccoutant@google.com>
5605 * gold.cc: Include timer.h.
5606 (queue_middle_tasks): Stamp time.
5607 (queue_final_tasks): Likewise.
5608 * main.cc (main): Store timer in parameters. Print timers
5610 * parameters.cc (Parameters::Parameters): Initialize timer_.
5611 (Parameters::set_timer): New function.
5612 (set_parameters_timer): New function.
5613 * parameters.h (Parameters::set_timer): New function.
5614 (Parameters::timer): New function.
5615 (Parameters::timer_): New data member.
5616 (set_parameters_timer): New function.
5617 * timer.cc (Timer::stamp): New function.
5618 (Timer::get_pass_time): New function.
5619 * timer.h (Timer::stamp): New function.
5620 (Timer::get_pass_time): New function.
5621 (Timer::pass_times_): New data member.
5623 2011-10-17 Cary Coutant <ccoutant@google.com>
5625 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5626 task for members of lib groups.
5628 2011-10-17 Cary Coutant <ccoutant@google.com>
5631 * fileread.cc (File_read::find_view): Add assert.
5632 (File_read::make_view): Move bounds check (replace with assert)...
5633 (File_read::find_or_make_view): ... to here.
5635 2011-10-12 Cary Coutant <ccoutant@google.com>
5637 * output.cc (Output_file::open_base_file): Handle case where
5638 ::read returns less than requested size.
5640 2011-10-10 Cary Coutant <ccoutant@google.com>
5642 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5643 Initialize defined_count_.
5644 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5645 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5646 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5647 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5648 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5649 * incremental.h (Sized_relobj_incr::defined_count_): New data
5651 (Sized_incr_dynobj::defined_count_): New data member.
5652 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5653 Return zeroes instead of internal error.
5655 2011-10-10 Cary Coutant <ccoutant@google.com>
5658 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5659 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5660 * output.h (class Output_reloc): Add use_plt_offset flag.
5661 (Output_reloc::type_): Adjust size of bit field.
5662 (Output_reloc::use_plt_offset_): New bit field.
5663 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5664 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5665 flag. Adjust all callers.
5666 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5667 creating RELATIVE relocations.
5669 2011-10-10 Nick Clifton <nickc@redhat.com>
5671 * po/es.po: Updated Spanish translation.
5672 * po/fi.po: Updated Finnish translation.
5674 2011-10-03 Diego Novillo <dnovillo@google.com>
5676 * options.cc (parse_uint): Fix dereference of RETVAL.
5678 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5680 * layout.h (section_order_map_): New member.
5681 (get_section_order_map): New member function.
5682 * output.cc (Output_section::add_input_section): Check for patterns
5683 only when --section-ordering-file is specified.
5684 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5685 output_sections have been formed.
5686 * layout.cc (Layout_Layout): Initialize section_order_map_.
5687 * plugin.cc (update_section_order): Store order in order_map. Do not
5689 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5690 * testsuite/Makefile.in: Regenerate.
5691 * testsuite/plugin_section_order.c: New file.
5692 * testsuite/plugin_final_layout.cc: New file.
5693 * testsuite/plugin_final_layout.sh: New file.
5695 2011-09-29 Cary Coutant <ccoutant@google.com>
5697 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5699 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
5700 symbols during incremental update.
5701 (Symbol_table::add_from_dynobj): Likewise.
5703 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5704 Ian Lance Taylor <iant@google.com>
5706 * symtab.cc (Symbol_table::define_special_symbol): Always
5707 canonicalize version string.
5709 2011-09-26 Cary Coutant <ccoutant@google.com>
5711 * gold.cc (queue_initial_tasks): Move option checks ...
5712 * options.cc (General_options::finalize): ... to here. Disable
5713 some options; make others fatal.
5715 2011-09-26 Cary Coutant <ccoutant@google.com>
5718 * plugin.cc (get_symbols_v2): New function.
5719 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5720 (is_referenced_from_outside): New function.
5721 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5722 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5723 (get_symbols): Pass version parameter.
5724 (get_symbols_v2): New function.
5725 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5727 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5728 (onload): Add LDPT_GET_SYMBOLS_V2.
5729 (all_symbols_read_hook): Use get_symbols_v2; check for
5730 LDPR_PREVAILING_DEF_IRONLY_EXP.
5731 * testsuite/plugin_test_3.sh: Update expected results.
5733 2011-09-23 Simon Baldwin <simonb@google.com>
5735 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5736 configuration options.
5737 * configure: Regenerate.
5738 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5739 * Makefile.in: Regenerate.
5740 * testsuite/Makefile.in: Regenerate.
5742 2011-09-19 Sriraman Tallam <tmsriram@google.com>
5744 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5746 2011-09-19 Cary Coutant <ccoutant@google.com>
5748 * incremental.cc (can_incremental_update): Fix typo in comment.
5749 * incremental.h (can_incremental_update): Likewise.
5751 2011-09-18 Cary Coutant <ccoutant@google.com>
5753 * incremental.cc (can_incremental_update): New function.
5754 * incremental.h (can_incremental_update): New function.
5755 * layout.cc (Layout::init_fixed_output_section): Call it.
5756 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5757 * object.cc (Sized_relobj_file::do_layout): Call
5758 can_incremental_update.
5760 2011-09-13 Cary Coutant <ccoutant@google.com>
5762 * configure.ac: Check for glibc support for gnu_indirect_function
5763 support with static linking, setting automake conditional
5765 * Makefile.in: Regenerate.
5766 * configure: Regenerate.
5768 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5769 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5771 * testsuite/Makefile.in: Regenerate.
5773 2011-09-13 Cary Coutant <ccoutant@google.com>
5775 * incremental.cc (Sized_relobj_incr::do_layout): Call
5776 report_comdat_group for kept comdat sections.
5777 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5778 * testsuite/Makefile.in: Regenerate.
5779 * testsuite/incr_comdat_test_1.cc: New source file.
5780 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5781 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5782 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5784 2011-09-13 Ian Lance Taylor <iant@google.com>
5786 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5787 variable external_symbols_offset.
5789 2011-09-12 Ian Lance Taylor <iant@google.com>
5791 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5792 triggered if object has no symbols.
5794 2011-09-09 David S. Miller <davem@davemloft.net>
5796 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5797 (Output_fill_debug_line::do_write): Likewise.
5799 2011-08-29 Cary Coutant <ccoutant@google.com>
5801 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5802 casts to match formatting specs.
5803 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5805 2011-08-26 Cary Coutant <ccoutant@google.com>
5807 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5808 remaining hole size when allocating.
5809 (Layout::make_output_section): Set fill methods for debug sections.
5810 * layout.h (Free_list::Free_list_node): Move from private to
5812 (Free_list::set_min_hole_size): New function.
5813 (Free_list::begin, Free_list::end): New functions.
5814 (Free_list::min_hole_): New data member.
5815 * output.cc: Include dwarf.h.
5816 (Output_fill_debug_info::do_minimum_hole_size): New function.
5817 (Output_fill_debug_info::do_write): New function.
5818 (Output_fill_debug_line::do_minimum_hole_size): New function.
5819 (Output_fill_debug_line::do_write): New function.
5820 (Output_section::Output_section): Initialize new data member.
5821 (Output_section::set_final_data_size): Ensure patch space is larger
5822 than minimum hole size.
5823 (Output_section::do_write): Fill holes in debug sections.
5824 * output.h (Output_fill): New class.
5825 (Output_fill_debug_info): New class.
5826 (Output_fill_debug_line): New class.
5827 (Output_section::set_free_space_fill): New function.
5828 (Output_section::free_space_fill_): New data member.
5829 * testsuite/Makefile.am (incremental_test_3): Add
5830 --incremental-patch option.
5831 (incremental_test_4): Likewise.
5832 (incremental_test_5): Likewise.
5833 (incremental_test_6): Likewise.
5834 (incremental_copy_test): Likewise.
5835 (incremental_common_test_1): Likewise.
5836 * testsuite/Makefile.in: Regenerate.
5838 2011-08-26 Nick Clifton <nickc@redhat.com>
5840 * po/es.po: Updated Spanish translation.
5842 2011-08-01 Cary Coutant <ccoutant@google.com>
5844 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5845 * gold/testsuite/Makefile.in: Regenerate.
5846 * gold/testsuite/justsyms_exec.c: New source file.
5847 * gold/testsuite/justsyms_lib.c: New source file.
5849 2011-08-01 Cary Coutant <ccoutant@google.com>
5851 * layout.cc (Layout::set_segment_offsets): Don't realign text
5852 segment if -Ttext was specified.
5853 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5855 * object.h (Sized_relobj_file::e_type): New function.
5856 (Sized_relobj_file::e_type_): New data member.
5857 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5858 base address for ET_EXEC files.
5859 * target.cc (Target::do_make_elf_object_implementation): Allow
5860 ET_EXEC files with --just-symbols option.
5862 2011-07-28 Cary Coutant <ccoutant@google.com>
5864 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5865 Add thread_number parameter.
5866 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5867 * workqueue-threads.cc
5868 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5869 current thread if its thread number is greater than desired thread
5871 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5872 Add thread_number parameter.
5873 (Workqueue::should_cancel_thread): Likewise.
5874 (Workqueue::find_runnable_or_wait): Pass thread_number to
5875 should_cancel_thread.
5876 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5879 2011-07-22 Sriraman Tallam <tmsriram@google.com>
5881 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5882 only after checking if it cannot be forced local.
5883 * symtab.h (is_externally_visible): Check if the symbol is not forced
5886 2011-07-15 Ian Lance Taylor <iant@google.com>
5888 * options.h (class General_options): Add --print-output-format.
5889 Move -EL next to -EB, for better --help output.
5890 * target-select.cc: Include <cstdio>, "options.h", and
5892 (Target_selector::do_target_bfd_name): New function.
5893 (print_output_format): New function.
5894 * target-select.h (class Target_selector): Update declarations.
5895 (Target_selector::target_bfd_name): New function.
5896 (print_output_format): Declare.
5897 * main.cc: Include "target-select.h".
5898 (main): Handle --print-output-format.
5899 * gold.cc: Include "target-select.h".
5900 (queue_initial_tasks): Handle --print-output-format when there are
5902 * parameters.cc (parameters_force_valid_target): Give a better
5903 error message if -EB/-EL does not match target.
5904 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5907 2011-07-15 Ian Lance Taylor <iant@google.com>
5909 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5910 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5911 (Output_data_plt_i386::do_write): Write address of .dynamic
5912 section to first entry in .got.plt section.
5913 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5914 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5916 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5917 section to first entry in .got.plt section.
5918 * layout.h (Layout::dynamic_section): New function.
5920 2011-07-13 Sriraman Tallam <tmsriram@google.com>
5922 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5924 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5925 input_section_position_, and input_section_glob_.
5926 (read_layout_from_file): Call function section_ordering_specified.
5927 * layout.h (is_section_ordering_specified): New function.
5928 (section_ordering_specified): New function.
5929 (section_ordering_specified_): New boolean member.
5930 * main.cc(main): Call load_plugins after layout object is defined.
5931 * output.cc (Output_section::add_input_section): Use
5932 function section_ordering_specified to check if section ordering is
5934 * output.cc (Output_section::add_relaxed_input_section): Use
5935 function section_ordering_specified to check if section ordering is
5937 (Output_section::update_section_layout): New function.
5938 (Output_section::sort_attached_input_sections): Check if input section
5940 * output.h (Output_section::update_section_layout): New function.
5941 * plugin.cc (get_section_count): New function.
5942 (get_section_type): New function.
5943 (get_section_name): New function.
5944 (get_section_contents): New function.
5945 (update_section_order): New function.
5946 (allow_section_ordering): New function.
5947 (Plugin::load): Add the new interfaces to the transfer vector.
5948 (Plugin_manager::load_plugins): New parameter.
5949 (Plugin_manager::all_symbols_read): New parameter.
5950 (Plugin_manager::claim_file): New parameter. Save the elf object for
5952 (Plugin_manager::get_elf_object): New function.
5953 (Plugin_manager::get_view): Change to directly use the bool to check
5954 if get_view is called from claim_file_hook.
5955 * plugin.h (input_objects): New function
5956 (Plugin__manager::load_plugins): New parameter.
5957 (Plugin_manager::claim_file): New parameter.
5958 (Plugin_manager::get_elf_object): New function.
5959 (Plugin_manager::in_claim_file_handler): New function.
5960 (Plugin_manager::in_claim_file_handler_): New member.
5961 (layout): New function.
5962 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5963 handler with an extra parameter. Make the elf object before calling
5965 * testsuite/plugin_test.c (get_section_count): New function pointer.
5966 (get_section_type): New function pointer.
5967 (get_section_name): New function pointer.
5968 (get_section_contents): New function pointer.
5969 (update_section_order): New function pointer.
5970 (allow_section_ordering): New function pointer.
5971 (onload): Check if the new interfaces exist.
5973 2011-07-13 Ian Lance Taylor <iant@google.com>
5975 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5977 * x86_64.cc (Target_x86_64::got_section): Likewise.
5978 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5979 (relro_now_test_SOURCES): New variable.
5980 (relro_now_test_DEPENDENCIES): New variable.
5981 (relro_now_test_LDFLAGS): New variable.
5982 (relro_now_test_LDADD): New variable.
5983 (relro_now_test.so): New target.
5984 * testsuite/Makefile.in: Rebuild.
5986 2011-07-12 Ian Lance Taylor <iant@google.com>
5989 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5990 GLOB_DAT relocation rather than a RELATIVE relocation for a
5991 protected symbol when creating a shared library.
5992 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5993 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5994 * testsuite/protected_main_1.cc (main): Test that protected
5995 function has same address.
5997 2011-07-11 Ian Lance Taylor <iant@google.com>
6000 * options.h (class General_options): Add -Bgroup.
6001 * options.cc (General_options::finalize): If -Bgroup is set,
6002 default to --unresolved-symbols=report-all.
6003 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6004 * target-reloc.h (issue_undefined_symbol_error): Handle
6005 --unresolved-symbols=report-all.
6007 2011-07-08 Ian Lance Taylor <iant@google.com>
6010 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6011 if linker script discards key sections.
6012 (Layout::create_dynamic_symtab): Likewise.
6013 (Layout::assign_local_dynsym_offsets): Likewise.
6014 (Layout::sized_create_version_sections): Likewise.
6015 (Layout::create_interp): Likewise.
6016 (Layout::finish_dynamic_section): Likewise.
6017 (Layout::set_dynamic_symbol_size): Likewise.
6019 2011-07-08 Ian Lance Taylor <iant@google.com>
6022 * options.h (class General_options): Add --unresolved-symbols.
6023 * target-reloc.h (issue_undefined_symbol_error): Check
6024 --unresolved-symbols. Add comments.
6026 2011-07-08 Ian Lance Taylor <iant@google.com>
6028 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6029 expression more complex.
6031 2011-07-08 Ian Lance Taylor <iant@google.com>
6034 * target-reloc.h (issue_undefined_symbol_error): New inline
6035 function, broken out of relocate_section.
6036 (relocate_section): Call issue_undefined_symbol_error.
6037 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6038 there is no TLS segment if we are about to issue an undefined
6040 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6042 2011-07-08 Ian Lance Taylor <iant@google.com>
6045 * resolve.cc (Symbol_table::should_override): Add fromtype
6046 parameter. Change all callers. Give error when linking together
6047 TLS and non-TLS symbol.
6048 (Symbol_table::should_override_with_special): Add fromtype
6049 parameter. Change all callers.
6050 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6051 there is no TLS segment if we have reported some errors.
6052 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6054 2011-07-08 Ian Lance Taylor <iant@google.com>
6057 * target.h (Target::plt_address_for_global): New function.
6058 (Target::plt_address_for_local): New function.
6059 (Target::plt_section_for_global): Remove.
6060 (Target::plt_section_for_local): Remove.
6061 (Target::do_plt_address_for_global): New virtual function.
6062 (Target::do_plt_address_for_local): New virtual function.
6063 (Target::do_plt_section_for_global): Remove.
6064 (Target::do_plt_section_for_local): Remove.
6065 (Target::register_global_plt_entry): Add Symbol_table and Layout
6067 * output.cc (Output_data_got::Got_entry::write): Use
6068 plt_address_for_global and plt_address_for_local.
6069 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6070 address of output section.
6071 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6072 got_irelative_, and irelative_count_ fields. Update
6074 (Output_data_plt_i386::has_irelative_section): New function.
6075 (Output_data_plt_i386::entry_count): Add irelative_count_.
6076 (Output_data_plt_i386::set_final_data_size): Likewise.
6077 (class Target_i386): Add got_irelative_ and rel_irelative_
6078 fields. Update declarations.
6079 (Target_i386::Target_i386): Initialize new fields.
6080 (Target_i386::do_plt_address_for_global): New function replacing
6081 do_plt_section_for_global.
6082 (Target_i386::do_plt_address_for_local): New function replacing
6083 do_plt_section_for_local.
6084 (Target_i386::got_section): Create got_irelative_.
6085 (Target_i386::rel_irelative_section): New function.
6086 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6087 fields. Don't define __rel_iplt_{start,end}.
6088 (Output_data_plt_i386::add_entry): Add symtab and layout
6089 parameters. Change all callers. Use different PLT and GOT for
6091 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6092 layout parameters. Change all callers. Use different PLT and
6094 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6095 (Output_data_plt_i386::rel_irelative): New function.
6096 (Output_data_plt_i386::address_for_global): New function.
6097 (Output_data_plt_i386::address_for_local): New function.
6098 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6099 IRELATIVE GOT when changing IFUNC GOT entries.
6100 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6102 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6103 if we didn't create an IRELATIVE GOT.
6104 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6105 plt_address_for_local.
6106 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6107 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6108 got_irelative_, and irelative_count_ fields. Update
6110 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6111 Initialize new fields. Remove symtab parameter. Change all
6113 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6115 (Output_data_plt_x86_64::has_irelative_section): New function.
6116 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6117 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6118 fields. Update declarations.
6119 (Target_x86_64::Target_x86_64): Initialize new fields.
6120 (Target_x86_64::do_plt_address_for_global): New function replacing
6121 do_plt_section_for_global.
6122 (Target_x86_64::do_plt_address_for_local): New function replacing
6123 do_plt_section_for_local.
6124 (Target_x86_64::got_section): Create got_irelative_.
6125 (Target_x86_64::rela_irelative_section): New function.
6126 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6127 all callers. Don't create __rel_iplt_{start,end}.
6128 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6129 parameters. Change all callers. Use different PLT and GOT for
6131 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6132 layout parameters. Change all callers. Use different PLT and
6134 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6135 parameters. Change all callers. Use different PLT and GOT for
6137 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6138 (Output_data_plt_x86_64::rela_irelative): New function.
6139 (Output_data_plt_x86_64::address_for_global): New function.
6140 (Output_data_plt_x86_64::address_for_local): New function.
6141 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6142 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6143 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6144 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6146 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6148 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6149 symbols if we didn't create an IRELATIVE GOT.
6150 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6151 plt_address_for_local.
6152 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6153 * testsuite/ifuncvar1.c: New test file.
6154 * testsuite/ifuncvar2.c: New test file.
6155 * testsuite/ifuncvar3.c: New test file.
6156 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6157 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6158 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6159 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6160 * testsuite/Makefile.in: Rebuild.
6162 2011-07-07 Cary Coutant <ccoutant@google.com>
6164 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6165 (two_file_test_1_ndebug.o): Likewise.
6166 (two_file_test_1b_ndebug.o): Likewise.
6167 (two_file_test_2_ndebug.o): Likewise.
6168 (two_file_test_main_ndebug.o): Likewise.
6169 (incremental_test_2): Link with no-debug versions.
6171 2011-07-06 Cary Coutant <ccoutant@google.com>
6173 * gold/incremental.cc
6174 (Output_section_incremental_inputs::write_info_blocks): Check for
6175 hidden and internal symbols.
6177 2011-07-06 Cary Coutant <ccoutant@google.com>
6179 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6180 Check disposition for startup file.
6181 (Incremental_inputs::report_command_line): Ignore
6182 --incremental-startup-unchanged option.
6183 * options.cc (General_options::parse_incremental_startup_unchanged):
6185 (General_options::General_options): Initialize new data member.
6186 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6187 (General_options): Add --incremental-startup-unchanged option.
6188 (General_options::incremental_startup_disposition): New function.
6189 (General_options::incremental_startup_disposition_): New data member.
6191 2011-07-06 Cary Coutant <ccoutant@google.com>
6193 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6194 input file index to Script_info ctor.
6195 (Sized_incremental_binary::do_file_has_changed): Find the
6196 command-line argument for files named in scripts.
6197 * incremental.h (Script_info::Script_info): New ctor
6198 with input file index.
6199 (Script_info::input_file_index): New function.
6200 (Script_info::input_file_index_): New data member.
6201 (Incremental_binary::get_library): Add const.
6202 (Incremental_binary::get_script_info): Add const.
6203 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6204 * testsuite/Makefile.am (incremental_test_5): New test case.
6205 (incremental_test_6): New test case.
6206 * testsuite/Makefile.in: Regenerate.
6208 2011-07-06 Cary Coutant <ccoutant@google.com>
6210 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6211 debug output when command lines differ.
6213 2011-07-06 Cary Coutant <ccoutant@google.com>
6215 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6216 --incremental-patch option.
6217 * layout.cc (Free_list::allocate): Extend allocation beyond original
6219 (Layout::make_output_section): Mark sections that should get
6221 * options.cc (parse_percent): New function.
6222 * options.h (parse_percent): New function.
6223 (DEFINE_percent): New macro.
6224 (General_options): Add --incremental-patch option.
6225 * output.cc (Output_section::Output_section): Initialize new data
6227 (Output_section::add_input_section): Print section name when out
6229 (Output_section::add_output_section_data): Likewise.
6230 (Output_section::set_final_data_size): Add patch space when
6231 doing --incremental-full.
6232 (Output_section::do_reset_address_and_file_offset): Remove patch
6234 (Output_segment::set_section_list_addresses): Print debug output
6235 only if --incremental-update.
6236 * output.h (Output_section::set_is_patch_space_allowed): New function.
6237 (Output_section::is_patch_space_allowed_): New data member.
6238 (Output_section::patch_space_): New data member.
6239 * parameters.cc (Parameters::incremental_full): New function.
6240 * parameters.h (Parameters::incremental_full): New function
6241 * testsuite/Makefile.am (incremental_test_2): Add test for
6242 --incremental-patch option.
6243 * testsuite/Makefile.in: Regenerate.
6244 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6245 (t18): Remove function body.
6247 2011-07-05 Doug Kwan <dougkwan@google.com>
6250 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6251 Arm_Address type for relocation result.
6252 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6254 (Arm_relocate_functions::abs32): Use unaligned access.
6255 (Arm_relocate_functions::rel32): Ditto.
6256 (Arm_relocate_functions::prel31): Ditto.
6257 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6258 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6259 static data relocations.
6260 * testsuite/Makefile.in: Regnerate.
6261 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6263 2011-07-05 Ian Lance Taylor <iant@google.com>
6266 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6267 symbols if necessary.
6268 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6270 2011-07-05 Ian Lance Taylor <iant@google.com>
6273 * resolve.cc (Symbol::override_base_with_special): Simply override
6274 version with special symbol version, ignoring previous version.
6276 2011-07-05 Ian Lance Taylor <iant@google.com>
6278 * object.cc (Sized_relobj_file::include_section_group): Add
6279 information to comment about signature location.
6281 2011-07-02 Ian Lance Taylor <iant@google.com>
6284 * options.h (class General_options): Add -f and -F.
6285 * options.cc (General_options::finalize): Fatal error if -f/-F
6286 are used without -shared.
6287 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6289 2011-07-02 Ian Lance Taylor <iant@google.com>
6291 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6293 2011-07-01 Ian Lance Taylor <iant@google.com>
6297 * resolve.cc (Symbol::override_base_with_special): Don't override
6298 the version if the overriding symbol has a different name.
6299 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6300 all callers. If we give an error about an undefined version,
6301 define the base version if necessary.
6302 * dynobj.h (class Versions): Update declaration.
6303 * testsuite/weak_alias_test_5.cc: New file.
6304 * testsuite/weak_alias_test.script: New file.
6305 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6306 and versioned_alias have the right value, and call t2.
6307 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6308 weak_alias_test_5.so.
6309 (weak_alias_test_LDADD): Likewise.
6310 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6311 * testsuite/Makefile.in: Rebuild.
6313 2011-07-01 Ian Lance Taylor <iant@google.com>
6316 * options.h (class General_options): Support -z notext.
6317 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6319 (two_file_shared_nonpic.so): Likewise.
6320 (two_file_shared_mixed.so): Likewise.
6321 (two_file_shared_mixed_1.so): Likewise.
6322 (weak_undef_lib_nonpic.so): Likewise.
6323 (alt/weak_undef_lib_nonpic.so): Likewise.
6324 (tls_test_shared_nonpic.so): Likewise.
6325 * testsuite/Makefile.in: Rebuild.
6327 2011-07-01 Ian Lance Taylor <iant@google.com>
6330 * configure.ac: Test whether static linking works, setting
6331 the automake conditional HAVE_STATIC.
6332 * testsuite/Makefile.am: Disable tests using -static if
6333 HAVE_STATIC is not true.
6334 * configure, testsuite/Makefile.in: Rebuild.
6336 2011-07-01 Ian Lance Taylor <iant@google.com>
6339 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6340 Assert if we see DW_EH_PE_indirect.
6341 * target.h (Target::ehframe_datarel_base): New function.
6342 (Target::do_ehframe_datarel_base): New target function.
6343 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6344 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6347 2011-07-01 Ian Lance Taylor <iant@google.com>
6350 * options.h (class General_options): Add
6351 --ld-generated-unwind-info.
6352 * ehframe.cc (Fde::write): Add address parameter. Change all
6353 callers. If associated with PLT, fill in address and size.
6354 (Cie::set_output_offset): Only add merge mapping if there is an
6356 (Cie::write): Add address parameter. Change all callers.
6357 (Eh_frame::add_ehframe_for_plt): New function.
6358 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6359 input_offset_ fields into union u_, with new plt field.
6360 (Fde::Fde): Adjust for new union field.
6361 (Fde::Fde) [Output_data version]: New constructor.
6362 (Fde::add_mapping): Only add merge mapping if there is an object.
6363 (class Cie): Update declarations.
6364 (class Eh_frame): Declare add_ehframe_for_plt.
6365 * layout.cc (Layout::layout_eh_frame): Break out code into
6366 make_eh_frame_section, and call it.
6367 (Layout::make_eh_frame_section): New function.
6368 (Layout::add_eh_frame_for_plt): New function.
6369 * layout.h (class Layout): Update declarations.
6370 * merge.cc (Merge_map::add_mapping): Add assertion.
6371 * i386.cc: Include "dwarf.h".
6372 (class Output_data_plt_i386): Make first_plt_entry,
6373 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6374 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6375 and plt_eh_frame_fde.
6376 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6377 boundary. Call add_eh_frame_for_plt if appropriate.
6378 * x86_64.cc: Include "dwarf.h".
6379 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6380 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6381 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6382 and plt_eh_frame_fde.
6383 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6386 2011-06-29 Ian Lance Taylor <iant@google.com>
6389 * object.cc (Sized_relobj_file::layout_section): Change shdr
6390 parameter to be const.
6391 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6393 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6394 appropriate. Call layout_eh_frame_section.
6395 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6397 * object.h (class Sized_relobj_file): Update declarations.
6399 2011-06-29 Ian Lance Taylor <iant@google.com>
6402 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6404 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6406 2011-06-29 Ian Lance Taylor <iant@google.com>
6409 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6411 * layout.cc (Layout::layout_eh_frame): Likewise.
6413 2011-06-29 Ian Lance Taylor <iant@google.com>
6416 * layout.cc (Layout::symtab_section_shndx): New function.
6417 * layout.h (class Layout): Declare symtab_section_shndx.
6418 * output.cc (Output_section::write_header): Call it.
6420 2011-06-29 Ian Lance Taylor <iant@google.com>
6423 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6424 symbols which are not used in a relocation.
6426 2011-06-28 Ian Lance Taylor <iant@google.com>
6429 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6430 script create indistinguishable segments.
6431 (Layout::set_segment_offsets): Use stable_sort when sorting
6432 segments. Pass this to Compare_segments constructor.
6433 * layout.h (class Layout): Make segment_precedes non-static.
6434 (class Compare_segments): Change from struct to class. Add
6435 layout_ field. Add constructor.
6436 * script-sections.cc
6437 (Script_sections::attach_sections_using_phdrs_clause): Rename
6438 local orphan to is_orphan. Don't report failure to put empty
6439 section in segment. On attachment failure, report name of
6440 section, and attach to first PT_LOAD segment.
6442 2011-06-28 Ian Lance Taylor <iant@google.com>
6445 * target-select.cc (Target_selector::Target_selector): Add
6446 emulation parameter. Change all callers.
6447 (select_target_by_bfd_name): Rename from select_target_by_name.
6449 (select_target_by_emulation): New function.
6450 (supported_emulation_names): New function.
6451 * target-select.h (class Target_selector): Add emulation_ field.
6452 Update declarations.
6453 (Target_selector::recognize_by_bfd_name): Rename from
6454 recognize_by_name. Change all callers.
6455 (Target_selector::supported_bfd_names): Rename from
6456 supported_names. Change all callers.
6457 (Target_selector::recognize_by_emulation): New function.
6458 (Target_selector::supported_emulations): New function.
6459 (Target_selector::emulation): New function.
6460 (Target_selector::do_recognize_by_bfd_name): Rename from
6461 do_recognize_by_name. Change all callers.
6462 (Target_selector::do_supported_bfd_names): Rename from
6463 do_supported_names. Change all callers.
6464 (Target_selector::do_recognize_by_emulation): New function.
6465 (Target_selector::do_supported_emulations): New function.
6466 (select_target_by_bfd_name): Change name in declaration.
6467 (select_target_by_emulation): Declare.
6468 (supported_emulation_names): Declare.
6469 * parameters.cc (parameters_force_valid_target): Try to find
6470 target based on emulation from -m option.
6471 * options.h (class General_options): Change doc string for -m.
6472 * options.cc (help): Print emulations.
6473 (General_options::parse_V): Likewise.
6474 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6475 Add emulation parameter. Change all callers.
6477 2011-06-28 Ian Lance Taylor <iant@google.com>
6479 * target.h (class Target): Add osabi_ field.
6480 (Target::osabi): New function.
6481 (Target::set_osabi): New function.
6482 (Target::Target): Initialize osabi_.
6483 (Target::do_adjust_elf_header): Make pure virtual.
6484 (Sized_target::do_adjust_elf_header): Declare.
6485 * target.cc (Sized_target::do_adjust_elf_header): New function.
6486 (class Sized_target): Instantiate all versions.
6487 * freebsd.h (class Target_freebsd): Remove.
6488 (Target_selector_freebsd::do_recognize): Call set_osabi on
6490 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6491 (Target_selector_freebsd::set_osabi): Remove.
6492 * i386.cc (class Target_i386): Inherit from Sized_target rather
6493 than Target_freebsd.
6494 * x86_64.cc (class Target_x86_64): Likewise.
6496 2011-06-28 Ian Lance Taylor <iant@google.com>
6498 * target.h (Target::can_check_for_function_pointers): Rewrite.
6500 (Target::can_icf_inline_merge_sections): Likewise.
6501 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6502 (Target::Target_info): Add can_icf_inline_merge_sections field.
6503 (Target::do_can_check_for_function_pointers): New virtual
6505 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6506 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6507 from can_check_for_function_pointers, move in file.
6508 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6509 section_may_have_icf_unsafe_poineters, move in file.
6510 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6511 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6512 Rename from can_check_for_function_pointers, move in file.
6513 (Target_i386::can_icf_inline_merge_sections): Remove.
6514 (Target_i386::i386_info): Initialize
6515 can_icf_inline_merge_sections.
6516 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6517 Initialize can_icf_inline_merge_sections.
6518 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6519 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6520 Rename from can_check_for_function_pointers, move in file.
6521 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6522 (Target_x86_64::x86_64_info): Initialize
6523 can_icf_inline_merge_sections.
6524 * testsuite/testfile.cc (Target_test::test_target_info):
6526 * icf.cc (get_section_contents): Correct formatting.
6528 2011-06-27 Ian Lance Taylor <iant@google.com>
6530 * symtab.cc (Symbol::versioned_name): New function.
6531 (Symbol_table::add_to_final_symtab): Use versioned_name when
6533 (Symbol_table::sized_write_symbol): Likewise.
6534 * symtab.h (class Symbol): Declare versioned_name.
6535 * stringpool.h (class Stringpool_template): Add variant of add
6536 which takes a std::basic_string.
6537 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6538 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6539 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6540 (ver_test_12.o): New target.
6541 * testsuite/Makefile.in: Rebuild.
6543 2011-06-27 Doug Kwan <dougkwan@google.com>
6545 * arm.cc (Arm_relocate_functions::thm_jump8,
6546 Arm_relocate_functions::thm_jump11): Use a wider signed
6547 type to compute offset.
6548 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6550 * testsuite/Makefile.in: Regenerate.
6551 * testsuite/arm_branch_in_range.sh: Check test results of
6552 arm_thm_jump11 and arm_thm_jump8.
6553 * testsuite/arm_thm_jump11.s: New test source file.
6554 * testsuite/arm_thm_jump11.t: New linker script.
6555 * testsuite/arm_thm_jump8.s: New test source file.
6556 * testsuite/arm_thm_jump8.t: New linker script.
6558 2011-06-24 Ian Lance Taylor <iant@google.com>
6560 * layout.cc: Include "object.h".
6561 (ctors_sections_in_init_array): New static variable.
6562 (Layout::is_ctors_in_init_array): New function.
6563 (Layout::layout): Add entry to ctors_sections_in_init_array if
6565 * layout.h (class Layout): Declare is_ctors_in_init_array.
6566 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6567 is_ctors_reverse_view is set.
6568 (Sized_relobj_file::write_sections): Add layout parameter. Change
6569 all callers. Set is_ctors_reverse_view field of View_size.
6570 (Sized_relobj_file::reverse_words): New function.
6571 * object.h (Sized_relobj_file::View_size): Add
6572 is_ctors_reverse_view field.
6573 (class Sized_relobj_file): Update declarations.
6574 * testsuite/initpri3.c: New test.
6575 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6577 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6578 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6579 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6580 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6581 * testsuite/Makefile.in: Rebuild.
6583 2011-06-24 Cary Coutant <ccoutant@google.com>
6585 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6586 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6587 (debug_msg_cdebug.err): New targets.
6588 * testsuite/Makefile.in: Regenerate.
6589 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6590 Fix checks for link with shared library.
6592 2011-06-24 Doug Kwan <dougkwan@google.com>
6594 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6595 skip empty text sections.
6596 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6598 2011-06-22 Ian Lance Taylor <iant@google.com>
6601 * options.h (class General_options): Add --ctors-in-init-array.
6602 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6603 friends as SHT_PROGBITS for merging sections.
6604 (Layout::layout): Remove special handling of .init_array and
6605 friends. Don't sort if doing relocatable link. Sort for .ctors
6606 and .dtors if ctors_in_init_array.
6607 (Layout::make_output_section): Force correct section types for
6608 .init_array and friends. Don't sort if doing relocatable link,
6609 Don't sort .ctors and .dtors if ctors_in_init_array.
6610 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6611 (Layout::output_section_name): Add relobj parameter. Change all
6612 callers. Handle .ctors. and .dtors. in code rather than table.
6613 Handle .ctors and .dtors if ctors_in_init_array.
6614 (Layout::match_file_name): New function, moved from output.cc.
6615 * layout.h (class Layout): Update declarations.
6616 * output.cc: Include "layout.h".
6617 (Input_section_sort_entry::get_priority): New function.
6618 (Input_section_sort_entry::match_file_name): Just call
6619 Layout::match_file_name.
6620 (Output_section::Input_section_sort_init_fini_compare::operator()):
6621 Handle .ctors and .dtors. Sort by explicit priority rather than
6623 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6624 * testsuite/initpri2.c: New test.
6625 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6626 (check_PROGRAMS): Add initpri2.
6627 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6628 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6629 * configure, testsuite/Makefile.in: Rebuild.
6631 2011-06-19 Ian Lance Taylor <iant@google.com>
6634 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6635 .interp section to a PT_INTERP segment even if we have seen a
6636 --dynamic-linker option. Don't do it if we have seen a PHDRS
6637 clause in a linker script.
6638 (Layout::finalize): Don't create a .interp section if we've
6639 already create a PT_INTERP segment.
6640 (Layout::create_interp): Always call choose_output_section (revert
6641 patch of 2011-06-17). Don't create PT_INTERP segment.
6642 * script-sections.cc
6643 (Script_sections::create_note_and_tls_segments): Add a .interp
6644 section to a PT_INTERP segment even if we have seen a
6645 --dynamic-linker option.
6647 2011-06-18 Ian Lance Taylor <iant@google.com>
6649 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6650 merely because a non-PT_LOAD segment has a dynamic reloc.
6652 2011-06-18 Ian Lance Taylor <iant@google.com>
6654 * layout.cc (Layout::finish_dynamic_section): Don't create
6655 DT_FLAGS entry if not needed.
6657 2011-06-18 Ian Lance Taylor <iant@google.com>
6660 * layout.cc (Layout::layout_eh_frame): Correct handling of
6661 writable .eh_frame section.
6663 2011-06-17 Ian Lance Taylor <iant@google.com>
6666 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6667 symbol is redefined with the exact same object and value.
6669 2011-06-17 Ian Lance Taylor <iant@google.com>
6672 * layout.h (class Layout): Add interp_segment_ field.
6673 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6674 (Layout::attach_allocated_section_to_segment): If making shared
6675 library, put .interp section in PT_INTERP segment.
6676 (Layout::finalize): Also call create_interp if -dynamic-linker
6678 (Layout::create_interp): Assert that there is no PT_INTERP
6679 segment. If not using a SECTIONS clause, use make_output_section.
6680 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6681 * script-sections.cc
6682 (Script_sections::create_note_and_tls_segments): If making shared
6683 library, put .interp section in PT_INTERP segment.
6685 2011-06-17 Ian Lance Taylor <iant@google.com>
6687 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6688 when making a shared library.
6690 2011-06-17 Ian Lance Taylor <iant@google.com>
6692 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6693 parameter. Change all callers. Don't issue warning about PC32
6694 against locally defined symbol.
6696 2011-06-16 Ian Lance Taylor <iant@google.com>
6698 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6699 occurs in same object.
6701 2011-06-14 Alan Modra <amodra@gmail.com>
6703 * po/POTFILES.in: Regenerate.
6705 2011-06-09 Ian Lance Taylor <iant@google.com>
6707 * script-sections.cc
6708 (Orphan_output_section::set_section_addresses): For a relocatable
6709 link set address to 0.
6711 2011-06-09 Cary Coutant <ccoutant@google.com>
6714 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6715 used with --compress-debug-sections.
6716 * gold/object.cc (Sized_relobj_file::do_layout): Report
6717 uncompressed size of compressed input sections.
6719 2011-06-08 Cary Coutant <ccoutant@google.com>
6722 * testsuite/two_file_test_2_v1.cc: Change initialization of
6723 v2 to keep it in .data.
6725 2011-06-07 Cary Coutant <ccoutant@google.com>
6727 * common.cc (Symbol_table::do_allocate_commons_list): Call
6729 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6730 (Errors::fallback): New function.
6731 (gold_fallback): New function.
6732 * errors.h (Errors::fallback): New function.
6733 * gold.cc (gold_exit): Change status parameter to enum; adjust
6735 (queue_initial_tasks): Call gold_fallback.
6736 * gold.h: Include cstdlib.
6737 (Exit_status): New enum type.
6738 (gold_exit): Change status parameter to enum.
6739 (gold_fallback): New function.
6740 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6741 (Layout::create_symtab_sections): Likewise.
6742 (Layout::create_shdrs): Likewise.
6743 * main.cc (main): Adjust call to gold_exit.
6744 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6745 (Output_data_got::add_got_entry_pair): Likewise.
6746 (Output_section::add_input_section): Likewise.
6747 (Output_section::add_output_section_data): Likewise.
6748 (Output_segment::set_section_list_addresses): Likewise.
6749 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6751 2011-06-07 Cary Coutant <ccoutant@google.com>
6753 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6754 for incremental links.
6755 * output.cc (Output_segment::set_section_list_addresses): Remove
6756 FIXME and test for TLS or BSS.
6758 2011-06-07 Cary Coutant <ccoutant@google.com>
6760 * testsuite/Makefile.am: Add incremental_copy_test,
6761 incremental_common_test_1.
6762 * testsuite/Makefile.in: Regenerate.
6763 * testsuite/common_test_1_v1.c: New source file.
6764 * testsuite/common_test_1_v2.c: New source file.
6765 * testsuite/copy_test_v1.cc: New source file.
6767 2011-06-07 Cary Coutant <ccoutant@google.com>
6769 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6770 update, allocate common from bss section's free list.
6771 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6772 linker-defined symbols.
6773 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6774 Skip GOT and PLT entries that are no longer referenced.
6775 (Output_section_incremental_inputs::write_info_blocks): Mark
6776 linker-defined symbols.
6777 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6778 * output.cc (Output_section::allocate): New function.
6779 * output.h (Output_section::allocate): New function.
6780 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6781 linker-defined symbols.
6782 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6783 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6784 (Symbol::init_base_output_data): Likewise.
6785 (Symbol::init_base_output_segment): Likewise.
6786 (Symbol::init_base_constant): Likewise.
6787 (Sized_symbol::init_output_data): Likewise.
6788 (Sized_symbol::init_output_segment): Likewise.
6789 (Sized_symbol::init_constant): Likewise.
6790 (Symbol_table::do_define_in_output_data): Likewise.
6791 (Symbol_table::do_define_in_output_segment): Likewise.
6792 (Symbol_table::do_define_as_constant): Likewise.
6793 * symtab.h (Symbol::is_predefined): New function.
6794 (Symbol::init_base_output_data): Add is_predefined parameter.
6795 (Symbol::init_base_output_segment): Likewise.
6796 (Symbol::init_base_constant): Likewise.
6797 (Symbol::is_predefined_): New data member.
6798 (Sized_symbol::init_output_data): Add is_predefined parameter.
6799 (Sized_symbol::init_output_segment): Likewise.
6800 (Sized_symbol::init_constant): Likewise.
6801 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6803 2011-06-07 Cary Coutant <ccoutant@google.com>
6805 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6806 instead of emit_copy_reloc.
6807 (Copy_relocs::emit_copy_reloc): Refactor.
6808 (Copy_relocs::make_copy_reloc): New function.
6809 (Copy_relocs::add_copy_reloc): Remove.
6810 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6812 (Copy_relocs::make_copy_reloc): New function.
6813 (Copy_relocs::add_copy_reloc): Remove.
6814 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6815 unchanged input files.
6816 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6817 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6818 Reserve BSS space for COPY relocations.
6819 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6820 (Output_section_incremental_inputs::write_info_blocks): Record
6821 whether a symbol is copied from a shared object.
6822 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6823 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6824 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6825 (Incremental_input_entry_reader::get_output_symbol_index): Add
6827 (Incremental_binary::emit_copy_relocs): New function.
6828 (Incremental_binary::do_emit_copy_relocs): New function.
6829 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6831 (Sized_incremental_binary::add_copy_reloc): New function.
6832 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6833 (Sized_incremental_binary::Copy_reloc): New struct.
6834 (Sized_incremental_binary::Copy_relocs): New typedef.
6835 (Sized_incremental_binary::copy_relocs_): New data member.
6836 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6837 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6838 * target.h (Sized_target::emit_copy_reloc): New function.
6839 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6841 2011-06-02 Cary Coutant <ccoutant@google.com>
6844 * gold/archive.cc (Archive::Archive): Initialize new data member.
6845 (Archive::include_all_members): Return if archive has already been
6847 * gold/archive.h (Archive::include_all_members_): New data member.
6849 2011-06-02 Nick Clifton <nickc@redhat.com>
6851 * dynobj.h: Fix spelling mistake in comment.
6852 * output.cc: Likewise.
6854 2011-05-31 Doug Kwan <dougkwan@google.com>
6858 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
6859 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6860 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6861 redundant arm_exidx_test.so.
6862 * testsuite/Makefile.in: Regenerate.
6863 (check_SCRIPTS): Add pr12826.sh
6864 (check_DATA): Add pr12826.stdout
6865 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6866 * testsuite/pr12826.sh: New file.
6867 * testsuite/pr12826_1.s: Ditto.
6868 * testsuite/pr12826_1.s: Ditto.
6870 2011-05-30 Ian Lance Taylor <iant@google.com>
6872 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6875 2011-05-29 Ian Lance Taylor <iant@google.com>
6878 * testsuite/Makefile.am: Use different file name for two_file_test
6879 temporary file for each incremental test.
6880 * testsuite/Makefile.in: Rebuild.
6882 2011-05-29 Ian Lance Taylor <iant@google.com>
6884 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6885 binary input file is empty.
6887 2011-05-27 Ian Lance Taylor <iant@google.com>
6889 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6890 (ver_test_9.so): Likewise.
6891 * testsuite/Makefile.in: Rebuild.
6893 2011-05-26 Cary Coutant <ccoutant@google.com>
6895 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6896 * incremental.cc (Incremental_inputs::report_input_section): Fix
6897 comment, indentation.
6898 (Incremental_inputs::report_comdat_group): New function.
6899 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6900 of data for incremental input file entry.
6901 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6902 group count, COMDAT group signatures.
6903 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6904 an unchanged input file.
6905 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6906 Initialize new data member.
6907 (Incremental_object_entry::add_comdat_group): New function.
6908 (Incremental_object_entry::get_comdat_group_count): New function.
6909 (Incremental_object_entry::get_comdat_signature_key): New function.
6910 (Incremental_object_entry::groups_): New data member.
6911 (Incremental_inputs::report_comdat_group): New function.
6912 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6913 data for incremental input file entry.
6914 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6915 (Incremental_input_entry_reader::get_input_section): Adjust size of
6916 data for incremental input file entry.
6917 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6918 (Incremental_input_entry_reader::get_comdat_group_signature): New
6920 * object.cc (Sized_relobj::include_section_group): Report kept
6921 COMDAT groups for incremental links.
6923 2011-05-24 David Meyer <pdox@google.com>
6925 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6926 with name parameter. Add found_name parameter.
6927 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6928 * dirsearch.h (class Dirsearch): Update declaration.
6930 2011-05-24 Ian Lance Taylor <iant@google.com>
6932 * archive.cc (Library_base::should_include_member): Pull in object
6933 from archive if it defines the entry symbol.
6934 * parameters.cc (Parameters::entry): New function.
6935 * parameters.h (class Parameters): Declare entry.
6936 * output.h (class Output_file_header): Remove entry_ field.
6937 * output.cc (Output_file_header::Output_file_header): Remove entry
6938 parameter. Change all callers.
6939 (Output_file_header::entry): Use parameters->entry.
6940 * gold.cc (queue_middle_tasks): Likewise.
6941 * plugin.cc (Plugin_hook::run): Likewise.
6943 2011-05-24 Cary Coutant <ccoutant@google.com>
6945 * gold.cc (queue_initial_tasks): Pass incremental base filename
6946 to Output_file::open_base_file; don't print error message.
6947 * incremental-dump.cc (main): Adjust call to
6948 Output_file::open_for_modification.
6949 * incremental-dump.cc (main): Likewise.
6950 * incremental.cc (Incremental_inputs::report_command_line):
6951 Ignore --incremental-base option when comparing command lines.
6952 Ignore parameter when given as separate argument.
6953 * options.h (class General_options): Add --incremental-base.
6954 * output.cc (Output_file::Output_file):
6955 (Output_file::open_base_file): Add base_name and writable parameters;
6956 read base file into new file; print error message here.
6957 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6959 * output.h (Output_file::open_for_modification): Rename to...
6960 (Output_file::open_base_file): ...this; add base_name and
6961 writable parameters; adjust all callers.
6962 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6964 * testsuite/Makefile.am (incremental_test_4): Test
6966 * testsuite/Makefile.in: Regenerate.
6968 2011-05-24 Cary Coutant <ccoutant@google.com>
6970 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6972 * testsuite/Makefile.in: Regenerate.
6973 * testsuite/two_file_test_1_v1.cc: New test source file.
6974 * testsuite/two_file_test_1b_v1.cc: New test source file.
6975 * testsuite/two_file_test_2_v1.cc: New test source file.
6977 2011-05-24 Cary Coutant <ccoutant@google.com>
6979 * dynobj.h (Dynobj::do_dynobj): New function.
6980 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6981 flag and soname for shared objects.
6982 * incremental.cc (Incremental_inputs::report_object): Make
6983 either Incremental_object_entry or Incremental_dynobj_entry; add
6984 soname to string table.
6985 (Incremental_inputs::report_input_section): Add assertion.
6986 (Output_section_incremental_inputs::set_final_data_size): Adjust
6987 type of input file entry for shared libraries; adjust size of
6988 shared library info entry.
6989 (Output_section_incremental_inputs::write_input_files): Write
6990 as_needed flag for shared libraries.
6991 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6992 of input file entry for shared libraries; write soname.
6993 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6994 soname from incremental info.
6995 * incremental.h (enum Incremental_input_flags): Add
6996 INCREMENTAL_INPUT_AS_NEEDED.
6997 (Incremental_input_entry::Incremental_input_entry): Initialize new
6999 (Incremental_input_entry::set_as_needed): New function.
7000 (Incremental_input_entry::as_needed): New function.
7001 (Incremental_input_entry::do_dynobj_entry): New function.
7002 (Incremental_input_entry::as_needed_): New data member.
7003 (Incremental_object_entry::Incremental_object_entry): Don't check
7005 (Incremental_object_entry::do_type): Likewise.
7006 (class Incremental_dynobj_entry): New class.
7007 (Incremental_input_entry_reader::as_needed): New function.
7008 (Incremental_input_entry_reader::get_soname): New function.
7009 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7010 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7011 size of shared library info entry.
7012 * layout.cc (Layout::finish_dynamic_section): Don't test for
7013 incremental link when adding DT_NEEDED entries.
7014 * object.h (Object::Object): Initialize new data member.
7015 (Object::dynobj): New function.
7016 (Object::set_as_needed): New function.
7017 (Object::as_needed): New function.
7018 (Object::do_dynobj): New function.
7019 (Object::as_needed_): New data member.
7021 2011-05-24 Cary Coutant <ccoutant@google.com>
7023 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7024 info; adjust display of GOT entries.
7025 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7026 vector of input objects; remove file_status_.
7027 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7028 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7029 got_plt reader; call target hooks to reserve GOT entries.
7030 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7031 of input file info header and GOT info entry.
7032 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7034 (Got_plt_view_info::got_descriptor): Remove.
7035 (Got_plt_view_info::sym_index): New data member.
7036 (Got_plt_view_info::input_index): New data member.
7037 (Local_got_offset_visitor::visit): Write input file index.
7038 (Global_got_offset_visitor::visit): Write 0 for input file index.
7039 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7040 with sym_index and input_index.
7041 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7042 incremental info GOT entry; replace got_descriptor with input_index.
7043 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7044 map from input file index to object.
7045 (Sized_relobj_incr::do_layout): Replace direct data member reference
7046 with accessor function.
7047 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7048 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7049 Adjust size of input file info header.
7050 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7051 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7052 (Incremental_input_entry_reader::get_input_section): Adjust size of
7053 input file info header.
7054 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7055 of incremental info GOT entry.
7056 (Incremental_got_plt_reader::get_got_desc): Remove.
7057 (Incremental_got_plt_reader::get_got_symndx): New function.
7058 (Incremental_got_plt_reader::get_got_input_index): New function.
7059 (Sized_incremental_binary::Sized_incremental_binary): Remove
7060 file_status_; add input_objects_.
7061 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7062 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7063 (Sized_incremental_binary::file_is_unchanged): Remove.
7064 (Sized_incremental_binary::set_input_object): New function.
7065 (Sized_incremental_binary::input_object): New function.
7066 (Sized_incremental_binary::file_status_): Remove.
7067 (Sized_incremental_binary::input_objects_): New data member.
7068 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7070 (Sized_relobj_incr::invalid_address): Move to base class.
7071 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7073 (Sized_relobj_incr::do_output_section_offset): Likewise.
7074 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7075 (Sized_relobj_incr::section_offsets_): Likewise.
7076 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7078 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7079 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7080 with accessor function.
7081 (Sized_relobj_file::do_layout): Likewise.
7082 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7083 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7084 (Sized_relobj_file::compute_final_local_value): Replace refs to
7085 section_offsets_ with accessor function.
7086 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7087 * object.h (Relobj::Relobj): Initialize new data members.
7088 (Relobj::add_dyn_reloc): New function.
7089 (Relobj::first_dyn_reloc): New function.
7090 (Relobj::dyn_reloc_count): New function.
7091 (Relobj::first_dyn_reloc_): New data member.
7092 (Relobj::dyn_reloc_count_): New data member.
7093 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7095 (Sized_relobj::Address): New typedef.
7096 (Sized_relobj::invalid_address): Move here from child class.
7097 (Sized_relobj::Sized_relobj): Initialize new data members.
7098 (Sized_relobj::sized_relobj): New function.
7099 (Sized_relobj::is_output_section_offset_invalid): Move here from
7101 (Sized_relobj::get_output_section_offset): Likewise.
7102 (Sized_relobj::local_has_got_offset): Likewise.
7103 (Sized_relobj::local_got_offset): Likewise.
7104 (Sized_relobj::set_local_got_offset): Likewise.
7105 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7106 (Sized_relobj::clear_got_offsets): New function.
7107 (Sized_relobj::section_offsets): Move here from child class.
7108 (Sized_relobj::do_output_section_offset): Likewise.
7109 (Sized_relobj::do_set_section_offset): Likewise.
7110 (Sized_relobj::Local_got_offsets): Likewise.
7111 (Sized_relobj::local_got_offsets_): Likewise.
7112 (Sized_relobj::section_offsets_): Likewise.
7113 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7115 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7117 (Sized_relobj_file::sized_relobj): New function
7118 (Sized_relobj_file::local_has_got_offset): Move to base class.
7119 (Sized_relobj_file::local_got_offset): Likewise.
7120 (Sized_relobj_file::set_local_got_offset): Likewise.
7121 (Sized_relobj_file::get_output_section_offset): Likewise.
7122 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7123 (Sized_relobj_file::do_output_section_offset): Likewise.
7124 (Sized_relobj_file::do_set_section_offset): Likewise.
7125 (Sized_relobj_file::Local_got_offsets): Likewise.
7126 (Sized_relobj_file::local_got_offsets_): Likewise.
7127 (Sized_relobj_file::section_offsets_): Likewise.
7128 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7130 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7131 (Output_reloc::get_symbol_index): Likewise.
7132 (Output_reloc::local_section_offset): Likewise.
7133 (Output_reloc::get_address): Likewise.
7134 (Output_reloc::symbol_value): Likewise.
7135 (Output_data_got::reserve_slot): Move to class definition.
7136 (Output_data_got::reserve_local): New function.
7137 (Output_data_got::reserve_slot_for_global): Remove.
7138 (Output_data_got::reserve_global): New function.
7139 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7140 (all constructors, two instantiations).
7141 (Output_reloc::get_relobj): New function (two instantiations).
7142 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7143 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7144 (Output_data_reloc::add_global): Adjust type of relobj.
7145 (Output_data_reloc::add_global_relative): Likewise.
7146 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7147 (Output_data_reloc::add_local): Likewise.
7148 (Output_data_reloc::add_local_relative): Likewise.
7149 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7150 (Output_data_reloc::add_local_section): Likewise.
7151 (Output_data_reloc::add_output_section): Likewise.
7152 (Output_data_reloc::add_absolute): Likewise.
7153 (Output_data_reloc::add_target_specific): Likewise.
7154 (Output_data_got::reserve_slot): Move definition here.
7155 (Output_data_got::reserve_local): New function.
7156 (Output_data_got::reserve_global): New function.
7157 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7158 section_offsets_ with accessor function.
7159 (Sized_relobj_file::write_sections): Likewise.
7160 (Sized_relobj_file::do_relocate_sections): Likewise.
7161 * target.h (Sized_target::reserve_local_got_entry): New function.
7162 (Sized_target::reserve_global_got_entry): New function.
7163 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7164 (Target_x86_64::reserve_global_got_entry): New function.
7165 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7167 2011-05-23 Cary Coutant <ccoutant@google.com>
7169 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7170 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7171 bit when checking got_type.
7172 * incremental.cc (Sized_incremental_binary::setup_readers):
7173 Store symbol table and string table locations; initialize bit vector
7174 of file status flags.
7175 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7177 (Sized_incremental_binary::do_process_got_plt): New function.
7178 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7179 (Output_section_incremental_inputs::set_final_data_size): Record
7180 file index for each input file.
7181 (Output_section_incremental_inputs::write_got_plt): Store file index
7182 instead of input entry offset for each GOT entry.
7184 (Incremental_input_entry::Incremental_input_entry): Initialize new
7186 (Incremental_input_entry::set_offset): Store file index.
7187 (Incremental_input_entry::get_file_index): New function.
7188 (Incremental_input_entry::file_index_): New data member.
7189 (Incremental_binary::process_got_plt): New function.
7190 (Incremental_binary::do_process_got_plt): New function.
7191 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7193 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7194 (Sized_incremental_binary::set_file_is_unchanged): New function.
7195 (Sized_incremental_binary::file_is_unchanged): New function.
7196 (Sized_incremental_binary::do_process_got_plt): New function.
7197 (Sized_incremental_binary::file_status_): New data member.
7198 (Sized_incremental_binary::main_symtab_loc_): New data member.
7199 (Sized_incremental_binary::main_strtab_loc_): New data member.
7200 * output.cc (Output_data_got::Got_entry::write): Add case
7202 (Output_data_got::add_global): Call add_got_entry.
7203 (Output_data_got::add_global_plt): Likewise.
7204 (Output_data_got::add_global_with_rel): Likewise.
7205 (Output_data_got::add_global_with_rela): Likewise.
7206 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7207 (Output_data_got::add_global_pair_with_rela): Likewise.
7208 (Output_data_got::add_local): Call add_got_entry.
7209 (Output_data_got::add_local_plt): Likewise.
7210 (Output_data_got::add_local_with_rel): Likewise.
7211 (Output_data_got::add_local_with_rela): Likewise.
7212 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7213 (Output_data_got::add_local_pair_with_rela): Likewise.
7214 (Output_data_got::reserve_slot): New function.
7215 (Output_data_got::reserve_slot_for_global): New function.
7216 (Output_data_got::add_got_entry): New function.
7217 (Output_data_got::add_got_entry_pair): New function.
7218 (Output_section::add_output_section_data): Edit FIXME.
7220 (Output_section_data_build::Output_section_data_build): New
7221 constructor with size parameter.
7222 (Output_data_space::Output_data_space): Likewise.
7223 (Output_data_got::Output_data_got): Initialize new data member; new
7224 constructor with size parameter.
7225 (Output_data_got::add_constant): Call add_got_entry.
7226 (Output_data_got::reserve_slot): New function.
7227 (Output_data_got::reserve_slot_for_global): New function.
7228 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7229 (Output_data_got::add_got_entry): New function.
7230 (Output_data_got::add_got_entry_pair): New function.
7231 (Output_data_got::free_list_): New data member.
7232 * target.h (Sized_target::init_got_plt_for_update): New function.
7233 (Sized_target::register_global_plt_entry): New function.
7234 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7235 Initialize new data member; call init; add constructor with PLT count.
7236 (Output_data_plt_x86_64::init): New function.
7237 (Output_data_plt_x86_64::add_relocation): New function.
7238 (Output_data_plt_x86_64::reserve_slot): New function.
7239 (Output_data_plt_x86_64::free_list_): New data member.
7240 (Target_x86_64::init_got_plt_for_update): New function.
7241 (Target_x86_64::register_global_plt_entry): New function.
7242 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7243 incremental updates.
7244 (Output_data_plt_x86_64::add_relocation): New function.
7245 * testsuite/object_unittest.cc (Object_test): Set default options.
7247 2011-05-16 Ian Lance Taylor <iant@google.com>
7249 * options.h (class General_options): Make -i a synonym for -r.
7251 2011-05-16 Ian Lance Taylor <iant@google.com>
7253 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7255 2011-05-10 Cary Coutant <ccoutant@google.com>
7257 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7260 2011-05-06 Ian Lance Taylor <iant@google.com>
7262 * layout.cc (Layout::layout): If the output section flags change,
7263 update the ordering.
7265 2011-04-25 Cary Coutant <ccoutant@google.com>
7267 * incremental-dump.cc (dump_incremental_inputs): Print local
7268 symbol info for each input file.
7270 (Output_section_incremental_inputs::set_final_data_size): Add local
7271 symbol info to input file entries in incremental info.
7272 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7273 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7274 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7275 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7277 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7278 (Sized_incr_relobj::do_relocate): Write the local symbols.
7279 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7280 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7281 Adjust size of input file header.
7282 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7283 (Incremental_inputs_reader::get_local_symbol_count): New function.
7284 (Incremental_inputs_reader::get_input_section): Adjust size of input
7286 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7287 (Sized_incr_relobj::This): New typedef.
7288 (Sized_incr_relobj::sym_size): New const data member.
7289 (Sized_incr_relobj::Local_symbol): New struct.
7290 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7291 (Sized_incr_relobj::do_local_symbol_offset): New function.
7292 (Sized_incr_relobj::local_symbol_count_): New data member.
7293 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7294 (Sized_incr_relobj::local_symbol_index_): New data member.
7295 (Sized_incr_relobj::local_symbol_offset_): New data member.
7296 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7297 (Sized_incr_relobj::local_symbols_): New data member.
7298 * object.h (Relobj::output_local_symbol_count): New function.
7299 (Relobj::local_symbol_offset): New function.
7300 (Relobj::do_output_local_symbol_count): New function.
7301 (Relobj::do_local_symbol_offset): New function.
7302 (Sized_relobj::do_output_local_symbol_count): New function.
7303 (Sized_relobj::do_local_symbol_offset): New function.
7305 2011-04-22 Vladimir Simonov <sv@sw.ru>
7307 * descriptors.cc (set_close_on_exec): New function.
7308 (Descriptors::open): Use set_close_on_exec.
7309 * output.cc (S_ISLNK): Define if not defined.
7311 2011-04-22 Cary Coutant <ccoutant@google.com>
7313 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7315 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7316 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7317 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7319 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7320 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7321 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7323 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7325 (Incremental_binary::apply_incremental_relocs): New function.
7326 (Incremental_binary::do_apply_incremental_relocs): New function.
7327 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7329 (Sized_incremental_binary::add_global_symbol): New function.
7330 (Sized_incremental_binary::global_symbol): New function.
7331 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7332 (Sized_incremental_binary::symbol_map_): New data member.
7333 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7334 * target.h (Sized_target::apply_relocation): New function.
7335 * target-reloc.h (apply_relocation): New function.
7336 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7338 2011-04-22 Doug Kwan <dougkwan@google.com>
7340 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7341 flag of a SHT_ARM_EXIDX section.
7342 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7343 * testsuite/Makefile.in: Regenerate.
7344 * testsuite/arm_exidx_test.s: New file.
7345 * testsuite/arm_exidx_test.sh: Same.
7347 2011-04-20 Cary Coutant <ccoutant@google.com>
7350 * archive.h (Incremental_archive_entry::Archive_member):
7351 Initialize arg_serial_ (second constructor).
7353 2011-04-17 Ian Lance Taylor <iant@google.com>
7355 * object.cc (Relocate_info::location): Simplify location string.
7356 * errors.cc (Errors::error_at_location): Don't print program
7358 (Errors::warning_at_location): Likewise.
7359 (Errors::undefined_symbol): Likewise.
7360 * testsuite/debug_msg.sh: Update accordingly.
7362 2011-04-14 Cary Coutant <ccoutant@google.com>
7364 * gold/layout.cc (Layout::symtab_section_offset): New function.
7365 * gold/layout.h (Layout::symtab_section_offset): New function.
7366 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7368 2011-04-12 Ian Lance Taylor <iant@google.com>
7370 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7371 with MREMAP_MAYMOVE.
7372 * output.h (class Output_file): Add map_is_allocated_ field.
7373 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7374 not available, provide stubs. If mremap is not available, #define
7376 (MREMAP_MAYMOVE): Define if not defined.
7377 (Output_file::Output_file): Initialize map_is_allocated_.
7378 (Output_file::resize): Check map_is_allocated_.
7379 (Output_file::map_anonymous): If mmap fails, use malloc.
7380 (Output_file::unmap): Don't do anything for an anonymous map.
7381 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7382 is not available, provide stubs.
7383 (File_read::View::~View): Use free rather than delete[].
7384 (File_read::make_view): Use malloc rather than new[]. If mmap
7386 (File_read::find_or_make_view): Use malloc rather than new[].
7387 * gold.h: Remove HAVE_REMAP code.
7388 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7389 exists. Rename mremap to gold_mremap. If mmap is not available
7391 * configure, config.in: Rebuild.
7393 2011-04-11 Ian Lance Taylor <iant@google.com>
7395 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7396 initialize local variable v.
7398 2011-04-11 Cary Coutant <ccoutant@google.com>
7400 * archive.cc (Archive::include_member): Adjust call to
7402 (Add_archive_symbols::run): Track argument serial numbers.
7403 (Lib_group::include_member): Likewise.
7404 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7405 * archive.h (Incremental_archive_entry::Archive_member):
7406 Initialize arg_serial_.
7407 (Archive_member::arg_serial_): New data member.
7408 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7409 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7411 (Sized_dynobj::do_for_all_local_got_entries): New function.
7412 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7414 * fileread.cc (get_mtime): New function.
7415 * fileread.h (get_mtime): New function.
7416 * gold.cc (queue_initial_tasks): Check for incremental update.
7417 (process_incremental_input): New function.
7418 (queue_middle_tasks): Don't force valid target for incremental
7420 * incremental-dump.cc (find_input_containing_global): Adjust
7421 size of symbol info entry.
7422 (dump_incremental_inputs): Dump argument serial number and
7423 in_system_directory flag; bias shndx by 1; print symbol names
7424 when dumping per-file symbol lists; use new symbol info readers.
7426 (Output_section_incremental_inputs:update_data_size): New function.
7427 (Sized_incremental_binary::setup_readers): Setup input readers
7428 for each input file; build maps for files added from libraries
7430 (Sized_incremental_binary::check_input_args): New function.
7431 (Sized_incremental_binary::do_check_inputs): Build map of argument
7432 serial numbers to input arguments.
7433 (Sized_incremental_binary::do_file_has_changed): Rename
7434 do_file_is_unchanged to this; compare file modification times.
7435 (Sized_incremental_binary::do_init_layout): New function.
7436 (Sized_incremental_binary::do_reserve_layout): New function.
7437 (Sized_incremental_binary::do_get_input_reader): Remove.
7438 (Sized_incremental_binary::get_symtab_view): New function.
7439 (Incremental_checker::can_incrementally_link_output_file): Remove.
7440 (Incremental_inputs::report_command_line): Exclude --debug options.
7441 (Incremental_inputs::report_archive_begin): Add parameter; track
7442 argument serial numbers; don't put input file entry for archive
7443 before archive members.
7444 (Incremental_inputs::report_archive_end): Put input file entry
7445 for archive after archive members.
7446 (Incremental_inputs::report_object): Add parameter; track argument
7447 serial numbers and in_system_directory flag.
7448 (Incremental_inputs::report_script): Add parameter; track argument
7450 (Output_section_incremental_inputs::set_final_data_size): Adjust
7451 size of symbol info entry; check for forwarding symbols.
7452 (Output_section_incremental_inputs::write_input_files): Write
7453 in_system_directory flag and argument serial number.
7454 (Output_section_incremental_inputs::write_info_blocks): Map section
7455 indices between incremental info and original input file; store
7456 input section index for each symbol.
7457 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7458 change operator() to visit().
7459 (class Global_got_offset_visitor): Likewise.
7460 (class Global_symbol_visitor_got_plt):
7461 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7463 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7464 (Sized_incr_relobj::do_read_symbols): New function.
7465 (Sized_incr_relobj::do_layout): New function.
7466 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7467 (Sized_incr_relobj::do_add_symbols): New function.
7468 (Sized_incr_relobj::do_should_include_member): New function.
7469 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7470 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7471 (Sized_incr_relobj::do_section_size): New function.
7472 (Sized_incr_relobj::do_section_name): New function.
7473 (Sized_incr_relobj::do_section_contents): New function.
7474 (Sized_incr_relobj::do_section_flags): New function.
7475 (Sized_incr_relobj::do_section_entsize): New function.
7476 (Sized_incr_relobj::do_section_address): New function.
7477 (Sized_incr_relobj::do_section_type): New function.
7478 (Sized_incr_relobj::do_section_link): New function.
7479 (Sized_incr_relobj::do_section_info): New function.
7480 (Sized_incr_relobj::do_section_addralign): New function.
7481 (Sized_incr_relobj::do_initialize_xindex): New function.
7482 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7483 (Sized_incr_relobj::do_read_relocs): New function.
7484 (Sized_incr_relobj::do_gc_process_relocs): New function.
7485 (Sized_incr_relobj::do_scan_relocs): New function.
7486 (Sized_incr_relobj::do_count_local_symbols): New function.
7487 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7488 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7489 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7490 (Sized_incr_relobj::do_relocate): New function.
7491 (Sized_incr_relobj::do_set_section_offset): New function.
7492 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7493 (Sized_incr_dynobj::do_read_symbols): New function.
7494 (Sized_incr_dynobj::do_layout): New function.
7495 (Sized_incr_dynobj::do_add_symbols): New function.
7496 (Sized_incr_dynobj::do_should_include_member): New function.
7497 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7498 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7499 (Sized_incr_dynobj::do_section_size): New function.
7500 (Sized_incr_dynobj::do_section_name): New function.
7501 (Sized_incr_dynobj::do_section_contents): New function.
7502 (Sized_incr_dynobj::do_section_flags): New function.
7503 (Sized_incr_dynobj::do_section_entsize): New function.
7504 (Sized_incr_dynobj::do_section_address): New function.
7505 (Sized_incr_dynobj::do_section_type): New function.
7506 (Sized_incr_dynobj::do_section_link): New function.
7507 (Sized_incr_dynobj::do_section_info): New function.
7508 (Sized_incr_dynobj::do_section_addralign): New function.
7509 (Sized_incr_dynobj::do_initialize_xindex): New function.
7510 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7511 (make_sized_incremental_object): New function.
7512 (Incremental_library::copy_unused_symbols): New function.
7513 (Incremental_library::do_for_all_unused_symbols): New function.
7514 * incremental.h (enum Incremental_input_flags): New type.
7515 (class Incremental_checker): Remove.
7516 (Incremental_input_entry::Incremental_input_entry): Add argument
7518 (Incremental_input_entry::arg_serial): New function.
7519 (Incremental_input_entry::set_is_in_system_directory): New function.
7520 (Incremental_input_entry::is_in_system_directory): New function.
7521 (Incremental_input_entry::arg_serial_): New data member.
7522 (Incremental_input_entry::is_in_system_directory_): New data member.
7523 (class Script_info): Move here from script.h.
7524 (Script_info::Script_info): Add filename parameter.
7525 (Script_info::filename): New function.
7526 (Script_info::filename_): New data member.
7527 (Incremental_script_entry::Incremental_script_entry): Add argument
7529 (Incremental_object_entry::Incremental_object_entry): Likewise.
7530 (Incremental_object_entry::add_input_section): Build list of input
7531 sections with map to original shndx.
7532 (Incremental_object_entry::get_input_section_index): New function.
7533 (Incremental_object_entry::shndx_): New data member.
7534 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7535 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7536 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7538 (Incremental_inputs::report_archive_begin): Likewise.
7539 (Incremental_inputs::report_object): Likewise.
7540 (Incremental_inputs::report_script): Likewise.
7541 (class Incremental_global_symbol_reader): New class.
7542 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7543 and store flags and input file type.
7544 (Incremental_input_entry_reader::arg_serial): New function.
7545 (Incremental_input_entry_reader::type): Extract type from flags.
7546 (Incremental_input_entry_reader::is_in_system_directory): New function.
7547 (Incremental_input_entry_reader::get_input_section_count): Call
7548 accessor function for type.
7549 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7550 function for type; adjust size of global symbol entry.
7551 (Incremental_input_entry_reader::get_global_symbol_count): Call
7552 accessor function for type.
7553 (Incremental_input_entry_reader::get_object_count): Likewise.
7554 (Incremental_input_entry_reader::get_object_offset): Likewise.
7555 (Incremental_input_entry_reader::get_member_count): Likewise.
7556 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7557 (Incremental_input_entry_reader::get_member_offset): Likewise.
7558 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7559 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7560 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7561 (Incremental_input_entry_reader::get_global_symbol_reader): New
7563 (Incremental_input_entry_reader::get_output_symbol_index): New
7565 (Incremental_input_entry_reader::type_): Remove.
7566 (Incremental_input_entry_reader::flags_): New data member.
7567 (Incremental_inputs_reader::input_file_offset): New function.
7568 (Incremental_inputs_reader::input_file_index): New function.
7569 (Incremental_inputs_reader::input_file): Call input_file_offset.
7570 (Incremental_inputs_reader::input_file_at_offset): New function.
7571 (Incremental_relocs_reader::get_r_type): Reformat.
7572 (Incremental_relocs_reader::get_r_shndx): Reformat.
7573 (Incremental_relocs_reader::get_r_offset): Reformat.
7574 (Incremental_relocs_reader::data): New function.
7575 (Incremental_binary::Incremental_binary): Initialize new data members.
7576 (Incremental_binary::check_inputs): Add cmdline parameter.
7577 (Incremental_binary::file_is_unchanged): Remove.
7578 (Input_reader::arg_serial): New function.
7579 (Input_reader::get_unused_symbol_count): New function.
7580 (Input_reader::get_unused_symbol): New function.
7581 (Input_reader::do_arg_serial): New function.
7582 (Input_reader::do_get_unused_symbol_count): New function.
7583 (Input_reader::do_get_unused_symbol): New function.
7584 (Incremental_binary::input_file_count): New function.
7585 (Incremental_binary::get_input_reader): Change signature to use
7586 index instead of filename.
7587 (Incremental_binary::file_has_changed): New function.
7588 (Incremental_binary::get_input_argument): New function.
7589 (Incremental_binary::get_library): New function.
7590 (Incremental_binary::get_script_info): New function.
7591 (Incremental_binary::init_layout): New function.
7592 (Incremental_binary::reserve_layout): New function.
7593 (Incremental_binary::output_file): New function.
7594 (Incremental_binary::do_check_inputs): New function.
7595 (Incremental_binary::do_file_is_unchanged): Remove.
7596 (Incremental_binary::do_file_has_changed): New function.
7597 (Incremental_binary::do_init_layout): New function.
7598 (Incremental_binary::do_reserve_layout): New function.
7599 (Incremental_binary::do_input_file_count): New function.
7600 (Incremental_binary::do_get_input_reader): Change signature.
7601 (Incremental_binary::input_args_map_): New data member.
7602 (Incremental_binary::library_map_): New data member.
7603 (Incremental_binary::script_map_): New data member.
7604 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7606 (Sized_incremental_binary::output_section): New function.
7607 (Sized_incremental_binary::inputs_reader): Add const.
7608 (Sized_incremental_binary::symtab_reader): Add const.
7609 (Sized_incremental_binary::relocs_reader): Add const.
7610 (Sized_incremental_binary::got_plt_reader): Add const.
7611 (Sized_incremental_binary::get_symtab_view): New function.
7612 (Sized_incremental_binary::Inputs_reader): New typedef.
7613 (Sized_incremental_binary::Input_entry_reader): New typedef.
7614 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7615 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7616 (Sized_incremental_binary::do_file_has_changed): New function.
7617 (Sized_incremental_binary::do_init_layout): New function.
7618 (Sized_incremental_binary::do_reserve_layout): New function.
7619 (Sized_input_reader::Inputs_reader): Remove.
7620 (Sized_input_reader::Input_entry_reader): Remove.
7621 (Sized_input_reader::do_arg_serial): New function.
7622 (Sized_input_reader::do_get_unused_symbol_count): New function.
7623 (Sized_input_reader::do_get_unused_symbol): New function.
7624 (Sized_incremental_binary::do_input_file_count): New function.
7625 (Sized_incremental_binary::do_get_input_reader): Change signature;
7626 use index instead of filename.
7627 (Sized_incremental_binary::section_map_): New data member.
7628 (Sized_incremental_binary::input_entry_readers_): New data member.
7629 (class Sized_incr_relobj): New class.
7630 (class Sized_incr_dynobj): New class.
7631 (make_sized_incremental_object): New function.
7632 (class Incremental_library): New class.
7633 * layout.cc (Free_list::num_lists): New static data member.
7634 (Free_list::num_nodes): New static data member.
7635 (Free_list::num_removes): New static data member.
7636 (Free_list::num_remove_visits): New static data member.
7637 (Free_list::num_allocates): New static data member.
7638 (Free_list::num_allocate_visits): New static data member.
7639 (Free_list::init): New function.
7640 (Free_list::remove): New function.
7641 (Free_list::allocate): New function.
7642 (Free_list::dump): New function.
7643 (Free_list::print_stats): New function.
7644 (Layout_task_runner::run): Resize output file for incremental updates.
7645 (Layout::Layout): Initialize new data members.
7646 (Layout::set_incremental_base): New function.
7647 (Layout::init_fixed_output_section): New function.
7648 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7649 incremental updates.
7650 (Layout::create_gold_note): Do not create gold note section for
7651 incremental updates.
7652 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7653 for incremental updates.
7654 (Layout::set_section_offsets): For incremental updates, allocate space
7656 (Layout::create_symtab_sections): Layout with offsets relative to
7657 start of section; for incremental updates, allocate space from free
7659 (Layout::create_shdrs): For incremental updates, allocate space from
7661 (Layout::finish_dynamic_section): For incremental updates, do not
7662 check --as-needed (fixed in subsequent patch).
7663 * layout.h (class Free_list): New class.
7664 (Layout::set_incremental_base): New function.
7665 (Layout::incremental_base): New function.
7666 (Layout::init_fixed_output_section): New function.
7667 (Layout::allocate): New function.
7668 (Layout::incremental_base_): New data member.
7669 (Layout::free_list_): New data member.
7670 * main.cc (main): Print Free_list statistics.
7671 * object.cc (Relobj::finalize_incremental_relocs): Add
7672 clear_counts parameter; clear counts only when clear_counts is set.
7673 (Sized_relobj::Sized_relobj): Initialize new base class.
7674 (Sized_relobj::do_layout): Don't report special sections.
7675 (Sized_relobj::do_for_all_local_got_entries): New function.
7676 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7677 symtab_off to all symbol table offsets.
7678 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7679 * object.h (class Got_offset_list): Move to top of file.
7680 (Object::Object): Allow case where input_file == NULL.
7681 (Object::~Object): Likewise.
7682 (Object::input_file): Assert that input_file != NULL.
7683 (Object::lock): Allow case where input_file == NULL.
7684 (Object::unlock): Likewise.
7685 (Object::is_locked): Likewise.
7686 (Object::token): Likewise.
7687 (Object::release): Likewise.
7688 (Object::is_incremental): New function.
7689 (Object::get_mtime): New function.
7690 (Object::for_all_local_got_entries): New function.
7691 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7692 (Object::set_is_in_system_directory): New function.
7693 (Object::is_in_system_directory): New function.
7694 (Object::do_is_incremental): New function.
7695 (Object::do_get_mtime): New function.
7696 (Object::do_for_all_local_got_entries): New function.
7697 (Object::is_in_system_directory_): New data member.
7698 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7699 (class Sized_relobj_base): New class.
7700 (class Sized_relobj): Derive from Sized_relobj_base.
7701 (class Sized_relobj::Symbols): Redeclare from base class.
7702 (class Sized_relobj::local_got_offset_list): Remove.
7703 (class Sized_relobj::Output_sections): Redeclare from base class.
7704 (class Sized_relobj::do_for_all_local_got_entries): New function.
7705 (class Sized_relobj::write_local_symbols): Add offset parameter.
7706 (class Sized_relobj::local_symbol_offset_): Update comment.
7707 (class Sized_relobj::local_dynsym_offset_): Update comment.
7708 * options.cc (Input_arguments::add_file): Remove const.
7709 * options.h (Input_file_argument::Input_file_argument):
7710 Initialize arg_serial_ (all constructors).
7711 (Input_file_argument::set_arg_serial): New function.
7712 (Input_file_argument::arg_serial): New function.
7713 (Input_file_argument::arg_serial_): New data member.
7714 (Input_arguments::Input_arguments): Initialize file_count_.
7715 (Input_arguments::add_file): Remove const.
7716 (Input_arguments::number_of_input_files): New function.
7717 (Input_arguments::file_count_): New data member.
7718 (Command_line::number_of_input_files): Call
7719 Input_arguments::number_of_input_files.
7720 * output.cc (Output_segment_headers::Output_segment_headers):
7722 (Output_section::Input_section::current_data_size): New function.
7723 (Output_section::Output_section): Initialize new data members.
7724 (Output_section::add_input_section): Don't do merge sections for
7725 an incremental link; allocate space from free list for an
7727 (Output_section::add_output_section_data): Allocate space from
7728 free list for an incremental update.
7729 (Output_section::update_data_size): New function.
7730 (Output_section::set_fixed_layout): New function.
7731 (Output_section::reserve): New function.
7732 (Output_segment::set_section_addresses): Remove const.
7733 (Output_segment::set_section_list_addresses): Remove const; allocate
7734 space from free list for an incremental update.
7735 (Output_segment::set_offset): Adjust size of RELRO segment for an
7737 * output.h (Output_data::current_data_size): Move here from
7739 (Output_data::pre_finalize_data_size): New function.
7740 (Output_data::update_data_size): New function.
7741 (Output_section_headers::update_data_size): new function.
7742 (Output_section_data_build::current_data_size): Move to Output_data.
7743 (Output_data_strtab::update_data_size): New function.
7744 (Output_section::current_data_size): Move to Output_data.
7745 (Output_section::set_fixed_layout): New function.
7746 (Output_section::has_fixed_layout): New function.
7747 (Output_section::reserve): New function.
7748 (Output_section::update_data_size): New function.
7749 (Output_section::has_fixed_layout_): New data member.
7750 (Output_section::free_list_): New data member.
7751 (Output_segment::set_section_addresses): Remove const.
7752 (Output_segment::set_section_list_addresses): Remove const.
7753 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7755 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7757 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7758 parameter when calling Add_symbols constructor; store argument
7759 serial number for members of a lib group.
7760 (Add_symbols::locks): Allow case where token == NULL.
7761 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7762 (Read_member::~Read_member): New function.
7763 (Read_member::is_runnable): New function.
7764 (Read_member::locks): New function.
7765 (Read_member::run): New function.
7766 (Check_script::~Check_script): New function.
7767 (Check_script::is_runnable): New function.
7768 (Check_script::locks): New function.
7769 (Check_script::run): New function.
7770 (Check_library::~Check_library): New function.
7771 (Check_library::is_runnable): New function.
7772 (Check_library::locks): New function.
7773 (Check_library::run): New function.
7774 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7775 (Add_symbols::library_): New data member.
7776 (class Read_member): New class.
7777 (class Check_script): New class.
7778 (class Check_library): New class.
7779 * reloc.cc (Read_relocs::is_runnable): Allow case where
7781 (Read_relocs::locks): Likewise.
7782 (Scan_relocs::locks): Likewise.
7783 (Relocate_task::locks): Likewise.
7784 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7786 (Sized_relobj::incremental_relocs_scan): Fix comment.
7787 (Sized_relobj::do_relocate): Pass output file offset to
7788 write_local_symbols.
7789 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7790 from class declaration.
7791 * script.cc (read_input_script): Allocate Script_info; pass
7792 argument serial number to report_script.
7793 * script.h (class Script_info): Move to incremental.h.
7794 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7795 * symtab.h (Symbol_table::add_from_incrobj): New function.
7796 (Symbol_table::set_file_offset): New function.
7798 2011-04-05 Cary Coutant <ccoutant@google.com>
7800 * incremental-dump.cc (dump_incremental_inputs): Change signature
7801 to take a Sized_incremental_binary; change caller. Use readers
7802 in Sized_incremental_binary.
7804 (Sized_incremental_binary::find_incremental_inputs_sections):
7805 Rename do_find_incremental_inputs_sections to this.
7806 (Sized_incremental_binary::setup_readers): New function.
7807 (Sized_incremental_binary::do_check_inputs): Check
7808 has_incremental_info_ flag; move setup code to setup_readers;
7810 (Sized_incremental_binary::do_file_is_unchanged): New function.
7811 (Sized_incremental_binary::do_get_input_reader): New function.
7812 * incremental.h (class Incremental_binary): Move to end of file.
7813 (Incremental_binary::file_is_unchanged): New function.
7814 (Incremental_binary::do_file_is_unchanged): New function.
7815 (Incremental_binary::Input_reader): New class.
7816 (Incremental_binary::get_input_reader): New function.
7817 (class Sized_incremental_binary): Move to end of file.
7818 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7819 input section reader classes.
7820 (Sized_incremental_binary::has_incremental_info): New function.
7821 (Sized_incremental_binary::inputs_reader): New function.
7822 (Sized_incremental_binary::symtab_reader): New function.
7823 (Sized_incremental_binary::relocs_reader): New function.
7824 (Sized_incremental_binary::got_plt_reader): New function.
7825 (Sized_incremental_binary::do_file_is_unchanged): New function.
7826 (Sized_incremental_binary::Sized_input_reader): New class.
7827 (Sized_incremental_binary::get_input_reader): New function.
7828 (Sized_incremental_binary::find_incremental_inputs_sections):
7829 Rename do_find_incremental_inputs_sections to this.
7830 (Sized_incremental_binary::setup_readers): New function.
7831 (Sized_incremental_binary::has_incremental_info_): New data member.
7832 (Sized_incremental_binary::inputs_reader_): New data member.
7833 (Sized_incremental_binary::symtab_reader_): New data member.
7834 (Sized_incremental_binary::relocs_reader_): New data member.
7835 (Sized_incremental_binary::got_plt_reader_): New data member.
7836 (Sized_incremental_binary::current_input_file_): New data member.
7838 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7841 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7844 2011-03-30 Cary Coutant <ccoutant@google.com>
7846 * archive.cc (Archive::include_member): Adjust call to report_object.
7847 (Add_archive_symbols::run): Add script_info to call to
7848 report_archive_begin.
7849 (Lib_group::include_member): Adjust call to report_object.
7850 (Add_lib_group_symbols::run): Adjust call to report_object.
7851 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7852 blocks. Add object count for script input files.
7853 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7854 script_info parameter; change all callers.
7855 (Incremental_inputs::report_object): Add script_info parameter;
7857 (Incremental_inputs::report_script): Store backpointer to
7858 incremental info entry.
7859 (Output_section_incremental_inputs::set_final_data_size): Record
7860 additional information for scripts.
7861 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7862 * incremental.h (Incremental_script_entry::add_object): New function.
7863 (Incremental_script_entry::get_object_count): New function.
7864 (Incremental_script_entry::get_object): New function.
7865 (Incremental_script_entry::objects_): New data member; adjust
7867 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7868 (Incremental_inputs::report_object): Add script_info parameter.
7869 (Incremental_inputs_reader::get_object_count): New function.
7870 (Incremental_inputs_reader::get_object_offset): New function.
7871 * options.cc (Input_arguments::add_file): Return reference to
7873 * options.h (Input_argument::set_script_info): New function.
7874 (Input_argument::script_info): New function.
7875 (Input_argument::script_info_): New data member; adjust all
7877 (Input_file_group::add_file): Return reference to new input argument.
7878 (Input_file_lib::add_file): Likewise.
7879 (Input_arguments::add_file): Likewise.
7880 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7881 * script.cc (Parser_closure::Parser_closure): Add script_info
7882 parameter; adjust all callers.
7883 (Parser_closure::script_info): New function.
7884 (Parser_closure::script_info_): New data member.
7885 (read_input_script): Report scripts earlier to incremental info.
7886 (script_add_file): Set script_info in Input_argument.
7887 (script_add_library): Likewise.
7888 * script.h (Script_options::Script_info): Rewrite class.
7890 2011-03-29 Cary Coutant <ccoutant@google.com>
7892 * archive.cc (Library_base::should_include_member): Move
7893 method here from class Archive.
7894 (Archive::Archive): Initialize base class.
7895 (Archive::should_include_member): Move to base class.
7896 (Archive::do_for_all_unused_symbols): New function.
7897 (Add_archive_symbols::run): Remove redundant access to
7899 (Lib_group::Lib_group): Initialize base class.
7900 (Lib_group::do_filename): New function.
7901 (Lib_group::include_member): Pass pointer to Lib_group to
7903 (Lib_group::do_for_all_unused_symbols): New function.
7904 (Add_lib_group_symbols::run): Report archive information for
7906 * archive.h (class Library_base): New base class.
7907 (class Archive): Derive from Library_base.
7908 (Archive::filename): Move to base class.
7909 (Archive::set_incremental_info): Likewise.
7910 (Archive::incremental_info): Likewise.
7911 (Archive::Should_include): Likewise.
7912 (Archive::should_include_member): Likewise.
7913 (Archive::Armap_entry): Remove.
7914 (Archive::Unused_symbol_iterator): Remove.
7915 (Archive::unused_symbols_begin): Remove.
7916 (Archive::unused_symbols_end): Remove.
7917 (Archive::do_filename): New function.
7918 (Archive::do_get_mtime): New function.
7919 (Archive::do_for_all_unused_symbols): New function.
7920 (Archive::task_): Move to base class.
7921 (Archive::incremental_info_): Likewise.
7922 (class Lib_group): Derive from Library_base.
7923 (Lib_group::do_filename): New function.
7924 (Lib_group::do_get_mtime): New function.
7925 (Lib_group::do_for_all_unused_symbols): New function.
7926 (Lib_group::task_): Move to base class.
7927 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7929 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7931 * incremental.cc (Incremental_inputs::report_archive_begin):
7932 Use Library_base; call library's get_mtime; add incremental inputs
7933 entry before members.
7934 (class Unused_symbol_visitor): New class.
7935 (Incremental_inputs::report_archive_end): Use Library_base; use
7936 visitor class to record unused symbols; don't add incremental inputs
7937 entry after members.
7938 (Incremental_inputs::report_object): Use Library_base.
7940 (Incremental_archive_entry::Incremental_archive_entry): Remove
7941 unused Archive parameter.
7942 (Incremental_inputs::report_archive_begin): Use Library_base.
7943 (Incremental_inputs::report_archive_end): Likewise.
7944 (Incremental_inputs::report_object): Likewise.
7945 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7947 * object.h (Object::for_all_global_symbols): New function.
7948 (Object::do_for_all_global_symbols): New function.
7949 (Sized_relobj::do_for_all_global_symbols): New function.
7950 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7952 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7955 2011-03-27 Ian Lance Taylor <iant@google.com>
7957 * archive.cc (Archive::interpret_header): Return -1 if something
7958 goes wrong. Change callers accordingly.
7960 2011-03-25 Cary Coutant <ccoutant@google.com>
7962 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7963 * testsuite/Makefile.in: Regenerate.
7965 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
7967 * plugin.cc (get_view): New.
7968 (Plugin::load): Pass get_view to the plugin.
7969 (Plugin_manager::get_view): New.
7971 2011-03-21 Ian Lance Taylor <iant@google.com>
7973 * testsuite/final_layout.sh: Rewrite to not use dc.
7974 * testsuite/relro_test.sh: Fail if dc is not present.
7976 2011-03-21 Sriraman Tallam <tmsriram@google.com>
7978 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7980 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7981 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7983 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7984 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7986 2011-03-14 Ian Lance Taylor <iant@google.com>
7988 * script-sections.cc (Sort_output_sections::script_compare):
7989 Rename from is_before, change return type.
7990 (Sort_output_sections::operator()): Adjust accordingly.
7992 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7995 * testsuite/odr_violation2.cc: Add comment to make all error line
7996 numbers double digits.
7997 * testsuite/debug_msg.sh: Adjust expected errors.
7999 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8001 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8002 but mark earlier ones as non-canonical
8003 (offset_to_iterator): Update search target and example
8004 (do_addr2line): Return extra lines in a vector*
8005 (format_file_lineno): Extract from do_addr2line
8006 (one_addr2line): Add vector* out-param
8007 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8008 when a lineno entry appeared last for its instruction
8009 (Dwarf_line_info): Add vector* out-param
8010 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8011 * symtab.cc (Odr_violation_compare): Include the lineno in the
8013 (linenos_from_loc): New. Combine the canonical line for an
8014 address with its other lines.
8015 (True_if_intersect): New. Helper functor to make
8016 std::set_intersection a query.
8017 (detect_odr_violations): Compare sets of lines instead of just
8018 one line for each function. This became less deterministic, but
8019 has fewer false positives.
8020 * symtab.h: Declarations.
8021 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8022 mix an optimized and non-optimized object in the same binary
8023 (odr_violation2.so): Same.
8024 * testsuite/Makefile.in: Regenerate from Makefile.am.
8025 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8026 * testsuite/debug_msg.sh: Update line numbers and add
8028 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8029 non-optimized context.
8030 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8031 isn't inlined, and use OdrDerived in an optimized context.
8032 * testsuite/odr_header1.h: Defines OdrDerived, where
8033 optimization will change the
8034 first-instruction-in-the-destructor's file and line number.
8035 * testsuite/odr_header2.h: Defines OdrBase.
8037 2011-03-09 Ian Lance Taylor <iant@google.com>
8039 * fileread.cc (File_read::clear_views): Don't delete the whole
8042 2011-03-08 Ian Lance Taylor <iant@google.com>
8045 * fileread.cc: #include <climits>.
8046 (GOLD_IOV_MAX): Define.
8047 (File_read::read_multiple): Limit number of entries by iov_max.
8048 * fileread.h (class File_read): Always set max_readv_entries to
8051 2011-03-07 Ian Lance Taylor <iant@google.com>
8054 * options.h (class General_options): Add -dy and -dn.
8056 2011-03-02 Cary Coutant <ccoutant@google.com>
8058 * testsuite/script_test_9.t: Add TLS segment.
8060 2011-03-02 Simon Baldwin <simonb@google.com>
8062 * configure.ac: Add check for gnu_indirect_function support in
8063 the toolchain building binutils.
8064 * configure: Rebuild.
8066 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
8068 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8069 plugin only symbols.
8070 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8071 in plugin files as not needed in the symbol table.
8073 2011-02-11 Sriraman Tallam <tmsriram@google.com>
8075 * output.cc (Output_section::add_input_section): Delay fill
8076 generation for section ordering.
8078 2011-02-09 Ian Lance Taylor <iant@google.com>
8081 * object.h (class Sized_relobj): Remove clear_local_symbols.
8082 * reloc.cc (Sized_relobj::do_relocate): Don't call
8083 clear_local_symbols.
8085 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
8087 * plugin.cc (is_visible_from_outside): Return true for symbols
8090 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8092 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8095 2011-02-02 Sriraman Tallam <tmsriram@google.com>
8097 * icf.h (is_section_foldable_candidate): Change type of parameter
8099 * icf.cc (Icf::find_identical_sections): Change type of local variable
8100 section_name to be std::string.
8101 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8103 2011-01-25 Ian Lance Taylor <iant@google.com>
8105 * script.cc (script_add_extern): Rewrite to use
8106 add_symbol_reference.
8108 2011-01-25 Doug Kwan <dougkwan@google.com>
8110 * icf.cc (get_section_contents): Always lock section's object.
8112 2011-01-24 Ian Lance Taylor <iant@google.com>
8114 * options.h (class General_options): Accept
8115 --no-detect-odr-violations.
8117 2011-01-24 Ian Lance Taylor <iant@google.com>
8119 * version.cc (version_string): Bump to 1.11.
8121 2011-01-24 Ian Lance Taylor <iant@google.com>
8123 * plugin.cc (class Plugin_rescan): Define new class.
8124 (Plugin_manager::claim_file): Set any_claimed_.
8125 (Plugin_manager::save_archive): New function.
8126 (Plugin_manager::save_input_group): New function.
8127 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8129 (Plugin_manager::new_undefined_symbol): New function.
8130 (Plugin_manager::rescan): New function.
8131 (Plugin_manager::rescannable_defines): New function.
8132 (Plugin_manager::add_input_file): Set any_added_.
8133 * plugin.h (class Plugin_manager): define new fields rescannable_,
8134 undefined_symbols_, any_claimed_, and any_added_. Declare
8135 Plugin_rescan as friend. Declare new functions.
8136 (Plugin_manager::Rescannable): Define type.
8137 (Plugin_manager::Rescannable_list): Define type.
8138 (Plugin_manager::Undefined_symbol_list): Define type.
8139 (Plugin_manager::Plugin_manager): Initialize new fields.
8140 * archive.cc (Archive::defines_symbol): New function.
8141 (Add_archive_symbols::run): Pass archive to plugins if any.
8142 * archive.h (class Archive): Declare defines_symbol.
8143 * readsyms.cc (Input_group::~Input_group): New function.
8144 (Finish_group::run): Pass input_group to plugins if any.
8145 * readsyms.h (class Input_group): Declare destructor.
8146 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8149 2011-01-10 Ian Lance Taylor <iant@google.com>
8151 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8153 (Layout::set_segment_offsets): Reset increase_relro before calling
8154 set_section_addresses a second time.
8156 2011-01-04 Cary Coutant <ccoutant@google.com>
8158 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8159 sections before NOBITS sections.
8161 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8163 * version.cc (print_version): Update copyright to 2011.
8165 2010-12-23 Cary Coutant <ccoutant@google.com>
8167 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8168 of OS to this->add. Add OD parameter to second form of the function.
8170 2010-12-20 Ian Lance Taylor <iant@google.com>
8172 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8173 second of two consecutive entries with same offset.
8175 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8177 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8178 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8179 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8180 to avoid unneeded links against $(LDADD).
8181 * testsuite/Makefile.in: Regenerate.
8183 2010-12-15 Ian Lance Taylor <iant@google.com>
8186 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8187 for R_X86_64_32 and R_X86_64_PC32.
8188 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8189 ver_matching_def_pic.o.
8190 (ver_matching_def_pic.o): New target.
8192 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8194 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8195 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8196 Move definition before File_read::View member definitions.
8197 (File_read::View::~View): Initialize and hold lock before
8198 updating current_mapped_bytes.
8200 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8202 * dwarf_reader.cc: Remove outdated comment.
8203 * gold-threads.cc: Fix typo in error message.
8204 * archive.cc: Fix typos in comments.
8205 * archive.h: Likewise.
8206 * arm-reloc-property.cc: Likewise.
8207 * arm-reloc-property.h: Likewise.
8208 * arm-reloc.def: Likewise.
8210 * attributes.h: Likewise.
8211 * cref.cc: Likewise.
8212 * ehframe.cc: Likewise.
8213 * fileread.h: Likewise.
8215 * i386.cc: Likewise.
8217 * incremental.h: Likewise.
8218 * int_encoding.cc: Likewise.
8219 * layout.h: Likewise.
8220 * main.cc: Likewise.
8221 * merge.h: Likewise.
8222 * object.cc: Likewise.
8223 * object.h: Likewise.
8224 * options.cc: Likewise.
8225 * readsyms.cc: Likewise.
8226 * reduced_debug_output.cc: Likewise.
8227 * reloc.cc: Likewise.
8228 * script-sections.cc: Likewise.
8229 * sparc.cc: Likewise.
8230 * symtab.h: Likewise.
8231 * target-reloc.h: Likewise.
8232 * target.cc: Likewise.
8233 * target.h: Likewise.
8234 * timer.cc: Likewise.
8235 * timer.h: Likewise.
8236 * x86_64.cc: Likewise.
8238 2010-12-09 Cary Coutant <ccoutant@google.com>
8240 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8242 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8243 parameter; change all callers.
8244 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8245 * options.h (warn_execstack): New option.
8247 2010-12-07 Doug Kwan <dougkwan@google.com>
8249 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8250 like function call relocations.
8252 2010-12-07 Ian Lance Taylor <iant@google.com>
8254 * archive.cc (Archive::get_elf_object_for_member): Permit
8255 punconfigured to be NULL.
8256 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8257 (Archive::include_member): Pass NULL to get_elf_object_for_member
8258 if we searched for the archive and this is the first included
8261 2010-12-01 Ian Lance Taylor <iant@google.com>
8263 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8264 track_relocs_type_ field.
8265 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8266 Set track_relocs_type_.
8267 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8268 contents when using RELA relocs.
8269 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8271 * reloc.cc (Track_relocs::next_addend): New function.
8272 * reloc.h (class Track_relocs): Declare next_addend.
8274 2010-12-01 Ian Lance Taylor <iant@google.com>
8276 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8279 2010-12-01 Ian Lance Taylor <iant@google.com>
8281 * README: Update compilers known to work and fail.
8283 2010-11-23 Matthias Klose <doko@ubuntu.com>
8285 * configure.in: For --enable-gold, handle value `default' instead of
8286 `both*'. Always install ld as ld.bfd, install as ld if gold is
8288 * configure: Regenerate.
8290 2010-11-18 Doug Kwan <dougkwan@google.com>
8292 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8293 and right_alignment to be zero. Store result alignment only if it is
8294 greater than existing alignment.
8296 2010-11-16 Cary Coutant <ccoutant@google.com>
8299 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8300 Check for ".zdebug_line".
8302 2010-11-16 Doug Kwan <dougkwan@google.com>
8303 Cary Coutant <ccoutant@google.com>
8305 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8306 by reference; adjust all callers.
8307 * output.cc (Output_segment::set_section_addresses): Adjust references
8308 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8310 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8311 end at page boundary.
8313 2010-11-16 Cary Coutant <ccoutant@google.com>
8316 * layout.cc (Layout::choose_output_section): Transform names of
8317 compressed sections even when using a script with a SECTIONS clause.
8318 (Layout::output_section_name): Remove code to transform
8319 compressed debug section names.
8320 * output.cc (Output_section::add_input_section): Use uncompressed
8321 section size when tracking input sections.
8323 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8325 * symtab.h (Symbol::NON_PIC_REF): Remove.
8326 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8327 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8328 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8329 (Symbol::use_plt_offset): Take a flags argument and pass it
8330 directly to needs_dynamic_reloc. Restrict check for undefined
8331 weak symbols to function calls.
8332 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8333 (Target_arm::Scan::global): Use it.
8334 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8335 (Target_arm::Relocate::relocate): Likewise.
8336 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8337 parameter with an r_type parameter. Use get_reference_flags
8339 (Target_arm::Relocate::relocate): Update accordingly.
8340 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8341 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8342 (Target_i386::Scan::global): Likewise.
8343 (Target_i386::Relocate::relocate): Likewise.
8344 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8345 parameter with an r_type parameter. Use get_reference_flags
8347 (Target_i386::Relocate::relocate): Update accordingly.
8348 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8349 (Target_powerpc::Scan::global): Use it.
8350 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8351 (Target_powerpc::Relocate::relocate): Likewise.
8352 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8353 (Target_sparc::Scan::global): Use it.
8354 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8355 (Target_sparc::Relocate::relocate): Likewise.
8356 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8357 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8358 (Target_x86_64::Scan::global): Likewise.
8359 (Target_x86_64::Relocate::relocate): Likewise.
8361 2010-11-08 Doug Kwan <dougkwan@google.com>
8362 Cary Coutant <ccoutant@google.com>
8364 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8365 (Arm_exidx_merge_section::section_contents_): New data member.
8366 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8367 (Arm_input_section::~Arm_input_section): De-allocate memory.
8368 (Arm_input_section::original_contents_): New data member.
8369 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8370 in parameters instead of calling Object::section_contents without
8372 (Arm_output_section::group_section): New parameter TASK. Pass it
8373 to callees that need locking objects.
8374 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8375 to lock EXIDX input sections. Fix a formatting issue. Call
8376 Arm_exidx_merged_section::build_contents to create merged section
8378 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8379 to lock object of stub table owner.
8380 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8381 TEXT_SIZE to initialize data member TEXT_SIZE_.
8382 (Arm_exidx_input_section::addralign): Fix typo in comment.
8383 (Arm_exidx_input_section::text_size): New method.
8384 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8385 that require locking objects. Lock objects before scanning for stubs
8386 and updating local symbols.
8387 (Arm_input_section<big_endian>::init): Copy contents of original
8389 (Arm_input_section<big_endian>::do_write): Use saved contents of
8390 original input section instead of calling Object::section_contents
8392 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8393 size without calling Object::section_size().
8394 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8395 for size. Allocate a buffer for merged EXIDX entries.
8396 (Arm_exidx_merged_section::build_contents): New method.
8397 (Arm_exidx_merged_section::do_write): Move merge section contents
8398 building code to Arm_exidx_merged_section::build_contetns. Write
8399 out contetns in buffer instead of building it on the fly.
8400 (Arm_relobj::make_exidx_input_section): Also pass text section size
8401 to Arm_exidx_input_section constructor.
8402 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8403 (Arm_dynobj::do_read_symbols): Fix memory leak.
8404 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8405 * target.h: (class Task): Add forward declaration.
8406 (Target::relax): Add new parameter TASK and pass it to
8408 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8410 2010-11-05 Cary Coutant <ccoutant@google.com>
8413 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8414 object when reading from the file.
8415 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8417 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8418 when reading section contents.
8419 (get_section_contents): Likewise.
8420 (icf::find_identical_sections): Likewise.
8421 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8422 object when reading from the file.
8423 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8424 the object when doing deferred section layout.
8426 2010-11-03 Nick Clifton <nickc@redhat.com>
8429 * script.h (class Symbol_assignment: name): New member. Returns
8430 the name of the symbol.
8431 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8432 Returns true if the given symbol name is on the list of
8433 assignments wating to be processed.
8434 * archive.cc (should_incldue_member): If the symbol is undefined,
8435 check to see if it is on the list of symbols pending assignment.
8437 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8439 * script-sections.cc (Script_sections::find_memory_region): Check
8440 for a NULL output section pointer.
8442 2010-10-29 Doug Kwan <dougkwan@google.com>
8444 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8445 Output_section::add_relaxed_input_section.
8446 * output.cc (Output_section::add_relaxed_input_section): Add new
8447 arguments LAYOUT and NAME. Set section order index.
8448 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8449 Copy section order index.
8450 * output.h (Output_section::add_relaxed_input_section): Add new
8451 arguments LAYOUT and NAME.
8453 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8455 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8456 NATIVE_OR_CROSS_LINKER.
8457 * testsuite/Makefile.in: Regenerate.
8459 2010-10-20 Doug Kwan <dougkwan@google.com>
8461 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8462 without SHF_LINK_ORDER flags.
8463 * layout.cc (Layout::choose_output_section): Do not filter
8464 SHF_LINK_ORDER flag in a relocatable link.
8466 2010-10-17 Cary Coutant <ccoutant@google.com>
8468 * output.h (Output_segment::set_section_addresses): Change function
8469 signature. Update all callers.
8470 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8472 (Output_segment::set_section_addresses): Align after last TLS
8473 section. Add padding before last relro section instead of after.
8475 2010-10-17 Doug Kwan <dougkwan@google.com>
8477 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8478 GOT output section to be writable.
8480 2010-10-14 Cary Coutant <ccoutant@google.com>
8482 * debug.h (DEBUG_INCREMENTAL): New flag.
8483 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8484 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8486 * incremental.cc (report_command_line): Ignore all forms of
8488 * layout.cc (Layout::Layout): Check parameters for incremental link
8490 * options.cc (General_options::parse_incremental): New function.
8491 (General_options::parse_no_incremental): New function.
8492 (General_options::parse_incremental_full): New function.
8493 (General_options::parse_incremental_update): New function.
8494 (General_options::incremental_mode_): New data member.
8495 (General_options::finalize): Check incremental_mode_.
8496 * options.h (General_options): Update help text for --incremental.
8497 Add --no-incremental, --incremental-full, --incremental-update.
8498 (General_options::Incremental_mode): New enum type.
8499 (General_options::incremental_mode): New function.
8500 (General_options::incremental_mode_): New data member.
8501 * parameters.cc (Parameters::incremental_mode_): New data member.
8502 (Parameters::set_options): Set incremental_mode_.
8503 (Parameters::set_incremental_full): New function.
8504 (Parameters::incremental): New function.
8505 (Parameters::incremental_update): New function.
8506 (set_parameters_incremental_full): New function.
8507 * parameters.h (Parameters::set_incremental_full): New function.
8508 (Parameters::incremental): New function.
8509 (Parameters::incremental_update): New function.
8510 (Parameters::incremental_mode_): New data member.
8511 (set_parameters_incremental_full): New function.
8512 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8513 incremental link mode.
8514 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8515 (Sized_relobj::do_relocate_sections): Likewise.
8516 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8518 * testsuite/Makefile.in: Regenerate.
8519 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8521 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8523 * script-sections.h (class Script_sections): Make
8524 Sections_elements typedef public.
8525 * script-sections.cc (class Sort_output_sections): Add elements_
8526 field. Add constructor which sets it; change all callers.
8527 (Sort_output_sections::is_before): New function.
8528 (Sort_output_sections::operator()): Call is_before.
8529 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8531 * testsuite/script_test_10.sh: New test. Test script section
8533 * testsuite/script_test_10.t: Likewise.
8534 * testsuite/script_test_10.s: Likewise.
8535 * testsuite/Makefile.am: Wrap the cross linker tests and the
8536 common tests into NATIVE_OR_CROSS_LINKER.
8537 (check_SCRIPTS): Add script_test_10.sh.
8538 (check_DATA): Add script_test_10.stdout.
8539 (script_test_10.o, script_test_10): New targets.
8540 (script_test_10.stdout): New target.
8541 * configure, testsuite/Makefile.in: Regenerate.
8543 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8545 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8546 error for the deprecated relocations.
8547 (Target_arm::Scan::global): Likewise.
8548 (Target_arm::Relocate::relocate): Likewise.
8550 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8552 * fileread.cc (Input_file::find_file): Initialize *found_name
8553 and *namep when using the fallback search for case 4.
8555 2010-10-11 Cary Coutant <ccoutant@google.com>
8557 * options.h (class General_options): Redefine -z lazy as an alias for
8558 the negation of -z now.
8560 2010-10-11 Ian Lance Taylor <iant@google.com>
8562 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8565 2010-10-06 Nick Clifton <nickc@redhat.com>
8567 * script-sections.cc(class Memory_region): Remove
8568 current_lma_offset_ field. Rename current_vma_offset_ to
8569 current_offset_. Add last_section_ field.
8570 (Memory_region::get_current_vma_address): Rename to
8571 get_current_address.
8572 (Memory_region::get_current_lma_address): Delete.
8573 (Memory_region::increment_vma_offset): Rename to
8575 (Memory_region::increment_lma_offset): Delete.
8576 (Memory_region::attributes_compatible): New method. Returns
8577 true if the provided section is compatible with the region.
8578 (Memory_region::get_last_section): New method. Returns the last
8579 section to use the region.
8580 (Memory_region::set_last_section): New method. Stores the last
8581 section to use the region.
8582 (Script_sections::block_in_region): New method. Returns true if
8583 a block of memory is contained within a region.
8584 (Script_sections::find_memory_region): New method. Locates a
8585 memory region to be used to set a VMA or LMA address.
8586 (Output_section_definition::set_section_addresses): Add code to
8587 check for addresses set by memory regions.
8588 (Output_segment::set_section_addresses): Remove memory region
8590 (Script_sections::create_segment): Add a warning if a header
8591 segment is created outside of any region.
8592 * script-sections.h (class Script_sections): Add prototypes for
8593 find_memory_region and block_in_region methods.
8594 * testsuite/memory_test.s: Use .long instead of .word.
8595 * testsuite/memory_test.t: Add some more output sections.
8596 * testsuite/memory_test.sh: Update expected output.
8598 2010-10-02 Doug Kwan <dougkwan@google.com>
8600 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8601 defintion to symtab.h
8602 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8603 declaration to defintion.
8605 2010-10-01 Nick Clifton <nickc@redhat.com>
8607 * expression.cc (eval): Replace dummy argument with NULL.
8608 (eval_maybe_dot): Check for a NULL result section pointer.
8609 (Symbol_expression::value): Likewise.
8610 (Dot_expression::value): Likewise.
8611 (BINARY_EXPRESSION): Likewise.
8612 (Max_expression::value): Likewise.
8613 (Min_expression::value): Likewise.
8614 (Absolute_expression::value): Likewise.
8615 (Addr_expression::value_from_output_section): Likewise.
8616 (Loaddddr_expression::value_from_output_section): Likewise.
8617 (Segment_start_expression::value): Likewise.
8618 * script-sections.cc
8619 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8621 (Sections_elememt_dot_assignment::set_section_addresses):
8623 (Output_data_expression::do_write_to_buffer): Likewise.
8624 (Output_section_definition::finalize_symbols): Likewise.
8625 (Output_section_definition::set_section_addresses): Likewise.
8627 2010-09-30 Doug Kwan <dougkwan@google.com>
8629 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8631 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8633 * target.h (Target::can_icf_inline_merge_sections): New virtual
8635 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8637 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8639 * icf.cc (get_section_contents): Inline merge sections only when
8642 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8644 * configure: Regenerate.
8646 2010-09-17 Ian Lance Taylor <iant@google.com>
8648 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8649 * testsuite/Makefile.am (memory_test.o): New target.
8650 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8652 * testsuite/Makefile.in: Rebuild.
8654 2010-09-17 Doug Kwan <dougkwan@google.com>
8656 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8657 defintion if relocation uses GOT entries of the symbol.
8658 * testsuite/icf_safe_test.sh: Fix test.
8659 * testsuite/icf_safe_so_test.sh: Fix test.
8661 2010-09-16 Cary Coutant <ccoutant@google.com>
8663 * script_sections.cc (class Memory_region): Remove "NULL" from
8664 vector initializations.
8666 2010-09-15 Cary Coutant <ccoutant@google.com>
8668 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8669 Resolve forwarding symbols.
8671 2010-09-15 Doug Kwan <dougkwan@google.com>
8673 * gold/testsuite/script_test_3.t: Add ARM special sections.
8674 * gold/testsuite/script_test_4.t: Same.
8675 * gold/testsuite/script_test_5.t: Same.
8676 * gold/testsuite/script_test_6.t: Same.
8677 * gold/testsuite/script_test_7.t: Same.
8678 * gold/testsuite/script_test_7.t: Same.
8679 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8681 2010-09-14 Cary Coutant <ccoutant@google.com>
8683 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8684 (Target_x86_64::Relocate::relocate_tls): Replace check for
8685 saw_tls_block_reloc_ with test for executable section.
8687 2010-09-12 Cary Coutant <ccoutant@google.com>
8689 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8690 position-independent executables to shared libraries need dynamic
8692 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8693 position-independent executables.
8694 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8695 * testsuite/Makefile.in: Regenerate.
8697 2010-09-10 Nick Clifton <nickc@redhat.com>
8700 * testsuite/memory_test.t: Discard any sections that are not
8703 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8706 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8707 "This::" to work around a bug in gcc 4.2.
8709 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8711 2010-09-09 Rafael Espindola <espindola@google.com>
8713 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8714 sections with different PF_X flags in the same segment.
8715 (Layout::find_first_load_seg): Search all segments to find the first
8717 * options.h (rosegment): New.
8719 2010-09-08 Rafael Espindola <espindola@google.com>
8721 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
8723 2010-09-08 Doug Kwan <dougkwan@google.com>
8725 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8726 (Arm_relobj::do_relocate_sections): Add new parameter for output
8727 file to match the parent.
8728 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8729 of local symbols instead of input values. Update code to track
8730 changes in gold::relocate_section.
8731 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8732 (Sized_relobj::compute_final_local_value_internal): New methods.
8733 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8734 body into private version of Sized_relobj::compute_final_local_value.
8735 Call the inline method.
8736 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8737 merged symbol value if there is one.
8738 (Symbol_value::has_output_value): New method defintiion.
8739 (Sized_relobj::Compute_final_local_value_status): New enum type.
8740 (Sized_relobj::compute_final_local_value): New methods.
8741 (Sized_relobj::compute_final_local_value_internal): New methods.
8742 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8743 and arm_cortex_a8.sh.
8744 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8745 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8747 * Makefile.in: Regenerate.
8748 * testsuite/arm_bl_out_of_range.s: Update test.
8749 * testsuite/thumb_bl_out_of_range.s: Ditto.
8750 * testsuite/thumb_blx_out_of_range.s: Ditto.
8751 * testsuite/arm_branch_out_of_range.sh: New file.
8752 * testsuite/arm_cortex_a8.sh: Ditto.
8753 * testsuite/arm_cortex_a8_b.s: Ditto.
8754 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8755 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8756 * testsuite/arm_cortex_a8_bl.s: Ditto.
8757 * testsuite/arm_cortex_a8_blx.s: Ditto.
8758 * testsuite/arm_cortex_a8_local.s: Ditto.
8759 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8760 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8762 2010-09-08 Rafael Espindola <espindola@google.com>
8764 * Makefile.am (memory_test.stdout): Run readelf with -W.
8765 * Makefile.in: Regenerate.
8766 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8769 2010-09-08 Rafael Espindola <espindola@google.com>
8771 * script-sections.cc (Script_sections::add_memory_region): Convert
8772 field precision to int.
8773 * script.cc (script_set_section_region, script_set_section_region):
8774 Convert field precision to int.
8776 2010-09-08 Rafael Espindola <espindola@google.com>
8778 * arm.cc (do_finalize_sections): Create the __exidx_start and
8779 __exdix_end symbols even when the section is missing.
8781 2010-09-08 Nick Clifton <nickc@redhat.com>
8783 * README: Remove claim that MEMORY is not supported.
8784 * expression.cc (script_exp_function_origin)
8785 (script_exp_function_length): Move from here to ...
8786 * script.cc: ... here.
8787 (script_set_section_region, script_add_memory)
8788 (script_parse_memory_attr, script_include_directive): New
8790 * script-sections.cc
8791 (class Memory_region): New class.
8792 (class Output_section_definition): Add set_memory_region,
8793 set_section_vma, set_section_lma and get_section_name methods.
8794 (class Script_Sections): Add add_memory_region,
8795 find_memory_region, find_memory_region_origin,
8796 find_memory_region_length and set_memory_region methods.
8797 Have set_section_addresses method walk the list of set memory
8799 Extend the print methos to display memory regions.
8800 * script-sections.h: Add prototypes for new methods.
8801 Add enum for MEMORY region attributes.
8802 * yyscript.y: Add support for parsing MEMORY regions.
8803 * script-c.h: Add prototypes for new functions.
8804 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8805 * testsuite/Makefile.in: Regenerate.
8806 * testsuite/memory_test.sh: New script.
8807 * testsuite/memory_test.s: New assembler source file.
8808 * testsuite/memory_test.t: New linker script.
8810 2010-08-27 Doug Kwan <dougkwan@google.com>
8812 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8813 reference override an existing dynamic weak reference.
8814 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8815 * testsuite/Makefile.in: Regenerate.
8816 * testsuite/dyn_weak_ref.sh: New file.
8817 * testsuite/dyn_weak_ref_1.c: Ditto.
8818 * testsuite/dyn_weak_ref_2.c: Ditto.
8820 2010-08-27 Ian Lance Taylor <iant@google.com>
8822 * incremental.h (class Incremental_input_entry): Add virtual
8825 2010-08-27 Ian Lance Taylor <iant@google.com>
8827 * testsuite/start_lib_test_3.c: Mark t3 as used.
8829 2010-08-27 Nick Clifton <nickc@redhat.com>
8831 * options.cc (version_script): Fix small typo in previous
8834 2010-08-25 Nick Clifton <nickc@redhat.com>
8836 * archive.cc: Formatting fixes: Remove whitespace between
8837 typename and following asterisk. Remove whitespace between
8838 function name and opening parenthesis.
8839 * archive.h: Likewise.
8841 * attributes.cc: Likewise.
8842 * attributes.h: Likewise.
8843 * common.cc: Likewise.
8844 * copy-relocs.cc: Likewise.
8845 * dirsearch.h: Likewise.
8846 * dynobj.cc: Likewise.
8847 * ehframe.cc: Likewise.
8848 * ehframe.h: Likewise.
8849 * expression.cc: Likewise.
8850 * fileread.cc: Likewise.
8851 * fileread.h: Likewise.
8853 * gold-threads.cc: Likewise.
8854 * gold.cc: Likewise.
8855 * i386.cc: Likewise.
8857 * incremental-dump.cc: Likewise.
8858 * incremental.cc: Likewise.
8859 * layout.cc: Likewise.
8860 * layout.h: Likewise.
8861 * main.cc: Likewise.
8862 * merge.cc: Likewise.
8863 * merge.h: Likewise.
8864 * object.cc: Likewise.
8865 * object.h: Likewise.
8866 * options.cc: Likewise.
8867 * options.h: Likewise.
8868 * output.cc: Likewise.
8869 * output.h: Likewise.
8870 * plugin.cc: Likewise.
8871 * plugin.h: Likewise.
8872 * powerpc.cc: Likewise.
8873 * reloc.cc: Likewise.
8874 * script-c.h: Likewise.
8875 * script-sections.cc: Likewise.
8876 * script.cc: Likewise.
8877 * stringpool.cc: Likewise.
8878 * symtab.cc: Likewise.
8879 * symtab.h: Likewise.
8880 * target.cc: Likewise.
8881 * timer.cc: Likewise.
8882 * timer.h: Likewise.
8883 * version.cc: Likewise.
8884 * x86_64.cc: Likewise.
8886 2010-08-24 Nick Clifton <nickc@redhat.com>
8889 * layout.cc (segment_precedes): Sort segments by their physical
8890 addresses, if they have been set.
8892 2010-08-23 Cary Coutant <ccoutant@google.com>
8894 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8896 (Lib_group::include_member): Unlock object after deleting its
8898 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8901 2010-08-19 Neil Vachharajani <nvachhar@google.com>
8902 Cary Coutant <ccoutant@google.com>
8904 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8905 constructor, and set_blocker.
8906 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8908 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8909 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8910 * testsuite/Makefile.am (start_lib_test): New test case.
8911 * testsuite/Makefile.in: Regenerate.
8912 * testsuite/start_lib_test_main.c: New file.
8913 * testsuite/start_lib_test_1.c: New file.
8914 * testsuite/start_lib_test_2.c: New file.
8915 * testsuite/start_lib_test_3.c: New file.
8917 2010-08-19 Ian Lance Taylor <iant@google.com>
8919 * Makefile.in: Rebuild with automake 1.11.1.
8920 * aclocal.m4: Likewise.
8921 * testsuite/Makefile.in: Likewise.
8923 2010-08-19 Ian Lance Taylor <iant@google.com>
8926 * i386.cc (class Output_data_plt_i386): Update declarations.
8927 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8928 local_ifuncs_ fields.
8929 (Target_i386::do_plt_section_for_global): New function.
8930 (Target_i386::do_plt_section_for_local): New function.
8931 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8932 parameter; change all callers. Initialize global_ifuncs_ and
8933 local_ifuncs_. If doing a static link define __rel_iplt_start and
8935 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8936 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8937 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8939 (Target_i386::make_plt_section): New function, broken out of
8940 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8941 (Target_i386::make_plt_entry): Call make_plt_section.
8942 (Target_i386::make_local_ifunc_plt_entry): New function.
8943 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8944 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8945 R_386_IRELATIVE to switch.
8946 (Target_i386::Scan::global): Likewise.
8947 (Target_i386::Relocate::relocate): Likewise.
8948 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8950 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8951 (Target_x86_64::do_plt_section_for_global): New function.
8952 (Target_x86_64::do_plt_section_for_local): New function.
8953 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8954 parameter; change all callers. If doing a static link define
8955 __rela_iplt_start and __rela_iplt_end.
8956 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8957 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8958 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8960 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8961 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8963 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8964 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8965 R_X86_64_IRELATIVE to switch.
8966 (Target_x86_64::Scan::global): Likewise.
8967 (Target_x86_64::Relocate::relocate): Likewise.
8968 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8970 * target.h (class Target): Add plt_section_for_global and
8971 plt_section_for_local functions. Add do_plt_section_for_global
8972 and do_plt_section_for_local virtual functions.
8973 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8974 clarifying comments.
8975 (Symbol::use_plt_offset): Handle IFUNC symbol.
8976 * object.cc (Sized_relobj::Sized_relobj): Initialize
8978 (Sized_relobj::local_has_plt_offset): New function.
8979 (Sized_relobj::local_plt_offset): New function.
8980 (Sized_relobj::set_local_plt_offset): New function.
8981 (Sized_relobj::do_count): Handle IFUNC symbol.
8982 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8983 a bit away from input_shndx_ field. Add set_is_func_symbol and
8984 is_ifunc_symbol functions.
8985 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8986 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8987 local_plt_offsets_ field.
8988 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8989 * output.h (class Output_section_data): Add non-const
8990 output_section function.
8991 (class Output_data_got): Update declarations.
8992 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8993 Add use_plt_offset parameter to global and local constructors.
8994 Change all callers. Change local_sym_index_ field to 31 bits.
8995 Change GSYM_CODE and CONSTANT_CODE accordingly.
8996 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8997 doing a static link don't set sh_link field.
8998 (Output_data_got::Got_entry::write): Use PLT offset if
9000 (Output_data_got::add_global_plt): New function.
9001 (Output_data_got::add_local_plt): New function.
9002 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9003 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9004 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9005 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9006 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9008 * testsuite/ifunc-sel.h: New file.
9009 * testsuite/ifuncmain1.c: New file.
9010 * testsuite/ifuncmain1vis.c: New file.
9011 * testsuite/ifuncmod1.c: New file.
9012 * testsuite/ifuncdep2.c: New file.
9013 * testsuite/ifuncmain2.c: New file.
9014 * testsuite/ifuncmain3.c: New file.
9015 * testsuite/ifuncmod3.c: New file.
9016 * testsuite/ifuncmain4.c: New file.
9017 * testsuite/ifuncmain5.c: New file.
9018 * testsuite/ifuncmod5.c: New file.
9019 * testsuite/ifuncmain6pie.c: New file.
9020 * testsuite/ifuncmod6.c: New file.
9021 * testsuite/ifuncmain7.c: New file.
9022 * configure, testsuite/Makefile.in: Rebuild.
9024 2010-08-18 Ian Lance Taylor <iant@google.com>
9027 (Output_section_incremental_inputs::write_input_files): Add cast
9028 to avoid signed/unsigned comparison warning.
9029 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9031 2010-08-12 Cary Coutant <ccoutant@google.com>
9033 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9035 2010-08-13 Ian Lance Taylor <iant@google.com>
9037 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9039 2010-08-12 Cary Coutant <ccoutant@google.com>
9040 Doug Kwan <dougkwan@google.com>
9042 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9043 defintion overrides non-weak undef, remember that the original undef
9045 * symtab.cc (Symbol_table::sized_write_global): For undef without
9046 an original weak binding, set binding to global in output.
9047 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9048 * testsuite/Makefile.in: Regenerate.
9049 * testsuite/strong_ref_weak_def.sh: New file.
9050 * testsuite/strong_ref_weak_def_1.c: Ditto.
9051 * testsuite/strong_ref_weak_def_2.c: Ditto.
9053 2010-08-12 Cary Coutant <ccoutant@google.com>
9055 * testsuite/incremental_test.sh: Rewrite.
9056 * testsuite/incremental_test_1.c: Rewrite.
9057 * testsuite/incremental_test_2.c: Rewrite.
9059 2010-08-12 Cary Coutant <ccoutant@google.com>
9061 * arm.cc (Target_arm::got_size): Add const.
9062 (Target_arm::got_entry_count): New function.
9063 (Target_arm::plt_entry_count): New function.
9064 (Target_arm::first_plt_entry_offset): New function.
9065 (Target_arm::plt_entry_size): New function.
9066 (Output_data_plt_arm::entry_count): New function.
9067 (Output_data_plt_arm::first_plt_entry_offset): New function.
9068 (Output_data_plt_arm::get_plt_entry_size): New function.
9069 * i386.cc (Target_i386::got_size): Add const.
9070 (Target_i386::got_entry_count): New function.
9071 (Target_i386::plt_entry_count): New function.
9072 (Target_i386::first_plt_entry_offset): New function.
9073 (Target_i386::plt_entry_size): New function.
9074 (Output_data_plt_i386::entry_count): New function.
9075 (Output_data_plt_i386::first_plt_entry_offset): New function.
9076 (Output_data_plt_i386::get_plt_entry_size): New function.
9077 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9078 find_incremental_inputs_sections. Dump incremental_got_plt section.
9079 * incremental.cc: Include target.h.
9080 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9081 parameter. Adjust all callers. Find incremental_got_plt section.
9082 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9084 (Output_section_incremental_inputs::set_final_data_size): Calculate
9085 size of incremental_got_plt section.
9086 (Output_section_incremental_inputs::do_write): Write the
9087 incremental_got_plt section.
9088 (Got_plt_view_info): New struct.
9089 (Local_got_offset_visitor): New class.
9090 (Global_got_offset_visitor): New class.
9091 (Global_symbol_visitor_got_plt): New class.
9092 (Output_section_incremental_inputs::write_got_plt): New function.
9093 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9094 Add parameter. Adjust all callers.
9095 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9096 (Incremental_inputs::got_plt_section): New function.
9097 (Incremental_inputs::got_plt_section_): New data member.
9098 (Incremental_got_plt_reader): New class.
9099 * layout.cc (Layout::create_incremental_info_sections): Add the
9100 incremental_got_plt section.
9101 * object.h (Got_offset_list::get_list): New function.
9102 (Got offset_list::for_all_got_offsets): New function.
9103 (Sized_relobj::local_got_offset_list): New function.
9104 * powerpc.cc (Target_powerpc::got_size): Add const.
9105 (Target_powerpc::got_entry_count): New function.
9106 (Target_powerpc::plt_entry_count): New function.
9107 (Target_powerpc::first_plt_entry_offset): New function.
9108 (Target_powerpc::plt_entry_size): New function.
9109 (Output_data_plt_powerpc::entry_count): New function.
9110 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9111 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9112 * sparc.cc (Target_sparc::got_size): Add const.
9113 (Target_sparc::got_entry_count): New function.
9114 (Target_sparc::plt_entry_count): New function.
9115 (Target_sparc::first_plt_entry_offset): New function.
9116 (Target_sparc::plt_entry_size): New function.
9117 (Output_data_plt_sparc::entry_count): New function.
9118 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9119 (Output_data_plt_sparc::get_plt_entry_size): New function.
9120 * symtab.h (Symbol::got_offset_list): New function.
9121 (Symbol_table::for_all_symbols): New function.
9122 * target.h (Sized_target::got_entry_count): New function.
9123 (Sized_target::plt_entry_count): New function.
9124 (Sized_target::plt_entry_size): New function.
9125 * x86_64.cc (Target_x86_64::got_size): Add const.
9126 (Target_x86_64::got_entry_count): New function.
9127 (Target_x86_64::plt_entry_count): New function.
9128 (Target_x86_64::first_plt_entry_offset): New function.
9129 (Target_x86_64::plt_entry_size): New function.
9130 (Output_data_plt_x86_64::entry_count): New function.
9131 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9132 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9134 2010-08-12 Cary Coutant <ccoutant@google.com>
9136 * archive.cc: Include incremental.h.
9137 (Archive::Archive): Initialize incremental_info_.
9138 (Archive::include_member): Record archive members in incremental info.
9139 (Add_archive_symbols::run): Record begin and end of an archive in
9141 (Lib_group::include_member): Record objects in incremental info.
9142 * archive.h (Incremental_archive_entry): Forward declaration.
9143 (Archive::set_incremental_info): New member function.
9144 (Archive::incremental_info): New member function.
9145 (Archive::Unused_symbol_iterator): New class.
9146 (Archive::unused_symbols_begin): New member function.
9147 (Archive::unused_symbols_end): New member function.
9148 (Archive::incremental_info_): New data member.
9149 * incremental-dump.cc (find_input_containing_global): New function.
9150 (dump_incremental_inputs): Dump new incremental info sections.
9151 * incremental.cc: Include symtab.h.
9152 (Output_section_incremental_inputs): New class.
9153 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9154 new incremental info sections.
9155 (Sized_incremental_binary::do_check_inputs): Likewise.
9156 (Incremental_inputs::report_archive): Remove.
9157 (Incremental_inputs::report_archive_begin): New function.
9158 (Incremental_inputs::report_archive_end): New function.
9159 (Incremental_inputs::report_object): New function.
9160 (Incremental_inputs::finalize_inputs): Remove.
9161 (Incremental_inputs::report_input_section): New function.
9162 (Incremental_inputs::report_script): Rewrite.
9163 (Incremental_inputs::finalize): Do nothing but finalize string table.
9164 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9165 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9166 (Incremental_inputs::create_data_sections): New function.
9167 (Incremental_inputs::relocs_entsize): New function.
9168 (Output_section_incremental_inputs::set_final_data_size): New function.
9169 (Output_section_incremental_inputs::do_write): New function.
9170 (Output_section_incremental_inputs::write_header): New function.
9171 (Output_section_incremental_inputs::write_input_files): New function.
9172 (Output_section_incremental_inputs::write_info_blocks): New function.
9173 (Output_section_incremental_inputs::write_symtab): New function.
9174 * incremental.h (Incremental_script_entry): Forward declaration.
9175 (Incremental_object_entry): Forward declaration.
9176 (Incremental_archive_entry): Forward declaration.
9177 (Incremental_inputs): Forward declaration.
9178 (Incremental_inputs_header_data): Remove.
9179 (Incremental_inputs_header): Remove.
9180 (Incremental_inputs_header_write): Remove.
9181 (Incremental_inputs_entry_data): Remove.
9182 (Incremental_inputs_entry): Remove.
9183 (Incremental_inputs_entry_write): Remove.
9184 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9185 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9186 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9187 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9189 (Incremental_input_entry): New class.
9190 (Incremental_script_entry): New class.
9191 (Incremental_object_entry): New class.
9192 (Incremental_archive_entry): New class.
9193 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9194 (Incremental_inputs::report_inputs): Remove.
9195 (Incremental_inputs::report_archive): Remove.
9196 (Incremental_inputs::report_archive_begin): New function.
9197 (Incremental_inputs::report_archive_end): New function.
9198 (Incremental_inputs::report_object): Change prototype.
9199 (Incremental_inputs::report_input_section): New function.
9200 (Incremental_inputs::report_script): Change prototype.
9201 (Incremental_inputs::get_reloc_count): New function.
9202 (Incremental_inputs::set_reloc_count): New function.
9203 (Incremental_inputs::create_data_sections): New function.
9204 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9205 (Incremental_inputs::inputs_section): New function.
9206 (Incremental_inputs::symtab_section): New function.
9207 (Incremental_inputs::relocs_section): New function.
9208 (Incremental_inputs::get_stringpool): Add const.
9209 (Incremental_inputs::command_line): Add const.
9210 (Incremental_inputs::inputs): Remove.
9211 (Incremental_inputs::command_line_key): New function.
9212 (Incremental_inputs::input_file_count): New function.
9213 (Incremental_inputs::input_files): New function.
9214 (Incremental_inputs::relocs_entsize): New function.
9215 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9216 (Incremental_inputs::finalize_inputs): Remove.
9217 (Incremental_inputs::Input_info): Remove.
9218 (Incremental_inputs::lock_): Remove.
9219 (Incremental_inputs::inputs_): Change type.
9220 (Incremental_inputs::inputs_map_): Remove.
9221 (Incremental_inputs::current_object_entry_): New data member.
9222 (Incremental_inputs::inputs_section_): New data member.
9223 (Incremental_inputs::symtab_section_): New data member.
9224 (Incremental_inputs::relocs_section_): New data member.
9225 (Incremental_inputs::reloc_count_): New data member.
9226 (Incremental_inputs_reader): New class.
9227 (Incremental_symtab_reader): New class.
9228 (Incremental_relocs_reader): New class.
9229 * layout.cc (Layout::finalize): Move finalization of incremental info
9230 and creation of incremental info sections to follow finalization of
9231 symbol table. Set offsets for postprocessing sections.
9232 (Layout::create_incremental_info_sections): Call
9233 Incremental_inputs::create_data_sections. Add incremental symtab
9234 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9235 sections to layout after input sections.
9236 * layout.h (struct Timespec): Forward declaration.
9237 (Layout::incremental_inputs): Add const.
9238 (Layout::create_incremental_info_sections): Add parameter.
9239 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9240 * object.cc: Include incremental.h.
9241 (Relobj::finalize_incremental_relocs): New function.
9242 (Sized_relobj::do_layout): Record input sections in incremental info.
9243 * object.h (Object::output_section): New function.
9244 (Object::output_section_offset): Moved from Relobj.
9245 (Object::get_incremental_reloc_base): New function.
9246 (Object::get_incremental_reloc_count): New function.
9247 (Object::do_output_section): New function.
9248 (Object::do_output_section_offset): Moved from Relobj.
9249 (Object::do_get_incremental_reloc_base): New function.
9250 (Object::do_get_incremental_reloc_count): New function.
9251 (Object::Object): Initialize new data members.
9252 (Relobj::output_section): Renamed do_output_section and moved to
9254 (Relobj::output_section_offset): Moved to Object.
9255 (Relobj::do_get_incremental_reloc_base): New function.
9256 (Relobj::do_get_incremental_reloc_count): New function.
9257 (Relobj::allocate_incremental_reloc_counts): New function.
9258 (Relobj::count_incremental_reloc): New function.
9259 (Relobj::finalize_incremental_relocs): New function.
9260 (Relobj::next_incremental_reloc_index): New function.
9261 (Relobj::reloc_counts_): New data member.
9262 (Relobj::reloc_bases_): New data member.
9263 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9264 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9265 (Sized_relobj::incremental_relocs_scan): New function.
9266 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9267 (Sized_relobj::incremental_relocs_write): New function.
9268 (Sized_relobj::incremental_relocs_write_reltype): New function.
9269 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9271 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9272 archives and object files elsewhere.
9273 (Add_symbols::run): Report object files here.
9274 (Finish_group::run): Report end of archive at end of group.
9275 * reloc.cc: Include layout.h, incremental.h.
9276 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9277 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9278 (Sized_relobj::incremental_relocs_scan): New function.
9279 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9280 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9281 (Sized_relobj::incremental_relocs_write): New function.
9282 (Sized_relobj::incremental_relocs_write_reltype): New function.
9283 * script.cc (read_input_script): Rewrite test for incremental link.
9284 Change call to Incremental_inputs::report_script.
9285 * symtab.h (Symbol_table::first_global_index): New function.
9286 (Symbol_table::output_count): New function.
9288 2010-08-12 Doug Kwan <dougkwan@google.com>
9290 * arm.cc (Target_arm::merge_object_attributes): Check command line
9291 options --no-wchar-size-warning and --no-enum-size-warning.
9292 * options.h (General_options): Add ld-compatible options
9293 --no-enum-size-warning and --no-wchar-size-warning.
9295 2010-08-04 Ian Lance Taylor <iant@google.com>
9297 * x86_64.cc (Target_x86_64::Scan::local): Use
9298 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9299 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9300 (Target_x86_64::Scan::global): Likewise.
9301 (Target_x86_64::Relocate::relocate): Likewise.
9302 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9305 2010-08-03 Cary Coutant <ccoutant@google.com>
9307 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9308 to reserve space in merged_strings vector. Keep total input size
9310 (Output_merge_string::do_print_merge_stats): Print total input size.
9311 * merge.h (Output_merge_string): Add input_size_ field.
9312 * stringpool.cc (Stringpool_template::string_length): Move
9313 implementations out of Stringpool_template class and place in
9315 * stringpool.h (string_length): Move out of Stringpool_template.
9317 2010-08-03 Ian Lance Taylor <iant@google.com>
9320 * layout.cc (relaxation_loop_body): If address of load segment is
9321 set, adjust address to include headers if possible.
9323 2010-08-03 Ian Lance Taylor <iant@google.com>
9325 * version.cc (version_string): Bump to 1.10.
9327 2010-08-03 Ian Lance Taylor <iant@google.com>
9330 * layout.h (enum Output_section_order): Define.
9331 (class Layout): Update declarations.
9332 * layout.cc (Layout::get_output_section): Add order parameter.
9333 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9334 is_first_non_relro parameters. Change all callers.
9335 (Layout::choose_output_section): Likewise.
9336 (Layout::add_output_section_data): Likewise.
9337 (Layout::make_output_section): Likewise. Set order.
9338 (Layout::default_section_order): New function.
9339 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9340 * output.cc (Output_section::Output_section): Initialize order_.
9341 Don't initialize deleted fields.
9342 (Output_segment::Output_segment): Don't initialize deleted
9344 (Output_segment::add_output_section_to_load): New function
9345 replacing add_output_section. Change all callers to call this or
9346 add_output_section_to_nonload.
9347 (Output_segment::add_output_section_to_nonload): New function.
9348 (Output_segment::remove_output_section): Rewrite.
9349 (Output_segment::add_initial_output_data): Likewise.
9350 (Output_segment::has_any_data_sections): Likewise.
9351 (Output_segment::is_first_section_relro): Likewise.
9352 (Output_segment::maximum_alignment): Likewise.
9353 (Output_segment::has_dynamic_reloc): New function replacing
9354 dynamic_reloc_count. Change all callers.
9355 (Output_segment::has_dynamic_reloc_list): New function replacing
9356 dynamic_reloc_count_list. Change all callers.
9357 (Output_segment::set_section_addresses): Rewrite.
9358 (Output_segment::set_offset): Rewrite.
9359 (Output_segment::find_first_and_last_list): Remove.
9360 (Output_segment::set_tls_offsets): Rewrite.
9361 (Output_segment::first_section_load_address): Likewise.
9362 (Output_segment::output_section_count): Likewise.
9363 (Output_segment::section_with_lowest_load_address): Likewise.
9364 (Output_segment::write_section_headers): Likewise.
9365 (Output_segment::print_sections_to_map): Likewise.
9366 * output.h (class Output_data): Remove dynamic_reloc_count_
9367 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9368 (Output_data::add_dynamic_reloc): Rewrite.
9369 (Output_data::has_dynamic_reloc): New function.
9370 (Output_data::dynamic_reloc_count): Remove.
9371 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9372 is_last_relro_, is_first_non_relro_, is_interp_,
9373 is_dynamic_linker_section_ fields. Add order and set_order
9374 functions. Remove is_relro_local, set_is_relro_local,
9375 is_last_relro, set_is_last_relro, is_first_non_relro,
9376 set_is_first_non_relro functions, is_interp, set_is_interp,
9377 is_dynamic_linker_section, and set_is_dynamic_linker_section
9379 (class Output_segment): Change Output_data_list from std::list to
9380 std:;vector. Add output_lists_ field. Remove output_data_ and
9381 output_bss_ fields. Update declarations.
9383 2010-08-02 Ian Lance Taylor <iant@google.com>
9385 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9386 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9387 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9389 2010-08-02 Ian Lance Taylor <iant@google.com>
9392 * script.cc (Script_options::Script_options): Initialize
9393 symbol_definitions_ and symbol_references_.
9394 (Script_options::add_symbol_assignment): Update
9395 symbol_definitions_ and symbol_references_.
9396 (Script_options::add_symbol_reference): New function.
9397 (script_symbol): New function.
9398 * script.h (class Script_options): Add symbol_definitions_ and
9399 symbol_references_ fields.
9400 (Script_options::referenced_const_iterator): New type.
9401 (Script_options::referenced_begin): New function.
9402 (Script_options::referenced_end): New function.
9403 (Script_options::is_referenced): New function.
9404 (Script_options::any_unreferenced): New function.
9405 * script-c.h (script_symbol): Declare.
9406 * yyscript.y (exp): Call script_symbol.
9407 * symtab.cc: Include "script.h".
9408 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9409 Change all callers. Check symbols referenced by scripts.
9410 (Symbol_table::add_undefined_symbols_from_command_line): Add
9411 layout parameter. Change all callers.
9412 (Symbol_table::do_add_undefined_symbols_from_command_line):
9413 Likewise. Break out loop body. Check symbols referenced by
9415 (Symbol_table::add_undefined_symbol_from_command_line): New
9416 function broken out of
9417 do_add_undefined_symbols_from_command_line.
9418 * symtab.h (class Symbol_table): Update declarations.
9419 * archive.cc: Include "layout.h".
9420 (Archive::should_include_member): Add layout parameter. Change
9421 all callers. Check for symbol mentioned in expression.
9422 * archive.h (class Archive): Update declaration.
9423 * object.cc (Sized_relobj::do_should_include_member): Add layout
9425 * object.h (Object::should_include_member): Add layout parameter.
9427 (Object::do_should_include_member): Add layout parameter.
9428 (class Sized_relobj): Update declaration.
9429 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9431 * dynobj.h (class Sized_dynobj): Update declaration.
9432 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9434 * plugin.h (class Sized_pluginobj): Update declaration.
9436 2010-08-02 Ian Lance Taylor <iant@google.com>
9439 * output.cc (Output_segment::set_offset): Search for the first and
9440 last sections rather than assuming that the list is in order.
9441 (Output_segment::find_first_and_last_list): New function.
9442 * output.h (class Output_segment): Update declarations.
9443 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9444 (relro_strip_test_SOURCES): New variable.
9445 (relro_strip_test_DEPENDENCIES): New variable.
9446 (relro_strip_test_LDFLAGS): New variable.
9447 (relro_strip_test_LDADD): New variable.
9448 (relro_strip_test.so): New target.
9450 2010-08-02 Ian Lance Taylor <iant@google.com>
9452 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9453 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9454 (Target_i386::got_tlsdesc_section): New function.
9455 (Target_i386::got_section): Create space for GOT entries for
9456 TLSDESC relocations.
9457 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9459 (Target_i386::Scan::global): Likewise.
9460 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9462 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9463 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9464 (Target_x86_64::got_tlsdesc_section): New function.
9465 (Target_x86_64::got_section): Create space for GOT entries for
9466 TLSDESC relocations.
9467 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9469 (Target_x86_64::Scan::global): Likewise.
9470 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9473 2010-08-02 Ian Lance Taylor <iant@google.com>
9475 * testsuite/final_layout.sh: Use dc to convert from hex to
9478 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9480 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9481 paramter to the call to gold::gc_process_relocs.
9482 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9483 paramter to the call to gold::gc_process_relocs.
9484 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9485 parameter to the call to gold::gc_process_relocs.
9486 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9487 template parameter to the call to gold::gc_process_relocs.
9488 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9489 paramter to the call to gold::gc_process_relocs.
9490 * gc.h (get_embedded_addend_size): New function.
9491 (gc_process_relocs): Save the size of the reloc for use by ICF.
9492 * icf.cc (get_section_contents): Get the addend from the text section
9493 for SHT_REL relocation sections.
9494 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9495 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9496 * int_encoding.h (read_from_pointer): New overloaded function.
9497 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9498 * testsuite/icf_sht_rel_addend_test.sh: New file.
9499 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9500 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9502 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9504 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9505 * Makefile.in: Regenerate.
9506 * testsuite/Makefile.in: Regenerate.
9508 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9510 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9511 * gold/testsuite/debug_msg.cc: Likewise.
9512 * gold/testsuite/odr_violation1.cc
9513 * gold/testsuite/odr_violation2.cc
9515 2010-07-21 Cary Coutant <ccoutant@google.com>
9517 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9518 string, and length fields.
9519 (Output_merge_string::Merged_strings_list): New type.
9520 (Output_merge_string::Merged_strings_lists): New typedef.
9521 (Output_merge_string): Replace merged_strings_ with
9522 merged_strings_lists_.
9523 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9524 Merged_strings_list per input object and section. Don't store pointer
9525 to the string. Don't store length with each merged string entry.
9526 (Output_merge_string::finalize_merged_data): Loop over list of merged
9527 strings lists. Recompute length of each merged string.
9529 2010-07-15 Cary Coutant <ccoutant@google.com>
9531 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9534 2010-07-14 Ian Lance Taylor <iant@google.com>
9536 * descriptors.cc (Descriptors::open): Report correct name in error
9539 2010-07-13 Doug Kwan <dougkwan@google.com>
9541 * arm.cc (Arm_input_section::Arm_input_section): For a
9542 SHT_ARM_EXIDX section, always keeps the input sections.
9543 (Arm_input_section::set_exidx_section_link): New method.
9544 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9545 has_errors_ to false.
9546 (Arm_exidx_input_section::has_errors,
9547 Arm_exidx_input_section::set_has_errors): New methods.
9548 (Arm_exidx_input_section::has_errors_): New data member.
9549 (Arm_relobj::get_exidx_shndx_list): New method.
9550 (Arm_output_section::append_text_sections_to_list): Do not skip
9551 section without SHF_EXECINSTR.
9552 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9554 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9555 section header. Make error messages more verbose. Check for
9556 a non-executable section linked to an EXIDX section.
9557 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9558 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9559 check that there is no deferred EXIDX section if we exit early.
9560 Instead of not making an EXIDX section in case of an error, make one
9561 and set the has_errors flag of it.
9562 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9563 in a relocatable link.
9564 (Target_arm::do_relax): Look for the EXIDX output section instead of
9565 assuming that it is called .ARM.exidx.
9566 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9567 section list. Do not check for SHF_EXECINSTR section flags but
9568 skip any input section with errors.
9569 * output.cc (Output_section::Output_section): Initialize
9570 always_keeps_input_sections_ to false.
9571 (Output_section::add_input_section): Check for
9572 always_keeps_input_sections_.
9573 * output.h (Output_section::always_keeps_input_sections,
9574 Output_section::set_always_keeps_input_sections): New methods.
9575 (Output_section::always_keeps_input_sections): New data member.
9577 2010-07-13 Rafael Espindola <espindola@google.com>
9579 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9580 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9582 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9583 Ian Lance Taylor <iant@google.com>
9585 * output.h (Output_section_lookup_maps::add_merge_section):
9586 Correct check of whether value was inserted.
9587 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9588 (Output_section_lookup_maps::add_relaxed_input_section):
9590 * arm.cc (Target_arm::got_section): Remove used local os.
9591 * i386.cc (Target_i386::got_section): Likewise.
9592 * x86_64.cc (Target_x86_64::got_section): Likewise.
9593 * sparc.cc (Target_sparc::got_section): Likewise.
9594 (Target_sparc::relocate): Remove unused local have_got_offset.
9595 * powerpc.cc (Target_powerpc::relocate): Likewise.
9597 2010-07-13 Ian Lance Taylor <iant@google.com>
9599 * compressed_output.cc (zlib_decompress): Fix signature in
9602 * archive.cc (Archive::include_member): Unlock an external member
9603 of a thin archive. Don't bother to delete an object we know is
9606 2010-07-12 Cary Coutant <ccoutant@google.com>
9608 * compressed_output.cc (zlib_decompress): New function.
9609 (get_uncompressed_size): New function.
9610 (decompress_input_section): New function.
9611 * compressed_output.h (get_uncompressed_size): New function.
9612 (decompress_input_section): New function.
9613 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9614 Handle compressed debug sections.
9615 * layout.cc (is_compressed_debug_section): New function.
9616 (Layout::output_section_name): Map compressed section names to
9618 * layout.h (is_compressed_debug_section): New function.
9619 (is_debug_info_section): Recognize compressed debug sections.
9620 * merge.cc: Include compressed_output.h.
9621 (Output_merge_data::do_add_input_section): Handle compressed
9623 (Output_merge_string::do_add_input_section): Handle compressed
9625 * object.cc: Include compressed_output.h.
9626 (Sized_relobj::Sized_relobj): Initialize new data members.
9627 (build_compressed_section_map): New function.
9628 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9629 * object.h (Object::section_is_compressed): New method.
9630 (Object::do_section_is_compressed): New method.
9631 (Sized_relobj::Compressed_section_map): New type.
9632 (Sized_relobj::do_section_is_compressed): New method.
9633 (Sized_relobj::compressed_sections_): New data member.
9634 * output.cc (Output_section::add_input_section): Handle compressed
9636 * reloc.cc: Include compressed_output.h.
9637 (Sized_relobj::write_sections): Handle compressed debug sections.
9639 2010-07-08 Cary Coutant <ccoutant@google.com>
9641 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9642 weak when resolving to a dynamic def.
9643 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9644 for weak undef/dynamic def cases. Adjust callers.
9645 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9646 undef_binding_weak_.
9647 (Symbol_table::sized_write_globals): Adjust symbol binding.
9648 (Symbol_table::sized_write_symbol): Add binding parameter.
9649 * symtab.h (Symbol::set_undef_binding): New method.
9650 (Symbol::is_undef_binding_weak): New method.
9651 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9652 (Symbol_table::should_override): Add new parameter.
9653 (Symbol_table::sized_write_symbol): Add new parameter.
9655 * testsuite/weak_undef_file1.cc: Add new test case.
9656 * testsuite/weak_undef_file2.cc: Fix header comment.
9657 * testsuite/weak_undef_test.cc: Add new test case.
9659 2010-06-29 Doug Kwan <dougkwan@google.com>
9661 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9662 Initialize USE_SYMBOL_.
9663 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9665 (Arm_reloc_property::uses_symbol_): New data member declaration.
9666 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9667 uses symbol value and symbol is undefined but not weakly undefined.
9669 2010-06-28 Rafael Espindola <espindola@google.com>
9671 * plugin.cc (Plugin::load): Use dlerror.
9673 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9675 * symtab.cc (detect_odr_violations): When reporting an ODR
9676 violation, report an object where the symbol is defined.
9678 2010-06-25 Doug Kwan <dougkwan@google.com>
9680 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9681 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9683 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9684 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9685 target hook to detect function points.
9686 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9687 * icf.h (Icf::check_section_for_function_pointers): Change type of
9688 parameter SECTION_NAME to const reference to std::string. Use
9689 target hook to determine if section may have unsafe pointers.
9690 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9693 2010-06-21 Rafael Espindola <espindola@google.com>
9695 * fileread.cc (Input_file::find_fie): New
9696 (Input_file::open): Use Input_file::find_fie.
9697 * fileread.h (Input_file::find_fie): New
9698 * plugin.cc (set_extra_library_path): New.
9699 (Plugin::load): Add set_extra_library_path to the transfer vector.
9700 (Plugin_manager::set_extra_library_path): New.
9701 (Plugin_manager::add_input_file): Use the extra search path if set.
9702 (set_extra_library_path(): New.
9703 * plugin.h (Plugin_manager): Add set_extra_library_path and
9706 2010-06-19 Cary Coutant <ccoutant@google.com>
9708 * layout.cc (gdb_sections): Add .debug_types.
9709 (lines_only_debug_sections): Likewise.
9711 2010-06-18 Rafael Espindola <espindola@google.com>
9713 * plugin.cc (add_input_file,add_input_library)
9714 (Plugin_manager::add_input_file): Make filename arguments const.
9715 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9718 2010-06-16 Doug Kwan <dougkwan@google.com>
9720 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9721 .ARM.attributes section if we have not merged any input
9722 attributes sections.
9724 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9726 * arm.cc: Allow combining objects with no EABI version
9729 2010-06-15 Rafael Espindola <espindola@google.com>
9731 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9733 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9735 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9736 (struct iovec): Correct !HAVE_READV definition.
9738 2010-06-10 Cary Coutant <ccoutant@google.com>
9740 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9741 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9743 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9746 * symtab.h (Symbol::is_placeholder): New member function.
9747 * target-reloc.h (relocate_section): Check for placeholder symbols.
9749 * testsuite/Makefile.am (plugin_test_8): New test.
9750 (plugin_test_9): New test.
9751 * testsuite/Makefile.in: Regenerate.
9753 2010-06-09 Nick Clifton <nickc@redhat.com>
9755 * yyscript.y (input_list_element): Allow strings prefixed with
9756 the '-' character. Treat these as libraries.
9757 * script.cc (script_add_library): New function. Adds a library
9758 specified by "-l<name>" found in an input script.
9759 * script-c.h: Add prototype for script_add_library.
9761 2010-06-07 Doug Kwan <dougkwan@google.com>
9763 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9764 Restrict stub-group size to be within long conditional branch
9765 range when working around cortex-A8 erratum.
9767 2010-06-07 Damien Diederen <dd@crosstwine.com>
9769 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9772 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9776 (Output_section::Input_section_sort_entry::compare_section_ordering):
9777 Change to return non-zero correctly.
9778 (Output_section::Input_section_sort_section_order_index_compare
9779 ::operator()): Change to fix ambiguity in comparisons.
9781 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9783 * gold.h (is_wildcard_string): New function.
9784 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9785 (Layout::layout_eh_frame): Ditto.
9786 (Layout::find_section_order_index): New method.
9787 (Layout::read_layout_from_file): New method.
9788 * layout.h (Layout::find_section_order_index): New method.
9789 (Layout::read_layout_from_file): New method.
9790 (Layout::input_section_position_): New private member.
9791 (Layout::input_section_glob_): New private member.
9792 * main.cc (main): Call read_layout_from_file here.
9793 * options.h (--section-ordering-file): New option.
9794 * output.cc (Output_section::input_section_order_specified_): New
9796 (Output_section::Output_section): Initialize new member.
9797 (Output_section::add_input_section): Add new parameter.
9798 Keep input sections when --section-ordering-file is used.
9799 (Output_section::set_final_data_size): Sort input sections when
9800 section ordering file is specified.
9801 (Output_section::Input_section_sort_entry): Add new parameter.
9803 (Output_section::Input_section_sort_entry::compare_section_ordering):
9805 (Output_section::Input_section_sort_compare::operator()): Change to
9806 consider section_order_index.
9807 (Output_section::Input_section_sort_init_fini_compare::operator()):
9808 Change to consider section_order_index.
9809 (Output_section::Input_section_sort_section_order_index_compare
9810 ::operator()): New method.
9811 (Output_section::sort_attached_input_sections): Change to sort
9812 according to section order when specified.
9813 (Output_section::add_input_section<32, true>): Add new parameter.
9814 (Output_section::add_input_section<64, true>): Add new parameter.
9815 (Output_section::add_input_section<32, false>): Add new parameter.
9816 (Output_section::add_input_section<64, false>): Add new parameter.
9817 * output.h (Output_section::add_input_section): Add new parameter.
9818 (Output_section::input_section_order_specified): New
9820 (Output_section::set_input_section_order_specified): New method.
9821 (Input_section::Input_section): Initialize section_order_index_.
9822 (Input_section::section_order_index): New method.
9823 (Input_section::set_section_order_index): New method.
9824 (Input_section::section_order_index_): New member.
9825 (Input_section::Input_section_sort_section_order_index_compare): New
9827 (Output_section::input_section_order_specified_): New member.
9828 * script-sections.cc (is_wildcard_string): Delete and move modified
9830 (Output_section_element_input::Output_section_element_input): Modify
9831 call to is_wildcard_string.
9832 (Output_section_element_input::Input_section_pattern
9833 ::Input_section_pattern): Ditto.
9834 (Output_section_element_input::Output_section_element_input): Ditto.
9835 * testsuite/Makefile.am (final_layout): New test case.
9836 * testsuite/Makefile.in: Regenerate.
9837 * testsuite/final_layout.cc: New file.
9838 * testsuite/final_layout.sh: New file.
9840 2010-06-01 Rafael Espindola <espindola@google.com>
9842 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9844 2010-06-01 Rafael Espindola <espindola@google.com>
9846 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9847 visibility of symbols.
9849 2010-05-27 Doug Kwan <dougkwan@google.com>
9851 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9852 from start of output section instead of address for a local symbol
9853 in a merged or relaxed section when doing a relocatable link.
9855 2010-05-26 Rafael Espindola <espindola@google.com>
9858 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9859 adding sections the garbage collector removed.
9860 * gold/testsuite/Makefile.am: Add test.
9861 * gold/testsuite/Makefile.in: Regenerate.
9862 * gold/testsuite/plugin_test_7.sh: New.
9863 * gold/testsuite/plugin_test_7_1.c: New.
9864 * gold/testsuite/plugin_test_7_2.c: New.
9866 2010-05-26 Rafael Espindola <espindola@google.com>
9868 * script-sections.cc (Output_section_definition::set_section_addresses):
9869 Check for --section-start.
9871 2010-05-26 Doug Kwan <dougkwan@google.com>
9873 * arm.cc (Arm_scan_relocatable_relocs): New class.
9874 (Target_arm::relocate_special_relocatable): New method.
9875 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9876 (Arm_relocate_functions::thumb_branch_common): Same.
9877 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9878 instead of Default_scan_relocatable_relocs.
9879 * target-reloc.h (relocate_for_relocatable): Let target handle
9880 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9881 * target.h (Sized_target::relocate_special_relocatable): New method.
9883 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9885 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9887 2010-05-23 Doug Kwan <dougkwan@google.com>
9889 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9891 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9892 with a direct branch, not a conditional branch, to a stub.
9893 * merge.cc (Output_merge_base::record_input_section): New method
9895 (Output_merge_data::do_add_input_section): Record input section if
9896 keeps-input-sections flag is set.
9897 (Output_merge_string::do_add_input_section): Ditto.
9898 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9899 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9901 (Output_merge_base::keeps_input_sections,
9902 Output_merge_base::set_keeps_input_sections,
9903 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9905 (Output_merge_base::Input_sections): New type declaration.
9906 (Output_merge_base::input_sections_begin,
9907 Output_merge_base::input_sections_end,
9908 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9909 (Output_merge_base::bool keeps_input_sections_,
9910 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9911 Output_merge_base::input_sections_): New data members.
9912 (Output_merge_data::do_set_keeps_input_sections): New method
9914 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9915 * output.cc (Output_section::Input_section::relobj): Move method
9916 defintion from class declaration to here and handle merge sections.
9917 (Output_section::Input_section::shndx): Ditto.
9918 (Output_section::Output_section): Remove initializations of removed
9919 data members and initialize new data member LOOKUP_MAPS_.
9920 (Output_section::add_input_section): Set keeps-input-sections flag
9921 for a newly created merge output section as appropriate. Adjust code
9922 to use Output_section_lookup_maps class.
9923 (Output_section::add_relaxed_input_section): Adjst code for lookup
9924 maps code refactoring.
9925 (Output_section::add_merge_input_section): Add a new parameter
9926 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9927 class. If adding input section to a newly created merge output
9928 section fails, remove the new merge section.
9929 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
9930 Adjust code for use of the Output_section_lookup_maps class.
9931 (Output_section::find_merge_section): Ditto.
9932 (Output_section::build_lookup_maps): New method defintion.
9933 (Output_section::find_relaxed_input_section): Adjust code to use
9934 Output_section_lookup_maps class.
9935 (Output_section::get_input_sections): Export merge sections. Adjust
9936 code to use Output_section_lookup_maps class.
9937 (Output_section:::add_script_input_section): Adjust code to use
9938 Output_section_lookup_maps class. Update lookup maps for merge
9940 (Output_section::discard_states): Use Output_section_lookup_maps.
9941 (Output_section::restore_states): Same.
9942 * output.h (Merge_section_properties): Move class defintion out of
9944 (Output_section_lookup_maps): New class.
9945 (Output_section::Input_section::is_merge_section): New method
9947 (Output_section::Input_section::relobj): Move defintion out of class
9948 defintion. Declare method only.
9949 (Output_section::Input_section::shndx): Ditto.
9950 (Output_section::Input_section::output_merge_base): New method defintion.
9951 (Output_section::Input_section::u2_.pomb): New union field.
9952 (Output_section::Merge_section_by_properties_map,
9953 Output_section::Output_section_data_by_input_section_map,
9954 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9956 (Output_section::add_merge_input_section): Add new parameter
9957 KEEPS_INPUT_SECTIONS.
9958 (Output_section::build_lookup_maps): New method declaration.
9959 (Output_section::merge_section_map_,
9960 Output_section::merge_section_by_properties_map_,
9961 Output_section::relaxed_input_section_map_,
9962 Output_section::is_relaxed_input_section_map_valid_): Remove data
9964 (Output_section::lookup_maps_): New data member.
9966 2010-05-21 Doug Kwan <dougkwan@google.com>
9969 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9970 avoid a compilation error.
9972 2010-05-19 Rafael Espindola <espindola@google.com>
9974 * script-sections.cc (Output_section_definition::allocate_to_segment):
9975 Update the phdrs_list even when the output section is NULL.
9976 * testsuite/Makefile.am: Add test.
9977 * testsuite/Makefile.in: Regenerate.
9978 * testsuite/script_test_9.cc: New.
9979 * testsuite/script_test_9.sh: New.
9980 * testsuite/script_test_9.t: New.
9982 2010-05-19 Doug Kwan <dougkwan@google.com>
9984 * arm.cc (Arm_input_section::original_size): New method.
9985 (Arm_input_section::do_addralign): Add a cast.
9986 (Arm_input_section::do_output_offset): Remove static cast.
9987 (Arm_input_section::original_addralign,
9988 Arm_input_section::original_size_): Change type to uint32_t.
9989 (Arm_input_section::init): Add safe casts for section alignment
9991 (Arm_input_section::set_final_data_size): Do not set address and
9992 offset of stub table.
9993 (Arm_output_section::fix_exidx_coverage): Change use of of
9994 Output_section::Simple_input_section to that of
9995 Output_section::Input_section.
9996 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9997 except for the first pass.
9998 * output.cc (Output_section::get_input_sections): Change type of
9999 input_sections to std::list<Input_section>.
10000 (Output_section::add_script_input_section): Rename from
10001 Output_section::add_simple_input_section. Change type of SIS
10002 parameter from Simple_input_section to Input_section.
10003 * output.h (Output_section::Simple_input_section): Remove class.
10004 (Output_section::Input_section): Change class visibility to public.
10005 (Output_section::Input_section::addralign): Use stored alignments
10006 for special input sections if set.
10007 (Output_section::Input_section::set_addralign): New method.
10008 (Output_section::get_input_sections): Change parameter type from
10009 list of Simple_input_section to list of Input_section.
10010 (Output_section::add_script_input_section): Rename from
10011 Output_section::add_simple_input_section. Change first parameter's
10012 type from Simple_input_section to Input_section and remove the
10013 second and third parameters.
10014 * script-sections.cc (Input_section::Input_section_list): Change
10015 type to list of Output_section::Input_section/
10016 (Input_section_info::Input_section_info): Change parameter type of
10017 INPUT_SECTION to Output_section::Input_section.
10018 (Input_section_info::input_section): Change return type.
10019 (Input_section_info::input_section_): Change type to
10020 Output_section::Input_section.
10021 (Output_section_element_input::set_section_addresses): Adjust code
10022 to use Output_section::Input_section instead of
10023 Output_section::Simple_input_section. Adjust code for renaming
10024 of Output_section::add_simple_input_section.
10025 (Orphan_output_section::set_section_addresses): Ditto.
10027 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10029 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10030 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10032 2010-05-18 Rafael Espindola <espindola@google.com>
10034 * options.cc (General_options::finalize): Handle -nostdlib.
10035 * options.h (nostdlib): New option.
10036 * script.cc (script_add_search_dir): Handle -nostdlib.
10038 2010-05-12 Doug Kwan <dougkwan@google.com>
10040 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10041 attributes section only if there no attributes section after merging.
10042 (Target_arm::merge_object_attributes): Move value of
10043 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
10044 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10045 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10046 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10047 and arm_attr_merge_7.stdout.
10048 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10049 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10050 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10051 arm_attr_merge_7b.o): New rules.
10052 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10054 * testsuite/Makefile.in: Regenerate.
10055 * testsuite/arm_attr_merge.sh: New file.
10056 * testsuite/arm_attr_merge_[67][ab].s: Same.
10058 2010-05-05 Nick Clifton <nickc@redhat.com>
10060 * po/es.po: Updated Spanish translation.
10062 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10064 * Makefile.am (install-exec-local): Properly install gold as
10065 default cross linker.
10066 * Makefile.in: Regenerated.
10068 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10069 Nick Clifton <nickc@redhat.com>
10071 * configure.ac (install_as_default): Define and set to false
10072 unless --enable-gold or --enable-gold=both/gold has been
10074 * configure: Regenerate.
10076 * Makefile.am (install-exec-local): Install the executable as
10077 'ld.gold'. If install_as_default is true then also install it as
10079 * Makefile.in: Regenerated.
10081 2010-04-24 Ian Lance Taylor <iant@google.com>
10083 * layout.cc (Layout::layout_reloc): In relocatable link don't
10084 combine reloc sections for grouped sections.
10086 2010-04-23 Sriraman Tallam <tmsriram@google.com>
10088 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10089 sections that are not ordinary to icf.
10090 * icf.cc (get_section_contents): Handle relocation pointing to section
10091 with no object or shndx information.
10092 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10093 * testsuite/Makefile.in: Regenerate.
10094 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10095 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10097 2010-04-22 Ian Lance Taylor <iant@google.com>
10099 * expression.cc (Expression::Expression_eval_info): Add
10100 result_alignment_pointer field.
10101 (Expression::eval_with_dot): Add result_alignment_pointer
10102 parameter. Change all callers.
10103 (Expression::eval_maybe_dot): Likewise.
10104 (class Binary_expression): Add alignment_pointer parameter to
10105 left_value and right_value. Change all callers.
10106 (BINARY_EXPRESSION): Set result alignment.
10107 (class Trinary_expression): Add alignment_pointer parameter to
10108 arg2_value and arg3_value. Change all callers.
10109 (Trinary_cond::value): Set result alignment.
10110 (Max_expression::value, Min_expression::value): Likewise.
10111 (Align_expression::value): Likewise.
10112 * script-sections.cc (class Sections_element): Add dot_alignment
10113 parameter to set_section_addresses virtual function. Update
10115 (class Output_section_element): Likewise.
10116 (Script_sections::create_segments): Add dot_alignment parameter.
10117 Change all callers.
10118 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10119 (Script_sections::set_phdrs_clause_addresses): Likewise.
10120 * script-sections.h: Update declarations.
10121 * script.h: Update declarations.
10122 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10124 * testsuite/script_test_3.t: Set large alignment.
10125 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10126 segment has expected alignment.
10128 2010-04-22 Nick Clifton <nickc@redhat.com>
10130 * po/gold.pot: Updated by the Translation project.
10131 * po/vi.po: Updated Vietnamese translation.
10133 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10135 * testsuite/Makefile.am (check_PROGRAMS): Add
10136 icf_virtual_function_folding_test.
10137 * testsuite/Makefile.in: Regenerated.
10139 2010-04-15 Andrew Haley <aph@redhat.com>
10141 * options.h (merge_exidx_entries): New option.
10142 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10143 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10144 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10145 (Target_arm::merge_exidx_entries): New function.
10146 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10147 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10148 to Arm_exidx_fixup constructor.
10149 Add new arg, merge_exidx_entries.
10150 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10151 Arm_output_section::fix_exidx_coverage.
10153 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10155 * icf.cc (get_section_contents): Check for preemptible functions.
10156 Ignore addend when appropriate.
10157 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10159 (add_from_relobj): Check for section folded.
10160 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10161 * symtab.h (should_add_dynsym_entry): Add new parameter.
10162 * target-reloc.h (scan_relocs): Check for section folded.
10163 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10164 Check reloc types for function pointers in shared objects.
10165 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10167 (icf_preemptible_functions_test): New test case.
10168 (icf_string_merge_test): New test case.
10169 * testsuite.Makefile.in: Regenerate.
10170 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10171 bar_glob. Refactor code.
10172 * testsuite/icf_preemptible_functions_test.cc: New file.
10173 * testsuite/icf_preemptible_functions_test.sh: New file.
10174 * testsuite/icf_string_merge_test.cc: New file.
10175 * testsuite/icf_string_merge_test.sh: New file.
10176 * testsuite/icf_virtual_function_folding_test.cc: New file.
10177 * testsuite/icf_virtual_function_folding_test.sh: New file.
10179 2010-04-14 Doug Kwan <dougkwan@google.com>
10181 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10182 for local symbol recounting if we remove a section due to ICF.
10183 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10184 there are no regular objects in input.
10186 2010-04-13 Doug Kwan <dougkwan@google.com>
10188 * arm.cc (Arm_input_section::set_final_data_size): Compute
10189 accurate final data size instead of using current data size.
10191 2010-04-09 Doug Kwan <dougkwan@google.com>
10193 * layout.cc (Layout::choose_output_section): Handle script section
10195 (Layout::make_output_section_for_script): Add section type parameter.
10196 Handle script section types.
10197 * layout.h (Layout::make_output_section_for_script): Add section
10199 * output.cc (Output_section::Output_section): Initialize data member
10201 (Output_section::do_reset_address_and_file_offset): Do not set address
10202 to 0 if section is a NOLOAD section.
10203 * output.h (Output_section::is_noload): New method.
10204 (Output_section::set_is_noload): Ditto.
10205 (Output_section::is_noload_): New data member.
10206 * script-c.h (Script_section_type): New enum type.
10207 (struct Parser_output_section_header): Add new file section_type.
10208 * script-sections.cc (Sections_element::output_section_name): Add
10209 parameter for returning script section type.
10210 (Output_section_definition::output_section_name): Ditto.
10211 (Output_section_definition::section_type)P; New method.
10212 (Output_section_definiton::script_section_type_name): Ditto.
10213 (Output_section_definition::script_section_type_): New data member.
10214 (Output_section_definition::Output_section_definition): Initialize
10215 data member Output_section_definition::script_section_type_.
10216 (Output_section_definition::create_sections): Pass script section type
10217 to Layout::make_output_section_for_script.
10218 (Output_section_definition::output_section_name): Return script
10219 section type to caller.
10220 (Output_section_definition::set_section_address): Do not advance
10221 dot value and load address if section type is NOLOAD. Set address
10222 of NOLOAD sections regardless of section flags.
10223 (Output_section_definition::print): Print section type if it is
10224 not SCRIPT_SECTION_TYPE_NONE.
10225 (Output_section_definition::section_type): New method.
10226 (Output_section_definition::script_section_type_name): Ditto.
10227 (Script_sections::output_section_name): Add new parameter
10228 PSECTION_TYPE for returning script section type. Pass it to
10229 section elements. Handle discard sections.
10230 (Sort_output_sections::operator()): Handle NOLOAD sections.
10231 * script-sections.h (Script_sections::Section_type): New enum type.
10232 (Script_sections::output_section_name): Add a new parameter for
10233 returning script section type.
10234 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10236 * yyscript.y (union): Add new field SECTION_TYPE.
10237 (COPY, DSECT, INFO, NOLOAD): New tokens.
10238 (opt_address_and_section_type): Change type to output_section_header.
10239 (section_type): New non-terminal
10240 (section_header): Handle section type.
10241 (opt_address_and_section_type): Return section type value.
10243 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10245 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10246 * testsuite/plugin_common_test_2.c (foo): Likewise.
10248 2010-04-08 Doug Kwan <dougkwan@google.com>
10250 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10252 * output.cc (Output_section::add_merge_input_section): Simplify
10253 code and return status of Output_merge_base::add_input_section.
10254 Update merge section map only if Output_merge_base::add_input_section
10257 2010-04-07 Doug Kwan <dougkwan@google.com>
10259 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10260 if section is marked as containing instructions but has no mapping
10262 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10263 correct section index.
10264 (Arm_relobj::find_linked_text_section): Ditto.
10266 2010-04-07 Cary Coutant <ccoutant@google.com>
10268 * archive.cc (include_member): Destroy Read_symbols_data object before
10270 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10271 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10272 (Read_symbols_data::~Read_symbols_data) New destructor.
10273 (Section_relocs::Section_relocs) New constructor.
10274 (Section_relocs::~Section_relocs) New destructor.
10275 (Read_relocs_data::Read_relocs_data) New constructor.
10276 (Read_relocs_data::~Read_relocs_data) New destructor.
10277 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10278 pointers to NULL after deleting.
10280 2010-04-07 Doug Kwan <dougkwan@google.com>
10282 * arm.cc: Replace "endianity" with "endianness" in comments.
10283 (Arm_exidx_cantunwind): Ditto.
10284 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10285 (Arm_relobj::merge_flags_and_attributes): New method.
10286 (Arm_relobj::merge_flags_and_attributes_): New data member.
10287 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10288 (Arm_relobj::scan_sections_for_stubs): Ditto.
10289 (Arm_relobj::do_read_symbols): Check to see if we really want to
10290 merge processor-specific flags and attributes. Exit early if
10291 an object is empty except for section names and the undefined symbol.
10292 (Target_arm::do_finalize_sections): Move check for ELF format to
10293 Arm_relobj::do_read_symbols. Merge processor specific flags and
10294 attributes from a regular object only when we have determined that
10295 it is aapropriate. Do not create an .ARM.attributes section in
10296 output if there is no regular input object.
10297 (Target_arm::merge_processor_specific_flags): Check
10298 --warn-mismatch before printing any error.
10299 (Target_arm::merge_object_attributes): Ditto.
10300 * gold.cc (queue_middle_tasks): Handle the case in which there is
10301 no regular object in input.
10302 * options.cc (General_options::parse_EB): New method.
10303 (General_options::parse_EL): Same.
10304 (General_options::General_options): Initialize endianness_.
10305 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10307 (General_options::Endianness): New enum.
10308 (General_options::endianness): New method.
10309 (General_options::endianness_): New data member.
10310 * parameters.cc (Parameters::set_options): Check target endianness.
10311 (Parameters::set_target_once): Ditto.
10312 (Parameters::check_target_endianness): New method.
10313 (parameters_force_valid_target): If either -EL or -EB is specified,
10314 use it to define endianness of default target.
10315 * parameters.h (Parameters::check_target_endianness): New method
10317 * target.h (class Target): Change "endianity" to "endianness"
10320 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10322 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10323 * configure: Regenerate.
10324 * Makefile.in: Regenerate.
10325 * testsuite/Makefile.in: Regenerate.
10327 2010-04-06 Cary Coutant <ccoutant@google.com>
10330 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10331 prevailing definitions of common symbols.
10332 * testsuite/plugin_test_6.sh: New test case.
10333 * testsuite/plugin_common_test_1.c: New test case.
10334 * testsuite/plugin_common_test_2.c: New test case.
10335 * testsuite/Makefile.am (plugin_test_6): New test case.
10336 * testsuite/Makefile.in: Regenerate.
10338 2010-04-06 Nick Clifton <nickc@redhat.com>
10340 * po/vi.po: New Vietnamese translation.
10342 2010-03-30 Doug Kwan <dougkwan@google.com>
10344 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10346 2010-03-25 Doug Kwan <dougkwan@google.com>
10348 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10349 to avoid a conversion warning on a 32-bit host.
10351 2010-03-24 Ian Lance Taylor <iant@google.com>
10353 * testsuite/script_test_3.t: Add a TLS segment.
10354 * testsuite/Makefile.am (check_PROGRAMS): Add
10355 tls_phdrs_script_test.
10356 (tls_phdrs_script_test_SOURCES): Define.
10357 (tls_phdrs_script_test_DEPENDENCIES): Define.
10358 (tls_phdrs_script_test_LDFLAGS): Define.
10359 (tls_phdrs_script_test_LDADD): Define.
10360 * testsuite/Makefile.in: Rebuild.
10362 2010-03-23 Cary Coutant <ccoutant@google.com>
10364 * fileread.cc (find_or_make_view): Fix comment.
10366 2010-03-23 Ian Lance Taylor <iant@google.com>
10368 * script-sections.cc (class Orphan_section_placement): Define
10369 PLACE_TLS and PLACE_TLS_BSS.
10370 (Orphan_section_placement::Orphan_section_placement): Initialize
10372 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10373 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10374 (tls_script_test_SOURCES): Define.
10375 (tls_script_test_DEPENDENCIES): Define.
10376 (tls_script_test_LDFLAGS): Define.
10377 (tls_script_test_LDADD): Define.
10378 * testsuite/Makefile.in: Rebuild.
10380 2010-03-22 Doug Kwan <dougkwan@google.com>
10382 * arm.cc (Arm_relocate_functions::abs8,
10383 Arm_relocate_functions::abs16): Use correct check for overflow
10384 specified in the ARM ELF specs.
10385 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10386 target of a BLX instruction specially.
10387 (Reloc_stub::stub_type_for_reloc): Ditto.
10388 (Relocate::relocate): Use symbolic names instead of numeric relocation
10389 codes to report error.
10390 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10392 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10393 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10394 thumb2_blx_out_of_range.stdout
10395 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10396 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10397 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10398 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10399 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10400 thumb2_blx_in_range, thumb2_blx_in_range.o,
10401 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10402 thumb2_blx_out_of_range.o): New rules.
10403 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10404 thumb2_blx_in_range and thumb2_blx_out_of_range.
10405 * testsuite/Makefile.in: Regenerate.
10406 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10407 * testsuite/thumb_blx_in_range.s: New file.
10408 * testsuite/thumb_blx_out_of_range.s: New file.
10410 2010-03-22 Rafael Espindola <espindola@google.com>
10412 * archive.cc (Should_include): Move to archive.h.
10413 (should_include_member): Make it a member of Archive.
10415 (Add_lib_group_symbols): New.
10416 * archive.h: Include options.h.
10417 (Archive_member): Moved from Archive.
10418 (Should_include): Moved from archive.cc.
10420 (Add_lib_group_symbols): New.
10421 * dynobj.cc (do_should_include_member): New.
10422 * dynobj.h (do_should_include_member): New.
10423 * gold.cc (queue_initial_tasks): Update call to queue.
10424 * main.cc (main): Print lib group stats.
10425 * object.cc (do_should_include_member): New.
10426 * object.h: Include archive.h.
10427 (Object::should_include_member): New.
10428 (Object::do_should_include_member): New.
10429 (Sized_relobj::do_should_include_member): New.
10430 * options.cc (General_options::parse_start_lib): New.
10431 (General_options::parse_end_lib): New.
10432 (Input_arguments::add_file): Handle lib groups.
10433 (Input_arguments::start_group): Check we are not in a lib.
10434 (Input_arguments::start_lib): New.
10435 (Input_arguments::end_lib): New.
10436 * options.h (General_options): Add start_lib and end_lib.
10437 (Input_argument::lib_): New.
10438 (Input_argument::lib): New.
10439 (Input_argument::is_lib): New.
10440 (Input_file_lib): New.
10441 (Input_arguments::in_lib_): New.
10442 (Input_arguments::in_lib): New.
10443 (Input_arguments::start_lib): New.
10444 (Input_arguments::end_lib_): New.
10445 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10446 in unused members as preempted.
10447 (Sized_pluginobj::do_should_include_member): New.
10448 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10449 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10450 return the blocker.
10451 (Read_symbols::do_whole_lib_group): New.
10452 (Read_symbols::do_lib_group): New.
10453 (Read_symbols::do_read_symbols): Handle lib groups.
10454 (Read_symbols::get_name): Handle lib groups.
10455 * readsyms.h (Read_symbols): Add an archive member pointer.
10456 (Read_symbols::do_whole_lib_group): New.
10457 (Read_symbols::do_lib_group): New.
10458 (Read_symbols::member_): New.
10459 * script.cc (read_input_script): Update call to queue_soon.
10461 2010-03-19 Doug Kwan <dougkwan@google.com>
10463 * arm.cc (Stub_table::Stub_table): Initialize new data members
10464 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10465 (Stub_table::add_reloc_stub): Assign stub offset and update
10466 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10467 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10469 (Stub_table::update_data_size_and_addralign): Use
10470 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10471 instead of going over all reloc stubs.
10472 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10473 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10474 Stringpool_template::offset_ to size of Stringpool_char.
10475 (Stringpool_template::new_key_offset): Remove code to initialize
10476 Stringpool_template::offset_.
10477 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10478 Stringpool_template::offset_ to zero.
10480 2010-03-15 Doug Kwan <dougkwan@google.com>
10482 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10484 (Stringpool_template::new_key_offset): New method.
10485 (Stringpool_template::add_string): Assign offsets when adding new
10487 (Stringpool_template::set_string_offsets): Do not set string offsets
10488 when not optimizing.
10489 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10491 (Chunked_vector::clear): Clear size_.
10492 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10493 (Chunked_vector::size): Return size_.
10494 (Chunked_vector::push_back): Use size_ to find insert position.
10495 (Chunked_vector::size_): New data member.
10496 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10497 (Stringpool_template::new_key_offset): New method declaration.
10498 (Stringpool_template::offset_): New data member.
10500 2010-03-15 Rafael Espindola <espindola@google.com>
10502 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10503 Add_symbols' constructor.
10504 * readsyms.h (Add_symbols): Remove the input_group member.
10506 2010-03-10 Ian Lance Taylor <iant@google.com>
10508 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10509 target to ask whether a reference to a symbol requires a stack
10511 * target.h (Target::is_call_to_non_split): New function.
10512 (Target::do_is_call_to_non_split): Declare virtual function.
10513 * target.cc: Include "symtab.h".
10514 (Target::do_is_call_to_non_split): New function.
10515 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10517 2010-03-10 Cary Coutant <ccoutant@google.com>
10519 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10520 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10521 (File_read::open[2]): Add whole_file_view_ to list of views.
10522 (File_read::make_view): Remove test of whole_file_view_.
10523 (File_read::find_or_make_view): Create whole_file_view_ if
10525 (File_read::clear_views): Replace bool parameter with enum;
10526 adjust all callers. Don't delete views with permanent data;
10527 do delete cached views and views from archives if
10528 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10529 if clearing the corresponding view.
10530 * fileread.h (File_read::Clear_views_mode): New enum.
10531 (File_read::View::is_permanent_view): New method.
10532 (File_read::clear_views): Replace bool parameter
10533 with enum; adjust all callers.
10534 * options.h (General_options): Change keep_files_mapped option;
10535 add map_whole_files.
10536 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10537 releasing the file.
10538 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10541 2010-03-10 David S. Miller <davem@davemloft.net>
10543 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10545 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10547 * icf.cc (get_section_contents): Add '@' marker after processing the
10550 2010-03-08 Doug Kwan <dougkwan@google.com>
10552 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10553 due to a conversion warning.
10554 (Arm_relobj::update_output_local_symbol_count): Check for local
10555 symbol with unset output index.
10557 2010-03-05 Ian Lance Taylor <iant@google.com>
10559 * options.h (class General_options): Add --spare-dynamic-tags.
10560 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10561 --spare-dynamic-tags.
10563 2010-03-05 Ian Lance Taylor <iant@google.com>
10565 * incremental.cc: Include "libiberty.h".
10567 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10569 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10570 function, is_info_ member.
10571 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10572 (Versions::Versions): Update caller.
10573 (Versions::define_base_version): Likewise.
10574 (Versions::add_def): Likewise.
10576 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10578 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10579 (Scan::possible_function_pointer_reloc): New function.
10580 (Scan::local_reloc_may_be_function_pointer): Change to call
10581 possible_function_pointer_reloc.
10582 (Scan::global_reloc_may_be_function_pointer): Ditto.
10583 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10584 relocations in ".data.rel.ro._ZTV" section.
10585 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10586 * testsuite/icf_safe_so_test.cc: Ditto.
10587 * testsuite/icf_safe_test.cc: Ditto.
10588 * testsuite/icf_safe_test.sh: Ditto.
10590 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10591 Ian Lance Taylor <iant@google.com>
10593 * target-reloc.h (relocate_section): Check the symbol table index
10594 for -1U before setting the local symbol index.
10595 (scan_relocatable_relocs): If copying the relocation, record that
10596 the local symbol is required.
10597 * object.h (Symbol_value::is_output_symtab_index_set): New
10599 (Symbol_value::may_be_discarded_from_output_symtab): New
10601 (Symbol_value::has_output_symtab_entry): New function.
10602 (Symbol_value::needs_output_symtab_entry): Remove.
10603 (Symbol_value::output_symtab_index): Make sure the symbol index is
10605 (Symbol_value::set_output_symtab_index): Make sure the symbol
10606 index is not set. Make sure the new index is valid.
10607 (Symbol_value::set_must_have_output_symtab_entry): New function.
10608 (Symbol_value::has_output_dynsym_entry): New function.
10609 (Symbol_value::set_output_dynsym_index): Make sure the new index
10611 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10612 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10613 local symbol if permitted.
10614 (Sized_relobj::do_finalize_local_symbols): Call
10615 is_output_symtab_index_set rather than needs_output_symtab_entry.
10616 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10617 rather than needs_output_symtab_entry. Call
10618 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10619 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10620 is_output_symtab_index_set rather than needs_output_symtab_entry.
10621 * testsuite/discard_locals_relocatable_test.c: New file.
10622 * testsuite/discard_locals_test.sh: Test -r.
10623 * testsuite/Makefile.am (check_DATA): Add
10624 discard_locals_relocatable_test1.syms,
10625 discard_local_relocatable_test2.syms.
10626 (MOSTLYCLEANFILES): Likewise. Also add
10627 discard_locals_relocatable_test1.lout and
10628 discard_locals_relocatable_test2.out.
10629 (discard_locals_relocatable_test1.syms): New target.
10630 (discard_locals_relocatable_test.o): New target.
10631 (discard_locals_relocatable_test1.out): New target.
10632 (discard_locals_relocatable_test2.syms): New target.
10633 (discard_locals_relocatable_test2.out): New target.
10634 (various): Add missing ../ld-new dependencies.
10635 * testsuite/Makefile.in: Rebuild.
10637 2010-03-03 Nick Clifton <nickc@redhat.com>
10639 * po/fi.po: New Finnish translation.
10641 2010-03-01 Doug Kwan <dougkwan@google.com>
10643 * layout.cc (Layout::Layout): Force section types of .init_array*,
10644 .preinit_array* and .fini_array* sections.
10645 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10646 Fix check of return value of std::string::find.().
10647 (Output_section::Input_section_sort_compare::operator()): Remove
10648 comment about .init_array.
10649 (Output_section::Input_section_sort_init_fini_compare::operator()):
10651 (Output_section::sort_attached_input_sections): Handle .init_array
10652 and .fini_array specially.
10653 * output.h (Output_section::Inut_section_sort_compare): Update
10655 (Output_section::Input_section_sort_init_fini_compare): New struct.
10657 2010-02-26 Doug Kwan <dougkwan@google.com>
10659 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10660 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10661 * testsuite/debug_msg.sh: Avoid matching source line number for
10662 use of global variable undef_int.
10664 2010-02-26 Doug Kwan <dougkwan@google.com>
10666 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10667 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10668 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10669 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10670 * options.cc (General_options::General_options): Initialize member
10672 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10673 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10674 and rm_no_fix_v4bx.stdout
10675 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10676 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10677 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10678 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10679 and arm_no_fix_v4bx.
10680 * Makefile.in: Regenerate.
10681 * testsuite/arm_fix_v4bx.s: New file.
10682 * testsuite/arm_fix_v4bx.sh: Ditto.
10684 2010-02-24 Doug Kwan <dougkwan@google.com>
10686 * arm.cc (Target_arm::got_section): Make the .got section the first
10687 non RELRO section in the data segment.
10688 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10689 suffixes of section names.
10691 2010-02-24 Doug Kwan <dougkwan@google.com>
10693 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10694 flags and attributes merging if an input file is a binary file.
10695 * fileread.cc (Input_file::open): Record format of original file.
10696 * fileread.h (Input_file::Format): New enum type.
10697 (Input_file::Input_file): Initialize data member format_.
10698 (Input_file::format): New method definition.
10699 (Input_file::format_):: New data member.
10701 2010-02-24 Doug Kwan <dougkwan@google.com>
10703 * arm.cc (Arm_output_data_got): New class.
10704 (ARM_TCB_SIZE): New constant
10705 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10706 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10707 If user uses a script with a SECTIONS clause, issue only a warning
10708 for a misplaced EXIDX input section. Otherwise, issue an error.
10709 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
10710 garbage collection.
10711 (Target_arm::got_mode_index_entry): Handle static linking.
10712 (Target_arm::Scan::local): Ditto.
10713 (Target_arm::Scan::global): Ditto.
10714 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10715 all incorrectly implemented relocations.
10716 (Target_arm::fix_exidx_coverage): Pass layout to
10717 Arm_output_section::fix_exidx_coverage.
10718 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10719 from ".ARM.exidx." and ".ARM.extab.".
10721 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10723 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10724 section if it does not already exist.
10725 * attributes.cc (Attributes_section_data::Attributes_section_data):
10726 Don't crash if size is zero.
10728 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10729 Ian Lance Taylor <iant@google.com>
10731 * gold.cc (queue_middle_tasks): If no input files were opened,
10733 * workqueue.h (Task_function::Task_function): Assert that there is
10736 2010-02-22 Doug Kwan <dougkwan@google.com>
10738 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10739 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10740 types to avoid warnings due to different uint64_t implementations
10741 on different hosts.
10743 2010-02-21 Doug Kwan <dougkwan@google.com>
10745 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10746 handling of the maximum backward branch offset.
10747 (Arm_relocate_functions::thumb_branch_common): Ditto.
10748 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10749 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
10750 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
10751 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10752 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10753 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10754 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10755 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10756 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10757 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10758 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10759 thumb2_bl_out_of_range.o): New rules.
10760 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10761 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10762 thumb2_bl_out_of_range
10763 * testsuite/Makefile.in: Regenerate.
10764 * testsuite/arm_bl_in_range.s: New file.
10765 * testsuite/arm_bl_out_of_range.s: Ditto.
10766 * testsuite/arm_branch_in_range.sh: Ditto.
10767 * testsuite/arm_branch_range.t: Ditto.
10768 * testsuite/thumb2_branch_range.t: Ditto.
10769 * testsuite/thumb_bl_in_range.s: Ditto.
10770 * testsuite/thumb_bl_out_of_range.s: Ditto.
10771 * testsuite/thumb_branch_range.t: Ditto.
10773 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10775 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10776 Add reloc offset information.
10777 * icf.cc (get_section_contents): Change iterators to point to the new
10778 vectors. Add reloc offset information to the contents.
10779 * icf.h (Icf::Sections_reachable_info): New typedef.
10780 (Icf::Sections_reachable_list): New typedef.
10781 (Icf::Offset_info): New typedef.
10782 (Icf::Reloc_info): New struct typedef.
10783 (Icf::Reloc_info_list): New typedef.
10784 (Icf::symbol_reloc_list): Delete method.
10785 (Icf::addend_reloc_list): Delete method.
10786 (Icf::section_reloc_list): Delete method.
10787 (Icf::reloc_info_list): New method.
10788 (Icf::reloc_info_list_): New member.
10790 2010-02-19 Doug Kwan <dougkwan@google.com>
10792 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10793 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10794 * arm.cc (Arm_relocation_functions): New forward declaration.
10795 (Target_arm::Target_arm): Initialize new data members
10796 got_mod_index_offset_ and tls_base_symbol_defined_.
10797 (Target_arm::Relocate::relocate_tls): New method.
10798 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10799 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10801 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
10802 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10803 (Target_arm::got_mod_index_offset_,
10804 Target_arm::tls_base_symbol_defined_): New data members.
10805 (Target_arm::Scan::local, Target::Scan::global,
10806 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10809 2010-02-18 Doug Kwan <dougkwan@google.com>
10811 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10812 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10813 text section as a parameter becuase some broken tools may not set
10814 the link in section header.
10815 (Target_arm::has_got_section): New method.
10816 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10817 without any mapping symbol as data only. Remove warning.
10818 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10819 link in its section header, try to discover the link by inspecting the
10820 REL31 relocation at the beginning of the section.
10821 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10823 (Target_arm::Scan::global): Treat any reference to the symbol
10824 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10826 2010-02-12 Sriraman Tallam <tmsriram@google.com>
10828 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10829 (Scan::global_reloc_may_be_function_pointer): New function.
10830 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10831 (Scan::global_reloc_may_be_function_pointer): New function.
10832 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10833 (Scan::global_reloc_may_be_function_pointer): New function.
10834 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10835 (Scan::global_reloc_may_be_function_pointer): New function.
10836 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10837 (Scan::global_reloc_may_be_function_pointer): New function.
10838 (Scan::possible_function_pointer_reloc): New function.
10839 (Target_x86_64::can_check_for_function_pointers): New function.
10840 * gc.h (gc_process_relocs): Scan relocation types to determine if
10841 function pointers were taken for targets that support it.
10842 * icf.cc (Icf::find_identical_sections): Include functions for
10843 folding in safe ICF whose pointer is not taken.
10844 * icf.h (Secn_fptr_taken_set): New typedef.
10845 (fptr_section_id_): New member.
10846 (section_has_function_pointers): New function.
10847 (set_section_has_function_pointers): New function.
10848 (check_section_for_function_pointers): New function.
10849 * options.h: Fix comment for safe ICF option.
10850 * target.h (can_check_for_function_pointers): New function.
10851 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10852 Modify icf_safe_test for X86-64.
10853 * testsuite/Makefile.in: Regenerate.
10854 * testsuite/icf_safe_so_test.cc: New file.
10855 * testsuite/icf_safe_so_test.sh: New file.
10856 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10857 (main): Change to take pointer to function kept_func_3.
10858 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10859 folding is done correctly for X86-64.
10861 2010-02-12 David S. Miller <davem@davemloft.net>
10863 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10864 is_symbolless parameter.
10865 (Output_reloc<SHT_REL>::is_symbolless): New.
10866 (Output_reloc<SHT_REL>::is_symbolless_): New.
10867 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10868 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10869 (Output_reloc<SHT_RELA>::is_symbolless): New.
10870 (Output_data_reloc::add_global): Handle is_symbolless.
10871 (Output_data_reloc::add_global_relative): Likewise.
10872 (Output_data_reloc::add_local): Likewise.
10873 (Output_data_reloc::add_local_relative): Likewise.
10874 (Output_data_reloc::add_symbolless_global_addend): New.
10875 (Output_data_reloc::add_symbolless_local_addend): New.
10876 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10878 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10879 instead of ->is_relative_
10880 (Output_reloc::write): Likewise.
10881 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10882 (Output_reloc::write_rel): Simplify.
10884 * sparc.cc (Target_sparc::Scan::local): Use
10885 ->add_symbolless_local_addend as needed.
10886 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10887 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10888 based upon relocation offset.
10890 2010-02-11 Doug Kwan <dougkwan@google.com>
10892 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10893 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10894 beginning of function.
10895 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10896 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10897 parameter is_32bit in calls to should_apply_static_reloc.
10898 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10899 (check_DATA): Add arm_abs_global.stdout.
10900 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10901 arm_abs_global.stdout): New rules.
10902 (MOSTLLYCLEANFILES): Add arm_abs_global
10903 * Makefile.in: Regenerate.
10904 * testsuite/arm_abs_global.s: New file.
10905 * testsuite/arm_abs_global.sh: Ditto.
10906 * testsuite/arm_abs_lib.s: Ditto.
10908 2010-02-11 Ian Lance Taylor <iant@google.com>
10910 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10912 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10913 Allocate_commons_task first.
10914 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10915 task, rather than symtab_lock_.
10916 (Gc_process_relocs::~Gc_process_relocs): New function.
10917 (Gc_process_relocs::is_runnable): Check this_blocker_.
10918 (Gc_process_relocs::locks): Use next_blocker_ rather than
10920 (Scan_relocs::~Scan_relocs): New function.
10921 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10923 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10925 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10926 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10927 constructor accordingly.
10928 (class Gc_process_relocs): Likewise.
10929 (class Scan_relocs): Likewise.
10930 * common.h (class Allocate_commons_task): Remove symtab_lock_
10931 field, and corresponding constructor parameter.
10932 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10934 (Allocate_commons_task::locks): Likewise.
10936 2010-02-11 Ian Lance Taylor <iant@google.com>
10938 * gold-threads.h (class Once): Define.
10939 (class Initialize_lock): Rewrite as child of Once.
10940 * gold-threads.cc (class Once_initialize): Define.
10941 (once_pointer_control): New static variable.
10942 (once_pointer, once_arg): New static variables.
10943 (c_run_once): New static function.
10944 (Once::Once, Once::run_once, Once::internal_run): New functions.
10945 (class Initialize_lock_once): Remove.
10946 (initialize_lock_control): Remove.
10947 (initialize_lock_pointer): Remove.
10948 (initialize_lock_once): Remove.
10949 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10950 (Initialize_lock::initialize): Rewrite.
10951 (Initialize_lock::do_run_once): New function.
10952 * archive.cc (Archive::interpret_header): Only clear name if it is
10954 * fileread.cc: Include "gold-threads.h"
10955 (file_counts_lock): New static variable.
10956 (file_counts_initialize_lock): Likewise.
10957 (File_read::release): Only increment counts when using --stats.
10958 Use a lock around the increment.
10959 * parameters.cc (class Set_parameters_target_once): Define.
10960 (set_parameters_target_once): New static variable.
10961 (Parameters::Parameters): Move here from parameters.h.
10962 (Parameters::set_target): Rewrite.
10963 (Parameters::set_target_once): New function.
10964 (Parameters::clear_target): Move here and rewrite.
10965 * parameters.h (class Parameters): Update declarations. Add
10966 set_parameters_target_once_ field.
10967 (Parameters::Parameters): Move to parameters.cc.
10968 (Parameters::clear_target): Likewise.
10969 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10971 (Start_group::~Start_group): New function.
10972 (Start_group::is_runnable): New function.
10973 (Start_group::locks, Start_group::run): New functions.
10974 (Finish_group::run): Change saw_undefined to size_t.
10975 * readsyms.h (class Start_group): Define.
10976 (class Finish_group): Change saw_undefined_ field to size_t.
10977 (Finish_group::Finish_group): Remove saw_undefined and
10978 this_blocker parameters. Change all callers.
10979 (Finish_group::set_saw_undefined): New function.
10980 (Finish_group::set_blocker): New function.
10981 * symtab.h (class Symbol_table): Change saw_undefined to return
10982 size_t. Change saw_undefined_ field to size_t.
10983 * target-select.cc (Set_target_once::do_run_once): New function.
10984 (Target_selector::Target_selector): Initialize set_target_once_
10985 field. Don't initialize lock_ and initialize_lock_ fields.
10986 (Target_selector::instantiate_target): Rewrite.
10987 (Target_selector::set_target): New function.
10988 * target-select.h (class Set_target_once): Define.
10989 (class Target_selector): Update declarations. Make
10990 Set_target_once a friend. Remove lock_ and initialize_lock_
10991 fields. Add set_target_once_ field.
10993 2010-02-10 Ian Lance Taylor <iant@google.com>
10995 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10996 queueing any tasks.
10997 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10998 (queue_middle_tasks): Add all blockers before queueing any tasks.
10999 (queue_final_tasks): Likewise.
11000 * token.h (Task_token::add_blockers): New function.
11001 * object.h (Input_objects::number_of_relobjs): New function.
11003 2010-02-10 Ian Lance Taylor <iant@google.com>
11005 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11006 shared, not if not position independent.
11007 * x86_64.cc (Relocate::relocate_tls): Likewise.
11008 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11009 (tls_pie_pic_test): New target.
11010 * testsuite/Makefile.in: Rebuild.
11012 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11013 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11014 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11015 * testsuite/Makefile.in: Rebuild.
11017 2010-02-09 David S. Miller <davem@davemloft.net>
11019 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11020 R_SPARC_RELATIVE using ->add_local_relative().
11021 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11023 * output.h (Output_data_dynamic::add_section_size): New method
11024 that takes two Output_data objects.
11025 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11026 entry param. Handle it in initializers.
11027 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11028 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11029 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11031 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11032 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11033 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11034 for dynrel_includes_plt.
11035 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11036 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11037 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11039 (Target_sparc::do_finalize_sections): Update to pass true for
11040 dynrel_includes_plt.
11041 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11042 output before .rela.plt
11043 (Target_powerpc::do_finalize_sections): Update to pass true for
11044 dynrel_includes_plt when 32-bit.
11046 2010-02-08 Doug Kwan <dougkwan@google.com>
11048 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11050 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11051 Arm_relobj::scan_section_for_cortex_a8_stubs,
11052 Arm_relobj::do_relocation_section): Instead of calling
11053 Output_section::output_address, use faster
11054 Arm_relobj::simple_input_section_output_address.
11056 2010-02-08 David S. Miller <davem@davemloft.net>
11058 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11059 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11060 relocation helper function.
11062 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11063 just like R_SPARC_GOT{10,13,22}.
11064 (Target_sparc::Scan::local): Likewise.
11065 (Target_sparc::Relocate:relocate): Likewise.
11067 2010-02-06 Ian Lance Taylor <iant@google.com>
11069 * configure.ac: Rewrite targetobjs duplicate removal code to use
11070 only shell constructs.
11071 * configure: Rebuild.
11073 2010-02-05 Doug Kwan <dougkwan@google.com>
11076 * arm.cc (Arm_relobj::section_is_scannable): New method.
11077 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11078 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11080 2010-02-04 Doug Kwan <dougkwan@google.com>
11083 * arm-reloc-property.cc (cstdio): Include.
11084 * configure.ac (targetobjs): Remove duplicates.
11085 * configure: Regenerate.
11086 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11087 big and little endian version for a given address size.
11089 2010-02-03 Doug Kwan <dougkwan@google.com>
11091 * arm-reloc-property.cc
11092 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11094 * arm-reloc-property.h
11095 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11096 New method definition.
11097 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11099 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11101 (GOT_PREL): Change implemented to Y.
11102 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11103 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11104 (Arm_relocate_functions::movw_abs_nc): Remove method.
11105 (Arm_relocate_functions::movt_abs): Ditto.
11106 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11107 (Arm_relocate_functions::thm_movt_abs): Ditto.
11108 (Arm_relocate_functions::movw_rel_nc): Ditto.
11109 (Arm_relocate_functions::movw_rel): Ditto.
11110 (Arm_relocate_functions::movt_rel): Ditto.
11111 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11112 (Arm_relocate_functions:thm_movw_rel): Ditto.
11113 (Arm_relocate_functions:thm_movt_rel): Ditto.
11114 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11115 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11116 New method definitions.
11117 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11118 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11119 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11120 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11121 (Target_arm::Relocate::relocate): Check for non-static or
11122 unimplemented relocation code and exit early. Change calls to
11123 Target_arm::reloc_uses_thumb_bit and
11124 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11125 instead. Refactor code to handle similar relocations to increase
11126 code sharing. Remove check for unsupported relocation code in switch
11128 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11129 relocation property table to find out size. Change error message to
11130 print out the name of a relocation code instead of the numeric value.
11131 (Target_arm::scan_reloc_for_stub): Use relocation property table
11132 instead of calling Target_arm::reloc_uses_thumb_bit().
11134 2010-02-02 Doug Kwan <dougkwan@google.com>
11136 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11137 types of relaxed input section.
11139 2010-02-02 Doug Kwan <dougkwan@google.com>
11141 * Makefile.am (HFILES): Add arm-reloc-property.h.
11143 (TARGETSOURCES): Add arm-reloc-property.cc
11144 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11145 (libgold_a_SOURCES): $(DEFFILES)
11146 * Makefile.in: Regenerate.
11147 * arm-reloc-property.cc: New file.
11148 * arm-reloc-property.h: New file.
11149 * arm-reloc.def: New file.
11150 * arm.cc: Update comments.
11151 (arm-reloc-property.h): New included header.
11152 (arm_reloc_property_table): New global variable.
11153 (Target_arm::do_select_as_default_target): New method definition.
11154 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11155 arm-reloc-property to targ_extra_obj.
11156 * parameters.cc (set_parameters_target): Call
11157 Target::select_as_default_target().
11158 * target.h (Target::select_as_default_target): New method definition.
11159 (Target::do_select_as_default_target): Same.
11161 2010-02-01 Doug Kwan <dougkwan@google.com>
11163 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11164 first_output_text_section_.
11165 (Arm_exidx_fixup::first_output_text_section): New method definition.
11166 (Arm_exidx_fixup::first_output_text_section_): New data member.
11167 (Arm_exidx_fixup::process_exidx_section): Record the first text
11168 output section seen.
11169 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11170 and entsize in output section header.
11172 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11174 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11175 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11176 (Arm_relocate_functions::thm_alu11): New Method.
11177 (Arm_relocate_functions::thm_pc8): New Method.
11178 (Arm_relocate_functions::thm_pc12): New Method.
11179 (Target_arm::Scan::local): Handle the relocations.
11180 (Target_arm::Scan::global): Likewise.
11181 (Target_arm::Relocate::relocate): Likewise.
11182 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11184 2010-01-29 Doug Kwan <dougkwan@google.com>
11186 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11187 of relocation types as ld.
11189 2010-01-29 Doug Kwan <dougkwan@google.com>
11191 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11193 (Arm_relocate_functions::thumb_branch_common): Ditto.
11194 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11195 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11196 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11197 Arm_relocate_functions::jump24): Remove.
11198 (Target_arm::Relocate::relocate): Adjust code to call
11199 Arm_relocation_functions::arm_branch_common and
11200 Arm_relocation_functions::thumb_branch_common instead of their removed
11201 wrappers. Merge switch-cases together to reduce source code size.
11203 2010-01-29 Doug Kwan <dougkwan@google.com>
11205 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11206 output_local_symbol_count_needs_update_.
11207 (Arm_relobj::output_local_symbol_count_needs_update,
11208 Arm_relobj::set_output_local_symbol_count_needs_update,
11209 Arm_relobj::update_output_local_symbol_count): New methods.
11210 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11212 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11213 of pointed function as in a R_ARM_PREL31 relocation.
11214 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11215 for output local symbol count updating.
11216 (Target_arm::do_relax): Update output local symbol counts in objects
11218 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11220 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11222 * arm.cc: Added support for the ARM relocations:
11223 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11224 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11225 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11227 (Arm_relocate_functions::movw_rel): New method.
11228 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11229 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11231 (Arm_relocate_functions::thm_movw_rel): New method.
11232 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11234 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11236 (Target_arm::Scan::global): Likewise.
11237 (Target_arm::Relocate::relocate): Likewise.
11238 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11241 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11243 * arm.cc: Added support for ARM group relocations.
11244 (Target_arm::reloc_needs_sym_origin): New method.
11245 (Arm_relocate_functions::calc_grp_kn): New method.
11246 (Arm_relocate_functions::calc_grp_residual): New method.
11247 (Arm_relocate_functions::calc_grp_gn): New method.
11248 (Arm_relocate_functions::arm_grp_alu): New Method.
11249 (Arm_relocate_functions::arm_grp_ldr): New Method.
11250 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11251 (Arm_relocate_functions::arm_grp_ldc): New Method.
11252 (Target_arm::Scan::local): Handle the ARM group relocations.
11253 (Target_arm::Scan::global): Likewise.
11254 (Target_arm::Relocate::relocate): Likewise.
11255 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11258 2010-01-26 Doug Kwan <dougkwan@google.com>
11260 * arm.cc (set): Include.
11261 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11263 (Arm_output_section::Text_section_list): New type.
11264 (Arm_output_section::append_text_sections_to_list): New method.
11265 (Arm_output_section::fix_exidx_coverage): Ditto.
11266 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11267 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11268 Relobj::set_section_offset() instead of
11269 Sized_relobj::invalidate_section_offset().
11270 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11271 parameter for section headers. Ignore relocation sections for
11272 unallocated sections and EXIDX sections.
11273 (Target_arm::fix_exidx_coverage): New method.
11274 (Target_arm::output_section_address_less_than): New type.
11275 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11276 linked text section instead of the EXIDX section.
11277 (Arm_output_section::create_stub_group): Add an assertion to check
11278 that this is not an EXIDX output section.
11279 (Arm_output_section::append_text_sections_to_list): New method.
11280 (Arm_output_section::fix_exidx_coverage): Ditto.
11281 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11282 Arm_relobj::section_needs_reloc_stub_scanning.
11283 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11285 (Target_arm::fix_exidx_coverage): New method.
11286 * object.h (Relobj::set_output_section): New method.
11287 (Sized_relobj::invalidate_section_offset): Remove method.
11288 (Sized_relobj::do_invalidate_section_offset): Remove method.
11289 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11291 2010-01-25 Doug Kwan <dougkwan@google.com>
11293 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11294 Fix warning due to signed and unsigned comparison on a 32-bit host.
11296 2010-01-22 Doug Kwan <dougkwan@google.com>
11298 * arm.cc (Target_arm::do_relax): Record an output section for section
11299 offset adjustment it contains any stub table that has changed.
11300 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11301 offsets in an output section if necessary.
11302 * output.cc (Output_section::Output_section): Initialize
11303 section_offsets_need_adjustments_.
11304 (Output_section::add_input_section_for_script): Renamed to
11305 Output_section::add_simple_input_section.
11306 (Output_section::save_states): Add a comment.
11307 (Output_section::discard_states): New method defintion.
11308 (Output_section::adjust_section_offsets): Same.
11309 * output.h (Output_section::add_input_section_for_script): Renamed to
11310 Output_section::add_simple_input_section.
11311 (Output_section::discard_states): New method declaration.
11312 (Output_section::adjust_section_offsets): Same.
11313 (Output_section::section_offsets_need_adjustment,
11314 Output_section::set_section_offsets_need_adjustment): New method
11316 (Output_section::section_offsets_need_adjustment_): New data member.
11317 * script-sections.cc
11318 (Output_section_element_input::set_section_address): Adjust code for
11319 renaming of Output_section::add_input_section_for_script.
11320 (Orphan_output_section::set_section_address): Same.
11322 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11324 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11325 Fix_v4bx enum values .
11326 * gold/options.h (General_options): New option definitions.
11327 (General_options::fix_v4bx): New method.
11328 (General_options::Fix_v4bx): New enum.
11329 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11330 (General_options::parse_fix_v4bx_interworking): New method.
11332 2010-01-22 Doug Kwan <dougkwan@google.com>
11334 * arm.cc (Arm_exidx_fixup): New class.
11336 2010-01-21 Doug Kwan <dougkwan@google.com>
11338 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11340 (Arm_exidx_section_offset_map): New type.
11342 2010-01-21 Doug Kwan <dougkwan@google.com>
11344 * arm.cc (Arm_exidx_input_section): New class.
11345 (Arm_relobj::exidx_input_section_by_link,
11346 Arm_relobj::exidx_input_section_by_shndx,
11347 Arm_relobj::make_exidx_input_section): New methods.
11348 (read_arm_attributes_section): Remove.
11349 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11350 information about them.
11351 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11354 2010-01-20 Doug Kwan <dougkwan@google.com>
11356 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11357 Input_section_specifier to Section_id.
11358 (Target_arm::new_arm_input_section: Adjust code for change of key
11360 (Target_arm::find_arm_input_section): Ditto.
11361 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11362 (Section_id): Remove.
11363 (Garbage_collection::Section_id_hash): Remove.
11364 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11365 (Section_id): Remove.
11366 (Icf::Section_id_hash): Remove.
11367 * object.h (Section_id, Const_section_id, Section_id_hash,
11368 Const_section_id_hash): New type definitions.
11369 * output.cc (Output_section::add_relaxed_input_section): Change to
11370 use Const_section_id instead of Input_section_specifier as key type.
11371 (Output_section::add_merge_input_section): Ditto.
11372 (Output_section::build_relaxation_map): Change to use Section_id
11373 instead of Input_section_specifier as key type.
11374 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11376 (Output_section::convert_input_sections_to_relaxed_sections): Change
11377 to use Const_section_id instead of Input_section_specifier as key type.
11378 (Output_section::find_merge_section): Ditto.
11379 (Output_section::find_relaxed_input_section): Ditto.
11380 * output.h (Input_section_specifier): Remove class.
11381 (Output_section::Output_section_data_by_input_section_map): Change
11382 key type to Const_section_id.
11383 (Output_section::Output_relaxed_input_section_by_input_section_map):
11385 (Output_section::Relaxation_map): Change key type to Section_id.
11387 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11389 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11390 (class Arm_v4bx_stub): New class.
11391 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11392 (Stub_factory::make_arm_v4bx_stub): New method.
11393 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11394 (Stub_table::empty): Handle v4bx stubs.
11395 (Stub_table::add_arm_v4bx_stub): New method.
11396 (Stub_table::find_arm_v4bx_stub): New method.
11397 (Arm_relocate_functions::v4bx): New method.
11398 (Target_arm::fix_v4bx): New method.
11399 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11400 (Stub_table::relocate_stubs): Likewise.
11401 (Stub_table::do_write): Likewise.
11402 (Stub_table::update_data_size_and_addralign): Likewise.
11403 (Stub_table::finalize_stubs): Likewise.
11404 (Target_arm::Scan::local): Likewise.
11405 (Target_arm::Scan::global): Likewise.
11406 (Target_arm::do_finalize_sections): Likewise.
11407 (Target_arm::Relocate::relocate): Likewise.
11408 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11410 (Target_arm::scan_reloc_for_stub): Likewise.
11411 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11413 2010-01-19 Ian Lance Taylor <iant@google.com>
11415 * output.cc (Output_section_headers::do_sized_write): Write large
11416 segment count to sh_info field.
11417 (Output_file_header::do_sized_write): For large segment count,
11418 write PN_XNUM to e_phnum field.
11420 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11422 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11423 (Arm_relocate_functions::thm_jump8): New function.
11424 (Arm_relocate_functions::thm_jump11): New function.
11425 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11427 (Target_arm::Scan::global): Likewise.
11428 (Target_arm::Relocate::relocate): Likewise.
11429 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11432 2010-01-14 Doug Kwan <dougkwan@google.com>
11434 * arm.cc (map, utility): Include headers.
11435 (Target_arm::apply_cortex_a8_workaround): New method.
11436 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11437 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11438 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11439 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11440 the --[no-]fix-cortex-a8 command line options.
11441 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11442 (Target_arm::relocate_stub): Use addend in instruction template.
11443 * options.h (DEFINE_bool): Set the user-set flag.
11444 (General_options): Add --[no-]-fix-cortex options.
11445 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11446 : Update fast look-up map after conversion.
11448 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11450 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11451 in the first pass of do_layout.
11453 2010-01-13 Doug Kwan <dougkwan@google.com>
11455 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11456 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11457 apparent compiler problem of not folding static constant integral
11458 data members of elfcpp::Elf_sizes<32>.
11460 2010-01-13 Doug Kwan <dougkwan@google.com>
11462 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11463 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11464 Arm_relobj::scan_section_for_cortex_a8_erratum,
11465 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11466 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11467 sections to scan for relocation stubs into a new method
11468 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11469 relocation and Cortex-A8 stub scanning.
11470 (Target_arm::do_relax): Force stubs to be after stubbed sections
11471 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11472 the beginning of a new relaxation pass. Update a comment.
11473 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11475 2010-01-12 Ian Lance Taylor <iant@google.com>
11477 * target-reloc.h (visibility_error): New inline function.
11478 (relocate_section): Call visibility_error.
11479 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11480 (MOSTLYCLEANFILES): Likewise.
11481 (protected_4_pic.o, protected_3.err): New targets.
11482 * testsuite/protected_4.cc: New file.
11484 2010-01-12 Doug Kwan <dougkwan@google.com>
11486 * arm.cc (Cortex_a8_reloc): New class.
11487 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11488 and cortex_a8_relocs_info_.
11489 (Target_arm::fix_cortex_a8): New method definition.
11490 (Target_arm::Cortex_a8_relocs_info): New type.
11491 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11492 New data member declarations.
11493 (Target_arm::scan_reloc_for_stub): Record information about
11494 relocations for THUMB branches that might be exempted from the
11495 Cortex-A8 workaround.
11496 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11497 at the beginning of a relaxation pass.
11499 2010-01-12 Doug Kwan <dougkwan@google.com>
11501 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11502 (Arm_relobj::Mapping_symbol_position,
11503 Arm_reloj::Mapping_symbol_position_less,
11504 Arm_relobj::Mapping_symbols_info): New types.
11505 (Target_arm::is_mapping_symbol_name): New method definition.
11506 (Arm_relobj::do_count_local_symbols): Save information about mapping
11509 2010-01-11 Doug Kwan <dougkwan@google.com>
11511 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11512 Arm_relocate_functions::thumb32_branch_upper,
11513 Arm_relocate_functions::thumb32_branch_lower,
11514 Arm_relocate_functions::thumb32_cond_branch_offset,
11515 Arm_relocate_functions::thumb32_cond_branch_upper,
11516 Arm_relocate_functions::thumb32_cond_branch_lower,
11517 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11518 branch offset encoding.
11519 (Arm_relocate_functions::thumb_branch_common): Use new branch
11520 offset encoding methods to avoid code duplication.
11521 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11522 (Stub_addend_reader::operator()): Use new branch encoding method
11523 to avoid code duplication.
11525 2010-01-11 Doug Kwan <dougkwan@google.com>
11527 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11528 (Target_arm::do_finalize_sections): Define special EXIDX section
11529 symbols only if referenced.
11530 * gc.h (Garbage_collection::add_reference): New method.
11531 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11534 2010-01-11 Ian Lance Taylor <iant@google.com>
11536 * script.cc (Version_script_info::build_expression_list_lookup):
11537 Change complaing about duplicate wildcard match from error to
11540 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11542 (Version_script_info::Version_script_info): Initialize globs_,
11543 default_version_, default_is_global_, and exact_. Don't
11544 initialize globals_ or locals_.
11545 (Version_script_info::build_lookup_tables): Build local symbols
11547 (Version_script_info::unquote): New function.
11548 (Version_script_info::add_exact_match): New function.
11549 (Version_script_info::build_expression_list_lookup): Remove lookup
11550 parameter. Add is_global parameter. Change all callers. Handle
11551 wildcard pattern specially. Unquote pattern. Call
11553 (Version_script_info::get_name_to_match): New function.
11554 (Version_script_info::get_symbol_version): New function.
11555 (Version_script_info::get_symbol_version_helper): Remove.
11556 (Version_script_info::check_unmatched_names): Call unquote.
11557 * script.h (class Version_script_info): Change get_symbol_version
11558 to be non-inline and add is_global parameter; change all callers.
11559 Rewrite symbol_is_local. Update declarations. Define struct
11560 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11561 Remove globals_ and locals_ members. Add exact_, globs_,
11562 default_version_, is_global_.
11563 (Version_script_info::Glob): Remove pattern, add expression and
11564 is_global. Update constructor. Change all callers.
11565 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11567 (Versions::symbol_section_contents): If a symbol is undefined, or
11568 defined in a dynamic object, set the version index to
11570 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11572 (Symbol_table::add_from_pluginobj): Likewise.
11573 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11575 2010-01-11 Doug Kwan <dougkwan@google.com>
11577 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11578 (incremental_dump_LDADD): Add linking option for libintl.
11579 * Makefile.in: Regenerate.
11581 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11584 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11586 * testsuite/Makefile.in: Regenerated.
11588 2010-01-10 Doug Kwan <dougkwan@google.com>
11590 * options.h (DEFINE_var): Use parentheses around argument varname__
11591 in macro body to avoid any unintended subsequent substitutions.
11593 2010-01-10 Ian Lance Taylor <iant@google.com>
11595 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11596 candidates before doing symbol resolution.
11598 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11599 ODR candidates if only one is weak.
11601 2010-01-08 Ian Lance Taylor <iant@google.com>
11603 * script.cc (Version_script_info::build_expression_list_lookup):
11604 Don't warn about ambiguous version, just record the ambiguity.
11605 (Version_script_info::get_symbol_version_helper): Give error if
11606 version is ambiguous.
11608 2010-01-08 Doug Kwan <dougkwan@google.com>
11610 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11611 prev_data_size_ and prev_addralign_. Remove initializer for
11612 deleted data member has_been_changed_.
11613 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11614 to determine if the table is empty.
11615 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11617 (Stub_table::add_reloc_stub): Define method in class definition
11618 instead of just declaring it there.
11619 (Stub_table::add_cortex_a8_stub): New method definition.
11620 (Stub_table::update_data_size_and_addralign): Ditto.
11621 (Stub_table::finalize_stubs): Ditto.
11622 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11623 (Stub_table::do_addralign_): Return address alignment in the
11624 (Stub_table::do_reset_address_and_file_offset): Define method in
11625 class definition instead of declaring it there. Set current data
11626 size to be the data size of the previous pass.
11627 (Stub_table::set_final_data_size): Use current data size as the
11629 (Stub_table::relocate_stub): Change parameter type of stub from
11630 Reloc_stub pointer to Stub pointer.
11631 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11632 (Stub_table::Cortex_a8_stub_list): New typedef.
11633 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11634 Stub_table::prev_addralign_): New data member.
11635 (Arm_relobj::Arm_relobj): Initialize data member
11636 section_has_cortex_a8_workaround_.
11637 (Arm_relobj::section_has_cortex_a8_workaround,
11638 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11640 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11642 (Target_arm::relocate_stub): Change parameter type of stub from
11643 Reloc_stub pointer to Stub pointer.
11644 (Insn_template::size, Insn_template::alignment): Handle
11645 THUMB16_SPECIAL_TYPE.
11646 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11647 Stub_table::update_data_size_and_addralign,
11648 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11650 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11651 (Stub_table::do_write): Ditto.
11652 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11654 2010-01-08 Ian Lance Taylor <iant@google.com>
11657 * symtab.h (class Symbol): Remove fields is_target_special_ and
11658 has_plt_offset_. Add field is_defined_in_discarded_section_.
11659 (Symbol::is_defined_in_discarded_section): New function.
11660 (Symbol::set_is_defined_in_discarded_section): New function.
11661 (Symbol::has_plt_offset): Rewrite.
11662 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11663 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11664 Don't initialize is_target_special_ or has_plt_offset_.
11665 Initialize is_defined_in_discarded_section_.
11666 (Symbol_table::add_from_relobj): If appropriate, set
11667 is_defined_in_discarded_section.
11668 * resolve.cc (Symbol::override_base_with_special): Don't test
11669 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11670 * target-reloc.h (relocate_section): Do special handling for
11671 symbols defined in discarded sections for global symbols as well
11674 2010-01-08 Ian Lance Taylor <iant@google.com>
11676 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11677 the SHT_SYMTAB case.
11679 2010-01-08 Ian Lance Taylor <iant@google.com>
11681 * object.cc (Sized_relobj::do_layout): Don't get confused if
11682 layout_eh_frame returns NULL.
11684 2010-01-08 Ian Lance Taylor <iant@google.com>
11687 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11688 dynamic symbol table, use the normal symbol table.
11689 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11692 2010-01-08 Ian Lance Taylor <iant@google.com>
11695 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11698 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11700 * version.cc (print_version): Change to "Copyright 2010".
11702 2010-01-08 Ian Lance Taylor <iant@google.com>
11706 * i386.cc (class Target_i386): Change return type of plt_section
11708 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11709 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11710 tls_desc_rel_ field.
11711 (Output_data_plt_i386::rel_tls_desc): New function.
11712 (Target_i386::rel_tls_desc_section): New function.
11713 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11714 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11715 R_386_TLS_DESC reloc in rel_tls_desc_section.
11716 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11717 Define struct Tlsdesc_info.
11718 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11719 (Target_x86_64::do_reloc_symbol_index): New function.
11720 (Target_x86_64::add_tlsdesc_info): New function.
11721 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11722 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11723 tlsdesc_rel_ field.
11724 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11726 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11727 (Target_x86_64::rela_tlsdesc_section): New function.
11728 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11730 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11731 (Target_x86_64::do_reloc_addend): New function.
11732 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11733 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11734 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11735 (Output_reloc::type): New function.
11736 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11737 (Output_reloc::is_target_specific): New function.
11738 (Output_reloc::target_arg): New function.
11739 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11740 absolute relocs and target specific relocs.
11741 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11742 add_target_specific.
11743 (class Output_data_reloc) [SHT_RELA]: Likewise.
11744 * output.cc (Output_reloc::Output_reloc): Add four new versions
11745 for absolute relocs and target specific relocs.
11746 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11747 (Output_reloc::get_symbol_index): Likewise.
11748 (Output_reloc::local_section_offset): Check that local_sym_index_
11749 is not TARGET_CODE or 0.
11750 (Output_reloc::symbol_value): Likewise.
11751 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11753 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11754 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11756 * layout.cc (add_target_dynamic_tags): Use output section for
11757 DT_PLTRELSZ and DT_JMPREL.
11759 2010-01-07 Ian Lance Taylor <iant@google.com>
11762 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11764 (class Output_data_reloc_generic): Define.
11765 (class Output_data_reloc_base): Change base class to
11766 Output_data_reloc_generic. Change add() method to call
11767 bump_relative_reloc_count for a relative reloc. Remove
11768 sort_relocs_ field.
11769 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11771 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11772 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11774 * layout.h (class Layout): Update declaration.
11776 2010-01-07 Ian Lance Taylor <iant@google.com>
11778 * output.h (class Output_data): Add const version of
11779 output_section and do_output_section.
11780 (class Output_section_data): Add const version of
11782 (class Output_section): Likewise.
11783 * layout.cc (Layout::add_target_dynamic_tags): New function.
11784 * layout.h (class Layout): Update declarations.
11785 * arm.cc (Target_arm::do_finalize_sections): Use
11786 add_target_dynamic_tags.
11787 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11788 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11789 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11790 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11792 2010-01-07 Ian Lance Taylor <iant@google.com>
11795 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11798 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11799 Ian Lance Taylor <iant@google.com>
11802 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11803 Xindex::read_symtab_xindex.
11805 2010-01-07 Doug Kwan <dougkwan@google.com>
11807 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11808 (Insn_template::thumb16_bcond_insn): New method declaration.
11809 (Insn_template): Fix spelling.
11810 (Stub::thumb16_special): New method declaration.
11811 (Stub::do_write): Define virtual method which was previously pure
11813 (Stub::do_thumb16_special): New method declaration.
11814 (Stub::do_fixed_endian_write): New template member.
11815 (Reloc_stub::do_write): Remove.
11816 (Reloc_stub::do_fixed_endian_write): Remove.
11817 (Cortex_a8_stub): New class definition.
11818 (Stub_factory::make_cortex_a8_stub): New method definition.
11819 (Stub_factory::Stub_factory): Add missing static storage class
11820 qualifier for elf32_arm_stub_a8_veneer_blx.
11822 2010-01-07 Ian Lance Taylor <iant@google.com>
11825 * options.h (class General_options): Add --warn-unresolved-symbols
11826 and --error-unresolved-symbols.
11827 * errors.cc (Errors::undefined_symbol): Implement
11828 --warn-unresolved-symbols.
11830 * options.h (class General_options): Add -z text and -z textoff.
11831 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11833 2010-01-06 Sriraman Tallam <tmsriram@google.com>
11835 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11836 (Garbage_collection::cident_sections): New function.
11837 (Garbage_collection::add_cident_section): New function.
11838 (Garbage_collection::cident_sections_): New member.
11839 (gc_process_relocs): Add references to sections whose names are C
11841 * gold.h (cident_section_start_prefix): New constant.
11842 (cident_section_stop_prefix): New constant.
11843 (is_cident): New function.
11844 * layout.cc (Layout::define_section_symbols): Replace string constants
11845 with the newly defined constants.
11846 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11848 * testsuite/Makefile.am: Add gc_orphan_section_test.
11849 * testsuite/Makefile.in: Regenerate.
11850 * testsuite/gc_orphan_section_test.cc: New file.
11851 * testsuite/gc_orphan_section_test.sh: New file.
11853 2010-01-06 Ian Lance Taylor <iant@google.com>
11856 * options.h (class General_options): Add --warn-shared-textrel.
11857 * layout.cc (Layout::finish_dynamic_section): Implement
11858 --warn-shared-textrel.
11861 * options.h (class General_options): Add --warn-multiple-gp.
11863 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11865 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11866 $(THREADSLIB) and $(LIBDL).
11867 * Makefile.in: Rebuild.
11869 2010-01-06 Ian Lance Taylor <iant@google.com>
11872 * options.cc (General_options::parse_section_start): New function.
11873 (General_options::section_start): New function.
11874 (General_options::General_options): Initialize all members.
11875 * options.h: Include <map>
11876 (class General_options): Add --section-start. Add section_starts_
11878 * layout.cc (Layout::attach_allocated_section_to_segment): If
11879 --section-start was used, set the address of the segment. Remove
11880 local sort_sections.
11881 (Layout::relaxation_loop_body): If the address of the load segment
11882 has been set by --section-start, don't use it.
11883 * output.h (Output_segment::update_flags_for_output_section): New
11885 * output.cc (Output_segment::add_output_section): Call
11886 update_flags_for_output_section.
11888 2010-01-05 Ian Lance Taylor <iant@google.com>
11891 * options.h (class General_options): Add --undefined-version.
11892 * script.cc (struct Version_expression): Add was_matched_by_symbol
11894 (Version_script_info::matched_symbol): New function.
11895 (Version_script_info::get_symbol_version_helper): Call
11897 (Version_script_info::check_unmatched_names): New function.
11898 * script.h (class Version_script_info): Update declarations.
11899 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11901 * options.h (class General_options): Use DEFINE_bool_alias for
11902 allow_multiple_definition.
11903 * resolve.cc (Symbol_table::should_override): Don't test
11904 allow_multiple_definition.
11907 * options.h (class General_options): Add --cref.
11908 * main.cc (main): Print cref table if --cref. Don't close mapfile
11909 until after printing cref table.
11910 * cref.cc: Include "symtab.h".
11911 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11912 (Cref_table_compare::operator()): New function.
11913 (Cref_inputs::gather_cref): New function.
11914 (filecol): New static const.
11915 (Cref_inputs::print_cref): New function.
11916 (Cref::print_cref): New function.
11917 * cref.h: Include <cstdio>.
11918 (class Cref): Update declarations.
11919 * mapfile.h (Mapfile::file): New function.
11920 * object.h (class Object): Define Symbols. Declare virtual
11921 do_get_global_symbols.
11922 (Object::get_global_symbols): New function.
11923 * object.cc (Input_objects::add_object): Pass object to cref_ if
11925 (Input_objects::archive_start): Likewise.
11926 (Input_objects::archive_stop): Likewise.
11927 (Input_objects::print_cref): New function.
11928 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11929 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11931 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11933 * plugin.h (class Sized_pluginobj): Update declarations.
11935 2010-01-05 Ian Lance Taylor <iant@google.com>
11937 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11938 to is_default_version. Rename insdef to insdefault.
11939 (Symbol_table::add_from_relobj): Rename def to is_default_version
11940 and local to is_forced_local.
11941 (Symbol_table::add_from_pluginobj): Likewise.
11942 (Symbol_table::add_from_dynobj): Likewise.
11943 (Symbol_table::define_special_symbol): Rename insdef to
11946 2010-01-04 Ian Lance Taylor <iant@google.com>
11949 * options.h (class General_options): Add
11950 --allow-multiple-definition and -z muldefs.
11951 * resolve.cc (Symbol_table::should_override): Don't warn about a
11952 multiple symbol definition if --allow-multiple-definition or -z
11956 * options.h (class General_options): Add --add-needed and
11957 --copy-dt-needed-entries. Tweak --as-needed help entry.
11958 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11959 error if --copy-dt-needed-entries aka --add-needed is used and
11960 would cause a change in behaviour.
11963 * options.h (class General_options): Add -G as a short version of
11964 --shared. Add no-op options -assert, -g, and -i.
11966 2010-01-04 Sriraman Tallam <tmsriram@google.com>
11968 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11969 check for .text or .gnu.linkonce.t sections.
11970 * icf.cc (Icf::find_identical_sections): Ditto.
11971 Change the detection for mangled function name within the section
11973 * icf.h (is_section_foldable_candidate): New function.
11975 2009-12-30 Ian Lance Taylor <iant@google.com>
11978 * options.h (class General_options): Permit two dashes with
11979 --retain-symbols-file.
11981 2009-12-30 Ian Lance Taylor <iant@google.com>
11984 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11985 don't put the file header and segment headers in the text
11989 * common.cc (Sort_commons::operator()): Stabilize sort when both
11991 (Symbol_table::do_allocate_commons_list): When allocating common
11992 symbols, skip a symbol which is no longer common.
11993 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11994 an object before checking its type.
11995 * testsuite/common_test_2.c: New file.
11996 * testsuite/common_test_3.c: New file.
11997 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11998 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11999 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12000 (common_test_2_pic.o, common_test_2.so): New targets.
12001 (common_test_3_pic.o, common_test_3.so): New targets.
12002 * testsuite/Makefile.in: Rebuild.
12005 * script.cc (read_input_script): If we see a new SECTIONS clause,
12006 and we have added an input section, give an error.
12007 * layout.h (class Layout): Add have_added_input_section function.
12008 Add have_added_input_section_ field.
12009 * layout.cc (Layout::Layout): Initialize
12010 have_added_input_section_.
12011 (Layout::layout): Set have_added_input_section_.
12012 (Layout::layout_eh_frame): Likewise.
12014 2009-12-30 Ian Lance Taylor <iant@google.com>
12017 * options.h (class General_options): Add --sort-common option.
12018 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12019 * common.cc (Sort_common): Add sort_order parameter to
12020 constructor. Add sort_order_ field.
12021 (Sort_commons::operator): Check sort_order_.
12022 (Symbol_table::allocate_commons): Determine the sort order.
12023 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12024 Change all callers.
12025 (Symbol_table::do_allocate_commons_list): Likewise.
12027 2009-12-30 Ian Lance Taylor <iant@google.com>
12030 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12031 symbols from this object, don't change the visibility of an
12033 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12035 2009-12-30 Ian Lance Taylor <iant@google.com>
12038 * script.h (class Version_script_info): Define Language enum.
12039 Update declarations. Define Glob, Exact, and Lookup types. Add
12040 new fields globals_, locals_, and is_finalized_.
12041 * script.cc: Various formatting fixes.
12042 (class Parser_closure): Change language_stack_ from a vector of
12043 std::string to one of Version_script_info::Language. Adjust all
12045 (class Lazy_demangler): Remove.
12046 (struct Version_expression): Change language from std::string to
12047 Version_script_info::Language.
12048 (Version_script_info::Version_script_info): New function.
12049 (Version_script_info::~Version_script_info): Don't call clear.
12050 (Version_script_info::finalize): New function.
12051 (Version_script_info::build_lookup_tables): New function.
12052 (Version_script_info::build_expression_list_lookup): New
12054 (Version_script_info::get_symbol_version_helper): Rewrite to use
12056 (Version_script_info::print_expression_list): Adjust to use
12057 Version_script_info::Language.
12058 (script_push_lex_into_version_mode): Check that the version script
12059 has not been finalized.
12060 (version_script_push_lang): Change language string to
12061 Version_script_info::Language.
12062 * options.cc (Command_line::version_script): New function.
12063 * options.h (class General_options): Add finalize_dynamic_list
12064 function. Change version_script from declaration to definition.
12065 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12066 * testsuite/version_script.map: Remove duplicate def of foo.
12067 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12068 version_script.map.
12069 * testsuite/Makefile.in: Rebuild.
12071 2009-12-30 Ian Lance Taylor <iant@google.com>
12074 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12075 if the input symbol index is 0, make the output symbol index 0.
12077 2009-12-30 Ian Lance Taylor <iant@google.com>
12080 * options.h (class General_options): Add -x/--discard-all.
12081 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12082 --discard-all. If the local symbol needs a dynamic entry, check
12083 that before handling --discard-locals.
12085 2009-12-30 Ian Lance Taylor <iant@google.com>
12088 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12090 (Output_segment::add_output_section): Don't change the flags if
12091 the type is PT_TLS.
12094 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12095 GNU hash table if they need a dynamic value. Otherwise, don't add
12096 them if they are defined in a dynamic object or are forced local.
12098 2009-12-29 Ian Lance Taylor <iant@google.com>
12101 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12102 .gnu.hash table for a 32-bit target.
12105 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12106 regular and a dynamic object only needs a dynamic symbol table
12107 entry if it is externally visible.
12110 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12111 constructor. Add global_offset_table_ field.
12112 (Target_i386::got_section): Set global_offset_table_.
12113 (Target_i386::do_finalize_sections): Set global_offset_table_
12115 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12116 in constructor. Add global_offset_table_ field.
12117 (Target_x86_64::got_section): Set global_offset_table_.
12118 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12121 * layout.cc (Layout::Layout): Initialize increase_relro_.
12122 (Layout::get_output_section): Add is_relro, is_last_relro, and
12123 is_first_non_relro parameters. Change all callers.
12124 (Layout::choose_output_section): Likewise.
12125 (Layout::add_output_section_data): Likewise.
12126 (Layout::make_output_section): Likewise.
12127 (Layout::set_segment_offsets): Clear increase_relro when using a
12129 * layout.h (class Layout): Add increase_relro method. Add
12130 increase_relro_ field. Update declarations.
12131 * output.cc (Output_section::Output_section): Initialize
12132 is_last_relro_ and is_first_non_relro_.
12133 (Output_segment::add_output_section): Group relro sections is
12134 do_sort is true. Handle is_last_relro and is_first_non_relro.
12135 (Output_segment::maximum_alignment): Remove relro handling.
12136 (Output_segment::set_section_addresses): Add increase_relro
12137 parameter. Change all callers. Add initial alignment to align
12138 relro sections on separate page. Remove old relro handling.
12139 (Output_segment::set_section_list_addresses): Remove in_relro
12140 parameter. Change all callers.
12141 (Output_segment::set_offset): Add increase parameter. Change all
12142 callers. Remove old relro handling.
12143 * output.h (class Output_section): Add new methods: is_last_relro,
12144 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12145 Add is_last_relro_ and is_first_non_relro_ fields.
12146 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12147 Create separate .got.plt section. Call increase_relro.
12148 * x86_64.cc (Target_x86_64::got_section): Likewise.
12149 * testsuite/relro_script_test.t: Add .got.plt.
12152 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12153 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12154 (Layout::finalize): Call set_dynamic_symbol_size.
12155 (Layout::set_dynamic_symbol_size): New function.
12156 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12157 set_dynamic_symbol_size.
12160 * output.h (class Output_section): Add is_entsize_zero_ field.
12161 * output.cc (Output_section::Output_section): Initialize
12163 (Output_section::set_entsize): If two different entsizes are
12164 requested, force it to zero.
12165 (Output_section::add_input_section): Set flags for .debug_str
12166 before updating section flags. Set entsize.
12167 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12168 and SHF_STRING if all input sections have those flags.
12170 2009-12-29 Rafael Espindola <espindola@google.com>
12172 * main.cc (main): Fix the sys time reporting.
12173 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12176 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12178 * options.cc (General_options::parse_version): Allow -v to exit
12179 without an error if there is nothing to link.
12181 2009-12-29 Ian Lance Taylor <iant@google.com>
12183 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12184 using a version of gcc before 4.1.
12185 * configure: Rebuild.
12187 2009-12-28 Chris Demetriou <cgd@google.com>
12189 * attributes.cc (Output_attributes_section_data::do_write): Use
12190 std::vector::front rather than std::vector::data.
12192 2009-12-28 Ian Lance Taylor <iant@google.com>
12194 * symtab.h (class Symbol_table): Add enum Defined.
12195 * resolve.cc (Symbol_table::should_override): Add defined
12196 parameter. Change all callers. Test whether object is NULL
12197 before calling a method on it.
12198 (Symbol_table::report_resolve_problem): Add defined parameter.
12199 Change all callers.
12200 (Symbol_table::should_override_with_special): Likewise.
12201 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12202 parameter. Change all callers.
12203 (Symbol_table::do_define_in_output_data): Likewise.
12204 (Symbol_table::define_in_output_segment): Likewise.
12205 (Symbol_table::do_define_in_output_segment): Likewise.
12206 (Symbol_table::define_as_constant): Likewise.
12207 (Symbol_table::do_define_as_constant): Likewise.
12208 * script.h (class Symbol_assignment): Add is_defsym parameter to
12209 constructor; change all callers.
12210 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12211 parameter. Change all callers. Add is_defsym_ field.
12212 (class Parser_closure): Add parsing_defsym parameter to
12213 constructor; change all callers. Add parsing_defsym accessor
12214 function. Add parsing_defsym_ field.
12216 2009-12-28 Ian Lance Taylor <iant@google.com>
12218 * gold.cc (queue_middle_tasks): Fix formatting.
12219 * object.cc (Relobj::is_section_name_included): Likewise.
12221 2009-12-23 Ian Lance Taylor <iant@google.com>
12223 * i386.cc (Target_i386::do_calls_non_split): Recognize
12224 -fsplit-stack prologue for a function with a static chain.
12225 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12226 -fsplit-stack prologue when using %r11.
12228 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12230 * options.cc (General_options::parse_version): Make -v continue and do
12231 the link like GNU ld does.
12233 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12235 * Makefile.am (CCFILES): Add timer.cc.
12236 (HFILES): Add timer.h.
12237 * configure.ac: Check for sysconf and times.
12238 * main.cc: include timer.h.
12239 (main): Use Timer instead of get_run_time.
12242 * workqueue.cc: include timer.h.
12243 (Workqueue::find_and_run_task):
12244 Report user, sys and wall time.
12245 * Makefile.in: Regenerate.
12246 * config.in: Regenerate.
12247 * configure: Regenerate.
12249 2009-12-16 Doug Kwan <dougkwan@google.com>
12251 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12253 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12254 relaxed input sections.
12255 * output.cc (Output_section::find_relaxed_input_section): Change
12256 return type to Output_relaxed_input_section pointer. Adjust code
12257 for new type of relaxed_input_section_map_.
12258 * output.h (Output_section::find_relaxed_input_section): Change
12259 return type to Output_relaxed_input_section pointer.
12260 (Output_section::Output_relaxed_input_section_by_input_section_map):
12262 (Output_section::relaxed_input_section_map_): Change type to
12263 Output_section::Output_relaxed_input_section_by_input_section_map.
12264 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12267 2009-12-15 Ian Lance Taylor <iant@google.com>
12269 * layout.cc (Layout::create_shstrtab): Only write out after input
12270 sections if we are compressing debug sections.
12272 2009-12-15 Ian Lance Taylor <iant@google.com>
12274 * archive.cc (Archive::add_symbols): Only look up a symbol without
12275 a version if there is, in fact, a version.
12277 2009-12-14 Ian Lance Taylor <iant@google.com>
12279 Revert -Wshadow changes, all changes from:
12280 2009-12-11 Doug Kwan <dougkwan@google.com>
12281 2009-12-11 Nick Clifton <nickc@redhat.com>
12282 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12284 2009-12-11 Doug Kwan <dougkwan@google.com>
12286 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12288 * attributes.cc (Object_attribute::size): Ditto.
12289 (Attributes_section_data::size): Ditto.
12290 (Attributes_section_data::Attributes_section_data): Ditto.
12291 (Output_attributes_section_data::do_write): Ditto.
12292 * attributes.h (Object_attribute::set_type): Ditto.
12293 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12295 2009-12-11 Nick Clifton <nickc@redhat.com>
12297 * archive.cc: Fix shadowed variable warnings.
12298 * arm.cc: Likewise.
12299 * compressed_output.cc: Likewise.
12300 * compressed_output.h: Likewise.
12301 * configure: Likewise.
12302 * dwarf_reader.cc: Likewise.
12303 * dynobj.cc: Likewise.
12304 * dynobj.h: Likewise.
12305 * ehframe.cc: Likewise.
12306 * ehframe.h: Likewise.
12307 * errors.cc: Likewise.
12308 * expression.cc: Likewise.
12309 * fileread.cc: Likewise.
12310 * fileread.h: Likewise.
12311 * freebsd.h: Likewise.
12312 * i386.cc: Likewise.
12313 * icf.cc: Likewise.
12314 * incremental.h: Likewise.
12315 * layout.cc: Likewise.
12316 * layout.h: Likewise.
12317 * mapfile.cc: Likewise.
12318 * merge.cc: Likewise.
12319 * merge.h: Likewise.
12320 * object.cc: Likewise.
12321 * object.h: Likewise.
12322 * options.h: Likewise.
12323 * output.cc: Likewise.
12324 * output.h: Likewise.
12325 * parameters.cc: Likewise.
12326 * plugin.cc: Likewise.
12327 * powerpc.cc: Likewise.
12328 * reduced_debug_output.cc: Likewise.
12329 * reduced_debug_output.h: Likewise.
12330 * reloc.cc: Likewise.
12331 * reloc.h: Likewise.
12332 * resolve.cc: Likewise.
12333 * script-sections.cc: Likewise.
12334 * script.cc: Likewise.
12335 * script.h: Likewise.
12336 * sparc.cc: Likewise.
12337 * symtab.cc: Likewise.
12338 * symtab.h: Likewise.
12339 * target-select.cc: Likewise.
12340 * target-select.h: Likewise.
12341 * token.h: Likewise.
12342 * workqueue.cc: Likewise.
12343 * workqueue.h: Likewise.
12344 * x86_64.cc: Likewise.
12346 2009-12-10 Doug Kwan <dougkwan@google.com>
12348 * arm.cc (attributes.h): New include.
12349 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12350 (Arm_relobj::~Arm_relobj): Delete object pointed by
12351 attributes_section_data_.
12352 (Arm_relobj::attributes_section_data): New method definition.
12353 (Arm_relobj::attributes_section_data_): New data member declaration.
12354 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12355 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12356 attributes_section_data_.
12357 (Arm_dynobj::attributes_section_data): New method definition.
12358 (Arm_dynobj::attributes_section_data_): New data member declaration.
12359 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12360 initialization value of may_use_blx_ to false.
12361 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12362 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12363 object attributes to compute results instead of hard-coding.
12364 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12365 Target_arm::get_secondary_compatible_arch,
12366 Target_arm::set_secondary_compatible_arch
12367 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12368 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12369 New method declarations.
12370 (Target_arm::get_aeabi_object_attribute): New method definition.
12371 (Target_arm::attributes_section_data_): New data member declaration.
12372 (read_arm_attributes_section): New template definition.
12373 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12374 (Arm_dynobj::do_read_symbols): Ditto.
12375 (Target_arm::do_finalize_sections): Merge attributes sections from
12376 input. Check for BLX use after attributes section merging.
12377 Fix __exidx_start and __exidx_end visibility. Create an
12378 .ARM.attributes section if necessary.
12379 (Target_arm::get_secondary_compatible_arch,
12380 Target_arm::set_secondary_compatible_arch,
12381 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12382 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12383 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12384 New method definitions.
12386 2009-12-09 Ian Lance Taylor <iant@google.com>
12388 * plugin.cc (Plugin::load): Don't cast from void* to a function
12391 2009-12-09 Ian Lance Taylor <iant@google.com>
12393 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12394 information fields.
12396 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12398 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12399 Replace two_file_shared_1.so with two_file_shared_2.so.
12400 * testsuite/Makefile.in: Regenerated.
12402 2009-12-08 Doug Kwan <dougkwan@google.com>
12404 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12405 (HFILES): Add attributes.h and int_encoding.h.
12406 * Makefile.in: Regenerate.
12407 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12408 function definitions to int_encoding.cc
12409 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12410 prototypes to int_encoding.h
12411 * reduced_debug_output.cc (int_encoding.h): New include.
12412 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12413 function definitions to int_encoding.cc
12414 (insert_into_vector, read_from_pointer): Move template definitions to
12416 * attributes.cc: New file.
12417 * attributes.h: New file.
12418 * int_encoding.cc: New file.
12419 * int_encoding.h: New file.
12421 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12424 * incremental-dump.cc (dump_incremental_inputs): New.
12425 (main): Use dump_incremental_inputs.
12427 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12430 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12431 checking elfcpp::STT_FUNC.
12432 (Target_i386::Relocate::relocate): Likewise.
12433 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12435 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12436 symbols from shared libraries into normal FUNC symbols.
12438 * symtab.h (Symbol): Add is_func and use it.
12440 2009-12-05 Doug Kwan <dougkwan@google.com>
12442 * arm.cc (Target_arm::arm_info): Initialize new fields
12443 attributes_section and attributes_vendor.
12444 * i386.cc (Target_i386::i386_info): Same.
12445 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12446 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12447 fields attributes_section and attributes_vendor.
12448 * sparc.cc (Target_sparc::sparc_info): Same.
12449 * target.h (Target::attributes_section, Target::attributes_vendor,
12450 Target::is_attributes_section, Target::attribute_arg_type,
12451 Target::attributes_order): New method definitions.
12452 (Target::Target_info::attributes_section,
12453 Target::Target_info::attributes_vendor): New fields.
12454 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12455 virtual method definitions.
12456 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12457 attributes_section and attributes_vendor.
12458 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12460 2009-12-05 Doug Kwan <dougkwan@google.com>
12462 * arm.cc: Update comments about interworking and stub generation.
12463 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12464 considered as non-PIC.
12465 (Arm_relocate_functions::base_abs): Fix formatting.
12466 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12467 of function to use GOT entry address instead of offset.
12468 (Target_arm::Scan::global): Issue an error if a symbol would need a
12469 PLT does not get one because it is untyped. Remove code to create
12470 dynamic symbols for relative branches.
12471 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12472 takes unsigned integer instead of boolean.
12474 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12476 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12477 (two_file_test_LDADD): Likewise.
12478 (common_test_1_LDADD): Likewise.
12479 (exception_test_LDADD) Likewise.
12480 (weak_test_LDADD): Likewise.
12481 (many_sections_test_LDADD): Likewise.
12482 (initpri1_LDADD): Likewise.
12483 (script_test_1_LDADD): Likewise.
12484 (script_test_2_LDADD): Likewise.
12485 (justsyms_LDADD): Likewise.
12486 (binary_test_LDADD): Likewise.
12487 (large_LDADD): Likewise.
12488 * testsuite/Makefile.in: Regenerated.
12490 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12492 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12493 (Symbol_table::override_with_special): Likewise.
12494 (Symbol_table::add_from_object): Likewise.
12496 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12498 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12499 Don't set the data_offset twice.
12501 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12503 * testsuite/Makefile.in: Regenerate.
12505 2009-12-03 Doug Kwan <dougkwan@google.com>
12507 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12508 (Target_arm::do_finalize_sections): Add parameter for symbol table
12509 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12510 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12511 parameter for symbol table pointer.
12512 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12513 an additional parameter for a pointer to symbol table.
12514 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12515 parameter for a symbol table pointer.
12516 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12517 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12519 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12520 parameter for a symbol table pointer.
12522 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12524 * incremental.cc (Incremental_inputs_header)
12525 (Incremental_inputs_header_write, Incremental_inputs_entry)
12526 (Incremental_inputs_entry_write): Move ...
12527 * incremental.h (Incremental_inputs_header)
12528 (Incremental_inputs_header_write, Incremental_inputs_entry)
12529 (Incremental_inputs_entry_write): here.
12531 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12533 * incremental.cc (make_sized_incremental_binary): Set the target.
12534 Error if it is incompatible.
12535 * output.h (Output_file): Add filename method.
12537 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12539 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12540 from the get_* methods.
12542 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12544 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12545 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12546 Write 0 for the data_offset of scripts.
12548 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12550 * testsuite/Makefile.am: Add the incremental_test.sh test.
12551 * testsuite/incremental_test.sh: New.
12552 * testsuite/incremental_test_1.c: New.
12553 * testsuite/incremental_test_2.c: New.
12555 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12557 * incremental-dump.cc (main): Fix typos.
12559 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12562 * incremental-dump.cc (main): Use llu to print 64 bit values.
12564 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12565 H.J. Lu <hongjiu.lu@intel.com>
12567 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12569 (incremental_dump_LDADD): Likewise.
12570 * Makefile.in: Regenerated.
12572 2009-11-25 Doug Kwan <dougkwan@google.com>
12576 2009-11-25 Doug Kwan <dougkwan@google.com>
12578 * arm.cc (Target_arm::Target_arm): Move method definition
12579 outside of class definition. Add code to handle
12580 --target1-rel, --target1-abs and --target2= options.
12581 (Target_arm::get_reloc_reloc_type): Change method to be
12582 non-static and const.
12583 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12584 New data member declaration.
12585 (Target_arm::Scan::local, Target_arm::Scan::global,
12586 Target_arm::Relocate::relocate,
12587 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12588 Adjust call to Target_arm::get_real_reloc_type.
12589 (Target_arm::get_real_reloc_type): Use command line options
12590 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12591 * options.h (--target1-rel, --target1-abs, --target2): New
12594 2009-11-25 Doug Kwan <dougkwan@google.com>
12596 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12597 class definition. Add code to handle --target1-rel, --target1-abs
12598 and --target2= options.
12599 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12601 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12602 member declaration.
12603 (Target_arm::Scan::local, Target_arm::Scan::global,
12604 Target_arm::Relocate::relocate,
12605 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12606 call to Target_arm::get_real_reloc_type.
12607 (Target_arm::get_real_reloc_type): Use command line options to
12608 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12609 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12612 2009-11-25 Doug Kwan <dougkwan@google.com>
12614 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12615 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12616 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12618 (Arm_relocate_functions::thm_call): Replace body with a call to
12619 Arm_relocate_functions::thumb_branch_common.
12620 (Arm_relocate_functions::thm_jump24,
12621 Arm_relocate_functions::thm_xpc22): New method definitions.
12622 (Arm_relocate_functions::thumb_branch_common): New method definition.
12623 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12625 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12626 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12628 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12630 * Makefile.am: Build incremental-dump
12631 * Makefile.in: Regenerate.
12632 * incremental-dump.cc: New.
12633 * incremental.cc (Incremental_inputs_header_data,
12634 Incremental_inputs_entry_data): Move to incremental.h
12635 * incremental.h: (Incremental_inputs_header_data,
12636 Incremental_inputs_entry_data): Move from incremental.cc
12638 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12640 * incremental.cc (Incremental_inputs_header,
12641 Incremental_inputs_header_write, Incremental_inputs_entry,
12642 Incremental_inputs_entry_write): Add a typedef with the data type.
12644 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12646 * incremental.cc (Incremental_inputs_header,
12647 Incremental_inputs_header_write, Incremental_inputs_entry,
12648 Incremental_inputs_entry_write): Update comment about which
12649 type has the filed descriptions.
12651 2009-11-15 Doug Kwan <dougkwan@google.com>
12653 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12654 (Arm_relocate_functions::arm_branch_common): Change method defintion
12655 in class definition to a method declaration and update list of formal
12657 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12658 Arm_relocation_functions::jump24): Adjust call to
12659 Arm_relocate_functions::arm_branch_common. Update list of formal
12661 (Arm_relocate_functions::xpc25): New method definition.
12662 (Arm_relocate_functions::arm_branch_common): Move method defintion
12663 out from class definition. Use stubs for mode-switching and extending
12665 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12666 specially. Change code to enable use of stubs in ARM branches.
12668 2009-11-10 Doug Kwan <dougkwan@google.com>
12670 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12671 in method declaration.
12672 (Target_arm::relocate_stub): New method declaration.
12673 (Target_arm::default_target): Change to return a pointer instead of
12675 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12676 Target_arm::default_target.
12677 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12679 (Target_arm::relocate_section): Adjust view.
12680 (Target_arm::relocate_stub): New method definition.
12682 2009-11-10 Doug Kwan <dougkwan@google.com>
12684 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12686 * incremental.cc (open_incremental_binary): Initialized local
12687 variables to avoid warnings.
12688 * object.cc (make_elf_object): Ditto.
12689 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12692 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12695 * testsuite/plugin_test.c: Include "config.h".
12697 2009-11-09 Doug Kwan <dougkwan@google.com>
12699 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12700 (arm_symbol_value): Remove.
12701 (Arm_relocate_functions::arm_branch_common,
12702 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12703 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12704 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12705 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12706 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12707 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12708 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12709 Arm_relocate_functions::thm_mobw_abs_nc,
12710 Arm_relocate_functions::thm_mov_abs,
12711 Arm_relocate_functions::movw_prel_nc,
12712 Arm_relocate_functions::thm_movt_abs,
12713 Arm_relocate_functions::movt_prel,
12714 Arm_relocate_functions::thm_movw_prel_nc,
12715 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12716 (Target_arm::Relocate::relocate): Only decompose address into two
12717 parts if relocation type uses the thumb-bit and pass the actual
12718 bit instead of a flag indicating that the thumb-bit is used. Adjust
12719 calls to methods in Arm_relocate_functions for this change.
12721 2009-11-08 Ian Lance Taylor <iant@google.com>
12724 * reloc.cc: Instantiate
12725 Sized_relobj::initialize_input_to_output_maps and
12726 Sized_relobj:free_input_to_output_maps.
12728 2009-11-06 Ian Lance Taylor <iant@google.com>
12731 * defstd.cc (in_segment): Set only_if_ref true for "end".
12733 2009-11-06 Doug Kwan <dougkwan@google.com>
12735 * arm.cc (class Reloc_stub): Correct a comment.
12736 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12737 (Target_arm::scan_section_for_stubs): New method declaration.
12738 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12739 Change methods from private to protected.
12740 (Target_arm::do_may_relax): New method definition.
12741 (Target_arm::do_relax, Target_arm::group_sections,
12742 Target_arm::scan_reloc_for_stub,
12743 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12744 (Target_arm::arm_input_section_map_): New data member declaration.
12745 (Target_arm::scan_reloc_for_stub,
12746 Target_arm::scan_reloc_section_for_stubs,
12747 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12748 Target_arm::do_relax): New method definitions.
12750 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12752 * configure.ac: Check for (struct stat)::st_mtim
12753 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12754 * config.in: Regenerate.
12755 * configure: Regenerate.
12757 2009-11-05 Ian Lance Taylor <iant@google.com>
12760 * output.cc (Output_segment::add_output_section): Add missing
12763 2009-11-04 Ian Lance Taylor <iant@google.com>
12766 * object.h (class Object): Add is_needed and set_is_needed
12767 methods. Add is_needed_ field. Make bool fields into bitfields.
12768 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12769 defined in a dynamic object and referenced by a regular object,
12770 set is_needed for the dynamic object.
12771 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12772 if the file is marked with as_needed and it is not needed.
12774 2009-11-04 Ian Lance Taylor <iant@google.com>
12777 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12778 tags if data is discarded by linker script.
12779 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12780 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12781 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12782 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12784 2009-11-04 Ian Lance Taylor <iant@google.com>
12786 * layout.cc (Layout::get_output_section): Add is_interp and
12787 is_dynamic_linker_section parameters. Change all callers.
12788 (Layout::choose_output_section): Likewise.
12789 (Layout::make_output_section): Likewise.
12790 (Layout::add_output_section_data): Add is_dynamic_linker_section
12791 parameter. Change all callers.
12792 * layout.h (class Layout): Update declarations.
12793 * output.h (class Output_section): Add is_interp, set_is_interp,
12794 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12795 Add is_interp_, is_dynamic_linker_section_ fields. Change
12796 generate_code_fills_at_write_ to a bitfield.
12797 * output.cc (Output_section::Output_sections): Initialize new
12799 (Output_segment::add_output_section): Add do_sort parameter.
12800 Change all callers.
12802 2009-11-03 Ian Lance Taylor <iant@google.com>
12805 * options.h (class General_options): Add --warn-common.
12806 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12807 merging two common symbols.
12808 (Symbol_table::should_override): Handle --warn-common when merging
12809 a common symbol with a defined symbol. Use report_resolve_problem
12810 for multiple definitions.
12811 (Symbol_table::report_resolve_problem): New function.
12812 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12814 2009-11-03 Doug Kwan <dougkwan@google.com>
12816 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12818 (Target_arm::stub_factory): New method definition.
12819 (Target_arm::new_arm_input_section,
12820 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12821 Target_arm::reloc_uses_thumb_bit): New method declarations.
12822 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
12823 New type definitions.
12824 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12825 member declarations.
12826 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12827 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12828 New method definitions.
12830 2009-11-03 Ian Lance Taylor <iant@google.com>
12832 * options.h (class General_options): Add --warn_constructors.
12834 2009-11-03 Ian Lance Taylor <iant@google.com>
12837 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12838 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12840 2009-11-03 Ian Lance Taylor <iant@google.com>
12843 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12844 --msgid-bugs-address.
12845 (install-pdf): New target.
12846 (install-data_yes): Look up one directory to find mkinstalldirs.
12848 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12850 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12853 2009-10-30 Doug Kwan <dougkwan@google.com>
12855 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12857 2009-10-30 Doug Kwan <dougkwan@google.com>
12859 * arm.cc (Stub_addend_reader): New struct template definition
12860 and partial specializations.
12861 (Stub_addend_reader::operator()): New method definition for a
12862 partially specialized template.
12864 2009-10-30 Doug Kwan <dougkwan@google.com>
12866 * arm.cc (Arm_relobj::processor_specific_flags): New method
12868 (Arm_relobj::do_read_symbols): New method declaration.
12869 (Arm_relobj::processor_specific_flags_): New data member declaration.
12870 (Arm_dynobj): New class definition.
12871 (Target_arm::do_finalize_sections): Add input_objects parameter.
12872 (Target_arm::do_adjust_elf_header): New method declaration.
12873 (Target_arm::are_eabi_versions_compatible,
12874 (Target_arm::merge_processor_specific_flags): New method declaration.
12875 (Target_arm::do_make_elf_object): New overloaded method definitions
12877 (Arm_relobj::do_read_symbols): New method definition.
12878 (Arm_dynobj::do_read_symbols): Ditto.
12879 (Target_arm::do_finalize_sections): Add input_objects parameters.
12880 Merge processor-specific flags from all input objects.
12881 (Target_arm::are_eabi_versions_compatible,
12882 Target_arm::merge_processor_specific_flags,
12883 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12884 New method definitions.
12885 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12886 Input_objects pointer type parameter.
12887 * layout.cc (Layout::finalize): Pass input objects to target's.
12888 finalize_sections function.
12889 * output.cc (Output_file_header::do_sized_write): Set ELF file
12890 header's processor-specific flags.
12891 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12892 Input_objects pointer type parameter.
12893 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12894 * target.h (Input_objects): New forward class declaration.
12895 (Target::processor_specific_flags,
12896 Target::are_processor_specific_flags_sect): New method definitions.
12897 (Target::finalize_sections): Add input_objects parameter.
12898 (Target::Target): Initialize processor_specific_flags_ and
12899 are_processor_specific_flags_set_.
12900 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12902 (Target::set_processor_specific_flags): New method definition.
12903 (Target::processor_specific_flags_,
12904 Target::are_processor_specific_flags_set_): New data member
12906 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12907 Input_objects pointer type parameter.
12909 2009-10-30 Doug Kwan <dougkwan@google.com>
12911 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12913 2009-10-28 Ian Lance Taylor <iant@google.com>
12915 * object.h (class Relobj): Drop options parameter from
12916 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12917 do_scan_relocs, do_relocate. Change all callers.
12918 (class Sized_relobj): Drop options parameters from
12919 do_gc_process_relocs, do_scan_relocs, do_relocate,
12920 do_relocate_sections, relocate_sections, emit_relocs_scan,
12921 emit_relocs_scan_reltype. Change all callers.
12922 (struct Relocate_info): Remove options field and all references to
12924 * reloc.h (class Read_relocs): Remove options constructor
12925 parameter and options_ field. Change all callers.
12926 (class Gc_process_relocs, class Scan_relocs): Likewise.
12927 (class Relocate_task): Likewise.
12928 * target-reloc.h (scan_relocs): Remove options parameter. Change
12930 (scan_relocatable_relocs): Likewise.
12931 * target.h (class Sized_target): Remove options parameter from
12932 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12934 * gc.h (gc_process_relocs): Remove options parameter. Change all
12936 * arm.cc: Update functions to remove options parameters.
12937 * i386.cc: Likewise.
12938 * powerpc.cc: Likewise.
12939 * sparc.cc: Likewise.
12940 * x86_64.cc: Likewise.
12941 * testsuite/testfile.cc: Likewise.
12943 2009-10-28 Doug Kwan <dougkwan@google.com>
12945 * arm.cc (Arm_relobj): New class definition.
12946 (Arm_relobj::scan_sections_for_stubs,
12947 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12948 New method definitions.
12950 2009-10-28 Cary Coutant <ccoutant@google.com>
12952 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12953 (Plugin::cleanup_done_): New member.
12954 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12955 (Plugin_manager::cleanup_done_): Remove.
12956 (Plugin_manager::add_input_file): Edit error message.
12957 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12958 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12960 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12962 * fileread.cc: (File_read::View::~View): Use the new
12963 data_ownership_ filed.
12964 (File_read::~File_read): Dispose the new whole_file_view_.
12965 (File_read::open): Mmap the whole file if needed.
12966 (File_read::open): Use whole_file_view_ instead of contents_.
12967 (File_read::find_view): Use whole_file_view_ if applicable.
12968 (File_read::do_read): Use whole_file_view_ instead of contents_.
12969 (File_read::make_view): Use whole_file_view_ instead of contents_,
12970 update File_read::View::View call.
12971 (File_read::find_or_make_view): Update File_read::View::View
12973 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12975 (File_read::View::Data_ownership): New enum.
12976 (File_read::View::View): Replace bool mapped_ with Data_ownership
12978 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12979 (File_read::View::data_ownership_): New field.
12980 (File_read::contents_): Remove (replaced by whole_file_view_).
12981 (File_read::whole_file_view_): New field.
12982 * options.h (class General_options): Add --keep-files-mapped.
12984 2009-10-27 Cary Coutant <ccoutant@google.com>
12986 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12987 * testsuite/Makefile.am (plugin_test_5): New test case.
12988 * testsuite/Makefile.in: Regenerate.
12990 2009-10-25 Doug Kwan <dougkwan@google.com>
12992 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12993 from private to protected to allow access by child class.
12994 (Sized_relobj::do_relocate_sections): New method declaration.
12995 (Sized_relobj::relocate_sections): Virtualize.
12996 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
12997 Sized_relobj::relocate_sections. Instantiate template explicitly
12998 for different target sizes and endianity.
13000 2009-10-24 Doug Kwan <dougkwan@google.com>
13002 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13003 (Arm_input_section::as_arm_input_section): New method.
13004 (Arm_output_section): New class definition.
13005 (Arm_output_section::create_stub_group,
13006 Arm_output_section::group_sections): New method definitions.
13008 2009-10-22 Doug Kwan <dougkwan@google.com>
13010 * arm.cc (Arm_input_section): New class definition.
13011 (Arm_input_section::init, Arm_input_section:do_write,
13012 Arm_input_section::set_final_data_size,
13013 Arm_input_section::do_reset_address_and_file_offset): New method
13016 2009-10-21 Doug Kwan <dougkwan@google.com>
13018 * arm.cc (Stub_table, Arm_input_section): New forward class
13020 (Stub_table): New class defintion.
13021 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13022 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13023 New method definition.
13025 2009-10-21 Doug Kwan <dougkwan@google.com>
13027 * arm.cc: Update copyright comments.
13028 (Target_arm): New forward class template declaration.
13029 (Arm_address): New type.
13030 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13031 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13032 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13034 (Insn_template): Same.
13035 (DEF_STUBS): New macro.
13036 (Stub_type): New enum type.
13037 (Stub_template): New class definition.
13039 (Reloc_stub): Same.
13040 (Stub_factory): Same.
13041 (Target_arm::Target_arm): Initialize may_use_blx_ and
13042 should_force_pic_veneer_.
13043 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13044 Target_arm::should_force_pic_veneer,
13045 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13046 Target_arm::using_thumb_only, Target_arm:;default_target): New
13048 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13049 New data member declarations.
13050 (Insn_template::size, Insn_template::alignment): New method defintions.
13051 (Stub_template::Stub_template): New method definition.
13052 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13053 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13054 (Stub_factory::Stub_factory): New method definition.
13055 * gold.h (string_hash): New template.
13056 * output.h (Input_section_specifier::hash_value): Use
13058 (Input_section_specifier::string_hash): Remove.
13059 * stringpool.cc (Stringpool_template::string_hash): Use
13062 2009-10-20 Doug Kwan <dougkwan@google.com>
13064 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13065 symbols of relaxed input sections.
13066 * output.h (Output_section::find_relaxed_input_section): Make
13069 2009-10-16 Doug Kwan <dougkwan@google.com>
13071 * dynobj.cc (Versions::Versions): Initialize version_script_.
13072 Only insert base version symbol definition for a shared object
13073 if version script defines any version versions.
13074 (Versions::define_base_version): New method definition.
13075 (Versions::add_def): Check that base version is not needed.
13076 (Versions::add_need): Define base version lazily.
13077 * dynobj.h (Versions::define_base_version): New method declaration.
13078 (Versions::needs_base_version_): New data member declaration.
13079 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13080 (check_DATA): Add no_version_test.stdout.
13081 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13083 * testsuite/Makefile.in: Regenerate.
13084 * testsuite/no_version_test.c: New file.
13085 * testsuite/no_version_test.sh: Ditto.
13087 2009-10-16 Doug Kwan <dougkwan@google.com>
13089 * expression.cc (class Segment_start_expression): New class definition.
13090 (Segment_start_expression::value): New method definition.
13091 (script_exp_function_segment_start): Return a new
13092 Segment_start_expression.
13093 * gold/script-c.h (script_saw_segment_start_expression): New function
13095 * script-sections.cc (Script_sections::Script_sections): Initialize
13096 SAW_SEGMENT_START_EXPRESSION_ to false.
13097 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13098 and -Tbbs options to specify section addresses if given in
13099 command line and no SEGMENT_START expression is seen in a script.
13100 * script-sections.h (Script_sections::saw_segment_start_expression,
13101 Script_sections::set_saw_segment_start_expression): New method
13103 (Script_sections::saw_segment_start_expression_): New data member
13105 * script.cc (script_saw_segment_start_expression): New function.
13106 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13107 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13108 script_test_7.sh and script_test_8.sh.
13109 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13110 script_test_8.stdout.
13111 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13112 (script_test_6, script_test_6.stdout, script_test_7,
13113 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13114 * Makefile.in: Regenerate.
13115 * testsuite/script_test_6.sh: New file.
13116 * testsuite/script_test_6.t: Same.
13117 * testsuite/script_test_7.sh: Same.
13118 * testsuite/script_test_7.t: Same.
13119 * testsuite/script_test_8.sh: Same.
13121 2009-10-16 Doug Kwan <dougkwan@google.com>
13123 * output.cc (Output_segment::set_section_list_address): Cast
13124 expressions to unsigned long long type to avoid format warnings.
13126 2009-10-15 Ian Lance Taylor <iant@google.com>
13128 * script.cc (Script_options::add_symbol_assignment): Always add a
13129 dot assignment to script_sections_.
13130 * script-sections.cc (Script_sections::add_dot_assignment):
13131 Initialize if necessary.
13133 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13134 program headers with no load segment if there is a linker script.
13136 * layout.cc (Layout::set_segment_offsets): Align the file offset
13137 to the segment aligment for -N or -n with no load segment.
13138 * output.cc (Output_segment::add_output_section): Don't crash if
13139 the first section is a TLS section.
13140 (Output_segment::set_section_list_addresses): Print an error
13141 message if the address moves backward in a linker script.
13142 * script-sections.cc
13143 (Output_section_element_input::set_section_addresses): Don't
13144 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13145 (Orphan_output_section::set_section_addresses): Likewise.
13147 2009-10-15 Doug Kwan <dougkwan@google.com>
13149 * layout.cc (Layout::finish_dynamic_section): Generate tags
13150 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13151 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13152 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13154 2009-10-14 Ian Lance Taylor <iant@google.com>
13156 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13158 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13159 data_shdr fields of relinfo.
13160 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13161 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13162 R_386_TLS_LDO_32, adjust based on section flags.
13163 (Target_i386::Relocate::fix_up_ldo): Remove.
13165 2009-10-13 Ian Lance Taylor <iant@google.com>
13167 Add support for -pie.
13168 * options.h (class General_options): Add -pie and
13170 (General_options::output_is_position_independent): Test -pie.
13171 (General_options::output_is_executable): Return true if not shared
13172 and not relocatable.
13173 (General_options::output_is_pie): Remove.
13174 * options.cc (General_options::finalize): Reject incompatible uses
13176 * gold.cc (queue_middle_tasks): A -pie link is not static.
13177 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13178 * symtab.cc (Symbol::final_value_is_known): Return false if
13179 output_is_position_independent.
13180 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13181 output_is_position_independent.
13182 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13183 output_is_position_independent.
13184 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13185 output_is_position_independent.
13186 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13188 (basic_pie_test.o, basic_pie_test): New targets.
13189 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13190 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13191 (two_file_pie_test): New target.
13192 * testsuite/Makefile.in: Rebuild.
13193 * README: Remove note saying that -pie is not supported.
13195 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13197 * options.h (class General_options): Add -init and -fini.
13198 * layout.cc (Layout::finish_dynamic_section): Emit
13199 given init and fini functions.
13201 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13203 * gc.h (gc_process_relocs): Check if icf is enabled using new
13205 * gold.cc (queue_initial_tasks): Likewise.
13206 (queue_middle_tasks): Likewise.
13207 * object.cc (do_layout): Likewise.
13208 * symtab.cc (is_section_folded): Likewise.
13209 * main.cc (main): Likewise.
13210 * reloc.cc (Read_relocs::run): Likewise.
13211 (Sized_relobj::do_scan_relocs): Likewise.
13212 * icf.cc (is_function_ctor_or_dtor): New function.
13213 (Icf::find_identical_sections): Check if function is ctor or dtor when
13214 safe icf is chosen.
13215 * options.h (General_options::icf): Change option to be an enum.
13216 (Icf_status): New enum.
13217 (icf_enabled): New method.
13218 (icf_safe_folding): New method.
13219 (set_icf_status): New method.
13220 (icf_status_): New variable.
13221 * (options.cc) (General_options::finalize): Set icf_status_.
13222 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13223 icf_test and icf_keep_unique_test to use the --icf enum flag.
13224 * testsuite/icf_safe_test.sh: New file.
13225 * testsuite/icf_safe_test.cc: New file.
13227 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13229 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13230 includes to gc.h and icf.h.
13231 * arm.cc: Include gc.h.
13232 * gold.cc: Likewise.
13233 * i386.cc: Likewise.
13234 * powerpc.cc: Likewise.
13235 * sparc.cc: Likewise.
13236 * x86_64.cc: Likewise.
13237 * gc.h: Include icf.h.
13239 2009-10-11 Ian Lance Taylor <iant@google.com>
13241 * plugin.cc: Include "gold.h" before other header files.
13243 2009-10-10 Chris Demetriou <cgd@google.com>
13245 * options.h (Input_file_argument::Input_file_type): New enum.
13246 (Input_file_argument::is_lib_): Replace with...
13247 (Input_file_argument::type_): New member.
13248 (Input_file_argument::Input_file_argument): Take Input_file_type
13249 'type' rather than boolean 'is_lib' as second argument.
13250 (Input_file_argument::is_lib): Use type_.
13251 (Input_file_argument::is_searched_file): New function.
13252 (Input_file_argument::may_need_search): Handle is_searched_file.
13253 * options.cc (General_options::parse_library): Support -l:filename.
13254 (General_options::parse_just_symbols): Update for Input_file_argument
13256 (Command_line::process): Likewise.
13257 * archive.cc (Archive::get_file_and_offset): Likewise.
13258 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13259 * script.cc (read_script_file, script_add_file): Likewise.
13260 * fileread.cc (Input_file::Input_file): Likewise.
13261 (Input_file::will_search_for): Handle is_searched_file.
13262 (Input_file::open): Likewise.
13263 * readsyms.cc (Read_symbols::get_name): Likewise.
13264 * testsuite/Makefile.am (searched_file_test): New test.
13265 * testsuite/Makefile.in: Regenerate.
13266 * testsuite/searched_file_test.cc: New file.
13267 * testsuite/searched_file_test_lib.cc: New file.
13269 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13270 Ian Lance Taylor <iant@google.com>
13272 * descriptor.cc: Include <cstdio> and "binary-io.h".
13273 (Descriptors::open): Open the files in binary mode always.
13274 * script.cc (Lex::get_token): Treat \r as whitespace.
13276 2009-10-09 Ian Lance Taylor <iant@google.com>
13278 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13280 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13281 Ian Lance Taylor <iant@google.com>
13283 * configure.ac: Check for readv function also.
13284 * fileread.cc (readv): Define if not HAVE_READV.
13285 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13287 * config.in: Regenerate.
13288 * configure: Regenerate.
13290 2009-10-09 Doug Kwan <dougkwan@google.com>
13292 * layout.cc (Layout::make_output_section): Call target hook to make
13293 ordinary output section.
13294 (Layout::finalize): Adjust parameter list of call the
13295 Target::may_relax().
13296 * layout.h (class Layout::section_list): New method.
13297 * merge.h (Output_merge_base::entsize): Change visibility to public.
13298 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13300 (Output_merge_string::do_is_string): New method.
13301 * object.cc (Sized_relobj::do_setup): renamed from
13302 Sized_relobj::set_up.
13303 * object.h (Sized_relobj::adjust_shndx,
13304 Sized_relobj::initializ_input_to_output_maps,
13305 Sized_relobj::free_input_to_output_maps): Change visibilities to
13307 (Sized_relobj::setup): Virtualize.
13308 (Sized_relobj::do_setup): New method declaration.
13309 (Sized_relobj::invalidate_section_offset,
13310 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13311 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13312 * options.cc (parse_int): New function.
13313 * options.h (parse_int): New declaration.
13314 (DEFINE_int): New macro.
13315 (stub_group_size): New option.
13316 * output.cc (Output_section::Output_section): Initialize memebers
13317 merge_section_map_, merge_section_by_properties_map_,
13318 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13319 (Output_section::add_input_section): Handled deferred code-fill
13320 generation and remove an old comment.
13321 (Output_section::add_relaxed_input_section): New method definition.
13322 (Output_section::add_merge_input_section): Use merge section by
13323 properties map to speed to search. Update merge section maps
13325 (Output_section::build_relaxation_map): New method definition.
13326 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13328 (Output_section::relax_input_section): Renamed to
13329 Output_section::convert_input_sections_to_relaxed_sections and change
13330 interface to take a vector of pointers to relaxed sections.
13331 (Output_section::find_merge_section,
13332 Output_section::find_relaxed_input_section): New method definitions.
13333 (Output_section::is_input_address_mapped,
13334 Output_section::output_offset, Output_section::output_address):
13335 Use output section data maps to speed up searching.
13336 (Output_section::find_starting_output_address): Add comments.
13337 (Output_section::do_write,
13338 Output_section::write_to_postprocessing_buffer): Do code-fill
13339 generation as appropriate.
13340 (Output_section::get_input_sections): Invalidate relaxed input section
13342 (Output_section::restore_states): Adjust type of checkpoint .
13343 Invalidate relaxed input section map.
13344 * output.h (Output_merge_base): New class declaration.
13345 (Input_section_specifier): New class defintion.
13346 (class Output_relaxed_input_section) Change base class to
13347 Output_section_data_build.
13348 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13349 base class initializer.
13350 (Output_section::add_relaxed_input_section): New method declaration.
13351 (Output_section::Input_section): Change visibility to protected.
13352 (Output_section::Input_section::relobj,
13353 Output_section::Input_section::shndx): Handle relaxed input sections.
13354 Output_section::input_sections) Change visibility to protected. Also
13355 define overload to return a non-const pointer.
13356 (Output_section::Merge_section_properties): New class defintion.
13357 (Output_section::Merge_section_by_properties_map,
13358 Output_section::Output_section_data_by_input_section_map,
13359 Output_section::Relaxation_map): New types.
13360 (Output_section::relax_input_section): Rename method to
13361 Output_section::convert_input_sections_to_relaxed_sections and change
13362 interface to take a vector of relaxed section pointers.
13363 (Output_section::find_merge_section,
13364 Output_section::find_relaxed_input_section,
13365 Output_section::build_relaxation_map,
13366 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13367 New method declarations.
13368 (Output_section::merge_section_map_
13369 Output_section::merge_section_by_properties_map_,
13370 Output_section::relaxed_input_section_map_,
13371 Output_section::is_relaxed_input_section_map_valid_,
13372 Output_section::generate_code_fills_at_write_): New data members.
13373 * script-sections.cc
13374 (Output_section_element_input::set_section_addresses): Call
13375 current_data_size and addralign methods of relaxed input sections.
13376 (Orphan_output_section::set_section_addresses): Call current_data_size
13377 and addralign methods of relaxed input sections.
13378 * symtab.cc (Symbol_table::compute_final_value): Extract template
13379 from the body of Symbol_table::sized_finalize_symbol.
13380 (Symbol_table::sized_finalized_symbol): Call
13381 Symbol_table::compute_final_value.
13382 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13383 (Symbol_table::compute_final_value): New templated method declaration.
13384 * target.cc (Target::do_make_output_section): New method defintion.
13385 * target.h (Target::make_output_section): New method declaration.
13386 (Target::relax): Add more parameters for input objects, symbol table
13387 and layout. Adjust call to do_relax.
13388 (Target::do_make_output_section): New method declaration.
13389 (Target::do_relax): Add parameters for input objects, symbol table
13392 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13394 * pread.c: Include stdio.h.
13396 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13398 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13401 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13403 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13404 Change read_shndx type to unsigned int.
13405 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13407 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13408 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13409 Change read_shndx type to unsigned int.
13410 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13412 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13413 * layout.cc (Layout::create_symtab_sections): Cast the result of
13414 local_symcount * symsize to off_t in the gold_assert.
13416 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13418 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13419 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13421 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13422 (Arm_relocate_functions::thm_abs5): New function.
13423 (Arm_relocate_functions::abs12): New function.
13424 (Arm_relocate_functions::abs16): New function.
13425 (Arm_relocate_functions::base_abs): New function.
13426 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13427 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13428 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13430 (Scan::global): Likewise.
13431 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13432 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13433 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13434 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13437 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13439 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13440 (Arm_relocate_functions::movt_prel): New function.
13441 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13442 (Arm_relocate_functions::thm_movt_prel): New function.
13443 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13444 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13445 (Scan::global, Relocate::relocate): Likewise.
13446 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13448 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13450 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13451 Incremental_checker.
13452 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13454 (class Incremental_inputs_header): New class.
13455 (Incremental_inputs_header_writer): Edit comment.
13456 (Incremental_inputs_entry): New class.
13457 (Incremental_inputs_entry_writer): Edit comment.
13458 (Sized_incremental_binary::do_find_incremental_inputs_section):
13459 Add *strtab_shndx parameter, fill it.
13460 (Sized_incremental_binary::do_check_inputs): New method.
13461 (Incremental_checker::can_incrementally_link_output_file): Use
13462 Sized_incremental_binary::check_inputs.
13463 (Incremental_inputs::report_command_line): Save command line in
13466 (Incremental_binary::find_incremental_inputs_section): New
13468 (Incremental_binary::do_find_incremental_inputs_section): Add
13469 strtab_shndx parameter.
13470 (Incremental_binary::do_check_inputs): New pure virtual method.
13471 (Sized_incremental_binary::do_check_inputs): Declare.
13472 (Incremental_checker::Incremental_checker): Add incremental_inputs
13473 parameter, use it to initialize incremental_inputs_.
13474 (Incremental_checker::incremental_inputs_): New field.
13475 (Incremental_checker::command_line): New method.
13476 (Incremental_checker::inputs): New method.
13477 (Incremental_checker::command_line_): New field.
13479 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13481 * incremental.cc: Include <cstdarg> and "target-select.h".
13482 (vexplain_no_incremental): New function.
13483 (explain_no_incremental): New function.
13484 (Incremental_binary::error): New method.
13485 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13487 (make_sized_incremental_binary): New function.
13488 (open_incremental_binary): New function.
13489 (can_incrementally_link_file): Add checks if output is ELF and has
13491 * incremental.h: Include "elfcpp_file.h" and "output.h".
13492 (Incremental_binary): New class.
13493 (Sized_incremental_binary): New class.
13494 (open_incremental_binary): Declare.
13495 * object.cc (is_elf_object): Use
13496 elfcpp::Elf_recognizer::is_elf_file.
13497 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13498 * output.h (Output_file::filesize): New method.
13500 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13502 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13504 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13505 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13507 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13509 (Arm_relocate_functions::movw_abs_nc): New function.
13510 (Arm_relocate_functions::movt_abs): New function.
13511 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13512 (Arm_relocate_functions::thm_movt_abs): New function.
13513 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13514 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13515 (Scan::global): Likewise.
13516 (Relocate::relocate): Likewise.
13517 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13519 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13521 * arm.cc (Arm_relocate_functions::got_prel) New function.
13522 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13523 (Relocate::relocate): Likewise.
13524 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13526 2009-10-06 Ian Lance Taylor <iant@google.com>
13528 * options.h (class General_options): Define
13529 split_stack_adjust_size parameter.
13530 * object.h (class Object): Add uses_split_stack_ and
13531 has_no_split_stack_ fields. Add uses_split_stack and
13532 has_no_split_stack accessor functions. Declare
13533 handle_split_stack_section.
13534 (class Reloc_symbol_changes): Define.
13535 (class Sized_relobj): Define Function_offsets. Declare
13536 split_stack_adjust, split_stack_adjust_reltype, and
13538 * object.cc (Object::handle_split_stack_section): New function.
13539 (Sized_relobj::do_layout): Call handle_split_stack_section.
13540 * dynobj.cc (Sized_dynobj::do_layout): Call
13541 handle_split_stack_section.
13542 * reloc.cc (Sized_relobj::relocate_sections): Call
13543 split_stack_adjust for executable sections in split_stack
13544 objects. Pass reloc_map to relocate_section.
13545 (Sized_relobj::split_stack_adjust): New function.
13546 (Sized_relobj::split_stack_adjust_reltype): New function.
13547 (Sized_relobj::find_functions): New function.
13548 * target-reloc.h: Include "object.h".
13549 (relocate_section): Add reloc_symbol_changes parameter. Change
13551 * target.h (class Target): Add calls_non_split method. Declare
13552 do_calls_non_split virtual method. Declare match_view and
13554 * target.cc: Include "elfcpp.h".
13555 (Target::do_calls_non_split): New function.
13556 (Target::match_view): New function.
13557 (Target::set_view_to_nop): New function.
13558 * gold.cc (queue_middle_tasks): Give an error if mixing
13559 split-stack and non-split-stack objects with -r.
13560 * i386.cc (Target_i386::relocate_section): Add
13561 reloc_symbol_changes parameter.
13562 (Target_i386::do_calls_non_split): New function.
13563 * x86_64.cc (Target_x86_64::relocate_section): Add
13564 reloc_symbol_changes parameter.
13565 (Target_x86_64::do_calls_non_split): New function.
13566 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13568 * powerpc.cc (Target_powerpc::relocate_section): Add
13569 reloc_symbol_changes parameter.
13570 * sparc.cc (Target_sparc::relocate_section): Add
13571 reloc_symbol_changes parameter.
13572 * configure.ac: Call AM_CONDITIONAL for the default target.
13573 * configure: Rebuild.
13574 * testsuite/Makefile.am (TEST_AS): New variable.
13575 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13576 (check_DATA): Add split_i386 and split_x86_64 files.
13577 (SPLIT_DEFSYMS): Define.
13578 (split_i386_[1234n].o): New targets.
13579 (split_i386_[124]): New targets.
13580 (split_i386_[1234r].stdout): New targets.
13581 (split_x86_64_[1234n].o): New targets.
13582 (split_x86_64_[124]): New targets.
13583 (split_x86_64_[1234r].stdout): New targets.
13584 (MOSTLYCLEANFILES): Add new executables.
13585 * testsuite/split_i386.sh: New file.
13586 * testsuite/split_x86_64.sh: New file.
13587 * testsuite/split_i386_1.s: New file.
13588 * testsuite/split_i386_2.s: New file.
13589 * testsuite/split_i386_3.s: New file.
13590 * testsuite/split_i386_4.s: New file.
13591 * testsuite/split_i386_n.s: New file.
13592 * testsuite/split_x86_64_1.s: New file.
13593 * testsuite/split_x86_64_2.s: New file.
13594 * testsuite/split_x86_64_3.s: New file.
13595 * testsuite/split_x86_64_4.s: New file.
13596 * testsuite/split_x86_64_n.s: New file.
13597 * testsuite/testfile.cc (Target_test): Update relocation_section
13599 * testsuite/Makefile.in: Rebuild.
13601 2009-10-06 Ian Lance Taylor <iant@google.com>
13603 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13604 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13605 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13606 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13607 the address on ldo_addrs_.
13608 (Target_i386::Relocate::fix_up_ldo): New function.
13610 2009-10-06 Rafael Espindola <espindola@google.com>
13612 * plugin.cc (add_input_library): New.
13613 (Plugin::load): Add add_input_library to tv.
13614 (Plugin_manager::add_input_file): Add the is_lib argument.
13615 (add_input_file): Update call to Plugin_manager::add_input_file.
13616 (add_input_library): New.
13617 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13619 2009-09-30 Doug Kwan <dougkwan@google.com>
13621 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13622 symbol and call Symbol::may_need_copy_reloc to determine if
13623 a copy reloc is needed.
13624 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13625 nocopyreloc is given in command line.
13626 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13627 given in command line.
13628 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13629 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13630 of the removed Target_i386::may_need_copy_reloc.
13631 * options.h (copyreloc): New option with default value false.
13632 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13633 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13634 instead of the removed Target_powerpc::may_need_copy_reloc.
13635 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13636 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13637 instead of the removed Target_sparc::may_need_copy_reloc.
13638 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13639 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13640 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13641 instead of the removed Target_x86_64::may_need_copy_reloc.
13643 2009-09-30 Ian Lance Taylor <iant@google.com>
13645 * object.h (class Object): Remove target_ field, and target,
13646 sized_target, and set_target methods.
13647 (Object::sized_target): Remove.
13648 (class Sized_relobj): Update declarations. Remove sized_target.
13649 * object.cc (Sized_relobj::setup): Remove target parameter.
13650 Change all callers.
13651 (Input_objects::add_object): Don't do anything with the target.
13652 (make_elf_sized_object): Add punconfigured parameter. Change all
13653 callers. Set or test parameter target.
13654 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13655 Change all callers.
13656 * parameters.cc (Parameters::set_target): Change parameter type to
13658 (Parameters::default_target): Remove.
13659 (set_parameters_target): Change parameter type to be non-const.
13660 (parameters_force_valid_target): New function.
13661 (parameters_clear_target): New function.
13662 * parameters.h (class Parameters): Update declarations. Remove
13663 default_target method. Add sized_target and clear_target
13664 methods. Change target_ to be non-const.
13665 (set_parameters_target): Update declaration.
13666 (parameters_force_valid_target): Declare.
13667 (parameters_clear_target): Declare.
13668 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13669 as NULL if we aren't searching.
13670 (Add_symbols::run): Don't check for compatible target.
13671 * fileread.cc (Input_file::open_binary): Call
13672 parameters_force_valid_target.
13673 * gold.cc (queue_middle_tasks): Likewise.
13674 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13675 set_target on object.
13676 * dynobj.h (class Sized_dynobj): Update declarations.
13677 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13678 make_elf_object returns NULL.
13679 (Archive::include_member): Don't check whether object target is
13681 * output.cc (Output_section::add_input_section): Get target from
13683 (Output_section::relax_input_section): Likewise.
13684 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13686 (Sized_relobj::do_scan_relocs): Likewise.
13687 (Sized_relobj::relocate_sections): Likewise.
13688 * resolve.cc (Symbol_table::resolve): Likewise.
13689 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13690 parameter. Change all callers.
13691 (Symbol_table::add_from_object): Get target from parameters.
13692 (Symbol_table::add_from_relobj): Don't check object target.
13693 (Symbol_table::add_from_dynobj): Likewise.
13694 (Symbol_table::define_special_symbol): Get target from
13696 * symtab.h (class Symbol_table): Update declaration.
13697 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13698 parameter. Change all callers. Clear parameter target.
13699 (Binary_test): Test target here.
13700 * testsuite/object_unittest.cc (gold_testsuite): Remove
13701 target_test_pointer parameter. Change all callers.
13702 (Object_test): Test target here.
13704 2009-09-26 Ian Lance Taylor <iant@google.com>
13706 * testsuite/initpri1.c: Don't try to use constructor priorities if
13707 compiling with gcc before 4.3.
13709 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13711 * testsuite/retain_symbols_file_test.sh (check_present): Change
13712 output file name to retain_symbols_file_test.stdout.
13713 (check_absent): Likewise.
13715 2009-09-18 Craig Silverstein <csilvers@google.com>
13717 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13718 * options.cc: Include <cerrno> and <fstream>.
13719 (General_options::finalize): Parse -retain-symbols-file tag.
13720 * options.h: New flag.
13721 (General_options): New method should_retain_symbol, new
13722 variable symbols_to_retain.
13723 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13724 should_retain_symbol map.
13725 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13726 * testsuite/Makefile.in: Regenerate.
13727 * testsuite/retain_symbols_file_test.sh: New file.
13729 2009-09-18 Nick Clifton <nickc@redhat.com>
13731 * po/es.po: Updated Spanish translation.
13733 2009-09-17 Doug Kwan <dougkwan@google.com>
13735 * debug.h (DEBUG_RELAXATION): New constant.
13736 (DEBUG_ALL): Add DEBUG_RELAXATION.
13737 (debug_string_to_enum): Add relaxation debug option.
13739 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13740 Layout::Relaxation_debug_check::read_sections,
13741 Layout::Relaxation_debug_check::read_sections): New method definitions.
13742 (Layout::Layout): Initialize data members
13743 record_output_section_data_from_scrips_,
13744 script_output_section_data_list_ and relaxation_debug_check_.
13745 (Layout::save_segments, Layout::restore_segments,
13746 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13747 Layout::relaxation_loop_body): New method definitions.
13748 (Layout::finalize): Support relaxation. Move section layout code to
13749 Layout::relaxation_loop_body.
13750 (Layout::set_asection_address_from_script): Move code for orphan
13751 section placement out.
13752 (Layout::place_orphan_sections_in_script): New method definition.
13753 * layout.h (Output_segment_headers, Output_file_header):
13754 New forward class declarations.
13755 (Layout::~Layout): Define.
13756 (Layout::new_output_section_data_from_script): New method definition.
13757 (Layout::place_orphan_sections_in_script): New method declaration.
13758 (Layout::Segment_states): New type declaration.
13759 (Layout::save_segments, Layout::restore_segments,
13760 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13761 Layout::relaxation_loop_body): New method declarations.
13762 (Layout::Output_section_data_list): New type declaration.
13763 (Layout::Relaxation_debug_check): New class definition.
13764 (Layout::record_output_section_data_from_script_,
13765 Layout::script_output_section_data_list_, Layout::segment_states_,
13766 Layout::relaxation_debug_check_): New data members.
13767 * output.cc: (Output_section_headers::do_size): New method definition.
13768 (Output_section_headers::Output_section_headers): Move size
13769 computation to Output_section_headers::do_size.
13770 (Output_segment_headers::do_size): New method definition.
13771 (Output_file_header::Output_file_header): Move size computation to
13772 Output_file_header::do_size and call it.
13773 (Output_file_header::do_size): New method definition.
13774 (Output_data_group::Output_data_group): Adjust call to
13775 Output_section_data.
13776 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13777 (Output_symtab_xindex::do_write): Add array bound check.
13778 (Output_section::Input_section::print_to_mapfile): Handle
13779 RELAXED_INPUT_SECTION_CODE.
13780 (Output_section::Output_section): Initialize data member checkpoint_.
13781 (Output_section::~Output_section): Delete checkpoint object pointed
13783 (Output_section::add_input_section): Always add an Input_section if
13785 (Output_section::add_merge_input_section): Add assert.
13786 (Output_section::relax_input_section): New method definition.
13787 (Output_section::set_final_data_size): Set load address to zero for
13788 an unallocated section.
13789 (Output_section::do_address_and_file_offset_have_reset_values):
13790 New method definition.
13791 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13792 Handle relaxed input section.
13793 (Output_section::sort_attached_input_sections): Checkpoint input
13794 section list lazily.
13795 (Output_section::get_input_sections): Change type of input_sections to
13796 list of Simple_input_section pointers. Checkpoint input section list
13797 lazily. Also handle relaxed input sections.
13798 (Output_section::add_input_section_for_script): Take a reference to
13799 a Simple_input_section object instead of Relobj pointer and section
13800 index as parameter. Handle relaxed input sections.
13801 (Output_section::save_states, Output_section::restore_states): New
13802 method definitions.
13803 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13804 (Output_data::is_data_size_fixed): New method definition.
13805 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13807 (Output_data::address_and_file_offset_have_reset_values): New method
13809 (Output_data::do_address_and_file_offset_have_reset_values): New method
13811 (Output_data::set_data_size): Check that data size is not fixed.
13812 (Output_data::fix_data_size): New method definition.
13813 (Output_data::is_data_size_fixed_): New data member.
13814 (Output_section_headers::set_final_data_size): New method definition.
13815 (Output_section_headers::do_size): New method declaration.
13816 (Output_segment_headers::set_final_data_size): New method definition.
13817 (Output_segment_headers::do_size): New method declaration.
13818 (Output_file_header::set_final_data_size)::New method definition.
13819 (Output_file_header::do_size)::New method declaration.
13820 (Output_section_data::Output_section_data): Add new parameter
13821 is_data_size_fixed and use it to fix data size.
13822 (Output_data_const::Output_data_const): Adjust call to base class
13823 constructor and fix data size.
13824 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13825 base class constructor and fix data size.
13826 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13827 base class constructor and fix data size.
13828 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13829 class constructor and fix data size.
13830 (Output_data_group::set_final_data_size): New method definition.
13831 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13832 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13833 class constructor and fix data size.
13834 (Output_relaxed_input_section): New class definition.
13835 (Output_section::Simple_input_section): New class definition.
13836 (Output_section::get_input_sections): Adjust parameter list.
13837 (Output_section::add_input_section_for_script): Same.
13838 (Output_section::save_states, Output_section::restore_states,
13839 Output_section::do_address_and_file_offset_have_reset_values,
13840 (Output_section::Input_section::Input_section): Handle
13841 RELAXED_INPUT_SECTION_CODE. Add new overload for
13842 Output_relaxed_input_section.
13843 (Output_section::Input_section::is_input_section,
13844 Output_section::Input_section::set_output_section): Handle relaxed
13846 (Output_section::Input_section::is_relaxed_input_section,
13847 Output_section::Input_section::output_section_data,
13848 Output_section::Input_section::relaxed_input_section): New method
13850 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13852 (Output_section::Input_section::u1_): Update comments.
13853 (Output_section::Input_section::u2_): Add new union member poris.
13854 (Output_section::Checkpoint_output_section): New classs definition.
13855 (Output_section::relax_input_section): New method declaration.
13856 (Output_section::checkpoint_): New data member.
13857 (Output_segment): Update comments.
13858 (Output_segment::Output_segment): Un-privatize copy constructor.
13859 (Output_segment::operator=): Un-privatize.
13860 * script-sections.cc (Output_section_element::Input_section_list):
13861 Change element type to Output_section::Simple_input_section.
13862 (Output_section_element_dot_assignment::set_section_addresses):
13863 Register output section data for relaxation clean up.
13864 (Output_data_exression::Output_data_expression): Adjust call to base
13865 constructor to fix data size.
13866 (Output_section_element_data::set_section_addresses): Register
13867 Output_data_expression object for relaxation clean up.
13868 (struct Input_section_info): Replace Relobj pointer and section index
13869 pair with Output_section::Simple_input_section and Convert struct to a
13871 (Input_section_sorter::operator()): Adjust access to
13872 Input_section_info data member to use accessors.
13873 (Output_section_element_input::set_section_addresses): Use layout
13874 parameter. Adjust code to use Output_section::Simple_input_section
13875 and Input_secction_info classes. Register filler for relaxation
13877 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13878 and section index pair with Output_section::Simple_input_section
13879 class. Adjust code accordingly.
13880 (Phdrs_element::release_segment): New method definition.
13881 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13883 (Script_sections::release_segments): New method definition.
13884 * gold/script-sections.h (Script_sections::release_segments): New
13885 method declaration.
13886 * gold/target.h (Target::may_relax, Target::relax,
13887 Target::do_may_relax, Target::do_relax): New method definitions.
13889 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13891 * arm.cc (has_signed_unsigned_overflow): New function.
13892 (Arm_relocate_functions::abs8): New function.
13893 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13894 (Target_arm::Scan::global): Likewise.
13895 (Target_arm::relocate::relocate): Likewise.
13896 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13899 2009-09-16 Cary Coutant <ccoutant@google.com>
13901 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13902 * testsuite/Makefile.in: Regenerate.
13904 2009-09-11 Nick Clifton <nickc@redhat.com>
13906 * po/gold.pot: Updated by the Translation project.
13908 2009-09-08 Cary Coutant <ccoutant@google.com>
13910 * output.cc (Output_file::open): Add execute permission to empty file.
13911 * testsuite/Makefile.am (permission_test): New test.
13912 * testsuite/Makefile.in: Regenerate.
13914 2009-09-02 Ian Lance Taylor <iant@google.com>
13916 * output.cc (Output_file::resize): Call map_no_anonymous rather
13919 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13921 * gold.cc: Include "incremental.h".
13922 (queue_initial_tasks): Call Incremental_checker methods.
13923 * incremental.cc: Include "output.h".
13924 (Incremental_checker::can_incrementally_link_output_file): New
13926 * incremental.h (Incremental_checker): New class.
13928 * output.cc (Output_file::open_for_modification): New method.
13929 (Output_file::map_anonymous): Changed return type to bool. Record
13930 map in base_ field.
13931 (Output_file::map_no_anonymous): New method, broken out of map.
13932 (Output_file::map): Use map_no_anonymous and map_anonymous.
13933 * output.h (class Output_file): Update declarations.
13935 2009-08-24 Cary Coutant <ccoutant@google.com>
13937 * options.h (Command_line::Pre_options): New class.
13938 (Command_line::pre_options): New member.
13939 * options.cc (gold::options::ready_to_register): New variable.
13940 (One_option::register_option): Do nothing if not registering options.
13941 Assert if same short option registered twice.
13942 (General_options::General_options): Turn off option registration when
13944 (Command_line::Pre_options::Pre_options): New constructor.
13946 2009-08-24 Cary Coutant <ccoutant@google.com>
13948 * options.h (General_options::no_keep_memory): Remove incorrect
13951 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13953 * Makefile.am (am__skiplex, am__skipyacc): New.
13954 * Makefile.in: Regenerate.
13956 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13958 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13959 (INCLUDES): ... this.
13960 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13961 (AM_CPPFLAGS): Renamed from ...
13962 (INCLUDE): ... this.
13963 * Makefile.in, testsuite/Makefile.in: Regenerate.
13965 * Makefile.in: Regenerate.
13966 * aclocal.m4: Likewise.
13967 * config.in: Likewise.
13968 * configure: Likewise.
13969 * testsuite/Makefile.in: Likewise.
13971 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13972 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13973 * Makefile.in: Regenerate.
13974 * testsuite/Makefile.in: Regenerate.
13976 2009-08-19 Cary Coutant <ccoutant@google.com>
13978 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13979 symbols in shared libraries overridden by hidden or internal symbols
13980 in the main program.
13982 2009-08-19 Chris Demetriou <cgd@google.com>
13984 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13985 checking source file names in error messages.
13987 2009-08-18 Doug Kwan <dougkwan@google.com>
13989 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13990 an elcpp::Ehdr as parameter. Adjust call to set_target.
13991 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13992 an elfcpp::Ehdr as parameter.
13993 * object.cc (Object::set_target): Remove the version that looks up
13994 a target and sets it.
13995 (Sized_relobj::setup): Take a Target object instead of
13996 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13997 (make_elf_sized_object): Find target and ask target to
13998 make an ELF object.
13999 * object.h: (Object::set_target): Remove the version that looks up
14000 a target and sets it.
14001 (Sized_relobj::setup): Take a Target object instead of
14002 an elfcpp:Ehdr as parameter.
14003 * target.cc: Include dynobj.h.
14004 (Target::do_make_elf_object_implementation): New.
14005 (Target::do_make_elf_object): New.
14006 * target.h (Target::make_elf_object): New template declaration.
14007 (Target::do_make_elf_object): New method declarations.
14008 (Target::do_make_elf_object_implementation): New template declaration.
14010 2009-08-14 Ian Lance Taylor <iant@google.com>
14012 * gold.h (FUNCTION_NAME): Define.
14013 (gold_unreachable): Use FUNCTION_NAME.
14015 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14017 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14018 symbol in the --keep-unique list is not found.
14020 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14022 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14023 been maked as --keep-unique.
14024 (Icf::unfold_section): New function.
14025 * icf.h (Icf::unfold_section): New function.
14026 * options.h (General_options::keep_unique): New option.
14027 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14028 * testsuite/Makefile.in: Regenerate.
14029 * testsuite/icf_keep_unique_test.sh: New file.
14030 * testsuite/icf_keep_unique_test.cc: New file.
14032 2009-08-12 Cary Coutant <ccoutant@google.com>
14035 * resolve.cc (Symbol_table::resolve): Check for references from
14036 dynamic objects to hidden and internal symbols.
14037 * testsuite/Makefile.am (hidden_test.sh): New test.
14038 * testsuite/Makefile.in: Regenerate.
14039 * testsuite/hidden_test.sh: New script.
14040 * testsuite/hidden_test_1.c: New test source.
14041 * testsuite/hidden_test_main.c: New test source.
14043 2009-08-11 Doug Kwan <dougkwan@google.com>
14045 * arm.cc: Update comments.
14046 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14047 segment to locate the .ARM.exidx section if present.
14049 2009-08-09 Doug Kwan <dougkwan@google.com>
14051 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14054 2009-08-07 Sriraman Tallam <tmsriram@google.com>
14055 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14058 2009-08-06 Sriraman Tallam <tmsriram@google.com>
14060 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14061 valid tls_segment only for non-debug-section relocations.
14062 * testsuite/Makefile.am: Add gc_tls_test.
14063 * testsuite/Makefile.in: Regenerate.
14064 * testsuite/gc_tls_test.cc: New file.
14065 * testsuite/gc_tls_test.sh: New file.
14067 2009-08-05 Sriraman Tallam <tmsriram@google.com>
14069 * icf.cc: New file.
14071 * Makefile.am (CCFILES): Add icf.cc.
14072 (HFILES): Add icf.h
14073 * Makefile.in: Regenerate.
14074 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14075 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14076 section, symbol and addend information for the relocs.
14077 * gold.cc (queue_middle_tasks): Call identical code folding.
14078 * gold.h: Add defines for multimap.
14079 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14080 to the call of finalize_local_symbols.
14081 * main.cc (main): Create object of class Icf.
14082 * object.cc (Sized_relobj::do_layout): Allow this function to be
14083 called twice during icf.
14084 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14085 to sections marked as identical by icf.
14086 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14088 (Sized_relobj::do_section_entsize): New function.
14089 * object.h (Object::section_entsize): New function.
14090 (Object::do_section_entsize): New pure virtual function.
14091 (Relobj::finalize_local_symbols): Add new parameter.
14092 (Relobj::do_section_entsize): New function.
14093 * options.h (General_options::icf): New option.
14094 (General_options::icf_iterations): New option.
14095 (General_options::print_icf_sections): New option.
14096 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14097 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14098 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14100 * symtab.cc (Symbol_table::is_section_folded): New function.
14101 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14102 to sections marked as identical by icf.
14103 * symtab.h (Symbol_table::set_icf): New function.
14104 (Symbol_table::icf): New function.
14105 (Symbol_table::is_section_folded): New function.
14106 (Symbol_table::icf_): New data member.
14107 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14108 * testsuite/Makefile.am: Add commands to build icf_test.
14109 * testsuite/Makefile.in: Regenerate.
14110 * testsuite/icf_test.sh: New file.
14111 * testsuite/icf_test.cc: New file.
14113 2009-07-24 Chris Demetriou <cgd@google.com>
14115 * layout.cc (is_compressible_debug_section): Fix incorrect
14116 comment about compressed section names.
14118 2009-07-20 Ian Lance Taylor <ian@airs.com>
14121 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14123 2009-07-16 Ian Lance Taylor <iant@google.com>
14126 * layout.h: #include <map>.
14127 (class Kept_section): Change from struct to class. Add accessors
14128 and setters. Add section size to Comdat_group mapping. Change
14129 Comdat_group to std::map. Add is_comdat_ field. Add
14130 linkonce_size field in union.
14131 (class Layout): Update declaration of find_or_add_kept_section.
14132 Don't declare find_kept_object.
14133 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14134 parameter. Add object, shndx, is_comdat, and is_group_name
14135 parameters. Change all callers. Adjust for new Kept_section.
14136 (Layout::find_kept_object): Remove.
14137 * object.cc (Sized_relobj::include_section_group): Update use of
14138 Kept_section. Rename secnum to shndx. Only record
14139 Kept_comdat_section if sections are the same size.
14140 (Sized_relobj::include_linkonce_section): Update use of
14141 Kept_section. Only record Kept_comdat_section if sections are the
14142 same size. Set size of linkonce section.
14143 (Sized_relobj::map_to_kept_section): Update call to
14144 get_kept_comdat_section.
14145 * object.h (class Sized_relobj): Rename fields in
14146 Kept_comdat_section to drop trailing underscores; change object
14147 field to Relobj*. Change Kept_comdat_section_table to store
14148 struct rather than pointer.
14149 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14150 Add kept_object and kept_shndx parameters. Change all callers.
14151 (Sized_relobj::get_kept_comdat_section): Change return type to
14152 bool. Add kept_object and kept_shndx parameters. Change all
14154 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14155 Layout::find_or_add_kept_section.
14157 2009-07-09 Ian Lance Taylor <iant@google.com>
14159 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14160 Reserve space in the hash table.
14162 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14164 * fileread.cc (File_read::get_mtime): New method.
14165 * fileread.h (Timespec): New structure.
14166 (File_read::get_mtime): New method.
14167 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14168 Renamed from timestamp_nsec.
14169 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14171 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14173 (Incremental_inputs::report_archive): Save mtime; style fix.
14174 (Incremental_inputs::report_obejct): Save mtime; style fix.
14175 (Incremental_inputs::report_script): Save mtime; style fix.
14176 (Incremental_inputs::finalize_inputs): Style fix.
14177 (Incremental_inputs::finalize): Style fix.
14178 (Incremental_inputs::create_input_section_data): Store inputs
14180 * incremental.h (Incremental_inputs::report_script): Add mtime
14182 (Incremental_inputs::Input_info::Input_info): Intialize only one
14184 (Incremental_inputs::Input_info::archive): Move to nameless
14186 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14187 (Incremental_inputs::Input_info::script): Move to nameless union.
14188 (Incremental_inputs::mtime): New field.
14189 * script.cc (read_input_script): Pass file mtime to
14191 * script.h (Script_info::inputs): Style fix.
14193 2009-07-01 Ian Lance Taylor <ian@airs.com>
14195 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14198 2009-06-24 Ian Lance Taylor <iant@google.com>
14201 * layout.cc (Layout::choose_output_section): If we find an
14202 existing section, update the flags.
14203 (Layout::create_notes): New function, broken out of
14205 (Layout::finalize): Don't create note sections.
14206 (Layout::create_note): Don't crash if linker script discards
14208 (Layout::create_gold_note): Likewise.
14209 (Layout::create_build_id): Likewise. Don't set
14210 after_input_sections on the section.
14211 (Layout::create_executable_stack_info): Remove target parameter.
14213 * layout.h (class Layout): Declare create_notes. Update
14214 declaration of create_executable_stack_info.
14215 * gold.cc (queue_middle_tasks): Call create_notes.
14216 * output.cc (Output_section::update_flags_for_input_section): Move
14217 here from output.h. If SHF_ALLOC flag is newly set, mark address
14219 * output.h (Output_data::mark_address_invalid): New function.
14220 (class Output_section): Only declare, not define,
14221 update_flags_for_input_section. Remove set_flags.
14223 2009-06-24 Ian Lance Taylor <iant@google.com>
14225 * script-sections.cc (Output_section_definition::
14226 set_section_addresses): Rename shadowing local load_address to
14229 2009-06-24 Ian Lance Taylor <iant@google.com>
14232 * reloc.cc (relocate_sections): Skip empty relocation sections.
14234 2009-06-23 Ian Lance Taylor <iant@google.com>
14237 * layout.cc (Layout::create_note): Use choose_output_section
14238 rather than make_output_section.
14240 2009-06-23 Ian Lance Taylor <iant@google.com>
14243 * options.cc (General_options::parse_V): Set printed_version_.
14244 (General_options::General_options): Initialize printed_version_.
14245 * options.h (class General_options): Add printed_version_ field.
14246 * gold.cc (queue_initial_tasks): If there are no input files,
14247 don't give a fatal error if we printed the version information.
14248 (queue_middle_tasks): If using -r with a shared object, give a
14249 fatal error rather than an ordinary error.
14251 2009-06-23 Ian Lance Taylor <iant@google.com>
14254 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14255 (Layout::make_output_section): Set have_stabstr_section_ if we see
14256 a .stab*str section.
14257 (Layout::finalize): Call link_stabs_sections.
14258 (Layout::link_stabs_sections): New file.
14259 * layout.h (class Layout): Add have_stabstr_section_ field.
14260 Declare link_stabs_sections.
14262 2009-06-23 Doug Kwan <dougkwan@google.com>
14264 * Makefile.am (libgold_a_LIBADD): New.
14265 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14266 * Makefile.in: Regenerate.
14267 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14268 * configure: Regenerate.
14269 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14270 * fileread.cc: Include sys/state.h
14271 * gold.h: Declare memmem and strndup if found missing.
14272 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14274 2009-06-23 Ian Lance Taylor <iant@google.com>
14276 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14277 * configure: Rebuild.
14279 2009-06-23 Ian Lance Taylor <iant@google.com>
14282 * object.cc (Object::section_contents): Don't try to get a view if
14283 the section has length zero.
14284 (Object::handle_gnu_warning_section): If the section is empty, use
14285 the name of the section as the warning.
14287 2009-06-23 Ian Lance Taylor <iant@google.com>
14290 * stringpool.h (class Stringpool_template): Add optimize_ field.
14291 (Stringpool_template::set_optimize): New function.
14292 * stringpool.cc (Stringpool_template::Stringpool_template):
14293 Initialize optimize_ field.
14294 (Stringpool_template::set_string_offsets): Test local optimize
14295 fild rather than parameter.
14296 * layout.cc (Layout::Layout): Call set_optimize on the section
14299 2009-06-22 Ian Lance Taylor <iant@google.com>
14302 * yyscript.y: Parse TARGET.
14303 * script.cc (script_set_target): New function.
14304 * script-c.h (script_set_target): Declare.
14305 * options.cc (General_options::string_to_object_format): Rename
14306 from string_to_object_format in anonymous namespace. Change
14308 * options.h (class General_options): Declare
14309 string_to_object_format.
14311 2009-06-22 Ian Lance Taylor <iant@google.com>
14313 * script-sections.cc (Script_sections::create_segments): Don't put
14314 program headers in a PT_LOAD segment if -n or -N.
14316 2009-06-22 Ian Lance Taylor <iant@google.com>
14319 * options.h (class General_options): Add -z lazy and -z now. Sort
14320 -z options into alphabetical order.
14321 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14323 2009-06-21 Ian Lance Taylor <iant@google.com>
14325 * layout.cc (Layout::make_output_section): Call
14326 Target::new_output_section.
14327 (Layout::attach_allocated_section_to_segment): Put large section
14328 sections in a separate load segment with the large segment flag
14330 (Layout::segment_precedes): Sort large data segments after other
14332 (align_file_offset): New static function.
14333 (Layout::set_segment_offsets): Use align_file_offset.
14334 * output.h (class Output_section): Add is_small_section_ and
14335 is_large_section_ fields.
14336 (Output_section::is_small_section): New function.
14337 (Output_section::set_is_small_section): New function.
14338 (Output_section::is_large_section): New function.
14339 (Output_section::set_is_large_section): New function.
14340 (Output_section::is_large_data_section): New function.
14341 (class Output_segment): Add is_large_data_segment_ field.
14342 (Output_segment::is_large_data_segment): New function.
14343 (Output_segment::set_is_large_data_segment): New function.
14344 * output.cc (Output_section::Output_section): Initialize new
14346 (Output_segment::Output_segment): Likewise.
14347 (Output_segment::add_output_section): Add assertion that large
14348 data sections always go in large data segments. Force small data
14349 sections to the end of the list of data sections. Force small BSS
14350 sections to the start of the list of BSS sections. For large BSS
14351 sections to the end of the list of BSS sections.
14352 * symtab.h (class Symbol): Declare is_common_shndx.
14353 (Symbol::is_defined): Check Symbol::is_common_shndx.
14354 (Symbol::is_common): Likewise.
14355 (class Symbol_table): Define enum Commons_section_type. Update
14356 declarations. Add small_commons_ and large_commons_ fields.
14357 * symtab.cc (Symbol::is_common_shndx): New function.
14358 (Symbol_table::Symbol_table): Initialize new fields.
14359 (Symbol_table::add_from_object): Put small and large common
14360 symbols in the right list.
14361 (Symbol_table::sized_finalized_symbol): Check
14362 Symbol::is_common_shndx.
14363 (Symbol_table::sized_write_globals): Likewise.
14364 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14365 common symbol lists. Don't call do_allocate_commons_list if the
14367 (Symbol_table::do_allocate_commons_list): Remove is_tls
14368 parameter. Add comons_section_type parameter. Change all
14369 callers. Handle small and large common symbols.
14370 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14371 Symbol::is_common_shndx.
14372 * resolve.cc (symbol_to_bits): Likewise.
14373 * target.h (Target::small_common_shndx): New function.
14374 (Target::small_common_section_flags): New function.
14375 (Target::large_common_shndx): New function.
14376 (Target::large_common_section_flags): New function.
14377 (Target::new_output_section): New function.
14378 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14379 small_common_section_flags, and large_common_section_flags
14381 (Target::do_new_output_section): New virtual function.
14382 * arm.cc (Target_arm::arm_info): Initialize new fields.
14383 * i386.cc (Target_i386::i386_info): Likewise.
14384 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14386 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14387 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14388 (Target_x86_64::do_new_output_section): New function.
14389 * configure.ac: Define conditional MCMODEL_MEDIUM.
14390 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14391 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14392 (large_LDFLAGS): Define.
14393 * testsuite/large.c: New file.
14394 * testsuite/testfile.cc (Target_test::test_target_info):
14395 Initialize new fields.
14396 * configure, testsuite/Makefile.in: Rebuild.
14398 2009-06-05 Doug Kwan <dougkwan@google.com>
14400 * Makefile.am (CCFILES): Add target.cc.
14401 * Makefile.in: Regenerate.
14402 * i386.cc (class Target_i386): Define new virtual method to
14403 override do_is_local_label_name in parent.
14404 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14405 local symbols if --discard-locals or -X is given.
14406 * options.h (class General_options): Declare new options
14407 '--discard-locals' and '-X' for discarding locals.
14408 * target.h (class Target): Define new methods is_local_label_name.
14409 Declare new virtual method do_is_local_label_name.
14410 * target.cc: New file.
14411 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14412 (check_SCRIPTS): Add discard_locals_test.sh.
14413 (check_DATA): Add discard_local_tests.syms.
14414 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14415 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14416 * testsuite/Makefile.in: Regenerate.
14417 * testsuite/discard_locals_test.c: New file.
14418 * testsuite/discard_locals_test.sh: Same.
14420 2009-06-05 Doug Kwan <dougkwan@google.com>
14422 * object.cc (Sized_relobj::Sized_relobj): Initialize
14423 discarded_eh_frame_shndx_ to -1U.
14424 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14426 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14427 a discarded .eh_frame section.
14428 (Sized_relobj::do_finalize_local_symbols): Ditto.
14429 * object.h (class Sized_relobj): Declare new member
14430 discarded_eh_frame_shndx_.
14431 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14432 (local_labels_test.o, local_labels_test): New rules.
14433 * testsuite/Makefile.in: Regenerate.
14435 2009-06-04 Doug Kwan <dougkwan@google.com>
14437 * layout.cc (Layout::section_name_mapping): Add mapping for
14438 special ARM sections.
14440 2009-06-03 Doug Kwan <dougkwan@google.com>
14442 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14443 (utils::has_overflow): Same.
14445 2009-06-03 Ian Lance Taylor <iant@google.com>
14447 * layout.cc (Layout::section_name_mapping): New array, replacing
14448 Layout::linkonce_mapping.
14449 (Layout::section_name_mapping_count): New variable, replacing
14450 Layout::linkonce_mapping_count.
14451 (Layout::linkonce_output_name): Remove.
14452 (Layout::output_section_name): Rewrite.
14453 * layout.h (class Layout): Rename Linkonce_mapping to
14454 Section_name_mapping, linkonce_mapping to section_name_mapping,
14455 linkonce_mapping_count to section_name_mapping_count. Don't
14456 declare linkonce_output_name.
14458 2009-06-03 Doug Kwan <dougkwan@google.com>
14460 * gold/arm.cc (namespace utils): New.
14461 (Target_arm::reloc_is_non_pic): Define new method.
14462 (class Arm_relocate_functions): New.
14463 (Target_arm::Relocate::relocate): Handle relocation types used by
14466 2009-06-03 Ian Lance Taylor <iant@google.com>
14468 * arm.cc (Target_arm::scan::global): Use || instead of |.
14470 2009-06-02 Doug Kwan <dougkwan@google.com>
14472 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14473 issued_non_pic_error_.
14474 (class Target_arm::Scan): Declare new method check_non_pic.
14475 Define new method symbol_needs_plt_entry.
14476 Declare new data member issued_non_pic_error_.
14477 (class Target_arm::Relocate): Declare new method
14478 should_apply_static_reloc.
14479 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14480 (Target_arm::Scan::check_non_pic): Define new method.
14481 (Target_arm::Scan::local): Handle a small subset of reloc types used
14483 (Target_arm::Scan::local): Same.
14484 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14486 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14488 * incremental.cc (Incremental_inputs::report_command_line): Filter
14489 out --incremental-* options.
14491 2009-05-29 Doug Kwan <dougkwan@google.com>
14493 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14495 (class Target_arm): Update comment.
14496 (Target_arm::Target_arm): Initialize new data members GOT_,
14497 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14498 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14499 and Target_arm::rel_dyn_section.
14500 Declare new_enum Target_arm::Got_type.
14501 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14503 Update commments for member do_dynsym_value.
14504 (Target_arm::got_size, Target_arm::plt_section,
14505 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14506 new methods inside class defintion.
14507 (Target_arm::got_section): Define new method.
14508 (Target_arm::rel_dyn_section): Same.
14509 (Output_data_plt_arm): New template class.
14510 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14511 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14512 (Output_data_plt_arm::add_entry): Same.
14513 (Output_data_plt_arm::first_plt_entry): Define new
14514 static data member for PLT instruction template.
14515 (Output_data_plt_arm::plt_entry): Same.
14516 (Output_data_plt_arm::do_write): Define new method.
14517 (Target_arm::make_plt_entry): Same.
14518 (Target_arm::do_finalize_sections): Same.
14519 (Target_arm::do_dynsym_value): Same.
14521 2009-05-28 Doug Kwan <dougkwan@google.com>
14523 * Makefile.am (TARGETSOURCES): Add arm.cc.
14524 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14525 * Makefile.in: Regenerate.
14526 * arm.cc: New file.
14527 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14529 2009-05-26 Doug Kwan <dougkwan@google.com>
14531 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14532 (General_options::check_excluded_libs): Strip off directories in
14533 archive name before matching like GNU ld does.
14534 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14535 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14536 (exclude_libs_test_LDFLAGS): Add linker option
14537 -Wl,--exclude-libs,libexclude_libs_test_3
14538 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14539 an explicit archive without using -l.
14540 (alt/libexclude_libs_test_3.a): New make rule.
14541 * testsuite/Makefile.in: Regenerate.
14542 * testsuite/exclude_libs_test.c : Declare lib3_default().
14544 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14545 * exclude_libs_test_3.c: New file.
14547 2009-05-26 Nick Clifton <nickc@redhat.com>
14549 * po/id.po: New Indonesian translation.
14550 * po/gold.pot: Updated template file.
14552 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14554 * testsuite/Makefile.am: Add -ffunction-sections to compile
14555 gc_comdat_test files. Add -Wl,--gc-sections to build
14557 * testsuite/Makefile.in: Regenerate.
14558 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14560 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14562 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14563 kept comdat section was garbage collected.
14564 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14565 * testsuite/Makefile.in: Regenerate.
14566 * testsuite/gc_comdat_test.sh: New file.
14567 * testsuite/gc_comdat_test_1.cc: New file.
14568 * testsuite/gc_comdat_test_2.cc: New file.
14570 2009-05-19 Doug Kwan <dougkwan@google.com>
14572 * archive.cc (Archive::Archive): Move constructor from archive.h
14573 to here. Initialize no_export_.
14574 (Archive::get_elf_object_for_member): Set no_export flag of object.
14575 * archive.h (Archive::Archive): Move constructor body to
14577 (Archive::no_export): New method.
14578 (Archive::no_export_): New field.
14579 * object.h (Object::Object): Initialize no_export_ to false.
14580 (Object::no_export, Object::set_no_export): New methods.
14581 (Object::no_export_): New field.
14582 * options.cc (General_options::parse_exclude_libs): New method.
14583 (General_options::check_excluded_libs) Same.
14584 * options.h (exclude_libs): New option.
14585 (General_options::check_excluded_libs): New method declaration.
14586 (General_options::excluded_libs_): New field.
14587 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14588 default or protected visibility if an object has no-export flag set.
14589 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14590 (check_SCRIPTS): Add exclude_libs_test.sh.
14591 (check_DATA): Add exclude_libs_test.syms.
14592 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14593 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14594 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14595 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14596 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14597 libexclude_libs_test_2.a): New rules.
14598 * testsuite/Makefile.in: Regenerate.
14599 * testsuite/exclude_libs_test.c: New file.
14600 * testsuite/exclude_libs_test.sh: Ditto.
14601 * testsuite/exclude_libs_test_1.c: Ditto.
14602 * testsuite/exclude_libs_test_2.c: Ditto.
14604 2009-05-15 Ian Lance Taylor <iant@google.com>
14606 * configure.ac: Check for declarations for cases where libiberty.h
14607 checks HAVE_DECL_xxx.
14608 * configure, config.in: Rebuild.
14610 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14612 * gold.h (Incremental_argument_list): Remove (invalid) forward
14614 * incremental.cc (Incremental_inputs::report_achive): New method.
14615 (Incremental_inputs::report_object): New method.
14616 (Incremental_inputs::report_script): New method.
14617 (Incremental_inputs::finalize_inputs): New method.
14618 (Incremental_inputs::finalize): Call finalize_inputs().
14619 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14620 Create inputs entries.
14621 * incremental.h (Incremental_input_type): New enum.
14622 (Incremental_inputs::Incremental_input): Initialize new fields.
14623 (Incremental_inputs::report_inputs): New method.
14624 (Incremental_inputs::report_achive): New method.
14625 (Incremental_inputs::report_object): New method.
14626 (Incremental_inputs::report_script): New method.
14627 (Incremental_inputs::finalize_inputs): New method.
14628 (Incremental_inputs::Input_info): New struct.
14629 (Incremental_inputs::Input_info_map): New typedef.
14630 (Incremental_inputs::lock_): New field.
14631 (Incremental_inputs::Inputs_): New field.
14632 (Incremental_inputs::Inputs_map): New field.
14633 * main.cc (main): Call Incremental_input::report_inputs.
14634 * options.h (Input_argument_list): Typedef moved from
14636 (Input_file_group::Files): Remove, use ::Input_argument_list.
14637 (Input_file_group::Input_argument_list): Remove, use
14638 ::Input_argument_list.
14639 * plugin.cc (Plugin_manager::add_input_file): Add error in
14641 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14643 * script.cc (read_input_script): Call
14644 Incremental_input::report_script.
14645 * script.h (Script_info): New class.
14647 2009-04-27 Ian Lance Taylor <iant@google.com>
14649 * x86_64.cc (do_adjust_output_section): Set entsize to
14652 2009-04-23 Elliott Hughes <enh@google.com>
14654 * output.cc (Output_file::close): After short writes, continue
14655 writing from the correct offset in the buffer being written.
14657 2009-04-23 Chris Demetriou <cgd@google.com>
14659 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14660 * configure: Regenerate.
14661 * config.in: Regenerate.
14662 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14663 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14665 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14667 * incremental.cc (Incremental_inputs_header_data): Renamed from
14668 Incremental_input_header_data.
14669 (Incremental_inputs_header_data::data_size): New field.
14670 (Incremental_inputs_header_data::put_input_file_count): Renamed
14671 from input_file_count.
14672 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14673 from command_line_offset.
14674 (Incremental_inputs_header_data::put_reserved): Renamed from
14676 (Incremental_inputs_entry_data): Renamed from
14677 Incremental_input_entry_data.
14678 (Incremental_inputs_entry_data::data_size): New field.
14679 (Incremental_inputs::report_command_line): New method.
14680 (Incremental_inputs::finalize): New method.
14681 (Incremental_inputs::create_incremental_inputs_data): New method.
14682 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14683 * incremental.h: New file.
14684 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14685 (Layout::finalize): Create incremental inputs section in
14686 incremental builds.
14687 (Layout::create_incremental_info_sections): New method.
14688 * layout.h (Layout::incremental_inputs): New method.
14689 (Layout::create_incremental_info_sections): New method.
14690 (Layout::incremental_inputs_): New field.
14691 * main.cc (main): Notify Incremental_input of the command line.
14693 2009-04-01 Ian Lance Taylor <iant@google.com>
14694 Mikolaj Zalewski <mikolajz@google.com>
14696 * gold.h (reserve_unordered_map): Define, three versions, one for
14697 each version of Unordered_map.
14698 * layout.cc (Layout::Layout): Remove options parameter. Add
14699 number_of_input_files parameter. Don't initialize options_.
14700 Initialize number_of_input_files_ and resized_signatures_. Move
14701 sections_are_attached_.
14702 (Layout::layout_group): Reserve space for group_signatures_.
14703 (Layout::find_or_add_kept_section): Change name parameter to be a
14704 reference. Resize signatures_ map when it gets large enough.
14705 (Layout::layout_eh_frame): Use parameters->options() instead of
14707 (Layout::make_output_section): Likewise.
14708 (Layout::attach_allocated_section_to_segment): Likewise.
14709 (Layout::finalize, Layout::create_executable_stack): Likewise.
14710 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14711 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14712 * layout.h (class Layout): Update declarations. Remove options_
14713 field. Add number_of_input_files_ and resized_signatures_
14714 fields. Move sections_are_attached_ field.
14715 * main.cc (main): Pass number of input files to Layout
14716 constructor. Don't pass options.
14718 2009-03-30 Ian Lance Taylor <iant@google.com>
14720 * ffsll.c (ffsll): Correct implementation.
14722 2009-03-27 Ian Lance Taylor <iant@google.com>
14724 * ffsll.c: New file.
14725 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14726 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14727 * ftruncate.c (ftruncate): Declare before definition.
14728 * mremap.c (mremap): Likewise.
14729 * pread.c (pread): Likewise.
14730 * configure, Makefile.in, config.in: Rebuild.
14732 * mremap.c: New file.
14733 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14734 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14735 (mremap): Declare if HAVE_MREMAP is not defined.
14736 * configure, Makefile.in, config.in: Rebuild.
14738 2009-03-27 Cary Coutant <ccoutant@google.com>
14740 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14741 position independent.
14742 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14743 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14745 2009-03-24 Cary Coutant <ccoutant@google.com>
14747 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14749 (needs_dynamic_reloc): Likewise.
14751 2009-03-24 Ian Lance Taylor <iant@google.com>
14753 * yyscript.y (file_cmd): Recognize EXTERN.
14754 (extern_name_list, extern_name_list_body): New nonterminals.
14755 * script.cc (script_add_extern): Define.
14756 * script-c.h (script_add_extern): Declare.
14758 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
14760 * object.cc (is_elf_object): Define.
14761 * object.h (is_elf_object): Declare.
14762 * archive.cc (Archive::get_elf_object_for_member): Call
14764 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14766 2009-03-24 Elliott Hughes <enh@google.com>
14768 * output.cc (Output_file::map_anonymous): Define.
14769 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14770 try an anonymous one. Report the size if the mmap fails.
14771 * output.h (class Output_file): Declare map_anonymous.
14773 2009-03-24 Ian Lance Taylor <iant@google.com>
14775 * target-select.cc (instantiate_target): Don't acquire the lock if
14776 the instantiated_target_ field has already been set.
14778 2009-03-23 Ian Lance Taylor <iant@google.com>
14780 * gold-threads.h (class Initialize_lock): Define.
14781 * gold-threads.cc (class Initialize_lock_once): Define.
14782 (initialize_lock_control): New static variable.
14783 (initialize_lock_pointer): New static variable.
14784 (initialize_lock_once): New static function.
14785 (Initialize_lock::Initialize_lock): Define.
14786 (Initialize_lock::initialize): Define.
14787 * target-select.h: Include "gold-threads.h".
14788 (class Target_selector): Add lock_ and initialize_lock_ fields.
14789 Don't define instantiate_target, just declare it.
14790 * target-select.cc (Target_selector::Target_selector): Initialize
14792 (Target_selector::instantiate_target): Define.
14793 * descriptors.h: Include "gold-threads.h".
14794 (class Descriptors): Add initialize_lock_ field.
14795 * descriptors.cc (Descriptors::Descriptors): Initialize new
14797 (Descriptors::open): Use initialize_lock_ field
14798 * errors.h (class Errors): Add initialize_lock_ field.
14799 * errors.cc (Errors::Errors): Initialize new field.
14800 (Errors::initialize_lock): Use initialize_lock_ field.
14801 * powerpc.cc (class Target_selector_powerpc): Remove
14802 instantiated_target_ field. In do_recognize call
14803 instantiate_target rather than do_instantiate_target. In
14804 do_instantiate_target just allocate a new target.
14805 * sparc.cc (class Target_selector_sparc): Likewise.
14807 * freebsd.h: New file.
14808 * i386.cc: Include "freebsd.h".
14809 (Target_i386): Derive from Target_freebsd rather than
14811 (Target_selector_i386): Derive from Target_selector_freebsd rather
14812 than Target_selector.
14813 * x86_64.cc: Include "freebsd.h".
14814 (Target_x86_64): Derive from Target_freebsd rather than
14816 (Target_selector_x86_64): Derive from Target_selector_freebsd
14817 rather than Target_selector.
14818 * target.h (class Target): Add adjust_elf_header and
14819 do_adjust_elf_header.
14820 * output.cc (Output_file_header:: do_sized_write): Call target
14821 adjust_elf_header routine.
14822 * configure.tgt: Set targ_osabi.
14823 * configure.ac: Define GOLD_DEFAULT_OSABI.
14824 * parameters.cc (Parameters::default_target): Pass
14825 GOLD_DEFAULT_OSABI to select_target.
14826 * target-select.h (class Target_selector): Make instantiate_target
14827 protected rather than private.
14828 * Makefile.am (HFILES): Add freebsd.h.
14829 * configure, Makefile.in, config.in: Rebuild.
14831 * merge.cc (do_add_input_section): Correct pend value. Change
14832 message about last entry not being null terminated from error to
14835 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14837 * incremental.cc: New file.
14838 * Makefile.am (CCFILES): Add incremental.cc.
14839 * Makefile.in: Rebuild.
14841 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14843 * layout.cc (Layout::output_section_name): Preserve names
14844 of '.note.' sections.
14846 2009-03-19 Ian Lance Taylor <iant@google.com>
14848 * descriptors.cc (Descriptors::open): Check that the options are
14849 valid before using them.
14851 2009-03-18 Ian Lance Taylor <iant@google.com>
14853 * script-sections.h: Include <list>.
14854 (class Script_sections): Change Sections_elements from std::vector
14855 to std::list. Typedef public Elements_iterator. Add
14856 orphan_section_placement_, data_segment_align_start_, and
14857 saw_data_segment_align_ fields. Remove data_segment_align_index_
14859 * script-sections.cc (class Orphan_section_placement): New class.
14860 (class Sections_element): Add virtual functions is_relro and
14861 orphan_section_init. Remove virtual function place_orphan_here.
14862 (class Output_section_definition): Add is_relro and
14863 orphan_section_init. Remove place_orphan_here.
14864 (class Orphan_output_section): Likewise.
14865 (Script_sections::Script_sections): Update for field changes.
14866 (Script_sections::data_segment_align): Set saw_data_segment_align_
14867 and data_segment_align_start_, not data_segment_align_index.
14868 (Script_sections::data_segment_relro_end): Check
14869 saw_data_segment_align_. Use data_segment_align_start_ rather
14870 than data_segment_align_index_.
14871 (Script_sections::place_orphan): Rewrite to use
14872 Orphan_section_placement.
14874 2009-03-17 Ian Lance Taylor <iant@google.com>
14876 * archive.cc (Archive::add_symbols): Check for a version attached
14877 to the symbol name in the archive map.
14878 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14879 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14880 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14881 (ver_test_11.a): New target.
14882 * testsuite/Makefile.in: Rebuild.
14884 * configure.ac: Check for chsize and posix_fallocate. Replace
14886 * ftruncate.c: New file, from gnulib.
14887 * output.cc (posix_fallocate): Define dummy version if not
14888 HAVE_POSIX_FALLOCATE.
14889 (Output_file::map): Call posix_fallocate rather than lseek and
14891 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14892 * configure, Makefile.in, config.in: Rebuild.
14894 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
14896 * layout.h (Layout::create_note): Add section_name parameter.
14897 * layout.cc (Layout::create_note): Likewise.
14898 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
14900 2009-03-17 Ian Lance Taylor <iant@google.com>
14902 * descriptors.cc: Include "options.h".
14903 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14904 (Descriptors::open): Always use O_CLOEXEC when opening a new
14905 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14906 then set FD_CLOEXEC.
14908 * sparc.cc (class Target_sparc): Add has_got_section.
14909 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14910 make sure we have a GOT section.
14912 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14913 (Target_sparc::Scan::local): Likewise.
14914 (Target_sparc::Scan::global): Likewise.
14915 (Target_sparc::Relocate::relocate): Likewise.
14916 (Target_sparc::Relocate::relocate_tls): Likewise.
14918 * symtab.cc (Symbol_table::define_default_version): New function,
14919 broken out of add_from_object.
14920 (Symbol_table::add_from_object): Call define_default_version.
14921 (Symbol_table::define_special_symbol): Add resolve_oldsym
14922 parameter. Change all callers. If the version for a symbol comes
14923 from a version script, resolve it with the symbol with the same
14924 name with no version. Also add the symbol without a version if
14926 (do_define_in_output_data): If resolving with oldsym, don't delete
14928 (do_define_in_output_segment): Likewise.
14929 (do_define_as_constant): Likewise.
14930 * symtab.h (class Symbol_table): Update declarations.
14932 2009-03-13 Ian Lance Taylor <iant@google.com>
14934 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14935 (Read_symbols::requeue): New function.
14936 (Read_symbols::do_read_symbols): If make_elf_object fails because
14937 the target type is not configured, and the file was searched for,
14938 issue a warning and retry with the next directory.
14939 (Add_symbols::run): If the file has an incompatible format, and
14940 it was searched for, requeue the Read_symbols task. On error,
14941 release the object.
14942 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14943 dirindex parameter to constructor. Change all callers. Declare
14944 incompatible_warning and requeue.
14945 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14946 input_argument_ and input_group_ fields. Add them to
14947 constructor. Change all callers.
14948 (class Read_script): Add dirindex_ field. Add it to constructor.
14949 Change all callers.
14950 * archive.cc (Archive::setup): Remove input_objects parameter.
14951 Change all callers.
14952 (Archive::get_file_and_offset): Likewise.
14953 (Archive::read_all_symbols): Likewise.
14954 (Archive::read_symbols): Likewise.
14955 (Archive::get_elf_object_for_member): Remove input_objects
14956 parameter. Add punconfigured parameter. Change all callers.
14957 (Archive::add_symbols): Change return type to bool. Check return
14958 value of include_member.
14959 (Archive::include_all_members): Likewise.
14960 (Archive::include_member): Change return type to bool. Return
14961 false if first included object has incompatible target. Set
14962 included_member_ field.
14963 (Add_archive_symbols::run): If add_symbols returns false, requeue
14965 * archive.h (class Archive): Add included_member_ field.
14966 Initialize it in constructor. Add input_file and searched_for
14967 methods. Update declarations.
14968 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14969 input_argument_ fields. Add them to constructor. Change all
14971 * script.cc: Include "target-select.h".
14972 (class Parser_closure): Add skip_on_incompatible_target_ and
14973 found_incompatible_target_ fields. Add
14974 skip_on_incompatible_target parameter to constructor. Change all
14975 callers. Add methods skip_on_incompatible_target,
14976 clear_skip_on_incompatible_target, found_incompatible_target, and
14977 set_found_incompatible_target.
14978 (read_input_script): Add dirindex parameter. Change all callers.
14979 If parser finds an incompatible target, requeue Read_symbols
14981 (script_set_symbol): Clear skip_on_incompatible_target in
14983 (script_add_assertion, script_parse_option): Likewise.
14984 (script_start_sections, script_add_phdr): Likewise.
14985 (script_check_output_format): New function.
14986 * script.h (read_input_script): Update declaration.
14987 * script-c.h (script_check_output_format): Declare.
14988 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14989 (ignore_cmd): Remove OUTPUT_FORMAT.
14990 * fileread.cc (Input_file::Input_file): Add explicit this.
14991 (Input_file::will_search_for): New function.
14992 (Input_file::open): Add pindex parameter. Change all callers.
14993 * fileread.h (class Input_file): Add input_file_argument method.
14994 Declare will_search_for. Update declarations.
14995 * object.cc (make_elf_object): Add punconfigured parameter.
14996 Change all callers.
14997 * object.h (class Object): Make input_file public. Add
14998 searched_for method.
14999 (make_elf_object): Update declaration.
15000 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15002 * dirsearch.h (class Dirsearch): Update declaration.
15003 * options.h (class General_options): Add --warn-search-mismatch.
15004 * parameters.cc (Parameters::is_compatible_target): New function.
15005 * parameters.h (class Parameters): Declare is_compatible_target.
15006 * workqueue.cc (Workqueue::add_blocker): New function.
15007 * workqueue.h (class Workqueue): Declare add_blocker.
15009 * fileread.cc (Input_file::open): Remove options parameter.
15010 Change all callers.
15011 (Input_file::open_binary): Likewise.
15012 * script.cc (read_input_script): Likewise.
15013 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15014 options parameter from constructor. Change all callers.
15015 (class Read_script): Likewise.
15016 * fileread.h (class Input_file): Update declarations.
15017 * script.h (read_input_script): Update declaration.
15019 2009-03-10 Nick Clifton <nickc@redhat.com>
15021 * po/es.po: New Spanish translation.
15023 2009-03-06 Cary Coutant <ccoutant@google.com>
15025 * options.cc (parse_short_option): Keep dash_z from registering itself.
15027 2009-03-03 Ian Lance Taylor <iant@google.com>
15030 * target-reloc.h (relocate_section): Pass output_section to
15032 * i386.cc (Target_i386::should_apply_static_reloc): Add
15033 output_section parameter. Change all callers.
15034 (Target_i386::Relocate::relocate): Add output_section parameter.
15035 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15036 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15037 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15038 * testsuite/two_file_shared.sh: New script.
15039 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15040 (check_DATA): Add two_file_shared.dbg.
15041 (two_file_shared.dbg): New target.
15042 * testsuite/Makefile.in: Rebuild.
15044 2009-03-01 Ian Lance Taylor <iant@google.com>
15046 * configure.ac: Check for byteswap.h.
15047 * configure: Rebuild.
15048 * config.in: Rebuild.
15050 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15052 * layout.cc (Layout::find_or_add_kept_section): New function.
15053 (Layout::add_comdat): Removed.
15054 * layout.h (struct Kept_section): Move out of class Layout.
15055 Remove trailing underscores from field names. Add group_sections
15056 field. Rename group_ field to is_group. Change all uses.
15057 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15058 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15059 comdat_groups_ field.
15060 (Sized_relobj::include_section_group): Use
15061 find_or_add_kept_section and Kept_section::group_sections.
15062 (Sized_relobj::include_linkonce_section): Likewise.
15063 * object.cc (class Sized_relobj): Don't define Comdat_group or
15064 Comdat_group_table. Remove find_comdat_group and
15065 add_comdat_group. Remove comdat_groups_ field.
15066 * plugin.cc (include_comdat_group): Use
15067 Layout::find_or_add_kept_section.
15069 2009-02-28 Ian Lance Taylor <iant@google.com>
15071 * README: --gc-sections and map files are now supported. Document
15072 some build requirements.
15075 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15076 relocatable link set the value of the section symbol to zero.
15077 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15078 relocatable link don't include the section address in the local
15081 2009-02-27 Ian Lance Taylor <iant@google.com>
15084 * options.h (class Search_directory): Add is_system_directory.
15085 (class General_options): Declare is_in_system_directory.
15086 * options.cc (get_relative_sysroot): Make static.
15087 (get_default_sysroot): Make static.
15088 (General_optoins::is_in_system_directory): New function.
15089 * fileread.cc (Input_file::is_in_system_directory): New function.
15090 * fileread.h (class Input_file): Declare is_in_system_directory.
15091 * object.h (class Object): Add is_in_system_directory.
15092 (class Input_objects): Remove system_library_directory_ field.
15093 * object.cc (Input_objects::add_object): Don't set
15094 system_library_directory_.
15095 (input_objects::found_in_system_library_directory): Remove.
15096 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15097 parameter. Change all callers.
15098 (Symbol_table::sized_write_globals): Likewise.
15099 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15100 Call Object::is_in_system_directory.
15101 * symtab.h (class Symbol_table): Update declarations.
15104 * descriptors.h (Open_descriptor): Add is_on_stack field.
15105 * descriptors.cc (Descriptors::open): If the descriptor is on the
15106 top of the stack, remove it. Initialize is_on_stack field.
15107 (Descriptors::release): Only add pod to stack if it is not on the
15109 (Descriptors::close_some_descriptor): Clear stack_next and
15110 is_on_stack fields.
15113 * output.cc (Output_section::find_starting_output_address): Rename
15114 from starting_output_address; add PADDR parameter; change return
15116 * output.h (class Output_section): Declare
15117 find_starting_output_address instead of starting_output_address.
15118 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15119 section symbol for which we can't find a merge section.
15122 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15123 hidden or internal, force the symbol to be local.
15124 * resolve.cc (Symbol::override_visibility): Define.
15125 (Symbol::override_base): Use override_visibility.
15126 (Symbol_table::resolve): Likewise.
15127 (Symbol::override_base_with_special): Likewise.
15128 (Symbol_table::override_with_special): If the visibility is hidden
15129 or internal, force the symbol to be local.
15130 * symtab.h (class Symbol): Add set_visibility and
15131 override_visibility.
15132 * testsuite/ver_test_1.sh: New file.
15133 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15134 (check_DATA): Add ver_test_1.syms.
15135 (ver_test_1.syms): New target.
15136 * testsuite/Makefile.in: Rebuild.
15138 2009-02-25 Cary Coutant <ccoutant@google.com>
15140 * layout.cc (Layout::choose_output_section): Don't rename sections
15141 when using a linker script that has a SECTIONS clause.
15142 * Makefile.in: Regenerate.
15144 * testsuite/Makefile.am (script_test_5.sh): New test case.
15145 * testsuite/Makefile.in: Regenerate.
15146 * testsuite/script_test_5.cc: New file.
15147 * testsuite/script_test_5.sh: New file.
15148 * testsuite/script_test_5.t: New file.
15150 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15152 * archive.cc (Archive::include_member): Update calls to add_symbols.
15153 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15154 the Layout argument.
15155 * dynobj.h (do_add_symbols): Add the Layout argument.
15156 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15158 * object.h (Object::add_symbols): Add the Layout argument.
15159 (Object::do_add_symbols): Add the Layout argument.
15160 (Sized_relobj::do_add_symbols): Add the Layout argument.
15161 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15162 Unify the two versions.
15163 (Add_plugin_symbols): Remove.
15164 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15165 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15166 (Add_plugin_symbols): Remove.
15167 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15168 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15169 (Add_symbols::run): Make it work with Pulginobj.
15171 2009-02-06 Ian Lance Taylor <iant@google.com>
15173 * object.cc (Sized_relobj::do_layout): Make info message start
15174 with lower case letter.
15176 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15178 * binary.cc: Fix file comment.
15180 * options.h (enum Incremental_disposition): Define.
15181 (class General_options): Add new options: --incremental,
15182 --incremental_changed, --incremental_unchanged,
15183 --incremental_unknown. Add incremental_disposition_ and
15184 implicit_incremental_ fields.
15185 (General_options::incremental_disposition): New function.
15186 (class Position_dependent_options): Add incremental_disposition
15188 (Position_dependent_options::copy_from_options): Set incremental
15190 * options.cc (General_options::parse_incremental_changed): New
15192 (General_options::parse_incremental_unchanged): New function.
15193 (General_options::parse_incremental_unknown): New function.
15194 (General_options::General_options): Initialize new fields
15195 incremental_disposition_ and implicit_incremental_.
15196 (General_options::finalize): Check for uasge of --incremental-*
15197 without --incremental.
15199 2009-02-06 Chris Demetriou <cgd@google.com>
15201 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15202 pointer and to report location as the file name associated with
15204 (gold_undefined_symbol_at_location): New function to replace the
15205 old gold_undefined_symbol functionality.
15206 * target-reloc.h (relocate_section): Update to use
15207 gold_undefined_symbol_at_location.
15208 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15209 Call gold_undefined_symbol function rather than gold_error.
15210 * errors.h (Errors::undefined_symbol): Take location as a
15211 string, rather than calculating it from a relocation.
15212 * errors.cc (Errors::fatal): Print "fatal error:" before the
15214 (Errors::error, Errors::error_at_location): Print "error: "
15215 before the formatted message.
15216 (Errors::undefined_symbol): Take location as a string, rather
15217 than calculating it from a relocation.
15218 (gold_undefined_symbol_at_location): New function akin to
15219 old gold_undefined_symbol, calculates location from relocation.
15220 (gold_undefined_symbol): Change to take only a Symbol pointer
15221 and to report location as the file name associated with the symbol.
15222 * testsuite/debug_msg.sh: Update for changed error messages.
15223 * testsuite/undef_symbol.sh: Likewise.
15225 2009-02-04 Duncan Sands <baldrick@free.fr>
15228 * reduced_debug_output.h
15229 (Output_reduced_debug_abbrev_section::failed): Use format for
15231 (Output_reduced_debug_info_section::faild): Likewise.
15233 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15235 * script.cc (Lazy_demangler): New class.
15236 (Version_script_info::get_symbol_version_helper): Demangle a
15239 2009-01-29 Cary Coutant <ccoutant@google.com>
15241 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15243 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15245 2009-01-28 Ian Lance Taylor <iant@google.com>
15247 * version.cc (version_string): Bump to 1.9.
15249 * gold.h: Include <cstring> and <stdint.h>.
15250 * version.cc: Include <cstdio>.
15251 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15253 * reduced_debug_output.cc (insert_into_vector): Rename from
15254 Insert_into_vector; change all callers. Use Swap_unaligned to
15255 avoid aliasing issue; remove union since it is unnecessary.
15257 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15259 * Makefile.am (CCFILES): Add gc.cc.
15260 (HFILES): Add gc.h.
15261 * Makefile.in: Regenerate.
15262 * gold.cc (Gc_runner): New class.
15263 (queue_initial_tasks): Call garbage collection related tasks
15264 when corresponding options are invoked.
15265 (queue_middle_gc_tasks): New function.
15266 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15267 processed early before laying out sections during garbage collection.
15268 * gold.h (queue_middle_gc_tasks): New function.
15269 (is_prefix_of): Move from "layout.cc".
15270 * i386.cc (Target_i386::gc_process_relocs): New function.
15271 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15272 * main.cc (main): Create object of class "Garbage_collection".
15273 * object.cc (Relobj::copy_symbols_data): New function.
15274 (Relobj::is_section_name_included): New function.
15275 (Sized_relobj::do_layout): Allow this function to be called twice
15276 during garbage collection and defer layout of section during the
15278 * object.h (Relobj::get_symbols_data): New function.
15279 (Relobj::is_section_name_included): New function.
15280 (Relobj::copy_symbols_data): New function.
15281 (Relobj::set_symbols_data): New function.
15282 (Relobj::get_relocs_data): New function.
15283 (Relobj::set_relocs_data): New function.
15284 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15285 (Relobj::gc_process_relocs): New function.
15286 (Relobj::do_gc_process_relocs): New pure virtual function.
15287 (Relobj::sd_): New data member.
15288 (Sized_relobj::is_output_section_offset_invalid): New function.
15289 (Sized_relobj::do_gc_process_relocs): New function.
15290 * options.h (General_options::gc_sections): Modify to not be a no-op.
15291 (General_options::print_gc_sections): New option.
15292 * plugin.cc (Plugin_finish::run): Remove function call to
15293 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15294 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15295 * reloc.cc (Read_relocs::run): Add task to process relocs and
15296 determine unreferenced sections when doing garbage collection.
15297 (Gc_process_relocs): New class.
15298 (Sized_relobj::do_gc_process_relocs): New function.
15299 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15300 sections that are garbage collected.
15301 * reloc.h (Gc_process_relocs): New class.
15302 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15303 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15304 symbols whose corresponding sections are garbage collected.
15305 (Symbol_table::Symbol_table): Add new parameter for the garbage
15307 (Symbol_table::gc_mark_undef_symbols): New function.
15308 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15309 (Symbol_table::gc_mark_dyn_syms): New function.
15310 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15312 (Symbol_table::add_from_object): Likewise.
15313 (Symbol_table::add_from_relobj): When building shared objects, do not
15314 treat externally visible symbols as garbage.
15315 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15316 table information for static and relocatable links.
15317 * symtab.h (Symbol_table::set_gc): New function.
15318 (Symbol_table::gc): New function.
15319 (Symbol_table::gc_mark_undef_symbols): New function.
15320 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15321 (Symbol_table::gc_mark_dyn_syms): New function.
15322 (Symbol_table::gc_): New data member.
15323 * target.h (Sized_target::gc_process_relocs): New pure virtual
15325 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15326 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15328 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15330 * options.h (General_options::gc_sections): Define as a no-op for now.
15331 (General_options::no_keep_memory): Ditto.
15332 (General_options::Bshareable): Define.
15333 * options.cc (General_options::finalize): Honor -Bshareable.
15335 2009-01-20 Andreas Schwab <schwab@suse.de>
15337 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15338 read the value in the contents, since we don't use it. Use the
15339 template endianness when writing.
15340 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15342 2009-01-19 Andreas Schwab <schwab@suse.de>
15344 * configure.tgt (powerpc64-*): Fix targ_obj.
15346 2009-01-15 Ian Lance Taylor <iant@google.com>
15348 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15349 local symbols when stripping all symbols.
15351 2009-01-14 Cary Coutant <ccoutant@google.com>
15353 * output.cc (Output_reloc): Add explicit instantiations.
15355 2009-01-14 Cary Coutant <ccoutant@google.com>
15357 * archive.cc (Archive::get_elf_object_for_member): Remove call
15358 to File_read::claim_for_plugin.
15359 * descriptors.cc (Descriptors::open): Remove reference to
15361 (Descriptors::claim_for_plugin): Remove.
15362 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15363 (Descriptors::is_claimed): Remove.
15364 (claim_descriptor_for_plugin): Remove.
15365 * fileread.cc (File_read::claim_for_plugin): Remove.
15366 * fileread.h (File_read::claim_for_plugin): Remove.
15367 (File_read::descriptor): Reopen descriptor if necessary.
15368 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15369 (Plugin_manager::all_symbols_read): Add task parameter. Change
15371 (Plugin_manager::get_input_file): New function.
15372 (Plugin_manager::release_input_file): New function.
15373 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15374 corresponding data member.
15375 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15376 and pass to base constructor. Change all callers.
15377 (get_input_file, release_input_file): New functions.
15378 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15379 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15380 (Plugin_manager::all_symbols_read): Add task parameter.
15381 (Plugin_manager::get_input_file): New function.
15382 (Plugin_manager::release_input_file): New function.
15383 (Plugin_manager::task_): New data member.
15384 (Pluginobj::Pluginobj): Add filesize parameter.
15385 (Pluginobj::filename): New function.
15386 (Pluginobj::descriptor): New function.
15387 (Pluginobj::filesize): New function.
15388 (Pluginobj::filesize_): New data member.
15389 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15390 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15391 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15393 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15394 with archive libraries.
15395 * testsuite/Makefile.in: Regenerate.
15396 * testsuite/plugin_test.c (struct sym_info): New type.
15397 (get_input_file, release_input_file): New static variables.
15398 (onload): Capture new transfer vector entries.
15399 (claim_file_hook): Stop reading at end of file according to filesize.
15400 Factor out parsing of readelf output into separate function.
15401 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15402 APIs and get the source file name from the symbol table. Convert
15403 source file name to corresponding object file name. Print info
15404 message when adding new input files.
15405 (parse_readelf_line): New function.
15406 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15407 * testsuite/plugin_test_2.sh: Likewise.
15408 * testsuite/plugin_test_3.sh: Likewise.
15409 * testsuite/plugin_test_4.sh: New test case.
15411 2009-01-07 Ian Lance Taylor <iant@google.com>
15413 * version.cc (version_string): Bump to 1.8.
15415 2008-12-23 Cary Coutant <ccoutant@google.com>
15417 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15418 * plugin.cc (Plugin_manager::finish): Rename as
15419 layout_deferred_objects. Move cleanup to separate function.
15420 (Plugin_manager::cleanup): New function.
15421 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15423 * plugin.h (Plugin_manager::finish): Rename as
15424 layout_deferred_objects.
15425 (Plugin_manager::cleanup): New function.
15426 (Plugin_manager::cleanup_done): New field.
15428 2008-12-23 Cary Coutant <ccoutant@google.com>
15430 * plugin.cc (is_visible_from_outside): New function.
15431 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15432 so we don't return "IR only" status for exported symbols or -r links.
15434 * testsuite/Makefile.am (plugin_test_3): New test case.
15435 * testsuite/Makefile.in: Regenerate.
15436 * testsuite/plugin_test_3.sh: New file.
15438 2008-12-22 Cary Coutant <ccoutant@google.com>
15440 * object.cc (Sized_relobj::layout_section): New function.
15441 (Sized_relobj::do_layout): Defer layout of input sections until after
15442 plugin has provided replacement files.
15443 (Sized_relobj::do_layout_deferred_sections): New function.
15444 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15445 (Relobj::layout_deferred_sections): New function.
15446 (Relobj::do_layout_deferred_sections): New function.
15447 (Sized_relobj::do_layout_deferred_sections): New function.
15448 (Sized_relobj::layout_section): New function.
15449 (Sized_relobj::Deferred_layout): New structure.
15450 (Sized_relobj::deferred_layout_): New field.
15451 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15452 Change all callers. Layout deferred sections.
15453 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15455 (Plugin_hook::run): Move code from do_plugin_hook inline.
15456 (Plugin_hook::do_plugin_hook): Remove.
15457 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15458 (Plugin_manager::finish): Renamed, was cleanup.
15459 (Plugin_manager::should_defer_layout): New function.
15460 (Plugin_manager::add_deferred_layout_object): New function.
15461 (Plugin_manager::Deferred_layout_list): New type.
15462 (Plugin_manager::deferred_layout_objects_): New field.
15463 (Plugin_hook::do_plugin_hook): Remove.
15465 2008-12-17 Ian Lance Taylor <iant@google.com>
15467 * options.h (class General_options): Add --no case for
15470 2008-12-16 Cary Coutant <ccoutant@google.com>
15472 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15474 (Plugin_manager::claim_file): Create plugin object even if
15475 plugin did not call the add_symbols callback.
15476 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15477 asking for more symbols than were added.
15478 * testsuite/Makefile.am (plugin_test_1): Add test case with
15480 (empty.syms): New target.
15481 * testsuite/Makefile.in: Regenerate.
15482 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15483 message. Don't call add_symbols if no globals.
15484 (all_symbols_read_hook): Don't provide replacement for empty
15487 2008-12-12 Ian Lance Taylor <iant@google.com>
15489 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15490 r_type == 0 for a local symbol with r_sym == 0.
15491 (scan_relocatable_relocs): Pass r_sym to
15492 local_non_section_strategy.
15493 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15496 * configure.ac: Update test for TLS descriptors: they are
15497 supported as of glibc 2.9.
15498 * configure: Rebuild.
15500 2008-12-11 Ian Lance Taylor <iant@google.com>
15503 * target-reloc.h (Default_scan_relocatable_relocs): For each
15504 function, map r_type == 0 to RELOC_DISCARD.
15506 2008-12-10 Cary Coutant <ccoutant@google.com>
15508 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15509 object to override a kept COMDAT group from a plugin object.
15511 2008-12-09 Ian Lance Taylor <iant@google.com>
15514 * yyscript.y (file_cmd): Handle INPUT.
15516 * testsuite/initpri1.c: Change all declarations to be full
15517 prototypes by adding void, to avoid compiler warnings.
15519 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15521 * options.cc (General_options::parse_plugin_opt): New.
15522 (General_options::add_plugin): The argument now is just the filename.
15523 (General_options::add_plugin_option): New.
15524 * options.h (plugin_opt): New.
15525 (add_plugin): Change argument name.
15526 (add_plugin_option): New.
15527 * plugin.cc (Plugin::load): Don't parse the plugin option.
15528 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15529 (Plugin::add_option): New.
15530 (Plugin::args_): Change type.
15531 (Plugin::filename_): New.
15532 (Plugin_manager::add_plugin_option): New.
15533 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15534 * testsuite/Makefile.in: Regenerate.
15536 2008-12-05 Cary Coutant <ccoutant@google.com>
15538 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15539 Handle --strip-lto-sections option.
15540 * options.h (strip_lto_sections): New option.
15542 2008-12-01 Cary Coutant <ccoutant@google.com>
15544 * plugin.cc (ld_plugin_message): Change format parameter to const.
15545 Fix mismatch between new[] and delete.
15547 2008-11-14 Cary Coutant <ccoutant@google.com>
15549 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15552 2008-11-05 Craig Silverstein <csilvers@google.com>
15554 * options.cc (General_options::parse_dynamic_list): New function.
15555 * options.h (General_options): New flags dynamic_list,
15556 dynamic_list_data, dynamic_list_cpp_new, and
15557 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15558 (General_options::in_dynamic_list): New function.
15559 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15560 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15561 (Lex::can_continue_name): Likewise.
15563 (read_script_file): New parameter script_options.
15564 (read_dynamic_list): New function.
15565 (Script_options::define_dynamic_list): New function.
15566 (dynamic_list_keyword_parsecodes): New variable.
15567 (dynamic_list_keywords): New variable.
15568 * script.h (Script_options::define_dynamic_list): New function
15570 (read_dynamic_list): New function prototype.
15571 * symtab.cc (strprefix): New macro.
15572 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15573 dynamic_list_data, dynamic_list_cpp_new, and
15574 dynamic_list_cpp_typeinfo.
15575 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15576 (dynamic_list_expr): New rule.
15577 (dynamic_list_nodes): Likewise.
15578 (dynamic_list_node): Likewise.
15579 * testsuite/Makefile.am (dynamic_list): New test.
15580 * testsuite/Makefile.in: Regenerated.
15581 * testsuite/dynamic_list.t: New file.
15582 * testsuite/dynamic_list.sh: New file.
15584 2008-11-05 Craig Silverstein <csilvers@google.com>
15586 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15587 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15588 (t11_last): Likewise.
15589 * testsuite/ver_test_6.c (main): Likewise.
15591 2008-10-07 Cary Coutant <ccoutant@google.com>
15593 * options.c (General_options::finalize): Add check for -static and
15595 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15598 2008-10-02 Cary Coutant <ccoutant@google.com>
15600 * plugin.cc (make_sized_plugin_object): Fix conditional
15601 compilation to work when not all targets are enabled.
15603 2008-09-29 Cary Coutant <ccoutant@google.com>
15605 * archive.cc (Archive::get_file_and_offset): Use filename instead
15606 of name to get library path.
15607 (Archive::include_member): Unlock external member of a thin archive.
15609 * testsuite/Makefile.am (TEST_AR): New variable.
15610 (thin_archive_test_1): New test.
15611 (thin_archive_test_2): New test.
15612 * testsuite/Makefile.in: Regenerate.
15613 * testsuite/thin_archive_main.cc: New file.
15614 * testsuite/thin_archive_test_1.cc: New file.
15615 * testsuite/thin_archive_test_2.cc: New file.
15616 * testsuite/thin_archive_test_3.cc: New file.
15617 * testsuite/thin_archive_test_4.cc: New file.
15619 2008-09-29 Cary Coutant <ccoutant@google.com>
15621 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15622 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15624 (Sized_relobj::do_finalize_local_symbols): Likewise.
15625 (Sized_relobj::map_to_kept_section): Likewise.
15626 * object.h (Sized_relobj::invalid_address): New constant.
15627 (Sized_relobj::do_output_section_offset): Check for invalid_address
15629 * output.cc (Output_reloc::local_section_offset): Use constant
15630 invalid_address instead of -1U.
15631 (Output_reloc::get_address): Likewise.
15632 (Output_section::output_address): Change -1U to -1ULL.
15633 * output.h (Output_reloc::invalid_address): New constant.
15634 * reloc.cc (Sized_relobj::write_sections): Use constant
15635 invalid_address instead of -1U.
15636 (Sized_relobj::relocate_sections): Likewise.
15637 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15638 values for merge sections.
15639 * target-reloc.h (relocate_for_relocatable): Use constant
15640 invalid_address instead of -1U.
15642 2008-09-19 Cary Coutant <ccoutant@google.com>
15644 Add plugin functionality for link-time optimization (LTO).
15645 * configure.ac (plugins): Add --enable-plugins option.
15646 * configure: Regenerate.
15647 * config.in: Regenerate.
15648 * Makefile.am (LIBDL): New variable.
15649 (CCFILES): Add plugin.cc.
15650 (HFILES): Add plugin.h.
15651 (ldadd_var): Add LIBDL.
15652 * Makefile.in: Regenerate.
15654 * archive.cc: Include "plugin.h".
15655 (Archive::setup): Don't preread archive symbols when using a plugin.
15656 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15657 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15659 (Archive::include_member): Add symbols from plugin objects.
15660 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15661 * descriptors.cc (Descriptors::open): Check for file descriptors
15662 abandoned by plugins.
15663 (Descriptors::claim_for_plugin): New function.
15664 * descriptors.h (Descriptors::claim_for_plugin): New function.
15665 (Open_descriptor::is_claimed): New field.
15666 (claim_descriptor_for_plugin): New function.
15667 * fileread.cc (File_read::claim_for_plugin): New function.
15668 * fileread.h (File_read::claim_for_plugin): New function.
15669 (File_read::descriptor): New function.
15670 * gold.cc: Include "plugin.h".
15671 (queue_initial_tasks): Add task to call plugin hooks for generating
15673 * main.cc: Include "plugin.h".
15674 (main): Load plugin libraries.
15675 * object.h (Pluginobj): Declare.
15676 (Object::pluginobj): New function.
15677 (Object::do_pluginobj): New function.
15678 (Object::set_target): New function.
15679 * options.cc: Include "plugin.h".
15680 (General_options::parse_plugin): New function.
15681 (General_options::General_options): Initialize plugins_ field.
15682 (General_options::add_plugin): New function.
15683 * options.h (Plugin_manager): Declare.
15684 (General_options): Add --plugin option.
15685 (General_options::has_plugins): New function.
15686 (General_options::plugins): New function.
15687 (General_options::add_plugin): New function.
15688 (General_options::plugins_): New field.
15689 * plugin.cc: New file.
15690 * plugin.h: New file.
15691 * readsyms.cc: Include "plugin.h".
15692 (Read_symbols::do_read_symbols): Check for archive before checking
15693 for ELF file. Call plugin hooks to claim files.
15694 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15695 from a real object file; force override when processing replacement
15697 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15698 (Symbol::init_base_object): Likewise.
15699 (Symbol::init_base_output_data): Likewise.
15700 (Symbol::init_base_output_segment): Likewise.
15701 (Symbol::init_base_constant): Likewise.
15702 (Symbol::init_base_undefined): Likewise.
15703 (Symbol::output_section): Assert that object is not a plugin.
15704 (Symbol_table::add_from_pluginobj): New function.
15705 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15707 (Symbol_table::sized_write_globals): Likewise.
15708 (Symbol_table::add_from_pluginobj): Instantiate template.
15709 * symtab.h (Sized_pluginobj): Declare.
15710 (Symbol::in_real_elf): New function.
15711 (Symbol::set_in_real_elf): New function.
15712 (Symbol::in_real_elf_): New field.
15713 (Symbol_table::add_from_pluginobj): New function.
15715 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15716 (LIBDL): New variable.
15717 (LDADD): Add LIBDL.
15718 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15719 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15720 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15721 (MOSTLYCLEANFILES): Likewise.
15722 * testsuite/Makefile.in: Regenerate.
15723 * testsuite/plugin_test.c: New file.
15724 * testsuite/plugin_test_1.sh: New file.
15725 * testsuite/plugin_test_2.sh: New file.
15727 2008-09-16 Ian Lance Taylor <iant@google.com>
15729 * target-reloc.h (relocate_section): Check whether a symbol is
15730 defined by the ABI before reporting an undefined symbol error.
15731 * target.h (Target::is_defined_by_abi): Make parameter const.
15732 (Target::do_is_defined_by_abi): Likewise.
15733 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15734 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15735 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15736 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15737 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15738 * testsuite/Makefile.in: Rebuild.
15740 * fileread.cc (make_view): Add casts to avoid warning.
15742 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15744 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15745 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15747 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15749 * options.h (General_options::output_is_executable): New.
15750 (General_options::output_is_pie): New.
15751 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15752 for shared libraries.
15753 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15755 2008-09-11 Chris Demetriou <cgd@google.com>
15757 * options.h (origin): New -z option.
15758 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15759 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15762 2008-09-05 Cary Coutant <ccoutant@google.com>
15764 * fileread.cc (File_read::make_view): Add check for attempt to map
15765 beyond end of file.
15767 2008-09-05 Cary Coutant <ccoutant@google.com>
15769 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15770 explicit instantiations.
15772 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15775 * options.cc (General_options::finalize): Allow undefined symbols
15776 in shlibs if linking -shared.
15779 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15780 symbols as not needing a dynsym entry.
15782 2008-08-20 Craig Silverstein <csilvers@google.com>
15784 * fileread.cc (File_read::open): Do not lock the file unless it
15785 was successfully opened.
15787 2008-08-14 Cary Coutant <ccoutant@google.com>
15789 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15790 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15791 * testsuite/tls_test.cc (struct int128): 128-bit struct
15792 for testing TLS relocs with non-zero addend.
15793 (v12): New TLS variable.
15795 (t_last): Add check for v12.
15796 * testsuite/tls_test.h (t12): New function.
15797 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15799 2008-08-13 Ian Lance Taylor <iant@google.com>
15801 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15802 set tls_segment_ or relro_segment_.
15803 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15805 * output.h (Output_section::clear_is_relro): New function.
15806 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15807 sections specially even when output_data_ is empty.
15808 (Output_segment::maximum_alignment): When first section is relro,
15809 only force alignment for PT_LOAD segments.
15810 * script.cc (script_data_segment_align): New function.
15811 (script_data_segment_relro_end): New function.
15812 * script-c.h (script_data_segment_align): Declare.
15813 (script_data_segment_relro_end): Declare.
15814 * script-sections.h (class Script_sections): Declare
15815 data_segment_align and data_segment_relro_end. Add fields
15816 segment_align_index_ and saw_relro_end_.
15817 * script-sections.cc (class Sections_element): Add set_is_relro
15818 virtual function. Add new bool* parameter to place_orphan_here.
15819 Add get_output_section virtual function.
15820 (class Output_section_definition): Add set_is_relro. Add new
15821 bool* parameter to place_orphan_here. Add get_output_section.
15822 Add is_relro_ field.
15823 (Output_section_definition::Output_section_definition): Initialize
15824 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15825 and is_relro_ fields.
15826 (Output_section_definition::place_orphan_here): Add is_relro
15828 (Output_section_definition::set_section_addresses): Set relro for
15830 (Output_section_definition::alternate_constraint): Likewise.
15831 (class Orphan_output_section): Add new bool* parameter to
15832 place_orphan_here. Add get_output_section.
15833 (Orphan_output_section::place_orphan_here): Add is_relro
15835 (Script_sections::Script_sections): Initialize
15836 data_segment_align_index_ and saw_relro_end_.
15837 (Script_sections::data_segment_align): New function.
15838 (Script_sections::data_segment_relro_end): New function.
15839 (Script_sections::place_orphan): Set or clear is_relro.
15840 (Script_sections::set_section_addresses): Force alignment of first
15842 * yyscript.y (exp): Call script_data_segment_align and
15843 script_data_segment_relro_end.
15844 * testsuite/relro_script_test.t: New file.
15845 * testsuite/relro_test.cc (using_script): Declare.
15846 (t1, t2): Test using_script.
15847 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15848 (relro_script_test_SOURCES): Define.
15849 (relro_script_test_DEPENDENCIES): Define.
15850 (relro_script_test_LDFLAGS): Define.
15851 (relro_script_test_LDADD): Define.
15852 (relro_script_test.so): New target.
15853 * testsuite/Makefile.in: Rebuild.
15855 2008-08-06 Cary Coutant <ccoutant@google.com>
15857 * archive.cc (Archive::total_archives, Archive::total_members)
15858 (Archive::total_members_loaded): New variables.
15859 (Archive::setup): Add parameter. Add option to preread
15861 (Archive::read_armap): Add counter.
15862 (Archive::get_file_and_offset): New function.
15863 (Archive::get_elf_object_for_member): New function.
15864 (Archive::read_all_symbols): New function.
15865 (Archive::read_symbols): New function.
15866 (Archive::add_symbols): Add counters.
15867 (Archive::include_all_members): Use armap to find members if it's
15869 (Archive::include_member): Skip reading symbols if already read.
15870 Factored code into Archive::get_file_and_offset and
15871 Archive::get_elf_object_for_member. Changed call to
15872 Mapfile::report_include_archive_member.
15873 (Archive::print_stats): New function.
15874 * archive.h: Declare Object and Read_symbols_data classes.
15875 (Archive::Archive): Add initializers for new members.
15876 (Archive::setup): Add parameter.
15877 (Archive::print_stats): New function.
15878 (Archive::total_archives, Archive::total_members)
15879 (Archive::total_members_loaded): New variables.
15880 (Archive::get_file_and_offset): New function.
15881 (Archive::get_elf_object_for_member): New function.
15882 (Archive::read_all_symbols): New function.
15883 (Archive::read_symbols): New function.
15884 (Archive::Archive_member): New class.
15885 (Archive::members_): New member.
15886 (Archive::num_members_): New member.
15887 * main.cc: Include archive.h.
15888 (main): Call Archive::print_stats.
15889 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15890 archive parameter; member_name is now the fully-decorated name.
15891 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15892 * options.h: (General_options): Add --preread-archive-symbols option.
15893 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15896 2008-08-04 Ian Lance Taylor <iant@google.com>
15898 * symtab.h (Symbol::use_plt_offset): New function.
15899 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15900 * powerpc.cc (Relocate::relocate): Likewise.
15901 * sparc.cc (Relocate::relocate): Likewise.
15902 * x86_64.cc (Relocate::relocate): Likewise.
15903 * testsuite/weak_plt.sh: New test.
15904 * testsuite/weak_plt_main.cc: New test.
15905 * testsuite/weak_plt_shared.cc: New test.
15906 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15907 (check_PROGRAMS): Add weak_plt.
15908 (check_DATA): Add weak_plt_shared.so.
15909 (weak_plt_main_pic.o, weak_plt): New targets.
15910 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15911 * testsuite/Makefile.in: Rebuild.
15913 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15915 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15916 * testsuite/Makefile.in: Rebuild.
15918 2008-08-04 Alan Modra <amodra@bigpond.net.au>
15920 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15921 * Makefile.in: Regenerate.
15922 * po/POTFILES.in: Regenerate.
15924 2008-07-29 Ian Lance Taylor <iant@google.com>
15926 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15927 symbols before other symbols.
15928 * testsuite/script_test_2.cc (test_addr): Declare.
15929 (test_addr_alias): Declare.
15930 (main): Check that test_addr and test_addr_alias have the right
15932 * testsuite/script_test_2.t: Define test_addr_alias and
15935 2008-07-24 Ian Lance Taylor <iant@google.com>
15938 * descriptors.cc: New file.
15939 * descriptors.h: New file.
15940 * gold-threads.h (class Hold_optional_lock): New class.
15941 * fileread.cc: Include "descriptors.h".
15942 (File_read::~File_read): Release descriptor rather than closing
15944 (File_read::open) [file]: Call open_descriptor rather than open.
15945 Set is_descriptor_opened_.
15946 (File_read::open) [memory]: Assert that descriptor is not open.
15947 (File_read::reopen_descriptor): New function.
15948 (File_read::release): Release descriptor.
15949 (File_read::do_read): Make non-const. Reopen descriptor.
15950 (File_read::read): Make non-const.
15951 (File_read::make_view): Reopen descriptor.
15952 (File_read::do_readv): Likewise.
15953 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15954 Update declarations.
15955 * layout.cc: Include "descriptors.h".
15956 (Layout::create_build_id): Use open_descriptor rather than open.
15957 * output.cc: Include "descriptors.h".
15958 (Output_file::open): Use open_descriptor rather than open.
15959 * archive.cc (Archive::const_iterator): Change Archive to be
15961 (Archive::begin, Archive::end): Make non-const.
15962 (Archive::count_members): Likewise.
15963 * archive.h (class Archive): Update declarations.
15964 * object.h (Object::read): Make non-const.
15965 * Makefile.am (CCFILES): Add descriptors.cc.
15966 (HFILES): Add descriptors.h.
15967 * Makefile.in: Rebuild.
15970 * gold.h: Always include <clocale>. Add Solaris workarounds
15971 following code in binutils/sysdep.h.
15974 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15975 this->eh_frame_hdr_ is NULL before using it.
15977 * dynobj.cc (Versions::Versions): Update comment.
15979 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15980 the base version name.
15982 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15983 array size plus one.
15984 (Stringpool_template::set_string_offsets): Subtract one from key
15985 before using it as an array index.
15986 (Stringpool_template::get_offset_with_length): Likewise.
15987 (Stringpool_template::write_to_buffer): Likewise.
15988 * stringpool.h (Stringpool_template::get_offset_from_key):
15991 2008-07-23 Ian Lance Taylor <iant@google.com>
15994 * object.h (Merged_symbol_value::value): Do our best to handle a
15998 * script.cc (Version_script_info::get_versions): Don't add empty
15999 version tag to return value.
16000 (Version_script_info::get_symbol_version_helper): Change return
16001 type to bool. Add pversion parameter. Change all callers.
16002 (script_register_vers_node): Don't require a non-NULL tag.
16003 * script.h (class Version_script_info): Update declarations.
16004 (Version_script_info::get_symbol_version): Change return type to
16005 bool. Add version parameter. Change all callers.
16006 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16007 handling. Handle an empty version from a version script.
16008 (Symbol_table::define_special_symbol): Likewise.
16009 * testsuite/ver_test_10.script: New file.
16010 * testsuite/ver_test_10.sh: New file.
16011 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16012 (check_DATA): Add ver_test_10.syms.
16013 (ver_test_10.syms, ver_test_10.so): New target.
16014 * testsuite/Makefile.in: Rebuild.
16016 2008-07-23 Simon Baldwin <simonb@google.com>
16018 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16019 to zero for undefined symbols from dynamic libraries.
16021 2008-07-23 Ian Lance Taylor <iant@google.com>
16023 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16024 Change all callers.
16025 * symtab.h (class Symbol_table): Update declaration.
16026 * testsuite/ver_test_9.cc: New file.
16027 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16028 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16029 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16030 (ver_test_9.so, ver_test_9.o): New targets.
16031 * testsuite/Makefile.in: Rebuild.
16033 2008-07-22 Ian Lance Taylor <iant@google.com>
16035 * options.h (class General_options): Define --check-sections.
16036 * layout.cc (Layout::set_segment_offsets): Handle
16039 * options.h (class General_options): Define -n/--nmagic and
16041 * options.cc (General_options::finalize): For -n/--nmagic or
16042 -N/--omagic, set -static.
16043 * layout.cc (Layout::attach_allocated_section_to_segment): If
16044 -N/--omagic, don't put read-only and read-write sections in
16045 different segments.
16046 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16047 finding a read-only segment.
16048 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16049 don't set the minimum segment alignment to the common page size,
16050 and don't set the file offset to the address modulo the page size.
16051 * script-sections.cc (Script_sections::create_segments): If
16052 -n/--omagic, don't put read-only and read-write sections in
16053 different segments.
16055 * cref.cc: New file.
16056 * cref.h: New file.
16057 * options.h (class General_options): Add --print-symbol-counts.
16058 * main.cc (main): Issue defined symbol report if requested.
16059 * archive.cc (Archive::interpret_header): Make into a const member
16061 (Archive::add_symbols): Call Input_objects::archive_start and
16063 (Archive::const_iterator): Define new class.
16064 (Archive::begin, Archive::end): New functions.
16065 (Archive::include_all_members): Rewrite to use iterator.
16066 (Archive::count_members): New function.
16067 * archive.h (class Archive): Update declarations.
16068 (Archive::filename): New function.
16069 * object.cc: Include "cref.h".
16070 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16071 (Sized_relobj::do_get_global_symbol_counts): New function.
16072 (Input_objects::add_object): Add object to cross-referencer.
16073 (Input_objects::archive_start): New function.
16074 (Input_objects::archive_stop): New function.
16075 (Input_objects::print_symbol_counts): New function.
16076 * object.h: Declare Cref and Archive.
16077 (Object::get_global_symbol_counts): New function.
16078 (Object::do_get_global_symbol_counts): New pure virtual function.
16079 (class Sized_relobj): Add defined_count_ field. Update
16081 (class Input_objects): Add cref_ field. Update constructor.
16082 Update declarations.
16083 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16085 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16087 (Sized_dynobj::do_get_global_symbol_counts): New function.
16088 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16089 defined_count_. Update declarations. Define Symbols typedef.
16090 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16091 parameter. Change all callers.
16092 (Symbol_table::add_from_dynobj): Add sympointers and defined
16093 parameters. Change all callers.
16094 * symtab.h (class Symbol_table): Update declarations.
16095 * Makefile.am (CCFILES): Add cref.cc.
16096 (HFILES): Add cref.h.
16097 * Makefile.in: Rebuild.
16099 2008-07-22 Simon Baldwin <simonb@google.com>
16101 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16102 to zero when writing undefined symbols.
16104 2008-07-22 Ian Lance Taylor <iant@google.com>
16106 * output.cc (Output_section::add_input_section): Don't try to
16107 merge empty merge sections.
16109 2008-07-21 Craig Silverstein <csilvers@google.com>
16111 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16112 Include symbol version in error message.
16114 2008-07-20 Chris Demetriou <cgd@google.com>
16116 * configure.ac (gold_cv_c_random_seed): New configured variable.
16117 (RANDOM_SEED_CFLAGS): New substituted variable.
16118 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16119 * configure: Rebuild.
16120 * Makefile.in: Likewise.
16121 * testsuite/Makefile.in: Likewise.
16123 2008-07-18 Ian Lance Taylor <iant@google.com>
16125 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16126 where we see NAME/NULL and NAME/VERSION as separate symbols.
16127 * testsuite/ver_test_main.cc (main): Call t4.
16128 (t4, t4_2a): Define.
16129 * testsuite/ver_test_2.cc (t4_2): Define.
16130 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16131 * testsuite/ver_test_4.cc (t4_2a): Define.
16132 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16133 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16135 2008-07-17 Ian Lance Taylor <iant@google.com>
16137 * dynobj.cc (Versions::add_def): If we give an error about a
16138 missing version, go ahead and create the version anyhow.
16140 2008-07-10 Ian Lance Taylor <iant@google.com>
16142 Handle output sections with more than 0x7fffffff bytes.
16143 * object.h (class Relobj): Change map_to_output_ to
16144 output_sections_, and just keep a section pointer. Change all
16145 uses. Move comdat group support to Sized_relobj.
16146 (Relobj::is_section_specially_mapped): Remove.
16147 (Relobj::output_section): Remove poff parameter. Change all
16149 (Relobj::output_section_offset): New function.
16150 (Relobj::set_section_offset): Rewrite.
16151 (Relobj::map_to_output): Remove.
16152 (Relobj::output_sections): New function.
16153 (Relobj::do_output_section_offset): New pure virtual function.
16154 (Relobj::do_set_section_offset): Likewise.
16155 (class Sized_relobj): Add section_offsets_ field. Add comdat
16156 group support from Relobj. Update declarations.
16157 (Sized_relobj::get_output_section_offset): New function.
16158 (Sized_relobj::do_output_section_offset): New function.
16159 (Sized_relobj::do_set_section_offset): New function.
16160 * object.cc (Relobj::output_section_address): Remove.
16161 (Sized_relobj::Sized_relobj): Initialize new fields.
16162 (Sized_relobj::include_section_group): Cast find_kept_object to
16164 (Sized_relobj::include_linkonce_section): Likewise.
16165 (Sized_relobj::do_layout): Use separate arrays for output section
16167 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16169 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16170 output_sections and section_offsets.
16171 (Sized_relobj::write_local_symbols): Likewise.
16172 (map_to_kept_section): Compute output address directly.
16173 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16174 output_sections and section_offsets.
16175 (Sized_relobj::write_sections): Likewise.
16176 (Sized_relobj::relocate_sections): Likewise.
16177 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16178 * output.h (class Output_reloc): Update declarations. Change
16179 u2_.relobj to Sized_relobj*.
16180 (class Output_data_reloc): Change add functions to use
16182 * output.cc (Output_reloc::Output_reloc): Change relobj to
16184 (Output_reloc::local_section_offset): Change return type to
16185 Elf_Addr. Use get_output_section_offset.
16186 (Output_reloc::get_address): Likewise.
16187 (Output_section::is_input_address_mapped): Don't call
16188 is_section_specially_mapped.
16189 (Output_section::output_offset): Likewise.
16190 (Output_section::output_address): Likewise.
16191 (Output_section::starting_output_address): Likewise.
16192 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16193 parameter to Sized_relobj*.
16194 (Copy_relocs::need_copy_reloc): Likewise.
16195 (Copy_relocs::save): Likewise.
16196 * copy-relocs.h (class Copy_relocs): Update declarations.
16197 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16198 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16199 * target-reloc.h (relocate_for_relocatable): Change
16200 offset_in_output_section type to Elf_Addr. Change code that uses
16202 * layout.cc (Layout::layout): Always set *off.
16203 * mapfile.cc (Mapfile::print_input_section): Use
16204 output_section_offset.
16205 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16207 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16208 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16209 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16211 2008-07-03 Ian Lance Taylor <iant@google.com>
16213 * layout.cc (Layout::include_section): Do not discard unrecognized
16214 SHT_STRTAB sections.
16216 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16218 * script.cc (Lex::can_continue_name): Make '?' allowable in
16219 version-script names.
16220 * testsuite/version_script.map: Change glob pattern to use '?'
16222 2008-06-30 Manish Singh <yosh@gimp.org>
16225 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16228 2008-06-30 Ian Lance Taylor <iant@google.com>
16232 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16233 versions]: Don't try to read the value in the contents, since we
16234 don't use it. Use the template endianness when writing.
16236 2008-06-25 Cary Coutant <ccoutant@google.com>
16238 * fileread.cc (File_read::make_view): Assert on zero-length view.
16239 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16240 symbol table when there are no symbols to read.
16242 2008-06-23 Craig Silverstein <csilvers@google.com>
16244 * version.cc (version_string): Bump to 1.7
16246 2008-06-18 Craig Silverstein <csilvers@google.com>
16248 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16249 constant 0xFFFF to type Valtype.
16250 (Powerpc_relocate_functions::rel16_ha): Likewise.
16252 2008-06-17 Ian Lance Taylor <iant@google.com>
16254 * output.h (Output_section::Input_section): Initialize p2align_ to
16255 zero for Output_section_data constructors.
16256 (Output_section::Input_section::addralign): If not an input
16257 section, return the alignment of the Output_section_data.
16258 * testsuite/copy_test.cc: New file.
16259 * testsuite/copy_test_1.cc: New file.
16260 * testsuite/copy_test_2.cc: New file.
16261 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16262 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16263 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16264 (copy_test_1_pic.o, copy_test_1.so): New targets.
16265 (copy_test_2_pic.o, copy_test_2.so): New targets.
16266 * testsuite/Makefile.in: Rebuild.
16268 * script-sections.cc (Script_sections::place_orphan): Initialize
16269 local variable exact.
16271 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16273 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16275 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16276 David S. Miller <davem@davemloft.net>
16278 * powerpc.cc: New file.
16279 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16280 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16281 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16282 * Makefile.in: Rebuild.
16284 2008-06-09 Ian Lance Taylor <iant@google.com>
16286 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16288 (throwing, orig_terminate): New static variables.
16289 (terminate_handler): New static function.
16290 (t2): Set terminate handler.
16292 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16295 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16298 2008-05-30 Cary Coutant <ccoutant@google.com>
16300 * archive.cc (Archive::include_all_members) Correct to step
16301 over symbol table and extended name table in thin archives.
16303 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16306 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16309 2008-05-28 Caleb Howe <cshowe@google.com>
16311 * reduced_debug_output.cc: New file.
16312 * reduced_debug_output.h: New file.
16313 * options.h (class General_options): Add --strip-debug-non-line.
16314 * options.cc (General_options::finalize): Add strip_debug_non_line
16315 to the strip heirarchy.
16316 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16318 * layout.cc: Include "reduced_debug_output.h".
16319 (Layout::Layout): Initialize new fields.
16320 (line_only_debug_sections): New static array.
16321 (is_lines_only_debug_sections): New static inline function.
16322 (Layout::include_section): Handle --strip-debug-non-line.
16323 (Layout::make_output_section): If --strip-debug-non-line, build
16324 new output sections for .debug_abbrev and .debug_info.
16325 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16326 gold. Warn about possible overflow.
16327 (read_signed_LEB_128): Likewise.
16328 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16329 (read_signed_LEB_128): Declare.
16330 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16331 (HFILES): Add reduced_debug_output.h.
16332 * Makefile.in: Rebuild.
16334 2008-05-21 Ian Lance Taylor <iant@google.com>
16336 * mapfile.cc: New file.
16337 * mapfile.h: New file.
16338 * options.h (class General_options): Add -M/--print-map and -Map.
16339 * options.cc (General_options::finalize): Make -M equivalent to
16341 * main.cc: Include <cstdio> and "mapfile.h".
16342 (main): Open mapfile if requested.
16343 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16344 constructor. Change caller.
16345 (queue_initial_tasks): Add mapfile parameter. Change caller.
16346 (queue_middle_tasks): Likewise.
16347 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16349 * archive.cc: Include "mapfile.h".
16350 (Archive::add_symbols): Add mapfile parameter. Change all
16351 callers. Pass mapfile, symbol, and reason to include_member.
16352 (Archive::include_all_members): Add mapfile parameter. Change all
16354 (Archive::include_member): Add mapfile, sym, and why parameters.
16355 Change all callers. Report inclusion to map file.
16356 * archive.h: Include "fileread.h".
16357 (class Archive): Update declarations.
16358 (Archive::file): New const method.
16359 (class Add_archive_symbols): Add mapfile_ field. Update
16360 constructor. Change all callers.
16361 * readsyms.h (class Read_symbols): Likewise.
16362 (class Finish_group): Likewise.
16363 (class Read_script): Likewise.
16364 * common.cc: Include "mapfile.h".
16365 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16367 (Symbol_table::do_allocate_commons): Likewise.
16368 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16369 symbol allocation to mapfile.
16370 * common.h (class Allocate_commons_task): Add mapfile_ field.
16371 Update constructor. Change all callers.
16372 * symtab.h (class Symbol_table): Update declarations.
16373 * layout.cc: Include "mapfile.h".
16374 (Layout_task_runner::run): Print information to mapfile.
16375 (Layout::create_gold_note): Change Output_data_fixed_space to
16376 Output_data_zero_fill.
16377 (Layout::create_build_id): Likewise.
16378 (Layout::print_to_mapfile): New function.
16379 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16380 constructor. Change caller.
16381 (class Layout): Declare print_to_mapfile.
16382 * output.cc (Output_section::Input_section::print_to_mapfile): New
16384 (Output_section::add_input_section): If producing a map, always
16385 add to input_sections_ list.
16386 (Output_section::do_print_to_mapfile): New function.
16387 (Output_segment::print_sections_to_mapfile): New function.
16388 (Output_segment::print_section_list_to_mapfile): New function.
16389 * output.h: Include "mapfile.h".
16390 (Output_data::print_to_mapfile): New function.
16391 (Output_data::do_print_to_mapfile): New virtual function.
16392 (Output_segment_headers::do_print_to_mapfile): New function.
16393 (Output_file_header::do_print_to_mapfile): New function.
16394 (Output_data_const::do_print_to_mapfile): New function.
16395 (class Output_data_const_buffer): Add map_name_ field. Update
16396 constructor. Change all callers. Add do_print_to_mapfile
16398 (class Output_data_fixed_space): Likewise.
16399 (class Output_data_space): Likewise.
16400 (class Output_data_zero_fill): New class.
16401 (Output_data_strtab::do_print_to_mapfile): New function.
16402 (Output_data_reloc_base::do_print_to_mapfile): New function.
16403 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16404 (Output_data_group::do_print_to_mapfile): New function.
16405 (Output_data_got::do_print_to_mapfile): New function.
16406 (Output_data_dynamic::do_print_to_mapfile): New function.
16407 (Output_symtab_xindex::do_print_to_mapfile): New function.
16408 (class Output_section): Declare do_print_to_mapflie. Declare
16409 print_to_mapfile in Input_section.
16410 (class Output_segment): Declare new functions.
16411 * object.h (Sized_relobj::symbol_count): New function.
16412 * script-sections.cc
16413 (Output_section_element_dot_assignment::set_section_addresses):
16414 Change Output_data_fixed_space to Output_data_zero_fill.
16415 (Output_data_expression::do_print_to_mapfile): New function.
16416 * script.cc (read_input_script): Add mapfile parameter. Change
16418 * script.h (read_input_script): Update declaration.
16419 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16420 (Eh_frame::do_print_to_mapfile): New function.
16421 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16422 (Output_merge_string::do_print_to_mapfile): New function.
16423 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16425 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16427 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16429 * Makefile.am (CCFILES): Add mapfile.cc.
16430 (HFILES): Add mapfile.h.
16431 * Makefile.in: Rebuild.
16433 2008-05-19 Ian Lance Taylor <iant@google.com>
16435 * options.h (class General_options): Add -z relro.
16436 * layout.cc (Layout::Layout): Initialize relro_segment_.
16437 (Layout::add_output_section_data): Return the output section.
16438 (Layout::make_output_section): Rcognize relro sections and mark
16439 them appropriately.
16440 (Layout::attach_allocated_section_to_segment): Put relro sections
16441 in a PT_GNU_RELRO segment.
16442 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16444 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16446 (Layout::linkonce_mapping): Map d.rel.ro.local to
16447 .data.rel.ro.local.
16448 (Layout::output_section_name): Us .data.rel.ro.local for any
16449 section which begins with that.
16450 * layout.h (class Layout): Update add_output_section_data
16451 declaration. Add relro_segment_ field.
16452 * output.cc (Output_section::Output_section): Initialize is_relro_
16453 and is_relro_local_ fields.
16454 (Output_segment::add_output_section): Group relro sections.
16455 (Output_segment::is_first_section_relro): New function.
16456 (Output_segment::maximum_alignment): If there is a relro section,
16457 align the segment to the common page size.
16458 (Output_segment::set_section_addresses): Track whether we are
16459 looking at relro sections. If the last section is a relro
16460 section, align to the common page size.
16461 (Output_segment::set_section_list_addresses): Add in_relro
16462 parameter. Change all callers. Align to the page size when
16463 moving from relro to non-relro section.
16464 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16466 * output.h (class Output_section): Add is_relro_ and
16467 is_relro_local_ fields.
16468 (Output_section::is_relro): New function.
16469 (Output_section::set_is_relro): New function.
16470 (Output_section::is_relro_local): New function.
16471 (Output_section::set_is_relro_local): New function.
16472 (class Output_segment): Update declarations.
16473 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16474 * sparc.cc (Target_sparc::got_section): Likewise.
16475 * x86_64.cc (Target_x86_64::got_section): Likewise.
16476 * testsuite/relro_test_main.cc: New file.
16477 * testsuite/relro_test.cc: New file.
16478 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16479 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16480 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16481 (relro_test.so, relro_test_pic.o): New targets.
16482 * testsuite/Makefile.in: Rebuild.
16484 2008-05-16 Ian Lance Taylor <iant@google.com>
16486 * output.cc (Output_segment::add_output_section): Remove front
16488 * output.h (class Output_segment): Remove
16489 add_initial_output_section and overloaded add_output_section.
16490 Update declaration of remaining add_output_section.
16491 * layout.cc (Layout::create_interp): Call add_output_section
16492 rather than add_initial_output_section.
16493 (Layout::finish_dynamic_section): Likewise.
16495 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16496 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16497 know the dynamic type.
16498 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16499 field. Initialize it in constructor.
16500 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16501 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16502 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16505 * output.cc (Output_reloc::get_address): Change return type to
16507 * output.h (class Output_reloc): Update get_address declaration.
16508 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16509 for section addresses.
16511 2008-05-09 Ian Lance Taylor <iant@google.com>
16514 * gold.cc (gold_nomem): Use return value of write.
16516 2008-05-08 Ian Lance Taylor <iant@google.com>
16518 * symtab.c (Symbol::init_base_output_data): Add version
16519 parameter. Change all callers.
16520 (Symbol::init_base_output_segment): Likewise.
16521 (Symbol::init_base_constant): Likewise.
16522 (Symbol::init_base_undefined): Likewise.
16523 (Sized_symbol::init_output_data): Likewise.
16524 (Sized_symbol::init_output_segment): Likewise.
16525 (Sized_symbol::init_constant): Likewise.
16526 (Sized_symbol::init_undefined): Likewise.
16527 (Symbol_table::do_define_in_output_data): If the new symbol has a
16528 version, mark it as the default.
16529 (Symbol_table::do_define_in_output_segment): Likewise.
16530 (Symbol_table::do_define_as_constant): Likewise.
16531 * symtab.h (class Symbol): Update declarations.
16532 (class Sized_symbol): Likewise.
16533 * resolve.cc (Symbol::override_version): New function.
16534 (Symbol::override_base): Call override_version.
16535 (Symbol::override_base_with_special): Likewise.
16536 * testsuite/ver_script_8.script: New file.
16537 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16538 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16539 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16540 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16542 2008-05-06 Ian Lance Taylor <iant@google.com>
16545 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16547 (class General_options): Remove existing --undefined, and add
16548 --no-undefined instead. Add new --undefined as synonym for -u.
16549 * archive.cc (Archive::add_symbols): Check whether symbol was
16551 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16552 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16553 all uses. Add IS_UNDEFINED. Update declarations to split
16554 different versions of init_base. Declare init_base_undefined.
16555 (Symbol::is_defined): Handle IS_UNDEFINED.
16556 (Symbol::is_undefined): Likewise.
16557 (Symbol::is_weak_undefined): Call is_undefined.
16558 (Symbol::is_absolute): Handle IS_CONSTANT.
16559 (class Sized_symbol): Update declarations to split different
16560 versions of init. Declare init_undefined.
16561 (class Symbol_table): Declare new functions.
16562 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16563 Change all callers.
16564 (Symbol::init_base_output_data): Likewise.
16565 (Symbol::init_base_output_segment): Likewise.
16566 (Symbol::init_base_constant): Likewise.
16567 (Symbol::init_base_undefined): New function.
16568 (Sized_symbol::init_object): Rename from init. Change all
16570 (Sized_symbol::init_output_data): Likewise.
16571 (Sized_symbol::init_output_segment): Likewise.
16572 (Sized_symbol::init_constant): Likewise.
16573 (Sized_symbol::init_undefined): New function.
16574 (Symbol_table::add_undefined_symbols_from_command_line): New
16576 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16578 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16579 (Symbol::output_section): Likewise.
16580 (Symbol::set_output_section): Likewise.
16581 (Symbol_table::sized_finalize_symbol): Likewise.
16582 (Symbol_table::sized_write_globals): Likewise.
16583 * resolve.cc (Symbol_table::should_override): Likewise.
16584 (Symbol::override_base_with_special): Likewise.
16586 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16587 symbol, change it to have default visibility.
16588 * testsuite/protected_1.cc: New file.
16589 * testsuite/protected_2.cc: New file.
16590 * testsuite/protected_3.cc: New file.
16591 * testsuite/protected_main_1.cc: New file.
16592 * testsuite/protected_main_2.cc: New file.
16593 * testsuite/protected_main_3.cc: New file.
16594 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16595 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16596 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16597 (protected_1.so): New target.
16598 (protected_1_pic.o, protected_2_pic.o): New targets.
16599 (protected_3_pic.o): New target.
16600 (check_PROGRAMS): Add protected_2.
16601 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16602 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16603 * testsuite/Makefile.in: Rebuild.
16605 * options.h (DEFINE_var): Add set_user_set_##varname__.
16606 (DEFINE_bool_alias): New macro.
16607 (class General_options): Define -Bstatic using DEFINE_bool_alias
16608 rather than DEFINE_special. Add --undefined as an alias for -z
16610 * options.cc (General_options::parse_Bstatic): Remove.
16612 * options.h (class General_options): Add --fatal-warnings.
16613 * main.cc (main): Implement --fatal-warnings.
16614 * errors.h (Errors::warning_count): New function.
16616 * options.h (class General_options): Add -Bsymbolic-functions.
16617 * symtab.h (Symbol::is_preemptible): Check for
16618 -Bsymbolic-functions.
16620 2008-05-05 Ian Lance Taylor <iant@google.com>
16622 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16623 as noVARNAME rather than no-VARNAME.
16624 (class General_options): Add option -z combreloc.
16625 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16627 (Output_reloc::sort_before) [SHT_REL]: New function.
16628 (Output_reloc::sort_before) [SHT_RELA]: New function.
16629 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16630 Sort_relocs_comparison.
16631 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16632 parameter. Change all callers.
16633 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16634 sort_relocs parameter. Change all callers.
16635 * output.cc (Output_reloc::get_address): New function, broken out
16637 (Output_reloc::write_rel): Call it.
16638 (Output_reloc::compare): New function.
16639 (Output_data_reloc_base::do_write): Optionally sort relocs.
16641 * configure.ac: If targ_extra_obj is set, link it in.
16642 * configure.tgt: Initialize all variables.
16643 (x86_64*): Set targ_extra_obj and targ_extra_size.
16644 * configure: Rebuild.
16646 * object.cc (Sized_relobj::include_section_group): Adjust section
16647 indexes read from group data. Build vector to pass to
16649 * layout.cc (Layout::layout_group): Add flags and shndxes
16650 parameters. Remove contents parameter. Change caller. Update
16651 explicit instantiations.
16652 * layout.h (class Layout): Update layout_group declaration.
16653 * output.cc (Output_data_group::Output_data_group): Add flags and
16654 input_shndxes parameters. Remove contents parameter. Change
16656 (Output_data_group::do_write): Change input_sections_ to
16658 * output.h (class Output_data_group): Update constructor
16659 declaration. Rename input_sections_ to input_shndxes_.
16660 * testsuite/many_sections_test.cc: Add template.
16662 2008-04-30 Cary Coutant <ccoutant@google.com>
16664 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16666 * layout.cc (Layout::include_section): Refactored check for debug
16668 (Layout::add_comdat): Add new parameters. Change type
16669 of signature parameter. Add object and shndx to signatures table.
16670 (Layout::find_kept_object): New function.
16671 * layout.h: Include <cstring>.
16672 (Layout::is_debug_info_section): New function.
16673 (Layout::add_comdat): Add new parameters.
16674 (Layout::find_kept_object): New function.
16675 (Layout::Kept_section): New struct.
16676 (Layout::Signatures): Change type of map range.
16677 * object.cc (Relobj::output_section_address): New function.
16678 (Sized_relobj::include_section_group): Add new parameters. Change
16679 calls to Layout::add_comdat. Change to build table of kept comdat
16680 groups and table mapping discarded sections to kept sections.
16681 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16682 (Sized_relobj::do_layout): Change calls to include_section_group and
16683 include_linkonce_section.
16684 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16685 value to zero when section is discarded.
16686 (Sized_relobj::map_to_kept_section): New function.
16687 * object.h (Relobj::output_section_address): New function.
16688 (Relobj::Comdat_group): New type.
16689 (Relobj::find_comdat_group): New function.
16690 (Relobj::Comdat_group_table): New type.
16691 (Relobj::Kept_comdat_section): New type.
16692 (Relobj::Kept_comdat_section_table): New type.
16693 (Relobj::add_comdat_group): New function.
16694 (Relobj::set_kept_comdat_section): New function.
16695 (Relobj::get_kept_comdat_section): New function.
16696 (Relobj::comdat_groups_): New field.
16697 (Relobj::kept_comdat_sections_): New field.
16698 (Symbol_value::input_value): Update comment.
16699 (Sized_relobj::map_to_kept_section) New function.
16700 (Sized_relobj::include_linkonce_section): Add new parameter.
16701 * target-reloc.h (Comdat_behavior): New type.
16702 (get_comdat_behavior): New function.
16703 (relocate_section): Add code to map a discarded section to the
16704 corresponding kept section when applying a relocation.
16706 2008-04-30 Craig Silverstein <csilvers@google.com>
16708 * dwarf_reader.cc (next_generation_count): New static var.
16709 (Addr2line_cache_entry): New struct.
16710 (addr2line_cache): New static var.
16711 (Dwarf_line_info::one_addr2line): Added caching.
16712 (Dwarf_line_info::clear_addr2line_cache): New function.
16713 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16714 cache-size parameter.
16715 (Dwarf_line_info::one_addr2line_cache): New function.
16716 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16717 new cache-size argument to one_addr2line(), and clear cache.
16719 2008-04-28 Cary Coutant <ccoutant@google.com>
16721 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16722 R_386_PC8 relocations.
16724 2008-04-23 Ian Lance Taylor <iant@google.com>
16726 * object.cc (Sized_relobj::include_section_group): Check for
16727 invalid section group.
16729 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16732 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16733 than read for file header.
16734 * archive.cc (Archive::include_member): Likewise.
16736 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
16738 * aclocal.m4: Regenerate.
16739 * configure: Regenerate.
16741 2008-04-19 Ian Lance Taylor <iant@google.com>
16743 * version.cc (version_string): Bump to 1.6.
16745 * testsuite/Makefile.am (many_sections_r_test): New target.
16746 (many_sections_r_test_SOURCES): Remove.
16747 (many_sections_r_test_DEPENDENCIES): Remove.
16748 (many_sections_r_test_LDFLAGS): Remove.
16749 (many_sections_r_test_LDADD): Remove.
16751 * object.cc (Sized_relobj::do_add_symbols): Always pass
16752 local_symbol_count_ to add_from_relobj.
16754 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16755 every thousand variables.
16756 * testsuite/Makefile.in: Rebuild.
16758 * object.cc (Xindex::initialize_symtab_xindex): New function.
16759 (Xindex::read_symtab_xindex): New function.
16760 (Xindex::sym_xindex_to_shndx): New function.
16761 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16763 (Sized_relobj::do_initialize_xindex): New function.
16764 (Sized_relobj::do_read_symbols): Adjust section links.
16765 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16766 parameter. Change all callers.
16767 (Sized_relobj::include_section_group): Adjust section links and
16768 symbol section indexes.
16769 (Sized_relobj::do_layout): Adjust section links.
16770 (Sized_relobj::do_count_local_symbols): Adjust section links and
16771 symbol section indexes.
16772 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16773 ordinary and special symbols.
16774 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16775 dynsym_xindex parameters. Change all callers. Adjust section
16776 links. Use SHN_XINDEX when needed.
16777 (Sized_relobj::get_symbol_location_info): Adjust section links.
16778 Don't get fooled by special symbols.
16779 * object.h (class Xindex): Define.
16780 (class Object): Add xindex_ parameter. Declare virtual functoin
16781 do_initialize_xindex.
16782 (Object::adjust_sym_shndx): New function.
16783 (Object::set_xindex): New protected function.
16784 (class Symbol_value): Add is_ordinary_shndx_ field.
16785 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16786 (Symbol_value::value): Assert ordinary section.
16787 (Symbol_value::initialize_input_to_output_map): Likewise.
16788 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16789 Change all callers.
16790 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16792 (class Sized_relobj): Update declarations.
16793 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16794 parameter. Change all callers.
16795 (Sized_relobj::adjust_shndx): New function.
16796 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16798 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16799 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16800 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16801 (Sized_dynobj::read_dynsym_section): Adjust section links.
16802 (Sized_dynobj::read_dynamic): Likewise.
16803 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16805 (Sized_dynobj::do_initialize_xindex): New function.
16806 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16807 do_initialize_xindex.
16808 (Sized_dynobj::adjust_shndx): New function.
16809 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16810 dynsym_xindex_ fields.
16811 (Layout::finalize): Add a call to set_section_indexes before
16812 creating the symtab sections.
16813 (Layout::set_section_indexes): Don't do anything if the section
16814 already has a section index.
16815 (Layout::create_symtab_sections): Add shnum parameter. Change
16816 caller. Create .symtab_shndx section if needed.
16817 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16819 (Layout::allocated_output_section_count): New function.
16820 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16822 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16823 fields. Update declarations.
16824 (Layout::symtab_xindex): New function.
16825 (Layout::dynsym_xindex): New function.
16826 (class Write_symbols_task): Add layout_ field.
16827 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16829 * output.cc (Output_section_headers::Output_section_headers): Add
16830 shstrtab_section parameter. Change all callers.
16831 (Output_section_headers::do_sized_write): Store overflow values
16832 for section count and section string table section index in
16833 section header zero.
16834 (Output_file_header::do_sized_write): Check for overflow of
16835 section count and section string table section index.
16836 (Output_symtab_xindex::do_write): New function.
16837 (Output_symtab_xindex::endian_do_write): New function.
16838 * output.h (class Output_section_headers): Add shstrtab_section_.
16839 Update declarations.
16840 (class Output_symtab_xindex): Define.
16841 (Output_section::has_out_shndx): New function.
16842 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16844 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16845 Change all callers.
16846 (Sized_symbol::init): Likewise.
16847 (Symbol::output_section): Check for ordinary symbol.
16848 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16849 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16851 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16852 Change all callers. Simplify handling of symbols from sections
16853 not included in the link.
16854 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16856 (Weak_alias_sorter::operator()): Assert that symbols are
16858 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16860 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16861 parameters. Change all callers.
16862 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16863 symbol distinction. Use SHN_XINDEX when needed.
16864 (Symbol_table::write_section_symbol): Add symtab_xindex
16865 parameter. Change all callers.
16866 (Symbol_table::sized_write_section_symbol): Likewise. Use
16867 SHN_XINDEX when needed.
16868 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16870 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16871 (Symbol::is_defined): Check is_ordinary.
16872 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16873 (Symbol::is_absolute, Symbol::is_common): Likewise.
16874 (class Sized_symbol): Update declarations.
16875 (class Symbol_table): Update declarations.
16876 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16877 parameters. Change all callers.
16878 (Sized_symbol::override): Likewise.
16879 (Symbol_table::override): Likewise.
16880 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16881 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16882 is_ordinary, and orig_st_shndx parameters. Change all callers.
16883 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16884 to be in an ordinary section.
16885 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16886 object and is_ordinary parameters. Change all callers.
16887 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16888 Change all callers. Don't add undefined or non-ordinary symbols
16890 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16891 Change all callers.
16892 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16894 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16895 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16896 (Sized_relobj::relocate_sections): Likewise.
16897 * target-reloc.h (scan_relocs): Adjust section symbol index.
16898 (scan_relocatable_relocs): Likewise.
16899 * i386.cc (Scan::local): Check for ordinary symbols.
16900 * sparc.cc (Scan::local): Likewise.
16901 * x86_64.cc (Scan::local): Likewise.
16902 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16903 to symbol_section_and_value.
16904 * testsuite/many_sections_test.cc: New file.
16905 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16906 (check_PROGRAMS): Add many_sections_test.
16907 (many_sections_test_SOURCES): Define.
16908 (many_sections_test_DEPENDENCIES): Define.
16909 (many_sections_test_LDFLAGS): Define.
16910 (BUILT_SOURCES): Add many_sections_define.h.
16911 (many_sections_define.h): New target.
16912 (BUILT_SOURCES): Add many_sections_check.h.
16913 (many_sections_check.h): New target.
16914 (check_PROGRAMS): Add many_sections_r_test.
16915 (many_sections_r_test_SOURCES): Define.
16916 (many_sections_r_test_DEPENDENCIES): Define.
16917 (many_sections_r_test_LDFLAGS): Define.
16918 (many_sections_r_test_LDADD): Define.
16919 (many_sections_r_test.o): New target.
16920 * testsuite/Makefile.in: Rebuild.
16922 2008-04-17 Cary Coutant <ccoutant@google.com>
16924 * errors.cc (Errors::info): New function.
16925 (gold_info): New function.
16926 * errors.h (Errors::info): New function.
16927 * gold.h (gold_info): New function.
16928 * object.cc (Input_objects::add_object): Print trace output.
16929 * options.cc (options::parse_set): New function.
16930 (General_options::parse_wrap): Deleted.
16931 (General_options::General_options): Deleted initializer.
16932 * options.h (options::String_set): New typedef.
16933 (options::parse_set): New function.
16934 (DEFINE_set): New macro.
16935 (General_options::wrap): Changed to use DEFINE_set. Changed
16936 callers of any_wrap_symbols and is_wrap_symbol.
16937 (General_options::trace, General_options::trace_symbol):
16939 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16940 (General_options::wrap_symbols_): Deleted.
16941 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16943 2008-04-17 David S. Miller <davem@davemloft.net>
16945 * options.cc (General_options::parse_V): New function.
16946 * options.h: Add entries for -V and -Qy.
16948 2008-04-17 Ian Lance Taylor <iant@google.com>
16950 * common.cc (Symbol_table::allocate_commons): Remove options
16951 parameter. Change caller.
16952 (Symbol_table::do_allocate_commons): Remove options parameter.
16953 Change caller. Just call do_allocate_commons_list twice.
16954 (Symbol_table::do_allocate_commons_list): New function, broken out
16955 of do_allocate_commons.
16956 * common.h (class Allocate_commons_task): Remove options_ field.
16957 Update constructor.
16958 * symtab.cc (Symbol_table::Symbol_table): Initialize
16960 (Symbol_table::add_from_object): Put TLS common symbols on
16962 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16963 which are IN_OUTPUT_DATA.
16964 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16965 allocate_commons and do_allocate_commons declarations. Declare
16966 do_allocate_commons_list.
16967 * gold.cc (queue_middle_tasks): Update creation of
16968 Allocate_commons_task to not pass options.
16969 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16970 (TLS_TEST_C_FLAGS): New variable.
16971 (tls_test_c_pic.o): New target.
16972 (tls_test_shared.so): Link in tls_test_c_pic.o.
16973 (tls_test_c_pic_ie.o): New target.
16974 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16975 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16976 (tls_test_c.o): New target.
16977 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16978 (tls_pic_test_LDADD): Likewise.
16979 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16980 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16981 (tls_test_c_gnu2.o): New target.
16982 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16984 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16985 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16986 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16987 * testsuite/tls_test.cc: Include "config.h".
16988 (t_last): Call t11_last.
16989 * testsuite/tls_test.h (t11, t11_last): Declare.
16990 * testsuite/tls_test_c.c: New file.
16991 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16992 * configure.ac: Check for OpenMP support.
16993 * configure, config.in, Makefile.in: Rebuild.
16994 * testsuite/Makefile.in: Rebuild.
16996 2008-04-16 Cary Coutant <ccoutant@google.com>
16998 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16999 (Target_i386::tls_base_symbol_defined_): New field.
17000 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17001 (Target_i386::Scan::global): Likewise.
17002 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17003 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17004 (Target_x86_64::tls_base_symbol_defined_): New field.
17005 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17006 (Target_x86_64::Scan::global): Likewise.
17008 2008-04-16 Cary Coutant <ccoutant@google.com>
17010 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17011 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17012 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17013 building shared libraries.
17014 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17015 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17016 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17017 * testsuite/Makefile.in: Rebuild.
17018 * testsuite/weak_undef.h: New file.
17019 * testsuite/weak_undef_file1.cc: Add extra test cases.
17020 * testsuite/weak_undef_file2.cc: Likewise.
17021 * testsuite/weak_undef_test.cc: Likewise.
17023 2008-04-16 David S. Miller <davem@davemloft.net>
17025 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17026 Add issued_non_pic_error_ field. Declare check_non_pic.
17027 (Target_sparc::Scan::check_non_pic): New function.
17028 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17029 (Target_sparc::Scan::global): Likewise.
17031 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17032 * configure: Rebuild.
17034 * options.h (DEFINE_enable): New macro.
17035 (new_dtags): New enable option.
17036 (initfirst, interpose, loadfltr, nodefaultlib,
17037 nodelete, nodlopen, nodump): New -z options.
17038 * layout.cc (Layout:finish_dynamic_section): If new
17039 dtags enabled, emit DT_RUNPATH. Also, emit a
17040 DT_FLAGS_1 containing any specified -z flags.
17042 2008-04-16 Ian Lance Taylor <iant@google.com>
17044 * copy-relocs.cc: New file.
17045 * copy-relocs.h: New file.
17046 * reloc.cc: Remove Copy_relocs code.
17047 * reloc.h: Likewise.
17048 * reloc-types.h (struct Reloc_types) [both versions]: Add
17049 get_reloc_addend_noerror.
17050 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17051 variants of add_global which take an addend which must be zero.
17052 * i386.cc: Include "copy-relocs.h".
17053 (class Target_i386): Change type of copy_relocs_ to variable,
17054 update initializer.
17055 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17056 Change all callers.
17057 (Target_i386::do_finalize_sections): Change handling of
17059 * sparc.cc: Include "copy-relocs.h".
17060 (class Target_sparc): Change type of copy_relocs_ to variable,
17061 update initializer.
17062 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17063 Change all callers.
17064 (Target_sparc::do_finalize_sections): Change handling of
17066 * x86_64.cc: Include "copy-relocs.h".
17067 (class Target_x86_64): Change type of copy_relocs_ to variable,
17068 update initializer.
17069 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17070 class. Change all callers.
17071 (Target_x86_64::do_finalize_sections): Change handling of
17073 * Makefile.am (CCFILES): Add copy-relocs.cc.
17074 (HFILES): Add copy-relocs.h.
17076 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17078 * testsuite/script_test_4.sh: Permit leading zeroes.
17080 2008-04-15 Ian Lance Taylor <iant@google.com>
17082 * script-sections.cc (Script_sections::create_segments): Use
17083 header_size_adjustment even when there is enough room for the
17085 * testsuite/script_test_4.sh: New file.
17086 * testsuite/script_test_4.t: New file.
17087 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17088 (check_DATA): Add script_test_4.stdout.
17089 (MOSTLYCLEANFILES): Likewise.
17090 (script_test_4): New target.
17091 (script_test_4.stdout): New target.
17092 * testsuite/Makefile.in: Rebuild.
17094 * sparc.cc: Add definitions for Output_data_plt_sparc class
17097 2008-04-14 David S. Miller <davem@davemloft.net>
17099 * sparc.cc: New file.
17100 * Makefile.am (TARGETSOURCES): Add sparc.cc
17101 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17102 * configure.tgt: Document targ_extra_size and
17103 targ_extra_big_endian. Add entries for sparc-* and
17105 * configure.ac: Handle targ_extra_size and
17106 targ_extra_big_endian.
17107 * Makefile.in: Rebuild.
17108 * configure: Likewise.
17109 * po/POTFILES.in: Likewise.
17110 * po/gold.pot: Likewise.
17112 2008-04-14 Ian Lance Taylor <iant@google.com>
17114 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17115 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17116 in the name/type/flags to section mapping. Don't call
17117 allocate_output_section.
17118 (Layout::choose_output_section): Change parameter from adjust_name
17119 to is_input_section. Don't permit input sections after sections
17120 are attached to segments. Don't call allocate_output_section.
17121 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17122 not write_enable_output_section.
17123 (Layout::make_output_section): Don't push to
17124 unattached_section_list_ nor call attach_to_segment. Call
17125 attach_section_to_segment if sections are attached.
17126 (Layout::attach_sections_to_segments): New function.
17127 (Layout::attach_section_to_segment): New function.
17128 (Layout::attach_allocated_section_to_segment): Rename from
17129 attach_to_segment. Remove flags parameter.
17130 (Layout::allocate_output_section): Remove function.
17131 (Layout::write_enable_output_section): Remove function.
17132 * layout.h (class Layout): Update for above changes. Add new
17133 field sections_are_attached_.
17134 * output.h (Output_section::update_flags_for_input_section): New
17136 * output.cc (Output_section::add_input_section): Call
17137 update_flags_for_input_section.
17138 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17140 2008-04-11 Cary Coutant <ccoutant@google.com>
17142 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17143 thought unnecessary.
17144 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17146 2008-04-11 Ian Lance Taylor <iant@google.com>
17148 * output.h (class Output_section_data): Remove inline definition
17150 * output.cc (Output_section_data::set_addralign): New function.
17152 2008-04-11 Cary Coutant <ccoutant@google.com>
17154 Add support for TLS descriptors for i386 and x86_64.
17155 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17156 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17157 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17159 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17160 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17161 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17163 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17164 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17165 Fix problem with initial-exec relocations.
17166 (Target_i386::Relocate::relocate_tls): Likewise.
17167 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17169 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17170 support for section-plus-offset dynamic table entries.
17171 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17172 (Output_data_dynamic::Dynamic_entry): Add support for
17173 section-plus-offset dynamic table entries.
17174 (Output_data_dynamic::Classification): Likewise.
17175 (Output_data_dynamic::classification_): Renamed offset_.
17176 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17177 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17178 (Target_x86_64::make_plt_section): New function.
17179 (Target_x86_64::reserve_tlsdesc_entries): New function.
17180 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17181 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17182 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17183 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17184 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17185 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17186 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17187 add extra PLT entry for TLS descriptors.
17188 (Output_data_plt_x86_64::got_): New field.
17189 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17190 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17192 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17194 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17195 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17196 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17197 R_386_TLS_DESC_CALL relocations.
17198 (Target_x86_64::Scan::global): Likewise.
17199 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17200 for TLS descriptors.
17201 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17202 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17203 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17204 GD-to-IE relaxation.
17205 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17206 and TLS_DESCRIPTORS.
17207 * Makefile.in: Rebuild.
17208 * configure: Rebuild.
17209 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17210 (tls_test_shared2.so): New target.
17211 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17212 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17213 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17214 (tls_shared_gd_to_ie_test_LDADD): New variable.
17215 (tls_shared_gnu2_gd_to_ie_test): New target.
17216 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17218 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17219 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17220 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17221 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17222 (tls_shared_gnu2_test): New target.
17223 (tls_test_gnu2_shared.so): New target.
17224 (tls_shared_gnu2_test_SOURCES): New variable.
17225 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17226 (tls_shared_gnu2_test_LDFLAGS): New variable.
17227 (tls_shared_gnu2_test_LDADD): New variable.
17228 * testsuite/Makefile.in: Rebuild.
17229 * testsuite/Makefile.
17231 2008-04-11 Ian Lance Taylor <iant@google.com>
17233 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17235 * testsuite/Makefile.in: Rebuild.
17237 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17239 * testsuite/script_test_2.cc (main): Adjust test.
17241 2008-04-11 David S. Miller <davem@davemloft.net>
17242 Ian Lance Taylor <iant@google.com>
17244 * options.h (General_options): Add entries for '-Y' and
17246 * options.cc (General_options:finalize): If -Y was used, add those
17247 entries to the library path instead of the default "/lib" and
17250 2008-04-11 David S. Miller <davem@davemloft.net>
17252 * testsuite/justsyms.t: Start at 0x100.
17253 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17254 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17256 * testsuite/script_test_2.cc: Adjust string and section length
17259 2008-04-09 Ian Lance Taylor <iant@google.com>
17262 * script-sections.cc (Sections_element::allocate_to_segment): Add
17264 (Output_section_definition::allocate_to_segment): Likewise.
17265 (Orphan_output_section::allocate_to_segment): Likewise.
17266 (Script_sections::attach_sections_using_phdrs_clause): Don't
17267 propagate non-PT_LOAD segments to orphan sections.
17268 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17269 readelf rather than objdump.
17270 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17271 .interp section and PT_INTERP segment are the same size.
17272 * testsuite/Makefile.in: Rebuild.
17274 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17275 aliases for symbols defined in the same object.
17276 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17277 (weak_alias_test_SOURCES): New variable.
17278 (weak_alias_test_DEPENDENCIES): New variable.
17279 (weak_alias_test_LDFLAGS): New variable.
17280 (weak_alias_test_LDADD): New variable.
17281 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17282 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17283 (weak_alias_test_3.o): New target.
17284 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17285 * testsuite/weak_alias_test_main.cc: New file.
17286 * testsuite/weak_alias_test_1.cc: New file.
17287 * testsuite/weak_alias_test_2.cc: New file.
17288 * testsuite/weak_alias_test_3.cc: New file.
17290 2008-04-08 Ian Lance Taylor <iant@google.com>
17292 * options.h (class General_options): Add --noinhibit-exec option.
17293 * main.cc (main): Check --noinhibit-exec.
17295 * options.h (class General_options): Define --wrap as a special
17296 option. Add wrap_symbols_ field.
17297 (General_options::any_wrap_symbols): New function.
17298 (General_options::is_wrap_symbol): New function.
17299 * options.cc (General_options::parse_wrap): New function.
17300 (General_options::General_options): Initialize wrap_symbols_.
17301 * symtab.cc (Symbol_table::wrap_symbol): New function.
17302 (Symbol_table::add_from_object): Handle --wrap.
17303 * symtab.h (class Symbol_table): Declare wrap_symbol.
17304 * target.h (Target::wrap_char): New function.
17305 (Target::Target_info): Add wrap_char field.
17306 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17307 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17308 * testsuite/testfile.cc (Target_test::test_target_info):
17311 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17314 * layout.h (class Layout): Add added_eh_frame_data_ field.
17315 * layout.cc (Layout::Layout): Initialize new field.
17316 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17317 output section until we find a section we merged successfully.
17318 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17319 that the size be non-zero.
17321 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17324 2008-04-08 Craig Silverstein <csilvers@google.com>
17326 * configure.ac: Export new conditional variable HAVE_ZLIB.
17327 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17329 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17330 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17332 2008-04-07 Ian Lance Taylor <iant@google.com>
17334 * version.cc (version_string): Set to "1.5".
17336 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17337 Add issued_non_pic_error_ field. Declare check_non_pic.
17338 (Target_x86_64::Scan::check_non_pic): New function.
17339 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17340 (Target_x86_64::Scan::global): Likewise.
17342 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17343 addend parameter. Change caller. Handle merge sections.
17344 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17345 Address to Addend. Don't add in the result of
17346 local_section_offset, pass down the addend and use the returned
17348 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17349 Update declarations of local_section_offset and symbol_value.
17350 * testsuite/two_file_test_1.cc (t18): New function.
17351 * testsuite/two_file_test_2.cc (f18): New function.
17352 * testsuite/two_file_test_main.cc (main): Call t18.
17353 * testsuite/two_file_test.h (t18, f18): Declare.
17355 * configure.ac: Don't test for objdump, c++filt, or readelf.
17356 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17358 (TEST_READELF): New variable.
17359 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17360 (check_PROGRAMS): Add two_file_strip_test.
17361 (two_file_strip_test): New target.
17362 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17363 (two_file_same_shared_strip_test_SOURCES): New variable.
17364 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17365 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17366 (two_file_same_shared_strip_test_LDADD): New variable.
17367 (two_file_shared_strip.so): New target.
17368 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17369 (ver_test_5.syms, ver_test_7.syms): Likewise.
17370 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17371 (strip_test_3.stdout): Use TEST_OBJDUMP.
17372 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17374 2008-04-04 Cary Coutant <ccoutant@google.com>
17376 * symtab.h (Symbol::is_weak_undefined): New function.
17377 (Symbol::is_strong_undefined): New function.
17378 (Symbol::is_absolute): New function.
17379 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17380 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17382 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17383 (weak_undef_test): New target.
17384 * testsuite/Makefile.in: Rebuild.
17385 * testsuite/weak_undef_file1.cc: New file.
17386 * testsuite/weak_undef_file2.cc: New file.
17387 * testsuite/weak_undef_test.cc: New file.
17389 2008-04-03 Craig Silverstein <csilvers@google.com>
17391 * compressed_output.h (class Output_compressed_section): Use
17393 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17395 (zlib_compressed_suffix): Removed.
17396 (Output_compressed_section::set_final_data_size): Use unsigned
17398 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17399 Fix linker invocation.
17400 (flagstest_o_specialfile_and_compress_debug_sections):
17402 * testsuite/Makefile.in: Regenerated.
17404 2008-04-02 David S. Miller <davem@davemloft.net>
17406 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17407 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17409 2008-04-02 Craig Silverstein <csilvers@google.com>
17413 2008-04-02 Ian Lance Taylor <iant@google.com>
17415 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17416 parameters. Update for new key type to views_. Change all
17418 (File_read::read): Adjust for byteshift in returned view.
17419 (File_read::add_view): New function, broken out of
17420 find_and_make_view.
17421 (File_read::make_view): New function, broken out of
17422 find_and_make_view.
17423 (File_read::find_or_make_view): Add offset and aligned
17424 parameters. Rewrite accordingly. Change all callers.
17425 (File_read::get_view): Add offset and aligned parameters. Adjust
17426 for byteshift in return value.
17427 (File_read::get_lasting_view): Likewise.
17428 * fileread.h (class File_read): Update declarations.
17429 (class File_read::View): Add byteshift_ field. Add byteshift to
17430 constructor. Add byteshift method.
17431 * archive.h (Archive::clear_uncached_views): New function.
17432 (Archive::get_view): Add aligned parameter. Change all callers.
17433 * object.h (Object::get_view): Add aligned parameter. Change all
17435 (Object::get_lasting_view): Likewise.
17437 * fileread.cc (File_read::release): Don't call clear_views if
17438 there are multiple objects.
17439 * fileread.h (File_read::clear_uncached_views): New function.
17440 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17443 2008-03-31 Cary Coutant <ccoutant@google.com>
17445 Add thin archive support.
17446 * archive.cc (Archive::armagt): New const.
17447 (Archive::setup): Remove task parameter and calls to unlock.
17448 (Archive::unlock_nested_archives): New function.
17449 (Archive::read_header): Add nested_off parameter. Change
17451 (Archive::interpret_header): Likewise.
17452 (Archive::include_all_members): Change to handle thin
17454 (Archive::include_member): Likewise.
17455 * archive.h (Archive::Archive): Add new parameters and
17457 (Archive::armagt): New const.
17458 (Archive::setup): Remove task parameter.
17459 (Archive::unlock_nested_archives): New function.
17460 (Archive::read_header): Add nested_off parameter.
17461 (Archive::interpret_header): Likewise.
17462 (Archive::Nested_archive_table): New typedef.
17463 (Archive::is_thin_archive_): New field.
17464 (Archive::nested_archives_): New field.
17465 (Archive::options_): New field.
17466 (Archive::dirpath_): New field.
17467 (Archive::task_): New field.
17468 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17469 for thin archives. Pass additional parameters to
17470 Archive::Archive. Unlock the archive file after calling
17473 2008-03-29 Ian Lance Taylor <iant@google.com>
17475 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17476 version symbol to be local.
17477 * testsuite/ver_test_4.sh: New file.
17478 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17479 (check_DATA): Add ver_test_4.syms.
17480 (ver_test_4.syms): New target.
17481 * testsuite/Makefile.in: Rebuild.
17484 (Output_section::Input_section_sort_entry::has_priority): New
17486 (Output_section::Input_section_sort_entry::match_file_name): New
17488 (Output_section::Input_section_sort_entry::match_section_name):
17490 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17492 (Output_section::Input_section_sort_entry::match_section_file):
17494 (Output_section::Input_section_sort_compare::operator()): Rewrite
17495 using new Input_section_sort_entry functions. Sort crtbegin and
17496 crtend first. Sort sections with no priority before sections with
17498 * testsuite/initpri1.c (d3): Check j != 4.
17499 (cd5): New constructor/destructor function.
17500 (main): Check j != 2.
17502 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17503 new symbol when resolving, don't call set_is_default.
17504 * testsuite/ver_test_7.cc: New file.
17505 * testsuite/ver_test_7.sh: New file.
17506 * testsuite/Makefile.am (ver_test_7.so): New target.
17507 (ver_test_7.o): New target.
17508 (check_SCRIPTS): Add ver_test_7.sh.
17509 (check_DATA): Add ver_test_7.syms.
17510 (ver_test_7.syms): New target.
17512 2008-03-28 Ian Lance Taylor <iant@google.com>
17514 * layout.cc (Layout::layout): If we see an input section with a
17515 name that needs sorting, set the must_sort flag for the output
17517 (Layout::make_output_section): If the name of the output section
17518 indicates that it might require sorting, set the may_sort flag.
17519 * output.h (Output_section::may_sort_attached_input_sections): New
17521 (Output_section::set_may_sort_attached_input_sections): New
17523 (Output_section::must_sort_attached_input_sections): New
17525 (Output_section::set_must_sort_attached_input_sections): New
17527 (class Output_section): Declare Input_section_sort_entry. Define
17528 Input_section_sort_compare. Declare
17529 sort_attached_input_sections. Add new fields:
17530 may_sort_attached_input_sections_,
17531 must_sort_attached_input_sections_,
17532 attached_input_sections_are_sorted_.
17533 * output.cc (Output_section::Output_section): Initialize new
17535 (Output_section::add_input_section): Add an entry to
17536 input_sections_ if may_sort or must_sort are true.
17537 (Output_section::set_final_data_size): Call
17538 sort_attached_input_sections if necessary.
17539 (Output_section::Input_section_sort_entry): Define new class.
17540 (Output_section::Input_section_sort_compare::operator()): New
17542 (Output_section::sort_attached_input_sections): New function.
17543 * configure.ac: Check whether the compiler supports constructor
17544 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17545 * testsuite/initpri1.c: New file.
17546 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17547 CONSTRUCTOR_PRIORITY.
17548 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17549 (initpri1_LDFLAGS): New variable.
17550 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17552 2008-03-27 Ian Lance Taylor <iant@google.com>
17554 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17555 * testsuite/common_test_1.c: New file.
17556 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17557 (common_test_1_SOURCES): New variable.
17558 (common_test_1_DEPENDENCIES): New variable.
17559 (common_test_1_LDFLAGS): New variable.
17561 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17562 and commons_ correctly when NAME/VERSION does not override
17564 * testsuite/ver_test_6.c: New file.
17565 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17566 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17567 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17569 2008-03-26 Ian Lance Taylor <iant@google.com>
17571 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17572 of an undefined symbol from a version script.
17573 * testsuite/Makefile.am (ver_test_5.so): New target.
17574 (ver_test_5.o): New target.
17575 (check_SCRIPTS): Add ver_test_5.sh.
17576 (check_DATA): Add ver_test_5.syms.
17577 (ver_test_5.syms): New target.
17578 * testsuite/ver_test_5.cc: New file.
17579 * testsuite/ver_test_5.script: New file.
17580 * testsuite/ver_test_5.sh: New file.
17581 * Makefile.in, testsuite/Makefile.in: Rebuild.
17584 Fix problems building gold with gcc 4.3.0.
17585 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17586 (gold_error_at_location, gold_warning_at_location): Use it.
17587 * configure.ac: Check whether we can compile and use a template
17588 function with a printf attribute.
17589 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17590 when jumping over bytes.
17591 * object.cc: Instantiate Object::read_section_data.
17592 * debug.h: Include <cstring>
17593 * dwarf_reader.cc: Include <algorithm>
17594 * main.cc: Include <cstring>.
17595 * options.cc: Include <cstring>.
17596 * output.cc: Include <cstring>.
17597 * script.cc: Include <cstring>.
17598 * script.h: Include <string>.
17599 * symtab.cc: Include <cstring> and <algorithm>.
17600 * target-select.cc: Include <cstring>.
17601 * version.cc: Include <string>.
17602 * testsuite/testmain.cc: Include <cstdlib>.
17603 * configure, config.in: Rebuild.
17605 2008-03-25 Ian Lance Taylor <iant@google.com>
17607 * options.cc: Include "../bfd/bfdver.h".
17608 (options::help): Print bug reporting address.
17610 * version.cc (print_version): Adjust output for current value of
17611 BFD_VERSION_STRING.
17615 * options.cc (options::help): Print list of supported targets.
17616 * target-select.h: Include <vector>.
17617 (class Target_selector): Make machine_, size_, and is_big_endian_
17618 fields const. Add bfd_name_ and instantiated_target_ fields.
17619 (Target_selector::Target_selector): Add bfd_name parameter.
17620 (Target_selector::recognize): Make non-virtual, call
17622 (Target_selector::recognize_by_name): Make non-virtual, call
17623 do_recognize_by_name.
17624 (Target_selector::supported_names): New function.
17625 (Target_selector::bfd_name): New function.
17626 (Target_selector::do_instantiate_target): New pure virtual
17628 (Target_selector::do_recognize): New virtual function.
17629 (Target_selector::do_recognize_by_name): New virtual function.
17630 (Target_selector::instantiate_target): New private function.
17631 (supported_target_names): Declare.
17632 * target-select.cc (Target_selector::Target_selector): Update for
17633 new parameter and fields.
17634 (select_target_by_name): Check that the name matches before
17635 calling recognize_by_name.
17636 (supported_target_names): New function.
17637 * i386.cc (class Target_selector_i386): Update Target_selector
17638 constructor call. Remove recognize and recognize_by_name. Add
17639 do_instantiate_target.
17640 * x86_64.cc (class Target_selector_x86_64): Likewise.
17641 * testsuite/testfile.cc (class Target_selector_test): Update for
17642 changes to Target_selector.
17644 * README: Rewrite, with some notes on unsupported features.
17646 2008-03-24 Cary Coutant <ccoutant@google.com>
17648 * i386.cc (Target_i386::Got_type): New enum declaration.
17649 (Target_i386::Scan::local): Updated callers of Output_data_got
17651 (Target_i386::Scan::global): Likewise.
17652 (Target_i386::Relocate::relocate): Likewise.
17653 (Target_i386::Relocate::relocate_tls): Likewise.
17654 * object.h (Got_offset_list): New class.
17655 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17656 (Sized_relobj::local_got_offset): Likewise.
17657 (Sized_relobj::set_local_got_offset): Likewise.
17658 (Sized_relobj::local_has_tls_got_offset): Removed.
17659 (Sized_relobj::local_tls_got_offset): Removed.
17660 (Sized_relobj::set_local_tls_got_offset): Removed.
17661 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17662 * output.cc (Output_data_got::add_global): Added got_type parameter.
17663 (Output_data_got::add_global_with_rel): Likewise.
17664 (Output_data_got::add_global_with_rela): Likewise.
17665 (Output_data_got::add_global_pair_with_rel): New function.
17666 (Output_data_got::add_global_pair_with_rela): New function.
17667 (Output_data_got::add_local): Added got_type parameter.
17668 (Output_data_got::add_local_with_rel): Likewise.
17669 (Output_data_got::add_local_with_rela): Likewise.
17670 (Output_data_got::add_local_pair_with_rel): New function.
17671 (Output_data_got::add_local_pair_with_rela): New function.
17672 (Output_data_got::add_global_tls): Removed.
17673 (Output_data_got::add_global_tls_with_rel): Removed.
17674 (Output_data_got::add_global_tls_with_rela): Removed.
17675 (Output_data_got::add_local_tls): Removed.
17676 (Output_data_got::add_local_tls_with_rel): Removed.
17677 (Output_data_got::add_local_tls_with_rela): Removed.
17678 * output.h (Output_data_got::add_global): Added got_type parameter.
17679 (Output_data_got::add_global_with_rel): Likewise.
17680 (Output_data_got::add_global_with_rela): Likewise.
17681 (Output_data_got::add_global_pair_with_rel): New function.
17682 (Output_data_got::add_global_pair_with_rela): New function.
17683 (Output_data_got::add_local): Added got_type parameter.
17684 (Output_data_got::add_local_with_rel): Likewise.
17685 (Output_data_got::add_local_with_rela): Likewise.
17686 (Output_data_got::add_local_pair_with_rel): New function.
17687 (Output_data_got::add_local_pair_with_rela): New function.
17688 (Output_data_got::add_global_tls): Removed.
17689 (Output_data_got::add_global_tls_with_rel): Removed.
17690 (Output_data_got::add_global_tls_with_rela): Removed.
17691 (Output_data_got::add_local_tls): Removed.
17692 (Output_data_got::add_local_tls_with_rel): Removed.
17693 (Output_data_got::add_local_tls_with_rela): Removed.
17694 * resolve.cc (Symbol::override_base_with_special): Removed
17695 reference to has_got_offset_ field.
17696 * symtab.cc (Symbol::init_fields): Replaced initialization
17697 of got_offset_ with got_offsets_. Removed initialization
17699 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
17700 (Symbol::got_offset): Likewise.
17701 (Symbol::set_got_offset): Likewise.
17702 (Symbol::has_tls_got_offset): Removed.
17703 (Symbol::tls_got_offset): Removed.
17704 (Symbol::set_tls_got_offset): Removed.
17705 (Symbol::got_offset_): Removed.
17706 (Symbol::tls_mod_got_offset_): Removed.
17707 (Symbol::tls_pair_got_offset_): Removed.
17708 (Symbol::got_offsets_): New field.
17709 (Symbol::has_got_offset): Removed.
17710 (Symbol::has_tls_mod_got_offset): Removed.
17711 (Symbol::has_tls_pair_got_offset): Removed.
17712 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17713 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17715 (Target_x86_64::Scan::global): Likewise.
17716 (Target_x86_64::Relocate::relocate): Likewise.
17717 (Target_x86_64::Relocate::relocate_tls): Likewise.
17719 2008-03-25 Ben Elliston <bje@au.ibm.com>
17721 * yyscript.y: Fix spelling error in comment.
17723 2008-03-24 Ian Lance Taylor <iant@google.com>
17725 * options.h (class General_options): Define build_id option.
17726 * layout.h (class Layout): Declare write_build_id, create_note,
17727 create_build_id. Add build_id_note_ member.
17728 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17729 "libiberty.h", "md5.h", "sha1.h".
17730 (Layout::Layout): Initialize eh_frame_data_,
17731 eh_frame_hdr_section_, and build_id_note_.
17732 (Layout::finalize): Call create_build_id.
17733 (Layout::create_note): New function, broken out of
17734 Layout::create_gold_note.
17735 (Layout::create_gold_note): Call create_note.
17736 (Layout::create_build_id): New function.
17737 (Layout::write_build_id): New function.
17738 (Close_task_runner::run): Call write_build_id.
17740 * x86_64.cc: Correct license to GPLv3.
17742 2008-03-23 Ian Lance Taylor <iant@google.com>
17744 * options.cc: Include "demangle.h".
17745 (parse_optional_string): New function.
17746 (parse_long_option): Handle takes_optional_argument.
17747 (parse_short_option): Update dash_z initializer. Handle
17748 takes_optional_argument.
17749 (General_options::General_options): Initialize do_demangle_.
17750 (General_options::finalize): Set do_demangle_. Handle demangling
17752 * options.h (parse_optional_string): Declare.
17753 (struct One_option): Add optional_arg field. Update constructor.
17754 Update call constructor calls. Add takes_optional_argument
17756 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17757 (DEFINE_optional_string): Define.
17758 (General_options::demangle): Change from DEFINE_bool to
17759 DEFINE_optional_string.
17760 (General_options::no_demangle): New function.
17761 (General_options::do_demangle): New function.
17762 (General_options::set_do_demangle): New function.
17763 (General_options::execstack_status_): Move definition to end of
17765 (General_options::static_): Likewise.
17766 (General_options::do_demangle_): New field.
17767 * object.cc (big_endian>::get_symbol_location_info): Call
17768 Options::do_demangle, not Options::demangle.
17769 * symtab.cc (demangle): Likewise.
17771 2008-03-22 Ian Lance Taylor <iant@google.com>
17773 * gold.h: Include <cstddef> and <sys/types.h>
17774 * options.h: Include <cstring>.
17776 2008-03-21 Ian Lance Taylor <iant@google.com>
17778 * Added source code to GNU binutils.
17780 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17782 Copying and distribution of this file, with or without modification,
17783 are permitted in any medium without royalty provided the copyright
17784 notice and this notice are preserved.
17790 version-control: never