1 2015-07-20 Yiran Wang <yiran@google.com>
2 Cary Coutant <ccoutant@gmail.com>
5 * resolve.cc (Symbol_table): Remove warning about references
6 from shared objects to hidden symbols.
7 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
8 * testsuite/Makefile.in: Regenerate.
9 * testsuite/hidden_test.sh: Check dynamic symbol table; update
10 expected error messages.
12 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
14 * compressed_output.cc (Output_compressed_section::set_final_data_size):
15 Make --compress-debug-sections=zlib the same as
16 --compress-debug-sections=zlib-gabi.
17 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
18 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
20 * testsuite/Makefile.in: Regenerated.
22 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
25 * compressed_output.cc (zlib_compress): Add argument for
26 compression header size. Set header size to compression header
27 size if it isn't 0. Don't write out the zlib header here.
28 (Output_compressed_section::set_final_data_size): Support
29 zlib-gnu and zlib-gabi compressions. Pass compression header
30 size to zlib_compress and write out compression header. Set
31 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
32 clear the SHF_COMPRESSED bit
33 * options.h (compress_debug_sections): Add zlib-gnu and
35 * output.h (Output_section::set_flags): New.
36 * testsuite/Makefile.am (check_PROGRAMS): Add
37 flagstest_compress_debug_sections_none,
38 flagstest_compress_debug_sections_gnu and
39 flagstest_compress_debug_sections_gabi.
40 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
41 flagstest_compress_debug_sections.stdout,
42 flagstest_compress_debug_sections.cmp,
43 flagstest_compress_debug_sections.check,
44 flagstest_compress_debug_sections_gnu.stdout,
45 flagstest_compress_debug_sections_gnu.cmp,
46 flagstest_compress_debug_sections_gnu.check,
47 flagstest_compress_debug_sections_gabi.stdout,
48 flagstest_compress_debug_sections_gabi.cmp and
49 flagstest_compress_debug_sections_gabi.check.
50 (flagstest_compress_debug_sections_none): New.
51 (flagstest_compress_debug_sections_none.stdout): Likewise.
52 (flagstest_compress_debug_sections.stdout): Likewise.
53 (flagstest_compress_debug_sections.check): Likewise.
54 (flagstest_compress_debug_sections.cmp): Likewise.
55 (flagstest_compress_debug_sections_gnu): Likewise.
56 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
57 (flagstest_compress_debug_sections_gnu.check): Likewise.
58 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
59 (flagstest_compress_debug_sections_gabi): Likewise.
60 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
61 (flagstest_compress_debug_sections_gnu.check): Likewise.
62 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
63 * testsuite/Makefile.in: Regenerated.
65 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
68 * compressed_output.h (decompress_input_section): Add arguments
69 for ELF class, big endian and sh_flags.
70 * compressed_output.cc (decompress_input_section): Likewise.
71 Support the SHF_COMPRESSED section.
72 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
74 * plugin.h (Pluginobj): Likewise.
75 * layout.cc (Layout::get_output_section_flags): Also clear the
77 * object.h (Compressed_section_info): Add flag to store sh_flags.
78 (Object): Add pure virtual elfsize and is_big_endian member
80 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
82 (build_compressed_section_map): Check SHF_COMPRESSED for
83 uncompressed size. Store sh_flags in Compressed_section_info.
84 Pass size, big_endian and sh_flags to decompress_input_section.
85 Skip the ".debug"/".zdebug" prefix when passing section name to
86 need_decompressed_section.
87 (Sized_relobj_file<size, big_endian>::do_find_special_section):
88 Don't check ".zdebug_*" sections.
89 (Object::decompressed_section_contents): Pass ELF class, big
90 endian and sh_flags to decompress_input_section.
91 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
93 * testsuite/Makefile.am (check_DATA): Add
94 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
95 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
96 gdb_index_test_2_gabi.stdout.
97 (debug_msg_cdebug_gabi.o): New.
98 (odr_violation1_cdebug_gabi.o): Likewise.
99 (odr_violation2_cdebug_gabi.o): Likewise.
100 (debug_msg_cdebug_gabi.err): Likewise.
101 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
102 (gdb_index_test_cdebug_gabi.o): Likewise.
103 (gdb_index_test_2_gabi): Likewise.
104 (gdb_index_test_2_gabi.stdout): Likewise.
105 * testsuite/gdb_index_test_2_gabi.sh: New file.
106 * testsuite/Makefile.in: Regenerated.
108 2015-07-09 Han Shen <shenhan@google.com>
110 Use "gold_info" instead of "gold_warning" for erratum fix.
112 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
114 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
116 2015-07-09 Han Shen <shenhan@google.com>
118 Drop missing symbol warning for arm/aarch64.
120 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
121 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
124 2015-07-07 Han Shen <shenhan@google.com>
126 Make gold aarch64 accept long form of mapping symbols.
128 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
131 2015-06-29 Doug Kwan <dougkwan@google.com>
133 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
134 at address expected by test.
135 * testsuite/arm_cortex_a8_b.s: Ditto.
136 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
137 * testsuite/arm_cortex_a8_bl.s: Ditto.
138 * testsuite/arm_cortex_a8_blx.s: Ditto.
139 * testsuite/arm_cortex_a8_local.s: Ditto.
140 * testsuite/arm_fix_v4bx.s: Ditto.
141 * testsuite/arm_unaligned_reloc.s: Ditto.
142 * testsuite/thumb_bl_out_of_range.s: Ditto.
143 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
144 * testsuite/thumb_blx_out_of_range.s: Ditto.
146 2015-06-29 Han Shen <shenhan@google.com>
148 Patch for erratum 843419 internal error.
150 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
151 (Erratum_stub::update_erratum_insn): New method.
152 (Stub_table::relocate_stubs): Modified to place relocated insn.
153 (AArch64_relobj::fix_errata): Modified gold_assert.
155 2015-06-12 Han Shen <shenhan@google.com>
159 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
160 defintion outside class definition.
161 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
162 (AArch64_insn_utilities::aarch64_op31): New member.
163 (AArch64_insn_utilities::aarch64_ra): New member.
164 (AArch64_insn_utilities::aarch64_mac): New member.
165 (AArch64_insn_utilities::aarch64_mlxl): New member.
166 (ST_E_835769): New global enum member.
167 (Stub_table::relocate_stubs): Add 835769 handler.
168 (Stub_template_repertoire::Stub_template_repertoire): Install new
170 (AArch64_relobj::scan_errata): This func is renamed from
172 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
173 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
174 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
175 (Target_aarch64::scan_erratum_835769_span): New method.
176 (Target_aarch64::create_erratum_stub): New method.
177 (Target_aarch64::is_erratum_835769_sequence): New method.
178 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
179 code into create_erratum_stub.
180 * options.h (fix_cortex_a53_835769): New option.
182 2015-06-11 Cary Coutant <ccoutant@gmail.com>
184 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
186 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
188 2015-06-11 Cary Coutant <ccoutant@gmail.com>
191 * layout.cc (corresponding_uncompressed_section_name): New function.
192 (Layout::choose_output_section): Call it.
193 * layout.h (corresponding_uncompressed_section_name): New function.
194 * script-sections.cc (Input_section_info::set_section_name): Check
195 for compressed debug section (.zdebug style).
197 2015-06-11 Jing Yu <jingyu@google.com>
199 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
200 * testsuite/Makefile.in: Regenerate.
202 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
204 * gold.h (is_cident): Correct typo.
206 2015-06-10 Han Shen <shenhan@google.com>
207 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
209 Now fixing for 843419 is fully functional.
211 The first part of the erratum fix CL is here -
212 https://sourceware.org/ml/binutils/2015-04/msg00229.html
214 * aarch64.cc(global enum): New constants representing stub types.
215 (Stub_template): New POD struct.
216 (Stub_template_repertoire): New class.
217 (Stub_base): New class.
218 (Erratum_stub): New class.
219 (Reloc_stub): Refactored to be a subclass of Stub_base.
220 (Reloc_stub::Stub_type): Removed.
221 (Reloc_stub::offset): Moved to Stub_base.
222 (Reloc_stub::set_offset): Moved to Stub_base.
223 (Reloc_stub::destination_address): Moved to Stub_base.
224 (Reloc_stub::set_destination_address): Moved to Stub_base.
225 (Reloc_stub::reset_destination_address): Moved to Stub_base.
226 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
227 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
228 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
229 (Reloc_stub::write): Moved to Stub_base.
230 (Reloc_stub::invalid_offset): Moved to Stub_base.
231 (Reloc_stub::invalid_address): Moved to Stub_base.
232 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
233 (Reloc_stub::stub_insns_): Moved to Stub_base.
234 (Reloc_stub::offset_): Moved to Stub_base.
235 (Reloc_stub::destination_address_): Moved to Stub_base.
236 (Stub_table::The_aarch64_relobj): New typedef.
237 (Stub_table::The_erratum_stub): New typedef.
238 (Stub_table::The_erratum_stub_less): New typedef.
239 (Stub_table::The_erratum_stub_set): New typedef.
240 (Stub_table::The_erratum_stub_set_iter): New typedef.
241 (Stub_table::empty): Added emptiness testing for erratum stubs.
242 (Stub_table::add_erratum_stub): New method to add an erratum stub.
243 (Stub_table::find_erratum_stub): New method.
244 (Stub_table::find_erratum_stubs_for_input_section): New method.
245 (Stub_table::erratum_stub_address): New method.
246 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
247 (Stub_table::do_addralign): Modified to handle erratum stubs.
248 (Stub_table::erratum_stubs_): New member.
249 (Stub_table::erratum_stub_size_): New member.
250 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
251 (Stub_table::do_write): Modified to handle erratum stubs.
252 (AArch64_relobj::The_erratum_stub): New typedef.
253 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
254 (AArch64_relobj::fix_errata): New method.
255 (Target_aarch64::The_reloc_stub_type): Removed.
256 (Target_aarch64::The_erratum_stub): New typede.
257 (AArch64_relocate_functions::construct_b): New method.
259 2015-06-08 Nick Clifton <nickc@redhat.com>
261 * po/fr.po: New French Translation.
263 2015-06-07 Cary Coutant <ccoutant@gmail.com>
266 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
267 callers. Don't use STT_COMMON to check for common symbols.
268 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
269 symbol that's not in a common section.
270 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
273 2015-06-04 Cary Coutant <ccoutant@gmail.com>
276 * Makefile.am (diststuff): Add target.
277 * Makefile.in: Regenerate.
279 2015-06-04 Cary Coutant <ccoutant@gmail.com>
282 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
283 temporary locals in merge sections.
284 * options.cc (General_options::parse_discard_all): New method.
285 (General_options::parse_discard_locals): New method.
286 (General_options::parse_discard_none): New method.
287 (General_options::General_options): Initialize discard_locals_.
288 * options.h (--discard-all): Convert to special option.
289 (--discard-locals): Likewise.
290 (--discard-none): New option.
291 (General_options::discard_all): New method.
292 (General_options::discard_locals): New method.
293 (General_options::discard_sec_merge): New method.
294 (General_options::Discard_locals): New enum.
295 (General_options::discard_locals_): New data member.
297 2015-06-03 Cary Coutant <cary@google.com>
299 * script-sections.cc (Script_sections::Script_sections): Initialize
301 (Script_sections::create_note_and_tls_segments): Set flag when
302 segments are created.
303 (Script_sections::expected_segment_count): Count PT_INTERP.
304 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
305 segments are created.
306 * script-sections.h (Script_sections::segments_created_): New data
309 2015-06-03 Cary Coutant <ccoutant@gmail.com>
313 (Output_section_element_input::set_section_addresses): When there
314 are several patterns with no sort spec, put all sections in the same
316 * testsuite/Makefile.am (script_test_12): New testcase.
317 (script_test_12i): New testcase.
318 * testsuite/Makefile.in: Regenerate.
319 * testsuite/script_test_12.t: New test linker script.
320 * testsuite/script_test_12i.t: New test linker script.
321 * testsuite/script_test_12a.c: New test source file.
322 * testsuite/script_test_12b.c: New test source file.
324 2015-06-02 Cary Coutant <ccoutant@gmail.com>
326 * nacl.h (Sniff_file): Switch parameters to get_view to get an
329 2015-06-03 Cary Coutant <ccoutant@gmail.com>
332 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
333 separate task to schedule the build id computation.
334 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
335 add Output_file and offset.
336 (Hash_task::run): Get and release the input views.
337 (Hash_task::is_runnable): Always return NULL (always runnable).
338 (Layout::queue_build_id_tasks): Remove.
339 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
340 parameters; use them instead of class members.
341 (Build_id_task_runner::run): New function.
342 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
344 * layout.h (Layout::queue_build_id_tasks): Remove.
345 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
347 (Layout::array_of_hashes_): Remove.
348 (Layout::size_of_array_of_hashes_): Remove.
349 (Layout::input_view_): Remove.
350 (Build_id_task_runner): New class.
351 (Close_task_runner::Close_task_runner): Add array_of_hashes and
352 size_of_hashes parameters.
353 (Close_task_runner::array_of_hashes_): New data member.
354 (Close_task_runner::size_of_hashes_): New data member.
355 * testsuite/Makefile.am
356 (flagstest_compress_debug_sections_and_build_id_tree): New test.
357 * testsuite/Makefile.in: Regenerate.
359 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
361 * merge.cc (get_input_merge_map): Update for data structure change.
362 (get_or_make_input_merge_map): Update for data structure change.
363 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
364 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
366 2015-05-16 Alan Modra <amodra@gmail.com>
368 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
369 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
370 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
371 (lis_0): Rename from lis_0_0.
373 2015-04-29 Cary Coutant <cary@google.com>
374 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
376 * gc.h (Garbage_collection::is_section_garbage): Change Object*
378 (Garbage_collection::add_reference): Likewise.
379 (Garbage_collection::gc_process_relocs): Likewise. Don't push
380 object/shndx pair onto *secvec for dynamic objects. Don't follow
381 relocations pointing to dynamic objects for GC.
382 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
383 (Icf::unfold_section): Likewise.
384 (Icf::is_section_folded): Likewise.
385 (Icf::get_folded_section): Likewise.
386 * icf.h: (Icf::get_folded_section): Likewise.
387 (Icf::unfold_section): Likewise.
388 (Icf::is_section_folded): Likewise.
389 (Icf::section_has_function_pointers): Likewise.
390 (Icf::set_section_has_function_pointers): Likewise.
391 * object.h (Section_id): Likewise.
392 (Const_section_id): Likewise.
393 * output.cc (Output_section::update_section_layout): Likewise.
394 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
396 * plugin.cc (update_section_order): Likewise.
397 (unique_segment_for_sections): Likewise.
398 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
399 (Target_powerpc::do_gc_add_reference): Likewise.
400 (Target_powerpc::gc_process_relocs): Likewise.
401 (Target_powerpc::do_gc_add_reference): Likewise.
402 * symtab.cc (Symbol_table::is_section_folded): Likewise.
403 (Symbol_table::gc_mark_symbol): Likewise.
404 * symtab.h: (Symbol_table::is_section_folded): Likewise.
405 * target.h: (Sized_target::gc_add_reference): Likewise.
406 (Sized_target::do_gc_add_reference): Likewise.
408 2015-04-29 Nick Clifton <nickc@redhat.com>
410 * po/fi.po: Updated Finnish translation.
412 2015-04-28 Alan Modra <amodra@gmail.com>
414 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
415 than unsigned int for find_global_entry result temp. Compare
416 against invalid_address.
417 (Target_powerpc::do_plt_address_for_global): Likewise.
418 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
419 on plt call stub existence for debug info. Do assert for plt
420 and global entry stub existence if an alloc section.
422 2015-04-28 Alan Modra <amodra@gmail.com>
424 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
425 on missing global entry stub due to bogus debug info.
427 2015-04-27 Han Shen <shenhan@google.com>
429 * options.h (--fix-cortex-a53-843419): Rename option.
430 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
432 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
434 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
437 * output.cc (Output_section::is_input_address_mapped): Assume a missing
439 * testsuite/Makefile.am: Add the eh_test test.
440 * testsuite/Makefile.in: Regenerate.
441 * testsuite/eh_test_a.cc: New test.
442 * testsuite/eh_test_b.cc: New test.
444 2015-04-23 Sriraman Tallam <tmsriram@google.com>
446 * options.h (--weak-unresolved-symbols): New option.
447 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
448 binding to weak with new option.
449 * symtab.h (is_weak_undefined): Check for new option.
450 (is_strong_undefined): Check for new option.
451 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
452 * testsuite/Makefile.in: Regenerate.
453 * testsuite/weak_unresolved_symbols_test.cc: New file.
455 2015-04-20 Ian Coolidge <icoolidge@google.com>
457 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
460 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
462 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
464 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
465 * object.cc (Sized_relobj_file::do_layout): Use push_back.
466 * powerpc.cc (process_gc_mark): Use push_back.
467 (Target_powerpc::do_gc_mark_symbol): Use push_back.
468 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
470 2015-04-16 Han Shen <shenhan@google.com>
472 * aarch64.cc (AArch64_insn_utilities): New utility class.
473 (AArch64_relobj::Mapping_symbol_position): New struct.
474 (AArch64_relobj::Mapping_symbol_info): New typedef.
475 (AArch64_relobj::do_count_local_symbols): New function overriding
476 parent's implementation.
477 (AArch64_relobj::mapping_symbol_info_): New member
478 (AArch64_relobj::scan_erratum_843419): New method.
479 (Target_aarch64::scan_erratum_843419_span): New method.
480 (Target_aarch64::is_erratum_843419_sequence): New method.
481 * options.h (fix_cortex_a53): New option.
483 2015-04-09 Cary Coutant <ccoutant@google.com>
485 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
487 * testsuite/Makefile.am (tls_pie_test.sh): New test.
488 * testsuite/Makefile.in: Regenerate.
489 * testsuite/tls_pie_test.sh: New.
491 2015-04-09 Cary Coutant <ccoutant@google.com>
493 * debug.h (DEBUG_LOCATION): New.
494 (DEBUG_ALL): Include DEBUG_LOCATION.
495 (debug_string_to_enum): Add DEBUG_LOCATION.
496 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
497 output to print correct context.
498 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
499 up to 4 more locations at the beginning of the function.
500 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
501 result before sorting list of line numbers.
502 * testsuite/debug_msg.sh: Allow range of line numbers for
503 canonical results on optimized code.
505 2015-04-07 HC Yen <hc.yen@mediatek.com>
507 Add AArch32 support for gold linker.
509 * arm.cc: Add V8 arch combine table.
511 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
513 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
515 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
517 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
518 to find by using the return value of insert.
520 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
522 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
525 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
528 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
529 (Target_x86_64::Scan::local): Don't create GOT entry, when we
530 can convert mov to lea.
531 (Target_x86_64::Scan::global): Ditto.
532 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
533 %reg to lea foo(%rip), %reg if possible.
534 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
535 * testsuite/x86_64_mov_to_lea1.s: New.
536 * testsuite/x86_64_mov_to_lea2.s: Ditto.
537 * testsuite/x86_64_mov_to_lea3.s: Ditto.
538 * testsuite/x86_64_mov_to_lea4.s: Ditto.
539 * testsuite/x86_64_mov_to_lea.sh: Ditto.
541 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
543 * configure: Regenerated.
545 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
548 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
549 (Target_i386::Scan::local): Don't create GOT entry, when we
550 can convert GOT to GOTOFF.
551 (Target_i386::Scan::global): Ditto.
552 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
553 lea foo@GOTOFF(%reg), %reg if possible.
554 * testsuite/Makefile.am (i386_mov_to_lea): New test.
555 * testsuite/i386_mov_to_lea1.s: New.
556 * testsuite/i386_mov_to_lea2.s: Ditto.
557 * testsuite/i386_mov_to_lea3.s: Ditto.
558 * testsuite/i386_mov_to_lea4.s: Ditto.
559 * testsuite/i386_mov_to_lea5.s: Ditto.
560 * testsuite/i386_mov_to_lea.sh: Ditto.
562 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
564 * Makefile.am (ZLIB): New.
566 (AM_CFLAGS): Add $(ZLIBINC).
567 (AM_CXXFLAGS): Likewise.
568 (ldadd_varldadd_var): Add $(ZLIB).
569 (incremental_dump_LDADD): Likewise.
570 (dwp_LDADD): Likewise.
571 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
573 (zlib_compress): Don't check HAVE_ZLIB_H.
574 (zlib_decompress): Likewise.
575 * options.h (compress_debug_sections): Likewise.
576 * configure.ac (AM_CONDITIONAL): Removed.
577 * testsuite/Makefile.am (ZLIB): New.
578 (LDADD): Add $(ZLIB).
579 Don't check HAVE_ZLIB.
580 * Makefile.in: Regenerated.
581 * config.in: Likewise.
582 * configure: Likewise.
583 * testsuite/Makefile.in: Likewise.
585 2015-03-30 Jing Yu <jingyu@google.com>
587 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
588 TLSLD_ADD_DTPREL_LO12_NC.
589 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
590 _TLS_MODULE_BASE_ point to the start of tls segment.
591 (Target_aarch64::optimize_tls_reloc): Add cases for
592 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
593 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
594 (Target_aarch64::Scan::local): Likewise.
595 (Target_aarch64::Scan::global): Likewise.
596 (Target_aarch64::Relocate::relocate): Likewise.
597 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
598 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
601 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
603 * merge.cc (Object_merge_map::add_mapping): call
604 Object_merge_map::Input_merge_map::add_mapping.
605 (Object_merge_map::Input_merge_map::add_mapping): New.
606 (Output_merge_data::do_add_input_section): Call
607 get_or_make_input_merge_map before a loop.
608 (Output_merge_string<Char_type>::finalize_merged_data): Call
609 get_or_make_input_merge_map before a loop.
610 * merge.h (Object_merge_map): Make Input_merge_map public.
611 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
612 (Relobj::get_or_create_merge_map): New.
613 * object.h (Relobj::get_or_create_merge_map): New.
615 2015-03-24 Alan Modra <amodra@gmail.com>
618 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
619 relocation errors for branches to strong undefined symbols.
621 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
623 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
624 (Object_merge_map::is_merge_section_for): Remove.
625 (Object_merge_map::find_merge_section): New.
626 * merge.h (Object_merge_map::is_merge_section_for): Remove.
627 (Object_merge_map::find_merge_section): New.
628 (Object_merge_map::get_input_merge_map): Add a const version.
629 * object.cc (Relobj::is_merge_section_for): Remove.
630 (Relobj::find_merge_section): New.
631 * object.h (Relobj::is_merge_section_for): Remove.
632 (Relobj::find_merge_section): New.
634 (Output_section::Input_section::is_merge_section_for): Remove.
635 (Output_section::add_merge_input_section): Don't call
636 add_merge_input_section.
637 (Output_section::find_merge_section): Return const. Use
638 object->find_merge_section.
639 (Output_section::build_lookup_maps): Don't build a map for
641 (Output_section::is_input_address_mapped): Return false if
642 section is not found.
643 (Output_section::find_starting_output_address): Use
644 find_merge_section instead of is_merge_section_for.
645 (Output_section::add_script_input_section): Don't build a map for
647 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
648 (Output_section_lookup_maps::find_merge_section): Remove.
649 (Output_section_lookup_maps::add_merge_input_section) Remove.
650 (Output_section::find_merge_section): Return const.
652 2015-03-22 Cary Coutant <cary@google.com>
655 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
656 non-SIB form of lea, with nop after the call.
658 2015-03-21 Cary Coutant <cary@google.com>
661 * output.cc (Output_segment::is_first_section_relro): Don't ignore
663 (Output_segment::set_section_addresses): Don't align size of relro
666 2015-03-21 Cary Coutant <cary@google.com>
669 * stringpool.cc (Stringpool_template): Don't optimize if section
670 alignment is greater than sizeof(char).
672 2015-03-21 Cary Coutant <cary@google.com>
675 * script-c.h (script_include_directive): Add first_token parameter.
676 * script.cc (script_include_directive): Add first_token parameter, and
677 pass it to read_script_file.
678 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
679 (PARSING_MEMORY_DEF): New tokens.
680 (top): Add new productions for INCLUDE files.
681 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
682 Pass PARSING_LINKER_SCRIPT to script_include_directive.
683 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
684 (section_cmd): Pass PARSING_SECTION_CMDS.
685 (file_or_sections_cmd): Remove.
686 (memory_def): Pass PARSING_MEMORY_DEF.
687 * testsuite/Makefile.am (memory_test_2): New test.
688 * testsuite/Makefile.in: Regenerate.
689 * testsuite/memory_test_inc.t: New script file.
690 * testsuite/memory_test_inc_1.t.src: New script file.
691 * testsuite/memory_test_inc_2.t.src: New script file.
692 * testsuite/memory_test_inc_3.t.src: New script file.
694 2015-03-21 Cary Coutant <cary@google.com>
696 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
697 (Sized_relobj_dwo::setup): Build compressed section map.
698 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
699 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
701 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
702 compressed_sections_ field.
703 (build_compressed_section_map): Take Object instead of
704 Sized_relobj_file parameter; add decompress_if_needed parameter.
705 (Sized_relobj_file::do_find_special_sections): Store compressed
706 section map in parent Object.
707 (Sized_relobj_file::do_decompressed_section_contents): Move
708 implementation to Object::decompressed_section_contents.
709 (Sized_relobj_file::do_discard_decompressed_sections): Move
710 implementation to Object::discard_decompressed_sections.
711 * object.h (build_compressed_section_map): Declare.
712 (Object::Object): Add compressed_sections_ field.
713 (Object::section_is_compressed): Move implementation here.
714 (Object::decompressed_section_contents): De-virtualize.
715 (Object::discard_decompressed_sections): De-virtualize.
716 (Object::do_section_is_compressed): Delete.
717 (Object::do_decompressed_section_contents): Delete.
718 (Object::set_compressed_sections): New method.
719 (Object::compressed_sections): New method.
720 (Object::compressed_sections_): New data member.
721 (Compressed_section_info, Compressed_section_map): Move to top of file.
722 (Sized_relobj_file::do_section_is_compressed): Delete.
723 (Sized_relobj_file::do_decompressed_section_contents): Delete.
724 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
725 (Sized_relobj_file::compressed_sections_): Move to Object class.
727 2015-03-21 Cary Coutant <ccoutant@google.com>
730 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
733 2015-03-11 Cary Coutant <ccoutant@google.com>
735 * options.cc (General_options::finalize): Don't allow -z relro
736 with incremental linking.
737 * testsuite/Makefile.am (incremental_test): Add -z norelro.
738 (incremental_test_2): Likewise.
739 (incremental_test_3): Likewise.
740 (incremental_test_4): Likewise.
741 (incremental_test_5): Likewise.
742 (incremental_test_6): Likewise.
743 (incremental_copy_test): Likewise.
744 (incremental_common_test_1): Likewise.
745 (incremental_comdat_test_1): Likewise.
746 * testsuite/Makefile.in: Regenerate.
748 2015-03-09 Cary Coutant <ccoutant@google.com>
751 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
752 return enum indicating whether .eh_frame section is empty, optimizable,
753 unrecognized, or an end marker. Adjust explicit instantiations.
754 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
755 (Eh_frame::add_ehframe_input_section): Change return type.
756 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
757 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
758 to the .eh_frame output section until we see the end marker.
759 (Layout::finalize_eh_frame_section): New.
760 * layout.h: (Layout::finalize_eh_frame_section): New.
762 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
764 * output.cc (Relobj::initialize_input_to_output_map<size>):
765 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
767 2015-03-04 Cary Coutant <ccoutant@google.com>
769 * parameters.cc (Parameters::set_target_once): Call
770 Target::select_as_default_target just once from here...
771 (set_parameters_target): ...instead of from here.
773 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
775 * ehframe.cc (Cie::set_output_offset): Pass in and use a
776 Output_section_data instead of a Merge_map.
777 (Eh_frame::Eh_frame): Don't initialize merge_map_.
778 (Eh_frame::read_cie): Use add_merge_mapping instead of
779 Merge_map::add_mapping.
780 (Eh_frame::read_fde): Ditto.
781 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
782 (Eh_frame::do_output_offset): Use merge_output_offset istead of
783 merge_map_->get_output_offset.
784 (Eh_frame::do_is_merge_section_for): Delete.
785 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
786 instead of a Merge_map.
787 (Cie::set_output_offset): Pass in a Output_section_data instead of a
789 (Eh_frame::do_is_merge_section_for): Delete.
790 (Eh_frame::merge_map_): Delete.
791 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
792 and use a Output_section_data instead of a Merge_map.
793 (Object_merge_map::add_mapping): Ditto.
794 (Object_merge_map::get_output_offset): Remove the merge_map argument.
795 (Object_merge_map::is_merge_section_for): Pass in and use a
796 Output_section_data instead of a Merge_map.
798 (Output_merge_base::do_output_offset): Use merge_output_offset instead
799 of merge_map_.get_output_offset.
800 (Output_merge_base::do_is_merge_section_for): Delete.
801 (Output_merge_data::do_add_input_section): Use
802 object->add_merge_mapping instead of add_mapping.
803 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
804 * merge.h (Merge_map): Delete forward declaration.
805 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
806 instead of a Merge_map.
807 (Object_merge_map::get_output_offset): Remove the merge_map argument.
808 (Object_merge_map::is_merge_section_for): Pass in and use a
809 Output_section_data instead of a Merge_map.
810 (Input_merge_map::Object_merge_map::merge_map): Replace with
812 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
813 Output_section_data instead of a Merge_map.
815 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
816 (Output_merge_base::do_is_merge_section_for): Delete.
817 (Output_merge_base::add_mapping): Delete.
818 (Output_merge_base::merge_map_): Delete.
819 * object.cc (Relobj::initialize_input_to_output_map): New.
820 (Relobj::initialize_input_to_output_map): New.
821 (Relobj::merge_output_offset): New.
822 (Relobj::is_merge_section_for): New.
823 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
825 * object.h (Relobj::merge_map): Delete.
826 (initialize_input_to_output_map): New.
827 (set_merge_map): Delete.
828 (add_merge_mapping): New.
829 (merge_output_offset): New.
830 (is_merge_section_for): New.
831 * output.cc (Output_section::Input_section::is_merge_section_for):
832 Use object->is_merge_section_for.
833 * output.h (Output_section_data::is_merge_section_for): Delete.
834 (Output_section_data::do_is_merge_section_for): Delete.
835 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
836 Use object->initialize_input_to_output_map.
837 (Merged_symbol_value<size>::value_from_output_section): Use
838 object->merge_output_offset.
840 2015-03-02 Peter Collingbourne <pcc@google.com>
841 Cary Coutant <ccoutant@google.com>
843 * output.cc (Output_section::add_merge_input_section): Do not
844 attempt to merge sections with an entsize of 0.
846 2015-03-02 Khem Raj <raj.khem@gmail.com>
848 * attributes.h (class Output_attributes_section_data ): Add
849 do_print_to_mapfile function.
851 2015-02-24 Alan Modra <amodra@gmail.com>
854 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
855 complain if value is not a multiple of four.
856 (Target_powerpc::Relocate::relocate): Correct handling of
857 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
859 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
861 * configure.ac (default_size): Set to 32 for x32.
862 * configure: Regenerated.
864 2015-02-18 Alan Modra <amodra@gmail.com>
867 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
870 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
872 * gc.h (Garbage_collection::add_reference): Don't use find.
874 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
876 * object.cc (write_local_symbols): avoid std::vector copy.
878 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
880 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
882 2015-02-09 Mark Wielaard <mjw@redhat.com>
884 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
885 DW_LANG_Fortran03 and DW_LANG_Fortran08.
887 2015-02-16 Cary Coutant <ccoutant@google.com>
891 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
892 DF_SYMBOLIC if --dynamic-list option is used.
893 * options.cc (General_options::finalize): --dynamic-list is not
894 mutually exclusive with -Bsymbolic.
895 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
896 listed in --dynamic-list.
897 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
898 -Bsymbolic-functions.
899 * testsuite/Makefile.in: Regenerate.
901 2015-02-16 Cary Coutant <ccoutant@google.com>
904 * incremental.cc: Remove redundant include of "output.h".
906 2015-02-12 Jing Yu <jingyu@google.com>
908 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
909 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
911 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
912 TLSLE_MOVW_* relocations.
913 (Target_aarch64::Scan::global): Likewise.
914 (Target_aarch64::Relocate::relocate): Likewise.
915 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
916 for new TLSLE_MOVW_* relocations.
918 2015-02-11 Will Newton <will.newton@linaro.org>
921 * arm.cc (Target_arm::make_plt_section): Create an ARM
922 state mapping symbol at the start of the PLT.
924 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
926 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
927 Replace two_file_shared_2.so with two_file_shared_1.so.
928 * testsuite/Makefile.in: Regenerated.
930 2015-02-09 Alan Modra <amodra@gmail.com>
932 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
933 plugin_test_thin.a and defsym_test.
934 * testsuite/Makefile.in: Regenerate.
936 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
938 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
941 2015-02-04 Peter Collingbourne <pcc@google.com>
943 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
944 forwarding symbols when computing symbol resolution info for plugins.
945 * plugin.h (Plugin_manager::symtab): New method.
946 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
948 2015-02-03 Cary Coutant <ccoutant@google.com>
949 Peter Collingbourne <pcc@google.com>
952 * archive.cc (Thin_archive_object_unlocker): New class.
953 (Archive::include_member): Unlock external members of thin archives.
954 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
955 (plugin_test_2): Likewise.
956 (plugin_test_3): Likewise.
957 (plugin_test_4): Likewise.
958 (plugin_test_5): Likewise.
959 (plugin_test_6): Likewise.
960 (plugin_test_7): Likewise.
961 (plugin_test_8): Likewise.
962 (plugin_test_9): Likewise.
963 (plugin_test_10): Likewise.
964 (plugin_test_11): New test case.
965 * testsuite/Makefile.in: Regenerate.
966 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
967 file to decide whether to claim file.
968 (all_symbols_read_hook): Likewise.
969 * testsuite/plugin_test_1.sh: Adjust expected output.
970 * testsuite/plugin_test_2.sh: Likewise.
971 * testsuite/plugin_test_3.sh: Likewise.
972 * testsuite/plugin_test_6.sh: Likewise.
973 * testsuite/plugin_test_tls.sh: Likewise.
974 * testsuite/plugin_test_11.sh: New testcase.
976 2015-02-03 Cary Coutant <ccoutant@google.com>
978 * descriptors.cc (Descriptors::open): Set artificially-low limit for
979 file descriptors when debugging enabled. Add debug output.
980 (Descriptors::release): Add debug output.
981 (Descriptors::close_some_descriptor): Likewise.
982 (Descriptors::close_all): Likewise.
983 * fileread.cc (File_read::lock): Likewise.
984 (File_read::unlock): Likewise.
986 2015-02-02 Cary Coutant <ccoutant@google.com>
988 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
989 executable output file.
991 2015-01-22 Han Shen <shenhan@google.com>
993 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
994 (Target_arm::do_plt_address_for_global): New method.
995 (Target_arm::do_plt_address_for_local): New method.
996 (Target_arm::rel_irelative_section): New method.
997 (Target_arm::make_data_plt): Add more parameters for plt ctor.
998 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
999 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1000 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1001 (Target_arm::Scan::check_non_pic): Add ifunc support.
1002 (Target_arm::Scan::local): Add ifunc support.
1003 (Target_arm::Scan::global): Add ifunc support.
1004 (Target_arm::make_plt_section): New method.
1005 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1006 (Target_arm::make_local_ifunc_plt_entry): New method.
1007 (Target_arm::got_irelative_): New member.
1008 (Target_arm::rel_irelative_): New member.
1009 (Target_arm::got_section): Add creation for got_irelative_.
1010 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1011 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1012 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1013 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1014 (Output_data_plt_arm::IRelative_data): New type.
1015 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1016 (Output_data_plt_arm::add_entry): Add more parameters.
1017 (Output_data_plt_arm::add_relocation): New method.
1018 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1019 (Output_data_plt_arm::rel_irelative): New method.
1020 (Output_data_plt_arm::entry_count): Modified.
1021 (Output_data_plt_arm::address_for_global): New method.
1022 (Output_data_plt_arm::address_for_local): New method.
1024 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1025 (Output_data_plt_arm::insert_irelative_data): New method.
1026 (Output_data_plt_arm::irelative_rel_): New member.
1027 (Output_data_plt_arm::got_): New member.
1028 (Output_data_plt_arm::got_irelative_): New member.
1029 (Output_data_plt_arm::irelative_count_): New member.
1030 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1031 (Output_data_plt_arm::irelative_data_vec_): New member.
1032 (Output_data_plt_arm::do_write): Write out irelative entries.
1033 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1034 more parameters to ctor.
1035 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1036 more parameters to ctor.
1037 * output.h (Output_data_reloc::add_local_relative): New method.
1038 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1040 2015-01-29 Alan Modra <amodra@gmail.com>
1042 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1043 and GOT_TLSGD to LE optimization.
1045 2015-01-28 Cary Coutant <ccoutant@google.com>
1047 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1048 for undef TLS symbols.
1049 (Target_x86_64::Relocate::relocate_tls): Likewise.
1050 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1052 2015-01-25 Cary Coutant <ccoutant@google.com>
1054 * output.cc (Output_segment::set_section_addresses): Fix calculation
1055 of size of relro segment.
1057 2015-01-22 Alan Modra <amodra@gmail.com>
1059 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1060 condition for need of ifunc plt entry.
1061 (Target_powerpc::Scan::global <got relocs>): Likewise.
1063 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1065 * mips.cc (reloc_high): Add r_sym.
1066 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1067 reloc_high constructor.
1068 (Mips_relocate_functions::relgot16_local): Likewise.
1069 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1070 r_type to decide whether LO16 matches HI16.
1071 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1072 rello16 and relgot16_local.
1074 2015-01-09 Cary Coutant <ccoutant@google.com>
1076 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1077 unless alignment is larger than page size.
1079 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1080 Cary Coutant <ccoutant@google.com>
1083 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1084 (DEFAULT_TARGET_X32): Set for x32.
1085 * x86_64.cc (cmp_insn_32): New.
1086 (lea_r10_insn_32): Likewise.
1087 (lea_r11_insn_32): Likewise.
1088 (cmp_insn_64): Likewise.
1089 (lea_r10_insn_64): Likewise.
1090 (lea_r11_insn_64): Likewise.
1091 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1092 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1093 (check_DATA): Add split_x32 files.
1094 (split_x32_[1234n].o): New targets.
1095 (split_x32_[124]): New targets.
1096 (split_x32_[1234r].stdout): New targets.
1097 * testsuite/split_x32.sh: New file.
1098 * testsuite/split_x32_1.s: Likewise.
1099 * testsuite/split_x32_2.s: Likewise.
1100 * testsuite/split_x32_3.s: Likewise.
1101 * testsuite/split_x32_4.s: Likewise.
1102 * testsuite/split_x32_n.s: Likewise.
1103 * configure: Regenerated.
1104 * testsuite/Makefile.in: Likewise.
1106 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1109 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1112 2015-01-02 Alan Modra <amodra@gmail.com>
1114 * version.cc (print_version): Just print current year.
1115 * dwp.cc (print_version): Likewise.
1117 2015-01-01 Alan Modra <amodra@gmail.com>
1119 Update year range in copyright notice of all files.
1121 2014-12-25 Alan Modra <amodra@gmail.com>
1123 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1125 (Target_arm::merge_object_attributes, ): Likewise.
1127 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1129 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1130 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1131 AEABI_VFP_args_vfp to check that.
1132 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1133 value and replace hardcoded values by enum values.
1135 2014-12-22 Cary Coutant <ccoutant@google.com>
1137 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1139 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1142 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1143 to "return i * i * 3;".
1145 2014-12-16 Cary Coutant <ccoutant@google.com>
1147 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1148 (Mapfile::print_output_data): Use current_data_size() to avoid
1149 assert for sections requiring postprocessing; if address is not valid,
1151 (Mapfile::print_output_section): Use current_data_size(); print note
1152 that addresses and sizes are before compression.
1154 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1156 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1157 Cast current_group_size to unsigned long when reporting error.
1159 2014-12-10 Jing Yu <jingyu@google.com>
1161 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1162 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1163 Update error message.
1164 (Target_aarch64::do_relax): Use absolute value of option
1165 stub_group_size. Replace local variable with class member
1168 2014-12-04 Alan Modra <amodra@gmail.com>
1170 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1171 addend of PLTREL24 reloc when not generating a plt stub. Make
1172 max_branch_offset an "Address".
1173 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1174 (Target_powerpc::Relocate::relocate): Likewise.
1176 2014-12-04 Alan Modra <amodra@gmail.com>
1179 * symtab.cc (Symbol::set_undefined): Remove assertion.
1180 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1181 on symbols defined in discarded sections, instead return false.
1182 Rearrange params, update all callers.
1183 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1184 branches to syms in discarded sections.
1185 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1186 undefined and flag as discarded.
1187 (Target_powerpc::Relocate::relocate): Localize variable.
1189 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1192 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1193 * testsuite/Makefile.in: Regenerated.
1195 2014-12-03 Alan Modra <amodra@gmail.com>
1198 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1199 when adding dynamic relocations against section symbols.
1201 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1203 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1204 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1205 * options.h (General_options): New -z option (global).
1207 2014-12-01 Cary Coutant <ccoutant@google.com>
1210 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1212 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1213 given but some inputs require executable stack.
1215 2014-11-26 Cary Coutant <ccoutant@google.com>
1217 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1218 .debug_str_offsets; strip .debug_gnu_pubnames and
1219 .debug_gnu_pubtypes.
1220 (lines_only_debug_sections): Strip all four new sections.
1222 2014-11-26 Jing Yu <jingyu@google.com>
1224 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1225 register to be x0 when to relax TLSDESC_LD64_LO12.
1227 2014-11-26 Alan Modra <amodra@gmail.com>
1229 * powerpc.cc (struct Stub_table_owner): New.
1230 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1231 unsigned int vector. Update all references.
1232 (powerpc_relobj::set_stub_table): Take an unsigned int param
1233 rather than a Stub_table. Update callers.
1234 (Powerpc_relobj::clear_stub_table): New function.
1235 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1236 stub_group_size_ vars.
1237 (Target_powerpc::new_stub_table): Delete.
1238 (max_branch_delta): New function, extracted from..
1239 (Target_powerpc::Relocate::relocate): ..here..
1240 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1241 status on whether stub created successfully.
1242 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1244 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1245 reduce on relax failure.
1246 (Target_powerpc::group_sections): Add "no_size_errors" param.
1247 Use stub_group_size_. Set up group info in a temp vector,
1248 before building Stub_table vector. Account for input sections
1249 possibly already converted to relaxed sections.
1250 (Stub_table::init): Delete. Merge into..
1251 (Stub_table::Stub_table): ..here.
1252 (Stub_table::can_reach_stub): New function.
1253 (Stub_table::add_plt_call_entry): Add "from" parameter and
1254 return true iff stub could be reached.
1255 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1257 (Stub_table::clear_stubs): Add "all" param.
1259 2014-11-26 Alan Modra <amodra@gmail.com>
1261 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1262 (Target_powerpc::group_sections): Use it.
1264 2014-11-25 Cary Coutant <ccoutant@google.com>
1266 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1267 (Binary_to_elf::write_symbol): Add st_size parameter.
1268 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1270 2014-11-25 Cary Coutant <ccoutant@google.com>
1273 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1274 (Sized_relobj_file::do_layout): Handle deferred sections properly
1275 during GC pass 1. Don't add reloc sections to deferred list twice.
1276 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1277 (Sized_relobj_file::is_deferred_layout_): New data member.
1279 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1282 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1283 Check PC-relative offset overflow in PLT entry.
1285 2014-11-21 Alan Modra <amodra@gmail.com>
1287 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1288 for undefined weaks.
1290 2014-11-20 Alan Modra <amodra@gmail.com>
1292 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1293 from --stub-group-size parameter divided by 1024.
1294 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1295 template parameter. Update all uses.
1296 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1297 has_stub_value. Set for long branches. Don't report overflow for
1298 branch to undefined weak symbols. Print info message on
1299 overflowing branch to stub.
1301 2014-11-20 Alan Modra <amodra@gmail.com>
1303 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1305 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1307 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1308 entry for R_X86_64_GOTPLT64.
1309 (Target_x86_64<size>::Relocate::relocate): Update comments for
1312 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1314 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1315 * plugin.h: add lock definition
1317 2014-10-29 Han Shen <shenhan@google.com>
1318 Jing Yu <jingyu@google.com>
1320 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1321 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1322 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1324 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1326 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1327 (Target_aarch64::tls_ld_to_le): New method.
1328 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1330 (Output_data_plt_aarch64::irelative_rel_): New data member.
1331 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1332 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1333 (Output_data_plt_aarch64::add_relocation): New method.
1334 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1335 offset. Add got_irelative size to got size.
1336 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1337 type string with the new typename.
1338 (AArch64_relocate_functions::update_adr): Replace parameter x with
1340 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1341 (AArch64_relocate_functions::reloc_common): New method.
1342 (AArch64_relocate_funcsions::rela_general): Extract common part out
1343 into reloc_common method.
1344 (AArch64_relocate_functions::rela_general): Likewise.
1345 (AArch64_relocate_functions::pcrela_general): Likewise.
1346 (AArch64_relocate_functions::adr): New method.
1347 (AArch64_relocate_functions::adrp): Calculate immed before calling
1349 (AArch64_relocate_functions::adrp): Likewise.
1350 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1351 comparing x to 0. Calculate immed from ~x when x < 0.
1352 (Target_aarch64::optimize_tls_reloc): Add new cases for
1353 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1354 TLSLD_MOVW_DTPREL_G0_NC.
1355 (Target_aarch64::possible_function_pointer_reloc): Implement this
1357 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1359 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1360 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1361 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1362 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1363 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1364 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1365 (Target_aarch64::make_plt_entry): Call add_entry with two more
1367 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1368 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1369 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1370 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1371 (Target_aarch64::Relocate::relocate_tls): Add cases for
1372 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1373 TLSLD_MOVW_DTPREL_G0_NC.
1374 * testsuite/icf_safe_so_test.cc: Correct test comment.
1375 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1377 2014-10-22 Alan Modra <amodra@gmail.com>
1379 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1382 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1384 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1386 2014-10-17 Cary Coutant <ccoutant@google.com>
1388 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1389 Add "typename" keyword.
1391 2014-10-15 Han Shen <shenhan@google.com>
1392 Jing Yu <jingyu@google.com>
1394 Patch for gold aarch64 backend to support relaxation.
1395 * aarch64-reloc.def: Change format.
1396 * aarch64.cc (class Reloc_stub): New class.
1397 (class Stub_table): New class.
1398 (class AArch64_relobj): New class.
1399 (class AArch64_input_section): New class.
1400 (class AArch64_output_section): New class.
1401 (Target_aarch64::new_stub_table): New method.
1402 (Target_aarch64::new_aarch64_input_section): New method.
1403 (Target_aarch64::find_aarch64_input_section): New method.
1404 (Target_aarch64::scan_section_for_stubs): New method.
1405 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1406 (Target_aarch64::relocate_stub): New method.
1407 (Target_aarch64::current_target): New method.
1408 (Target_aarch64::do_make_elf_object): New method.
1409 (Target_aarch64::do_may_relax): New method.
1410 (Target_aarch64::do_relax): New method.
1411 (Target_aarch64::group_sections): New method.
1412 (Target_aarch64::scan_reloc_for_stub): New method.
1413 (Target_aarch64::do_make_output_section): New method.
1414 (Target_aarch64::stub_tables_): New data member.
1415 (Target_aarch64::aarch64_input_section_map_): New data member.
1416 (AArch64_relocate_functions::maybe_apply_stub): New method.
1418 2014-09-30 Cary Coutant <ccoutant@google.com>
1421 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1423 2014-09-30 Kito Cheng <kito@0xlab.org>
1426 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1427 hash table before sysv-style hash table.
1429 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1431 * options.h (--pic-executable): Add negative to alias to -no-pie.
1433 2014-09-26 Cary Coutant <ccoutant@google.com>
1436 * object.cc (Sized_relobj_file): Compute value of section symbols
1437 for TLS sections the same as TLS symbols.
1439 2014-09-25 Cary Coutant <ccoutant@google.com>
1442 * resolve.cc (Symbol_table::resolve): Override common placeholder
1443 symbols, but adjust sizes.
1444 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1445 symbols to common lists.
1447 2014-09-24 Alan Modra <amodra@gmail.com>
1449 * po/POTFILES.in: Regenerate.
1451 2014-09-23 Taiju Tsuiki <tzik@google.com>
1452 Cary Coutant <ccoutant@google.com>
1455 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1456 on input_sections_blocker.
1457 * layout.cc (Write_sections_task::locks): Unblock
1458 input_sections_blocker_.
1459 * layout.h (Write_sections_task::Write_sections_task): Add
1460 input_sections_blocker.
1461 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1463 * testsuite/Makefile.in: Regenerate.
1465 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1467 * testsuite/Makefile.am (plugin_test_10): New test.
1468 * testsuite/Makefile.in: Regenerate
1469 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1470 * testsuite/plugin_test_10.sh: New file.
1472 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1474 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1475 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1476 during the replacement phase.
1478 2014-09-17 Han Shen <shenhan@google.com>
1479 Jing Yu <jingyu@google.com>
1481 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1482 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1483 * aarch64.cc (Target_aarch64): Add data members
1484 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1485 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1487 (Target_aarch64::do_reloc_symbol_index): New method.
1488 (Target_aarch64::do_reloc_addend): New method.
1489 (Target_aarch64::add_tlsdesc_info): New method.
1490 (Target_aarch64::do_dynsym_value): New method.
1491 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1492 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1493 (Target_aarch64::make_data_plt): Add new parameters: got,
1494 got_irelative. Pass them to do_make_data_plt.
1495 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1496 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1497 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1498 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1499 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1500 (Target_aarch64::got_tlsdesc_section): New method.
1501 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1502 (Target_aarch64::define_tls_base_symbol): New method.
1503 (Target_aarch64::reserve_tlsdesc_entries): New method.
1504 (Target_aarch64::got_mod_index_entry): New method.
1505 (Target_aarch64::rela_tlsdesc_section): New method.
1506 (Target_aarch64::rela_irelative_section): New method.
1507 (Target_aarch64::Tlsdesc_info): New struct.
1508 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1509 relocations and tlsdesc relocations.
1510 (Target_aarch64::optimize_tls_reloc): Implement method.
1511 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1512 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1514 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1515 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1516 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1517 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1518 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1519 (Output_data_plt_aarch64::rela_irelative): New method.
1520 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1521 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1522 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1523 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1524 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1525 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1526 (Output_data_plt_aarch64_standard): New member variables:
1527 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1528 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1529 New parameter: got, got_irelative.
1530 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1531 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1532 (Output_data_plt_aarch64::do_write): Replace got_address with
1533 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1534 (AArch64_relocate_functions::update_movnz): New method.
1535 (AArch64_relocate_functions): Correct format.
1536 (AArch64_relocate_functions::movnz): New method.
1537 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1538 before the switch. Add new cases to switch.
1539 Check ie_to_le relaxation on tlsie relocations. Add code handling
1540 tlsgd tlsdesc cases.
1541 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1542 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1543 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1544 Call reloc_name_in_error_message to print unsupported reloc.
1545 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1547 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1548 relocs. Fill in some more dynamic tags.
1549 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1550 Skip call tls_get_addr when tlsgd is relaxed.
1551 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1552 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1553 tlsdesc->ie relaxation.
1555 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1557 * mips.cc (Target_mips_nacl): New class.
1558 (Target_selector_mips_nacl): New class.
1559 (target_selector_mips32): Rename from target_selector_mips32be and use
1560 Target_selector_mips_nacl instead of Target_selector_mips.
1561 (target_selector_mips32el): Rename from target_selector_mips32 and use
1562 Target_selector_mips_nacl instead of Target_selector_mips.
1563 (target_selector_mips64): Rename from target_selector_mips64be and use
1564 Target_selector_mips_nacl instead of Target_selector_mips.
1565 (target_selector_mips64el): Rename from target_selector_mips64 and use
1566 Target_selector_mips_nacl instead of Target_selector_mips.
1567 (Target_mips::mips_info): Add const attribute.
1569 2014-09-02 Cary Coutant <ccoutant@google.com>
1571 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1572 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1573 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1574 (Sized_incr_dynobj::do_section_name): Likewise.
1575 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1576 (Sized_incr_dynobj::do_section_name): Likewise.
1577 * object.h (Object::section_name): Likewise.
1578 (Object::do_section_name): Likewise.
1579 (Sized_relobj_file::do_section_name): Likewise.
1580 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1581 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1583 2014-09-02 Cary Coutant <ccoutant@google.com>
1586 * ehframe.cc (Fde::write): Add output_offset parameter.
1587 (Cie::write): Likewise.
1588 (Eh_frame::set_final_data_size): Account for offset within output
1590 (Eh_frame::do_sized_write): Likewise.
1591 * ehframe.h (Fde::write): Add output_offset parameter.
1592 (Cie::write): Likewise.
1593 * output.cc (Output_section::Input_section_sort_entry): Remove
1594 section_has_name_; add output_section_name parameter. Use
1595 output section name for non-input sections.
1596 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1597 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1598 (Output_section::Input_section_sort_compare): Remove logic for
1599 sections without names.
1600 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1601 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1603 (Output_section::Input_section_sort_section_name_compare): Likewise.
1605 2014-08-29 Han Shen <shenhan@google.com>
1606 Jing Yu <jingyu@google.com>
1608 * aarch64-reloc-property.cc
1609 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1610 reference reloc property in the table.
1611 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1613 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1614 2 new overloaded methods.
1615 (Output_data_got_aarch64::do_write): Add code to write out
1617 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1619 (Output_data_got_aarch64::static_relocs): New vector to
1621 (Target_aarch64::TCB_SIZE): New const static memeber.
1622 (Target_aarch64::tcb_size): New method.
1623 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1624 (Target_aarch64::Relocate::relocate_tls): New method.
1625 (Target_aarch64::Scan::local): Add code handling new reloc types.
1626 (Target_aarch64::Scan::global): Add code handling new reloc types.
1628 2014-08-13 Sriraman Tallam <tmsriram@google.com>
1630 * options.h (-no-pie): Add option.
1632 2014-08-08 Jing Yu <jingyu@google.com>
1633 Han Shen <shenhan@google.com>
1635 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1636 (DEFFILES): add aarch64-reloc.def.
1637 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1638 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1639 * Makefile.in: Regenerate.
1640 * aarch64-reloc-property.cc: New file.
1641 * aarch64-reloc-property.h: New file.
1642 * aarch64-reloc.def: New file.
1643 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1644 with tab to make the format consistent.
1645 (Output_data_got_aarch64::symbol_table_): New method.
1646 (Target_aarch64::do_plt_address_for_global): New method.
1647 (Target_aarch64::do_plt_address_for_local): New method.
1648 (Target_aarch64::do_select_as_default_target): New method.
1649 (Target_aarch64::do_make_data_plt): New method.
1650 (Target_aarch64::make_data_plt): New method.
1651 (Output_data_plt_aarch64::has_irelative_section): New method.
1652 (Output_data_plt_aarch64::address_for_global): New method.
1653 (Output_data_plt_aarch64::address_for_local): New method.
1654 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1655 (Output_data_plt_aarch64::add_entry): Implement contents.
1656 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1657 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1658 the got_pov entry to plt0.
1659 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1661 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1662 (AArch64_howto): New struct.
1663 (aarch64_howto[]): New static const array.
1664 (AArch64_relocate_functions): New class.
1665 (Target_aarch64::Scan::get_reference_flags): Remove method.
1666 (Target_aarch64::Scan::local): Implement to support a few relocations.
1667 (Target_aarch64::Scan::global): Implement to support a few relocations.
1668 (Target_aarch64::make_plt_section): Implement contents.
1669 (Target_aarch64::make_plt_entry): Implement contents.
1670 (Target_aarch64::do_finalize_sections): Implement contents.
1671 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1672 (Target_aarch64::relocate_section): Implement contents.
1674 2014-08-06 Alan Modra <amodra@gmail.com>
1676 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1678 2014-08-06 Alan Modra <amodra@gmail.com>
1681 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1683 2014-07-21 Sriraman Tallam <tmsriram@google.com>
1685 * object.cc (Relobj::is_section_name_included): Add
1686 ".rodata.nptl_version" to not garbage collect this section.
1688 2014-07-08 Cary Coutant <ccoutant@google.com>
1690 * expression.cc (struct Expression::Expression_eval_info): Add
1691 new fields type_pointer, vis_pointer, and nonvis_pointer.
1692 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1693 nonvis_pointer parameters. Adjust all calls.
1694 (Symbol_expression::value): Update type, visibility, and nonvis bits
1696 * script.cc (Symbol_assignment::sized_finalize): Update type,
1697 visibility, and remaining st_other bits for new symbol.
1698 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1699 vis_pointer, and nonvis_pointer parameters.
1700 * symtab.h (Symbol::set_type): New method.
1702 * testsuite/Makefile.am (defsym_test): New test.
1703 * testsuite/Makefile.in: Regenerate.
1704 * testsuite/defsym_test.c: New file.
1705 * testsuite/defsym_test.sh: New file.
1707 2014-07-08 Cary Coutant <ccoutant@google.com>
1710 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1711 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1712 (Sized_dynobj::base_read_symbols): ...new method.
1713 * object.h (Sized_relobj_file::base_read_symbols): New method.
1714 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1715 (Sized_relobj_file::base_read_symbols): ...new method.
1716 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1717 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1718 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1720 2014-07-04 Alan Modra <amodra@gmail.com>
1722 * po/POTFILES.in: Regenerate.
1724 2014-07-02 Jing Yu <jingyu@google.com>
1726 * aarch64.cc: New file
1727 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1728 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1729 * Makefile.in: Regenerate.
1730 * configure.tgt: Add entries for aarch64*.
1731 * configure.ac: Likewise.
1732 * configure: Likewise.
1734 2014-06-27 Alan Modra <amodra@gmail.com>
1736 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1738 2014-06-24 Cary Coutant <ccoutant@google.com>
1740 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1742 (Dwo_file::sized_read_unit_index): Likewise.
1744 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1746 * mips.cc: New file.
1747 * Makefile.am (TARGETSOURCES): Add mips.cc
1748 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1749 * configure.tgt: Add entries for mips*.
1750 * configure.ac: Likewise.
1751 * Makefile.in: Regenerate.
1752 * configure: Likewise.
1754 2014-06-09 Cary Coutant <ccoutant@google.com>
1756 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1757 unit_length is within section bounds.
1759 2014-06-09 Cary Coutant <ccoutant@google.com>
1762 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1765 2014-06-07 Alan Modra <amodra@gmail.com>
1767 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1769 2014-06-06 Cary Coutant <ccoutant@google.com>
1771 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1772 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1773 (Dwarf_pubnames_table::read_header): Likewise.
1774 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1775 .debug_gnu_pubtypes.
1777 2014-06-05 Joel Brobecker <brobecker@adacore.com>
1779 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1780 * Makefile.in, configure: Regenerate.
1782 2014-06-03 Alan Modra <amodra@gmail.com>
1784 * powerpc.cc (addis_12_2): Define.
1785 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1787 2014-06-03 Alan Modra <amodra@gmail.com>
1789 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1792 2014-06-02 Alan Modra <amodra@gmail.com>
1794 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1795 Only ignore relocs on ELFv1.
1796 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1798 2014-05-30 Cary Coutant <ccoutant@google.com>
1800 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1801 * testsuite/Makefile.in: Regenerate.
1802 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1804 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1807 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1808 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1810 2014-05-15 Alan Modra <amodra@gmail.com>
1812 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1813 Compare FDE contents with DW_CFA_nop rather than 0.
1815 2014-05-13 Sriraman Tallam <tmsriram@google.com>
1817 * symtab.h (may_need_copy_reloc): Remove check for position independent
1819 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1820 position independence before pc absolute may_need_copy_reloc call.
1821 Add check for executable output befor pc relative may_need_copy_reloc
1827 * powerpc.cc: Add check for no position independence before
1828 may_need_copy_reloc calls.
1829 * testsuite/pie_copyrelocs_test.cc: New file.
1830 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1831 * Makefile.am (pie_copyrelocs_test): New test.
1832 * Makefile.in: Regenerate.
1834 2014-05-08 Martin Liška <mliska@suse.cz>
1836 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1838 2014-05-06 Cary Coutant <ccoutant@google.com>
1841 * i386.cc (Output_data_got_plt_i386): New class.
1842 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1843 parameter. Change all callers.
1844 (Output_data_plt_i386::layout_): Remove.
1845 (Output_data_plt_i386::got_plt_): Change type.
1846 (Target_i386::got_plt_): Change type. Change all references.
1847 (Target_i386::got_section): Create instance of new class.
1848 (Output_data_got_plt_i386::do_write): New function.
1849 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1850 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1851 parameter. Change all callers.
1852 (Output_data_plt_x86_64::layout_): Remove.
1853 (Output_data_plt_x86_64::got_plt_): Change type.
1854 (Target_x86_64::got_plt_): Change type. Change all references.
1855 (Target_x86_64::got_section): Create instance of new class.
1856 (Output_data_got_plt_x86_64::do_write): New function.
1857 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1858 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1861 2014-05-05 Cary Coutant <ccoutant@google.com>
1863 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1864 if we have pubnames/pubtypes.
1866 2014-05-02 Cary Coutant <ccoutant@google.com>
1868 * defstd.cc (in_segment): Define __ehdr_start here...
1869 * layout.cc (Layout::finalize): ...Instead of here. Set the
1870 output segment when known.
1871 * resolve.cc (Symbol::override_base_with_special): Remember
1872 the original binding.
1873 * symtab.cc (Symbol::set_output_segment): New function.
1874 (Symbol::set_undefined): New function.
1875 * symtab.h (Symbol::is_weak_undefined): Check original undef
1877 (Symbol::is_strong_undefined): New function.
1878 (Symbol::set_output_segment): New function.
1879 (Symbol::set_undefined): New function.
1880 * target-reloc.h (is_strong_undefined): Remove.
1881 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1882 Check for hidden undefs.
1883 (relocate_section): Call Symbol::is_strong_undefined.
1885 * testsuite/Makefile.am (ehdr_start_test_1)
1886 (ehdr_start_test_2, ehdr_start_test_3)
1887 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1888 * testsuite/Makefile.in: Regenerate.
1889 * testsuite/ehdr_start_def.cc: New source file.
1890 * testsuite/ehdr_start_test.cc: New source file.
1891 * testsuite/ehdr_start_test.t: New linker script.
1892 * testsuite/ehdr_start_test_4.sh: New shell script.
1894 2014-04-23 Cary Coutant <ccoutant@google.com>
1897 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1899 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1901 * layout.cc (Layout::include_section): Allow a target to decide
1902 whether to include a section.
1903 * target.h (Target::should_include_section): New function.
1904 (Target::do_should_include_section): New function.
1906 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1908 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1910 (Copy_relocs::emit): ... here.
1911 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1912 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1913 (Copy_reloc_entry::entries_): Change from private to protected.
1915 2014-04-02 Sriraman Tallam <tmsriram@google.com>
1917 * icf.cc (get_section_contents): Replace copies of reloc
1918 vectors with const references.
1920 2014-04-02 Cary Coutant <ccoutant@google.com>
1922 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1923 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1924 * configure: Regenerate.
1925 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1926 -fno-use-linker-plugin.
1927 (LINK1, CXXLINK1): Add it to the link command.
1928 * testsuite/Makefile.in: Regenerate.
1930 2014-03-12 Alan Modra <amodra@gmail.com>
1932 * Makefile.in: Regenerate.
1934 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1936 * symtab.h (Symbol::set_nonvis): New function.
1938 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1940 * symtab.cc (Sized_symbol<32>::init_output_data):
1941 Instantiate the template.
1942 (Sized_symbol<64>::init_output_data): Likewise.
1944 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1946 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1947 adjust dynamic symbol value.
1948 * target.h (Target::adjust_dyn_symbol): New function.
1949 (Target::do_adjust_dyn_symbol): New function.
1951 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1953 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1954 Get the value of DYNAMIC_CUSTOM dynamic entry.
1955 * output.h (Output_data_dynamic::add_custom): New function.
1956 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1958 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1959 * target.h (Target::dynamic_tag_custom_value): New function.
1960 (Target::do_dynamic_tag_custom_value): New function.
1962 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1964 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1966 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1967 (Target::do_has_custom_set_dynsym_indexes): New function.
1968 (Target::set_dynsym_indexes): New function.
1969 (Target::do_set_dynsym_indexes): New function.
1971 2014-03-07 Alan Modra <amodra@gmail.com>
1973 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1974 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1975 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1976 (Powerpc_relocate_functions::has_overflow_bitfield,
1977 overflowed): Use the above.
1978 (Target_powerpc::Relocate::relocate): Correct overflow checking
1979 for a number of relocations. Modify overflow test for 16-bit
1980 fields in instructions to signed/unsigned according to whether
1981 the field takes a signed or unsigned value.
1983 2014-03-05 Alan Modra <amodra@gmail.com>
1985 Update copyright years.
1987 2014-03-05 Alan Modra <amodra@gmail.com>
1989 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1990 R_PPC64_ADDR64_LOCAL.
1991 (Target_powerpc::Relocate::relocate): Likewise.
1993 2014-03-03 Alan Modra <amodra@gmail.com>
1995 * dwp.cc (print_version): Update copyright year to current.
1997 2014-02-10 Alan Modra <amodra@gmail.com>
1999 * po/gold.pot: Regenerate.
2001 2014-02-06 Cary Coutant <ccoutant@google.com>
2003 Fix problem where -u is ignored when a weak undef is seen.
2005 * archive.cc (Library_base::should_include_member): Reorder
2006 code to check for -u option if a weak undef has already been seen.
2007 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2008 * testsuite/Makefile.in: Regenerate.
2009 * testsuite/weak_undef_file3.cc: New file.
2010 * testsuite/weak_undef_file4.cc: New file.
2011 * testsuite/weak_undef_test_2.cc: New file.
2013 2014-02-05 Cary Coutant <ccoutant@google.com>
2015 Fix issues with gold undefined symbol diagnostics.
2018 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2020 * target-reloc.h (is_strong_undefined): New function.
2021 (relocate_section): Move undef vtable symbol check from here.
2022 Check for is_strong_undefined.
2024 2014-02-05 Cary Coutant <ccoutant@google.com>
2026 Fix problems with the --dynamic-list option.
2029 * options.cc (General_options::parse_dynamic_list):
2030 Set have_dynamic_list_.
2031 (General_options::General_options): Initialize have_dynamic_list_.
2032 (General_options::finalize): Turn off -Bsymbolic and
2033 -Bsymbolic-functions if --dynamic-list provided.
2034 * options.h (General_options::have_dynamic_list): New function.
2035 (General_options::have_dynamic_list_): New data member.
2036 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2040 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2041 in --dynamic-list, mark it.
2043 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2044 (dynamic_list_2): New test case.
2045 * testsuite/Makefile.in: Regenerate.
2046 * testsuite/dynamic_list_2.cc: New file.
2047 * testsuite/dynamic_list_2.t: New file.
2048 * testsuite/dynamic_list_lib1.cc: New file.
2049 * testsuite/dynamic_list_lib2.cc: New file.
2050 * testsuite/gc_dynamic_list_test.c: New file.
2051 * testsuite/gc_dynamic_list_test.sh: New file.
2052 * testsuite/gc_dynamic_list_test.t: New file.
2054 2014-01-28 Cary Coutant <ccoutant@google.com>
2056 Add .gdb_index version 7 support.
2058 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2059 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2061 (Dwarf_ranges_table::read_ranges_table): Likewise.
2062 (Dwarf_pubnames_table::read_section): Check for GNU-style
2063 sections, and for compressed debug sections.
2064 (Dwarf_pubnames_table::read_header): Compute end address of table.
2065 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2066 for end of list by offset, not by offset == 0.
2067 (Dwarf_info_reader::do_read_string_table): Check for compressed
2069 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2070 Initialize new data members.
2071 (Dwarf_pubnames_table::next_name): return flag_byte.
2072 (Dwarf_pubnames_table::end_of_table_): New data member.
2073 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2074 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2075 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2076 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2077 read skeleton type unit DIEs.
2078 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2079 (Gdb_index::do_write): Write flag_byte.
2080 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2081 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2082 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2083 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2085 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2087 * version.cc (print_version): Update copyright year to 2014.
2089 2013-12-19 Dimitry Andric <dimitry@andric.com>
2091 * stringpool.cc (Stringpool_template::reserve): Add
2092 HAVE_UNORDERED_MAP case.
2093 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2095 2013-12-18 Cary Coutant <ccoutant@google.com>
2097 * configure.ac: Check for <unordered_set> and <unordered_map>.
2098 * config.in: Regenerate.
2099 * configure: Regenerate.
2100 * system.h: Use <unordered_set> and <unordered_map> if available.
2102 2013-12-10 Roland McGrath <mcgrathr@google.com>
2104 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2105 with $(INSTALL_PROGRAM_ENV).
2106 * Makefile.in: Regenerate.
2108 2013-11-22 Cary Coutant <ccoutant@google.com>
2110 * configure.ac: Add check for which library is needed for
2112 * configure: Regenerate.
2114 2013-11-22 Cary Coutant <ccoutant@google.com>
2116 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2118 * testsuite/Makefile.in: Regenerate.
2120 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2122 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2123 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2124 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2125 (Target_x86_64<size>::Scan::local): Likewise.
2126 (Target_x86_64<size>::Scan::global): Likewise.
2127 (Target_x86_64<size>::Relocate::relocate): Likewise.
2128 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2130 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2133 * testsuite/Makefile.am (check_PROGRAMS): Add
2134 exception_x86_64_bnd_test.
2135 (exception_x86_64_bnd_test_SOURCES): New macro.
2136 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2137 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2138 (exception_x86_64_bnd_test_LDADD): Likewise.
2139 (exception_x86_64_bnd_1.o): New rule.
2140 (exception_x86_64_bnd_2.o): Likewise.
2141 * testsuite/Makefile.in: Regenerated.
2143 2013-11-15 Alan Modra <amodra@gmail.com>
2145 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2147 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2148 Only call ppc64_local_entry_offset for 64-bit. Restrict
2149 symval_for_branch lookup to ELFv1.
2150 (Stub_table::add_plt_call_entry): Use unsigned int off.
2151 (Output_data_glink::Address, invalid_address): New.
2152 (Output_data_glink::add_eh_frame): Move out of line. Add
2154 (Output_data_glink::add_global_entry, find_global_entry,
2155 global_entry_address): New functions.
2156 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2157 ge_size): New variables.
2158 (Output_data_glink::set_final_data_size): Add global entry
2160 (Output_data_glink::do_write): Write global entry stubs.
2161 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2162 parameter. Return true for ELFv2. Adjust callers.
2163 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2164 ELFv1. Similarly for ifunc and dynamic relocation processing
2165 specific to ELFv1. Recognize that symbols are defined on
2166 their plt entries for ELFv2.
2167 (Target_powerpc::symval_for_branch): Assert if called for
2169 (Target_powerpc::Relocate::relocate): Use global entry plt
2170 stub for symbol value if such exists on ELFv2.
2171 (Target_powerpc::Relocate::relocate): Don't call
2172 symval_for_branch when ELFv2. Do adjust for local entry
2174 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2176 (Target_powerpc::do_plt_address_for_global): Similarly.
2178 2013-11-14 Cary Coutant <ccoutant@google.com>
2180 Revert patch -- this did not fix the problem, and there is
2183 2013-11-14 Cary Coutant <ccoutant@google.com>
2186 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2187 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2188 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2189 updating fde_offsets_.
2190 (Eh_frame_hdr::lock_): New data member.
2192 2013-11-14 Cary Coutant <ccoutant@google.com>
2194 * dwp.cc (Dwo_file_entry): New type.
2195 (File_list): Use Dwo_file_entry.
2196 (Dwo_file::verify): New function.
2197 (Dwo_file::verify_dwo_list): New function.
2198 (Dwo_file::sized_verify_dwo_list): New function.
2199 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2201 (Dwp_options): New enum type.
2202 (dwp_options): Add --verify-only.
2205 * dwp.h (gold_info): Add declaration.
2207 2013-11-14 Cary Coutant <ccoutant@google.com>
2210 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2211 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2212 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2213 updating fde_offsets_.
2214 (Eh_frame_hdr::lock_): New data member.
2216 2013-11-06 Cary Coutant <ccoutant@google.com>
2219 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2220 before reloc sections.
2222 2013-11-04 Alan Modra <amodra@gmail.com>
2224 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2225 (Symbol::needs_dynamic_reloc): Test new flag.
2226 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2227 (Target_powerpc::Scan::get_reference_flags): Add target param.
2228 Return FUNC_DESC_ABI for 64-bit ELFv1.
2229 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2231 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2232 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2234 2013-10-31 Cary Coutant <ccoutant@google.com>
2236 Restore support for dwp v2 DWARF package file format.
2238 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2239 tu_length parameter. Adjust all callers.
2240 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2241 * dwp.cc: Include dwarf.h.
2242 (Section_bounds): New struct type.
2243 (Unit_set): New struct type.
2244 (Dwo_file::Dwo_file): Initialize new data member.
2245 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2246 Combine and rename to...
2247 (Dwo_file::read_unit_index): ...this.
2248 (Dwo_file::sized_read_compunit_index)
2249 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2250 (Dwo_file::sized_read_unit_index): ...this.
2251 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2252 parameters; add section_id parameter.
2253 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2254 (Dwo_file::add_unit_set): ...this.
2255 (Dwo_file::shndx_map_): Remove.
2256 (Dwo_file::sect_offsets_): New data member.
2257 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2258 (Dwp_output_file::add_section): Rename to...
2259 (Dwp_output_file::add_contribution): ...this.
2260 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2261 (Dwp_output_file::add_tu_set): Likewise.
2262 (Dwp_output_file::Contribution): New type.
2263 (Dwp_output_file::Section::contributions): New data member.
2264 (Dwp_output_file::Cu_or_tu_set): Remove.
2265 (Dwp_output_file::Section::Section): New ctor.
2266 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2267 (Dwp_output_file::Dwp_index::Section_table): New type.
2268 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2269 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2271 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2272 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2273 (Dwp_output_file::Dwp_index::section_table): New member function.
2274 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2275 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2276 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2277 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2278 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2279 (Dwp_output_file::Dwp_index::section_table_): New data member.
2280 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2281 (Dwp_output_file::add_output_section): New member function.
2282 (Dwp_output_file::write_new_section): New member function.
2283 (Dwp_output_file::write_contributions): New member function.
2284 (Dwp_output_file::section_id_map_): New data member.
2285 (class Dwo_id_info_reader): Remove.
2286 (class Unit_reader): New class.
2287 (get_dwarf_section_name): New function.
2288 (Dwo_file::read_executable): Adjust initializations of class data.
2289 (Dwo_file::read): Add support for v2 package file format.
2290 (Dwo_file::read_unit_index): Likewise.
2291 (Dwo_file::sized_read_unit_index): Likewise.
2292 (Dwo_file::copy_section): Likewise.
2293 (Dwo_file::add_unit_set): Likewise.
2294 (Dwp_output_file::add_output_section): Likewise.
2295 (Dwp_output_file::add_contribution): Likewise.
2296 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2298 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2300 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2302 (Dwp_output_file::initialize): Remove unused function.
2303 (Dwp_output_file::finalize): Add support for v2 package file format.
2304 (Dwp_output_file::write_index): Likewise.
2305 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2308 2013-10-31 Cary Coutant <ccoutant@google.com>
2310 * configure.ac: Fix check for -fmerge-constants.
2311 * configure.ac: Regenerate.
2313 2013-10-30 Roland McGrath <mcgrathr@google.com>
2315 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2316 Correct 9-byte nop sequence to match what the assembler generates.
2318 2013-10-30 Alan Modra <amodra@gmail.com>
2320 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2321 ppc64_local_entry_offset, ppc64_local_entry_offset,
2322 do_read_symbols): New functions.
2323 (Powerpc_relobj::e_flags_, st_other_): New vars.
2324 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2325 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2326 (Powerpc_relobj::e_flags_): New var.
2327 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2328 and adjust for ELFv2.
2329 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2330 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2331 (Powerpc_dynobj::do_find_special_sections): Likewise.
2332 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2333 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2334 to ELFv2 local entry.
2335 (Target_powerpc::do_relax): No thread safe barriers needed for
2337 (Output_data_plt_powerpc::initial_plt_entry_size_,
2338 plt_entry_size): Delete. Replace all uses with
2339 first_plt_entry_offset() and plt_entry_size().
2340 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2341 reserved_size parm. Update callers.
2342 (Output_data_plt_powerpc::entry_count): Update.
2343 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2344 and use Target_powerpc::first_plt_entry_offset().
2345 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2346 rename to plt_entry_size.
2347 (Output_data_plt_powerpc::add_ifunc_entry,
2348 add_local_ifunc_entry): Adjust reloc for ELFv2.
2349 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2350 (glink_eh_frame_fde_64v2): New.
2351 (Stub_table::plt_call_size): Support ELFv2 sizing.
2352 (Output_data_glink::add_eh_frame): Use the new FDE.
2353 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2354 (Stub_table::do_write): Write ELFv2 stubs and glink.
2355 (Target_powerpc::Relocate::relocate): Replaces nop after call
2356 with ld 2,24(1) and adjust local offset destination for ELFv2.
2358 2013-10-30 Alan Modra <amodra@gmail.com>
2360 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2361 (Target_powerpc::Scan::global, local): Likewise.
2362 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2363 on all ppc64 @h and @ha relocs.
2365 2013-10-14 Alan Modra <amodra@gmail.com>
2367 * output.h (Output_data_got::add_constant): Tidy.
2368 (Output_data_got::add_constant_pair): New function.
2369 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2370 methods used so as to first call reserve_ent().
2372 2013-10-11 Roland McGrath <mcgrathr@google.com>
2374 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2375 add_got_entry and add_got_entry_pair.
2377 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2378 (HAVE_PUBNAMES): Likewise.
2379 * configure: Regenerate.
2381 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2382 * testsuite/Makefile.in: Regenerate.
2384 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2385 Remove const from declaration.
2386 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2387 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2388 * output.h (Output_file_header): Remove const from member target_
2389 and corresponding constructor argument.
2390 * output.cc (Output_file_header::Output_file_header): Update prototype.
2391 (Output_file_header::do_sized_write): Use this->target_ in place
2392 of parameters()->target().
2394 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2396 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2397 * configure: Regenerate.
2398 * Makefile.in: Regenerate.
2399 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2400 * testsuite/merge_string_literals_2.c: Likewise.
2401 * testsuite/Makefile.am
2402 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2403 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2404 literal -fmerge-constants.
2405 * testsuite/Makefile.in: Regenerate.
2407 * i386.cc (Target_i386): Remove unused member dynbss_.
2408 * arm.cc (Target_arm): Likewise.
2409 * powerpc.cc (Target_powerpc): Likewise.
2410 * sparc.cc (Target_sparc): Likewise.
2411 * tilegx.cc (Target_tilegx): Likewise.
2412 * x86_64.cc (Target_x86_64): Likewise.
2413 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2414 type_signature_, type_offset_.
2415 * plugin.h (Plugin_hook): Remove unused member layout_.
2416 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2418 (Read_member): Remove unused members input_objects_, symtab_,
2420 (Check_library): Remove unused member symtab_.
2421 * archive.h (Lib_group): Remove unused member lib_.
2422 * archive.cc (Lib_group::Lib_group): Update initializer.
2423 * incremental.h (Incremental_binary): Remove unused member target_.
2424 (Incremental_script_entry): Removed unused member script_.
2425 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2426 * icf.h (Icf): Remove unused member num_tracked_relocs.
2428 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2429 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2431 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2433 * archive.h: Use struct rather than class for forward declaration
2434 of Read_symbols_data.
2436 2013-10-07 Cary Coutant <ccoutant@google.com>
2439 * testsuite/Makefile.am (icf_test): Fix dependencies.
2440 (icf_safe_test): Likewise.
2441 (icf_safe_so_test): Likewise.
2442 (large_symbol_alignment): Add empty _LDADD rule.
2443 * testsuite/Makefile.in: Regenerate.
2445 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2448 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2449 relocation for R_X86_64_32 on x32.
2451 2013-08-27 Roland McGrath <mcgrathr@google.com>
2453 * output.cc (Output_segment::set_section_addresses): Take new
2454 Target* argument. If target->isolate_execinstr() and the segment
2455 is executable and starts at a target->abi_pagesize() boundary,
2456 pad its end out to a target->abi_pagesize() boundary with code fill.
2457 * output.h (Output_segment::set_section_addresses): Update decl.
2458 * layout.h (Layout::check_output_data_for_reset_values): Take new
2459 argument RELAX_OUTPUTS.
2460 (Layout): New member relax_output_list_.
2461 (Layout::add_relax_output): New method.
2462 * layout.cc (Layout::Layout): Update constructor.
2463 (Layout::reset_relax_output): New method.
2464 (Layout::clean_up_after_relaxation): Call it.
2465 (Layout::prepare_for_relaxation): Update caller.
2466 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2467 Call reset_relax_output before re-processing segments for
2468 isolate_execinstr case.
2469 (Layout::write_data): Handle relax_output_list_.
2470 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2471 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2473 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2476 * object.h: Fix typos.
2478 2013-08-16 Roland McGrath <mcgrathr@google.com>
2480 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2481 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2483 2013-08-07 Cary Coutant <ccoutant@google.com>
2485 Revert support for v2 DWP files:
2487 2013-03-01 Cary Coutant <ccoutant@google.com>
2489 Add dwp support for v2 DWARF package file format.
2490 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2491 tu_length parameter. Adjust all callers.
2492 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2493 * dwp.cc: Include dwarf.h.
2494 (Section_bounds): New struct type.
2495 (Unit_set): New struct type.
2496 (Dwo_file::Dwo_file): Initialize new data member.
2497 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2498 Combine and rename to...
2499 (Dwo_file::read_unit_index): ...this.
2500 (Dwo_file::sized_read_compunit_index)
2501 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2502 (Dwo_file::sized_read_unit_index): ...this.
2503 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2504 parameters; add section_id parameter.
2505 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2506 (Dwo_file::add_unit_set): ...this.
2507 (Dwo_file::shndx_map_): Remove.
2508 (Dwo_file::sect_offsets_): New data member.
2509 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2510 (Dwp_output_file::add_section): Rename to...
2511 (Dwp_output_file::add_contribution): ...this.
2512 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2513 (Dwp_output_file::add_tu_set): Likewise.
2514 (Dwp_output_file::Contribution): New type.
2515 (Dwp_output_file::Section::contributions): New data member.
2516 (Dwp_output_file::Cu_or_tu_set): Remove.
2517 (Dwp_output_file::Section::Section): New ctor.
2518 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2519 (Dwp_output_file::Dwp_index::Section_table): New type.
2520 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2521 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2523 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2524 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2525 (Dwp_output_file::Dwp_index::section_table): New member function.
2526 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2527 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2528 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2529 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2530 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2531 (Dwp_output_file::Dwp_index::section_table_): New data member.
2532 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2533 (Dwp_output_file::add_output_section): New member function.
2534 (Dwp_output_file::write_new_section): New member function.
2535 (Dwp_output_file::write_contributions): New member function.
2536 (Dwp_output_file::section_id_map_): New data member.
2537 (class Dwo_id_info_reader): Remove.
2538 (class Unit_reader): New class.
2539 (get_dwarf_section_name): New function.
2540 (Dwo_file::read_executable): Adjust initializations of class data.
2541 (Dwo_file::read): Add support for v2 package file format.
2542 (Dwo_file::read_unit_index): Likewise.
2543 (Dwo_file::sized_read_unit_index): Likewise.
2544 (Dwo_file::copy_section): Likewise.
2545 (Dwo_file::add_unit_set): Likewise.
2546 (Dwp_output_file::add_output_section): Likewise.
2547 (Dwp_output_file::add_contribution): Likewise.
2548 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2550 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2552 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2554 (Dwp_output_file::initialize): Remove unused function.
2555 (Dwp_output_file::finalize): Add support for v2 package file format.
2556 (Dwp_output_file::write_index): Likewise.
2557 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2560 2013-07-31 Cary Coutant <ccoutant@google.com>
2562 * object.cc (Sized_relobj::do_output_section_address): New function.
2563 (Sized_relobj): Instantiate explicitly.
2564 * object.h (Object::output_section_address): New function.
2565 (Object::do_output_section_address): New function.
2566 (Sized_relobj::do_output_section_address): New function.
2567 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2569 2013-07-30 Cary Coutant <ccoutant@google.com>
2570 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2572 * parameters.cc (Parameters::entry): Return target-specific entry
2574 * target.h (Target::entry_symbol_name): New function.
2575 (Target_info::entry_symbol_name): New data member.
2577 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2578 * i386.cc (Target_i386::i386_info): Likewise.
2579 (Target_i386_nacl::i386_nacl_info): Likewise.
2580 * sparc.cc (Target_sparc::sparc_info): Likewise.
2581 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2582 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2583 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2584 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2586 2013-07-22 Sterling Augustine <saugustine@google.com>
2588 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2589 Convert parameter shndx to local variable. Add parameters symtab
2590 and symtab_size. Scan over section names. Find relocation
2591 section corresponding to current section. Create and initialize
2592 reloc_mapper_ and reloc_type_.
2593 (Dwarf_pubnames_table::read_header): Add assertion. Change
2594 unit_length to off_t. Initialize member unit_length_. Fill in field
2596 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2597 Initialize new fields unit_length_ and cu_offset_.
2598 (Dwarf_pubnames_table::read_section): Update prototype.
2599 (Dwarf_pubnames_table::cu_offset): New member function.
2600 (Dwarf_pubnames_table::subsection_size): Likewise.
2601 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2603 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2604 member functions public.
2605 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2606 Update comment. Rework logic. Move repeated parts to...
2607 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2608 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2609 pubtypes_table_, and stmt_list_offset.
2610 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2611 Gdb_index::find_pubtype_offset,
2612 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2613 (Gdb_index::pubnames_read): Update prototype and rework logic.
2614 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2616 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2617 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2618 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2619 Gdb_index::map_pubtable_to_dies):
2621 (Gdb_index::pubnames_read): Update declaration.
2622 (Gdb_index::Pubname_offset_map): New type.
2623 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2624 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2625 Gdb_index::stmt_list_offset): Declare.
2626 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2627 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2628 Gdb_index::pubtypes_offset_): Remove.
2630 2013-07-19 Roland McGrath <mcgrathr@google.com>
2632 * options.h (General_options): Add -Trodata-segment option.
2633 * parameters.cc (Parameters::check_rodata_segment): New function.
2634 (Parameters::set_target_once): Call it.
2635 * parameters.h (Parameters): Declare it (private member function).
2636 * layout.cc (load_seg_unusable_for_headers): New function, broken
2637 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2638 then validate rodata segment rather than text segment.
2639 (relaxation_loop_body): Call that.
2640 (is_text_segment): New function. Don't admit a non-executable
2641 segment if TARGET->isolate_execinstr().
2642 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2644 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
2647 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2648 * nacl.h (Sniff_file::View::View): Request aligned view.
2650 2013-07-11 Cary Coutant <ccoutant@google.com>
2652 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2653 correct BRLT entry size.
2655 2013-07-03 Alan Modra <amodra@gmail.com>
2657 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2660 2013-07-01 Cary Coutant <ccoutant@google.com>
2662 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2664 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2665 (Dwarf_ranges_table::lookup_reloc): New function.
2666 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2668 (Dwarf_ranges_table::lookup_reloc): New function.
2669 (Dwarf_ranges_table::reloc_type_): New data member.
2671 2013-06-27 Jing Yu <jingyu@google.com>
2674 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2676 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2677 (Target_powerpc::do_relax): Call the above.
2679 2013-06-27 Cary Coutant <ccoutant@google.com>
2681 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2682 on garbage collected .opd section.
2684 2013-06-27 Alan Modra <amodra@gmail.com>
2686 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2688 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2689 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2691 2013-06-14 Cary Coutant <ccoutant@google.com>
2693 * resolve.cc (Symbol::override_base): Don't override st_type
2694 from plugin placeholder symbols.
2695 (Symbol_table::resolve): Likewise.
2696 (Symbol_table::should_override): Don't complain about TLS mismatch
2697 if the TO symbol is a plugin placeholder.
2698 * testsuite/Makefile.am (plugin_test_tls): New test.
2699 * testsuite/Makefile.in: Regenerate.
2700 * testsuite/plugin_test_tls.sh: New test script.
2701 * testsuite/two_file_test_2_tls.cc: New test source.
2702 * testsuite/two_file_test_tls.cc: New test source.
2704 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2706 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2707 the maximum segment alignment is larger than the page size.
2708 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2709 correctly aligns the symbols with large alignemnt.
2710 * testsuite/Makefile.in: Regenerate.
2711 * testsuite/large_symbol_alignment.cc: New file.
2713 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2714 Sriraman Tallam <tmsriram@google.com>
2716 * options.h (sort_section): New option.
2717 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2718 Rename from Input_section_sort_section_name_special_ordering_compare.
2719 (Input_section_sort_section_name_compare): New struct.
2720 * output.cc (Output_section::Input_section_sort_section_name_compare::
2721 operator()): New function.
2722 (Output_section::sort_attached_input_sections): Use new sort function
2723 for .text if --sort-section=name is specified.
2724 * layout.cc (Layout::make_output_section):
2725 Add sorting by name when --sort-section=name is specified.
2726 * testsuite/Makefile.am (text_section_grouping): Test option
2727 --sort-section=name.
2728 * testsuite/Makefile.in: Regenerate.
2729 * testsuite/section_sorting_name.cc: New file.
2730 * testsuite/section_sorting_name.sh: New file.
2732 2013-05-21 Cary Coutant <ccoutant@google.com>
2734 * symtab.h (Symbol::is_cxx_vtable): New function.
2735 * target-reloc.h (relocate_section): Check for vtable symbol.
2736 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2737 * testsuite/Makefile.in: Regenerate.
2738 * testsuite/missing_key_func.cc: New test source.
2739 * testsuite/missing_key_func.sh: New test script.
2741 2013-05-21 Cary Coutant <ccoutant@google.com>
2743 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2744 type of enclosing symbol.
2745 (Relocate_info::location): Check symbol type when describing symbol.
2746 * object.h (Symbol_location_info): Remove unused line_number;
2747 add enclosing_symbol_type.
2748 * testsuite/debug_msg.sh: Adjust expected output.
2750 2013-05-13 Cary Coutant <ccoutant@google.com>
2752 * configure.ac: Export DEFAULT_TARGET.
2753 * configure: Regenerate.
2754 * Makefile.in: Regenerate.
2755 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2756 * testsuite/Makefile.in: Regenerate.
2757 * testsuite/debug_msg.sh: Delete duplicate tests.
2758 Don't check undef_int error message match for powerpc where the
2759 source file and line number aren't available.
2761 2013-05-10 Roland McGrath <mcgrathr@google.com>
2763 * options.h (General_options): Add --rosegment-gap option.
2764 * options.cc (finalize): --rosegment-gap implies --rosegment.
2765 * layout.cc (set_segment_offsets): Let user option override
2766 target->rosegment_gap().
2768 2013-05-10 Roland McGrath <mcgrathr@google.com>
2770 * options.h (General_options): Remove leading space from help
2771 messages for -nostdlib and --rosegment.
2773 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2776 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2778 2013-05-03 Alan Modra <amodra@gmail.com>
2780 * merge.cc (Output_merge_string::do_add_input_section): Correct
2781 scan for number of strings. Rename vars to avoid shadowing.
2782 Include missing terminator in input_size_.
2784 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2786 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2787 Restore empty string handling.
2789 2013-05-01 Cary Coutant <ccoutant@google.com>
2791 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2792 uninitialized warning.
2794 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2796 * output.cc (Output_section::add_merge_input_section): Allow
2797 to merge sections if the alignment is more than character size.
2798 * merge.h (Output_merge_string::Output_merge_string): Remove
2800 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2801 only not-null strings. Check the alignment of strings.
2803 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2804 alignment as the argument.
2805 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2806 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2807 Align non-zero length strings according to the addralign_.
2808 (Stringpool_template<Stringpool_char>::set_string_offsets):
2809 Updating offsets according to the given alignment.
2810 * testsuite/Makefile.am (text_section_grouping): Test if string
2811 literals are getting merged.
2812 * testsuite/Makefile.in: Regenerate.
2813 * testsuite/merge_string_literals_1.c: New file.
2814 * testsuite/merge_string_literals_2.c: Ditto.
2815 * testsuite/merge_string_literals.sh: Ditto.
2817 2013-04-26 Ian Lance Taylor <iant@google.com>
2819 * target-reloc.h (relocate_section): If the reloc offset is out of
2820 range, pass VIEW as NULL to relocate.relocate.
2821 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2822 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2823 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2824 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2825 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2826 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2828 2013-04-26 Geoff Pike <gpike@chromium.org>
2830 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2831 * layout.cc (Hash_task): New class.
2832 (Layout::queue_build_id_tasks): New function.
2833 (Layout::write_build_id): Handle single-thread portion of build ID
2834 computation. (In some cases, all of it is single-threaded.) Replace
2835 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2836 functionality in fewer lines of code.
2837 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2838 * options.h (General_options): make "--build-id" default to tree
2839 rather than sha1. Add two new options related to --build-id=tree:
2840 --build-id-chunk-size-for-treehash and
2841 --build-id-min-file-size-for-treehash.
2842 * Makefile.am: add testing of --build-id=tree and related new options
2843 (these tests will be invoked by "make check").
2844 * Makefile.in: Regenerate.
2846 2013-04-25 Alan Modra <amodra@gmail.com>
2848 * configure.tgt: Add powerpcle and powerpc64le.
2850 2013-04-22 Alan Modra <amodra@gmail.com>
2853 * layout.cc (Layout::segment_precedes): Allow more than one
2854 segment with the same type and flags.
2856 2013-04-15 Cary Coutant <ccoutant@google.com>
2858 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2859 allocate space in file for BSS sections.
2861 2013-04-15 Cary Coutant <ccoutant@google.com>
2863 * script-sections.cc (Orphan_output_section): Reset address
2864 to zero after each orphaned section for relocatable links.
2866 2013-04-15 Cary Coutant <ccoutant@google.com>
2868 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2869 section starting address for relocatable link.
2870 * testsuite/Makefile.am (script_test_11): New test.
2871 * testsuite/Makefile.in: Regenerate.
2872 * testsuite/script_test_11.c: New source file.
2873 * testsuite/script_test_11.t: New linker script.
2875 2013-04-13 Alan Modra <amodra@gmail.com>
2877 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2878 owner when sections are not adjacent and exceed group size.
2879 (Target_powerpc::group_sections): Handle corner case.
2880 (Target_powerpc::Branch_info::make_stub): Handle case where
2881 stub table doesn't exist due to branches in non-exec sections.
2882 (Target_powerpc::Relocate::relocate): Likewise.
2884 2013-04-11 Alan Modra <amodra@gmail.com>
2887 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2888 .branch_lt to match bfd ld. Adjust comments throughout file.
2890 2013-04-04 Ian Lance Taylor <iant@google.com>
2893 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2894 sections before checking whether they are included in the link.
2896 2013-03-29 Sriraman Tallam <tmsriram@google.com>
2898 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2899 object before calling the plugin claim_file handler. Pass the elf
2900 object of the archive to the plugin. Delete the elf object if the
2901 plugin claims the file.
2903 2013-03-21 Alan Modra <amodra@gmail.com>
2905 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2906 segment when omagic.
2908 2013-03-21 Alan Modra <amodra@gmail.com>
2910 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2912 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2913 uninitialized" warning.
2915 2013-03-20 Alan Modra <amodra@gmail.com>
2917 * symtab.h (Symbol::clear_version): New function.
2918 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2919 is_needed by weak references. Clear version for symbols defined
2920 in as-needed objects that are not needed.
2922 2013-03-15 Alan Modra <amodra@gmail.com>
2924 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2925 static and public. Add report_err param. Return false for data refs.
2926 (Target_powerpc::rela_dyn_section): New overloaded function.
2927 (Target_powerpc::plt_, iplt_): Elucidate.
2928 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2929 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2930 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2931 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2932 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2933 push_branch and make_plt_entry for ifunc syms when
2934 reloc_needs_plt_for_ifunc.
2935 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2936 for ifunc unless reloc_needs_plt_for_ifunc.
2938 2013-03-15 Alan Modra <amodra@gmail.com>
2940 * gc.h (gc_process_relocs): Don't look through function descriptors.
2941 * icf.cc (get_section_contents): Do so here instead.
2943 2013-03-13 Alan Modra <amodra@gmail.com>
2945 * powerpc.cc (is_branch_reloc): Forward declare.
2946 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2947 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2948 false for 64-bit, true for 32-bit non-branch relocs.
2949 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2950 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2952 (icf_safe_test): Generate linker map file as well as nm output.
2953 (icf_safe_so_test): Likewise.
2954 * testsuite/Makefile.in: Regenerate.
2955 * testsuite/icf_test.sh: Parse linker map file to determine
2957 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2958 * testsuite/icf_safe_so_test.sh: Likewise.
2959 (X86_32_or_ARM_specific_safe_fold): Merge into..
2960 (arch_specific_safe_fold): ..this.
2961 (X86_64_specific_safe_fold): Delete unused function.
2963 2013-03-12 Alan Modra <amodra@gmail.com>
2965 * gc.h (gc_process_relocs): Look through function descriptors
2966 to determine shndx, symvalue and addend used by ICF. Tidy
2967 variable duplication.
2969 2013-03-11 Alan Modra <amodra@gmail.com>
2971 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2972 * layout.cc (Layout_task_runner::run): ..to here.
2973 * symtab.h (struct Symbol_location): Extract from..
2974 (class Symbol_table): ..here.
2975 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2976 * target.h (class Target): Add function_location and
2977 do_function_location functions.
2978 (class Sized_target): Add do_function_location.
2979 * object.h (class Sized_relobj_file): Move find_shdr..
2980 (class Object): ..to here.
2981 * object.cc: Likewise. Update to suit. Instantiate.
2982 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2983 * powerpc.cc (class Powerpc_dynobj): New.
2984 (Target_powerpc::do_function_location): New function.
2985 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2986 (Powerpc_dynobj::do_read_symbols): New function.
2987 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2989 2013-03-08 Ian Lance Taylor <iant@google.com>
2991 * options.cc (General_options::string_to_object_format): Accept
2994 2013-03-08 Alan Modra <amodra@gmail.com>
2996 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2997 pointer to Post_fde.
2998 (struct Post_fde): Move definition to here..
2999 * ehframe.cc (struct Post_fde): ..from here.
3000 (Cie::write): Don't alloc Post_fde.
3001 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3003 2013-03-07 Alan Modra <amodra@gmail.com>
3005 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3006 relocation referencing .LC0.
3007 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3009 2013-03-07 Alan Modra <amodra@gmail.com>
3011 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3012 always_inline. Add assembly for powerpc to avoid GOT.
3014 2013-03-07 Alan Modra <amodra@gmail.com>
3016 * testsuite/script_test_10.sh: Don't test .bss section
3019 2013-03-06 Alan Modra <amodra@gmail.com>
3021 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3022 (Target_powerpc::symval_for_branch): Add symtab param. Update
3023 all callers. Handle folded sections.
3024 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3026 (Global_symbol_visitor_opd::operator()): Likewise.
3028 2013-03-04 Alan Modra <amodra@gmail.com>
3030 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3031 * testsuite/Makefile.in: Regenerate.
3033 2013-03-01 Cary Coutant <ccoutant@google.com>
3035 Add dwp support for v2 DWARF package file format.
3036 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3037 tu_length parameter. Adjust all callers.
3038 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3039 * dwp.cc: Include dwarf.h.
3040 (Section_bounds): New struct type.
3041 (Unit_set): New struct type.
3042 (Dwo_file::Dwo_file): Initialize new data member.
3043 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3044 Combine and rename to...
3045 (Dwo_file::read_unit_index): ...this.
3046 (Dwo_file::sized_read_compunit_index)
3047 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3048 (Dwo_file::sized_read_unit_index): ...this.
3049 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3050 parameters; add section_id parameter.
3051 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3052 (Dwo_file::add_unit_set): ...this.
3053 (Dwo_file::shndx_map_): Remove.
3054 (Dwo_file::sect_offsets_): New data member.
3055 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3056 (Dwp_output_file::add_section): Rename to...
3057 (Dwp_output_file::add_contribution): ...this.
3058 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3059 (Dwp_output_file::add_tu_set): Likewise.
3060 (Dwp_output_file::Contribution): New type.
3061 (Dwp_output_file::Section::contributions): New data member.
3062 (Dwp_output_file::Cu_or_tu_set): Remove.
3063 (Dwp_output_file::Section::Section): New ctor.
3064 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3065 (Dwp_output_file::Dwp_index::Section_table): New type.
3066 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3067 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3069 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3070 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3071 (Dwp_output_file::Dwp_index::section_table): New member function.
3072 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3073 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3074 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3075 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3076 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3077 (Dwp_output_file::Dwp_index::section_table_): New data member.
3078 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3079 (Dwp_output_file::add_output_section): New member function.
3080 (Dwp_output_file::write_new_section): New member function.
3081 (Dwp_output_file::write_contributions): New member function.
3082 (Dwp_output_file::section_id_map_): New data member.
3083 (class Dwo_id_info_reader): Remove.
3084 (class Unit_reader): New class.
3085 (get_dwarf_section_name): New function.
3086 (Dwo_file::read_executable): Adjust initializations of class data.
3087 (Dwo_file::read): Add support for v2 package file format.
3088 (Dwo_file::read_unit_index): Likewise.
3089 (Dwo_file::sized_read_unit_index): Likewise.
3090 (Dwo_file::copy_section): Likewise.
3091 (Dwo_file::add_unit_set): Likewise.
3092 (Dwp_output_file::add_output_section): Likewise.
3093 (Dwp_output_file::add_contribution): Likewise.
3094 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3096 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3098 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3100 (Dwp_output_file::initialize): Remove unused function.
3101 (Dwp_output_file::finalize): Add support for v2 package file format.
3102 (Dwp_output_file::write_index): Likewise.
3103 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3106 2013-03-01 Cary Coutant <ccoutant@google.com>
3108 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3109 function into class definition in header file.
3110 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3111 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3113 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3115 2013-02-28 Alan Modra <amodra@gmail.com>
3117 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3118 * target.cc (Target::do_plt_fde_location): New function.
3119 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3120 accessor function, and constructor param.
3121 (struct Post_fde, Post_fdes): Declare.
3122 (Cie::write): Add post_fdes param.
3123 * ehframe.cc (Fde::write): Use plt_fde_location.
3124 (struct Post_fde): Define.
3125 (Cie::write): Stash FDEs added post merge mapping.
3126 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3127 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3128 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3130 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3131 (Target_powerpc::has_glink): New function.
3132 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3133 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3134 glink_eh_frame_fde_32, default_fde): New data.
3135 (Stub_table::eh_frame_added_): New var.
3136 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3138 (Stub_table::add_eh_frame): New function.
3139 (Output_data_glink::add_eh_frame): New function.
3140 (Target_powerpc::make_glink_section): Call add_eh_frame.
3142 2013-02-15 Ian Lance Taylor <iant@google.com>
3144 * options.h (DEFINE_uint64_alias): Define.
3145 (class General_options): Add -Ttext-segment as an alias for
3148 2013-02-15 Alan Modra <amodra@gmail.com>
3150 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3151 (Stub_table::do_write): ..here, two places.
3152 (Stub_table::plt_call_size): Use it here too.
3154 2013-02-11 Ian Lance Taylor <iant@google.com>
3156 * descriptors.cc (Descriptors::close_all): New function.
3157 * descriptors.h (class Descriptors): Declare close_all.
3158 (close_all_descriptors): New inline function.
3159 * plugin.cc: Include "descriptors.h".
3160 (Plugin_manager::cleanup): Call close_all_descriptors.
3162 2013-02-06 Alan Modra <amodra@gmail.com>
3164 * README: Update coding style link.
3166 2013-01-28 Cary Coutant <ccoutant@google.com>
3168 * dwp.cc (File_list): New typedef.
3169 (Dwo_name_info_reader): New class.
3170 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3171 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3172 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3173 (Dwo_file::read_executable): New function.
3174 (Dwo_file::read): Move common setup code to ...
3175 (Dwo_file::make_object): ... here.
3176 (dwp_options): Add --exec/-e.
3180 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3182 * layout.cc (Layout::layout): Check for option text_reorder.
3183 (Layout::make_output_section): Ditto.
3184 * options.h (text_reorder): New option.
3185 * output.cc (Input_section_sort_compare): Remove special ordering
3188 Input_section_sort_section_name_special_ordering_compare::
3189 operator()): New function.
3190 (Output_section::sort_attached_input_sections): Use new sort function
3192 * output.h (Input_section_sort_section_name_special_ordering_compare):
3194 * testsuite/Makefile.am (text_section_grouping): Test option
3196 * testsuite/Makefile.in: Regenerate.
3197 * testsuite/text_section_grouping.sh: Check order of functions without
3198 default text reordering.
3200 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3202 * options.h (General_options): Change default to true for new_dtags.
3204 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3206 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3207 when enable_new_dtags is false. Only add DT_RUNPATH when
3208 enable_new_dtags is true.
3210 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3212 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3213 used in declaration and definition consistent.
3214 (Target_powerpc::symval_for_branch): Ditto.
3216 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3218 * testsuite/plugin_final_layout.cc: Fix comment.
3220 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3222 * layout.cc (Layout::layout): Do not do default sorting for
3223 text sections when section ordering is specified.
3224 (make_output_section): Ditto.
3225 * testsuite/plugin_final_layout.cc: Name the function sections
3226 to catch reordering issues.
3228 2013-01-15 Alan Modra <amodra@gmail.com>
3230 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3233 2013-01-15 Alan Modra <amodra@gmail.com>
3235 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3236 * testsuite/Makefile.in: Regenerate.
3238 2013-01-14 Alan Modra <amodra@gmail.com>
3240 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3241 * testsuite/Makefile.in: Regenerate.
3243 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3246 Fix mingw gold build with plugins enabled
3247 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3248 * configure.ac: Export DLOPEN_LIBS and add headers check.
3249 * plugin.cc: Handle non-dlfcn case.
3250 * Makefile.in: Regenerate.
3251 * config.in: Regenerate.
3252 * configure: Regenerate.
3253 * testsuite/Makefile.in: Regenerate.
3255 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3257 * output.h (sort_attached_input_sections): Change to be public.
3258 * script-sections.cc
3259 (Output_section_definition::set_section_addresses): Sort
3260 attached input sections according to section order before linker
3261 script assigns section addresses.
3262 (Orphan_output_section::set_section_addresses): Sort
3263 attached input sections according to section order before linker
3264 script assigns section addresses.
3265 * Makefile.am (final_layout.sh): Use a simple linker script to
3266 check if section ordering still works.
3267 * Makefile.in: Regenerate.
3269 2013-01-09 Ben Cheng <bccheng@google.com>
3271 * arm.cc (Target_arm::attributes_accept_div): New function.
3272 (Target_arm::attributes_forbid_div): New function.
3273 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3274 attribute using the same new functions as what bfd/elf32_arm.c
3277 2013-01-07 Cary Coutant <ccoutant@google.com>
3280 * output.cc (Output_section::add_input_section): For incremental
3281 updates, don't track input sections that are allocated from patch
3284 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3285 Ian Lance Taylor <iant@google.com>
3288 * configure.ac (--enable-ld): Removed.
3289 (install_as_default): Set to yes only for --enable-gold=default
3291 * configure: Regenerated.
3293 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3295 * options.h (General_options): Add -fuse-ld= for GCC linker
3296 option compatibility.
3298 2013-01-04 Cary Coutant <ccoutant@google.com>
3300 * configure.ac: Fix typo restoring CXXFLAGS.
3301 * configure: Regenerate.
3303 2013-01-04 Cary Coutant <ccoutant@google.com>
3305 * testsuite/Makefile.am (CXXLINK_S): New macro.
3306 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3307 * testsuite/Makefile.in: Regenerate.
3309 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3311 * version.cc (print_version): Update copyright year to 2013.
3313 2012-12-20 Ian Lance Taylor <iant@google.com>
3315 * layout.cc (Layout::special_ordering_of_input_section): New
3317 (Layout::layout): If input section requires special ordering, must
3318 sort input sections.
3319 (Layout::make_output_section): May sort .text input sections.
3320 (Layout::is_section_name_prefix_grouped): Remove.
3321 * layout.h (class Layout): Declare
3322 special_ordering_of_input_section. Don't declare
3323 is_section_name_prefix_grouped.
3324 * output.cc (Output_section::add_input_section): Revert last
3326 (Output_section::Input_section_sort::match_file_name): Don't crash
3327 if called on output section data.
3328 (Output_section::Input_section_sort_compare): Sort based on
3330 (Output_section::Input_section_sort_section_order_index_compare):
3332 (Output_section::sort_attached_input_sections): Likewise.
3334 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3336 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3337 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3338 * output.cc (Output_section::add_input_section): Check if section
3339 name contains special prefix. Keep input sections to sort such
3341 (Output_section::Input_section_sort_section_order_index_compare
3342 ::operator()): Group sections according to prefixes.
3343 (Output_section::sort_attached_input_sections): Add condition to
3344 Input_section_entry constructor call.
3345 * testsuite/Makefile.am (text_section_grouping): New test.
3346 * testsuite/Makefile.in: Regenerate.
3347 * testsuite/text_section_grouping.cc: New file.
3348 * testsuite/text_section_grouping.sh: New file.
3350 2012-12-17 Nick Clifton <nickc@redhat.com>
3352 * Makefile.am: Add copyright notice.
3355 * configure.ac: Likewise.
3356 * ftruncate.c: Likewise.
3357 * Makefile.in: Regenerate.
3359 2012-12-14 Cary Coutant <ccoutant@google.com>
3361 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3362 --no-as-needed flag.
3363 (exception_separate_shared_12_test): Likewise.
3364 (incremental_copy_test): Likewise.
3365 * testsuite/Makefile.in: Regenerate.
3367 2012-12-14 Cary Coutant <ccoutant@google.com>
3369 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3370 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3372 2012-12-12 Alan Modra <amodra@gmail.com>
3374 * powerpc.cc (class Track_tls): New.
3375 (class Relocate, class Scan): Inherit Track_tls.
3376 (Target_powerpc::Scan::local, global): Track tls optimization
3377 and avoid creating plt entry for __tls_get_addr if all uses
3379 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3381 2012-12-12 Alan Modra <amodra@gmail.com>
3383 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3384 Replace no_toc_optimize with toc_optimize.
3385 * output.h (Output_section::input_sections): Provide non-const variant.
3386 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3387 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3389 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3390 (class Sort_toc_sections): New.
3391 (Target_powerpc::do_finalize_sections): Sort toc sections.
3392 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3394 2012-12-10 Roland McGrath <mcgrathr@google.com>
3396 * testsuite/binary_unittest.cc (read_all): New function.
3397 (Sized_binary_test): Use it instead of ::read.
3398 * fileread.cc (do_read): Don't assume pread always reads the whole
3399 amount in a single call.
3401 2012-12-10 Alan Modra <amodra@gmail.com>
3403 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3404 Set EM_PPC64 or EM_PPC here.
3405 (Target_selector_powerpc::do_recognize): Delete.
3407 2012-12-10 Alan Modra <amodra@gmail.com>
3409 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3411 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3413 2012-12-07 Roland McGrath <mcgrathr@google.com>
3415 * testsuite/binary_unittest.cc (Sized_binary_test):
3416 Use open_descriptor rather than ::open.
3418 2012-12-07 Alan Modra <amodra@gmail.com>
3420 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3421 typedef and invalid_address constant.
3422 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3423 instantiate constants.
3425 2012-12-06 Roland McGrath <mcgrathr@google.com>
3427 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3428 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3429 * aclocal.m4: Regenerate.
3430 * configure: Regenerate.
3431 * Makefile.in: Regenerate.
3432 * testsuite/Makefile.in: Regenerate.
3434 2012-12-07 Alan Modra <amodra@gmail.com>
3436 * options.h (General_options): Add no_toc_optimize.
3437 * powerpc.cc (ok_lo_toc_insn): New function.
3438 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3440 2012-12-06 Alan Modra <amodra@gmail.com>
3442 * options.h (General_options): Add plt_align, plt_static_chain,
3443 plt_thread_safe. Update stub_group_size help text.
3444 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3445 for new plt_thread_safe_ var.
3446 (use_plt_offset): Correct comments.
3447 (Target_powerpc::do_relax): Look for thread creation symbols to
3448 determine default plt_thread_safe value. Clear plt call stubs
3449 as well as branch stubs each iteration.
3450 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3452 (l, hi, ha, write_insn): Move earlier.
3453 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3454 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3456 (Stub_table::update_size): Adjust.
3457 (Stub_table::prev_size, set_prev_size): Delete.
3458 (Stub_table::stub_align): Let --plt-align affect result.
3459 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3460 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3461 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3462 (Stub_table::do_write): Support more stub variants.
3464 2012-12-04 Alan Modra <amodra@gmail.com>
3466 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3467 (Target_powerpc::do_define_standard_symbols): New function.
3469 2012-12-03 Alan Modra <amodra@gmail.com>
3471 * output.h: Formatting, whitespace.
3473 2012-12-03 Alan Modra <amodra@gmail.com>
3475 * layout.h (Layout::get_executable_sections): Declare.
3476 * layout.cc (Layout::get_executable_sections): New function.
3477 * arm.cc (Target_arm::group_sections): Use it.
3478 (Arm_output_section::group_sections): Delete now redundant test.
3479 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3480 param to handle relative relocs.
3481 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3482 (Output_data_reloc::add_absolute): Adjust.
3483 (Output_data_reloc::add_relative): New function.
3484 (Output_data::reset_data_size): New function.
3485 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3486 (Output_section::set_addralign): New function.
3487 (Output_section::checkpoint_set_addralign): New function.
3488 (Output_section::clear_section_offsets_need_adjustment): New function.
3489 (Output_section::input_sections): Make public.
3490 * powerpc.cc (class Output_data_brlt_powerpc): New.
3491 (class Stub_table, class Stub_control): New.
3492 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3493 stub_table_, set_stub_table, stub_table): New vectors and accessor
3495 (Target_powerpc::do_may_relax, do_relax, push_branch,
3496 new_stub_table, stub_tables, brlt_section, group_sections,
3497 add_branch_lookup_table, find_branch_lookup_table,
3498 write_branch_lookup_table, make_brlt_section): New functions.
3499 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3500 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3501 branch_info_): New vars.
3502 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3503 make call stubs here.
3504 (Output_data_glink): Remove all call stub handling from this class.
3505 (Target_powerpc::Scan::local, global): Save interesting branch
3506 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3507 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3508 functions on final link.
3509 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3510 Handle long branch destinations too.
3511 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3512 do_plt_address_for_local): Adjust lookup of plt call stubs.
3514 2012-11-30 Alan Modra <amodra@gmail.com>
3516 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3517 relocs against protected symbols when building 32-bit shared libs.
3519 2012-11-30 Alan Modra <amodra@gmail.com>
3521 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3522 param. Call got_section() to make .got. Update all callers
3523 and their callers and so on.
3525 2012-11-30 Alan Modra <amodra@gmail.com>
3527 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3528 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3529 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3530 value if it already exists.
3532 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3535 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3537 2012-11-14 Roland McGrath <mcgrathr@google.com>
3539 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3540 than bfc instruction for data sandboxing.
3542 2012-11-08 Alan Modra <amodra@gmail.com>
3544 * po/POTFILES.in: Regenerate.
3546 2012-11-05 Alan Modra <amodra@gmail.com>
3548 * configure.ac: Apply 2012-09-10 change to config.in here.
3549 * configure: Regenerate.
3551 2012-11-05 Alan Modra <amodra@gmail.com>
3553 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3554 (struct Opd_ent): Use "Address" rather than "Offset".
3555 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3556 (Target_powerpc::got_section): Make public.
3557 (Target_powerpc::scan_relocs): Move code setting symbols..
3558 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3559 Create _SDA_BASE_ only when referenced.
3561 2012-11-02 Roland McGrath <mcgrathr@google.com>
3563 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3566 2012-11-01 Roland McGrath <mcgrathr@google.com>
3568 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3569 for offset_in_output_section parameter.
3570 (Sized_target::relocate_special_relocatable): Likewise.
3571 * arm.cc (Target_arm::relocate_relocs): Likewise.
3572 (Target_arm::relocate_special_relocatable): Likewise.
3573 * i386.cc (Target_i386::relocate_relocs): Likewise.
3574 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3575 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3576 * target-reloc.h (relocate_relocs): Likewise.
3577 * testsuite/testfile.cc (Target_test): Likewise.
3578 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3579 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3581 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3582 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3584 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3585 parameter, which is unused in the [!F_SETFD] case.
3587 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3588 SYMNDX to off_t before comparing it to this->data_size().
3589 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3590 * incremental.cc (Output_section_incremental_inputs::do_write):
3591 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3593 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3595 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3597 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3598 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3601 2012-10-29 Cary Coutant <ccoutant@google.com>
3603 * dwp.cc (usage): Add file and exit status parameters;
3604 add --help and --version options.
3605 (print_version): New function.
3606 (main): Add --help and --version options.
3608 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3610 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3611 final_layout_sequence.txt.
3612 * testsuite/Makefile.in: Regenerated.
3614 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3616 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3617 COMPILE generated by automake.
3619 (CXXCOMPILE1): Likewise.
3620 (CXXLINK1): Likewise.
3621 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3623 (CXXCOMPILE): Likewise.
3624 (CXXLINK): Likewise.
3625 * testsuite/Makefile.in: Regenerated.
3627 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3629 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3630 on bad fwrite return.
3632 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3634 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3637 2012-10-23 Cary Coutant <ccoutant@google.com>
3639 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3640 * testsuite/Makefile.in: Regenerate.
3641 * testsuite/dwp_test.h: New source file.
3642 * testsuite/dwp_test_1.cc: New source file.
3643 * testsuite/dwp_test_1.s: New source file.
3644 * testsuite/dwp_test_1.sh: New source file.
3645 * testsuite/dwp_test_1b.cc: New source file.
3646 * testsuite/dwp_test_1b.s: New source file.
3647 * testsuite/dwp_test_2.cc: New source file.
3648 * testsuite/dwp_test_2.s: New source file.
3649 * testsuite/dwp_test_2.sh: New source file.
3650 * testsuite/dwp_test_main.cc: New source file.
3651 * testsuite/dwp_test_main.s: New source file.
3653 2012-10-23 Cary Coutant <ccoutant@google.com>
3655 * dwp.h: New header file.
3656 * dwp.cc: New source file.
3657 * gold.h: Move shared declarations to system.h.
3658 * system.h: New header file.
3659 * Makefile.am: Add dwp.
3660 * Makefile.in: Regenerate.
3662 2012-10-23 Cary Coutant <ccoutant@google.com>
3664 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3665 Dwarf_info_reader::read_from_pointer.
3666 (Dwarf_pubnames_table::read_header): Likewise.
3667 (Dwarf_pubnames_table::next_name): Likewise.
3668 (Dwarf_die::read_attributes): Likewise.
3669 (Dwarf_die::skip_attributes): Likewise.
3670 (Dwarf_info_reader::read_from_pointer): New function template.
3671 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3672 (Dwarf_pubnames_table): Likewise.
3673 (Dwarf_info_reader::read_from_pointer): New function template.
3674 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3675 Dwarf_pubnames_table ctor.
3677 2012-10-23 Cary Coutant <ccoutant@google.com>
3679 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3681 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3683 (Dwarf_info_reader::set_abbrev_shndx): New method.
3684 (Dwarf_info_reader::abbrev_shndx_): New data member.
3686 2012-10-23 Cary Coutant <ccoutant@google.com>
3688 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3689 from object, not parameters.
3690 (Dwarf_info_reader::parse): Likewise.
3691 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3692 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3693 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3696 2012-10-23 Cary Coutant <ccoutant@google.com>
3698 * fileread.cc (Input_file::Input_file): New constructor.
3699 * fileread.h (class Input_file): Add new constructor.
3701 2012-10-18 Alan Modra <amodra@gmail.com>
3704 * object.cc (Relobj::is_section_name_included): Also match
3705 .sdata personality section.
3707 2012-10-18 Alan Modra <amodra@gmail.com>
3709 * target-reloc.h (class Default_comdat_behavior): New, package up..
3710 (get_comdat_behaviour): ..this.
3711 (relocate_section): Add Relocate_comdat_behavior template arg,
3712 adjust code to suit.
3713 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3714 (Target_arm::scan_reloc_section): Likewise.
3715 * i386.cc (Target_i386::relocate_section): Likewise.
3716 * sparc.cc (Target_sparc::relocate_section): Likewise.
3717 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3718 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3719 * powerpc.cc (class Relocate_comdat_behavior): New.
3720 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3721 gold::relocate_section with new template arg.
3723 2012-10-18 Alan Modra <amodra@gmail.com>
3725 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3726 dynamic relocs for GOT_TPREL got entries, without symbol if
3728 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3729 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3730 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3732 2012-10-17 Alan Modra <amodra@gmail.com>
3735 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3737 2012-10-16 Sriraman Tallam <tmsriram@google.com>
3739 * layout.cc (Layout::include_section): Keep sections marked
3740 SHF_EXCLUDE when doing relocatable links.
3742 2012-10-16 Alan Modra <amodra@gmail.com>
3744 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3745 (Target_powerpc::do_finalize_sections): Call it.
3746 (Output_data_save_res): New class and supporting functions.
3747 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3748 normal symbols defined in object files.
3750 2012-10-12 Alan Modra <amodra@gmail.com>
3752 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3753 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3754 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3755 section if scan_opd_relocs not yet called.
3756 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3758 2012-10-12 Alan Modra <amodra@gmail.com>
3760 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3761 add_local_ifunc_entry): Revert last change.
3762 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3764 2012-10-05 Alan Modra <amodra@gmail.com>
3766 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3767 do_plt_address_for_global): New functions.
3768 (Output_data_got_powerpc::do_write): Don't segfault when linking
3770 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3771 add_local_ifunc_entry): Return true on adding entry..
3772 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3773 glink->add_entry call. Remove unused symtab param. Adjust calls.
3774 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3775 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3776 set up symbols here.
3777 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3778 syms here. Do so even when no .iplt. Don't segfault when linking
3780 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3781 new variants without reloc param.
3782 (Glink_sym_ent::Glink_sym_ent): Likewise.
3783 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3784 reloc when refs will resolve to plt call stub.
3785 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3786 R_PPC_PLTREL24 to resolve locally.
3787 (Target_powerpc::Scan::global): Correct ifunc handling.
3788 (Target_powerpc::Relocate::relocate): Correct local sym glink
3789 lookup. Don't destroy "value" when we have a plt call stub,
3790 and when checking plt call validity.
3791 (Target_powerpc::do_dynsym_value): Simplify.
3793 2012-10-05 Alan Modra <amodra@gmail.com>
3795 * i386.cc (Output_data_plt_i386::address_for_global,
3796 address_for_local): Add plt offset to returned value. Adjust uses.
3797 * sparc.cc (Output_data_plt_sparc::address_for_global,
3798 address_for_local): Likewise.
3799 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3800 address_for_local): Likewise.
3801 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3802 address_for_local): Likewise.
3803 * target.h (Target::plt_address_for_global, plt_address_for_local):
3805 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3806 (Output_data_got::Got_entry::write): Nor here.
3807 * output.h: Comment fix.
3809 2012-10-02 Jiong Wang <jiwang@tilera.com>
3811 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3812 global_offset_table_ value for larget got.
3813 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3815 2012-09-29 Alan Modra <amodra@gmail.com>
3817 * powerpc.cc (Target_powerpc::iplt_): New output section.
3818 (Target_powerpc::iplt_section, make_iplt_section,
3819 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3820 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3821 Target_powerpc::plt_entry_count): Count iplt entries too.
3822 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3823 reloc section in constructor. New params.
3824 (Target_powerpc::make_plt_section): Create reloc section here instead.
3825 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3827 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3828 (Output_data_glink::add_entry, find_entry): New functions to
3829 deal with local syms.
3830 (Glink_sym_ent): Add support for local syms.
3831 (Output_data_glink::do_write): Handle ifunc plt entries.
3832 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3833 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3834 (Target_powerpc::Relocate::relocate): Likewise.
3835 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3837 2012-09-25 Alan Modra <amodra@gmail.com>
3839 * object.h (Sized_relobj_file::adjust_local_symbol,
3840 do_adjust_local_symbol): New functions.
3841 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3842 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3843 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3844 and irregular opd entry spacing.
3845 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3846 (Global_symbol_visitor_opd): New functor.
3847 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3848 on deleted opd entries.
3850 2012-09-15 Jiong Wang <jiwang@tilera.com>
3852 * tilegx.cc: New file.
3853 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3854 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3855 * configure.tgt: Add entries for tilegx*.
3856 * configure.ac: Likewise.
3857 * Makefile.in: Rebuild.
3858 * configure: Likewise.
3859 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3862 2012-09-13 Alan Modra <amodra@gmail.com>
3864 * target-reloc.h (scan_relocs): Call scan.local for relocs
3865 against symbols in discarded sections. Pass is_discarded
3867 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3868 Add is_discarded param.
3869 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3870 is_discarded to flag opd entry as discarded. Don't emit dyn
3871 relocs on such entries.
3872 (Target_powerpc::Scan::global): Similarly detect and handle
3874 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3875 opd_ent_. Update all uses.
3876 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3877 (Target_powerpc::relocate_section): Zero out discarded opd
3880 2012-09-12 Ian Lance Taylor <iant@google.com>
3883 * output.cc: Rename Output_data_got template parameter from size
3884 to got_size for all functions. Compile all variants of
3886 (Output_data_got::Got_entry::write): Correct use of size for
3887 symbol value. Use local_is_tls rather than casting to
3889 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3890 (class Sized_relobj_file): Add do_local_is_tls.
3891 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3893 2012-09-11 Alan Modra <amodra@gmail.com>
3896 * layout.cc (Layout::set_segment_offsets): When using
3897 common-page-size alignment, ensure we are on a new max-page-size
3899 * output.cc (Output_segment::set_section_addresses): Use
3900 abi_pagesize, not common_pagesize for relro boundary.
3901 (Output_segment::set_offset): Likewise.
3903 2012-09-11 Alan Modra <amodra@gmail.com>
3905 * output.h (Output_data_got::add_global_tls, add_local_tls,
3906 add_local_tls_pair): New functions.
3907 (Output_data_got::add_local_pair_with_rel): Remove second
3908 reloc param. Expand comment.
3909 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3910 use_plt_or_tls_offset_, similarly for constructor param.
3911 (Output_data_got::Got_entry::write): Add got_index param.
3912 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3913 add_local_tls_pair): New functions.
3914 (Output_data_got::Got_entry::write): Handle tls symbols
3915 with use_plt_or_tls_offset_ set specially.
3916 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3917 (Output_data_got::do_write): Replace iterator with index, pass
3918 index to entry write function.
3919 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3920 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3921 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3923 * i386.cc (Target_i386::Scan::local): Likewise.
3924 * sparc.cc (Target_sparc::Scan::local): Likewise.
3925 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3926 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3927 do_tls_offset_for_global): New functions.
3928 (Target_powerpc::Scan::local): Correct TLS relocations and got
3930 (Target_powerpc::Scan::global): Don't emit unnecessary
3931 dynamic relocations on TLS GOT entries.
3933 2012-09-10 Matthias Klose <doko@ubuntu.com>
3935 * config.in: Disable sanity check for kfreebsd.
3937 2012-09-10 Sterling Augustine <saugustine@google.com>
3939 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3940 (Gdb_index::pubtypes_read): New parameter.
3941 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3943 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3946 2012-09-09 Alan Modra <amodra@gmail.com>
3948 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3949 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3950 * gc.h (gc_process_relocs): Call target gc_add_reference.
3951 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3952 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3953 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3955 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3956 to cater for when we don't need code offset. Update use.
3957 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3958 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3959 set_opd_valid): New functions.
3960 (Target_powerpc::do_gc_add_reference): New function.
3961 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3963 (Target_powerpc::do_gc_mark_symbol): New function.
3965 2012-09-06 Cary Coutant <ccoutant@google.com>
3967 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3968 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3969 (Dwarf_die::skip_attributes): Likewise.
3970 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3971 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3973 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3975 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3977 * testsuite/script_test_3.t: Add .got.plt output section
3979 * testsuite/script_test_4.t: Likewise.
3981 2012-09-05 Alan Modra <amodra@gmail.com>
3983 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3984 update all uses and lose "enum" when using type.
3986 2012-09-05 Alan Modra <amodra@gmail.com>
3988 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3989 * configure: Regenerate.
3990 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3991 (plugin_final_layout.stdout): Likewise.
3992 (memory_test): Set page sizes to 0x1000.
3993 * testsuite/Makefile.in: Regenerate.
3994 * testsuite/discard_locals_test.sh: Add FIXME comment.
3995 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3996 * testsuite/pr14265.t: Add .got output section statement.
3997 * testsuite/script_test_2.t: Likewise.
3998 * testsuite/script_test_3.t: Likewise.
3999 * testsuite/script_test_4.t: Likewise.
4000 * testsuite/script_test_5.t: Likewise.
4001 * testsuite/script_test_6.t: Likewise.
4002 * testsuite/script_test_7.t: Likewise.
4003 * testsuite/script_test_9.t: Likewise.
4005 2012-09-05 Alan Modra <amodra@gmail.com>
4007 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4008 (Powerpc_relocate_functions::Status): New typedef.
4009 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4010 (Target_powerpc::Scan::local): Handle REL64.
4011 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4012 for REL32 and REL64.
4013 (Target_powerpc::symval_for_branch): New function, extracted from..
4014 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4015 checks. Report overflow errors.
4017 2012-09-05 Alan Modra <amodra@gmail.com>
4019 * object.h (Sized_relobj_file::emit_relocs): Delete.
4020 (Sized_relobj_file::emit_relocs_reltype): Delete.
4021 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4022 relocate_relocs for --emit-relocs.
4023 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4024 * output.h: Update comment.
4025 (Output_segment::first_section): New function.
4026 (Output_segment::first_section_load_address): Use first_section.
4027 * output.cc (Output_segment::first_section): New function extracted..
4028 (Output_segment::first_section_load_address): ..from here. Delete.
4029 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4030 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4031 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4032 adjust call to target.h function.
4033 * i386.cc (Target_i386): Likewise.
4034 * sparc.cc (Target_sparc): Likewise.
4035 * x86_64.cc (Target_x86_64): Likewise.
4036 * powerpc.cc (Target_powerpc): Likewise.
4037 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4038 first tls section has section symbol for optimised local dynamic
4040 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4041 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4043 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4044 Rename to relocate_relocs. Update error message.
4046 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4048 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4051 2012-08-31 Alan Modra <amodra@gmail.com>
4053 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4054 (Powerpc_relobj::toc_base_offset): New stub function.
4055 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4056 got_mod_index_offset to tlsld_got_offset. Update all refs.
4057 (Target_powerpc::Relocate::enum skip_tls): New.
4058 (Target_powerpc::call_tls_get_addr_): New var.
4059 (Target_powerpc::is_branch_reloc): Move to file scope.
4060 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4061 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4063 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4064 (powerpc_info): Correct common_pagesize for ppc64.
4065 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4066 (Powerpc_relocate_functions): Add overflow check enums and functions.
4067 Add non-shift version of rela, rela_ua. Delete all rel public
4068 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4069 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4070 addr16_ha3, addr14 functions.
4071 (Output_data_got_powerpc::add_constant_pair): New function.
4072 (Output_data_got_powerpc::got_base_offset): Likewise.
4073 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4074 (instruction constants): Sort, add some more.
4075 (Output_data_glink::do_write): Add and use Address typedef. Use
4076 object->toc_base_offset() stub for 64-bit.
4077 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4078 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4079 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4080 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4081 Always treat .opd relocs as against locally defined symbol.
4082 Correct condition for RELATIVE relocs.
4083 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4084 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4085 for 32-bit syms with a plt entry. Correct ppc64 toc base
4086 calculations. Handle TLS relocs, and more. Add overflow
4087 checking and adjust for Powerpc_relocate_functions changes.
4088 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4089 Reinstate --emit-relocs code with FIXME.
4091 2012-08-30 Alan Modra <amodra@gmail.com>
4093 * layout.cc (Layout::set_segment_offsets): Set p_align to
4094 abi_pagesize, not common_pagesize.
4095 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4096 to determine whether file header can go in segment.
4098 2012-08-30 Alan Modra <amodra@gmail.com>
4100 * output.h (Output_reloc::Output_reloc <output section>): Add
4101 is_relative param. Adjust calls.
4102 (Output_reloc::add_output_section_relative): New functions.
4103 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4105 (Output_reloc::symbol_value): Handle SECTION_CODE.
4107 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4109 * gold.cc (queue_middle_tasks): Call layout again when unique
4110 segments for sections is desired.
4111 * layout.cc (Layout::Layout): Initialize new members.
4112 (Layout::get_output_section_flags): New function.
4113 (Layout::choose_output_section): Call get_output_section_flags.
4114 (Layout::layout): Make output section for mapping to a unique segment.
4115 (Layout::insert_section_segment_map): New function.
4116 (Layout::attach_allocated_section_to_segment): Make unique segment for
4117 output sections marked so.
4118 (Layout::segment_precedes): Check for unique segments when sorting.
4119 * layout.h (Layout::Unique_segment_info): New struct.
4120 (Layout::Section_segment_map): New typedef.
4121 (Layout::insert_section_segment_map): New function.
4122 (Layout::get_output_section_flags): New function.
4123 (Layout::is_unique_segment_for_sections_specified): New function.
4124 (Layout::set_unique_segment_for_sections_specified): New function.
4125 (Layout::unique_segment_for_sections_specified_): New member.
4126 (Layout::section_segment_map_): New member.
4127 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4128 Rename is_gc_pass_one to is_pass_one.
4129 Rename is_gc_pass_two to is_pass_two.
4130 Rename is_gc_or_icf to is_two_pass.
4131 Check for which pass based on whether symbols data is present.
4132 Make it two pass when unique segments for sections is desired.
4133 * output.cc (Output_section::Output_section): Initialize new
4135 * output.h (Output_section::is_unique_segment): New function.
4136 (Output_section::set_is_unique_segment): New function.
4137 (Output_section::is_unique_segment_): New member.
4138 (Output_section::extra_segment_flags): New function.
4139 (Output_section::set_extra_segment_flags): New function.
4140 (Output_section::extra_segment_flags_): New member.
4141 (Output_section::segment_alignment): New function.
4142 (Output_section::set_segment_alignment): New function.
4143 (Output_section::segment_alignment_): New member.
4144 (Output_segment::Output_segment): Initialize is_unique_segment_.
4145 (Output_segment::is_unique_segment): New function.
4146 (Output_segment::set_is_unique_segment): New function.
4147 (Output_segment::is_unique_segment_): New member.
4148 * plugin.cc (allow_unique_segment_for_sections): New function.
4149 (unique_segment_for_sections): New function.
4150 (Plugin::load): Add new functions to transfer vector.
4151 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4152 * Makefile.in: Regenerate.
4153 * testsuite/plugin_final_layout.sh: Check if unique segment
4154 functionality works.
4155 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4157 (allow_unique_segment_for_sections): New global.
4158 (unique_segment_for_sections): New global.
4159 (claim_file_hook): Call allow_unique_segment_for_sections.
4160 (all_symbols_read_hook): Call unique_segment_for_sections.
4162 2012-08-22 Cary Coutant <ccoutant@google.com>
4164 * layout.cc (Layout::include_section): Don't assert on GROUP
4165 sections with --emit-relocs.
4167 2012-08-21 Cary Coutant <ccoutant@google.com>
4169 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4170 if --export-dynamic-symbol names an undef symbol.
4172 2012-08-18 Alan Modra <amodra@gmail.com>
4174 * powerpc.cc: Formatting and white space.
4175 (Powerpc_relobj): Rename got2_section_ to special_.
4176 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4177 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4178 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4179 (Target_powerpc): Add Address typedef and invalid_address. Use
4181 (Target_powerpc::is_branch_reloc): New function.
4182 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4183 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4184 for dst_mask, value and addend.
4185 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4186 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4187 (Output_data_glink::do_write): Correct toc base. Don't try to use
4188 uint16_t for 24-bit offset. Use get_output_section_offset and
4190 (Target_powerpc::Scan::local): Handle more relocs.
4191 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4192 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4193 Plug in toc restoring insn after plt calls. Translate branches
4194 to function descriptor symbols to corresponding entry point.
4195 (Target_powerpc::relocate_for_relocatable): Check return from
4196 get_output_section_offset.
4197 * symtab.h: Comment typo.
4199 2012-08-14 Ian Lance Taylor <iant@google.com>
4201 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4202 unsupported_relocal_local to call unsupported_reloc_global.
4204 2012-08-14 Nick Clifton <nickc@redhat.com>
4207 * script-sections.cc (Sections_element::output_section_name): Add
4208 keep return parameter.
4209 (Output_section_element::match_name): Add keep return parameter.
4210 Return the value of the keep_ member.
4211 * script-sections.h (class Output_section): Update
4212 output_section_name prototype.
4213 * layout.cc (Layout::keep_input_section): New public member
4215 (Layout::choose_output_section): Pass keep parameter to
4216 output_section_name.
4217 * layout.h (class Layout): Add keep_input_section.
4218 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4220 * testsuite/Makefile.am: Add a test.
4221 * testsuite/Makefile.in: Regenerate.
4222 * testsuite/pr14265.c: Source file for the test.
4223 * testsuite/pr14265.t: Linker script for the test.
4224 * testsuite/pr14265.sh: Shell script for the test.
4226 2012-08-14 Alan Modra <amodra@gmail.com>
4228 * target.h (Target::output_section_name): New function.
4229 (Target::do_output_section_name): New function.
4230 * layout.cc (Layout::choose_output_section): Call the above.
4231 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4233 2012-08-14 Alan Modra <amodra@gmail.com>
4235 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4236 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4237 for replace_constant call.
4238 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4239 (Output_data_glink::do_print_to_mapfile): New function.
4240 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4241 (Target_powerpc::Relocate::relocate): Likewise.
4243 2012-08-14 Alan Modra <amodra@gmail.com>
4245 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4246 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4247 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4248 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4249 all references to shndx_. Handle special case for R_PPC_PLTREL24
4251 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4252 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4253 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4255 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4256 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4258 2012-08-12 Alan Modra <amodra@gmail.com>
4260 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4261 (glink insn constants): Use uint32_t.
4262 (Output_data_glink::add_entry): Use insert, not [] operator.
4264 2012-08-11 Alan Modra <amodra@gmail.com>
4266 * object.h (Sized_relobj_file::find_shdr): New function.
4267 (Sized_relobj_file::find_special_sections): New function.
4268 * object.cc (Sized_relobj_file::find_shdr): New function.
4269 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4270 (Sized_relobj_file::find_special_sections): New function, split out..
4271 (Sized_relobj_file::do_read_symbols): ..from here.
4272 * output.h (Output_data_got::replace_constant): New function.
4273 (Output_data_got::num_entries): New function.
4274 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4275 (Output_data_got::got_offset): Protected rather than private.
4276 (Output_data_got::replace_got_entry): New function.
4277 * output.cc (Output_data_got::replace_got_entry): New function.
4278 * powerpc.cc (class Powerpc_relobj): New.
4279 (class Powerpc_relocate_functions): Delete all psymval variants or
4280 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4281 Implement _ha functions using corresponding _hi function.
4282 (Powerpc_relobj::find_special_sections): New function.
4283 (Target_powerpc::do_make_elf_object): New function.
4284 (class Output_data_got_powerpc): New.
4285 (class Output_data_glink): New.
4286 (class Powerpc_scan_relocatable_reloc): New.
4287 Many more changes througout file.
4289 2012-08-09 Nick Clifton <nickc@redhat.com>
4291 * po/vi.po: Updated Vietnamese translation.
4293 2012-08-07 Ian Lance Taylor <iant@google.com>
4295 * layout.cc (Layout::add_target_dynamic_tags): If
4296 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4299 2012-07-30 Nick Clifton <nickc@redhat.com>
4301 * po/gold.pot: Updated template.
4302 * po/es.po: Updated Spanish translation.
4304 2012-07-18 Cary Coutant <ccoutant@google.com>
4307 * configure.ac: Add check for -gpubnames support.
4308 * configure: Regenerate.
4309 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4310 support; force -gno-pubnames.
4311 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4313 (gdb_index_test_4): New test.
4314 * testsuite/Makefile.in: Regenerate.
4315 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4316 * testsuite/gdb_index_test_2.sh: Likewise.
4317 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4318 * testsuite/gdb_index_test_4.sh: New script.
4319 * testsuite/gdb_index_test_comm.sh: New script with common code;
4320 don't look for space after colon.
4322 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4324 * gold.cc (queue_middle_tasks): Update function order only after
4325 deferred objects due to plugins are processed.
4327 2012-07-11 Ian Lance Taylor <iant@google.com>
4329 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4330 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4331 (Target_arm::scan_reloc_for_stub): Likewise.
4332 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4333 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4334 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4335 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4336 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4338 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4339 Ian Lance Taylor <iant@google.com>
4342 * configure.ac: Test whether std::tr1::hash<off_t> works.
4343 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4345 * output.h (class Output_fill): Add virtual destructor.
4346 * configure, config.in: Rebuild.
4348 2012-06-22 Roland McGrath <mcgrathr@google.com>
4350 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4352 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4354 * plugin.cc (Plugin::load): Handle position independent executables.
4356 2012-06-06 Cary Coutant <ccoutant@google.com>
4358 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4360 (lines_only_debug_sections): Likewise.
4361 (gdb_fast_lookup_sections): New static array.
4362 (is_gdb_debug_section): Rename formal parameter.
4363 (is_lines_only_debug_section): Likewise.
4364 (is_gdb_fast_lookup_section): New function.
4365 (Layout::include_section): Check for ".zdebug_" prefix; pass
4366 section name suffix to is_gdb_debug_section, et al.; check for
4367 fast-lookup sections when building .gdb_index.
4368 * options.h (--strip-debug-gdb): Update GDB version number.
4370 2012-06-06 Cary Coutant <ccoutant@google.com>
4372 * configure.ac: Add check for fallocate.
4373 * configure: Regenerate.
4374 * config.in: Regenerate.
4376 * options.h (class General_options): Add --mmap-output-file and
4377 --posix-fallocate options.
4378 * output.cc: (posix_fallocate): Remove; replace with...
4379 (gold_fallocate): New function.
4380 (Output_file::map_no_anonymous): Call gold_fallocate.
4381 (Output_file::map): Check --mmap-output-file option.
4383 2012-06-05 Jing Yu <jingyu@google.com>
4385 * gold.h (textdomain): Add do {} to empty while(0).
4386 (bindtextdomain): Likewise.
4388 2012-06-04 Cary Coutant <ccoutant@google.com>
4390 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4393 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4395 * symtab.cc (Symbol_table::define_special_symbol):
4396 Initialize *poldsym to prevent uninitialized variable errors.
4398 2012-05-23 Cary Coutant <ccoutant@google.com>
4400 * layout.cc (Layout::section_name_mapping): Add rules to handle
4401 exact match on .data.rel.ro.local or .data.rel.ro.
4402 (Layout::output_section_name): Check for exact matches.
4404 2012-05-23 Cary Coutant <ccoutant@google.com>
4406 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4409 2012-05-22 Cary Coutant <ccoutant@google.com>
4411 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4412 object before exporting symbol.
4414 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4416 * testsuite/tls_test.cc: Include "config.h" first.
4417 * testsuite/tls_test_c.c: Likewise.
4419 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4420 Nick Clifton <nickc@redhat.com>
4423 * configure.in: Add check that sysdep.h has been included before
4424 any system header files.
4425 * configure: Regenerate.
4426 * config.in: Regenerate.
4428 2012-05-14 Cary Coutant <ccoutant@google.com>
4430 * layout.cc (Layout::make_output_section): Mark .tdata section
4432 * testsuite/relro_test.cc: Add a TLS variable.
4434 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4437 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4438 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4441 2012-05-08 Cary Coutant <ccoutant@google.com>
4443 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4444 (lines_only_debug_sections): Likewise.
4446 2012-05-02 Roland McGrath <mcgrathr@google.com>
4448 * nacl.cc: New file.
4450 * Makefile.am (CCFILES, HFILES): Add them.
4451 * Makefile.in: Regenerate.
4452 * i386.cc (Output_data_plt_i386_nacl): New class.
4453 (Output_data_plt_i386_nacl_exec): New class.
4454 (Output_data_plt_i386_nacl_dyn): New class.
4455 (Target_i386_nacl): New class.
4456 (Target_selector_i386_nacl): New class.
4457 (target_selector_i386): Use it instead of Target_selector_i386.
4458 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4459 (Target_x86_64_nacl): New class.
4460 (Target_selector_x86_64_nacl): New class.
4461 (target_selector_x86_64, target_selector_x32): Use it instead of
4462 Target_selector_x86_64.
4463 * arm.cc (Output_data_plt_arm_nacl): New class.
4464 (Target_arm_nacl): New class.
4465 (Target_selector_arm_nacl): New class.
4466 (target_selector_arm, target_selector_armbe): Use it instead of
4467 Target_selector_arm.
4469 * target-select.cc (select_target): Take new Input_file* and off_t
4470 arguments, pass them on to recognize method of selector.
4471 * object.cc (make_elf_sized_object): Update caller.
4472 * parameters.cc (parameters_force_valid_target): Likewise.
4473 * incremental.cc (make_sized_incremental_binary): Likewise.
4474 * target-select.h: Update decl.
4475 (Target_selector::recognize): Take new Input_file* argument,
4476 pass it on to do_recognize.
4477 (Target_selector::do_recognize): Take new Input_file* argument.
4478 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4479 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4480 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4481 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4483 * target.h (Target::Target_info): New members isolate_execinstr
4485 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4486 * arm.cc (Target_arm::arm_info): Update initializer.
4487 * i386.cc (Target_i386::i386_info): Likewise.
4488 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4489 * sparc.cc (Target_sparc::sparc_info): Likewise.
4490 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4491 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4492 * layout.cc (Layout::attach_allocated_section_to_segment):
4493 Take new const Target* argument. If target->isolate_execinstr(), act
4495 (Layout::find_first_load_seg): Take new const Target* argument;
4496 if target->isolate_execinstr(), reject PF_X segments.
4497 (Layout::relaxation_loop_body): Update caller.
4498 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4499 reset file offset to zero when we hit LOAD_SEG, and then do a second
4500 loop over the segments before LOAD_SEG to reassign offsets after
4501 addresses have been determined. Handle target->rosegment_gap().
4502 (Layout::attach_section_to_segment): Take new const Target* argument;
4503 pass it to attach_allocated_section_to_segment.
4504 (Layout::make_output_section): Update caller.
4505 (Layout::attach_sections_to_segments): Take new const Target* argument;
4506 pass it to attach_section_to_segment.
4507 * gold.cc (queue_middle_tasks): Update caller.
4508 * layout.h (Layout): Update method decls with new arguments.
4510 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4511 Target_info pointer to use.
4512 (Target_arm::do_make_data_plt): New virtual method.
4513 (Target_arm::make_data_plt): New method that calls it.
4514 (Target_arm::make_plt_entry): Use it.
4515 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4516 for the section alignment.
4517 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4519 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4520 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4522 (Output_data_plt_arm::get_plt_entry_size): Call it.
4523 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4524 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4525 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4527 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4528 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4529 method instead of sizeof(plt_entry).
4530 (Output_data_plt_arm::add_entry): Likewise.
4531 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4532 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4534 (Target_arm::plt_entry_size): Likewise.
4535 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4537 (Output_data_plt_arm_standard): ... here, new class.
4538 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4539 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4540 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4542 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4543 Take additional argument for the PLT entry size.
4544 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4545 Use get_plt_entry_size method rather than plt_entry_size variable.
4546 (Output_data_plt_x86_64::reserve_slot): Likewise.
4547 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4548 (Output_data_plt_x86_64::add_entry): Likewise.
4549 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4550 (Output_data_plt_x86_64::address_for_global): Likewise.
4551 (Output_data_plt_x86_64::address_for_local): Likewise.
4552 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4553 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4554 Make method non-static.
4555 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4557 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4558 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4559 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4560 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4562 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4563 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4565 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4566 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4568 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4569 (Output_data_plt_x86_64::plt_entry_size)
4570 (Output_data_plt_x86_64::first_plt_entry)
4571 (Output_data_plt_x86_64::plt_entry)
4572 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4573 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4574 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4575 (Output_data_plt_x86_64_standard): ... here, new class.
4576 (Target_x86_64::Target_x86_64): Take optional argument for the
4577 Target_info pointer to use.
4578 (Target_x86_64::do_make_data_plt): New virtual method.
4579 (Target_x86_64::make_data_plt): New method to call it.
4580 (Target_x86_64::init_got_plt_for_update): Use that.
4581 Call this->plt_->add_eh_frame method here.
4582 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4583 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4584 rather than static method.
4585 (Target_x86_64::plt_entry_size): Likewise.
4586 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4587 rather than plt_entry_size variable. Move guts of PLT filling to...
4588 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4589 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4590 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4592 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4593 additional argument for the section alignment.
4594 Don't do add_eh_frame_for_plt here.
4595 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4596 non-static. Use get_plt_entry_size method rather than plt_entry_size
4598 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4600 (Output_data_plt_i386::get_plt_entry_size): Call it.
4601 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4602 (Output_data_plt_i386::add_eh_frame): New method to call it.
4603 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4605 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4606 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4608 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4609 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4610 method instead of plt_entry_size.
4611 (Output_data_plt_i386::plt_entry_size)
4612 (Output_data_plt_i386::plt_eh_frame_fde_size)
4613 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4614 (Output_data_plt_i386_standard): ... here, new class.
4615 (Output_data_plt_i386_exec): New class.
4616 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4617 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4618 (Output_data_plt_i386::exec_plt_entry): Move to ...
4619 (Output_data_plt_i386_exec::plt_entry): ... here.
4620 (Output_data_plt_i386_dyn): New class.
4621 (Output_data_plt_i386::first_plt_entry): Move to ...
4622 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4623 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4624 (Output_data_plt_i386_dyn::plt_entry): ... here.
4625 (Target_i386::Target_i386): Take optional argument for the Target_info
4627 (Target_i386::do_make_data_plt): New virtual method.
4628 (Target_i386::make_data_plt): New method to call it.
4629 (Target_i386::make_plt_section): Use that.
4630 Call this->plt_->add_eh_frame method here.
4631 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4632 rather than plt_entry_size variable.
4633 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4634 (Output_data_plt_i386::address_for_local): Likewise.
4635 (Output_data_plt_i386::do_write): Likewise.
4636 Move guts of PLT filling to...
4637 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4638 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4639 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4640 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4642 2012-05-01 Cary Coutant <ccoutant@google.com>
4644 * dwarf_reader.cc (Dwarf_die::read_attributes)
4645 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4646 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4647 * reduced_debug_output.cc
4648 (Output_reduced_debug_info_section::get_die_end): Remove
4649 DW_FORM_GNU_ref_index. Add default case.
4651 2012-04-26 Mark Wielaard <mjw@redhat.com>
4653 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4654 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4655 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4656 DW_AT_high_pc as offset from DW_AT_low_pc.
4658 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4659 * testsuite/Makefile.in: Regenerate.
4660 * testsuite/gdb_index_test_3.c: New test source file.
4661 * testsuite/gdb_index_test_3.sh: New test source file.
4663 2012-04-25 Ian Lance Taylor <iant@google.com>
4665 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4667 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4668 as a class, not a struct.
4669 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4670 (Target_arm::apply_cortex_a8_workaround): Likewise.
4671 * gc.h: Declare Reloc_types as a struct, not a class.
4672 * object.h: Declare Symbols_data as a struct.
4673 * reloc.h: Declare Read_relocs_data as a struct.
4674 * target.h: Declare Relocate_info as a struct.
4676 2012-04-24 David S. Miller <davem@davemloft.net>
4678 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4679 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4682 2012-04-24 Cary Coutant <ccoutant@google.com>
4684 * incremental-dump.cc (find_input_containing_global): Replace
4685 magic number with symbolic constant.
4686 (dump_incremental_inputs): Update version number.
4687 * incremental.cc (Output_section_incremental_inputs): Update version
4688 number; import symbolic constants from Incremental_inputs_reader.
4689 (Incremental_inputs::create_data_sections): Align relocations
4690 section correctly for 64-bit targets.
4691 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4692 constants; add padding.
4693 (Output_section_incremental_inputs::write_header): Add assert for
4695 (Output_section_incremental_inputs::write_input_files): Add assert
4696 for input_entry_size.
4697 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4698 add assert for object_info_size, input_section_entry_size,
4699 global_sym_entry_size.
4700 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4701 for data structure sizes; use them.
4702 (Incremental_input_entry_reader): Import symbolic constants from
4703 Incremental_inputs_reader; use them.
4705 2012-04-23 David S. Miller <davem@davemloft.net>
4707 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4709 (Target_sparc::Target_sparc): Initialize new fields.
4710 (Target_sparc::do_make_elf_object): New function.
4711 (Target_sparc::do_adjust_elf_header): New function.
4713 2012-04-23 Cary Coutant <ccoutant@google.com>
4715 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4716 CU range table of gdb index.
4718 2012-04-20 David S. Miller <davem@davemloft.net>
4720 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4723 2012-04-16 David S. Miller <davem@davemloft.net>
4725 * sparc.cc (Target_sparc::got_address): New function.
4726 (Sparc_relocate_functions::gdop_hix22): New function.
4727 (Sparc_relocate_functions::gdop_lox10): New function.
4728 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4730 (Target_sparc::Scan::local): Likewise if the global symbol is not
4731 preemptible and is not IFUNC.
4732 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4733 transformations for local and non-preemptible non-IFUNC global
4736 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4737 writing out 64-bit part of ranges.
4739 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4740 -fpic and -fpie respectively.
4741 * Makefile.in: Regenerate.
4743 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4744 (Target_sparc::Target_sparc): Initialize new field.
4745 (Target_sparc::do_plt_section_for_global): New function.
4746 (Target_sparc::do_plt_section_for_local): New function.
4747 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4748 (Target_sparc::make_plt_section): New function, broken out of
4749 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4750 (Target_sparc::make_plt_entry): Call make_plt_section.
4751 (Target_sparc::make_local_ifunc_plt_entry): New function.
4752 (Target_sparc::rela_ifunc_section): New function.
4753 (Target_sparc::plt_section): Remove const.
4754 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4755 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4756 and ifunc_count_ fields.
4757 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4758 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4759 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4760 (Output_data_plt_sparc::rela_ifunc): New function.
4761 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4762 (Output_data_plt_sparc::has_ifunc_section): New function.
4763 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4764 (Output_data_plt_sparc::address_for_global): New function.
4765 (Output_data_plt_sparc::address_for_local): New function.
4766 (Output_data_plt_sparc::plt_index_to_offset): New function.
4767 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4769 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4771 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4772 R_SPARC_JMP_IREL to switch.
4773 (Target_sparc::Scan::check_non_pic): Likewise.
4774 (Target_sparc::Scan::local): Handle IFUNC symbols.
4775 (Target_sparc::Scan::local): Likewise.
4776 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4777 and plt_address_for_local.
4778 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4779 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4781 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4782 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4783 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4784 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4786 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4787 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4789 * sparc.cc (Target_sparc::Scan::global): Likewise.
4790 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4792 2012-04-16 Cary Coutant <ccoutant@google.com>
4794 * archive.cc (Library_base::should_include_member): Check for
4795 --export-dynamic-symbol.
4796 * options.h (class General_options): Add --export-dynamic-symbol.
4797 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4798 --export-dynamic-symbol.
4799 (Symbol_table::gc_mark_undef_symbols): Likewise.
4800 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4802 2012-04-12 David S. Miller <davem@davemloft.net>
4804 * sparc.cc (Reloc::wdisp10): New relocation method.
4805 (Reloc::h34): Likewise.
4806 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4807 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4809 (Target_sparc::Scan::local): Likewise.
4810 (Target_sparc::Scan::global): Likewise.
4811 (Target_sparc::Relocate::relocate): Likewise.
4813 2012-04-09 Cary Coutant <ccoutant@google.com>
4815 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4818 2012-04-06 Ian Lance Taylor <iant@google.com>
4820 * timer.cc: #include <unistd.h>.
4822 2012-04-06 Roland McGrath <mcgrathr@google.com>
4824 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4825 * config.in: Regenerate.
4826 * configure: Regenerate.
4828 2012-04-05 Nick Clifton <nickc@redhat.com>
4830 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4831 (AM_LC_MESSAGES): Add.
4832 * aclocal.m4: Regenerate.
4833 * config.in: Regenerate.
4834 * configure: Regenerate.
4836 2012-03-21 Cary Coutant <ccoutant@google.com>
4838 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4839 * Makefile.in: Regenerate.
4840 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4841 (Sized_elf_reloc_mapper::symbol_section): New function.
4842 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4843 (make_elf_reloc_mapper): New function.
4844 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4845 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4846 (Dwarf_abbrev_table::do_get_abbrev): New function.
4847 (Dwarf_ranges_table::read_ranges_table): New function.
4848 (Dwarf_ranges_table::read_range_list): New function.
4849 (Dwarf_pubnames_table::read_section): New function.
4850 (Dwarf_pubnames_table::read_header): New function.
4851 (Dwarf_pubnames_table::next_name): New function.
4852 (Dwarf_die::Dwarf_die): New function.
4853 (Dwarf_die::read_attributes): New function.
4854 (Dwarf_die::skip_attributes): New function.
4855 (Dwarf_die::set_name): New function.
4856 (Dwarf_die::set_linkage_name): New function.
4857 (Dwarf_die::attribute): New function.
4858 (Dwarf_die::string_attribute): New function.
4859 (Dwarf_die::int_attribute): New function.
4860 (Dwarf_die::uint_attribute): New function.
4861 (Dwarf_die::ref_attribute): New function.
4862 (Dwarf_die::child_offset): New function.
4863 (Dwarf_die::sibling_offset): New function.
4864 (Dwarf_info_reader::check_buffer): New function.
4865 (Dwarf_info_reader::parse): New function.
4866 (Dwarf_info_reader::do_parse): New function.
4867 (Dwarf_info_reader::do_read_string_table): New function.
4868 (Dwarf_info_reader::lookup_reloc): New function.
4869 (Dwarf_info_reader::get_string): New function.
4870 (Dwarf_info_reader::visit_compilation_unit): New function.
4871 (Dwarf_info_reader::visit_type_unit): New function.
4872 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4873 Sized_elf_reloc_mapper.
4874 (Sized_dwarf_line_info::symbol_section): Remove function.
4875 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4876 (Sized_dwarf_line_info::read_line_mappings): Remove object
4877 parameter, adjust callers.
4878 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4879 * dwarf_reader.h: Include <sys/types.h>.
4880 (class Track_relocs): Remove forward declaration.
4881 (class Elf_reloc_mapper): New class.
4882 (class Sized_elf_reloc_mapper): New class.
4883 (class Dwarf_abbrev_table): New class.
4884 (class Dwarf_range_list): New class.
4885 (class Dwarf_ranges_table): New class.
4886 (class Dwarf_pubnames_table): New class.
4887 (class Dwarf_die): New class.
4888 (class Dwarf_info_reader): New class.
4889 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4890 (Sized_dwarf_line_info::symbol_section): Remove member function.
4891 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4893 * gdb-index.cc: New source file.
4894 * gdb-index.h: New source file.
4895 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4896 and .debug_types sections, call Layout::add_to_gdb_index.
4897 (Sized_relobj_incr::do_section_name): Implement.
4898 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4899 return type; Implement.
4900 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4902 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4903 parameter list and return type.
4904 (Sized_incr_dynobj::do_section_contents): Likewise.
4905 * layout.cc: Include gdb-index.h.
4906 (Layout::Layout): Initialize gdb_index_data_.
4907 (Layout::init_fixed_output_section): Check for .gdb_index section.
4908 (Layout::add_to_gdb_index): New function. Instantiate.
4909 * layout.h: Add forward declaration for class Gdb_index.
4910 (Layout::add_to_gdb_index): New member function.
4911 (Layout::gdb_index_data_): New data member.
4912 * main.cc: Include gdb-index.h.
4913 (main): Print statistics for gdb index.
4914 * object.cc (Object::section_contents): Move code into
4915 do_section_contents.
4916 (need_decompressed_section): Check for sections needed when building
4918 (build_compressed_section_map): Likewise.
4919 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4921 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4922 sections; call Layout::add_to_gdb_index.
4923 (Sized_relobj_file::do_decompressed_section_contents): Call
4924 do_section_contents directly.
4925 * object.h (Object::do_section_contents): Adjust parameter list and
4927 (Object::do_decompressed_section_contents): Call do_section_contents
4929 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4931 * options.h (class General_options): Add --gdb-index option.
4932 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4933 list and return type.
4934 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4935 * reloc.h (Track_relocs::checkpoint): New function.
4936 (Track_relocs::reset): New function.
4938 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4940 * testsuite/Makefile.in: Regenerate.
4941 * testsuite/gdb_index_test.cc: New test source file.
4942 * testsuite/gdb_index_test_1.sh: New test source file.
4943 * testsuite/gdb_index_test_2.sh: New test source file.
4945 2012-03-19 Doug Kwan <dougkwan@google.com>
4947 * arm.cc (Target_arm::do_define_standard_symbols): New method.
4948 (Target_arm::do_finalize_sections): Remove code which defines
4949 __exidx_start and __exidx_end. Make symbol table parameter
4950 anonymous as it is not used.
4951 * gold.cc (queue_middle_tasks): Call target hook to define any
4952 target-specific symbols.
4953 * target.h (Target::define_standard_symbols): New method.
4954 (Target::do_define_standard_symbols): Same.
4955 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4956 * testsuite/Makefile.in: Regenerate.
4957 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4959 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4960 relocations are generated for __exidx_start and __exidx_end.
4962 2012-03-16 Doug Kwan <dougkwan@google.com>
4964 * testsuite/Makefile.am: Disable test initpri3b.
4965 * testsuite/Makefile.in: Regenerate.
4967 2012-03-15 Doug Kwan <dougkwan@google.com>
4969 * arm.cc (Target_arm::got_section): Make .got section read-only
4972 2012-03-15 Ian Lance Taylor <iant@google.com>
4975 * layout.cc (Layout::make_output_section): Correctly mark
4976 SHT_INIT_ARRAY, et. al., as relro.
4978 2012-03-14 Doug Kwan <dougkwan@google.com>
4980 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4981 dynamic relocations for protected symbols in shared objects.
4983 2012-03-13 Ian Lance Taylor <iant@google.com>
4985 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4986 keep the larger alignment.
4988 2012-03-12 Cary Coutant <ccoutant@google.com>
4990 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4991 handling of DW_LNE_define_file.
4993 2012-03-12 Cary Coutant <ccoutant@google.com>
4995 * reduced_debug_output.cc
4996 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4999 2012-02-29 Cary Coutant <ccoutant@google.com>
5001 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5003 2012-02-29 Cary Coutant <ccoutant@google.com>
5005 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5006 Call Object::decompressed_section_contents.
5007 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5009 (Sized_dwarf_line_info::buffer_start_): New data member.
5010 * merge.cc (Output_merge_data::do_add_input_section): Call
5011 Object::decompressed_section_contents.
5012 (Output_merge_string::do_add_input_section): Likewise.
5013 * object.cc (need_decompressed_section): New function.
5014 (build_compressed_section_map): Decompress sections needed later.
5015 (Sized_relobj_file::do_decompressed_section_contents): New function.
5016 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5017 * object.h (Object::decompressed_section_contents): New function.
5018 (Object::discard_decompressed_sections): New function.
5019 (Object::do_decompressed_section_contents): New function.
5020 (Object::do_discard_decompressed_sections): New function.
5021 (Compressed_section_info): New type.
5022 (Compressed_section_map): Include decompressed section contents.
5023 (Sized_relobj_file::do_decompressed_section_contents): New function.
5024 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5026 2012-02-16 Cary Coutant <ccoutant@google.com>
5028 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5029 * testsuite/Makefile.in: Regenerate.
5031 2012-02-14 Cary Coutant <ccoutant@google.com>
5033 * options.cc (General_options::finalize): Disallow -pie and -static.
5035 2012-02-03 Doug Kwan <dougkwan@google.com>
5037 * arm.cc (Arm_relocate_functions::abs8,
5038 Arm_relocate_functions::abs16): Use
5039 Bits::has_signed_unsigned_overflow32.
5040 (Arm_relocate_functions::thm_abs8): Correct range of
5042 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5045 2012-02-02 Doug Kwan <dougkwan@google.com>
5047 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5048 position independent outputs, not just shared objects.
5050 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5052 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5053 * configure: Regenerated.
5055 2012-01-27 Ian Lance Taylor <iant@google.com>
5057 * reloc.h (Bits): New class with static functions, copied from
5058 namespace utils in arm.cc.
5059 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5062 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5064 * incremental.cc (write_info_blocks): Correct relocation offset.
5066 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5068 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5069 (Relocate::tls_gd_to_le): Likewise.
5071 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5073 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5075 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5077 * configure.ac: Check if -mcmodel=medium works.
5078 * configure: Regenerated.
5080 2012-01-24 Cary Coutant <ccoutant@google.com>
5082 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5084 (read_unsigned_LEB_128_x): ... this new function.
5085 (read_signed_LEB_128): Replaced with inline definition and ...
5086 (read_signed_LEB_128_x): ... this new function.
5087 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5088 (read_unsigned_LEB_128): Add inline definition.
5089 (read_signed_LEB_128_x): New function.
5090 (read_signed_LEB_128): Add inline definition.
5091 * testsuite/Makefile.am (leb128_unittest): New unit test.
5092 * testsuite/Makefile.in: Regenerate.
5093 * testsuite/leb128_unittest.cc: New unit test.
5095 2012-01-23 Ian Lance Taylor <iant@google.com>
5098 * i386.cc (Target_i386::do_code_fill): When using a jmp
5099 instruction, pad with nop instructions.
5100 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5102 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5104 * x86_64.cc (gc_process_relocs): Add typename on types used in
5106 (scan_relocs): Likewise.
5107 (relocate_section): Likewise.
5108 (apply_relocation): Likewise.
5110 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5112 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5113 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5116 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5118 * x86_64.cc: Initial support for x32.
5120 2012-01-03 Cary Coutant <ccoutant@google.com>
5122 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5123 Use abstract base class for GOT.
5124 * gold/output.h (class Output_data_got_base): New abstract base class.
5125 (class Output_data_got): Derive from new base class, adjust ctors.
5126 (Output_data_got::reserve_slot): Make virtual; rename to
5127 do_reserve_slot; Adjust callers.
5128 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5129 pointer to abstract base class.
5130 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5132 2011-12-18 Ian Lance Taylor <iant@google.com>
5134 * object.h (Relobj::local_symbol_value): New function.
5135 (Relobj::local_plt_offset): New function.
5136 (Relobj::local_has_got_offset): New function.
5137 (Relobj::local_got_offset): New function.
5138 (Relobj::set_local_got_offset): New function.
5139 (Relobj::do_local_symbol_value): New pure virtual function.
5140 (Relobj::do_local_plt_offset): Likewise.
5141 (Relobj::do_local_has_got_offset): Likewise.
5142 (Relobj::do_local_got_offset): Likewise.
5143 (Relobj::do_set_local_got_offset): Likewise.
5144 (Sized_relobj::do_local_has_got_offset): Rename from
5145 local_has_got_offset.
5146 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5147 (Sized_relobj::do_set_local_got_offset): Rename from
5148 set_local_got_offset.
5149 (Sized_relobj_file::do_local_plt_offset): Rename from
5151 (Sized_relobj_file::do_local_symbol_value): New function.
5152 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5154 * output.cc (Output_data_got::Got_entry::write): Change object to
5155 Relobj. Use local_symbol_value.
5156 (Output_data_got::add_global_with_rel): Change rel_dyn to
5157 Output_data_reloc_generic*. Use add_global_generic.
5158 (Output_data_got::add_global_with_rela): Remove. Change all
5159 callers to use add_global_with_rel.
5160 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5161 Output_data_reloc_generic*. Use add_global_generic.
5162 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5163 callers to use add_global_pair_with_rel.
5164 (Output_data_got::add_local): Change object to Relobj*.
5165 (Output_data_got::add_local_plt): Likewise.
5166 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5167 change rel_dyn to Output_data_reloc_generic*. Use
5169 (Output_data_got::add_local_with_rela): Remove. Change all
5170 callers to use all_local_with_rel.
5171 (Output_data_got::add_local_pair_with_rel): Change object to
5172 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5173 add_output_section_generic.
5174 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5175 callers to use add_local_pair_with_rel.
5176 (Output_data_got::reserve_local): Change object to Relobj*.
5177 * output.h: (class Output_data_reloc_generic): Add pure virtual
5178 declarations for add_global_generic, add_local_generic,
5179 add_output_section_generic.
5180 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5181 functions for Output_data_reloc_generic. Update declarations for
5182 changes listed in output.cc.
5183 (class Output_data_got): Change template parameter to got_size.
5184 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5185 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5187 (Sized_relobj_incr::do_local_plt_offset): New function.
5188 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5191 2011-12-17 Cary Coutant <ccoutant@google.com>
5193 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5194 * resolve.cc (Symbol_table::resolve): Likewise.
5195 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5197 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5199 2011-12-16 Ian Lance Taylor <iant@google.com>
5201 * output.h (Output_data_reloc_generic::add): Only call
5202 add_dynamic_reloc if this is a dynamic reloc section.
5204 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5207 * target-reloc.h (apply_relocation): Replace <64, false> with
5210 2011-11-25 Nick Clifton <nickc@redhat.com>
5212 * po/it.po: New Italian translation.
5214 2011-11-17 Sterling Augustine <saugustine@google.com>
5216 * script.cc (script_include_directive): Implement.
5217 (read_script_file): New local variables name and search_path. Update
5218 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5219 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5220 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5222 2011-11-11 Sterling Augustine <saugustine@google.com>
5224 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5225 (file_or_sections_cmd): Likewise.
5227 2011-11-11 Doug Kwan <dougkwan@google.com>
5229 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5230 if --just-symbols is given.
5232 2011-11-10 Doug Kwan <dougkwan@google.com>
5235 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5236 when processing data relocs.
5237 * reloc.h (Relocate_functions::rel_unaligned): New method.
5238 (Relocate_functions::pcrel_unaligned): Ditto.
5239 (Relocate_functions::rel32_unaligned): Ditto.
5240 (Relocate_functions::pcrel32_unaligned): Ditto.
5242 2011-11-09 Doug Kwan <dougkwan@google.com>
5245 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5246 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5247 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5248 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5249 (Relocate_functions::rel_unaligned): New.
5250 (Relocate_functions::rel32_unaligned): New.
5251 * target-reloc.h (relocate_for_relocatable): Add code to handle
5252 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5253 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5254 arm_unaligned_reloc_r): New targets.
5255 * testsuite/Makefile.in: Regenerate.
5256 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5259 2011-11-02 Ian Lance Taylor <iant@google.com>
5261 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5263 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5264 * options.cc (General_options::finalize): Use library search path
5265 from configure script if specified. If not native and no sysroot,
5266 only search TOOLLIBDIR.
5267 * options.h (Search_directory::Search_directory): Change name to
5269 (General_options::add_to_library_path_with_sysroot): Change arg to
5271 * configure, Makefile.in, config.in: Rebuild.
5273 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5275 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5276 we are working around the ARM1176 Erratum.
5277 * options.h (General_options::fix_arm1176): Add option.
5278 * testsuite/Makefile.am: Add testcases, and keep current ones
5280 * testsuite/Makefile.in: Regenerate.
5281 * testsuite/arm_fix_1176.s: New file.
5282 * testsuite/arm_fix_1176.sh: Likewise.
5284 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5286 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5288 (Target_arm::may_use_blx): Remove method.
5289 (Target_arm::set_may_use_blx): Likewise.
5290 (Target_arm::may_use_v4t_interworking): New method.
5291 (Target_arm::may_use_v5t_interworking): Likewise.
5292 (Target_arm::may_use_blx_): Remove member variable.
5293 (Arm_relocate_functions::arm_branch_common): Check for v5T
5295 (Arm_relocate_functions::thumb_branch_common): Likewise.
5296 (Reloc_stub::stub_type_for_reloc): Likewise.
5297 (Target_arm::do_finalize_sections): Correct interworking checks.
5298 * testsuite/Makefile.am: Add new tests.
5299 * testsuite/Makefile.in: Regenerate.
5300 * testsuite/arm_farcall_arm_arm.s: New test.
5301 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5302 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5303 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5304 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5305 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5306 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5307 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5309 2011-10-31 Cary Coutant <ccoutant@google.com>
5312 * expression.cc (Expression::eval_with_dot): Add
5313 is_section_dot_assignment parameter.
5314 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5315 absolute and assigning to dot within a section.
5316 * script-sections.cc
5317 (Output_section_element_assignment::set_section_addresses): Pass
5318 dot_section to set_if_absolute.
5319 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5320 as is_section_dot_assignment flag to eval_with_dot.
5321 (Output_section_element_dot_assignment::set_section_addresses):
5323 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5324 parameter. Also set value if relative to dot_section; set the
5325 symbol's output_section.
5326 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5327 parameter. Adjust all callers.
5328 (Expression::eval_maybe_dot): Likewise.
5329 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5331 * testsuite/script_test_2.t: Test assignment of an absolute value
5332 to dot within an output section element.
5334 2011-10-31 Cary Coutant <ccoutant@google.com>
5336 * options.h (class General_options): Add --[no-]gnu-unique options.
5337 * symtab.cc (Symbol_table::sized_write_globals): Convert
5338 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5340 2011-10-31 Cary Coutant <ccoutant@google.com>
5343 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5344 unnecessary assertion.
5345 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5347 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5349 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5351 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5353 Change to just keep the section associated with symbol.
5354 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5355 they are externally visible and --export-dynamic is turned on.
5356 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5358 2011-10-19 Ian Lance Taylor <iant@google.com>
5361 * script-sections.cc
5362 (Output_section_element_dot_assignment::needs_output_section): New
5365 2011-10-19 Ian Lance Taylor <iant@google.com>
5368 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5369 --section-start option was seen.
5370 * options.h (General_options::any_section_start): New function.
5372 2011-10-18 David S. Miller <davem@davemloft.net>
5375 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5376 member to track relocation locations that have moved during TLS
5377 reloc optimizations.
5378 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5379 (Target_sparc::Relocate::relocate): Adjust view down by 4
5380 bytes if it matches reloc_adjust_addr_.
5381 (Target_sparc::Relocate::relocate_tls): Always move the
5382 __tls_get_addr call delay slot instruction forward 4 bytes when
5383 performing relaxation.
5385 2011-10-18 Cary Coutant <ccoutant@google.com>
5387 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5388 (Output_file::map_no_anonymous): Check for non-zero
5389 return code from posix_fallocate.
5391 2011-10-17 Cary Coutant <ccoutant@google.com>
5394 * plugin.cc (is_visible_from_outside): Check for symbols
5395 referenced from dynamic objects.
5396 * resolve.cc (Symbol_table::resolve): Don't count references
5397 from dynamic objects as references from real ELF files.
5398 * testsuite/plugin_test_2.sh: Adjust expected result.
5400 2011-10-17 Cary Coutant <ccoutant@google.com>
5402 * gold.cc: Include timer.h.
5403 (queue_middle_tasks): Stamp time.
5404 (queue_final_tasks): Likewise.
5405 * main.cc (main): Store timer in parameters. Print timers
5407 * parameters.cc (Parameters::Parameters): Initialize timer_.
5408 (Parameters::set_timer): New function.
5409 (set_parameters_timer): New function.
5410 * parameters.h (Parameters::set_timer): New function.
5411 (Parameters::timer): New function.
5412 (Parameters::timer_): New data member.
5413 (set_parameters_timer): New function.
5414 * timer.cc (Timer::stamp): New function.
5415 (Timer::get_pass_time): New function.
5416 * timer.h (Timer::stamp): New function.
5417 (Timer::get_pass_time): New function.
5418 (Timer::pass_times_): New data member.
5420 2011-10-17 Cary Coutant <ccoutant@google.com>
5422 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5423 task for members of lib groups.
5425 2011-10-17 Cary Coutant <ccoutant@google.com>
5428 * fileread.cc (File_read::find_view): Add assert.
5429 (File_read::make_view): Move bounds check (replace with assert)...
5430 (File_read::find_or_make_view): ... to here.
5432 2011-10-12 Cary Coutant <ccoutant@google.com>
5434 * output.cc (Output_file::open_base_file): Handle case where
5435 ::read returns less than requested size.
5437 2011-10-10 Cary Coutant <ccoutant@google.com>
5439 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5440 Initialize defined_count_.
5441 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5442 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5443 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5444 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5445 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5446 * incremental.h (Sized_relobj_incr::defined_count_): New data
5448 (Sized_incr_dynobj::defined_count_): New data member.
5449 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5450 Return zeroes instead of internal error.
5452 2011-10-10 Cary Coutant <ccoutant@google.com>
5455 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5456 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5457 * output.h (class Output_reloc): Add use_plt_offset flag.
5458 (Output_reloc::type_): Adjust size of bit field.
5459 (Output_reloc::use_plt_offset_): New bit field.
5460 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5461 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5462 flag. Adjust all callers.
5463 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5464 creating RELATIVE relocations.
5466 2011-10-10 Nick Clifton <nickc@redhat.com>
5468 * po/es.po: Updated Spanish translation.
5469 * po/fi.po: Updated Finnish translation.
5471 2011-10-03 Diego Novillo <dnovillo@google.com>
5473 * options.cc (parse_uint): Fix dereference of RETVAL.
5475 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5477 * layout.h (section_order_map_): New member.
5478 (get_section_order_map): New member function.
5479 * output.cc (Output_section::add_input_section): Check for patterns
5480 only when --section-ordering-file is specified.
5481 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5482 output_sections have been formed.
5483 * layout.cc (Layout_Layout): Initialize section_order_map_.
5484 * plugin.cc (update_section_order): Store order in order_map. Do not
5486 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5487 * testsuite/Makefile.in: Regenerate.
5488 * testsuite/plugin_section_order.c: New file.
5489 * testsuite/plugin_final_layout.cc: New file.
5490 * testsuite/plugin_final_layout.sh: New file.
5492 2011-09-29 Cary Coutant <ccoutant@google.com>
5494 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5496 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
5497 symbols during incremental update.
5498 (Symbol_table::add_from_dynobj): Likewise.
5500 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5501 Ian Lance Taylor <iant@google.com>
5503 * symtab.cc (Symbol_table::define_special_symbol): Always
5504 canonicalize version string.
5506 2011-09-26 Cary Coutant <ccoutant@google.com>
5508 * gold.cc (queue_initial_tasks): Move option checks ...
5509 * options.cc (General_options::finalize): ... to here. Disable
5510 some options; make others fatal.
5512 2011-09-26 Cary Coutant <ccoutant@google.com>
5515 * plugin.cc (get_symbols_v2): New function.
5516 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5517 (is_referenced_from_outside): New function.
5518 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5519 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5520 (get_symbols): Pass version parameter.
5521 (get_symbols_v2): New function.
5522 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5524 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5525 (onload): Add LDPT_GET_SYMBOLS_V2.
5526 (all_symbols_read_hook): Use get_symbols_v2; check for
5527 LDPR_PREVAILING_DEF_IRONLY_EXP.
5528 * testsuite/plugin_test_3.sh: Update expected results.
5530 2011-09-23 Simon Baldwin <simonb@google.com>
5532 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5533 configuration options.
5534 * configure: Regenerate.
5535 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5536 * Makefile.in: Regenerate.
5537 * testsuite/Makefile.in: Regenerate.
5539 2011-09-19 Sriraman Tallam <tmsriram@google.com>
5541 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5543 2011-09-19 Cary Coutant <ccoutant@google.com>
5545 * incremental.cc (can_incremental_update): Fix typo in comment.
5546 * incremental.h (can_incremental_update): Likewise.
5548 2011-09-18 Cary Coutant <ccoutant@google.com>
5550 * incremental.cc (can_incremental_update): New function.
5551 * incremental.h (can_incremental_update): New function.
5552 * layout.cc (Layout::init_fixed_output_section): Call it.
5553 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5554 * object.cc (Sized_relobj_file::do_layout): Call
5555 can_incremental_update.
5557 2011-09-13 Cary Coutant <ccoutant@google.com>
5559 * configure.ac: Check for glibc support for gnu_indirect_function
5560 support with static linking, setting automake conditional
5562 * Makefile.in: Regenerate.
5563 * configure: Regenerate.
5565 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5566 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5568 * testsuite/Makefile.in: Regenerate.
5570 2011-09-13 Cary Coutant <ccoutant@google.com>
5572 * incremental.cc (Sized_relobj_incr::do_layout): Call
5573 report_comdat_group for kept comdat sections.
5574 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5575 * testsuite/Makefile.in: Regenerate.
5576 * testsuite/incr_comdat_test_1.cc: New source file.
5577 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5578 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5579 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5581 2011-09-13 Ian Lance Taylor <iant@google.com>
5583 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5584 variable external_symbols_offset.
5586 2011-09-12 Ian Lance Taylor <iant@google.com>
5588 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5589 triggered if object has no symbols.
5591 2011-09-09 David S. Miller <davem@davemloft.net>
5593 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5594 (Output_fill_debug_line::do_write): Likewise.
5596 2011-08-29 Cary Coutant <ccoutant@google.com>
5598 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5599 casts to match formatting specs.
5600 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5602 2011-08-26 Cary Coutant <ccoutant@google.com>
5604 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5605 remaining hole size when allocating.
5606 (Layout::make_output_section): Set fill methods for debug sections.
5607 * layout.h (Free_list::Free_list_node): Move from private to
5609 (Free_list::set_min_hole_size): New function.
5610 (Free_list::begin, Free_list::end): New functions.
5611 (Free_list::min_hole_): New data member.
5612 * output.cc: Include dwarf.h.
5613 (Output_fill_debug_info::do_minimum_hole_size): New function.
5614 (Output_fill_debug_info::do_write): New function.
5615 (Output_fill_debug_line::do_minimum_hole_size): New function.
5616 (Output_fill_debug_line::do_write): New function.
5617 (Output_section::Output_section): Initialize new data member.
5618 (Output_section::set_final_data_size): Ensure patch space is larger
5619 than minimum hole size.
5620 (Output_section::do_write): Fill holes in debug sections.
5621 * output.h (Output_fill): New class.
5622 (Output_fill_debug_info): New class.
5623 (Output_fill_debug_line): New class.
5624 (Output_section::set_free_space_fill): New function.
5625 (Output_section::free_space_fill_): New data member.
5626 * testsuite/Makefile.am (incremental_test_3): Add
5627 --incremental-patch option.
5628 (incremental_test_4): Likewise.
5629 (incremental_test_5): Likewise.
5630 (incremental_test_6): Likewise.
5631 (incremental_copy_test): Likewise.
5632 (incremental_common_test_1): Likewise.
5633 * testsuite/Makefile.in: Regenerate.
5635 2011-08-26 Nick Clifton <nickc@redhat.com>
5637 * po/es.po: Updated Spanish translation.
5639 2011-08-01 Cary Coutant <ccoutant@google.com>
5641 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5642 * gold/testsuite/Makefile.in: Regenerate.
5643 * gold/testsuite/justsyms_exec.c: New source file.
5644 * gold/testsuite/justsyms_lib.c: New source file.
5646 2011-08-01 Cary Coutant <ccoutant@google.com>
5648 * layout.cc (Layout::set_segment_offsets): Don't realign text
5649 segment if -Ttext was specified.
5650 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5652 * object.h (Sized_relobj_file::e_type): New function.
5653 (Sized_relobj_file::e_type_): New data member.
5654 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5655 base address for ET_EXEC files.
5656 * target.cc (Target::do_make_elf_object_implementation): Allow
5657 ET_EXEC files with --just-symbols option.
5659 2011-07-28 Cary Coutant <ccoutant@google.com>
5661 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5662 Add thread_number parameter.
5663 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5664 * workqueue-threads.cc
5665 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5666 current thread if its thread number is greater than desired thread
5668 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5669 Add thread_number parameter.
5670 (Workqueue::should_cancel_thread): Likewise.
5671 (Workqueue::find_runnable_or_wait): Pass thread_number to
5672 should_cancel_thread.
5673 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5676 2011-07-22 Sriraman Tallam <tmsriram@google.com>
5678 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5679 only after checking if it cannot be forced local.
5680 * symtab.h (is_externally_visible): Check if the symbol is not forced
5683 2011-07-15 Ian Lance Taylor <iant@google.com>
5685 * options.h (class General_options): Add --print-output-format.
5686 Move -EL next to -EB, for better --help output.
5687 * target-select.cc: Include <cstdio>, "options.h", and
5689 (Target_selector::do_target_bfd_name): New function.
5690 (print_output_format): New function.
5691 * target-select.h (class Target_selector): Update declarations.
5692 (Target_selector::target_bfd_name): New function.
5693 (print_output_format): Declare.
5694 * main.cc: Include "target-select.h".
5695 (main): Handle --print-output-format.
5696 * gold.cc: Include "target-select.h".
5697 (queue_initial_tasks): Handle --print-output-format when there are
5699 * parameters.cc (parameters_force_valid_target): Give a better
5700 error message if -EB/-EL does not match target.
5701 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5704 2011-07-15 Ian Lance Taylor <iant@google.com>
5706 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5707 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5708 (Output_data_plt_i386::do_write): Write address of .dynamic
5709 section to first entry in .got.plt section.
5710 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5711 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5713 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5714 section to first entry in .got.plt section.
5715 * layout.h (Layout::dynamic_section): New function.
5717 2011-07-13 Sriraman Tallam <tmsriram@google.com>
5719 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5721 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5722 input_section_position_, and input_section_glob_.
5723 (read_layout_from_file): Call function section_ordering_specified.
5724 * layout.h (is_section_ordering_specified): New function.
5725 (section_ordering_specified): New function.
5726 (section_ordering_specified_): New boolean member.
5727 * main.cc(main): Call load_plugins after layout object is defined.
5728 * output.cc (Output_section::add_input_section): Use
5729 function section_ordering_specified to check if section ordering is
5731 * output.cc (Output_section::add_relaxed_input_section): Use
5732 function section_ordering_specified to check if section ordering is
5734 (Output_section::update_section_layout): New function.
5735 (Output_section::sort_attached_input_sections): Check if input section
5737 * output.h (Output_section::update_section_layout): New function.
5738 * plugin.cc (get_section_count): New function.
5739 (get_section_type): New function.
5740 (get_section_name): New function.
5741 (get_section_contents): New function.
5742 (update_section_order): New function.
5743 (allow_section_ordering): New function.
5744 (Plugin::load): Add the new interfaces to the transfer vector.
5745 (Plugin_manager::load_plugins): New parameter.
5746 (Plugin_manager::all_symbols_read): New parameter.
5747 (Plugin_manager::claim_file): New parameter. Save the elf object for
5749 (Plugin_manager::get_elf_object): New function.
5750 (Plugin_manager::get_view): Change to directly use the bool to check
5751 if get_view is called from claim_file_hook.
5752 * plugin.h (input_objects): New function
5753 (Plugin__manager::load_plugins): New parameter.
5754 (Plugin_manager::claim_file): New parameter.
5755 (Plugin_manager::get_elf_object): New function.
5756 (Plugin_manager::in_claim_file_handler): New function.
5757 (Plugin_manager::in_claim_file_handler_): New member.
5758 (layout): New function.
5759 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5760 handler with an extra parameter. Make the elf object before calling
5762 * testsuite/plugin_test.c (get_section_count): New function pointer.
5763 (get_section_type): New function pointer.
5764 (get_section_name): New function pointer.
5765 (get_section_contents): New function pointer.
5766 (update_section_order): New function pointer.
5767 (allow_section_ordering): New function pointer.
5768 (onload): Check if the new interfaces exist.
5770 2011-07-13 Ian Lance Taylor <iant@google.com>
5772 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5774 * x86_64.cc (Target_x86_64::got_section): Likewise.
5775 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5776 (relro_now_test_SOURCES): New variable.
5777 (relro_now_test_DEPENDENCIES): New variable.
5778 (relro_now_test_LDFLAGS): New variable.
5779 (relro_now_test_LDADD): New variable.
5780 (relro_now_test.so): New target.
5781 * testsuite/Makefile.in: Rebuild.
5783 2011-07-12 Ian Lance Taylor <iant@google.com>
5786 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5787 GLOB_DAT relocation rather than a RELATIVE relocation for a
5788 protected symbol when creating a shared library.
5789 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5790 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5791 * testsuite/protected_main_1.cc (main): Test that protected
5792 function has same address.
5794 2011-07-11 Ian Lance Taylor <iant@google.com>
5797 * options.h (class General_options): Add -Bgroup.
5798 * options.cc (General_options::finalize): If -Bgroup is set,
5799 default to --unresolved-symbols=report-all.
5800 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5801 * target-reloc.h (issue_undefined_symbol_error): Handle
5802 --unresolved-symbols=report-all.
5804 2011-07-08 Ian Lance Taylor <iant@google.com>
5807 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5808 if linker script discards key sections.
5809 (Layout::create_dynamic_symtab): Likewise.
5810 (Layout::assign_local_dynsym_offsets): Likewise.
5811 (Layout::sized_create_version_sections): Likewise.
5812 (Layout::create_interp): Likewise.
5813 (Layout::finish_dynamic_section): Likewise.
5814 (Layout::set_dynamic_symbol_size): Likewise.
5816 2011-07-08 Ian Lance Taylor <iant@google.com>
5819 * options.h (class General_options): Add --unresolved-symbols.
5820 * target-reloc.h (issue_undefined_symbol_error): Check
5821 --unresolved-symbols. Add comments.
5823 2011-07-08 Ian Lance Taylor <iant@google.com>
5825 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5826 expression more complex.
5828 2011-07-08 Ian Lance Taylor <iant@google.com>
5831 * target-reloc.h (issue_undefined_symbol_error): New inline
5832 function, broken out of relocate_section.
5833 (relocate_section): Call issue_undefined_symbol_error.
5834 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5835 there is no TLS segment if we are about to issue an undefined
5837 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5839 2011-07-08 Ian Lance Taylor <iant@google.com>
5842 * resolve.cc (Symbol_table::should_override): Add fromtype
5843 parameter. Change all callers. Give error when linking together
5844 TLS and non-TLS symbol.
5845 (Symbol_table::should_override_with_special): Add fromtype
5846 parameter. Change all callers.
5847 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5848 there is no TLS segment if we have reported some errors.
5849 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5851 2011-07-08 Ian Lance Taylor <iant@google.com>
5854 * target.h (Target::plt_address_for_global): New function.
5855 (Target::plt_address_for_local): New function.
5856 (Target::plt_section_for_global): Remove.
5857 (Target::plt_section_for_local): Remove.
5858 (Target::do_plt_address_for_global): New virtual function.
5859 (Target::do_plt_address_for_local): New virtual function.
5860 (Target::do_plt_section_for_global): Remove.
5861 (Target::do_plt_section_for_local): Remove.
5862 (Target::register_global_plt_entry): Add Symbol_table and Layout
5864 * output.cc (Output_data_got::Got_entry::write): Use
5865 plt_address_for_global and plt_address_for_local.
5866 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5867 address of output section.
5868 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5869 got_irelative_, and irelative_count_ fields. Update
5871 (Output_data_plt_i386::has_irelative_section): New function.
5872 (Output_data_plt_i386::entry_count): Add irelative_count_.
5873 (Output_data_plt_i386::set_final_data_size): Likewise.
5874 (class Target_i386): Add got_irelative_ and rel_irelative_
5875 fields. Update declarations.
5876 (Target_i386::Target_i386): Initialize new fields.
5877 (Target_i386::do_plt_address_for_global): New function replacing
5878 do_plt_section_for_global.
5879 (Target_i386::do_plt_address_for_local): New function replacing
5880 do_plt_section_for_local.
5881 (Target_i386::got_section): Create got_irelative_.
5882 (Target_i386::rel_irelative_section): New function.
5883 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5884 fields. Don't define __rel_iplt_{start,end}.
5885 (Output_data_plt_i386::add_entry): Add symtab and layout
5886 parameters. Change all callers. Use different PLT and GOT for
5888 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5889 layout parameters. Change all callers. Use different PLT and
5891 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5892 (Output_data_plt_i386::rel_irelative): New function.
5893 (Output_data_plt_i386::address_for_global): New function.
5894 (Output_data_plt_i386::address_for_local): New function.
5895 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5896 IRELATIVE GOT when changing IFUNC GOT entries.
5897 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5899 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5900 if we didn't create an IRELATIVE GOT.
5901 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5902 plt_address_for_local.
5903 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5904 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5905 got_irelative_, and irelative_count_ fields. Update
5907 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5908 Initialize new fields. Remove symtab parameter. Change all
5910 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5912 (Output_data_plt_x86_64::has_irelative_section): New function.
5913 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5914 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5915 fields. Update declarations.
5916 (Target_x86_64::Target_x86_64): Initialize new fields.
5917 (Target_x86_64::do_plt_address_for_global): New function replacing
5918 do_plt_section_for_global.
5919 (Target_x86_64::do_plt_address_for_local): New function replacing
5920 do_plt_section_for_local.
5921 (Target_x86_64::got_section): Create got_irelative_.
5922 (Target_x86_64::rela_irelative_section): New function.
5923 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5924 all callers. Don't create __rel_iplt_{start,end}.
5925 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5926 parameters. Change all callers. Use different PLT and GOT for
5928 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5929 layout parameters. Change all callers. Use different PLT and
5931 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5932 parameters. Change all callers. Use different PLT and GOT for
5934 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5935 (Output_data_plt_x86_64::rela_irelative): New function.
5936 (Output_data_plt_x86_64::address_for_global): New function.
5937 (Output_data_plt_x86_64::address_for_local): New function.
5938 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5939 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5940 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5941 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5943 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5945 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5946 symbols if we didn't create an IRELATIVE GOT.
5947 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5948 plt_address_for_local.
5949 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5950 * testsuite/ifuncvar1.c: New test file.
5951 * testsuite/ifuncvar2.c: New test file.
5952 * testsuite/ifuncvar3.c: New test file.
5953 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5954 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5955 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5956 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5957 * testsuite/Makefile.in: Rebuild.
5959 2011-07-07 Cary Coutant <ccoutant@google.com>
5961 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5962 (two_file_test_1_ndebug.o): Likewise.
5963 (two_file_test_1b_ndebug.o): Likewise.
5964 (two_file_test_2_ndebug.o): Likewise.
5965 (two_file_test_main_ndebug.o): Likewise.
5966 (incremental_test_2): Link with no-debug versions.
5968 2011-07-06 Cary Coutant <ccoutant@google.com>
5970 * gold/incremental.cc
5971 (Output_section_incremental_inputs::write_info_blocks): Check for
5972 hidden and internal symbols.
5974 2011-07-06 Cary Coutant <ccoutant@google.com>
5976 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5977 Check disposition for startup file.
5978 (Incremental_inputs::report_command_line): Ignore
5979 --incremental-startup-unchanged option.
5980 * options.cc (General_options::parse_incremental_startup_unchanged):
5982 (General_options::General_options): Initialize new data member.
5983 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5984 (General_options): Add --incremental-startup-unchanged option.
5985 (General_options::incremental_startup_disposition): New function.
5986 (General_options::incremental_startup_disposition_): New data member.
5988 2011-07-06 Cary Coutant <ccoutant@google.com>
5990 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5991 input file index to Script_info ctor.
5992 (Sized_incremental_binary::do_file_has_changed): Find the
5993 command-line argument for files named in scripts.
5994 * incremental.h (Script_info::Script_info): New ctor
5995 with input file index.
5996 (Script_info::input_file_index): New function.
5997 (Script_info::input_file_index_): New data member.
5998 (Incremental_binary::get_library): Add const.
5999 (Incremental_binary::get_script_info): Add const.
6000 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6001 * testsuite/Makefile.am (incremental_test_5): New test case.
6002 (incremental_test_6): New test case.
6003 * testsuite/Makefile.in: Regenerate.
6005 2011-07-06 Cary Coutant <ccoutant@google.com>
6007 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6008 debug output when command lines differ.
6010 2011-07-06 Cary Coutant <ccoutant@google.com>
6012 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6013 --incremental-patch option.
6014 * layout.cc (Free_list::allocate): Extend allocation beyond original
6016 (Layout::make_output_section): Mark sections that should get
6018 * options.cc (parse_percent): New function.
6019 * options.h (parse_percent): New function.
6020 (DEFINE_percent): New macro.
6021 (General_options): Add --incremental-patch option.
6022 * output.cc (Output_section::Output_section): Initialize new data
6024 (Output_section::add_input_section): Print section name when out
6026 (Output_section::add_output_section_data): Likewise.
6027 (Output_section::set_final_data_size): Add patch space when
6028 doing --incremental-full.
6029 (Output_section::do_reset_address_and_file_offset): Remove patch
6031 (Output_segment::set_section_list_addresses): Print debug output
6032 only if --incremental-update.
6033 * output.h (Output_section::set_is_patch_space_allowed): New function.
6034 (Output_section::is_patch_space_allowed_): New data member.
6035 (Output_section::patch_space_): New data member.
6036 * parameters.cc (Parameters::incremental_full): New function.
6037 * parameters.h (Parameters::incremental_full): New function
6038 * testsuite/Makefile.am (incremental_test_2): Add test for
6039 --incremental-patch option.
6040 * testsuite/Makefile.in: Regenerate.
6041 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6042 (t18): Remove function body.
6044 2011-07-05 Doug Kwan <dougkwan@google.com>
6047 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6048 Arm_Address type for relocation result.
6049 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6051 (Arm_relocate_functions::abs32): Use unaligned access.
6052 (Arm_relocate_functions::rel32): Ditto.
6053 (Arm_relocate_functions::prel31): Ditto.
6054 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6055 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6056 static data relocations.
6057 * testsuite/Makefile.in: Regnerate.
6058 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6060 2011-07-05 Ian Lance Taylor <iant@google.com>
6063 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6064 symbols if necessary.
6065 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6067 2011-07-05 Ian Lance Taylor <iant@google.com>
6070 * resolve.cc (Symbol::override_base_with_special): Simply override
6071 version with special symbol version, ignoring previous version.
6073 2011-07-05 Ian Lance Taylor <iant@google.com>
6075 * object.cc (Sized_relobj_file::include_section_group): Add
6076 information to comment about signature location.
6078 2011-07-02 Ian Lance Taylor <iant@google.com>
6081 * options.h (class General_options): Add -f and -F.
6082 * options.cc (General_options::finalize): Fatal error if -f/-F
6083 are used without -shared.
6084 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6086 2011-07-02 Ian Lance Taylor <iant@google.com>
6088 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6090 2011-07-01 Ian Lance Taylor <iant@google.com>
6094 * resolve.cc (Symbol::override_base_with_special): Don't override
6095 the version if the overriding symbol has a different name.
6096 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6097 all callers. If we give an error about an undefined version,
6098 define the base version if necessary.
6099 * dynobj.h (class Versions): Update declaration.
6100 * testsuite/weak_alias_test_5.cc: New file.
6101 * testsuite/weak_alias_test.script: New file.
6102 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6103 and versioned_alias have the right value, and call t2.
6104 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6105 weak_alias_test_5.so.
6106 (weak_alias_test_LDADD): Likewise.
6107 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6108 * testsuite/Makefile.in: Rebuild.
6110 2011-07-01 Ian Lance Taylor <iant@google.com>
6113 * options.h (class General_options): Support -z notext.
6114 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6116 (two_file_shared_nonpic.so): Likewise.
6117 (two_file_shared_mixed.so): Likewise.
6118 (two_file_shared_mixed_1.so): Likewise.
6119 (weak_undef_lib_nonpic.so): Likewise.
6120 (alt/weak_undef_lib_nonpic.so): Likewise.
6121 (tls_test_shared_nonpic.so): Likewise.
6122 * testsuite/Makefile.in: Rebuild.
6124 2011-07-01 Ian Lance Taylor <iant@google.com>
6127 * configure.ac: Test whether static linking works, setting
6128 the automake conditional HAVE_STATIC.
6129 * testsuite/Makefile.am: Disable tests using -static if
6130 HAVE_STATIC is not true.
6131 * configure, testsuite/Makefile.in: Rebuild.
6133 2011-07-01 Ian Lance Taylor <iant@google.com>
6136 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6137 Assert if we see DW_EH_PE_indirect.
6138 * target.h (Target::ehframe_datarel_base): New function.
6139 (Target::do_ehframe_datarel_base): New target function.
6140 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6141 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6144 2011-07-01 Ian Lance Taylor <iant@google.com>
6147 * options.h (class General_options): Add
6148 --ld-generated-unwind-info.
6149 * ehframe.cc (Fde::write): Add address parameter. Change all
6150 callers. If associated with PLT, fill in address and size.
6151 (Cie::set_output_offset): Only add merge mapping if there is an
6153 (Cie::write): Add address parameter. Change all callers.
6154 (Eh_frame::add_ehframe_for_plt): New function.
6155 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6156 input_offset_ fields into union u_, with new plt field.
6157 (Fde::Fde): Adjust for new union field.
6158 (Fde::Fde) [Output_data version]: New constructor.
6159 (Fde::add_mapping): Only add merge mapping if there is an object.
6160 (class Cie): Update declarations.
6161 (class Eh_frame): Declare add_ehframe_for_plt.
6162 * layout.cc (Layout::layout_eh_frame): Break out code into
6163 make_eh_frame_section, and call it.
6164 (Layout::make_eh_frame_section): New function.
6165 (Layout::add_eh_frame_for_plt): New function.
6166 * layout.h (class Layout): Update declarations.
6167 * merge.cc (Merge_map::add_mapping): Add assertion.
6168 * i386.cc: Include "dwarf.h".
6169 (class Output_data_plt_i386): Make first_plt_entry,
6170 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6171 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6172 and plt_eh_frame_fde.
6173 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6174 boundary. Call add_eh_frame_for_plt if appropriate.
6175 * x86_64.cc: Include "dwarf.h".
6176 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6177 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6178 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6179 and plt_eh_frame_fde.
6180 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6183 2011-06-29 Ian Lance Taylor <iant@google.com>
6186 * object.cc (Sized_relobj_file::layout_section): Change shdr
6187 parameter to be const.
6188 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6190 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6191 appropriate. Call layout_eh_frame_section.
6192 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6194 * object.h (class Sized_relobj_file): Update declarations.
6196 2011-06-29 Ian Lance Taylor <iant@google.com>
6199 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6201 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6203 2011-06-29 Ian Lance Taylor <iant@google.com>
6206 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6208 * layout.cc (Layout::layout_eh_frame): Likewise.
6210 2011-06-29 Ian Lance Taylor <iant@google.com>
6213 * layout.cc (Layout::symtab_section_shndx): New function.
6214 * layout.h (class Layout): Declare symtab_section_shndx.
6215 * output.cc (Output_section::write_header): Call it.
6217 2011-06-29 Ian Lance Taylor <iant@google.com>
6220 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6221 symbols which are not used in a relocation.
6223 2011-06-28 Ian Lance Taylor <iant@google.com>
6226 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6227 script create indistinguishable segments.
6228 (Layout::set_segment_offsets): Use stable_sort when sorting
6229 segments. Pass this to Compare_segments constructor.
6230 * layout.h (class Layout): Make segment_precedes non-static.
6231 (class Compare_segments): Change from struct to class. Add
6232 layout_ field. Add constructor.
6233 * script-sections.cc
6234 (Script_sections::attach_sections_using_phdrs_clause): Rename
6235 local orphan to is_orphan. Don't report failure to put empty
6236 section in segment. On attachment failure, report name of
6237 section, and attach to first PT_LOAD segment.
6239 2011-06-28 Ian Lance Taylor <iant@google.com>
6242 * target-select.cc (Target_selector::Target_selector): Add
6243 emulation parameter. Change all callers.
6244 (select_target_by_bfd_name): Rename from select_target_by_name.
6246 (select_target_by_emulation): New function.
6247 (supported_emulation_names): New function.
6248 * target-select.h (class Target_selector): Add emulation_ field.
6249 Update declarations.
6250 (Target_selector::recognize_by_bfd_name): Rename from
6251 recognize_by_name. Change all callers.
6252 (Target_selector::supported_bfd_names): Rename from
6253 supported_names. Change all callers.
6254 (Target_selector::recognize_by_emulation): New function.
6255 (Target_selector::supported_emulations): New function.
6256 (Target_selector::emulation): New function.
6257 (Target_selector::do_recognize_by_bfd_name): Rename from
6258 do_recognize_by_name. Change all callers.
6259 (Target_selector::do_supported_bfd_names): Rename from
6260 do_supported_names. Change all callers.
6261 (Target_selector::do_recognize_by_emulation): New function.
6262 (Target_selector::do_supported_emulations): New function.
6263 (select_target_by_bfd_name): Change name in declaration.
6264 (select_target_by_emulation): Declare.
6265 (supported_emulation_names): Declare.
6266 * parameters.cc (parameters_force_valid_target): Try to find
6267 target based on emulation from -m option.
6268 * options.h (class General_options): Change doc string for -m.
6269 * options.cc (help): Print emulations.
6270 (General_options::parse_V): Likewise.
6271 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6272 Add emulation parameter. Change all callers.
6274 2011-06-28 Ian Lance Taylor <iant@google.com>
6276 * target.h (class Target): Add osabi_ field.
6277 (Target::osabi): New function.
6278 (Target::set_osabi): New function.
6279 (Target::Target): Initialize osabi_.
6280 (Target::do_adjust_elf_header): Make pure virtual.
6281 (Sized_target::do_adjust_elf_header): Declare.
6282 * target.cc (Sized_target::do_adjust_elf_header): New function.
6283 (class Sized_target): Instantiate all versions.
6284 * freebsd.h (class Target_freebsd): Remove.
6285 (Target_selector_freebsd::do_recognize): Call set_osabi on
6287 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6288 (Target_selector_freebsd::set_osabi): Remove.
6289 * i386.cc (class Target_i386): Inherit from Sized_target rather
6290 than Target_freebsd.
6291 * x86_64.cc (class Target_x86_64): Likewise.
6293 2011-06-28 Ian Lance Taylor <iant@google.com>
6295 * target.h (Target::can_check_for_function_pointers): Rewrite.
6297 (Target::can_icf_inline_merge_sections): Likewise.
6298 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6299 (Target::Target_info): Add can_icf_inline_merge_sections field.
6300 (Target::do_can_check_for_function_pointers): New virtual
6302 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6303 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6304 from can_check_for_function_pointers, move in file.
6305 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6306 section_may_have_icf_unsafe_poineters, move in file.
6307 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6308 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6309 Rename from can_check_for_function_pointers, move in file.
6310 (Target_i386::can_icf_inline_merge_sections): Remove.
6311 (Target_i386::i386_info): Initialize
6312 can_icf_inline_merge_sections.
6313 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6314 Initialize can_icf_inline_merge_sections.
6315 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6316 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6317 Rename from can_check_for_function_pointers, move in file.
6318 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6319 (Target_x86_64::x86_64_info): Initialize
6320 can_icf_inline_merge_sections.
6321 * testsuite/testfile.cc (Target_test::test_target_info):
6323 * icf.cc (get_section_contents): Correct formatting.
6325 2011-06-27 Ian Lance Taylor <iant@google.com>
6327 * symtab.cc (Symbol::versioned_name): New function.
6328 (Symbol_table::add_to_final_symtab): Use versioned_name when
6330 (Symbol_table::sized_write_symbol): Likewise.
6331 * symtab.h (class Symbol): Declare versioned_name.
6332 * stringpool.h (class Stringpool_template): Add variant of add
6333 which takes a std::basic_string.
6334 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6335 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6336 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6337 (ver_test_12.o): New target.
6338 * testsuite/Makefile.in: Rebuild.
6340 2011-06-27 Doug Kwan <dougkwan@google.com>
6342 * arm.cc (Arm_relocate_functions::thm_jump8,
6343 Arm_relocate_functions::thm_jump11): Use a wider signed
6344 type to compute offset.
6345 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6347 * testsuite/Makefile.in: Regenerate.
6348 * testsuite/arm_branch_in_range.sh: Check test results of
6349 arm_thm_jump11 and arm_thm_jump8.
6350 * testsuite/arm_thm_jump11.s: New test source file.
6351 * testsuite/arm_thm_jump11.t: New linker script.
6352 * testsuite/arm_thm_jump8.s: New test source file.
6353 * testsuite/arm_thm_jump8.t: New linker script.
6355 2011-06-24 Ian Lance Taylor <iant@google.com>
6357 * layout.cc: Include "object.h".
6358 (ctors_sections_in_init_array): New static variable.
6359 (Layout::is_ctors_in_init_array): New function.
6360 (Layout::layout): Add entry to ctors_sections_in_init_array if
6362 * layout.h (class Layout): Declare is_ctors_in_init_array.
6363 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6364 is_ctors_reverse_view is set.
6365 (Sized_relobj_file::write_sections): Add layout parameter. Change
6366 all callers. Set is_ctors_reverse_view field of View_size.
6367 (Sized_relobj_file::reverse_words): New function.
6368 * object.h (Sized_relobj_file::View_size): Add
6369 is_ctors_reverse_view field.
6370 (class Sized_relobj_file): Update declarations.
6371 * testsuite/initpri3.c: New test.
6372 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6374 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6375 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6376 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6377 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6378 * testsuite/Makefile.in: Rebuild.
6380 2011-06-24 Cary Coutant <ccoutant@google.com>
6382 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6383 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6384 (debug_msg_cdebug.err): New targets.
6385 * testsuite/Makefile.in: Regenerate.
6386 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6387 Fix checks for link with shared library.
6389 2011-06-24 Doug Kwan <dougkwan@google.com>
6391 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6392 skip empty text sections.
6393 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6395 2011-06-22 Ian Lance Taylor <iant@google.com>
6398 * options.h (class General_options): Add --ctors-in-init-array.
6399 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6400 friends as SHT_PROGBITS for merging sections.
6401 (Layout::layout): Remove special handling of .init_array and
6402 friends. Don't sort if doing relocatable link. Sort for .ctors
6403 and .dtors if ctors_in_init_array.
6404 (Layout::make_output_section): Force correct section types for
6405 .init_array and friends. Don't sort if doing relocatable link,
6406 Don't sort .ctors and .dtors if ctors_in_init_array.
6407 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6408 (Layout::output_section_name): Add relobj parameter. Change all
6409 callers. Handle .ctors. and .dtors. in code rather than table.
6410 Handle .ctors and .dtors if ctors_in_init_array.
6411 (Layout::match_file_name): New function, moved from output.cc.
6412 * layout.h (class Layout): Update declarations.
6413 * output.cc: Include "layout.h".
6414 (Input_section_sort_entry::get_priority): New function.
6415 (Input_section_sort_entry::match_file_name): Just call
6416 Layout::match_file_name.
6417 (Output_section::Input_section_sort_init_fini_compare::operator()):
6418 Handle .ctors and .dtors. Sort by explicit priority rather than
6420 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6421 * testsuite/initpri2.c: New test.
6422 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6423 (check_PROGRAMS): Add initpri2.
6424 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6425 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6426 * configure, testsuite/Makefile.in: Rebuild.
6428 2011-06-19 Ian Lance Taylor <iant@google.com>
6431 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6432 .interp section to a PT_INTERP segment even if we have seen a
6433 --dynamic-linker option. Don't do it if we have seen a PHDRS
6434 clause in a linker script.
6435 (Layout::finalize): Don't create a .interp section if we've
6436 already create a PT_INTERP segment.
6437 (Layout::create_interp): Always call choose_output_section (revert
6438 patch of 2011-06-17). Don't create PT_INTERP segment.
6439 * script-sections.cc
6440 (Script_sections::create_note_and_tls_segments): Add a .interp
6441 section to a PT_INTERP segment even if we have seen a
6442 --dynamic-linker option.
6444 2011-06-18 Ian Lance Taylor <iant@google.com>
6446 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6447 merely because a non-PT_LOAD segment has a dynamic reloc.
6449 2011-06-18 Ian Lance Taylor <iant@google.com>
6451 * layout.cc (Layout::finish_dynamic_section): Don't create
6452 DT_FLAGS entry if not needed.
6454 2011-06-18 Ian Lance Taylor <iant@google.com>
6457 * layout.cc (Layout::layout_eh_frame): Correct handling of
6458 writable .eh_frame section.
6460 2011-06-17 Ian Lance Taylor <iant@google.com>
6463 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6464 symbol is redefined with the exact same object and value.
6466 2011-06-17 Ian Lance Taylor <iant@google.com>
6469 * layout.h (class Layout): Add interp_segment_ field.
6470 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6471 (Layout::attach_allocated_section_to_segment): If making shared
6472 library, put .interp section in PT_INTERP segment.
6473 (Layout::finalize): Also call create_interp if -dynamic-linker
6475 (Layout::create_interp): Assert that there is no PT_INTERP
6476 segment. If not using a SECTIONS clause, use make_output_section.
6477 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6478 * script-sections.cc
6479 (Script_sections::create_note_and_tls_segments): If making shared
6480 library, put .interp section in PT_INTERP segment.
6482 2011-06-17 Ian Lance Taylor <iant@google.com>
6484 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6485 when making a shared library.
6487 2011-06-17 Ian Lance Taylor <iant@google.com>
6489 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6490 parameter. Change all callers. Don't issue warning about PC32
6491 against locally defined symbol.
6493 2011-06-16 Ian Lance Taylor <iant@google.com>
6495 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6496 occurs in same object.
6498 2011-06-14 Alan Modra <amodra@gmail.com>
6500 * po/POTFILES.in: Regenerate.
6502 2011-06-09 Ian Lance Taylor <iant@google.com>
6504 * script-sections.cc
6505 (Orphan_output_section::set_section_addresses): For a relocatable
6506 link set address to 0.
6508 2011-06-09 Cary Coutant <ccoutant@google.com>
6511 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6512 used with --compress-debug-sections.
6513 * gold/object.cc (Sized_relobj_file::do_layout): Report
6514 uncompressed size of compressed input sections.
6516 2011-06-08 Cary Coutant <ccoutant@google.com>
6519 * testsuite/two_file_test_2_v1.cc: Change initialization of
6520 v2 to keep it in .data.
6522 2011-06-07 Cary Coutant <ccoutant@google.com>
6524 * common.cc (Symbol_table::do_allocate_commons_list): Call
6526 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6527 (Errors::fallback): New function.
6528 (gold_fallback): New function.
6529 * errors.h (Errors::fallback): New function.
6530 * gold.cc (gold_exit): Change status parameter to enum; adjust
6532 (queue_initial_tasks): Call gold_fallback.
6533 * gold.h: Include cstdlib.
6534 (Exit_status): New enum type.
6535 (gold_exit): Change status parameter to enum.
6536 (gold_fallback): New function.
6537 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6538 (Layout::create_symtab_sections): Likewise.
6539 (Layout::create_shdrs): Likewise.
6540 * main.cc (main): Adjust call to gold_exit.
6541 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6542 (Output_data_got::add_got_entry_pair): Likewise.
6543 (Output_section::add_input_section): Likewise.
6544 (Output_section::add_output_section_data): Likewise.
6545 (Output_segment::set_section_list_addresses): Likewise.
6546 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6548 2011-06-07 Cary Coutant <ccoutant@google.com>
6550 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6551 for incremental links.
6552 * output.cc (Output_segment::set_section_list_addresses): Remove
6553 FIXME and test for TLS or BSS.
6555 2011-06-07 Cary Coutant <ccoutant@google.com>
6557 * testsuite/Makefile.am: Add incremental_copy_test,
6558 incremental_common_test_1.
6559 * testsuite/Makefile.in: Regenerate.
6560 * testsuite/common_test_1_v1.c: New source file.
6561 * testsuite/common_test_1_v2.c: New source file.
6562 * testsuite/copy_test_v1.cc: New source file.
6564 2011-06-07 Cary Coutant <ccoutant@google.com>
6566 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6567 update, allocate common from bss section's free list.
6568 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6569 linker-defined symbols.
6570 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6571 Skip GOT and PLT entries that are no longer referenced.
6572 (Output_section_incremental_inputs::write_info_blocks): Mark
6573 linker-defined symbols.
6574 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6575 * output.cc (Output_section::allocate): New function.
6576 * output.h (Output_section::allocate): New function.
6577 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6578 linker-defined symbols.
6579 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6580 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6581 (Symbol::init_base_output_data): Likewise.
6582 (Symbol::init_base_output_segment): Likewise.
6583 (Symbol::init_base_constant): Likewise.
6584 (Sized_symbol::init_output_data): Likewise.
6585 (Sized_symbol::init_output_segment): Likewise.
6586 (Sized_symbol::init_constant): Likewise.
6587 (Symbol_table::do_define_in_output_data): Likewise.
6588 (Symbol_table::do_define_in_output_segment): Likewise.
6589 (Symbol_table::do_define_as_constant): Likewise.
6590 * symtab.h (Symbol::is_predefined): New function.
6591 (Symbol::init_base_output_data): Add is_predefined parameter.
6592 (Symbol::init_base_output_segment): Likewise.
6593 (Symbol::init_base_constant): Likewise.
6594 (Symbol::is_predefined_): New data member.
6595 (Sized_symbol::init_output_data): Add is_predefined parameter.
6596 (Sized_symbol::init_output_segment): Likewise.
6597 (Sized_symbol::init_constant): Likewise.
6598 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6600 2011-06-07 Cary Coutant <ccoutant@google.com>
6602 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6603 instead of emit_copy_reloc.
6604 (Copy_relocs::emit_copy_reloc): Refactor.
6605 (Copy_relocs::make_copy_reloc): New function.
6606 (Copy_relocs::add_copy_reloc): Remove.
6607 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6609 (Copy_relocs::make_copy_reloc): New function.
6610 (Copy_relocs::add_copy_reloc): Remove.
6611 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6612 unchanged input files.
6613 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6614 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6615 Reserve BSS space for COPY relocations.
6616 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6617 (Output_section_incremental_inputs::write_info_blocks): Record
6618 whether a symbol is copied from a shared object.
6619 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6620 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6621 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6622 (Incremental_input_entry_reader::get_output_symbol_index): Add
6624 (Incremental_binary::emit_copy_relocs): New function.
6625 (Incremental_binary::do_emit_copy_relocs): New function.
6626 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6628 (Sized_incremental_binary::add_copy_reloc): New function.
6629 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6630 (Sized_incremental_binary::Copy_reloc): New struct.
6631 (Sized_incremental_binary::Copy_relocs): New typedef.
6632 (Sized_incremental_binary::copy_relocs_): New data member.
6633 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6634 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6635 * target.h (Sized_target::emit_copy_reloc): New function.
6636 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6638 2011-06-02 Cary Coutant <ccoutant@google.com>
6641 * gold/archive.cc (Archive::Archive): Initialize new data member.
6642 (Archive::include_all_members): Return if archive has already been
6644 * gold/archive.h (Archive::include_all_members_): New data member.
6646 2011-06-02 Nick Clifton <nickc@redhat.com>
6648 * dynobj.h: Fix spelling mistake in comment.
6649 * output.cc: Likewise.
6651 2011-05-31 Doug Kwan <dougkwan@google.com>
6655 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
6656 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6657 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6658 redundant arm_exidx_test.so.
6659 * testsuite/Makefile.in: Regenerate.
6660 (check_SCRIPTS): Add pr12826.sh
6661 (check_DATA): Add pr12826.stdout
6662 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6663 * testsuite/pr12826.sh: New file.
6664 * testsuite/pr12826_1.s: Ditto.
6665 * testsuite/pr12826_1.s: Ditto.
6667 2011-05-30 Ian Lance Taylor <iant@google.com>
6669 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6672 2011-05-29 Ian Lance Taylor <iant@google.com>
6675 * testsuite/Makefile.am: Use different file name for two_file_test
6676 temporary file for each incremental test.
6677 * testsuite/Makefile.in: Rebuild.
6679 2011-05-29 Ian Lance Taylor <iant@google.com>
6681 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6682 binary input file is empty.
6684 2011-05-27 Ian Lance Taylor <iant@google.com>
6686 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6687 (ver_test_9.so): Likewise.
6688 * testsuite/Makefile.in: Rebuild.
6690 2011-05-26 Cary Coutant <ccoutant@google.com>
6692 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6693 * incremental.cc (Incremental_inputs::report_input_section): Fix
6694 comment, indentation.
6695 (Incremental_inputs::report_comdat_group): New function.
6696 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6697 of data for incremental input file entry.
6698 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6699 group count, COMDAT group signatures.
6700 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6701 an unchanged input file.
6702 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6703 Initialize new data member.
6704 (Incremental_object_entry::add_comdat_group): New function.
6705 (Incremental_object_entry::get_comdat_group_count): New function.
6706 (Incremental_object_entry::get_comdat_signature_key): New function.
6707 (Incremental_object_entry::groups_): New data member.
6708 (Incremental_inputs::report_comdat_group): New function.
6709 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6710 data for incremental input file entry.
6711 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6712 (Incremental_input_entry_reader::get_input_section): Adjust size of
6713 data for incremental input file entry.
6714 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6715 (Incremental_input_entry_reader::get_comdat_group_signature): New
6717 * object.cc (Sized_relobj::include_section_group): Report kept
6718 COMDAT groups for incremental links.
6720 2011-05-24 David Meyer <pdox@google.com>
6722 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6723 with name parameter. Add found_name parameter.
6724 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6725 * dirsearch.h (class Dirsearch): Update declaration.
6727 2011-05-24 Ian Lance Taylor <iant@google.com>
6729 * archive.cc (Library_base::should_include_member): Pull in object
6730 from archive if it defines the entry symbol.
6731 * parameters.cc (Parameters::entry): New function.
6732 * parameters.h (class Parameters): Declare entry.
6733 * output.h (class Output_file_header): Remove entry_ field.
6734 * output.cc (Output_file_header::Output_file_header): Remove entry
6735 parameter. Change all callers.
6736 (Output_file_header::entry): Use parameters->entry.
6737 * gold.cc (queue_middle_tasks): Likewise.
6738 * plugin.cc (Plugin_hook::run): Likewise.
6740 2011-05-24 Cary Coutant <ccoutant@google.com>
6742 * gold.cc (queue_initial_tasks): Pass incremental base filename
6743 to Output_file::open_base_file; don't print error message.
6744 * incremental-dump.cc (main): Adjust call to
6745 Output_file::open_for_modification.
6746 * incremental-dump.cc (main): Likewise.
6747 * incremental.cc (Incremental_inputs::report_command_line):
6748 Ignore --incremental-base option when comparing command lines.
6749 Ignore parameter when given as separate argument.
6750 * options.h (class General_options): Add --incremental-base.
6751 * output.cc (Output_file::Output_file):
6752 (Output_file::open_base_file): Add base_name and writable parameters;
6753 read base file into new file; print error message here.
6754 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6756 * output.h (Output_file::open_for_modification): Rename to...
6757 (Output_file::open_base_file): ...this; add base_name and
6758 writable parameters; adjust all callers.
6759 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6761 * testsuite/Makefile.am (incremental_test_4): Test
6763 * testsuite/Makefile.in: Regenerate.
6765 2011-05-24 Cary Coutant <ccoutant@google.com>
6767 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6769 * testsuite/Makefile.in: Regenerate.
6770 * testsuite/two_file_test_1_v1.cc: New test source file.
6771 * testsuite/two_file_test_1b_v1.cc: New test source file.
6772 * testsuite/two_file_test_2_v1.cc: New test source file.
6774 2011-05-24 Cary Coutant <ccoutant@google.com>
6776 * dynobj.h (Dynobj::do_dynobj): New function.
6777 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6778 flag and soname for shared objects.
6779 * incremental.cc (Incremental_inputs::report_object): Make
6780 either Incremental_object_entry or Incremental_dynobj_entry; add
6781 soname to string table.
6782 (Incremental_inputs::report_input_section): Add assertion.
6783 (Output_section_incremental_inputs::set_final_data_size): Adjust
6784 type of input file entry for shared libraries; adjust size of
6785 shared library info entry.
6786 (Output_section_incremental_inputs::write_input_files): Write
6787 as_needed flag for shared libraries.
6788 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6789 of input file entry for shared libraries; write soname.
6790 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6791 soname from incremental info.
6792 * incremental.h (enum Incremental_input_flags): Add
6793 INCREMENTAL_INPUT_AS_NEEDED.
6794 (Incremental_input_entry::Incremental_input_entry): Initialize new
6796 (Incremental_input_entry::set_as_needed): New function.
6797 (Incremental_input_entry::as_needed): New function.
6798 (Incremental_input_entry::do_dynobj_entry): New function.
6799 (Incremental_input_entry::as_needed_): New data member.
6800 (Incremental_object_entry::Incremental_object_entry): Don't check
6802 (Incremental_object_entry::do_type): Likewise.
6803 (class Incremental_dynobj_entry): New class.
6804 (Incremental_input_entry_reader::as_needed): New function.
6805 (Incremental_input_entry_reader::get_soname): New function.
6806 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6807 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6808 size of shared library info entry.
6809 * layout.cc (Layout::finish_dynamic_section): Don't test for
6810 incremental link when adding DT_NEEDED entries.
6811 * object.h (Object::Object): Initialize new data member.
6812 (Object::dynobj): New function.
6813 (Object::set_as_needed): New function.
6814 (Object::as_needed): New function.
6815 (Object::do_dynobj): New function.
6816 (Object::as_needed_): New data member.
6818 2011-05-24 Cary Coutant <ccoutant@google.com>
6820 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6821 info; adjust display of GOT entries.
6822 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6823 vector of input objects; remove file_status_.
6824 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6825 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6826 got_plt reader; call target hooks to reserve GOT entries.
6827 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6828 of input file info header and GOT info entry.
6829 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6831 (Got_plt_view_info::got_descriptor): Remove.
6832 (Got_plt_view_info::sym_index): New data member.
6833 (Got_plt_view_info::input_index): New data member.
6834 (Local_got_offset_visitor::visit): Write input file index.
6835 (Global_got_offset_visitor::visit): Write 0 for input file index.
6836 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6837 with sym_index and input_index.
6838 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6839 incremental info GOT entry; replace got_descriptor with input_index.
6840 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6841 map from input file index to object.
6842 (Sized_relobj_incr::do_layout): Replace direct data member reference
6843 with accessor function.
6844 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6845 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6846 Adjust size of input file info header.
6847 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6848 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6849 (Incremental_input_entry_reader::get_input_section): Adjust size of
6850 input file info header.
6851 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6852 of incremental info GOT entry.
6853 (Incremental_got_plt_reader::get_got_desc): Remove.
6854 (Incremental_got_plt_reader::get_got_symndx): New function.
6855 (Incremental_got_plt_reader::get_got_input_index): New function.
6856 (Sized_incremental_binary::Sized_incremental_binary): Remove
6857 file_status_; add input_objects_.
6858 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6859 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6860 (Sized_incremental_binary::file_is_unchanged): Remove.
6861 (Sized_incremental_binary::set_input_object): New function.
6862 (Sized_incremental_binary::input_object): New function.
6863 (Sized_incremental_binary::file_status_): Remove.
6864 (Sized_incremental_binary::input_objects_): New data member.
6865 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6867 (Sized_relobj_incr::invalid_address): Move to base class.
6868 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6870 (Sized_relobj_incr::do_output_section_offset): Likewise.
6871 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6872 (Sized_relobj_incr::section_offsets_): Likewise.
6873 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6875 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6876 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6877 with accessor function.
6878 (Sized_relobj_file::do_layout): Likewise.
6879 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6880 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6881 (Sized_relobj_file::compute_final_local_value): Replace refs to
6882 section_offsets_ with accessor function.
6883 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6884 * object.h (Relobj::Relobj): Initialize new data members.
6885 (Relobj::add_dyn_reloc): New function.
6886 (Relobj::first_dyn_reloc): New function.
6887 (Relobj::dyn_reloc_count): New function.
6888 (Relobj::first_dyn_reloc_): New data member.
6889 (Relobj::dyn_reloc_count_): New data member.
6890 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6892 (Sized_relobj::Address): New typedef.
6893 (Sized_relobj::invalid_address): Move here from child class.
6894 (Sized_relobj::Sized_relobj): Initialize new data members.
6895 (Sized_relobj::sized_relobj): New function.
6896 (Sized_relobj::is_output_section_offset_invalid): Move here from
6898 (Sized_relobj::get_output_section_offset): Likewise.
6899 (Sized_relobj::local_has_got_offset): Likewise.
6900 (Sized_relobj::local_got_offset): Likewise.
6901 (Sized_relobj::set_local_got_offset): Likewise.
6902 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6903 (Sized_relobj::clear_got_offsets): New function.
6904 (Sized_relobj::section_offsets): Move here from child class.
6905 (Sized_relobj::do_output_section_offset): Likewise.
6906 (Sized_relobj::do_set_section_offset): Likewise.
6907 (Sized_relobj::Local_got_offsets): Likewise.
6908 (Sized_relobj::local_got_offsets_): Likewise.
6909 (Sized_relobj::section_offsets_): Likewise.
6910 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6912 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6914 (Sized_relobj_file::sized_relobj): New function
6915 (Sized_relobj_file::local_has_got_offset): Move to base class.
6916 (Sized_relobj_file::local_got_offset): Likewise.
6917 (Sized_relobj_file::set_local_got_offset): Likewise.
6918 (Sized_relobj_file::get_output_section_offset): Likewise.
6919 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6920 (Sized_relobj_file::do_output_section_offset): Likewise.
6921 (Sized_relobj_file::do_set_section_offset): Likewise.
6922 (Sized_relobj_file::Local_got_offsets): Likewise.
6923 (Sized_relobj_file::local_got_offsets_): Likewise.
6924 (Sized_relobj_file::section_offsets_): Likewise.
6925 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6927 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6928 (Output_reloc::get_symbol_index): Likewise.
6929 (Output_reloc::local_section_offset): Likewise.
6930 (Output_reloc::get_address): Likewise.
6931 (Output_reloc::symbol_value): Likewise.
6932 (Output_data_got::reserve_slot): Move to class definition.
6933 (Output_data_got::reserve_local): New function.
6934 (Output_data_got::reserve_slot_for_global): Remove.
6935 (Output_data_got::reserve_global): New function.
6936 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6937 (all constructors, two instantiations).
6938 (Output_reloc::get_relobj): New function (two instantiations).
6939 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6940 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6941 (Output_data_reloc::add_global): Adjust type of relobj.
6942 (Output_data_reloc::add_global_relative): Likewise.
6943 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6944 (Output_data_reloc::add_local): Likewise.
6945 (Output_data_reloc::add_local_relative): Likewise.
6946 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6947 (Output_data_reloc::add_local_section): Likewise.
6948 (Output_data_reloc::add_output_section): Likewise.
6949 (Output_data_reloc::add_absolute): Likewise.
6950 (Output_data_reloc::add_target_specific): Likewise.
6951 (Output_data_got::reserve_slot): Move definition here.
6952 (Output_data_got::reserve_local): New function.
6953 (Output_data_got::reserve_global): New function.
6954 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6955 section_offsets_ with accessor function.
6956 (Sized_relobj_file::write_sections): Likewise.
6957 (Sized_relobj_file::do_relocate_sections): Likewise.
6958 * target.h (Sized_target::reserve_local_got_entry): New function.
6959 (Sized_target::reserve_global_got_entry): New function.
6960 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6961 (Target_x86_64::reserve_global_got_entry): New function.
6962 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6964 2011-05-23 Cary Coutant <ccoutant@google.com>
6966 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6967 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6968 bit when checking got_type.
6969 * incremental.cc (Sized_incremental_binary::setup_readers):
6970 Store symbol table and string table locations; initialize bit vector
6971 of file status flags.
6972 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6974 (Sized_incremental_binary::do_process_got_plt): New function.
6975 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6976 (Output_section_incremental_inputs::set_final_data_size): Record
6977 file index for each input file.
6978 (Output_section_incremental_inputs::write_got_plt): Store file index
6979 instead of input entry offset for each GOT entry.
6981 (Incremental_input_entry::Incremental_input_entry): Initialize new
6983 (Incremental_input_entry::set_offset): Store file index.
6984 (Incremental_input_entry::get_file_index): New function.
6985 (Incremental_input_entry::file_index_): New data member.
6986 (Incremental_binary::process_got_plt): New function.
6987 (Incremental_binary::do_process_got_plt): New function.
6988 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6990 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6991 (Sized_incremental_binary::set_file_is_unchanged): New function.
6992 (Sized_incremental_binary::file_is_unchanged): New function.
6993 (Sized_incremental_binary::do_process_got_plt): New function.
6994 (Sized_incremental_binary::file_status_): New data member.
6995 (Sized_incremental_binary::main_symtab_loc_): New data member.
6996 (Sized_incremental_binary::main_strtab_loc_): New data member.
6997 * output.cc (Output_data_got::Got_entry::write): Add case
6999 (Output_data_got::add_global): Call add_got_entry.
7000 (Output_data_got::add_global_plt): Likewise.
7001 (Output_data_got::add_global_with_rel): Likewise.
7002 (Output_data_got::add_global_with_rela): Likewise.
7003 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7004 (Output_data_got::add_global_pair_with_rela): Likewise.
7005 (Output_data_got::add_local): Call add_got_entry.
7006 (Output_data_got::add_local_plt): Likewise.
7007 (Output_data_got::add_local_with_rel): Likewise.
7008 (Output_data_got::add_local_with_rela): Likewise.
7009 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7010 (Output_data_got::add_local_pair_with_rela): Likewise.
7011 (Output_data_got::reserve_slot): New function.
7012 (Output_data_got::reserve_slot_for_global): New function.
7013 (Output_data_got::add_got_entry): New function.
7014 (Output_data_got::add_got_entry_pair): New function.
7015 (Output_section::add_output_section_data): Edit FIXME.
7017 (Output_section_data_build::Output_section_data_build): New
7018 constructor with size parameter.
7019 (Output_data_space::Output_data_space): Likewise.
7020 (Output_data_got::Output_data_got): Initialize new data member; new
7021 constructor with size parameter.
7022 (Output_data_got::add_constant): Call add_got_entry.
7023 (Output_data_got::reserve_slot): New function.
7024 (Output_data_got::reserve_slot_for_global): New function.
7025 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7026 (Output_data_got::add_got_entry): New function.
7027 (Output_data_got::add_got_entry_pair): New function.
7028 (Output_data_got::free_list_): New data member.
7029 * target.h (Sized_target::init_got_plt_for_update): New function.
7030 (Sized_target::register_global_plt_entry): New function.
7031 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7032 Initialize new data member; call init; add constructor with PLT count.
7033 (Output_data_plt_x86_64::init): New function.
7034 (Output_data_plt_x86_64::add_relocation): New function.
7035 (Output_data_plt_x86_64::reserve_slot): New function.
7036 (Output_data_plt_x86_64::free_list_): New data member.
7037 (Target_x86_64::init_got_plt_for_update): New function.
7038 (Target_x86_64::register_global_plt_entry): New function.
7039 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7040 incremental updates.
7041 (Output_data_plt_x86_64::add_relocation): New function.
7042 * testsuite/object_unittest.cc (Object_test): Set default options.
7044 2011-05-16 Ian Lance Taylor <iant@google.com>
7046 * options.h (class General_options): Make -i a synonym for -r.
7048 2011-05-16 Ian Lance Taylor <iant@google.com>
7050 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7052 2011-05-10 Cary Coutant <ccoutant@google.com>
7054 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7057 2011-05-06 Ian Lance Taylor <iant@google.com>
7059 * layout.cc (Layout::layout): If the output section flags change,
7060 update the ordering.
7062 2011-04-25 Cary Coutant <ccoutant@google.com>
7064 * incremental-dump.cc (dump_incremental_inputs): Print local
7065 symbol info for each input file.
7067 (Output_section_incremental_inputs::set_final_data_size): Add local
7068 symbol info to input file entries in incremental info.
7069 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7070 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7071 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7072 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7074 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7075 (Sized_incr_relobj::do_relocate): Write the local symbols.
7076 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7077 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7078 Adjust size of input file header.
7079 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7080 (Incremental_inputs_reader::get_local_symbol_count): New function.
7081 (Incremental_inputs_reader::get_input_section): Adjust size of input
7083 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7084 (Sized_incr_relobj::This): New typedef.
7085 (Sized_incr_relobj::sym_size): New const data member.
7086 (Sized_incr_relobj::Local_symbol): New struct.
7087 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7088 (Sized_incr_relobj::do_local_symbol_offset): New function.
7089 (Sized_incr_relobj::local_symbol_count_): New data member.
7090 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7091 (Sized_incr_relobj::local_symbol_index_): New data member.
7092 (Sized_incr_relobj::local_symbol_offset_): New data member.
7093 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7094 (Sized_incr_relobj::local_symbols_): New data member.
7095 * object.h (Relobj::output_local_symbol_count): New function.
7096 (Relobj::local_symbol_offset): New function.
7097 (Relobj::do_output_local_symbol_count): New function.
7098 (Relobj::do_local_symbol_offset): New function.
7099 (Sized_relobj::do_output_local_symbol_count): New function.
7100 (Sized_relobj::do_local_symbol_offset): New function.
7102 2011-04-22 Vladimir Simonov <sv@sw.ru>
7104 * descriptors.cc (set_close_on_exec): New function.
7105 (Descriptors::open): Use set_close_on_exec.
7106 * output.cc (S_ISLNK): Define if not defined.
7108 2011-04-22 Cary Coutant <ccoutant@google.com>
7110 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7112 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7113 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7114 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7116 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7117 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7118 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7120 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7122 (Incremental_binary::apply_incremental_relocs): New function.
7123 (Incremental_binary::do_apply_incremental_relocs): New function.
7124 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7126 (Sized_incremental_binary::add_global_symbol): New function.
7127 (Sized_incremental_binary::global_symbol): New function.
7128 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7129 (Sized_incremental_binary::symbol_map_): New data member.
7130 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7131 * target.h (Sized_target::apply_relocation): New function.
7132 * target-reloc.h (apply_relocation): New function.
7133 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7135 2011-04-22 Doug Kwan <dougkwan@google.com>
7137 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7138 flag of a SHT_ARM_EXIDX section.
7139 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7140 * testsuite/Makefile.in: Regenerate.
7141 * testsuite/arm_exidx_test.s: New file.
7142 * testsuite/arm_exidx_test.sh: Same.
7144 2011-04-20 Cary Coutant <ccoutant@google.com>
7147 * archive.h (Incremental_archive_entry::Archive_member):
7148 Initialize arg_serial_ (second constructor).
7150 2011-04-17 Ian Lance Taylor <iant@google.com>
7152 * object.cc (Relocate_info::location): Simplify location string.
7153 * errors.cc (Errors::error_at_location): Don't print program
7155 (Errors::warning_at_location): Likewise.
7156 (Errors::undefined_symbol): Likewise.
7157 * testsuite/debug_msg.sh: Update accordingly.
7159 2011-04-14 Cary Coutant <ccoutant@google.com>
7161 * gold/layout.cc (Layout::symtab_section_offset): New function.
7162 * gold/layout.h (Layout::symtab_section_offset): New function.
7163 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7165 2011-04-12 Ian Lance Taylor <iant@google.com>
7167 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7168 with MREMAP_MAYMOVE.
7169 * output.h (class Output_file): Add map_is_allocated_ field.
7170 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7171 not available, provide stubs. If mremap is not available, #define
7173 (MREMAP_MAYMOVE): Define if not defined.
7174 (Output_file::Output_file): Initialize map_is_allocated_.
7175 (Output_file::resize): Check map_is_allocated_.
7176 (Output_file::map_anonymous): If mmap fails, use malloc.
7177 (Output_file::unmap): Don't do anything for an anonymous map.
7178 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7179 is not available, provide stubs.
7180 (File_read::View::~View): Use free rather than delete[].
7181 (File_read::make_view): Use malloc rather than new[]. If mmap
7183 (File_read::find_or_make_view): Use malloc rather than new[].
7184 * gold.h: Remove HAVE_REMAP code.
7185 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7186 exists. Rename mremap to gold_mremap. If mmap is not available
7188 * configure, config.in: Rebuild.
7190 2011-04-11 Ian Lance Taylor <iant@google.com>
7192 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7193 initialize local variable v.
7195 2011-04-11 Cary Coutant <ccoutant@google.com>
7197 * archive.cc (Archive::include_member): Adjust call to
7199 (Add_archive_symbols::run): Track argument serial numbers.
7200 (Lib_group::include_member): Likewise.
7201 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7202 * archive.h (Incremental_archive_entry::Archive_member):
7203 Initialize arg_serial_.
7204 (Archive_member::arg_serial_): New data member.
7205 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7206 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7208 (Sized_dynobj::do_for_all_local_got_entries): New function.
7209 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7211 * fileread.cc (get_mtime): New function.
7212 * fileread.h (get_mtime): New function.
7213 * gold.cc (queue_initial_tasks): Check for incremental update.
7214 (process_incremental_input): New function.
7215 (queue_middle_tasks): Don't force valid target for incremental
7217 * incremental-dump.cc (find_input_containing_global): Adjust
7218 size of symbol info entry.
7219 (dump_incremental_inputs): Dump argument serial number and
7220 in_system_directory flag; bias shndx by 1; print symbol names
7221 when dumping per-file symbol lists; use new symbol info readers.
7223 (Output_section_incremental_inputs:update_data_size): New function.
7224 (Sized_incremental_binary::setup_readers): Setup input readers
7225 for each input file; build maps for files added from libraries
7227 (Sized_incremental_binary::check_input_args): New function.
7228 (Sized_incremental_binary::do_check_inputs): Build map of argument
7229 serial numbers to input arguments.
7230 (Sized_incremental_binary::do_file_has_changed): Rename
7231 do_file_is_unchanged to this; compare file modification times.
7232 (Sized_incremental_binary::do_init_layout): New function.
7233 (Sized_incremental_binary::do_reserve_layout): New function.
7234 (Sized_incremental_binary::do_get_input_reader): Remove.
7235 (Sized_incremental_binary::get_symtab_view): New function.
7236 (Incremental_checker::can_incrementally_link_output_file): Remove.
7237 (Incremental_inputs::report_command_line): Exclude --debug options.
7238 (Incremental_inputs::report_archive_begin): Add parameter; track
7239 argument serial numbers; don't put input file entry for archive
7240 before archive members.
7241 (Incremental_inputs::report_archive_end): Put input file entry
7242 for archive after archive members.
7243 (Incremental_inputs::report_object): Add parameter; track argument
7244 serial numbers and in_system_directory flag.
7245 (Incremental_inputs::report_script): Add parameter; track argument
7247 (Output_section_incremental_inputs::set_final_data_size): Adjust
7248 size of symbol info entry; check for forwarding symbols.
7249 (Output_section_incremental_inputs::write_input_files): Write
7250 in_system_directory flag and argument serial number.
7251 (Output_section_incremental_inputs::write_info_blocks): Map section
7252 indices between incremental info and original input file; store
7253 input section index for each symbol.
7254 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7255 change operator() to visit().
7256 (class Global_got_offset_visitor): Likewise.
7257 (class Global_symbol_visitor_got_plt):
7258 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7260 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7261 (Sized_incr_relobj::do_read_symbols): New function.
7262 (Sized_incr_relobj::do_layout): New function.
7263 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7264 (Sized_incr_relobj::do_add_symbols): New function.
7265 (Sized_incr_relobj::do_should_include_member): New function.
7266 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7267 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7268 (Sized_incr_relobj::do_section_size): New function.
7269 (Sized_incr_relobj::do_section_name): New function.
7270 (Sized_incr_relobj::do_section_contents): New function.
7271 (Sized_incr_relobj::do_section_flags): New function.
7272 (Sized_incr_relobj::do_section_entsize): New function.
7273 (Sized_incr_relobj::do_section_address): New function.
7274 (Sized_incr_relobj::do_section_type): New function.
7275 (Sized_incr_relobj::do_section_link): New function.
7276 (Sized_incr_relobj::do_section_info): New function.
7277 (Sized_incr_relobj::do_section_addralign): New function.
7278 (Sized_incr_relobj::do_initialize_xindex): New function.
7279 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7280 (Sized_incr_relobj::do_read_relocs): New function.
7281 (Sized_incr_relobj::do_gc_process_relocs): New function.
7282 (Sized_incr_relobj::do_scan_relocs): New function.
7283 (Sized_incr_relobj::do_count_local_symbols): New function.
7284 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7285 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7286 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7287 (Sized_incr_relobj::do_relocate): New function.
7288 (Sized_incr_relobj::do_set_section_offset): New function.
7289 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7290 (Sized_incr_dynobj::do_read_symbols): New function.
7291 (Sized_incr_dynobj::do_layout): New function.
7292 (Sized_incr_dynobj::do_add_symbols): New function.
7293 (Sized_incr_dynobj::do_should_include_member): New function.
7294 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7295 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7296 (Sized_incr_dynobj::do_section_size): New function.
7297 (Sized_incr_dynobj::do_section_name): New function.
7298 (Sized_incr_dynobj::do_section_contents): New function.
7299 (Sized_incr_dynobj::do_section_flags): New function.
7300 (Sized_incr_dynobj::do_section_entsize): New function.
7301 (Sized_incr_dynobj::do_section_address): New function.
7302 (Sized_incr_dynobj::do_section_type): New function.
7303 (Sized_incr_dynobj::do_section_link): New function.
7304 (Sized_incr_dynobj::do_section_info): New function.
7305 (Sized_incr_dynobj::do_section_addralign): New function.
7306 (Sized_incr_dynobj::do_initialize_xindex): New function.
7307 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7308 (make_sized_incremental_object): New function.
7309 (Incremental_library::copy_unused_symbols): New function.
7310 (Incremental_library::do_for_all_unused_symbols): New function.
7311 * incremental.h (enum Incremental_input_flags): New type.
7312 (class Incremental_checker): Remove.
7313 (Incremental_input_entry::Incremental_input_entry): Add argument
7315 (Incremental_input_entry::arg_serial): New function.
7316 (Incremental_input_entry::set_is_in_system_directory): New function.
7317 (Incremental_input_entry::is_in_system_directory): New function.
7318 (Incremental_input_entry::arg_serial_): New data member.
7319 (Incremental_input_entry::is_in_system_directory_): New data member.
7320 (class Script_info): Move here from script.h.
7321 (Script_info::Script_info): Add filename parameter.
7322 (Script_info::filename): New function.
7323 (Script_info::filename_): New data member.
7324 (Incremental_script_entry::Incremental_script_entry): Add argument
7326 (Incremental_object_entry::Incremental_object_entry): Likewise.
7327 (Incremental_object_entry::add_input_section): Build list of input
7328 sections with map to original shndx.
7329 (Incremental_object_entry::get_input_section_index): New function.
7330 (Incremental_object_entry::shndx_): New data member.
7331 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7332 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7333 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7335 (Incremental_inputs::report_archive_begin): Likewise.
7336 (Incremental_inputs::report_object): Likewise.
7337 (Incremental_inputs::report_script): Likewise.
7338 (class Incremental_global_symbol_reader): New class.
7339 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7340 and store flags and input file type.
7341 (Incremental_input_entry_reader::arg_serial): New function.
7342 (Incremental_input_entry_reader::type): Extract type from flags.
7343 (Incremental_input_entry_reader::is_in_system_directory): New function.
7344 (Incremental_input_entry_reader::get_input_section_count): Call
7345 accessor function for type.
7346 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7347 function for type; adjust size of global symbol entry.
7348 (Incremental_input_entry_reader::get_global_symbol_count): Call
7349 accessor function for type.
7350 (Incremental_input_entry_reader::get_object_count): Likewise.
7351 (Incremental_input_entry_reader::get_object_offset): Likewise.
7352 (Incremental_input_entry_reader::get_member_count): Likewise.
7353 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7354 (Incremental_input_entry_reader::get_member_offset): Likewise.
7355 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7356 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7357 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7358 (Incremental_input_entry_reader::get_global_symbol_reader): New
7360 (Incremental_input_entry_reader::get_output_symbol_index): New
7362 (Incremental_input_entry_reader::type_): Remove.
7363 (Incremental_input_entry_reader::flags_): New data member.
7364 (Incremental_inputs_reader::input_file_offset): New function.
7365 (Incremental_inputs_reader::input_file_index): New function.
7366 (Incremental_inputs_reader::input_file): Call input_file_offset.
7367 (Incremental_inputs_reader::input_file_at_offset): New function.
7368 (Incremental_relocs_reader::get_r_type): Reformat.
7369 (Incremental_relocs_reader::get_r_shndx): Reformat.
7370 (Incremental_relocs_reader::get_r_offset): Reformat.
7371 (Incremental_relocs_reader::data): New function.
7372 (Incremental_binary::Incremental_binary): Initialize new data members.
7373 (Incremental_binary::check_inputs): Add cmdline parameter.
7374 (Incremental_binary::file_is_unchanged): Remove.
7375 (Input_reader::arg_serial): New function.
7376 (Input_reader::get_unused_symbol_count): New function.
7377 (Input_reader::get_unused_symbol): New function.
7378 (Input_reader::do_arg_serial): New function.
7379 (Input_reader::do_get_unused_symbol_count): New function.
7380 (Input_reader::do_get_unused_symbol): New function.
7381 (Incremental_binary::input_file_count): New function.
7382 (Incremental_binary::get_input_reader): Change signature to use
7383 index instead of filename.
7384 (Incremental_binary::file_has_changed): New function.
7385 (Incremental_binary::get_input_argument): New function.
7386 (Incremental_binary::get_library): New function.
7387 (Incremental_binary::get_script_info): New function.
7388 (Incremental_binary::init_layout): New function.
7389 (Incremental_binary::reserve_layout): New function.
7390 (Incremental_binary::output_file): New function.
7391 (Incremental_binary::do_check_inputs): New function.
7392 (Incremental_binary::do_file_is_unchanged): Remove.
7393 (Incremental_binary::do_file_has_changed): New function.
7394 (Incremental_binary::do_init_layout): New function.
7395 (Incremental_binary::do_reserve_layout): New function.
7396 (Incremental_binary::do_input_file_count): New function.
7397 (Incremental_binary::do_get_input_reader): Change signature.
7398 (Incremental_binary::input_args_map_): New data member.
7399 (Incremental_binary::library_map_): New data member.
7400 (Incremental_binary::script_map_): New data member.
7401 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7403 (Sized_incremental_binary::output_section): New function.
7404 (Sized_incremental_binary::inputs_reader): Add const.
7405 (Sized_incremental_binary::symtab_reader): Add const.
7406 (Sized_incremental_binary::relocs_reader): Add const.
7407 (Sized_incremental_binary::got_plt_reader): Add const.
7408 (Sized_incremental_binary::get_symtab_view): New function.
7409 (Sized_incremental_binary::Inputs_reader): New typedef.
7410 (Sized_incremental_binary::Input_entry_reader): New typedef.
7411 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7412 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7413 (Sized_incremental_binary::do_file_has_changed): New function.
7414 (Sized_incremental_binary::do_init_layout): New function.
7415 (Sized_incremental_binary::do_reserve_layout): New function.
7416 (Sized_input_reader::Inputs_reader): Remove.
7417 (Sized_input_reader::Input_entry_reader): Remove.
7418 (Sized_input_reader::do_arg_serial): New function.
7419 (Sized_input_reader::do_get_unused_symbol_count): New function.
7420 (Sized_input_reader::do_get_unused_symbol): New function.
7421 (Sized_incremental_binary::do_input_file_count): New function.
7422 (Sized_incremental_binary::do_get_input_reader): Change signature;
7423 use index instead of filename.
7424 (Sized_incremental_binary::section_map_): New data member.
7425 (Sized_incremental_binary::input_entry_readers_): New data member.
7426 (class Sized_incr_relobj): New class.
7427 (class Sized_incr_dynobj): New class.
7428 (make_sized_incremental_object): New function.
7429 (class Incremental_library): New class.
7430 * layout.cc (Free_list::num_lists): New static data member.
7431 (Free_list::num_nodes): New static data member.
7432 (Free_list::num_removes): New static data member.
7433 (Free_list::num_remove_visits): New static data member.
7434 (Free_list::num_allocates): New static data member.
7435 (Free_list::num_allocate_visits): New static data member.
7436 (Free_list::init): New function.
7437 (Free_list::remove): New function.
7438 (Free_list::allocate): New function.
7439 (Free_list::dump): New function.
7440 (Free_list::print_stats): New function.
7441 (Layout_task_runner::run): Resize output file for incremental updates.
7442 (Layout::Layout): Initialize new data members.
7443 (Layout::set_incremental_base): New function.
7444 (Layout::init_fixed_output_section): New function.
7445 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7446 incremental updates.
7447 (Layout::create_gold_note): Do not create gold note section for
7448 incremental updates.
7449 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7450 for incremental updates.
7451 (Layout::set_section_offsets): For incremental updates, allocate space
7453 (Layout::create_symtab_sections): Layout with offsets relative to
7454 start of section; for incremental updates, allocate space from free
7456 (Layout::create_shdrs): For incremental updates, allocate space from
7458 (Layout::finish_dynamic_section): For incremental updates, do not
7459 check --as-needed (fixed in subsequent patch).
7460 * layout.h (class Free_list): New class.
7461 (Layout::set_incremental_base): New function.
7462 (Layout::incremental_base): New function.
7463 (Layout::init_fixed_output_section): New function.
7464 (Layout::allocate): New function.
7465 (Layout::incremental_base_): New data member.
7466 (Layout::free_list_): New data member.
7467 * main.cc (main): Print Free_list statistics.
7468 * object.cc (Relobj::finalize_incremental_relocs): Add
7469 clear_counts parameter; clear counts only when clear_counts is set.
7470 (Sized_relobj::Sized_relobj): Initialize new base class.
7471 (Sized_relobj::do_layout): Don't report special sections.
7472 (Sized_relobj::do_for_all_local_got_entries): New function.
7473 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7474 symtab_off to all symbol table offsets.
7475 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7476 * object.h (class Got_offset_list): Move to top of file.
7477 (Object::Object): Allow case where input_file == NULL.
7478 (Object::~Object): Likewise.
7479 (Object::input_file): Assert that input_file != NULL.
7480 (Object::lock): Allow case where input_file == NULL.
7481 (Object::unlock): Likewise.
7482 (Object::is_locked): Likewise.
7483 (Object::token): Likewise.
7484 (Object::release): Likewise.
7485 (Object::is_incremental): New function.
7486 (Object::get_mtime): New function.
7487 (Object::for_all_local_got_entries): New function.
7488 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7489 (Object::set_is_in_system_directory): New function.
7490 (Object::is_in_system_directory): New function.
7491 (Object::do_is_incremental): New function.
7492 (Object::do_get_mtime): New function.
7493 (Object::do_for_all_local_got_entries): New function.
7494 (Object::is_in_system_directory_): New data member.
7495 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7496 (class Sized_relobj_base): New class.
7497 (class Sized_relobj): Derive from Sized_relobj_base.
7498 (class Sized_relobj::Symbols): Redeclare from base class.
7499 (class Sized_relobj::local_got_offset_list): Remove.
7500 (class Sized_relobj::Output_sections): Redeclare from base class.
7501 (class Sized_relobj::do_for_all_local_got_entries): New function.
7502 (class Sized_relobj::write_local_symbols): Add offset parameter.
7503 (class Sized_relobj::local_symbol_offset_): Update comment.
7504 (class Sized_relobj::local_dynsym_offset_): Update comment.
7505 * options.cc (Input_arguments::add_file): Remove const.
7506 * options.h (Input_file_argument::Input_file_argument):
7507 Initialize arg_serial_ (all constructors).
7508 (Input_file_argument::set_arg_serial): New function.
7509 (Input_file_argument::arg_serial): New function.
7510 (Input_file_argument::arg_serial_): New data member.
7511 (Input_arguments::Input_arguments): Initialize file_count_.
7512 (Input_arguments::add_file): Remove const.
7513 (Input_arguments::number_of_input_files): New function.
7514 (Input_arguments::file_count_): New data member.
7515 (Command_line::number_of_input_files): Call
7516 Input_arguments::number_of_input_files.
7517 * output.cc (Output_segment_headers::Output_segment_headers):
7519 (Output_section::Input_section::current_data_size): New function.
7520 (Output_section::Output_section): Initialize new data members.
7521 (Output_section::add_input_section): Don't do merge sections for
7522 an incremental link; allocate space from free list for an
7524 (Output_section::add_output_section_data): Allocate space from
7525 free list for an incremental update.
7526 (Output_section::update_data_size): New function.
7527 (Output_section::set_fixed_layout): New function.
7528 (Output_section::reserve): New function.
7529 (Output_segment::set_section_addresses): Remove const.
7530 (Output_segment::set_section_list_addresses): Remove const; allocate
7531 space from free list for an incremental update.
7532 (Output_segment::set_offset): Adjust size of RELRO segment for an
7534 * output.h (Output_data::current_data_size): Move here from
7536 (Output_data::pre_finalize_data_size): New function.
7537 (Output_data::update_data_size): New function.
7538 (Output_section_headers::update_data_size): new function.
7539 (Output_section_data_build::current_data_size): Move to Output_data.
7540 (Output_data_strtab::update_data_size): New function.
7541 (Output_section::current_data_size): Move to Output_data.
7542 (Output_section::set_fixed_layout): New function.
7543 (Output_section::has_fixed_layout): New function.
7544 (Output_section::reserve): New function.
7545 (Output_section::update_data_size): New function.
7546 (Output_section::has_fixed_layout_): New data member.
7547 (Output_section::free_list_): New data member.
7548 (Output_segment::set_section_addresses): Remove const.
7549 (Output_segment::set_section_list_addresses): Remove const.
7550 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7552 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7554 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7555 parameter when calling Add_symbols constructor; store argument
7556 serial number for members of a lib group.
7557 (Add_symbols::locks): Allow case where token == NULL.
7558 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7559 (Read_member::~Read_member): New function.
7560 (Read_member::is_runnable): New function.
7561 (Read_member::locks): New function.
7562 (Read_member::run): New function.
7563 (Check_script::~Check_script): New function.
7564 (Check_script::is_runnable): New function.
7565 (Check_script::locks): New function.
7566 (Check_script::run): New function.
7567 (Check_library::~Check_library): New function.
7568 (Check_library::is_runnable): New function.
7569 (Check_library::locks): New function.
7570 (Check_library::run): New function.
7571 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7572 (Add_symbols::library_): New data member.
7573 (class Read_member): New class.
7574 (class Check_script): New class.
7575 (class Check_library): New class.
7576 * reloc.cc (Read_relocs::is_runnable): Allow case where
7578 (Read_relocs::locks): Likewise.
7579 (Scan_relocs::locks): Likewise.
7580 (Relocate_task::locks): Likewise.
7581 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7583 (Sized_relobj::incremental_relocs_scan): Fix comment.
7584 (Sized_relobj::do_relocate): Pass output file offset to
7585 write_local_symbols.
7586 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7587 from class declaration.
7588 * script.cc (read_input_script): Allocate Script_info; pass
7589 argument serial number to report_script.
7590 * script.h (class Script_info): Move to incremental.h.
7591 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7592 * symtab.h (Symbol_table::add_from_incrobj): New function.
7593 (Symbol_table::set_file_offset): New function.
7595 2011-04-05 Cary Coutant <ccoutant@google.com>
7597 * incremental-dump.cc (dump_incremental_inputs): Change signature
7598 to take a Sized_incremental_binary; change caller. Use readers
7599 in Sized_incremental_binary.
7601 (Sized_incremental_binary::find_incremental_inputs_sections):
7602 Rename do_find_incremental_inputs_sections to this.
7603 (Sized_incremental_binary::setup_readers): New function.
7604 (Sized_incremental_binary::do_check_inputs): Check
7605 has_incremental_info_ flag; move setup code to setup_readers;
7607 (Sized_incremental_binary::do_file_is_unchanged): New function.
7608 (Sized_incremental_binary::do_get_input_reader): New function.
7609 * incremental.h (class Incremental_binary): Move to end of file.
7610 (Incremental_binary::file_is_unchanged): New function.
7611 (Incremental_binary::do_file_is_unchanged): New function.
7612 (Incremental_binary::Input_reader): New class.
7613 (Incremental_binary::get_input_reader): New function.
7614 (class Sized_incremental_binary): Move to end of file.
7615 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7616 input section reader classes.
7617 (Sized_incremental_binary::has_incremental_info): New function.
7618 (Sized_incremental_binary::inputs_reader): New function.
7619 (Sized_incremental_binary::symtab_reader): New function.
7620 (Sized_incremental_binary::relocs_reader): New function.
7621 (Sized_incremental_binary::got_plt_reader): New function.
7622 (Sized_incremental_binary::do_file_is_unchanged): New function.
7623 (Sized_incremental_binary::Sized_input_reader): New class.
7624 (Sized_incremental_binary::get_input_reader): New function.
7625 (Sized_incremental_binary::find_incremental_inputs_sections):
7626 Rename do_find_incremental_inputs_sections to this.
7627 (Sized_incremental_binary::setup_readers): New function.
7628 (Sized_incremental_binary::has_incremental_info_): New data member.
7629 (Sized_incremental_binary::inputs_reader_): New data member.
7630 (Sized_incremental_binary::symtab_reader_): New data member.
7631 (Sized_incremental_binary::relocs_reader_): New data member.
7632 (Sized_incremental_binary::got_plt_reader_): New data member.
7633 (Sized_incremental_binary::current_input_file_): New data member.
7635 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7638 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7641 2011-03-30 Cary Coutant <ccoutant@google.com>
7643 * archive.cc (Archive::include_member): Adjust call to report_object.
7644 (Add_archive_symbols::run): Add script_info to call to
7645 report_archive_begin.
7646 (Lib_group::include_member): Adjust call to report_object.
7647 (Add_lib_group_symbols::run): Adjust call to report_object.
7648 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7649 blocks. Add object count for script input files.
7650 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7651 script_info parameter; change all callers.
7652 (Incremental_inputs::report_object): Add script_info parameter;
7654 (Incremental_inputs::report_script): Store backpointer to
7655 incremental info entry.
7656 (Output_section_incremental_inputs::set_final_data_size): Record
7657 additional information for scripts.
7658 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7659 * incremental.h (Incremental_script_entry::add_object): New function.
7660 (Incremental_script_entry::get_object_count): New function.
7661 (Incremental_script_entry::get_object): New function.
7662 (Incremental_script_entry::objects_): New data member; adjust
7664 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7665 (Incremental_inputs::report_object): Add script_info parameter.
7666 (Incremental_inputs_reader::get_object_count): New function.
7667 (Incremental_inputs_reader::get_object_offset): New function.
7668 * options.cc (Input_arguments::add_file): Return reference to
7670 * options.h (Input_argument::set_script_info): New function.
7671 (Input_argument::script_info): New function.
7672 (Input_argument::script_info_): New data member; adjust all
7674 (Input_file_group::add_file): Return reference to new input argument.
7675 (Input_file_lib::add_file): Likewise.
7676 (Input_arguments::add_file): Likewise.
7677 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7678 * script.cc (Parser_closure::Parser_closure): Add script_info
7679 parameter; adjust all callers.
7680 (Parser_closure::script_info): New function.
7681 (Parser_closure::script_info_): New data member.
7682 (read_input_script): Report scripts earlier to incremental info.
7683 (script_add_file): Set script_info in Input_argument.
7684 (script_add_library): Likewise.
7685 * script.h (Script_options::Script_info): Rewrite class.
7687 2011-03-29 Cary Coutant <ccoutant@google.com>
7689 * archive.cc (Library_base::should_include_member): Move
7690 method here from class Archive.
7691 (Archive::Archive): Initialize base class.
7692 (Archive::should_include_member): Move to base class.
7693 (Archive::do_for_all_unused_symbols): New function.
7694 (Add_archive_symbols::run): Remove redundant access to
7696 (Lib_group::Lib_group): Initialize base class.
7697 (Lib_group::do_filename): New function.
7698 (Lib_group::include_member): Pass pointer to Lib_group to
7700 (Lib_group::do_for_all_unused_symbols): New function.
7701 (Add_lib_group_symbols::run): Report archive information for
7703 * archive.h (class Library_base): New base class.
7704 (class Archive): Derive from Library_base.
7705 (Archive::filename): Move to base class.
7706 (Archive::set_incremental_info): Likewise.
7707 (Archive::incremental_info): Likewise.
7708 (Archive::Should_include): Likewise.
7709 (Archive::should_include_member): Likewise.
7710 (Archive::Armap_entry): Remove.
7711 (Archive::Unused_symbol_iterator): Remove.
7712 (Archive::unused_symbols_begin): Remove.
7713 (Archive::unused_symbols_end): Remove.
7714 (Archive::do_filename): New function.
7715 (Archive::do_get_mtime): New function.
7716 (Archive::do_for_all_unused_symbols): New function.
7717 (Archive::task_): Move to base class.
7718 (Archive::incremental_info_): Likewise.
7719 (class Lib_group): Derive from Library_base.
7720 (Lib_group::do_filename): New function.
7721 (Lib_group::do_get_mtime): New function.
7722 (Lib_group::do_for_all_unused_symbols): New function.
7723 (Lib_group::task_): Move to base class.
7724 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7726 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7728 * incremental.cc (Incremental_inputs::report_archive_begin):
7729 Use Library_base; call library's get_mtime; add incremental inputs
7730 entry before members.
7731 (class Unused_symbol_visitor): New class.
7732 (Incremental_inputs::report_archive_end): Use Library_base; use
7733 visitor class to record unused symbols; don't add incremental inputs
7734 entry after members.
7735 (Incremental_inputs::report_object): Use Library_base.
7737 (Incremental_archive_entry::Incremental_archive_entry): Remove
7738 unused Archive parameter.
7739 (Incremental_inputs::report_archive_begin): Use Library_base.
7740 (Incremental_inputs::report_archive_end): Likewise.
7741 (Incremental_inputs::report_object): Likewise.
7742 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7744 * object.h (Object::for_all_global_symbols): New function.
7745 (Object::do_for_all_global_symbols): New function.
7746 (Sized_relobj::do_for_all_global_symbols): New function.
7747 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7749 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7752 2011-03-27 Ian Lance Taylor <iant@google.com>
7754 * archive.cc (Archive::interpret_header): Return -1 if something
7755 goes wrong. Change callers accordingly.
7757 2011-03-25 Cary Coutant <ccoutant@google.com>
7759 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7760 * testsuite/Makefile.in: Regenerate.
7762 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
7764 * plugin.cc (get_view): New.
7765 (Plugin::load): Pass get_view to the plugin.
7766 (Plugin_manager::get_view): New.
7768 2011-03-21 Ian Lance Taylor <iant@google.com>
7770 * testsuite/final_layout.sh: Rewrite to not use dc.
7771 * testsuite/relro_test.sh: Fail if dc is not present.
7773 2011-03-21 Sriraman Tallam <tmsriram@google.com>
7775 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7777 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7778 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7780 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7781 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7783 2011-03-14 Ian Lance Taylor <iant@google.com>
7785 * script-sections.cc (Sort_output_sections::script_compare):
7786 Rename from is_before, change return type.
7787 (Sort_output_sections::operator()): Adjust accordingly.
7789 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7792 * testsuite/odr_violation2.cc: Add comment to make all error line
7793 numbers double digits.
7794 * testsuite/debug_msg.sh: Adjust expected errors.
7796 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7798 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7799 but mark earlier ones as non-canonical
7800 (offset_to_iterator): Update search target and example
7801 (do_addr2line): Return extra lines in a vector*
7802 (format_file_lineno): Extract from do_addr2line
7803 (one_addr2line): Add vector* out-param
7804 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7805 when a lineno entry appeared last for its instruction
7806 (Dwarf_line_info): Add vector* out-param
7807 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7808 * symtab.cc (Odr_violation_compare): Include the lineno in the
7810 (linenos_from_loc): New. Combine the canonical line for an
7811 address with its other lines.
7812 (True_if_intersect): New. Helper functor to make
7813 std::set_intersection a query.
7814 (detect_odr_violations): Compare sets of lines instead of just
7815 one line for each function. This became less deterministic, but
7816 has fewer false positives.
7817 * symtab.h: Declarations.
7818 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7819 mix an optimized and non-optimized object in the same binary
7820 (odr_violation2.so): Same.
7821 * testsuite/Makefile.in: Regenerate from Makefile.am.
7822 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7823 * testsuite/debug_msg.sh: Update line numbers and add
7825 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7826 non-optimized context.
7827 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7828 isn't inlined, and use OdrDerived in an optimized context.
7829 * testsuite/odr_header1.h: Defines OdrDerived, where
7830 optimization will change the
7831 first-instruction-in-the-destructor's file and line number.
7832 * testsuite/odr_header2.h: Defines OdrBase.
7834 2011-03-09 Ian Lance Taylor <iant@google.com>
7836 * fileread.cc (File_read::clear_views): Don't delete the whole
7839 2011-03-08 Ian Lance Taylor <iant@google.com>
7842 * fileread.cc: #include <climits>.
7843 (GOLD_IOV_MAX): Define.
7844 (File_read::read_multiple): Limit number of entries by iov_max.
7845 * fileread.h (class File_read): Always set max_readv_entries to
7848 2011-03-07 Ian Lance Taylor <iant@google.com>
7851 * options.h (class General_options): Add -dy and -dn.
7853 2011-03-02 Cary Coutant <ccoutant@google.com>
7855 * testsuite/script_test_9.t: Add TLS segment.
7857 2011-03-02 Simon Baldwin <simonb@google.com>
7859 * configure.ac: Add check for gnu_indirect_function support in
7860 the toolchain building binutils.
7861 * configure: Rebuild.
7863 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
7865 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7866 plugin only symbols.
7867 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7868 in plugin files as not needed in the symbol table.
7870 2011-02-11 Sriraman Tallam <tmsriram@google.com>
7872 * output.cc (Output_section::add_input_section): Delay fill
7873 generation for section ordering.
7875 2011-02-09 Ian Lance Taylor <iant@google.com>
7878 * object.h (class Sized_relobj): Remove clear_local_symbols.
7879 * reloc.cc (Sized_relobj::do_relocate): Don't call
7880 clear_local_symbols.
7882 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
7884 * plugin.cc (is_visible_from_outside): Return true for symbols
7887 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7889 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7892 2011-02-02 Sriraman Tallam <tmsriram@google.com>
7894 * icf.h (is_section_foldable_candidate): Change type of parameter
7896 * icf.cc (Icf::find_identical_sections): Change type of local variable
7897 section_name to be std::string.
7898 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7900 2011-01-25 Ian Lance Taylor <iant@google.com>
7902 * script.cc (script_add_extern): Rewrite to use
7903 add_symbol_reference.
7905 2011-01-25 Doug Kwan <dougkwan@google.com>
7907 * icf.cc (get_section_contents): Always lock section's object.
7909 2011-01-24 Ian Lance Taylor <iant@google.com>
7911 * options.h (class General_options): Accept
7912 --no-detect-odr-violations.
7914 2011-01-24 Ian Lance Taylor <iant@google.com>
7916 * version.cc (version_string): Bump to 1.11.
7918 2011-01-24 Ian Lance Taylor <iant@google.com>
7920 * plugin.cc (class Plugin_rescan): Define new class.
7921 (Plugin_manager::claim_file): Set any_claimed_.
7922 (Plugin_manager::save_archive): New function.
7923 (Plugin_manager::save_input_group): New function.
7924 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7926 (Plugin_manager::new_undefined_symbol): New function.
7927 (Plugin_manager::rescan): New function.
7928 (Plugin_manager::rescannable_defines): New function.
7929 (Plugin_manager::add_input_file): Set any_added_.
7930 * plugin.h (class Plugin_manager): define new fields rescannable_,
7931 undefined_symbols_, any_claimed_, and any_added_. Declare
7932 Plugin_rescan as friend. Declare new functions.
7933 (Plugin_manager::Rescannable): Define type.
7934 (Plugin_manager::Rescannable_list): Define type.
7935 (Plugin_manager::Undefined_symbol_list): Define type.
7936 (Plugin_manager::Plugin_manager): Initialize new fields.
7937 * archive.cc (Archive::defines_symbol): New function.
7938 (Add_archive_symbols::run): Pass archive to plugins if any.
7939 * archive.h (class Archive): Declare defines_symbol.
7940 * readsyms.cc (Input_group::~Input_group): New function.
7941 (Finish_group::run): Pass input_group to plugins if any.
7942 * readsyms.h (class Input_group): Declare destructor.
7943 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7946 2011-01-10 Ian Lance Taylor <iant@google.com>
7948 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7950 (Layout::set_segment_offsets): Reset increase_relro before calling
7951 set_section_addresses a second time.
7953 2011-01-04 Cary Coutant <ccoutant@google.com>
7955 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7956 sections before NOBITS sections.
7958 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7960 * version.cc (print_version): Update copyright to 2011.
7962 2010-12-23 Cary Coutant <ccoutant@google.com>
7964 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7965 of OS to this->add. Add OD parameter to second form of the function.
7967 2010-12-20 Ian Lance Taylor <iant@google.com>
7969 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7970 second of two consecutive entries with same offset.
7972 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7974 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7975 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7976 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7977 to avoid unneeded links against $(LDADD).
7978 * testsuite/Makefile.in: Regenerate.
7980 2010-12-15 Ian Lance Taylor <iant@google.com>
7983 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7984 for R_X86_64_32 and R_X86_64_PC32.
7985 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7986 ver_matching_def_pic.o.
7987 (ver_matching_def_pic.o): New target.
7989 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7991 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7992 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7993 Move definition before File_read::View member definitions.
7994 (File_read::View::~View): Initialize and hold lock before
7995 updating current_mapped_bytes.
7997 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7999 * dwarf_reader.cc: Remove outdated comment.
8000 * gold-threads.cc: Fix typo in error message.
8001 * archive.cc: Fix typos in comments.
8002 * archive.h: Likewise.
8003 * arm-reloc-property.cc: Likewise.
8004 * arm-reloc-property.h: Likewise.
8005 * arm-reloc.def: Likewise.
8007 * attributes.h: Likewise.
8008 * cref.cc: Likewise.
8009 * ehframe.cc: Likewise.
8010 * fileread.h: Likewise.
8012 * i386.cc: Likewise.
8014 * incremental.h: Likewise.
8015 * int_encoding.cc: Likewise.
8016 * layout.h: Likewise.
8017 * main.cc: Likewise.
8018 * merge.h: Likewise.
8019 * object.cc: Likewise.
8020 * object.h: Likewise.
8021 * options.cc: Likewise.
8022 * readsyms.cc: Likewise.
8023 * reduced_debug_output.cc: Likewise.
8024 * reloc.cc: Likewise.
8025 * script-sections.cc: Likewise.
8026 * sparc.cc: Likewise.
8027 * symtab.h: Likewise.
8028 * target-reloc.h: Likewise.
8029 * target.cc: Likewise.
8030 * target.h: Likewise.
8031 * timer.cc: Likewise.
8032 * timer.h: Likewise.
8033 * x86_64.cc: Likewise.
8035 2010-12-09 Cary Coutant <ccoutant@google.com>
8037 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8039 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8040 parameter; change all callers.
8041 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8042 * options.h (warn_execstack): New option.
8044 2010-12-07 Doug Kwan <dougkwan@google.com>
8046 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8047 like function call relocations.
8049 2010-12-07 Ian Lance Taylor <iant@google.com>
8051 * archive.cc (Archive::get_elf_object_for_member): Permit
8052 punconfigured to be NULL.
8053 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8054 (Archive::include_member): Pass NULL to get_elf_object_for_member
8055 if we searched for the archive and this is the first included
8058 2010-12-01 Ian Lance Taylor <iant@google.com>
8060 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8061 track_relocs_type_ field.
8062 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8063 Set track_relocs_type_.
8064 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8065 contents when using RELA relocs.
8066 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8068 * reloc.cc (Track_relocs::next_addend): New function.
8069 * reloc.h (class Track_relocs): Declare next_addend.
8071 2010-12-01 Ian Lance Taylor <iant@google.com>
8073 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8076 2010-12-01 Ian Lance Taylor <iant@google.com>
8078 * README: Update compilers known to work and fail.
8080 2010-11-23 Matthias Klose <doko@ubuntu.com>
8082 * configure.in: For --enable-gold, handle value `default' instead of
8083 `both*'. Always install ld as ld.bfd, install as ld if gold is
8085 * configure: Regenerate.
8087 2010-11-18 Doug Kwan <dougkwan@google.com>
8089 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8090 and right_alignment to be zero. Store result alignment only if it is
8091 greater than existing alignment.
8093 2010-11-16 Cary Coutant <ccoutant@google.com>
8096 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8097 Check for ".zdebug_line".
8099 2010-11-16 Doug Kwan <dougkwan@google.com>
8100 Cary Coutant <ccoutant@google.com>
8102 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8103 by reference; adjust all callers.
8104 * output.cc (Output_segment::set_section_addresses): Adjust references
8105 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8107 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8108 end at page boundary.
8110 2010-11-16 Cary Coutant <ccoutant@google.com>
8113 * layout.cc (Layout::choose_output_section): Transform names of
8114 compressed sections even when using a script with a SECTIONS clause.
8115 (Layout::output_section_name): Remove code to transform
8116 compressed debug section names.
8117 * output.cc (Output_section::add_input_section): Use uncompressed
8118 section size when tracking input sections.
8120 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8122 * symtab.h (Symbol::NON_PIC_REF): Remove.
8123 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8124 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8125 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8126 (Symbol::use_plt_offset): Take a flags argument and pass it
8127 directly to needs_dynamic_reloc. Restrict check for undefined
8128 weak symbols to function calls.
8129 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8130 (Target_arm::Scan::global): Use it.
8131 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8132 (Target_arm::Relocate::relocate): Likewise.
8133 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8134 parameter with an r_type parameter. Use get_reference_flags
8136 (Target_arm::Relocate::relocate): Update accordingly.
8137 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8138 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8139 (Target_i386::Scan::global): Likewise.
8140 (Target_i386::Relocate::relocate): Likewise.
8141 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8142 parameter with an r_type parameter. Use get_reference_flags
8144 (Target_i386::Relocate::relocate): Update accordingly.
8145 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8146 (Target_powerpc::Scan::global): Use it.
8147 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8148 (Target_powerpc::Relocate::relocate): Likewise.
8149 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8150 (Target_sparc::Scan::global): Use it.
8151 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8152 (Target_sparc::Relocate::relocate): Likewise.
8153 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8154 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8155 (Target_x86_64::Scan::global): Likewise.
8156 (Target_x86_64::Relocate::relocate): Likewise.
8158 2010-11-08 Doug Kwan <dougkwan@google.com>
8159 Cary Coutant <ccoutant@google.com>
8161 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8162 (Arm_exidx_merge_section::section_contents_): New data member.
8163 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8164 (Arm_input_section::~Arm_input_section): De-allocate memory.
8165 (Arm_input_section::original_contents_): New data member.
8166 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8167 in parameters instead of calling Object::section_contents without
8169 (Arm_output_section::group_section): New parameter TASK. Pass it
8170 to callees that need locking objects.
8171 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8172 to lock EXIDX input sections. Fix a formatting issue. Call
8173 Arm_exidx_merged_section::build_contents to create merged section
8175 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8176 to lock object of stub table owner.
8177 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8178 TEXT_SIZE to initialize data member TEXT_SIZE_.
8179 (Arm_exidx_input_section::addralign): Fix typo in comment.
8180 (Arm_exidx_input_section::text_size): New method.
8181 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8182 that require locking objects. Lock objects before scanning for stubs
8183 and updating local symbols.
8184 (Arm_input_section<big_endian>::init): Copy contents of original
8186 (Arm_input_section<big_endian>::do_write): Use saved contents of
8187 original input section instead of calling Object::section_contents
8189 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8190 size without calling Object::section_size().
8191 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8192 for size. Allocate a buffer for merged EXIDX entries.
8193 (Arm_exidx_merged_section::build_contents): New method.
8194 (Arm_exidx_merged_section::do_write): Move merge section contents
8195 building code to Arm_exidx_merged_section::build_contetns. Write
8196 out contetns in buffer instead of building it on the fly.
8197 (Arm_relobj::make_exidx_input_section): Also pass text section size
8198 to Arm_exidx_input_section constructor.
8199 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8200 (Arm_dynobj::do_read_symbols): Fix memory leak.
8201 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8202 * target.h: (class Task): Add forward declaration.
8203 (Target::relax): Add new parameter TASK and pass it to
8205 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8207 2010-11-05 Cary Coutant <ccoutant@google.com>
8210 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8211 object when reading from the file.
8212 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8214 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8215 when reading section contents.
8216 (get_section_contents): Likewise.
8217 (icf::find_identical_sections): Likewise.
8218 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8219 object when reading from the file.
8220 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8221 the object when doing deferred section layout.
8223 2010-11-03 Nick Clifton <nickc@redhat.com>
8226 * script.h (class Symbol_assignment: name): New member. Returns
8227 the name of the symbol.
8228 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8229 Returns true if the given symbol name is on the list of
8230 assignments wating to be processed.
8231 * archive.cc (should_incldue_member): If the symbol is undefined,
8232 check to see if it is on the list of symbols pending assignment.
8234 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8236 * script-sections.cc (Script_sections::find_memory_region): Check
8237 for a NULL output section pointer.
8239 2010-10-29 Doug Kwan <dougkwan@google.com>
8241 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8242 Output_section::add_relaxed_input_section.
8243 * output.cc (Output_section::add_relaxed_input_section): Add new
8244 arguments LAYOUT and NAME. Set section order index.
8245 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8246 Copy section order index.
8247 * output.h (Output_section::add_relaxed_input_section): Add new
8248 arguments LAYOUT and NAME.
8250 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8252 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8253 NATIVE_OR_CROSS_LINKER.
8254 * testsuite/Makefile.in: Regenerate.
8256 2010-10-20 Doug Kwan <dougkwan@google.com>
8258 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8259 without SHF_LINK_ORDER flags.
8260 * layout.cc (Layout::choose_output_section): Do not filter
8261 SHF_LINK_ORDER flag in a relocatable link.
8263 2010-10-17 Cary Coutant <ccoutant@google.com>
8265 * output.h (Output_segment::set_section_addresses): Change function
8266 signature. Update all callers.
8267 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8269 (Output_segment::set_section_addresses): Align after last TLS
8270 section. Add padding before last relro section instead of after.
8272 2010-10-17 Doug Kwan <dougkwan@google.com>
8274 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8275 GOT output section to be writable.
8277 2010-10-14 Cary Coutant <ccoutant@google.com>
8279 * debug.h (DEBUG_INCREMENTAL): New flag.
8280 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8281 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8283 * incremental.cc (report_command_line): Ignore all forms of
8285 * layout.cc (Layout::Layout): Check parameters for incremental link
8287 * options.cc (General_options::parse_incremental): New function.
8288 (General_options::parse_no_incremental): New function.
8289 (General_options::parse_incremental_full): New function.
8290 (General_options::parse_incremental_update): New function.
8291 (General_options::incremental_mode_): New data member.
8292 (General_options::finalize): Check incremental_mode_.
8293 * options.h (General_options): Update help text for --incremental.
8294 Add --no-incremental, --incremental-full, --incremental-update.
8295 (General_options::Incremental_mode): New enum type.
8296 (General_options::incremental_mode): New function.
8297 (General_options::incremental_mode_): New data member.
8298 * parameters.cc (Parameters::incremental_mode_): New data member.
8299 (Parameters::set_options): Set incremental_mode_.
8300 (Parameters::set_incremental_full): New function.
8301 (Parameters::incremental): New function.
8302 (Parameters::incremental_update): New function.
8303 (set_parameters_incremental_full): New function.
8304 * parameters.h (Parameters::set_incremental_full): New function.
8305 (Parameters::incremental): New function.
8306 (Parameters::incremental_update): New function.
8307 (Parameters::incremental_mode_): New data member.
8308 (set_parameters_incremental_full): New function.
8309 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8310 incremental link mode.
8311 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8312 (Sized_relobj::do_relocate_sections): Likewise.
8313 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8315 * testsuite/Makefile.in: Regenerate.
8316 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8318 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8320 * script-sections.h (class Script_sections): Make
8321 Sections_elements typedef public.
8322 * script-sections.cc (class Sort_output_sections): Add elements_
8323 field. Add constructor which sets it; change all callers.
8324 (Sort_output_sections::is_before): New function.
8325 (Sort_output_sections::operator()): Call is_before.
8326 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8328 * testsuite/script_test_10.sh: New test. Test script section
8330 * testsuite/script_test_10.t: Likewise.
8331 * testsuite/script_test_10.s: Likewise.
8332 * testsuite/Makefile.am: Wrap the cross linker tests and the
8333 common tests into NATIVE_OR_CROSS_LINKER.
8334 (check_SCRIPTS): Add script_test_10.sh.
8335 (check_DATA): Add script_test_10.stdout.
8336 (script_test_10.o, script_test_10): New targets.
8337 (script_test_10.stdout): New target.
8338 * configure, testsuite/Makefile.in: Regenerate.
8340 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8342 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8343 error for the deprecated relocations.
8344 (Target_arm::Scan::global): Likewise.
8345 (Target_arm::Relocate::relocate): Likewise.
8347 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8349 * fileread.cc (Input_file::find_file): Initialize *found_name
8350 and *namep when using the fallback search for case 4.
8352 2010-10-11 Cary Coutant <ccoutant@google.com>
8354 * options.h (class General_options): Redefine -z lazy as an alias for
8355 the negation of -z now.
8357 2010-10-11 Ian Lance Taylor <iant@google.com>
8359 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8362 2010-10-06 Nick Clifton <nickc@redhat.com>
8364 * script-sections.cc(class Memory_region): Remove
8365 current_lma_offset_ field. Rename current_vma_offset_ to
8366 current_offset_. Add last_section_ field.
8367 (Memory_region::get_current_vma_address): Rename to
8368 get_current_address.
8369 (Memory_region::get_current_lma_address): Delete.
8370 (Memory_region::increment_vma_offset): Rename to
8372 (Memory_region::increment_lma_offset): Delete.
8373 (Memory_region::attributes_compatible): New method. Returns
8374 true if the provided section is compatible with the region.
8375 (Memory_region::get_last_section): New method. Returns the last
8376 section to use the region.
8377 (Memory_region::set_last_section): New method. Stores the last
8378 section to use the region.
8379 (Script_sections::block_in_region): New method. Returns true if
8380 a block of memory is contained within a region.
8381 (Script_sections::find_memory_region): New method. Locates a
8382 memory region to be used to set a VMA or LMA address.
8383 (Output_section_definition::set_section_addresses): Add code to
8384 check for addresses set by memory regions.
8385 (Output_segment::set_section_addresses): Remove memory region
8387 (Script_sections::create_segment): Add a warning if a header
8388 segment is created outside of any region.
8389 * script-sections.h (class Script_sections): Add prototypes for
8390 find_memory_region and block_in_region methods.
8391 * testsuite/memory_test.s: Use .long instead of .word.
8392 * testsuite/memory_test.t: Add some more output sections.
8393 * testsuite/memory_test.sh: Update expected output.
8395 2010-10-02 Doug Kwan <dougkwan@google.com>
8397 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8398 defintion to symtab.h
8399 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8400 declaration to defintion.
8402 2010-10-01 Nick Clifton <nickc@redhat.com>
8404 * expression.cc (eval): Replace dummy argument with NULL.
8405 (eval_maybe_dot): Check for a NULL result section pointer.
8406 (Symbol_expression::value): Likewise.
8407 (Dot_expression::value): Likewise.
8408 (BINARY_EXPRESSION): Likewise.
8409 (Max_expression::value): Likewise.
8410 (Min_expression::value): Likewise.
8411 (Absolute_expression::value): Likewise.
8412 (Addr_expression::value_from_output_section): Likewise.
8413 (Loaddddr_expression::value_from_output_section): Likewise.
8414 (Segment_start_expression::value): Likewise.
8415 * script-sections.cc
8416 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8418 (Sections_elememt_dot_assignment::set_section_addresses):
8420 (Output_data_expression::do_write_to_buffer): Likewise.
8421 (Output_section_definition::finalize_symbols): Likewise.
8422 (Output_section_definition::set_section_addresses): Likewise.
8424 2010-09-30 Doug Kwan <dougkwan@google.com>
8426 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8428 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8430 * target.h (Target::can_icf_inline_merge_sections): New virtual
8432 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8434 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8436 * icf.cc (get_section_contents): Inline merge sections only when
8439 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8441 * configure: Regenerate.
8443 2010-09-17 Ian Lance Taylor <iant@google.com>
8445 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8446 * testsuite/Makefile.am (memory_test.o): New target.
8447 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8449 * testsuite/Makefile.in: Rebuild.
8451 2010-09-17 Doug Kwan <dougkwan@google.com>
8453 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8454 defintion if relocation uses GOT entries of the symbol.
8455 * testsuite/icf_safe_test.sh: Fix test.
8456 * testsuite/icf_safe_so_test.sh: Fix test.
8458 2010-09-16 Cary Coutant <ccoutant@google.com>
8460 * script_sections.cc (class Memory_region): Remove "NULL" from
8461 vector initializations.
8463 2010-09-15 Cary Coutant <ccoutant@google.com>
8465 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8466 Resolve forwarding symbols.
8468 2010-09-15 Doug Kwan <dougkwan@google.com>
8470 * gold/testsuite/script_test_3.t: Add ARM special sections.
8471 * gold/testsuite/script_test_4.t: Same.
8472 * gold/testsuite/script_test_5.t: Same.
8473 * gold/testsuite/script_test_6.t: Same.
8474 * gold/testsuite/script_test_7.t: Same.
8475 * gold/testsuite/script_test_7.t: Same.
8476 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8478 2010-09-14 Cary Coutant <ccoutant@google.com>
8480 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8481 (Target_x86_64::Relocate::relocate_tls): Replace check for
8482 saw_tls_block_reloc_ with test for executable section.
8484 2010-09-12 Cary Coutant <ccoutant@google.com>
8486 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8487 position-independent executables to shared libraries need dynamic
8489 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8490 position-independent executables.
8491 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8492 * testsuite/Makefile.in: Regenerate.
8494 2010-09-10 Nick Clifton <nickc@redhat.com>
8497 * testsuite/memory_test.t: Discard any sections that are not
8500 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8503 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8504 "This::" to work around a bug in gcc 4.2.
8506 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8508 2010-09-09 Rafael Espindola <espindola@google.com>
8510 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8511 sections with different PF_X flags in the same segment.
8512 (Layout::find_first_load_seg): Search all segments to find the first
8514 * options.h (rosegment): New.
8516 2010-09-08 Rafael Espindola <espindola@google.com>
8518 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
8520 2010-09-08 Doug Kwan <dougkwan@google.com>
8522 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8523 (Arm_relobj::do_relocate_sections): Add new parameter for output
8524 file to match the parent.
8525 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8526 of local symbols instead of input values. Update code to track
8527 changes in gold::relocate_section.
8528 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8529 (Sized_relobj::compute_final_local_value_internal): New methods.
8530 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8531 body into private version of Sized_relobj::compute_final_local_value.
8532 Call the inline method.
8533 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8534 merged symbol value if there is one.
8535 (Symbol_value::has_output_value): New method defintiion.
8536 (Sized_relobj::Compute_final_local_value_status): New enum type.
8537 (Sized_relobj::compute_final_local_value): New methods.
8538 (Sized_relobj::compute_final_local_value_internal): New methods.
8539 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8540 and arm_cortex_a8.sh.
8541 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8542 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8544 * Makefile.in: Regenerate.
8545 * testsuite/arm_bl_out_of_range.s: Update test.
8546 * testsuite/thumb_bl_out_of_range.s: Ditto.
8547 * testsuite/thumb_blx_out_of_range.s: Ditto.
8548 * testsuite/arm_branch_out_of_range.sh: New file.
8549 * testsuite/arm_cortex_a8.sh: Ditto.
8550 * testsuite/arm_cortex_a8_b.s: Ditto.
8551 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8552 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8553 * testsuite/arm_cortex_a8_bl.s: Ditto.
8554 * testsuite/arm_cortex_a8_blx.s: Ditto.
8555 * testsuite/arm_cortex_a8_local.s: Ditto.
8556 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8557 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8559 2010-09-08 Rafael Espindola <espindola@google.com>
8561 * Makefile.am (memory_test.stdout): Run readelf with -W.
8562 * Makefile.in: Regenerate.
8563 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8566 2010-09-08 Rafael Espindola <espindola@google.com>
8568 * script-sections.cc (Script_sections::add_memory_region): Convert
8569 field precision to int.
8570 * script.cc (script_set_section_region, script_set_section_region):
8571 Convert field precision to int.
8573 2010-09-08 Rafael Espindola <espindola@google.com>
8575 * arm.cc (do_finalize_sections): Create the __exidx_start and
8576 __exdix_end symbols even when the section is missing.
8578 2010-09-08 Nick Clifton <nickc@redhat.com>
8580 * README: Remove claim that MEMORY is not supported.
8581 * expression.cc (script_exp_function_origin)
8582 (script_exp_function_length): Move from here to ...
8583 * script.cc: ... here.
8584 (script_set_section_region, script_add_memory)
8585 (script_parse_memory_attr, script_include_directive): New
8587 * script-sections.cc
8588 (class Memory_region): New class.
8589 (class Output_section_definition): Add set_memory_region,
8590 set_section_vma, set_section_lma and get_section_name methods.
8591 (class Script_Sections): Add add_memory_region,
8592 find_memory_region, find_memory_region_origin,
8593 find_memory_region_length and set_memory_region methods.
8594 Have set_section_addresses method walk the list of set memory
8596 Extend the print methos to display memory regions.
8597 * script-sections.h: Add prototypes for new methods.
8598 Add enum for MEMORY region attributes.
8599 * yyscript.y: Add support for parsing MEMORY regions.
8600 * script-c.h: Add prototypes for new functions.
8601 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8602 * testsuite/Makefile.in: Regenerate.
8603 * testsuite/memory_test.sh: New script.
8604 * testsuite/memory_test.s: New assembler source file.
8605 * testsuite/memory_test.t: New linker script.
8607 2010-08-27 Doug Kwan <dougkwan@google.com>
8609 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8610 reference override an existing dynamic weak reference.
8611 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8612 * testsuite/Makefile.in: Regenerate.
8613 * testsuite/dyn_weak_ref.sh: New file.
8614 * testsuite/dyn_weak_ref_1.c: Ditto.
8615 * testsuite/dyn_weak_ref_2.c: Ditto.
8617 2010-08-27 Ian Lance Taylor <iant@google.com>
8619 * incremental.h (class Incremental_input_entry): Add virtual
8622 2010-08-27 Ian Lance Taylor <iant@google.com>
8624 * testsuite/start_lib_test_3.c: Mark t3 as used.
8626 2010-08-27 Nick Clifton <nickc@redhat.com>
8628 * options.cc (version_script): Fix small typo in previous
8631 2010-08-25 Nick Clifton <nickc@redhat.com>
8633 * archive.cc: Formatting fixes: Remove whitespace between
8634 typename and following asterisk. Remove whitespace between
8635 function name and opening parenthesis.
8636 * archive.h: Likewise.
8638 * attributes.cc: Likewise.
8639 * attributes.h: Likewise.
8640 * common.cc: Likewise.
8641 * copy-relocs.cc: Likewise.
8642 * dirsearch.h: Likewise.
8643 * dynobj.cc: Likewise.
8644 * ehframe.cc: Likewise.
8645 * ehframe.h: Likewise.
8646 * expression.cc: Likewise.
8647 * fileread.cc: Likewise.
8648 * fileread.h: Likewise.
8650 * gold-threads.cc: Likewise.
8651 * gold.cc: Likewise.
8652 * i386.cc: Likewise.
8654 * incremental-dump.cc: Likewise.
8655 * incremental.cc: Likewise.
8656 * layout.cc: Likewise.
8657 * layout.h: Likewise.
8658 * main.cc: Likewise.
8659 * merge.cc: Likewise.
8660 * merge.h: Likewise.
8661 * object.cc: Likewise.
8662 * object.h: Likewise.
8663 * options.cc: Likewise.
8664 * options.h: Likewise.
8665 * output.cc: Likewise.
8666 * output.h: Likewise.
8667 * plugin.cc: Likewise.
8668 * plugin.h: Likewise.
8669 * powerpc.cc: Likewise.
8670 * reloc.cc: Likewise.
8671 * script-c.h: Likewise.
8672 * script-sections.cc: Likewise.
8673 * script.cc: Likewise.
8674 * stringpool.cc: Likewise.
8675 * symtab.cc: Likewise.
8676 * symtab.h: Likewise.
8677 * target.cc: Likewise.
8678 * timer.cc: Likewise.
8679 * timer.h: Likewise.
8680 * version.cc: Likewise.
8681 * x86_64.cc: Likewise.
8683 2010-08-24 Nick Clifton <nickc@redhat.com>
8686 * layout.cc (segment_precedes): Sort segments by their physical
8687 addresses, if they have been set.
8689 2010-08-23 Cary Coutant <ccoutant@google.com>
8691 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8693 (Lib_group::include_member): Unlock object after deleting its
8695 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8698 2010-08-19 Neil Vachharajani <nvachhar@google.com>
8699 Cary Coutant <ccoutant@google.com>
8701 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8702 constructor, and set_blocker.
8703 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8705 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8706 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8707 * testsuite/Makefile.am (start_lib_test): New test case.
8708 * testsuite/Makefile.in: Regenerate.
8709 * testsuite/start_lib_test_main.c: New file.
8710 * testsuite/start_lib_test_1.c: New file.
8711 * testsuite/start_lib_test_2.c: New file.
8712 * testsuite/start_lib_test_3.c: New file.
8714 2010-08-19 Ian Lance Taylor <iant@google.com>
8716 * Makefile.in: Rebuild with automake 1.11.1.
8717 * aclocal.m4: Likewise.
8718 * testsuite/Makefile.in: Likewise.
8720 2010-08-19 Ian Lance Taylor <iant@google.com>
8723 * i386.cc (class Output_data_plt_i386): Update declarations.
8724 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8725 local_ifuncs_ fields.
8726 (Target_i386::do_plt_section_for_global): New function.
8727 (Target_i386::do_plt_section_for_local): New function.
8728 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8729 parameter; change all callers. Initialize global_ifuncs_ and
8730 local_ifuncs_. If doing a static link define __rel_iplt_start and
8732 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8733 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8734 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8736 (Target_i386::make_plt_section): New function, broken out of
8737 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8738 (Target_i386::make_plt_entry): Call make_plt_section.
8739 (Target_i386::make_local_ifunc_plt_entry): New function.
8740 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8741 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8742 R_386_IRELATIVE to switch.
8743 (Target_i386::Scan::global): Likewise.
8744 (Target_i386::Relocate::relocate): Likewise.
8745 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8747 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8748 (Target_x86_64::do_plt_section_for_global): New function.
8749 (Target_x86_64::do_plt_section_for_local): New function.
8750 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8751 parameter; change all callers. If doing a static link define
8752 __rela_iplt_start and __rela_iplt_end.
8753 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8754 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8755 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8757 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8758 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8760 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8761 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8762 R_X86_64_IRELATIVE to switch.
8763 (Target_x86_64::Scan::global): Likewise.
8764 (Target_x86_64::Relocate::relocate): Likewise.
8765 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8767 * target.h (class Target): Add plt_section_for_global and
8768 plt_section_for_local functions. Add do_plt_section_for_global
8769 and do_plt_section_for_local virtual functions.
8770 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8771 clarifying comments.
8772 (Symbol::use_plt_offset): Handle IFUNC symbol.
8773 * object.cc (Sized_relobj::Sized_relobj): Initialize
8775 (Sized_relobj::local_has_plt_offset): New function.
8776 (Sized_relobj::local_plt_offset): New function.
8777 (Sized_relobj::set_local_plt_offset): New function.
8778 (Sized_relobj::do_count): Handle IFUNC symbol.
8779 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8780 a bit away from input_shndx_ field. Add set_is_func_symbol and
8781 is_ifunc_symbol functions.
8782 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8783 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8784 local_plt_offsets_ field.
8785 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8786 * output.h (class Output_section_data): Add non-const
8787 output_section function.
8788 (class Output_data_got): Update declarations.
8789 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8790 Add use_plt_offset parameter to global and local constructors.
8791 Change all callers. Change local_sym_index_ field to 31 bits.
8792 Change GSYM_CODE and CONSTANT_CODE accordingly.
8793 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8794 doing a static link don't set sh_link field.
8795 (Output_data_got::Got_entry::write): Use PLT offset if
8797 (Output_data_got::add_global_plt): New function.
8798 (Output_data_got::add_local_plt): New function.
8799 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8800 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8801 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8802 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8803 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8805 * testsuite/ifunc-sel.h: New file.
8806 * testsuite/ifuncmain1.c: New file.
8807 * testsuite/ifuncmain1vis.c: New file.
8808 * testsuite/ifuncmod1.c: New file.
8809 * testsuite/ifuncdep2.c: New file.
8810 * testsuite/ifuncmain2.c: New file.
8811 * testsuite/ifuncmain3.c: New file.
8812 * testsuite/ifuncmod3.c: New file.
8813 * testsuite/ifuncmain4.c: New file.
8814 * testsuite/ifuncmain5.c: New file.
8815 * testsuite/ifuncmod5.c: New file.
8816 * testsuite/ifuncmain6pie.c: New file.
8817 * testsuite/ifuncmod6.c: New file.
8818 * testsuite/ifuncmain7.c: New file.
8819 * configure, testsuite/Makefile.in: Rebuild.
8821 2010-08-18 Ian Lance Taylor <iant@google.com>
8824 (Output_section_incremental_inputs::write_input_files): Add cast
8825 to avoid signed/unsigned comparison warning.
8826 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8828 2010-08-12 Cary Coutant <ccoutant@google.com>
8830 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8832 2010-08-13 Ian Lance Taylor <iant@google.com>
8834 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8836 2010-08-12 Cary Coutant <ccoutant@google.com>
8837 Doug Kwan <dougkwan@google.com>
8839 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8840 defintion overrides non-weak undef, remember that the original undef
8842 * symtab.cc (Symbol_table::sized_write_global): For undef without
8843 an original weak binding, set binding to global in output.
8844 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8845 * testsuite/Makefile.in: Regenerate.
8846 * testsuite/strong_ref_weak_def.sh: New file.
8847 * testsuite/strong_ref_weak_def_1.c: Ditto.
8848 * testsuite/strong_ref_weak_def_2.c: Ditto.
8850 2010-08-12 Cary Coutant <ccoutant@google.com>
8852 * testsuite/incremental_test.sh: Rewrite.
8853 * testsuite/incremental_test_1.c: Rewrite.
8854 * testsuite/incremental_test_2.c: Rewrite.
8856 2010-08-12 Cary Coutant <ccoutant@google.com>
8858 * arm.cc (Target_arm::got_size): Add const.
8859 (Target_arm::got_entry_count): New function.
8860 (Target_arm::plt_entry_count): New function.
8861 (Target_arm::first_plt_entry_offset): New function.
8862 (Target_arm::plt_entry_size): New function.
8863 (Output_data_plt_arm::entry_count): New function.
8864 (Output_data_plt_arm::first_plt_entry_offset): New function.
8865 (Output_data_plt_arm::get_plt_entry_size): New function.
8866 * i386.cc (Target_i386::got_size): Add const.
8867 (Target_i386::got_entry_count): New function.
8868 (Target_i386::plt_entry_count): New function.
8869 (Target_i386::first_plt_entry_offset): New function.
8870 (Target_i386::plt_entry_size): New function.
8871 (Output_data_plt_i386::entry_count): New function.
8872 (Output_data_plt_i386::first_plt_entry_offset): New function.
8873 (Output_data_plt_i386::get_plt_entry_size): New function.
8874 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8875 find_incremental_inputs_sections. Dump incremental_got_plt section.
8876 * incremental.cc: Include target.h.
8877 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8878 parameter. Adjust all callers. Find incremental_got_plt section.
8879 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8881 (Output_section_incremental_inputs::set_final_data_size): Calculate
8882 size of incremental_got_plt section.
8883 (Output_section_incremental_inputs::do_write): Write the
8884 incremental_got_plt section.
8885 (Got_plt_view_info): New struct.
8886 (Local_got_offset_visitor): New class.
8887 (Global_got_offset_visitor): New class.
8888 (Global_symbol_visitor_got_plt): New class.
8889 (Output_section_incremental_inputs::write_got_plt): New function.
8890 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8891 Add parameter. Adjust all callers.
8892 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8893 (Incremental_inputs::got_plt_section): New function.
8894 (Incremental_inputs::got_plt_section_): New data member.
8895 (Incremental_got_plt_reader): New class.
8896 * layout.cc (Layout::create_incremental_info_sections): Add the
8897 incremental_got_plt section.
8898 * object.h (Got_offset_list::get_list): New function.
8899 (Got offset_list::for_all_got_offsets): New function.
8900 (Sized_relobj::local_got_offset_list): New function.
8901 * powerpc.cc (Target_powerpc::got_size): Add const.
8902 (Target_powerpc::got_entry_count): New function.
8903 (Target_powerpc::plt_entry_count): New function.
8904 (Target_powerpc::first_plt_entry_offset): New function.
8905 (Target_powerpc::plt_entry_size): New function.
8906 (Output_data_plt_powerpc::entry_count): New function.
8907 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8908 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8909 * sparc.cc (Target_sparc::got_size): Add const.
8910 (Target_sparc::got_entry_count): New function.
8911 (Target_sparc::plt_entry_count): New function.
8912 (Target_sparc::first_plt_entry_offset): New function.
8913 (Target_sparc::plt_entry_size): New function.
8914 (Output_data_plt_sparc::entry_count): New function.
8915 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8916 (Output_data_plt_sparc::get_plt_entry_size): New function.
8917 * symtab.h (Symbol::got_offset_list): New function.
8918 (Symbol_table::for_all_symbols): New function.
8919 * target.h (Sized_target::got_entry_count): New function.
8920 (Sized_target::plt_entry_count): New function.
8921 (Sized_target::plt_entry_size): New function.
8922 * x86_64.cc (Target_x86_64::got_size): Add const.
8923 (Target_x86_64::got_entry_count): New function.
8924 (Target_x86_64::plt_entry_count): New function.
8925 (Target_x86_64::first_plt_entry_offset): New function.
8926 (Target_x86_64::plt_entry_size): New function.
8927 (Output_data_plt_x86_64::entry_count): New function.
8928 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8929 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8931 2010-08-12 Cary Coutant <ccoutant@google.com>
8933 * archive.cc: Include incremental.h.
8934 (Archive::Archive): Initialize incremental_info_.
8935 (Archive::include_member): Record archive members in incremental info.
8936 (Add_archive_symbols::run): Record begin and end of an archive in
8938 (Lib_group::include_member): Record objects in incremental info.
8939 * archive.h (Incremental_archive_entry): Forward declaration.
8940 (Archive::set_incremental_info): New member function.
8941 (Archive::incremental_info): New member function.
8942 (Archive::Unused_symbol_iterator): New class.
8943 (Archive::unused_symbols_begin): New member function.
8944 (Archive::unused_symbols_end): New member function.
8945 (Archive::incremental_info_): New data member.
8946 * incremental-dump.cc (find_input_containing_global): New function.
8947 (dump_incremental_inputs): Dump new incremental info sections.
8948 * incremental.cc: Include symtab.h.
8949 (Output_section_incremental_inputs): New class.
8950 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8951 new incremental info sections.
8952 (Sized_incremental_binary::do_check_inputs): Likewise.
8953 (Incremental_inputs::report_archive): Remove.
8954 (Incremental_inputs::report_archive_begin): New function.
8955 (Incremental_inputs::report_archive_end): New function.
8956 (Incremental_inputs::report_object): New function.
8957 (Incremental_inputs::finalize_inputs): Remove.
8958 (Incremental_inputs::report_input_section): New function.
8959 (Incremental_inputs::report_script): Rewrite.
8960 (Incremental_inputs::finalize): Do nothing but finalize string table.
8961 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8962 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8963 (Incremental_inputs::create_data_sections): New function.
8964 (Incremental_inputs::relocs_entsize): New function.
8965 (Output_section_incremental_inputs::set_final_data_size): New function.
8966 (Output_section_incremental_inputs::do_write): New function.
8967 (Output_section_incremental_inputs::write_header): New function.
8968 (Output_section_incremental_inputs::write_input_files): New function.
8969 (Output_section_incremental_inputs::write_info_blocks): New function.
8970 (Output_section_incremental_inputs::write_symtab): New function.
8971 * incremental.h (Incremental_script_entry): Forward declaration.
8972 (Incremental_object_entry): Forward declaration.
8973 (Incremental_archive_entry): Forward declaration.
8974 (Incremental_inputs): Forward declaration.
8975 (Incremental_inputs_header_data): Remove.
8976 (Incremental_inputs_header): Remove.
8977 (Incremental_inputs_header_write): Remove.
8978 (Incremental_inputs_entry_data): Remove.
8979 (Incremental_inputs_entry): Remove.
8980 (Incremental_inputs_entry_write): Remove.
8981 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8982 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8983 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8984 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8986 (Incremental_input_entry): New class.
8987 (Incremental_script_entry): New class.
8988 (Incremental_object_entry): New class.
8989 (Incremental_archive_entry): New class.
8990 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8991 (Incremental_inputs::report_inputs): Remove.
8992 (Incremental_inputs::report_archive): Remove.
8993 (Incremental_inputs::report_archive_begin): New function.
8994 (Incremental_inputs::report_archive_end): New function.
8995 (Incremental_inputs::report_object): Change prototype.
8996 (Incremental_inputs::report_input_section): New function.
8997 (Incremental_inputs::report_script): Change prototype.
8998 (Incremental_inputs::get_reloc_count): New function.
8999 (Incremental_inputs::set_reloc_count): New function.
9000 (Incremental_inputs::create_data_sections): New function.
9001 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9002 (Incremental_inputs::inputs_section): New function.
9003 (Incremental_inputs::symtab_section): New function.
9004 (Incremental_inputs::relocs_section): New function.
9005 (Incremental_inputs::get_stringpool): Add const.
9006 (Incremental_inputs::command_line): Add const.
9007 (Incremental_inputs::inputs): Remove.
9008 (Incremental_inputs::command_line_key): New function.
9009 (Incremental_inputs::input_file_count): New function.
9010 (Incremental_inputs::input_files): New function.
9011 (Incremental_inputs::relocs_entsize): New function.
9012 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9013 (Incremental_inputs::finalize_inputs): Remove.
9014 (Incremental_inputs::Input_info): Remove.
9015 (Incremental_inputs::lock_): Remove.
9016 (Incremental_inputs::inputs_): Change type.
9017 (Incremental_inputs::inputs_map_): Remove.
9018 (Incremental_inputs::current_object_entry_): New data member.
9019 (Incremental_inputs::inputs_section_): New data member.
9020 (Incremental_inputs::symtab_section_): New data member.
9021 (Incremental_inputs::relocs_section_): New data member.
9022 (Incremental_inputs::reloc_count_): New data member.
9023 (Incremental_inputs_reader): New class.
9024 (Incremental_symtab_reader): New class.
9025 (Incremental_relocs_reader): New class.
9026 * layout.cc (Layout::finalize): Move finalization of incremental info
9027 and creation of incremental info sections to follow finalization of
9028 symbol table. Set offsets for postprocessing sections.
9029 (Layout::create_incremental_info_sections): Call
9030 Incremental_inputs::create_data_sections. Add incremental symtab
9031 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9032 sections to layout after input sections.
9033 * layout.h (struct Timespec): Forward declaration.
9034 (Layout::incremental_inputs): Add const.
9035 (Layout::create_incremental_info_sections): Add parameter.
9036 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9037 * object.cc: Include incremental.h.
9038 (Relobj::finalize_incremental_relocs): New function.
9039 (Sized_relobj::do_layout): Record input sections in incremental info.
9040 * object.h (Object::output_section): New function.
9041 (Object::output_section_offset): Moved from Relobj.
9042 (Object::get_incremental_reloc_base): New function.
9043 (Object::get_incremental_reloc_count): New function.
9044 (Object::do_output_section): New function.
9045 (Object::do_output_section_offset): Moved from Relobj.
9046 (Object::do_get_incremental_reloc_base): New function.
9047 (Object::do_get_incremental_reloc_count): New function.
9048 (Object::Object): Initialize new data members.
9049 (Relobj::output_section): Renamed do_output_section and moved to
9051 (Relobj::output_section_offset): Moved to Object.
9052 (Relobj::do_get_incremental_reloc_base): New function.
9053 (Relobj::do_get_incremental_reloc_count): New function.
9054 (Relobj::allocate_incremental_reloc_counts): New function.
9055 (Relobj::count_incremental_reloc): New function.
9056 (Relobj::finalize_incremental_relocs): New function.
9057 (Relobj::next_incremental_reloc_index): New function.
9058 (Relobj::reloc_counts_): New data member.
9059 (Relobj::reloc_bases_): New data member.
9060 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9061 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9062 (Sized_relobj::incremental_relocs_scan): New function.
9063 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9064 (Sized_relobj::incremental_relocs_write): New function.
9065 (Sized_relobj::incremental_relocs_write_reltype): New function.
9066 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9068 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9069 archives and object files elsewhere.
9070 (Add_symbols::run): Report object files here.
9071 (Finish_group::run): Report end of archive at end of group.
9072 * reloc.cc: Include layout.h, incremental.h.
9073 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9074 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9075 (Sized_relobj::incremental_relocs_scan): New function.
9076 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9077 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9078 (Sized_relobj::incremental_relocs_write): New function.
9079 (Sized_relobj::incremental_relocs_write_reltype): New function.
9080 * script.cc (read_input_script): Rewrite test for incremental link.
9081 Change call to Incremental_inputs::report_script.
9082 * symtab.h (Symbol_table::first_global_index): New function.
9083 (Symbol_table::output_count): New function.
9085 2010-08-12 Doug Kwan <dougkwan@google.com>
9087 * arm.cc (Target_arm::merge_object_attributes): Check command line
9088 options --no-wchar-size-warning and --no-enum-size-warning.
9089 * options.h (General_options): Add ld-compatible options
9090 --no-enum-size-warning and --no-wchar-size-warning.
9092 2010-08-04 Ian Lance Taylor <iant@google.com>
9094 * x86_64.cc (Target_x86_64::Scan::local): Use
9095 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9096 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9097 (Target_x86_64::Scan::global): Likewise.
9098 (Target_x86_64::Relocate::relocate): Likewise.
9099 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9102 2010-08-03 Cary Coutant <ccoutant@google.com>
9104 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9105 to reserve space in merged_strings vector. Keep total input size
9107 (Output_merge_string::do_print_merge_stats): Print total input size.
9108 * merge.h (Output_merge_string): Add input_size_ field.
9109 * stringpool.cc (Stringpool_template::string_length): Move
9110 implementations out of Stringpool_template class and place in
9112 * stringpool.h (string_length): Move out of Stringpool_template.
9114 2010-08-03 Ian Lance Taylor <iant@google.com>
9117 * layout.cc (relaxation_loop_body): If address of load segment is
9118 set, adjust address to include headers if possible.
9120 2010-08-03 Ian Lance Taylor <iant@google.com>
9122 * version.cc (version_string): Bump to 1.10.
9124 2010-08-03 Ian Lance Taylor <iant@google.com>
9127 * layout.h (enum Output_section_order): Define.
9128 (class Layout): Update declarations.
9129 * layout.cc (Layout::get_output_section): Add order parameter.
9130 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9131 is_first_non_relro parameters. Change all callers.
9132 (Layout::choose_output_section): Likewise.
9133 (Layout::add_output_section_data): Likewise.
9134 (Layout::make_output_section): Likewise. Set order.
9135 (Layout::default_section_order): New function.
9136 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9137 * output.cc (Output_section::Output_section): Initialize order_.
9138 Don't initialize deleted fields.
9139 (Output_segment::Output_segment): Don't initialize deleted
9141 (Output_segment::add_output_section_to_load): New function
9142 replacing add_output_section. Change all callers to call this or
9143 add_output_section_to_nonload.
9144 (Output_segment::add_output_section_to_nonload): New function.
9145 (Output_segment::remove_output_section): Rewrite.
9146 (Output_segment::add_initial_output_data): Likewise.
9147 (Output_segment::has_any_data_sections): Likewise.
9148 (Output_segment::is_first_section_relro): Likewise.
9149 (Output_segment::maximum_alignment): Likewise.
9150 (Output_segment::has_dynamic_reloc): New function replacing
9151 dynamic_reloc_count. Change all callers.
9152 (Output_segment::has_dynamic_reloc_list): New function replacing
9153 dynamic_reloc_count_list. Change all callers.
9154 (Output_segment::set_section_addresses): Rewrite.
9155 (Output_segment::set_offset): Rewrite.
9156 (Output_segment::find_first_and_last_list): Remove.
9157 (Output_segment::set_tls_offsets): Rewrite.
9158 (Output_segment::first_section_load_address): Likewise.
9159 (Output_segment::output_section_count): Likewise.
9160 (Output_segment::section_with_lowest_load_address): Likewise.
9161 (Output_segment::write_section_headers): Likewise.
9162 (Output_segment::print_sections_to_map): Likewise.
9163 * output.h (class Output_data): Remove dynamic_reloc_count_
9164 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9165 (Output_data::add_dynamic_reloc): Rewrite.
9166 (Output_data::has_dynamic_reloc): New function.
9167 (Output_data::dynamic_reloc_count): Remove.
9168 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9169 is_last_relro_, is_first_non_relro_, is_interp_,
9170 is_dynamic_linker_section_ fields. Add order and set_order
9171 functions. Remove is_relro_local, set_is_relro_local,
9172 is_last_relro, set_is_last_relro, is_first_non_relro,
9173 set_is_first_non_relro functions, is_interp, set_is_interp,
9174 is_dynamic_linker_section, and set_is_dynamic_linker_section
9176 (class Output_segment): Change Output_data_list from std::list to
9177 std:;vector. Add output_lists_ field. Remove output_data_ and
9178 output_bss_ fields. Update declarations.
9180 2010-08-02 Ian Lance Taylor <iant@google.com>
9182 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9183 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9184 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9186 2010-08-02 Ian Lance Taylor <iant@google.com>
9189 * script.cc (Script_options::Script_options): Initialize
9190 symbol_definitions_ and symbol_references_.
9191 (Script_options::add_symbol_assignment): Update
9192 symbol_definitions_ and symbol_references_.
9193 (Script_options::add_symbol_reference): New function.
9194 (script_symbol): New function.
9195 * script.h (class Script_options): Add symbol_definitions_ and
9196 symbol_references_ fields.
9197 (Script_options::referenced_const_iterator): New type.
9198 (Script_options::referenced_begin): New function.
9199 (Script_options::referenced_end): New function.
9200 (Script_options::is_referenced): New function.
9201 (Script_options::any_unreferenced): New function.
9202 * script-c.h (script_symbol): Declare.
9203 * yyscript.y (exp): Call script_symbol.
9204 * symtab.cc: Include "script.h".
9205 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9206 Change all callers. Check symbols referenced by scripts.
9207 (Symbol_table::add_undefined_symbols_from_command_line): Add
9208 layout parameter. Change all callers.
9209 (Symbol_table::do_add_undefined_symbols_from_command_line):
9210 Likewise. Break out loop body. Check symbols referenced by
9212 (Symbol_table::add_undefined_symbol_from_command_line): New
9213 function broken out of
9214 do_add_undefined_symbols_from_command_line.
9215 * symtab.h (class Symbol_table): Update declarations.
9216 * archive.cc: Include "layout.h".
9217 (Archive::should_include_member): Add layout parameter. Change
9218 all callers. Check for symbol mentioned in expression.
9219 * archive.h (class Archive): Update declaration.
9220 * object.cc (Sized_relobj::do_should_include_member): Add layout
9222 * object.h (Object::should_include_member): Add layout parameter.
9224 (Object::do_should_include_member): Add layout parameter.
9225 (class Sized_relobj): Update declaration.
9226 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9228 * dynobj.h (class Sized_dynobj): Update declaration.
9229 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9231 * plugin.h (class Sized_pluginobj): Update declaration.
9233 2010-08-02 Ian Lance Taylor <iant@google.com>
9236 * output.cc (Output_segment::set_offset): Search for the first and
9237 last sections rather than assuming that the list is in order.
9238 (Output_segment::find_first_and_last_list): New function.
9239 * output.h (class Output_segment): Update declarations.
9240 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9241 (relro_strip_test_SOURCES): New variable.
9242 (relro_strip_test_DEPENDENCIES): New variable.
9243 (relro_strip_test_LDFLAGS): New variable.
9244 (relro_strip_test_LDADD): New variable.
9245 (relro_strip_test.so): New target.
9247 2010-08-02 Ian Lance Taylor <iant@google.com>
9249 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9250 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9251 (Target_i386::got_tlsdesc_section): New function.
9252 (Target_i386::got_section): Create space for GOT entries for
9253 TLSDESC relocations.
9254 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9256 (Target_i386::Scan::global): Likewise.
9257 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9259 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9260 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9261 (Target_x86_64::got_tlsdesc_section): New function.
9262 (Target_x86_64::got_section): Create space for GOT entries for
9263 TLSDESC relocations.
9264 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9266 (Target_x86_64::Scan::global): Likewise.
9267 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9270 2010-08-02 Ian Lance Taylor <iant@google.com>
9272 * testsuite/final_layout.sh: Use dc to convert from hex to
9275 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9277 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9278 paramter to the call to gold::gc_process_relocs.
9279 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9280 paramter to the call to gold::gc_process_relocs.
9281 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9282 parameter to the call to gold::gc_process_relocs.
9283 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9284 template parameter to the call to gold::gc_process_relocs.
9285 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9286 paramter to the call to gold::gc_process_relocs.
9287 * gc.h (get_embedded_addend_size): New function.
9288 (gc_process_relocs): Save the size of the reloc for use by ICF.
9289 * icf.cc (get_section_contents): Get the addend from the text section
9290 for SHT_REL relocation sections.
9291 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9292 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9293 * int_encoding.h (read_from_pointer): New overloaded function.
9294 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9295 * testsuite/icf_sht_rel_addend_test.sh: New file.
9296 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9297 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9299 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9301 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9302 * Makefile.in: Regenerate.
9303 * testsuite/Makefile.in: Regenerate.
9305 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9307 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9308 * gold/testsuite/debug_msg.cc: Likewise.
9309 * gold/testsuite/odr_violation1.cc
9310 * gold/testsuite/odr_violation2.cc
9312 2010-07-21 Cary Coutant <ccoutant@google.com>
9314 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9315 string, and length fields.
9316 (Output_merge_string::Merged_strings_list): New type.
9317 (Output_merge_string::Merged_strings_lists): New typedef.
9318 (Output_merge_string): Replace merged_strings_ with
9319 merged_strings_lists_.
9320 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9321 Merged_strings_list per input object and section. Don't store pointer
9322 to the string. Don't store length with each merged string entry.
9323 (Output_merge_string::finalize_merged_data): Loop over list of merged
9324 strings lists. Recompute length of each merged string.
9326 2010-07-15 Cary Coutant <ccoutant@google.com>
9328 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9331 2010-07-14 Ian Lance Taylor <iant@google.com>
9333 * descriptors.cc (Descriptors::open): Report correct name in error
9336 2010-07-13 Doug Kwan <dougkwan@google.com>
9338 * arm.cc (Arm_input_section::Arm_input_section): For a
9339 SHT_ARM_EXIDX section, always keeps the input sections.
9340 (Arm_input_section::set_exidx_section_link): New method.
9341 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9342 has_errors_ to false.
9343 (Arm_exidx_input_section::has_errors,
9344 Arm_exidx_input_section::set_has_errors): New methods.
9345 (Arm_exidx_input_section::has_errors_): New data member.
9346 (Arm_relobj::get_exidx_shndx_list): New method.
9347 (Arm_output_section::append_text_sections_to_list): Do not skip
9348 section without SHF_EXECINSTR.
9349 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9351 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9352 section header. Make error messages more verbose. Check for
9353 a non-executable section linked to an EXIDX section.
9354 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9355 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9356 check that there is no deferred EXIDX section if we exit early.
9357 Instead of not making an EXIDX section in case of an error, make one
9358 and set the has_errors flag of it.
9359 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9360 in a relocatable link.
9361 (Target_arm::do_relax): Look for the EXIDX output section instead of
9362 assuming that it is called .ARM.exidx.
9363 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9364 section list. Do not check for SHF_EXECINSTR section flags but
9365 skip any input section with errors.
9366 * output.cc (Output_section::Output_section): Initialize
9367 always_keeps_input_sections_ to false.
9368 (Output_section::add_input_section): Check for
9369 always_keeps_input_sections_.
9370 * output.h (Output_section::always_keeps_input_sections,
9371 Output_section::set_always_keeps_input_sections): New methods.
9372 (Output_section::always_keeps_input_sections): New data member.
9374 2010-07-13 Rafael Espindola <espindola@google.com>
9376 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9377 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9379 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9380 Ian Lance Taylor <iant@google.com>
9382 * output.h (Output_section_lookup_maps::add_merge_section):
9383 Correct check of whether value was inserted.
9384 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9385 (Output_section_lookup_maps::add_relaxed_input_section):
9387 * arm.cc (Target_arm::got_section): Remove used local os.
9388 * i386.cc (Target_i386::got_section): Likewise.
9389 * x86_64.cc (Target_x86_64::got_section): Likewise.
9390 * sparc.cc (Target_sparc::got_section): Likewise.
9391 (Target_sparc::relocate): Remove unused local have_got_offset.
9392 * powerpc.cc (Target_powerpc::relocate): Likewise.
9394 2010-07-13 Ian Lance Taylor <iant@google.com>
9396 * compressed_output.cc (zlib_decompress): Fix signature in
9399 * archive.cc (Archive::include_member): Unlock an external member
9400 of a thin archive. Don't bother to delete an object we know is
9403 2010-07-12 Cary Coutant <ccoutant@google.com>
9405 * compressed_output.cc (zlib_decompress): New function.
9406 (get_uncompressed_size): New function.
9407 (decompress_input_section): New function.
9408 * compressed_output.h (get_uncompressed_size): New function.
9409 (decompress_input_section): New function.
9410 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9411 Handle compressed debug sections.
9412 * layout.cc (is_compressed_debug_section): New function.
9413 (Layout::output_section_name): Map compressed section names to
9415 * layout.h (is_compressed_debug_section): New function.
9416 (is_debug_info_section): Recognize compressed debug sections.
9417 * merge.cc: Include compressed_output.h.
9418 (Output_merge_data::do_add_input_section): Handle compressed
9420 (Output_merge_string::do_add_input_section): Handle compressed
9422 * object.cc: Include compressed_output.h.
9423 (Sized_relobj::Sized_relobj): Initialize new data members.
9424 (build_compressed_section_map): New function.
9425 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9426 * object.h (Object::section_is_compressed): New method.
9427 (Object::do_section_is_compressed): New method.
9428 (Sized_relobj::Compressed_section_map): New type.
9429 (Sized_relobj::do_section_is_compressed): New method.
9430 (Sized_relobj::compressed_sections_): New data member.
9431 * output.cc (Output_section::add_input_section): Handle compressed
9433 * reloc.cc: Include compressed_output.h.
9434 (Sized_relobj::write_sections): Handle compressed debug sections.
9436 2010-07-08 Cary Coutant <ccoutant@google.com>
9438 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9439 weak when resolving to a dynamic def.
9440 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9441 for weak undef/dynamic def cases. Adjust callers.
9442 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9443 undef_binding_weak_.
9444 (Symbol_table::sized_write_globals): Adjust symbol binding.
9445 (Symbol_table::sized_write_symbol): Add binding parameter.
9446 * symtab.h (Symbol::set_undef_binding): New method.
9447 (Symbol::is_undef_binding_weak): New method.
9448 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9449 (Symbol_table::should_override): Add new parameter.
9450 (Symbol_table::sized_write_symbol): Add new parameter.
9452 * testsuite/weak_undef_file1.cc: Add new test case.
9453 * testsuite/weak_undef_file2.cc: Fix header comment.
9454 * testsuite/weak_undef_test.cc: Add new test case.
9456 2010-06-29 Doug Kwan <dougkwan@google.com>
9458 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9459 Initialize USE_SYMBOL_.
9460 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9462 (Arm_reloc_property::uses_symbol_): New data member declaration.
9463 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9464 uses symbol value and symbol is undefined but not weakly undefined.
9466 2010-06-28 Rafael Espindola <espindola@google.com>
9468 * plugin.cc (Plugin::load): Use dlerror.
9470 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9472 * symtab.cc (detect_odr_violations): When reporting an ODR
9473 violation, report an object where the symbol is defined.
9475 2010-06-25 Doug Kwan <dougkwan@google.com>
9477 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9478 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9480 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9481 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9482 target hook to detect function points.
9483 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9484 * icf.h (Icf::check_section_for_function_pointers): Change type of
9485 parameter SECTION_NAME to const reference to std::string. Use
9486 target hook to determine if section may have unsafe pointers.
9487 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9490 2010-06-21 Rafael Espindola <espindola@google.com>
9492 * fileread.cc (Input_file::find_fie): New
9493 (Input_file::open): Use Input_file::find_fie.
9494 * fileread.h (Input_file::find_fie): New
9495 * plugin.cc (set_extra_library_path): New.
9496 (Plugin::load): Add set_extra_library_path to the transfer vector.
9497 (Plugin_manager::set_extra_library_path): New.
9498 (Plugin_manager::add_input_file): Use the extra search path if set.
9499 (set_extra_library_path(): New.
9500 * plugin.h (Plugin_manager): Add set_extra_library_path and
9503 2010-06-19 Cary Coutant <ccoutant@google.com>
9505 * layout.cc (gdb_sections): Add .debug_types.
9506 (lines_only_debug_sections): Likewise.
9508 2010-06-18 Rafael Espindola <espindola@google.com>
9510 * plugin.cc (add_input_file,add_input_library)
9511 (Plugin_manager::add_input_file): Make filename arguments const.
9512 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9515 2010-06-16 Doug Kwan <dougkwan@google.com>
9517 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9518 .ARM.attributes section if we have not merged any input
9519 attributes sections.
9521 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9523 * arm.cc: Allow combining objects with no EABI version
9526 2010-06-15 Rafael Espindola <espindola@google.com>
9528 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9530 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9532 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9533 (struct iovec): Correct !HAVE_READV definition.
9535 2010-06-10 Cary Coutant <ccoutant@google.com>
9537 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9538 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9540 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9543 * symtab.h (Symbol::is_placeholder): New member function.
9544 * target-reloc.h (relocate_section): Check for placeholder symbols.
9546 * testsuite/Makefile.am (plugin_test_8): New test.
9547 (plugin_test_9): New test.
9548 * testsuite/Makefile.in: Regenerate.
9550 2010-06-09 Nick Clifton <nickc@redhat.com>
9552 * yyscript.y (input_list_element): Allow strings prefixed with
9553 the '-' character. Treat these as libraries.
9554 * script.cc (script_add_library): New function. Adds a library
9555 specified by "-l<name>" found in an input script.
9556 * script-c.h: Add prototype for script_add_library.
9558 2010-06-07 Doug Kwan <dougkwan@google.com>
9560 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9561 Restrict stub-group size to be within long conditional branch
9562 range when working around cortex-A8 erratum.
9564 2010-06-07 Damien Diederen <dd@crosstwine.com>
9566 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9569 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9573 (Output_section::Input_section_sort_entry::compare_section_ordering):
9574 Change to return non-zero correctly.
9575 (Output_section::Input_section_sort_section_order_index_compare
9576 ::operator()): Change to fix ambiguity in comparisons.
9578 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9580 * gold.h (is_wildcard_string): New function.
9581 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9582 (Layout::layout_eh_frame): Ditto.
9583 (Layout::find_section_order_index): New method.
9584 (Layout::read_layout_from_file): New method.
9585 * layout.h (Layout::find_section_order_index): New method.
9586 (Layout::read_layout_from_file): New method.
9587 (Layout::input_section_position_): New private member.
9588 (Layout::input_section_glob_): New private member.
9589 * main.cc (main): Call read_layout_from_file here.
9590 * options.h (--section-ordering-file): New option.
9591 * output.cc (Output_section::input_section_order_specified_): New
9593 (Output_section::Output_section): Initialize new member.
9594 (Output_section::add_input_section): Add new parameter.
9595 Keep input sections when --section-ordering-file is used.
9596 (Output_section::set_final_data_size): Sort input sections when
9597 section ordering file is specified.
9598 (Output_section::Input_section_sort_entry): Add new parameter.
9600 (Output_section::Input_section_sort_entry::compare_section_ordering):
9602 (Output_section::Input_section_sort_compare::operator()): Change to
9603 consider section_order_index.
9604 (Output_section::Input_section_sort_init_fini_compare::operator()):
9605 Change to consider section_order_index.
9606 (Output_section::Input_section_sort_section_order_index_compare
9607 ::operator()): New method.
9608 (Output_section::sort_attached_input_sections): Change to sort
9609 according to section order when specified.
9610 (Output_section::add_input_section<32, true>): Add new parameter.
9611 (Output_section::add_input_section<64, true>): Add new parameter.
9612 (Output_section::add_input_section<32, false>): Add new parameter.
9613 (Output_section::add_input_section<64, false>): Add new parameter.
9614 * output.h (Output_section::add_input_section): Add new parameter.
9615 (Output_section::input_section_order_specified): New
9617 (Output_section::set_input_section_order_specified): New method.
9618 (Input_section::Input_section): Initialize section_order_index_.
9619 (Input_section::section_order_index): New method.
9620 (Input_section::set_section_order_index): New method.
9621 (Input_section::section_order_index_): New member.
9622 (Input_section::Input_section_sort_section_order_index_compare): New
9624 (Output_section::input_section_order_specified_): New member.
9625 * script-sections.cc (is_wildcard_string): Delete and move modified
9627 (Output_section_element_input::Output_section_element_input): Modify
9628 call to is_wildcard_string.
9629 (Output_section_element_input::Input_section_pattern
9630 ::Input_section_pattern): Ditto.
9631 (Output_section_element_input::Output_section_element_input): Ditto.
9632 * testsuite/Makefile.am (final_layout): New test case.
9633 * testsuite/Makefile.in: Regenerate.
9634 * testsuite/final_layout.cc: New file.
9635 * testsuite/final_layout.sh: New file.
9637 2010-06-01 Rafael Espindola <espindola@google.com>
9639 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9641 2010-06-01 Rafael Espindola <espindola@google.com>
9643 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9644 visibility of symbols.
9646 2010-05-27 Doug Kwan <dougkwan@google.com>
9648 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9649 from start of output section instead of address for a local symbol
9650 in a merged or relaxed section when doing a relocatable link.
9652 2010-05-26 Rafael Espindola <espindola@google.com>
9655 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9656 adding sections the garbage collector removed.
9657 * gold/testsuite/Makefile.am: Add test.
9658 * gold/testsuite/Makefile.in: Regenerate.
9659 * gold/testsuite/plugin_test_7.sh: New.
9660 * gold/testsuite/plugin_test_7_1.c: New.
9661 * gold/testsuite/plugin_test_7_2.c: New.
9663 2010-05-26 Rafael Espindola <espindola@google.com>
9665 * script-sections.cc (Output_section_definition::set_section_addresses):
9666 Check for --section-start.
9668 2010-05-26 Doug Kwan <dougkwan@google.com>
9670 * arm.cc (Arm_scan_relocatable_relocs): New class.
9671 (Target_arm::relocate_special_relocatable): New method.
9672 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9673 (Arm_relocate_functions::thumb_branch_common): Same.
9674 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9675 instead of Default_scan_relocatable_relocs.
9676 * target-reloc.h (relocate_for_relocatable): Let target handle
9677 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9678 * target.h (Sized_target::relocate_special_relocatable): New method.
9680 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9682 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9684 2010-05-23 Doug Kwan <dougkwan@google.com>
9686 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9688 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9689 with a direct branch, not a conditional branch, to a stub.
9690 * merge.cc (Output_merge_base::record_input_section): New method
9692 (Output_merge_data::do_add_input_section): Record input section if
9693 keeps-input-sections flag is set.
9694 (Output_merge_string::do_add_input_section): Ditto.
9695 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9696 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9698 (Output_merge_base::keeps_input_sections,
9699 Output_merge_base::set_keeps_input_sections,
9700 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9702 (Output_merge_base::Input_sections): New type declaration.
9703 (Output_merge_base::input_sections_begin,
9704 Output_merge_base::input_sections_end,
9705 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9706 (Output_merge_base::bool keeps_input_sections_,
9707 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9708 Output_merge_base::input_sections_): New data members.
9709 (Output_merge_data::do_set_keeps_input_sections): New method
9711 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9712 * output.cc (Output_section::Input_section::relobj): Move method
9713 defintion from class declaration to here and handle merge sections.
9714 (Output_section::Input_section::shndx): Ditto.
9715 (Output_section::Output_section): Remove initializations of removed
9716 data members and initialize new data member LOOKUP_MAPS_.
9717 (Output_section::add_input_section): Set keeps-input-sections flag
9718 for a newly created merge output section as appropriate. Adjust code
9719 to use Output_section_lookup_maps class.
9720 (Output_section::add_relaxed_input_section): Adjst code for lookup
9721 maps code refactoring.
9722 (Output_section::add_merge_input_section): Add a new parameter
9723 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9724 class. If adding input section to a newly created merge output
9725 section fails, remove the new merge section.
9726 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
9727 Adjust code for use of the Output_section_lookup_maps class.
9728 (Output_section::find_merge_section): Ditto.
9729 (Output_section::build_lookup_maps): New method defintion.
9730 (Output_section::find_relaxed_input_section): Adjust code to use
9731 Output_section_lookup_maps class.
9732 (Output_section::get_input_sections): Export merge sections. Adjust
9733 code to use Output_section_lookup_maps class.
9734 (Output_section:::add_script_input_section): Adjust code to use
9735 Output_section_lookup_maps class. Update lookup maps for merge
9737 (Output_section::discard_states): Use Output_section_lookup_maps.
9738 (Output_section::restore_states): Same.
9739 * output.h (Merge_section_properties): Move class defintion out of
9741 (Output_section_lookup_maps): New class.
9742 (Output_section::Input_section::is_merge_section): New method
9744 (Output_section::Input_section::relobj): Move defintion out of class
9745 defintion. Declare method only.
9746 (Output_section::Input_section::shndx): Ditto.
9747 (Output_section::Input_section::output_merge_base): New method defintion.
9748 (Output_section::Input_section::u2_.pomb): New union field.
9749 (Output_section::Merge_section_by_properties_map,
9750 Output_section::Output_section_data_by_input_section_map,
9751 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9753 (Output_section::add_merge_input_section): Add new parameter
9754 KEEPS_INPUT_SECTIONS.
9755 (Output_section::build_lookup_maps): New method declaration.
9756 (Output_section::merge_section_map_,
9757 Output_section::merge_section_by_properties_map_,
9758 Output_section::relaxed_input_section_map_,
9759 Output_section::is_relaxed_input_section_map_valid_): Remove data
9761 (Output_section::lookup_maps_): New data member.
9763 2010-05-21 Doug Kwan <dougkwan@google.com>
9766 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9767 avoid a compilation error.
9769 2010-05-19 Rafael Espindola <espindola@google.com>
9771 * script-sections.cc (Output_section_definition::allocate_to_segment):
9772 Update the phdrs_list even when the output section is NULL.
9773 * testsuite/Makefile.am: Add test.
9774 * testsuite/Makefile.in: Regenerate.
9775 * testsuite/script_test_9.cc: New.
9776 * testsuite/script_test_9.sh: New.
9777 * testsuite/script_test_9.t: New.
9779 2010-05-19 Doug Kwan <dougkwan@google.com>
9781 * arm.cc (Arm_input_section::original_size): New method.
9782 (Arm_input_section::do_addralign): Add a cast.
9783 (Arm_input_section::do_output_offset): Remove static cast.
9784 (Arm_input_section::original_addralign,
9785 Arm_input_section::original_size_): Change type to uint32_t.
9786 (Arm_input_section::init): Add safe casts for section alignment
9788 (Arm_input_section::set_final_data_size): Do not set address and
9789 offset of stub table.
9790 (Arm_output_section::fix_exidx_coverage): Change use of of
9791 Output_section::Simple_input_section to that of
9792 Output_section::Input_section.
9793 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9794 except for the first pass.
9795 * output.cc (Output_section::get_input_sections): Change type of
9796 input_sections to std::list<Input_section>.
9797 (Output_section::add_script_input_section): Rename from
9798 Output_section::add_simple_input_section. Change type of SIS
9799 parameter from Simple_input_section to Input_section.
9800 * output.h (Output_section::Simple_input_section): Remove class.
9801 (Output_section::Input_section): Change class visibility to public.
9802 (Output_section::Input_section::addralign): Use stored alignments
9803 for special input sections if set.
9804 (Output_section::Input_section::set_addralign): New method.
9805 (Output_section::get_input_sections): Change parameter type from
9806 list of Simple_input_section to list of Input_section.
9807 (Output_section::add_script_input_section): Rename from
9808 Output_section::add_simple_input_section. Change first parameter's
9809 type from Simple_input_section to Input_section and remove the
9810 second and third parameters.
9811 * script-sections.cc (Input_section::Input_section_list): Change
9812 type to list of Output_section::Input_section/
9813 (Input_section_info::Input_section_info): Change parameter type of
9814 INPUT_SECTION to Output_section::Input_section.
9815 (Input_section_info::input_section): Change return type.
9816 (Input_section_info::input_section_): Change type to
9817 Output_section::Input_section.
9818 (Output_section_element_input::set_section_addresses): Adjust code
9819 to use Output_section::Input_section instead of
9820 Output_section::Simple_input_section. Adjust code for renaming
9821 of Output_section::add_simple_input_section.
9822 (Orphan_output_section::set_section_addresses): Ditto.
9824 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9826 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9827 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9829 2010-05-18 Rafael Espindola <espindola@google.com>
9831 * options.cc (General_options::finalize): Handle -nostdlib.
9832 * options.h (nostdlib): New option.
9833 * script.cc (script_add_search_dir): Handle -nostdlib.
9835 2010-05-12 Doug Kwan <dougkwan@google.com>
9837 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9838 attributes section only if there no attributes section after merging.
9839 (Target_arm::merge_object_attributes): Move value of
9840 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
9841 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9842 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9843 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9844 and arm_attr_merge_7.stdout.
9845 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9846 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9847 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9848 arm_attr_merge_7b.o): New rules.
9849 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9851 * testsuite/Makefile.in: Regenerate.
9852 * testsuite/arm_attr_merge.sh: New file.
9853 * testsuite/arm_attr_merge_[67][ab].s: Same.
9855 2010-05-05 Nick Clifton <nickc@redhat.com>
9857 * po/es.po: Updated Spanish translation.
9859 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9861 * Makefile.am (install-exec-local): Properly install gold as
9862 default cross linker.
9863 * Makefile.in: Regenerated.
9865 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9866 Nick Clifton <nickc@redhat.com>
9868 * configure.ac (install_as_default): Define and set to false
9869 unless --enable-gold or --enable-gold=both/gold has been
9871 * configure: Regenerate.
9873 * Makefile.am (install-exec-local): Install the executable as
9874 'ld.gold'. If install_as_default is true then also install it as
9876 * Makefile.in: Regenerated.
9878 2010-04-24 Ian Lance Taylor <iant@google.com>
9880 * layout.cc (Layout::layout_reloc): In relocatable link don't
9881 combine reloc sections for grouped sections.
9883 2010-04-23 Sriraman Tallam <tmsriram@google.com>
9885 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9886 sections that are not ordinary to icf.
9887 * icf.cc (get_section_contents): Handle relocation pointing to section
9888 with no object or shndx information.
9889 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9890 * testsuite/Makefile.in: Regenerate.
9891 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9892 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9894 2010-04-22 Ian Lance Taylor <iant@google.com>
9896 * expression.cc (Expression::Expression_eval_info): Add
9897 result_alignment_pointer field.
9898 (Expression::eval_with_dot): Add result_alignment_pointer
9899 parameter. Change all callers.
9900 (Expression::eval_maybe_dot): Likewise.
9901 (class Binary_expression): Add alignment_pointer parameter to
9902 left_value and right_value. Change all callers.
9903 (BINARY_EXPRESSION): Set result alignment.
9904 (class Trinary_expression): Add alignment_pointer parameter to
9905 arg2_value and arg3_value. Change all callers.
9906 (Trinary_cond::value): Set result alignment.
9907 (Max_expression::value, Min_expression::value): Likewise.
9908 (Align_expression::value): Likewise.
9909 * script-sections.cc (class Sections_element): Add dot_alignment
9910 parameter to set_section_addresses virtual function. Update
9912 (class Output_section_element): Likewise.
9913 (Script_sections::create_segments): Add dot_alignment parameter.
9915 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9916 (Script_sections::set_phdrs_clause_addresses): Likewise.
9917 * script-sections.h: Update declarations.
9918 * script.h: Update declarations.
9919 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9921 * testsuite/script_test_3.t: Set large alignment.
9922 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9923 segment has expected alignment.
9925 2010-04-22 Nick Clifton <nickc@redhat.com>
9927 * po/gold.pot: Updated by the Translation project.
9928 * po/vi.po: Updated Vietnamese translation.
9930 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9932 * testsuite/Makefile.am (check_PROGRAMS): Add
9933 icf_virtual_function_folding_test.
9934 * testsuite/Makefile.in: Regenerated.
9936 2010-04-15 Andrew Haley <aph@redhat.com>
9938 * options.h (merge_exidx_entries): New option.
9939 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9940 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9941 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9942 (Target_arm::merge_exidx_entries): New function.
9943 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9944 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9945 to Arm_exidx_fixup constructor.
9946 Add new arg, merge_exidx_entries.
9947 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9948 Arm_output_section::fix_exidx_coverage.
9950 2010-04-18 Sriraman Tallam <tmsriram@google.com>
9952 * icf.cc (get_section_contents): Check for preemptible functions.
9953 Ignore addend when appropriate.
9954 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9956 (add_from_relobj): Check for section folded.
9957 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9958 * symtab.h (should_add_dynsym_entry): Add new parameter.
9959 * target-reloc.h (scan_relocs): Check for section folded.
9960 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9961 Check reloc types for function pointers in shared objects.
9962 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9964 (icf_preemptible_functions_test): New test case.
9965 (icf_string_merge_test): New test case.
9966 * testsuite.Makefile.in: Regenerate.
9967 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9968 bar_glob. Refactor code.
9969 * testsuite/icf_preemptible_functions_test.cc: New file.
9970 * testsuite/icf_preemptible_functions_test.sh: New file.
9971 * testsuite/icf_string_merge_test.cc: New file.
9972 * testsuite/icf_string_merge_test.sh: New file.
9973 * testsuite/icf_virtual_function_folding_test.cc: New file.
9974 * testsuite/icf_virtual_function_folding_test.sh: New file.
9976 2010-04-14 Doug Kwan <dougkwan@google.com>
9978 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9979 for local symbol recounting if we remove a section due to ICF.
9980 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9981 there are no regular objects in input.
9983 2010-04-13 Doug Kwan <dougkwan@google.com>
9985 * arm.cc (Arm_input_section::set_final_data_size): Compute
9986 accurate final data size instead of using current data size.
9988 2010-04-09 Doug Kwan <dougkwan@google.com>
9990 * layout.cc (Layout::choose_output_section): Handle script section
9992 (Layout::make_output_section_for_script): Add section type parameter.
9993 Handle script section types.
9994 * layout.h (Layout::make_output_section_for_script): Add section
9996 * output.cc (Output_section::Output_section): Initialize data member
9998 (Output_section::do_reset_address_and_file_offset): Do not set address
9999 to 0 if section is a NOLOAD section.
10000 * output.h (Output_section::is_noload): New method.
10001 (Output_section::set_is_noload): Ditto.
10002 (Output_section::is_noload_): New data member.
10003 * script-c.h (Script_section_type): New enum type.
10004 (struct Parser_output_section_header): Add new file section_type.
10005 * script-sections.cc (Sections_element::output_section_name): Add
10006 parameter for returning script section type.
10007 (Output_section_definition::output_section_name): Ditto.
10008 (Output_section_definition::section_type)P; New method.
10009 (Output_section_definiton::script_section_type_name): Ditto.
10010 (Output_section_definition::script_section_type_): New data member.
10011 (Output_section_definition::Output_section_definition): Initialize
10012 data member Output_section_definition::script_section_type_.
10013 (Output_section_definition::create_sections): Pass script section type
10014 to Layout::make_output_section_for_script.
10015 (Output_section_definition::output_section_name): Return script
10016 section type to caller.
10017 (Output_section_definition::set_section_address): Do not advance
10018 dot value and load address if section type is NOLOAD. Set address
10019 of NOLOAD sections regardless of section flags.
10020 (Output_section_definition::print): Print section type if it is
10021 not SCRIPT_SECTION_TYPE_NONE.
10022 (Output_section_definition::section_type): New method.
10023 (Output_section_definition::script_section_type_name): Ditto.
10024 (Script_sections::output_section_name): Add new parameter
10025 PSECTION_TYPE for returning script section type. Pass it to
10026 section elements. Handle discard sections.
10027 (Sort_output_sections::operator()): Handle NOLOAD sections.
10028 * script-sections.h (Script_sections::Section_type): New enum type.
10029 (Script_sections::output_section_name): Add a new parameter for
10030 returning script section type.
10031 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10033 * yyscript.y (union): Add new field SECTION_TYPE.
10034 (COPY, DSECT, INFO, NOLOAD): New tokens.
10035 (opt_address_and_section_type): Change type to output_section_header.
10036 (section_type): New non-terminal
10037 (section_header): Handle section type.
10038 (opt_address_and_section_type): Return section type value.
10040 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10042 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10043 * testsuite/plugin_common_test_2.c (foo): Likewise.
10045 2010-04-08 Doug Kwan <dougkwan@google.com>
10047 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10049 * output.cc (Output_section::add_merge_input_section): Simplify
10050 code and return status of Output_merge_base::add_input_section.
10051 Update merge section map only if Output_merge_base::add_input_section
10054 2010-04-07 Doug Kwan <dougkwan@google.com>
10056 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10057 if section is marked as containing instructions but has no mapping
10059 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10060 correct section index.
10061 (Arm_relobj::find_linked_text_section): Ditto.
10063 2010-04-07 Cary Coutant <ccoutant@google.com>
10065 * archive.cc (include_member): Destroy Read_symbols_data object before
10067 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10068 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10069 (Read_symbols_data::~Read_symbols_data) New destructor.
10070 (Section_relocs::Section_relocs) New constructor.
10071 (Section_relocs::~Section_relocs) New destructor.
10072 (Read_relocs_data::Read_relocs_data) New constructor.
10073 (Read_relocs_data::~Read_relocs_data) New destructor.
10074 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10075 pointers to NULL after deleting.
10077 2010-04-07 Doug Kwan <dougkwan@google.com>
10079 * arm.cc: Replace "endianity" with "endianness" in comments.
10080 (Arm_exidx_cantunwind): Ditto.
10081 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10082 (Arm_relobj::merge_flags_and_attributes): New method.
10083 (Arm_relobj::merge_flags_and_attributes_): New data member.
10084 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10085 (Arm_relobj::scan_sections_for_stubs): Ditto.
10086 (Arm_relobj::do_read_symbols): Check to see if we really want to
10087 merge processor-specific flags and attributes. Exit early if
10088 an object is empty except for section names and the undefined symbol.
10089 (Target_arm::do_finalize_sections): Move check for ELF format to
10090 Arm_relobj::do_read_symbols. Merge processor specific flags and
10091 attributes from a regular object only when we have determined that
10092 it is aapropriate. Do not create an .ARM.attributes section in
10093 output if there is no regular input object.
10094 (Target_arm::merge_processor_specific_flags): Check
10095 --warn-mismatch before printing any error.
10096 (Target_arm::merge_object_attributes): Ditto.
10097 * gold.cc (queue_middle_tasks): Handle the case in which there is
10098 no regular object in input.
10099 * options.cc (General_options::parse_EB): New method.
10100 (General_options::parse_EL): Same.
10101 (General_options::General_options): Initialize endianness_.
10102 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10104 (General_options::Endianness): New enum.
10105 (General_options::endianness): New method.
10106 (General_options::endianness_): New data member.
10107 * parameters.cc (Parameters::set_options): Check target endianness.
10108 (Parameters::set_target_once): Ditto.
10109 (Parameters::check_target_endianness): New method.
10110 (parameters_force_valid_target): If either -EL or -EB is specified,
10111 use it to define endianness of default target.
10112 * parameters.h (Parameters::check_target_endianness): New method
10114 * target.h (class Target): Change "endianity" to "endianness"
10117 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10119 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10120 * configure: Regenerate.
10121 * Makefile.in: Regenerate.
10122 * testsuite/Makefile.in: Regenerate.
10124 2010-04-06 Cary Coutant <ccoutant@google.com>
10127 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10128 prevailing definitions of common symbols.
10129 * testsuite/plugin_test_6.sh: New test case.
10130 * testsuite/plugin_common_test_1.c: New test case.
10131 * testsuite/plugin_common_test_2.c: New test case.
10132 * testsuite/Makefile.am (plugin_test_6): New test case.
10133 * testsuite/Makefile.in: Regenerate.
10135 2010-04-06 Nick Clifton <nickc@redhat.com>
10137 * po/vi.po: New Vietnamese translation.
10139 2010-03-30 Doug Kwan <dougkwan@google.com>
10141 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10143 2010-03-25 Doug Kwan <dougkwan@google.com>
10145 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10146 to avoid a conversion warning on a 32-bit host.
10148 2010-03-24 Ian Lance Taylor <iant@google.com>
10150 * testsuite/script_test_3.t: Add a TLS segment.
10151 * testsuite/Makefile.am (check_PROGRAMS): Add
10152 tls_phdrs_script_test.
10153 (tls_phdrs_script_test_SOURCES): Define.
10154 (tls_phdrs_script_test_DEPENDENCIES): Define.
10155 (tls_phdrs_script_test_LDFLAGS): Define.
10156 (tls_phdrs_script_test_LDADD): Define.
10157 * testsuite/Makefile.in: Rebuild.
10159 2010-03-23 Cary Coutant <ccoutant@google.com>
10161 * fileread.cc (find_or_make_view): Fix comment.
10163 2010-03-23 Ian Lance Taylor <iant@google.com>
10165 * script-sections.cc (class Orphan_section_placement): Define
10166 PLACE_TLS and PLACE_TLS_BSS.
10167 (Orphan_section_placement::Orphan_section_placement): Initialize
10169 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10170 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10171 (tls_script_test_SOURCES): Define.
10172 (tls_script_test_DEPENDENCIES): Define.
10173 (tls_script_test_LDFLAGS): Define.
10174 (tls_script_test_LDADD): Define.
10175 * testsuite/Makefile.in: Rebuild.
10177 2010-03-22 Doug Kwan <dougkwan@google.com>
10179 * arm.cc (Arm_relocate_functions::abs8,
10180 Arm_relocate_functions::abs16): Use correct check for overflow
10181 specified in the ARM ELF specs.
10182 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10183 target of a BLX instruction specially.
10184 (Reloc_stub::stub_type_for_reloc): Ditto.
10185 (Relocate::relocate): Use symbolic names instead of numeric relocation
10186 codes to report error.
10187 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10189 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10190 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10191 thumb2_blx_out_of_range.stdout
10192 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10193 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10194 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10195 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10196 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10197 thumb2_blx_in_range, thumb2_blx_in_range.o,
10198 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10199 thumb2_blx_out_of_range.o): New rules.
10200 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10201 thumb2_blx_in_range and thumb2_blx_out_of_range.
10202 * testsuite/Makefile.in: Regenerate.
10203 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10204 * testsuite/thumb_blx_in_range.s: New file.
10205 * testsuite/thumb_blx_out_of_range.s: New file.
10207 2010-03-22 Rafael Espindola <espindola@google.com>
10209 * archive.cc (Should_include): Move to archive.h.
10210 (should_include_member): Make it a member of Archive.
10212 (Add_lib_group_symbols): New.
10213 * archive.h: Include options.h.
10214 (Archive_member): Moved from Archive.
10215 (Should_include): Moved from archive.cc.
10217 (Add_lib_group_symbols): New.
10218 * dynobj.cc (do_should_include_member): New.
10219 * dynobj.h (do_should_include_member): New.
10220 * gold.cc (queue_initial_tasks): Update call to queue.
10221 * main.cc (main): Print lib group stats.
10222 * object.cc (do_should_include_member): New.
10223 * object.h: Include archive.h.
10224 (Object::should_include_member): New.
10225 (Object::do_should_include_member): New.
10226 (Sized_relobj::do_should_include_member): New.
10227 * options.cc (General_options::parse_start_lib): New.
10228 (General_options::parse_end_lib): New.
10229 (Input_arguments::add_file): Handle lib groups.
10230 (Input_arguments::start_group): Check we are not in a lib.
10231 (Input_arguments::start_lib): New.
10232 (Input_arguments::end_lib): New.
10233 * options.h (General_options): Add start_lib and end_lib.
10234 (Input_argument::lib_): New.
10235 (Input_argument::lib): New.
10236 (Input_argument::is_lib): New.
10237 (Input_file_lib): New.
10238 (Input_arguments::in_lib_): New.
10239 (Input_arguments::in_lib): New.
10240 (Input_arguments::start_lib): New.
10241 (Input_arguments::end_lib_): New.
10242 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10243 in unused members as preempted.
10244 (Sized_pluginobj::do_should_include_member): New.
10245 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10246 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10247 return the blocker.
10248 (Read_symbols::do_whole_lib_group): New.
10249 (Read_symbols::do_lib_group): New.
10250 (Read_symbols::do_read_symbols): Handle lib groups.
10251 (Read_symbols::get_name): Handle lib groups.
10252 * readsyms.h (Read_symbols): Add an archive member pointer.
10253 (Read_symbols::do_whole_lib_group): New.
10254 (Read_symbols::do_lib_group): New.
10255 (Read_symbols::member_): New.
10256 * script.cc (read_input_script): Update call to queue_soon.
10258 2010-03-19 Doug Kwan <dougkwan@google.com>
10260 * arm.cc (Stub_table::Stub_table): Initialize new data members
10261 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10262 (Stub_table::add_reloc_stub): Assign stub offset and update
10263 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10264 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10266 (Stub_table::update_data_size_and_addralign): Use
10267 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10268 instead of going over all reloc stubs.
10269 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10270 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10271 Stringpool_template::offset_ to size of Stringpool_char.
10272 (Stringpool_template::new_key_offset): Remove code to initialize
10273 Stringpool_template::offset_.
10274 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10275 Stringpool_template::offset_ to zero.
10277 2010-03-15 Doug Kwan <dougkwan@google.com>
10279 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10281 (Stringpool_template::new_key_offset): New method.
10282 (Stringpool_template::add_string): Assign offsets when adding new
10284 (Stringpool_template::set_string_offsets): Do not set string offsets
10285 when not optimizing.
10286 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10288 (Chunked_vector::clear): Clear size_.
10289 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10290 (Chunked_vector::size): Return size_.
10291 (Chunked_vector::push_back): Use size_ to find insert position.
10292 (Chunked_vector::size_): New data member.
10293 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10294 (Stringpool_template::new_key_offset): New method declaration.
10295 (Stringpool_template::offset_): New data member.
10297 2010-03-15 Rafael Espindola <espindola@google.com>
10299 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10300 Add_symbols' constructor.
10301 * readsyms.h (Add_symbols): Remove the input_group member.
10303 2010-03-10 Ian Lance Taylor <iant@google.com>
10305 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10306 target to ask whether a reference to a symbol requires a stack
10308 * target.h (Target::is_call_to_non_split): New function.
10309 (Target::do_is_call_to_non_split): Declare virtual function.
10310 * target.cc: Include "symtab.h".
10311 (Target::do_is_call_to_non_split): New function.
10312 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10314 2010-03-10 Cary Coutant <ccoutant@google.com>
10316 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10317 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10318 (File_read::open[2]): Add whole_file_view_ to list of views.
10319 (File_read::make_view): Remove test of whole_file_view_.
10320 (File_read::find_or_make_view): Create whole_file_view_ if
10322 (File_read::clear_views): Replace bool parameter with enum;
10323 adjust all callers. Don't delete views with permanent data;
10324 do delete cached views and views from archives if
10325 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10326 if clearing the corresponding view.
10327 * fileread.h (File_read::Clear_views_mode): New enum.
10328 (File_read::View::is_permanent_view): New method.
10329 (File_read::clear_views): Replace bool parameter
10330 with enum; adjust all callers.
10331 * options.h (General_options): Change keep_files_mapped option;
10332 add map_whole_files.
10333 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10334 releasing the file.
10335 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10338 2010-03-10 David S. Miller <davem@davemloft.net>
10340 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10342 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10344 * icf.cc (get_section_contents): Add '@' marker after processing the
10347 2010-03-08 Doug Kwan <dougkwan@google.com>
10349 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10350 due to a conversion warning.
10351 (Arm_relobj::update_output_local_symbol_count): Check for local
10352 symbol with unset output index.
10354 2010-03-05 Ian Lance Taylor <iant@google.com>
10356 * options.h (class General_options): Add --spare-dynamic-tags.
10357 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10358 --spare-dynamic-tags.
10360 2010-03-05 Ian Lance Taylor <iant@google.com>
10362 * incremental.cc: Include "libiberty.h".
10364 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10366 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10367 function, is_info_ member.
10368 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10369 (Versions::Versions): Update caller.
10370 (Versions::define_base_version): Likewise.
10371 (Versions::add_def): Likewise.
10373 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10375 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10376 (Scan::possible_function_pointer_reloc): New function.
10377 (Scan::local_reloc_may_be_function_pointer): Change to call
10378 possible_function_pointer_reloc.
10379 (Scan::global_reloc_may_be_function_pointer): Ditto.
10380 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10381 relocations in ".data.rel.ro._ZTV" section.
10382 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10383 * testsuite/icf_safe_so_test.cc: Ditto.
10384 * testsuite/icf_safe_test.cc: Ditto.
10385 * testsuite/icf_safe_test.sh: Ditto.
10387 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10388 Ian Lance Taylor <iant@google.com>
10390 * target-reloc.h (relocate_section): Check the symbol table index
10391 for -1U before setting the local symbol index.
10392 (scan_relocatable_relocs): If copying the relocation, record that
10393 the local symbol is required.
10394 * object.h (Symbol_value::is_output_symtab_index_set): New
10396 (Symbol_value::may_be_discarded_from_output_symtab): New
10398 (Symbol_value::has_output_symtab_entry): New function.
10399 (Symbol_value::needs_output_symtab_entry): Remove.
10400 (Symbol_value::output_symtab_index): Make sure the symbol index is
10402 (Symbol_value::set_output_symtab_index): Make sure the symbol
10403 index is not set. Make sure the new index is valid.
10404 (Symbol_value::set_must_have_output_symtab_entry): New function.
10405 (Symbol_value::has_output_dynsym_entry): New function.
10406 (Symbol_value::set_output_dynsym_index): Make sure the new index
10408 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10409 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10410 local symbol if permitted.
10411 (Sized_relobj::do_finalize_local_symbols): Call
10412 is_output_symtab_index_set rather than needs_output_symtab_entry.
10413 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10414 rather than needs_output_symtab_entry. Call
10415 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10416 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10417 is_output_symtab_index_set rather than needs_output_symtab_entry.
10418 * testsuite/discard_locals_relocatable_test.c: New file.
10419 * testsuite/discard_locals_test.sh: Test -r.
10420 * testsuite/Makefile.am (check_DATA): Add
10421 discard_locals_relocatable_test1.syms,
10422 discard_local_relocatable_test2.syms.
10423 (MOSTLYCLEANFILES): Likewise. Also add
10424 discard_locals_relocatable_test1.lout and
10425 discard_locals_relocatable_test2.out.
10426 (discard_locals_relocatable_test1.syms): New target.
10427 (discard_locals_relocatable_test.o): New target.
10428 (discard_locals_relocatable_test1.out): New target.
10429 (discard_locals_relocatable_test2.syms): New target.
10430 (discard_locals_relocatable_test2.out): New target.
10431 (various): Add missing ../ld-new dependencies.
10432 * testsuite/Makefile.in: Rebuild.
10434 2010-03-03 Nick Clifton <nickc@redhat.com>
10436 * po/fi.po: New Finnish translation.
10438 2010-03-01 Doug Kwan <dougkwan@google.com>
10440 * layout.cc (Layout::Layout): Force section types of .init_array*,
10441 .preinit_array* and .fini_array* sections.
10442 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10443 Fix check of return value of std::string::find.().
10444 (Output_section::Input_section_sort_compare::operator()): Remove
10445 comment about .init_array.
10446 (Output_section::Input_section_sort_init_fini_compare::operator()):
10448 (Output_section::sort_attached_input_sections): Handle .init_array
10449 and .fini_array specially.
10450 * output.h (Output_section::Inut_section_sort_compare): Update
10452 (Output_section::Input_section_sort_init_fini_compare): New struct.
10454 2010-02-26 Doug Kwan <dougkwan@google.com>
10456 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10457 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10458 * testsuite/debug_msg.sh: Avoid matching source line number for
10459 use of global variable undef_int.
10461 2010-02-26 Doug Kwan <dougkwan@google.com>
10463 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10464 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10465 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10466 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10467 * options.cc (General_options::General_options): Initialize member
10469 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10470 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10471 and rm_no_fix_v4bx.stdout
10472 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10473 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10474 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10475 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10476 and arm_no_fix_v4bx.
10477 * Makefile.in: Regenerate.
10478 * testsuite/arm_fix_v4bx.s: New file.
10479 * testsuite/arm_fix_v4bx.sh: Ditto.
10481 2010-02-24 Doug Kwan <dougkwan@google.com>
10483 * arm.cc (Target_arm::got_section): Make the .got section the first
10484 non RELRO section in the data segment.
10485 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10486 suffixes of section names.
10488 2010-02-24 Doug Kwan <dougkwan@google.com>
10490 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10491 flags and attributes merging if an input file is a binary file.
10492 * fileread.cc (Input_file::open): Record format of original file.
10493 * fileread.h (Input_file::Format): New enum type.
10494 (Input_file::Input_file): Initialize data member format_.
10495 (Input_file::format): New method definition.
10496 (Input_file::format_):: New data member.
10498 2010-02-24 Doug Kwan <dougkwan@google.com>
10500 * arm.cc (Arm_output_data_got): New class.
10501 (ARM_TCB_SIZE): New constant
10502 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10503 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10504 If user uses a script with a SECTIONS clause, issue only a warning
10505 for a misplaced EXIDX input section. Otherwise, issue an error.
10506 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
10507 garbage collection.
10508 (Target_arm::got_mode_index_entry): Handle static linking.
10509 (Target_arm::Scan::local): Ditto.
10510 (Target_arm::Scan::global): Ditto.
10511 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10512 all incorrectly implemented relocations.
10513 (Target_arm::fix_exidx_coverage): Pass layout to
10514 Arm_output_section::fix_exidx_coverage.
10515 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10516 from ".ARM.exidx." and ".ARM.extab.".
10518 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10520 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10521 section if it does not already exist.
10522 * attributes.cc (Attributes_section_data::Attributes_section_data):
10523 Don't crash if size is zero.
10525 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10526 Ian Lance Taylor <iant@google.com>
10528 * gold.cc (queue_middle_tasks): If no input files were opened,
10530 * workqueue.h (Task_function::Task_function): Assert that there is
10533 2010-02-22 Doug Kwan <dougkwan@google.com>
10535 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10536 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10537 types to avoid warnings due to different uint64_t implementations
10538 on different hosts.
10540 2010-02-21 Doug Kwan <dougkwan@google.com>
10542 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10543 handling of the maximum backward branch offset.
10544 (Arm_relocate_functions::thumb_branch_common): Ditto.
10545 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10546 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
10547 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
10548 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10549 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10550 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10551 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10552 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10553 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10554 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10555 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10556 thumb2_bl_out_of_range.o): New rules.
10557 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10558 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10559 thumb2_bl_out_of_range
10560 * testsuite/Makefile.in: Regenerate.
10561 * testsuite/arm_bl_in_range.s: New file.
10562 * testsuite/arm_bl_out_of_range.s: Ditto.
10563 * testsuite/arm_branch_in_range.sh: Ditto.
10564 * testsuite/arm_branch_range.t: Ditto.
10565 * testsuite/thumb2_branch_range.t: Ditto.
10566 * testsuite/thumb_bl_in_range.s: Ditto.
10567 * testsuite/thumb_bl_out_of_range.s: Ditto.
10568 * testsuite/thumb_branch_range.t: Ditto.
10570 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10572 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10573 Add reloc offset information.
10574 * icf.cc (get_section_contents): Change iterators to point to the new
10575 vectors. Add reloc offset information to the contents.
10576 * icf.h (Icf::Sections_reachable_info): New typedef.
10577 (Icf::Sections_reachable_list): New typedef.
10578 (Icf::Offset_info): New typedef.
10579 (Icf::Reloc_info): New struct typedef.
10580 (Icf::Reloc_info_list): New typedef.
10581 (Icf::symbol_reloc_list): Delete method.
10582 (Icf::addend_reloc_list): Delete method.
10583 (Icf::section_reloc_list): Delete method.
10584 (Icf::reloc_info_list): New method.
10585 (Icf::reloc_info_list_): New member.
10587 2010-02-19 Doug Kwan <dougkwan@google.com>
10589 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10590 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10591 * arm.cc (Arm_relocation_functions): New forward declaration.
10592 (Target_arm::Target_arm): Initialize new data members
10593 got_mod_index_offset_ and tls_base_symbol_defined_.
10594 (Target_arm::Relocate::relocate_tls): New method.
10595 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10596 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10598 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
10599 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10600 (Target_arm::got_mod_index_offset_,
10601 Target_arm::tls_base_symbol_defined_): New data members.
10602 (Target_arm::Scan::local, Target::Scan::global,
10603 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10606 2010-02-18 Doug Kwan <dougkwan@google.com>
10608 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10609 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10610 text section as a parameter becuase some broken tools may not set
10611 the link in section header.
10612 (Target_arm::has_got_section): New method.
10613 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10614 without any mapping symbol as data only. Remove warning.
10615 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10616 link in its section header, try to discover the link by inspecting the
10617 REL31 relocation at the beginning of the section.
10618 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10620 (Target_arm::Scan::global): Treat any reference to the symbol
10621 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10623 2010-02-12 Sriraman Tallam <tmsriram@google.com>
10625 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10626 (Scan::global_reloc_may_be_function_pointer): New function.
10627 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10628 (Scan::global_reloc_may_be_function_pointer): New function.
10629 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10630 (Scan::global_reloc_may_be_function_pointer): New function.
10631 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10632 (Scan::global_reloc_may_be_function_pointer): New function.
10633 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10634 (Scan::global_reloc_may_be_function_pointer): New function.
10635 (Scan::possible_function_pointer_reloc): New function.
10636 (Target_x86_64::can_check_for_function_pointers): New function.
10637 * gc.h (gc_process_relocs): Scan relocation types to determine if
10638 function pointers were taken for targets that support it.
10639 * icf.cc (Icf::find_identical_sections): Include functions for
10640 folding in safe ICF whose pointer is not taken.
10641 * icf.h (Secn_fptr_taken_set): New typedef.
10642 (fptr_section_id_): New member.
10643 (section_has_function_pointers): New function.
10644 (set_section_has_function_pointers): New function.
10645 (check_section_for_function_pointers): New function.
10646 * options.h: Fix comment for safe ICF option.
10647 * target.h (can_check_for_function_pointers): New function.
10648 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10649 Modify icf_safe_test for X86-64.
10650 * testsuite/Makefile.in: Regenerate.
10651 * testsuite/icf_safe_so_test.cc: New file.
10652 * testsuite/icf_safe_so_test.sh: New file.
10653 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10654 (main): Change to take pointer to function kept_func_3.
10655 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10656 folding is done correctly for X86-64.
10658 2010-02-12 David S. Miller <davem@davemloft.net>
10660 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10661 is_symbolless parameter.
10662 (Output_reloc<SHT_REL>::is_symbolless): New.
10663 (Output_reloc<SHT_REL>::is_symbolless_): New.
10664 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10665 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10666 (Output_reloc<SHT_RELA>::is_symbolless): New.
10667 (Output_data_reloc::add_global): Handle is_symbolless.
10668 (Output_data_reloc::add_global_relative): Likewise.
10669 (Output_data_reloc::add_local): Likewise.
10670 (Output_data_reloc::add_local_relative): Likewise.
10671 (Output_data_reloc::add_symbolless_global_addend): New.
10672 (Output_data_reloc::add_symbolless_local_addend): New.
10673 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10675 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10676 instead of ->is_relative_
10677 (Output_reloc::write): Likewise.
10678 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10679 (Output_reloc::write_rel): Simplify.
10681 * sparc.cc (Target_sparc::Scan::local): Use
10682 ->add_symbolless_local_addend as needed.
10683 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10684 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10685 based upon relocation offset.
10687 2010-02-11 Doug Kwan <dougkwan@google.com>
10689 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10690 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10691 beginning of function.
10692 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10693 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10694 parameter is_32bit in calls to should_apply_static_reloc.
10695 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10696 (check_DATA): Add arm_abs_global.stdout.
10697 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10698 arm_abs_global.stdout): New rules.
10699 (MOSTLLYCLEANFILES): Add arm_abs_global
10700 * Makefile.in: Regenerate.
10701 * testsuite/arm_abs_global.s: New file.
10702 * testsuite/arm_abs_global.sh: Ditto.
10703 * testsuite/arm_abs_lib.s: Ditto.
10705 2010-02-11 Ian Lance Taylor <iant@google.com>
10707 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10709 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10710 Allocate_commons_task first.
10711 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10712 task, rather than symtab_lock_.
10713 (Gc_process_relocs::~Gc_process_relocs): New function.
10714 (Gc_process_relocs::is_runnable): Check this_blocker_.
10715 (Gc_process_relocs::locks): Use next_blocker_ rather than
10717 (Scan_relocs::~Scan_relocs): New function.
10718 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10720 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10722 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10723 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10724 constructor accordingly.
10725 (class Gc_process_relocs): Likewise.
10726 (class Scan_relocs): Likewise.
10727 * common.h (class Allocate_commons_task): Remove symtab_lock_
10728 field, and corresponding constructor parameter.
10729 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10731 (Allocate_commons_task::locks): Likewise.
10733 2010-02-11 Ian Lance Taylor <iant@google.com>
10735 * gold-threads.h (class Once): Define.
10736 (class Initialize_lock): Rewrite as child of Once.
10737 * gold-threads.cc (class Once_initialize): Define.
10738 (once_pointer_control): New static variable.
10739 (once_pointer, once_arg): New static variables.
10740 (c_run_once): New static function.
10741 (Once::Once, Once::run_once, Once::internal_run): New functions.
10742 (class Initialize_lock_once): Remove.
10743 (initialize_lock_control): Remove.
10744 (initialize_lock_pointer): Remove.
10745 (initialize_lock_once): Remove.
10746 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10747 (Initialize_lock::initialize): Rewrite.
10748 (Initialize_lock::do_run_once): New function.
10749 * archive.cc (Archive::interpret_header): Only clear name if it is
10751 * fileread.cc: Include "gold-threads.h"
10752 (file_counts_lock): New static variable.
10753 (file_counts_initialize_lock): Likewise.
10754 (File_read::release): Only increment counts when using --stats.
10755 Use a lock around the increment.
10756 * parameters.cc (class Set_parameters_target_once): Define.
10757 (set_parameters_target_once): New static variable.
10758 (Parameters::Parameters): Move here from parameters.h.
10759 (Parameters::set_target): Rewrite.
10760 (Parameters::set_target_once): New function.
10761 (Parameters::clear_target): Move here and rewrite.
10762 * parameters.h (class Parameters): Update declarations. Add
10763 set_parameters_target_once_ field.
10764 (Parameters::Parameters): Move to parameters.cc.
10765 (Parameters::clear_target): Likewise.
10766 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10768 (Start_group::~Start_group): New function.
10769 (Start_group::is_runnable): New function.
10770 (Start_group::locks, Start_group::run): New functions.
10771 (Finish_group::run): Change saw_undefined to size_t.
10772 * readsyms.h (class Start_group): Define.
10773 (class Finish_group): Change saw_undefined_ field to size_t.
10774 (Finish_group::Finish_group): Remove saw_undefined and
10775 this_blocker parameters. Change all callers.
10776 (Finish_group::set_saw_undefined): New function.
10777 (Finish_group::set_blocker): New function.
10778 * symtab.h (class Symbol_table): Change saw_undefined to return
10779 size_t. Change saw_undefined_ field to size_t.
10780 * target-select.cc (Set_target_once::do_run_once): New function.
10781 (Target_selector::Target_selector): Initialize set_target_once_
10782 field. Don't initialize lock_ and initialize_lock_ fields.
10783 (Target_selector::instantiate_target): Rewrite.
10784 (Target_selector::set_target): New function.
10785 * target-select.h (class Set_target_once): Define.
10786 (class Target_selector): Update declarations. Make
10787 Set_target_once a friend. Remove lock_ and initialize_lock_
10788 fields. Add set_target_once_ field.
10790 2010-02-10 Ian Lance Taylor <iant@google.com>
10792 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10793 queueing any tasks.
10794 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10795 (queue_middle_tasks): Add all blockers before queueing any tasks.
10796 (queue_final_tasks): Likewise.
10797 * token.h (Task_token::add_blockers): New function.
10798 * object.h (Input_objects::number_of_relobjs): New function.
10800 2010-02-10 Ian Lance Taylor <iant@google.com>
10802 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10803 shared, not if not position independent.
10804 * x86_64.cc (Relocate::relocate_tls): Likewise.
10805 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10806 (tls_pie_pic_test): New target.
10807 * testsuite/Makefile.in: Rebuild.
10809 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10810 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10811 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10812 * testsuite/Makefile.in: Rebuild.
10814 2010-02-09 David S. Miller <davem@davemloft.net>
10816 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10817 R_SPARC_RELATIVE using ->add_local_relative().
10818 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10820 * output.h (Output_data_dynamic::add_section_size): New method
10821 that takes two Output_data objects.
10822 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10823 entry param. Handle it in initializers.
10824 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10825 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10826 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10828 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10829 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10830 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10831 for dynrel_includes_plt.
10832 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10833 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10834 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10836 (Target_sparc::do_finalize_sections): Update to pass true for
10837 dynrel_includes_plt.
10838 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10839 output before .rela.plt
10840 (Target_powerpc::do_finalize_sections): Update to pass true for
10841 dynrel_includes_plt when 32-bit.
10843 2010-02-08 Doug Kwan <dougkwan@google.com>
10845 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10847 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10848 Arm_relobj::scan_section_for_cortex_a8_stubs,
10849 Arm_relobj::do_relocation_section): Instead of calling
10850 Output_section::output_address, use faster
10851 Arm_relobj::simple_input_section_output_address.
10853 2010-02-08 David S. Miller <davem@davemloft.net>
10855 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10856 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10857 relocation helper function.
10859 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10860 just like R_SPARC_GOT{10,13,22}.
10861 (Target_sparc::Scan::local): Likewise.
10862 (Target_sparc::Relocate:relocate): Likewise.
10864 2010-02-06 Ian Lance Taylor <iant@google.com>
10866 * configure.ac: Rewrite targetobjs duplicate removal code to use
10867 only shell constructs.
10868 * configure: Rebuild.
10870 2010-02-05 Doug Kwan <dougkwan@google.com>
10873 * arm.cc (Arm_relobj::section_is_scannable): New method.
10874 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10875 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10877 2010-02-04 Doug Kwan <dougkwan@google.com>
10880 * arm-reloc-property.cc (cstdio): Include.
10881 * configure.ac (targetobjs): Remove duplicates.
10882 * configure: Regenerate.
10883 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10884 big and little endian version for a given address size.
10886 2010-02-03 Doug Kwan <dougkwan@google.com>
10888 * arm-reloc-property.cc
10889 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10891 * arm-reloc-property.h
10892 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10893 New method definition.
10894 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10896 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10898 (GOT_PREL): Change implemented to Y.
10899 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10900 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10901 (Arm_relocate_functions::movw_abs_nc): Remove method.
10902 (Arm_relocate_functions::movt_abs): Ditto.
10903 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10904 (Arm_relocate_functions::thm_movt_abs): Ditto.
10905 (Arm_relocate_functions::movw_rel_nc): Ditto.
10906 (Arm_relocate_functions::movw_rel): Ditto.
10907 (Arm_relocate_functions::movt_rel): Ditto.
10908 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10909 (Arm_relocate_functions:thm_movw_rel): Ditto.
10910 (Arm_relocate_functions:thm_movt_rel): Ditto.
10911 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10912 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10913 New method definitions.
10914 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10915 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10916 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10917 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10918 (Target_arm::Relocate::relocate): Check for non-static or
10919 unimplemented relocation code and exit early. Change calls to
10920 Target_arm::reloc_uses_thumb_bit and
10921 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10922 instead. Refactor code to handle similar relocations to increase
10923 code sharing. Remove check for unsupported relocation code in switch
10925 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10926 relocation property table to find out size. Change error message to
10927 print out the name of a relocation code instead of the numeric value.
10928 (Target_arm::scan_reloc_for_stub): Use relocation property table
10929 instead of calling Target_arm::reloc_uses_thumb_bit().
10931 2010-02-02 Doug Kwan <dougkwan@google.com>
10933 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10934 types of relaxed input section.
10936 2010-02-02 Doug Kwan <dougkwan@google.com>
10938 * Makefile.am (HFILES): Add arm-reloc-property.h.
10940 (TARGETSOURCES): Add arm-reloc-property.cc
10941 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
10942 (libgold_a_SOURCES): $(DEFFILES)
10943 * Makefile.in: Regenerate.
10944 * arm-reloc-property.cc: New file.
10945 * arm-reloc-property.h: New file.
10946 * arm-reloc.def: New file.
10947 * arm.cc: Update comments.
10948 (arm-reloc-property.h): New included header.
10949 (arm_reloc_property_table): New global variable.
10950 (Target_arm::do_select_as_default_target): New method definition.
10951 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10952 arm-reloc-property to targ_extra_obj.
10953 * parameters.cc (set_parameters_target): Call
10954 Target::select_as_default_target().
10955 * target.h (Target::select_as_default_target): New method definition.
10956 (Target::do_select_as_default_target): Same.
10958 2010-02-01 Doug Kwan <dougkwan@google.com>
10960 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10961 first_output_text_section_.
10962 (Arm_exidx_fixup::first_output_text_section): New method definition.
10963 (Arm_exidx_fixup::first_output_text_section_): New data member.
10964 (Arm_exidx_fixup::process_exidx_section): Record the first text
10965 output section seen.
10966 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10967 and entsize in output section header.
10969 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10971 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10972 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10973 (Arm_relocate_functions::thm_alu11): New Method.
10974 (Arm_relocate_functions::thm_pc8): New Method.
10975 (Arm_relocate_functions::thm_pc12): New Method.
10976 (Target_arm::Scan::local): Handle the relocations.
10977 (Target_arm::Scan::global): Likewise.
10978 (Target_arm::Relocate::relocate): Likewise.
10979 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10981 2010-01-29 Doug Kwan <dougkwan@google.com>
10983 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10984 of relocation types as ld.
10986 2010-01-29 Doug Kwan <dougkwan@google.com>
10988 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10990 (Arm_relocate_functions::thumb_branch_common): Ditto.
10991 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10992 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10993 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10994 Arm_relocate_functions::jump24): Remove.
10995 (Target_arm::Relocate::relocate): Adjust code to call
10996 Arm_relocation_functions::arm_branch_common and
10997 Arm_relocation_functions::thumb_branch_common instead of their removed
10998 wrappers. Merge switch-cases together to reduce source code size.
11000 2010-01-29 Doug Kwan <dougkwan@google.com>
11002 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11003 output_local_symbol_count_needs_update_.
11004 (Arm_relobj::output_local_symbol_count_needs_update,
11005 Arm_relobj::set_output_local_symbol_count_needs_update,
11006 Arm_relobj::update_output_local_symbol_count): New methods.
11007 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11009 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11010 of pointed function as in a R_ARM_PREL31 relocation.
11011 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11012 for output local symbol count updating.
11013 (Target_arm::do_relax): Update output local symbol counts in objects
11015 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11017 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11019 * arm.cc: Added support for the ARM relocations:
11020 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11021 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11022 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11024 (Arm_relocate_functions::movw_rel): New method.
11025 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11026 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11028 (Arm_relocate_functions::thm_movw_rel): New method.
11029 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11031 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11033 (Target_arm::Scan::global): Likewise.
11034 (Target_arm::Relocate::relocate): Likewise.
11035 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11038 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11040 * arm.cc: Added support for ARM group relocations.
11041 (Target_arm::reloc_needs_sym_origin): New method.
11042 (Arm_relocate_functions::calc_grp_kn): New method.
11043 (Arm_relocate_functions::calc_grp_residual): New method.
11044 (Arm_relocate_functions::calc_grp_gn): New method.
11045 (Arm_relocate_functions::arm_grp_alu): New Method.
11046 (Arm_relocate_functions::arm_grp_ldr): New Method.
11047 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11048 (Arm_relocate_functions::arm_grp_ldc): New Method.
11049 (Target_arm::Scan::local): Handle the ARM group relocations.
11050 (Target_arm::Scan::global): Likewise.
11051 (Target_arm::Relocate::relocate): Likewise.
11052 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11055 2010-01-26 Doug Kwan <dougkwan@google.com>
11057 * arm.cc (set): Include.
11058 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11060 (Arm_output_section::Text_section_list): New type.
11061 (Arm_output_section::append_text_sections_to_list): New method.
11062 (Arm_output_section::fix_exidx_coverage): Ditto.
11063 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11064 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11065 Relobj::set_section_offset() instead of
11066 Sized_relobj::invalidate_section_offset().
11067 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11068 parameter for section headers. Ignore relocation sections for
11069 unallocated sections and EXIDX sections.
11070 (Target_arm::fix_exidx_coverage): New method.
11071 (Target_arm::output_section_address_less_than): New type.
11072 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11073 linked text section instead of the EXIDX section.
11074 (Arm_output_section::create_stub_group): Add an assertion to check
11075 that this is not an EXIDX output section.
11076 (Arm_output_section::append_text_sections_to_list): New method.
11077 (Arm_output_section::fix_exidx_coverage): Ditto.
11078 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11079 Arm_relobj::section_needs_reloc_stub_scanning.
11080 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11082 (Target_arm::fix_exidx_coverage): New method.
11083 * object.h (Relobj::set_output_section): New method.
11084 (Sized_relobj::invalidate_section_offset): Remove method.
11085 (Sized_relobj::do_invalidate_section_offset): Remove method.
11086 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11088 2010-01-25 Doug Kwan <dougkwan@google.com>
11090 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11091 Fix warning due to signed and unsigned comparison on a 32-bit host.
11093 2010-01-22 Doug Kwan <dougkwan@google.com>
11095 * arm.cc (Target_arm::do_relax): Record an output section for section
11096 offset adjustment it contains any stub table that has changed.
11097 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11098 offsets in an output section if necessary.
11099 * output.cc (Output_section::Output_section): Initialize
11100 section_offsets_need_adjustments_.
11101 (Output_section::add_input_section_for_script): Renamed to
11102 Output_section::add_simple_input_section.
11103 (Output_section::save_states): Add a comment.
11104 (Output_section::discard_states): New method defintion.
11105 (Output_section::adjust_section_offsets): Same.
11106 * output.h (Output_section::add_input_section_for_script): Renamed to
11107 Output_section::add_simple_input_section.
11108 (Output_section::discard_states): New method declaration.
11109 (Output_section::adjust_section_offsets): Same.
11110 (Output_section::section_offsets_need_adjustment,
11111 Output_section::set_section_offsets_need_adjustment): New method
11113 (Output_section::section_offsets_need_adjustment_): New data member.
11114 * script-sections.cc
11115 (Output_section_element_input::set_section_address): Adjust code for
11116 renaming of Output_section::add_input_section_for_script.
11117 (Orphan_output_section::set_section_address): Same.
11119 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11121 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11122 Fix_v4bx enum values .
11123 * gold/options.h (General_options): New option definitions.
11124 (General_options::fix_v4bx): New method.
11125 (General_options::Fix_v4bx): New enum.
11126 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11127 (General_options::parse_fix_v4bx_interworking): New method.
11129 2010-01-22 Doug Kwan <dougkwan@google.com>
11131 * arm.cc (Arm_exidx_fixup): New class.
11133 2010-01-21 Doug Kwan <dougkwan@google.com>
11135 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11137 (Arm_exidx_section_offset_map): New type.
11139 2010-01-21 Doug Kwan <dougkwan@google.com>
11141 * arm.cc (Arm_exidx_input_section): New class.
11142 (Arm_relobj::exidx_input_section_by_link,
11143 Arm_relobj::exidx_input_section_by_shndx,
11144 Arm_relobj::make_exidx_input_section): New methods.
11145 (read_arm_attributes_section): Remove.
11146 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11147 information about them.
11148 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11151 2010-01-20 Doug Kwan <dougkwan@google.com>
11153 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11154 Input_section_specifier to Section_id.
11155 (Target_arm::new_arm_input_section: Adjust code for change of key
11157 (Target_arm::find_arm_input_section): Ditto.
11158 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11159 (Section_id): Remove.
11160 (Garbage_collection::Section_id_hash): Remove.
11161 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11162 (Section_id): Remove.
11163 (Icf::Section_id_hash): Remove.
11164 * object.h (Section_id, Const_section_id, Section_id_hash,
11165 Const_section_id_hash): New type definitions.
11166 * output.cc (Output_section::add_relaxed_input_section): Change to
11167 use Const_section_id instead of Input_section_specifier as key type.
11168 (Output_section::add_merge_input_section): Ditto.
11169 (Output_section::build_relaxation_map): Change to use Section_id
11170 instead of Input_section_specifier as key type.
11171 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11173 (Output_section::convert_input_sections_to_relaxed_sections): Change
11174 to use Const_section_id instead of Input_section_specifier as key type.
11175 (Output_section::find_merge_section): Ditto.
11176 (Output_section::find_relaxed_input_section): Ditto.
11177 * output.h (Input_section_specifier): Remove class.
11178 (Output_section::Output_section_data_by_input_section_map): Change
11179 key type to Const_section_id.
11180 (Output_section::Output_relaxed_input_section_by_input_section_map):
11182 (Output_section::Relaxation_map): Change key type to Section_id.
11184 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11186 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11187 (class Arm_v4bx_stub): New class.
11188 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11189 (Stub_factory::make_arm_v4bx_stub): New method.
11190 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11191 (Stub_table::empty): Handle v4bx stubs.
11192 (Stub_table::add_arm_v4bx_stub): New method.
11193 (Stub_table::find_arm_v4bx_stub): New method.
11194 (Arm_relocate_functions::v4bx): New method.
11195 (Target_arm::fix_v4bx): New method.
11196 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11197 (Stub_table::relocate_stubs): Likewise.
11198 (Stub_table::do_write): Likewise.
11199 (Stub_table::update_data_size_and_addralign): Likewise.
11200 (Stub_table::finalize_stubs): Likewise.
11201 (Target_arm::Scan::local): Likewise.
11202 (Target_arm::Scan::global): Likewise.
11203 (Target_arm::do_finalize_sections): Likewise.
11204 (Target_arm::Relocate::relocate): Likewise.
11205 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11207 (Target_arm::scan_reloc_for_stub): Likewise.
11208 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11210 2010-01-19 Ian Lance Taylor <iant@google.com>
11212 * output.cc (Output_section_headers::do_sized_write): Write large
11213 segment count to sh_info field.
11214 (Output_file_header::do_sized_write): For large segment count,
11215 write PN_XNUM to e_phnum field.
11217 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11219 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11220 (Arm_relocate_functions::thm_jump8): New function.
11221 (Arm_relocate_functions::thm_jump11): New function.
11222 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11224 (Target_arm::Scan::global): Likewise.
11225 (Target_arm::Relocate::relocate): Likewise.
11226 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11229 2010-01-14 Doug Kwan <dougkwan@google.com>
11231 * arm.cc (map, utility): Include headers.
11232 (Target_arm::apply_cortex_a8_workaround): New method.
11233 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11234 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11235 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11236 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11237 the --[no-]fix-cortex-a8 command line options.
11238 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11239 (Target_arm::relocate_stub): Use addend in instruction template.
11240 * options.h (DEFINE_bool): Set the user-set flag.
11241 (General_options): Add --[no-]-fix-cortex options.
11242 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11243 : Update fast look-up map after conversion.
11245 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11247 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11248 in the first pass of do_layout.
11250 2010-01-13 Doug Kwan <dougkwan@google.com>
11252 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11253 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11254 apparent compiler problem of not folding static constant integral
11255 data members of elfcpp::Elf_sizes<32>.
11257 2010-01-13 Doug Kwan <dougkwan@google.com>
11259 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11260 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11261 Arm_relobj::scan_section_for_cortex_a8_erratum,
11262 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11263 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11264 sections to scan for relocation stubs into a new method
11265 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11266 relocation and Cortex-A8 stub scanning.
11267 (Target_arm::do_relax): Force stubs to be after stubbed sections
11268 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11269 the beginning of a new relaxation pass. Update a comment.
11270 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11272 2010-01-12 Ian Lance Taylor <iant@google.com>
11274 * target-reloc.h (visibility_error): New inline function.
11275 (relocate_section): Call visibility_error.
11276 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11277 (MOSTLYCLEANFILES): Likewise.
11278 (protected_4_pic.o, protected_3.err): New targets.
11279 * testsuite/protected_4.cc: New file.
11281 2010-01-12 Doug Kwan <dougkwan@google.com>
11283 * arm.cc (Cortex_a8_reloc): New class.
11284 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11285 and cortex_a8_relocs_info_.
11286 (Target_arm::fix_cortex_a8): New method definition.
11287 (Target_arm::Cortex_a8_relocs_info): New type.
11288 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11289 New data member declarations.
11290 (Target_arm::scan_reloc_for_stub): Record information about
11291 relocations for THUMB branches that might be exempted from the
11292 Cortex-A8 workaround.
11293 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11294 at the beginning of a relaxation pass.
11296 2010-01-12 Doug Kwan <dougkwan@google.com>
11298 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11299 (Arm_relobj::Mapping_symbol_position,
11300 Arm_reloj::Mapping_symbol_position_less,
11301 Arm_relobj::Mapping_symbols_info): New types.
11302 (Target_arm::is_mapping_symbol_name): New method definition.
11303 (Arm_relobj::do_count_local_symbols): Save information about mapping
11306 2010-01-11 Doug Kwan <dougkwan@google.com>
11308 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11309 Arm_relocate_functions::thumb32_branch_upper,
11310 Arm_relocate_functions::thumb32_branch_lower,
11311 Arm_relocate_functions::thumb32_cond_branch_offset,
11312 Arm_relocate_functions::thumb32_cond_branch_upper,
11313 Arm_relocate_functions::thumb32_cond_branch_lower,
11314 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11315 branch offset encoding.
11316 (Arm_relocate_functions::thumb_branch_common): Use new branch
11317 offset encoding methods to avoid code duplication.
11318 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11319 (Stub_addend_reader::operator()): Use new branch encoding method
11320 to avoid code duplication.
11322 2010-01-11 Doug Kwan <dougkwan@google.com>
11324 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11325 (Target_arm::do_finalize_sections): Define special EXIDX section
11326 symbols only if referenced.
11327 * gc.h (Garbage_collection::add_reference): New method.
11328 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11331 2010-01-11 Ian Lance Taylor <iant@google.com>
11333 * script.cc (Version_script_info::build_expression_list_lookup):
11334 Change complaing about duplicate wildcard match from error to
11337 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11339 (Version_script_info::Version_script_info): Initialize globs_,
11340 default_version_, default_is_global_, and exact_. Don't
11341 initialize globals_ or locals_.
11342 (Version_script_info::build_lookup_tables): Build local symbols
11344 (Version_script_info::unquote): New function.
11345 (Version_script_info::add_exact_match): New function.
11346 (Version_script_info::build_expression_list_lookup): Remove lookup
11347 parameter. Add is_global parameter. Change all callers. Handle
11348 wildcard pattern specially. Unquote pattern. Call
11350 (Version_script_info::get_name_to_match): New function.
11351 (Version_script_info::get_symbol_version): New function.
11352 (Version_script_info::get_symbol_version_helper): Remove.
11353 (Version_script_info::check_unmatched_names): Call unquote.
11354 * script.h (class Version_script_info): Change get_symbol_version
11355 to be non-inline and add is_global parameter; change all callers.
11356 Rewrite symbol_is_local. Update declarations. Define struct
11357 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11358 Remove globals_ and locals_ members. Add exact_, globs_,
11359 default_version_, is_global_.
11360 (Version_script_info::Glob): Remove pattern, add expression and
11361 is_global. Update constructor. Change all callers.
11362 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11364 (Versions::symbol_section_contents): If a symbol is undefined, or
11365 defined in a dynamic object, set the version index to
11367 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11369 (Symbol_table::add_from_pluginobj): Likewise.
11370 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11372 2010-01-11 Doug Kwan <dougkwan@google.com>
11374 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11375 (incremental_dump_LDADD): Add linking option for libintl.
11376 * Makefile.in: Regenerate.
11378 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11381 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11383 * testsuite/Makefile.in: Regenerated.
11385 2010-01-10 Doug Kwan <dougkwan@google.com>
11387 * options.h (DEFINE_var): Use parentheses around argument varname__
11388 in macro body to avoid any unintended subsequent substitutions.
11390 2010-01-10 Ian Lance Taylor <iant@google.com>
11392 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11393 candidates before doing symbol resolution.
11395 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11396 ODR candidates if only one is weak.
11398 2010-01-08 Ian Lance Taylor <iant@google.com>
11400 * script.cc (Version_script_info::build_expression_list_lookup):
11401 Don't warn about ambiguous version, just record the ambiguity.
11402 (Version_script_info::get_symbol_version_helper): Give error if
11403 version is ambiguous.
11405 2010-01-08 Doug Kwan <dougkwan@google.com>
11407 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11408 prev_data_size_ and prev_addralign_. Remove initializer for
11409 deleted data member has_been_changed_.
11410 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11411 to determine if the table is empty.
11412 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11414 (Stub_table::add_reloc_stub): Define method in class definition
11415 instead of just declaring it there.
11416 (Stub_table::add_cortex_a8_stub): New method definition.
11417 (Stub_table::update_data_size_and_addralign): Ditto.
11418 (Stub_table::finalize_stubs): Ditto.
11419 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11420 (Stub_table::do_addralign_): Return address alignment in the
11421 (Stub_table::do_reset_address_and_file_offset): Define method in
11422 class definition instead of declaring it there. Set current data
11423 size to be the data size of the previous pass.
11424 (Stub_table::set_final_data_size): Use current data size as the
11426 (Stub_table::relocate_stub): Change parameter type of stub from
11427 Reloc_stub pointer to Stub pointer.
11428 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11429 (Stub_table::Cortex_a8_stub_list): New typedef.
11430 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11431 Stub_table::prev_addralign_): New data member.
11432 (Arm_relobj::Arm_relobj): Initialize data member
11433 section_has_cortex_a8_workaround_.
11434 (Arm_relobj::section_has_cortex_a8_workaround,
11435 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11437 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11439 (Target_arm::relocate_stub): Change parameter type of stub from
11440 Reloc_stub pointer to Stub pointer.
11441 (Insn_template::size, Insn_template::alignment): Handle
11442 THUMB16_SPECIAL_TYPE.
11443 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11444 Stub_table::update_data_size_and_addralign,
11445 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11447 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11448 (Stub_table::do_write): Ditto.
11449 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11451 2010-01-08 Ian Lance Taylor <iant@google.com>
11454 * symtab.h (class Symbol): Remove fields is_target_special_ and
11455 has_plt_offset_. Add field is_defined_in_discarded_section_.
11456 (Symbol::is_defined_in_discarded_section): New function.
11457 (Symbol::set_is_defined_in_discarded_section): New function.
11458 (Symbol::has_plt_offset): Rewrite.
11459 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11460 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11461 Don't initialize is_target_special_ or has_plt_offset_.
11462 Initialize is_defined_in_discarded_section_.
11463 (Symbol_table::add_from_relobj): If appropriate, set
11464 is_defined_in_discarded_section.
11465 * resolve.cc (Symbol::override_base_with_special): Don't test
11466 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11467 * target-reloc.h (relocate_section): Do special handling for
11468 symbols defined in discarded sections for global symbols as well
11471 2010-01-08 Ian Lance Taylor <iant@google.com>
11473 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11474 the SHT_SYMTAB case.
11476 2010-01-08 Ian Lance Taylor <iant@google.com>
11478 * object.cc (Sized_relobj::do_layout): Don't get confused if
11479 layout_eh_frame returns NULL.
11481 2010-01-08 Ian Lance Taylor <iant@google.com>
11484 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11485 dynamic symbol table, use the normal symbol table.
11486 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11489 2010-01-08 Ian Lance Taylor <iant@google.com>
11492 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11495 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11497 * version.cc (print_version): Change to "Copyright 2010".
11499 2010-01-08 Ian Lance Taylor <iant@google.com>
11503 * i386.cc (class Target_i386): Change return type of plt_section
11505 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11506 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11507 tls_desc_rel_ field.
11508 (Output_data_plt_i386::rel_tls_desc): New function.
11509 (Target_i386::rel_tls_desc_section): New function.
11510 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11511 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11512 R_386_TLS_DESC reloc in rel_tls_desc_section.
11513 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11514 Define struct Tlsdesc_info.
11515 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11516 (Target_x86_64::do_reloc_symbol_index): New function.
11517 (Target_x86_64::add_tlsdesc_info): New function.
11518 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11519 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11520 tlsdesc_rel_ field.
11521 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11523 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11524 (Target_x86_64::rela_tlsdesc_section): New function.
11525 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11527 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11528 (Target_x86_64::do_reloc_addend): New function.
11529 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11530 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11531 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11532 (Output_reloc::type): New function.
11533 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11534 (Output_reloc::is_target_specific): New function.
11535 (Output_reloc::target_arg): New function.
11536 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11537 absolute relocs and target specific relocs.
11538 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11539 add_target_specific.
11540 (class Output_data_reloc) [SHT_RELA]: Likewise.
11541 * output.cc (Output_reloc::Output_reloc): Add four new versions
11542 for absolute relocs and target specific relocs.
11543 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11544 (Output_reloc::get_symbol_index): Likewise.
11545 (Output_reloc::local_section_offset): Check that local_sym_index_
11546 is not TARGET_CODE or 0.
11547 (Output_reloc::symbol_value): Likewise.
11548 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11550 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11551 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11553 * layout.cc (add_target_dynamic_tags): Use output section for
11554 DT_PLTRELSZ and DT_JMPREL.
11556 2010-01-07 Ian Lance Taylor <iant@google.com>
11559 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11561 (class Output_data_reloc_generic): Define.
11562 (class Output_data_reloc_base): Change base class to
11563 Output_data_reloc_generic. Change add() method to call
11564 bump_relative_reloc_count for a relative reloc. Remove
11565 sort_relocs_ field.
11566 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11568 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11569 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11571 * layout.h (class Layout): Update declaration.
11573 2010-01-07 Ian Lance Taylor <iant@google.com>
11575 * output.h (class Output_data): Add const version of
11576 output_section and do_output_section.
11577 (class Output_section_data): Add const version of
11579 (class Output_section): Likewise.
11580 * layout.cc (Layout::add_target_dynamic_tags): New function.
11581 * layout.h (class Layout): Update declarations.
11582 * arm.cc (Target_arm::do_finalize_sections): Use
11583 add_target_dynamic_tags.
11584 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11585 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11586 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11587 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11589 2010-01-07 Ian Lance Taylor <iant@google.com>
11592 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11595 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11596 Ian Lance Taylor <iant@google.com>
11599 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11600 Xindex::read_symtab_xindex.
11602 2010-01-07 Doug Kwan <dougkwan@google.com>
11604 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11605 (Insn_template::thumb16_bcond_insn): New method declaration.
11606 (Insn_template): Fix spelling.
11607 (Stub::thumb16_special): New method declaration.
11608 (Stub::do_write): Define virtual method which was previously pure
11610 (Stub::do_thumb16_special): New method declaration.
11611 (Stub::do_fixed_endian_write): New template member.
11612 (Reloc_stub::do_write): Remove.
11613 (Reloc_stub::do_fixed_endian_write): Remove.
11614 (Cortex_a8_stub): New class definition.
11615 (Stub_factory::make_cortex_a8_stub): New method definition.
11616 (Stub_factory::Stub_factory): Add missing static storage class
11617 qualifier for elf32_arm_stub_a8_veneer_blx.
11619 2010-01-07 Ian Lance Taylor <iant@google.com>
11622 * options.h (class General_options): Add --warn-unresolved-symbols
11623 and --error-unresolved-symbols.
11624 * errors.cc (Errors::undefined_symbol): Implement
11625 --warn-unresolved-symbols.
11627 * options.h (class General_options): Add -z text and -z textoff.
11628 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11630 2010-01-06 Sriraman Tallam <tmsriram@google.com>
11632 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11633 (Garbage_collection::cident_sections): New function.
11634 (Garbage_collection::add_cident_section): New function.
11635 (Garbage_collection::cident_sections_): New member.
11636 (gc_process_relocs): Add references to sections whose names are C
11638 * gold.h (cident_section_start_prefix): New constant.
11639 (cident_section_stop_prefix): New constant.
11640 (is_cident): New function.
11641 * layout.cc (Layout::define_section_symbols): Replace string constants
11642 with the newly defined constants.
11643 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11645 * testsuite/Makefile.am: Add gc_orphan_section_test.
11646 * testsuite/Makefile.in: Regenerate.
11647 * testsuite/gc_orphan_section_test.cc: New file.
11648 * testsuite/gc_orphan_section_test.sh: New file.
11650 2010-01-06 Ian Lance Taylor <iant@google.com>
11653 * options.h (class General_options): Add --warn-shared-textrel.
11654 * layout.cc (Layout::finish_dynamic_section): Implement
11655 --warn-shared-textrel.
11658 * options.h (class General_options): Add --warn-multiple-gp.
11660 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11662 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11663 $(THREADSLIB) and $(LIBDL).
11664 * Makefile.in: Rebuild.
11666 2010-01-06 Ian Lance Taylor <iant@google.com>
11669 * options.cc (General_options::parse_section_start): New function.
11670 (General_options::section_start): New function.
11671 (General_options::General_options): Initialize all members.
11672 * options.h: Include <map>
11673 (class General_options): Add --section-start. Add section_starts_
11675 * layout.cc (Layout::attach_allocated_section_to_segment): If
11676 --section-start was used, set the address of the segment. Remove
11677 local sort_sections.
11678 (Layout::relaxation_loop_body): If the address of the load segment
11679 has been set by --section-start, don't use it.
11680 * output.h (Output_segment::update_flags_for_output_section): New
11682 * output.cc (Output_segment::add_output_section): Call
11683 update_flags_for_output_section.
11685 2010-01-05 Ian Lance Taylor <iant@google.com>
11688 * options.h (class General_options): Add --undefined-version.
11689 * script.cc (struct Version_expression): Add was_matched_by_symbol
11691 (Version_script_info::matched_symbol): New function.
11692 (Version_script_info::get_symbol_version_helper): Call
11694 (Version_script_info::check_unmatched_names): New function.
11695 * script.h (class Version_script_info): Update declarations.
11696 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11698 * options.h (class General_options): Use DEFINE_bool_alias for
11699 allow_multiple_definition.
11700 * resolve.cc (Symbol_table::should_override): Don't test
11701 allow_multiple_definition.
11704 * options.h (class General_options): Add --cref.
11705 * main.cc (main): Print cref table if --cref. Don't close mapfile
11706 until after printing cref table.
11707 * cref.cc: Include "symtab.h".
11708 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11709 (Cref_table_compare::operator()): New function.
11710 (Cref_inputs::gather_cref): New function.
11711 (filecol): New static const.
11712 (Cref_inputs::print_cref): New function.
11713 (Cref::print_cref): New function.
11714 * cref.h: Include <cstdio>.
11715 (class Cref): Update declarations.
11716 * mapfile.h (Mapfile::file): New function.
11717 * object.h (class Object): Define Symbols. Declare virtual
11718 do_get_global_symbols.
11719 (Object::get_global_symbols): New function.
11720 * object.cc (Input_objects::add_object): Pass object to cref_ if
11722 (Input_objects::archive_start): Likewise.
11723 (Input_objects::archive_stop): Likewise.
11724 (Input_objects::print_cref): New function.
11725 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11726 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11728 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11730 * plugin.h (class Sized_pluginobj): Update declarations.
11732 2010-01-05 Ian Lance Taylor <iant@google.com>
11734 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11735 to is_default_version. Rename insdef to insdefault.
11736 (Symbol_table::add_from_relobj): Rename def to is_default_version
11737 and local to is_forced_local.
11738 (Symbol_table::add_from_pluginobj): Likewise.
11739 (Symbol_table::add_from_dynobj): Likewise.
11740 (Symbol_table::define_special_symbol): Rename insdef to
11743 2010-01-04 Ian Lance Taylor <iant@google.com>
11746 * options.h (class General_options): Add
11747 --allow-multiple-definition and -z muldefs.
11748 * resolve.cc (Symbol_table::should_override): Don't warn about a
11749 multiple symbol definition if --allow-multiple-definition or -z
11753 * options.h (class General_options): Add --add-needed and
11754 --copy-dt-needed-entries. Tweak --as-needed help entry.
11755 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11756 error if --copy-dt-needed-entries aka --add-needed is used and
11757 would cause a change in behaviour.
11760 * options.h (class General_options): Add -G as a short version of
11761 --shared. Add no-op options -assert, -g, and -i.
11763 2010-01-04 Sriraman Tallam <tmsriram@google.com>
11765 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11766 check for .text or .gnu.linkonce.t sections.
11767 * icf.cc (Icf::find_identical_sections): Ditto.
11768 Change the detection for mangled function name within the section
11770 * icf.h (is_section_foldable_candidate): New function.
11772 2009-12-30 Ian Lance Taylor <iant@google.com>
11775 * options.h (class General_options): Permit two dashes with
11776 --retain-symbols-file.
11778 2009-12-30 Ian Lance Taylor <iant@google.com>
11781 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11782 don't put the file header and segment headers in the text
11786 * common.cc (Sort_commons::operator()): Stabilize sort when both
11788 (Symbol_table::do_allocate_commons_list): When allocating common
11789 symbols, skip a symbol which is no longer common.
11790 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11791 an object before checking its type.
11792 * testsuite/common_test_2.c: New file.
11793 * testsuite/common_test_3.c: New file.
11794 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11795 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11796 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11797 (common_test_2_pic.o, common_test_2.so): New targets.
11798 (common_test_3_pic.o, common_test_3.so): New targets.
11799 * testsuite/Makefile.in: Rebuild.
11802 * script.cc (read_input_script): If we see a new SECTIONS clause,
11803 and we have added an input section, give an error.
11804 * layout.h (class Layout): Add have_added_input_section function.
11805 Add have_added_input_section_ field.
11806 * layout.cc (Layout::Layout): Initialize
11807 have_added_input_section_.
11808 (Layout::layout): Set have_added_input_section_.
11809 (Layout::layout_eh_frame): Likewise.
11811 2009-12-30 Ian Lance Taylor <iant@google.com>
11814 * options.h (class General_options): Add --sort-common option.
11815 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11816 * common.cc (Sort_common): Add sort_order parameter to
11817 constructor. Add sort_order_ field.
11818 (Sort_commons::operator): Check sort_order_.
11819 (Symbol_table::allocate_commons): Determine the sort order.
11820 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11821 Change all callers.
11822 (Symbol_table::do_allocate_commons_list): Likewise.
11824 2009-12-30 Ian Lance Taylor <iant@google.com>
11827 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11828 symbols from this object, don't change the visibility of an
11830 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11832 2009-12-30 Ian Lance Taylor <iant@google.com>
11835 * script.h (class Version_script_info): Define Language enum.
11836 Update declarations. Define Glob, Exact, and Lookup types. Add
11837 new fields globals_, locals_, and is_finalized_.
11838 * script.cc: Various formatting fixes.
11839 (class Parser_closure): Change language_stack_ from a vector of
11840 std::string to one of Version_script_info::Language. Adjust all
11842 (class Lazy_demangler): Remove.
11843 (struct Version_expression): Change language from std::string to
11844 Version_script_info::Language.
11845 (Version_script_info::Version_script_info): New function.
11846 (Version_script_info::~Version_script_info): Don't call clear.
11847 (Version_script_info::finalize): New function.
11848 (Version_script_info::build_lookup_tables): New function.
11849 (Version_script_info::build_expression_list_lookup): New
11851 (Version_script_info::get_symbol_version_helper): Rewrite to use
11853 (Version_script_info::print_expression_list): Adjust to use
11854 Version_script_info::Language.
11855 (script_push_lex_into_version_mode): Check that the version script
11856 has not been finalized.
11857 (version_script_push_lang): Change language string to
11858 Version_script_info::Language.
11859 * options.cc (Command_line::version_script): New function.
11860 * options.h (class General_options): Add finalize_dynamic_list
11861 function. Change version_script from declaration to definition.
11862 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11863 * testsuite/version_script.map: Remove duplicate def of foo.
11864 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11865 version_script.map.
11866 * testsuite/Makefile.in: Rebuild.
11868 2009-12-30 Ian Lance Taylor <iant@google.com>
11871 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11872 if the input symbol index is 0, make the output symbol index 0.
11874 2009-12-30 Ian Lance Taylor <iant@google.com>
11877 * options.h (class General_options): Add -x/--discard-all.
11878 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11879 --discard-all. If the local symbol needs a dynamic entry, check
11880 that before handling --discard-locals.
11882 2009-12-30 Ian Lance Taylor <iant@google.com>
11885 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11887 (Output_segment::add_output_section): Don't change the flags if
11888 the type is PT_TLS.
11891 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11892 GNU hash table if they need a dynamic value. Otherwise, don't add
11893 them if they are defined in a dynamic object or are forced local.
11895 2009-12-29 Ian Lance Taylor <iant@google.com>
11898 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11899 .gnu.hash table for a 32-bit target.
11902 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11903 regular and a dynamic object only needs a dynamic symbol table
11904 entry if it is externally visible.
11907 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11908 constructor. Add global_offset_table_ field.
11909 (Target_i386::got_section): Set global_offset_table_.
11910 (Target_i386::do_finalize_sections): Set global_offset_table_
11912 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11913 in constructor. Add global_offset_table_ field.
11914 (Target_x86_64::got_section): Set global_offset_table_.
11915 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11918 * layout.cc (Layout::Layout): Initialize increase_relro_.
11919 (Layout::get_output_section): Add is_relro, is_last_relro, and
11920 is_first_non_relro parameters. Change all callers.
11921 (Layout::choose_output_section): Likewise.
11922 (Layout::add_output_section_data): Likewise.
11923 (Layout::make_output_section): Likewise.
11924 (Layout::set_segment_offsets): Clear increase_relro when using a
11926 * layout.h (class Layout): Add increase_relro method. Add
11927 increase_relro_ field. Update declarations.
11928 * output.cc (Output_section::Output_section): Initialize
11929 is_last_relro_ and is_first_non_relro_.
11930 (Output_segment::add_output_section): Group relro sections is
11931 do_sort is true. Handle is_last_relro and is_first_non_relro.
11932 (Output_segment::maximum_alignment): Remove relro handling.
11933 (Output_segment::set_section_addresses): Add increase_relro
11934 parameter. Change all callers. Add initial alignment to align
11935 relro sections on separate page. Remove old relro handling.
11936 (Output_segment::set_section_list_addresses): Remove in_relro
11937 parameter. Change all callers.
11938 (Output_segment::set_offset): Add increase parameter. Change all
11939 callers. Remove old relro handling.
11940 * output.h (class Output_section): Add new methods: is_last_relro,
11941 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11942 Add is_last_relro_ and is_first_non_relro_ fields.
11943 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11944 Create separate .got.plt section. Call increase_relro.
11945 * x86_64.cc (Target_x86_64::got_section): Likewise.
11946 * testsuite/relro_script_test.t: Add .got.plt.
11949 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11950 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11951 (Layout::finalize): Call set_dynamic_symbol_size.
11952 (Layout::set_dynamic_symbol_size): New function.
11953 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11954 set_dynamic_symbol_size.
11957 * output.h (class Output_section): Add is_entsize_zero_ field.
11958 * output.cc (Output_section::Output_section): Initialize
11960 (Output_section::set_entsize): If two different entsizes are
11961 requested, force it to zero.
11962 (Output_section::add_input_section): Set flags for .debug_str
11963 before updating section flags. Set entsize.
11964 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11965 and SHF_STRING if all input sections have those flags.
11967 2009-12-29 Rafael Espindola <espindola@google.com>
11969 * main.cc (main): Fix the sys time reporting.
11970 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11973 2009-12-29 Sriraman Tallam <tmsriram@google.com>
11975 * options.cc (General_options::parse_version): Allow -v to exit
11976 without an error if there is nothing to link.
11978 2009-12-29 Ian Lance Taylor <iant@google.com>
11980 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11981 using a version of gcc before 4.1.
11982 * configure: Rebuild.
11984 2009-12-28 Chris Demetriou <cgd@google.com>
11986 * attributes.cc (Output_attributes_section_data::do_write): Use
11987 std::vector::front rather than std::vector::data.
11989 2009-12-28 Ian Lance Taylor <iant@google.com>
11991 * symtab.h (class Symbol_table): Add enum Defined.
11992 * resolve.cc (Symbol_table::should_override): Add defined
11993 parameter. Change all callers. Test whether object is NULL
11994 before calling a method on it.
11995 (Symbol_table::report_resolve_problem): Add defined parameter.
11996 Change all callers.
11997 (Symbol_table::should_override_with_special): Likewise.
11998 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11999 parameter. Change all callers.
12000 (Symbol_table::do_define_in_output_data): Likewise.
12001 (Symbol_table::define_in_output_segment): Likewise.
12002 (Symbol_table::do_define_in_output_segment): Likewise.
12003 (Symbol_table::define_as_constant): Likewise.
12004 (Symbol_table::do_define_as_constant): Likewise.
12005 * script.h (class Symbol_assignment): Add is_defsym parameter to
12006 constructor; change all callers.
12007 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12008 parameter. Change all callers. Add is_defsym_ field.
12009 (class Parser_closure): Add parsing_defsym parameter to
12010 constructor; change all callers. Add parsing_defsym accessor
12011 function. Add parsing_defsym_ field.
12013 2009-12-28 Ian Lance Taylor <iant@google.com>
12015 * gold.cc (queue_middle_tasks): Fix formatting.
12016 * object.cc (Relobj::is_section_name_included): Likewise.
12018 2009-12-23 Ian Lance Taylor <iant@google.com>
12020 * i386.cc (Target_i386::do_calls_non_split): Recognize
12021 -fsplit-stack prologue for a function with a static chain.
12022 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12023 -fsplit-stack prologue when using %r11.
12025 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12027 * options.cc (General_options::parse_version): Make -v continue and do
12028 the link like GNU ld does.
12030 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12032 * Makefile.am (CCFILES): Add timer.cc.
12033 (HFILES): Add timer.h.
12034 * configure.ac: Check for sysconf and times.
12035 * main.cc: include timer.h.
12036 (main): Use Timer instead of get_run_time.
12039 * workqueue.cc: include timer.h.
12040 (Workqueue::find_and_run_task):
12041 Report user, sys and wall time.
12042 * Makefile.in: Regenerate.
12043 * config.in: Regenerate.
12044 * configure: Regenerate.
12046 2009-12-16 Doug Kwan <dougkwan@google.com>
12048 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12050 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12051 relaxed input sections.
12052 * output.cc (Output_section::find_relaxed_input_section): Change
12053 return type to Output_relaxed_input_section pointer. Adjust code
12054 for new type of relaxed_input_section_map_.
12055 * output.h (Output_section::find_relaxed_input_section): Change
12056 return type to Output_relaxed_input_section pointer.
12057 (Output_section::Output_relaxed_input_section_by_input_section_map):
12059 (Output_section::relaxed_input_section_map_): Change type to
12060 Output_section::Output_relaxed_input_section_by_input_section_map.
12061 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12064 2009-12-15 Ian Lance Taylor <iant@google.com>
12066 * layout.cc (Layout::create_shstrtab): Only write out after input
12067 sections if we are compressing debug sections.
12069 2009-12-15 Ian Lance Taylor <iant@google.com>
12071 * archive.cc (Archive::add_symbols): Only look up a symbol without
12072 a version if there is, in fact, a version.
12074 2009-12-14 Ian Lance Taylor <iant@google.com>
12076 Revert -Wshadow changes, all changes from:
12077 2009-12-11 Doug Kwan <dougkwan@google.com>
12078 2009-12-11 Nick Clifton <nickc@redhat.com>
12079 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12081 2009-12-11 Doug Kwan <dougkwan@google.com>
12083 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12085 * attributes.cc (Object_attribute::size): Ditto.
12086 (Attributes_section_data::size): Ditto.
12087 (Attributes_section_data::Attributes_section_data): Ditto.
12088 (Output_attributes_section_data::do_write): Ditto.
12089 * attributes.h (Object_attribute::set_type): Ditto.
12090 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12092 2009-12-11 Nick Clifton <nickc@redhat.com>
12094 * archive.cc: Fix shadowed variable warnings.
12095 * arm.cc: Likewise.
12096 * compressed_output.cc: Likewise.
12097 * compressed_output.h: Likewise.
12098 * configure: Likewise.
12099 * dwarf_reader.cc: Likewise.
12100 * dynobj.cc: Likewise.
12101 * dynobj.h: Likewise.
12102 * ehframe.cc: Likewise.
12103 * ehframe.h: Likewise.
12104 * errors.cc: Likewise.
12105 * expression.cc: Likewise.
12106 * fileread.cc: Likewise.
12107 * fileread.h: Likewise.
12108 * freebsd.h: Likewise.
12109 * i386.cc: Likewise.
12110 * icf.cc: Likewise.
12111 * incremental.h: Likewise.
12112 * layout.cc: Likewise.
12113 * layout.h: Likewise.
12114 * mapfile.cc: Likewise.
12115 * merge.cc: Likewise.
12116 * merge.h: Likewise.
12117 * object.cc: Likewise.
12118 * object.h: Likewise.
12119 * options.h: Likewise.
12120 * output.cc: Likewise.
12121 * output.h: Likewise.
12122 * parameters.cc: Likewise.
12123 * plugin.cc: Likewise.
12124 * powerpc.cc: Likewise.
12125 * reduced_debug_output.cc: Likewise.
12126 * reduced_debug_output.h: Likewise.
12127 * reloc.cc: Likewise.
12128 * reloc.h: Likewise.
12129 * resolve.cc: Likewise.
12130 * script-sections.cc: Likewise.
12131 * script.cc: Likewise.
12132 * script.h: Likewise.
12133 * sparc.cc: Likewise.
12134 * symtab.cc: Likewise.
12135 * symtab.h: Likewise.
12136 * target-select.cc: Likewise.
12137 * target-select.h: Likewise.
12138 * token.h: Likewise.
12139 * workqueue.cc: Likewise.
12140 * workqueue.h: Likewise.
12141 * x86_64.cc: Likewise.
12143 2009-12-10 Doug Kwan <dougkwan@google.com>
12145 * arm.cc (attributes.h): New include.
12146 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12147 (Arm_relobj::~Arm_relobj): Delete object pointed by
12148 attributes_section_data_.
12149 (Arm_relobj::attributes_section_data): New method definition.
12150 (Arm_relobj::attributes_section_data_): New data member declaration.
12151 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12152 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12153 attributes_section_data_.
12154 (Arm_dynobj::attributes_section_data): New method definition.
12155 (Arm_dynobj::attributes_section_data_): New data member declaration.
12156 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12157 initialization value of may_use_blx_ to false.
12158 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12159 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12160 object attributes to compute results instead of hard-coding.
12161 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12162 Target_arm::get_secondary_compatible_arch,
12163 Target_arm::set_secondary_compatible_arch
12164 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12165 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12166 New method declarations.
12167 (Target_arm::get_aeabi_object_attribute): New method definition.
12168 (Target_arm::attributes_section_data_): New data member declaration.
12169 (read_arm_attributes_section): New template definition.
12170 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12171 (Arm_dynobj::do_read_symbols): Ditto.
12172 (Target_arm::do_finalize_sections): Merge attributes sections from
12173 input. Check for BLX use after attributes section merging.
12174 Fix __exidx_start and __exidx_end visibility. Create an
12175 .ARM.attributes section if necessary.
12176 (Target_arm::get_secondary_compatible_arch,
12177 Target_arm::set_secondary_compatible_arch,
12178 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12179 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12180 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12181 New method definitions.
12183 2009-12-09 Ian Lance Taylor <iant@google.com>
12185 * plugin.cc (Plugin::load): Don't cast from void* to a function
12188 2009-12-09 Ian Lance Taylor <iant@google.com>
12190 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12191 information fields.
12193 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12195 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12196 Replace two_file_shared_1.so with two_file_shared_2.so.
12197 * testsuite/Makefile.in: Regenerated.
12199 2009-12-08 Doug Kwan <dougkwan@google.com>
12201 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12202 (HFILES): Add attributes.h and int_encoding.h.
12203 * Makefile.in: Regenerate.
12204 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12205 function definitions to int_encoding.cc
12206 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12207 prototypes to int_encoding.h
12208 * reduced_debug_output.cc (int_encoding.h): New include.
12209 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12210 function definitions to int_encoding.cc
12211 (insert_into_vector, read_from_pointer): Move template definitions to
12213 * attributes.cc: New file.
12214 * attributes.h: New file.
12215 * int_encoding.cc: New file.
12216 * int_encoding.h: New file.
12218 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12221 * incremental-dump.cc (dump_incremental_inputs): New.
12222 (main): Use dump_incremental_inputs.
12224 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12227 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12228 checking elfcpp::STT_FUNC.
12229 (Target_i386::Relocate::relocate): Likewise.
12230 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12232 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12233 symbols from shared libraries into normal FUNC symbols.
12235 * symtab.h (Symbol): Add is_func and use it.
12237 2009-12-05 Doug Kwan <dougkwan@google.com>
12239 * arm.cc (Target_arm::arm_info): Initialize new fields
12240 attributes_section and attributes_vendor.
12241 * i386.cc (Target_i386::i386_info): Same.
12242 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12243 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12244 fields attributes_section and attributes_vendor.
12245 * sparc.cc (Target_sparc::sparc_info): Same.
12246 * target.h (Target::attributes_section, Target::attributes_vendor,
12247 Target::is_attributes_section, Target::attribute_arg_type,
12248 Target::attributes_order): New method definitions.
12249 (Target::Target_info::attributes_section,
12250 Target::Target_info::attributes_vendor): New fields.
12251 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12252 virtual method definitions.
12253 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12254 attributes_section and attributes_vendor.
12255 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12257 2009-12-05 Doug Kwan <dougkwan@google.com>
12259 * arm.cc: Update comments about interworking and stub generation.
12260 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12261 considered as non-PIC.
12262 (Arm_relocate_functions::base_abs): Fix formatting.
12263 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12264 of function to use GOT entry address instead of offset.
12265 (Target_arm::Scan::global): Issue an error if a symbol would need a
12266 PLT does not get one because it is untyped. Remove code to create
12267 dynamic symbols for relative branches.
12268 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12269 takes unsigned integer instead of boolean.
12271 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12273 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12274 (two_file_test_LDADD): Likewise.
12275 (common_test_1_LDADD): Likewise.
12276 (exception_test_LDADD) Likewise.
12277 (weak_test_LDADD): Likewise.
12278 (many_sections_test_LDADD): Likewise.
12279 (initpri1_LDADD): Likewise.
12280 (script_test_1_LDADD): Likewise.
12281 (script_test_2_LDADD): Likewise.
12282 (justsyms_LDADD): Likewise.
12283 (binary_test_LDADD): Likewise.
12284 (large_LDADD): Likewise.
12285 * testsuite/Makefile.in: Regenerated.
12287 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12289 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12290 (Symbol_table::override_with_special): Likewise.
12291 (Symbol_table::add_from_object): Likewise.
12293 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12295 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12296 Don't set the data_offset twice.
12298 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12300 * testsuite/Makefile.in: Regenerate.
12302 2009-12-03 Doug Kwan <dougkwan@google.com>
12304 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12305 (Target_arm::do_finalize_sections): Add parameter for symbol table
12306 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12307 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12308 parameter for symbol table pointer.
12309 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12310 an additional parameter for a pointer to symbol table.
12311 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12312 parameter for a symbol table pointer.
12313 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12314 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12316 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12317 parameter for a symbol table pointer.
12319 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12321 * incremental.cc (Incremental_inputs_header)
12322 (Incremental_inputs_header_write, Incremental_inputs_entry)
12323 (Incremental_inputs_entry_write): Move ...
12324 * incremental.h (Incremental_inputs_header)
12325 (Incremental_inputs_header_write, Incremental_inputs_entry)
12326 (Incremental_inputs_entry_write): here.
12328 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12330 * incremental.cc (make_sized_incremental_binary): Set the target.
12331 Error if it is incompatible.
12332 * output.h (Output_file): Add filename method.
12334 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12336 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12337 from the get_* methods.
12339 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12341 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12342 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12343 Write 0 for the data_offset of scripts.
12345 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12347 * testsuite/Makefile.am: Add the incremental_test.sh test.
12348 * testsuite/incremental_test.sh: New.
12349 * testsuite/incremental_test_1.c: New.
12350 * testsuite/incremental_test_2.c: New.
12352 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12354 * incremental-dump.cc (main): Fix typos.
12356 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12359 * incremental-dump.cc (main): Use llu to print 64 bit values.
12361 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12362 H.J. Lu <hongjiu.lu@intel.com>
12364 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12366 (incremental_dump_LDADD): Likewise.
12367 * Makefile.in: Regenerated.
12369 2009-11-25 Doug Kwan <dougkwan@google.com>
12373 2009-11-25 Doug Kwan <dougkwan@google.com>
12375 * arm.cc (Target_arm::Target_arm): Move method definition
12376 outside of class definition. Add code to handle
12377 --target1-rel, --target1-abs and --target2= options.
12378 (Target_arm::get_reloc_reloc_type): Change method to be
12379 non-static and const.
12380 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12381 New data member declaration.
12382 (Target_arm::Scan::local, Target_arm::Scan::global,
12383 Target_arm::Relocate::relocate,
12384 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12385 Adjust call to Target_arm::get_real_reloc_type.
12386 (Target_arm::get_real_reloc_type): Use command line options
12387 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12388 * options.h (--target1-rel, --target1-abs, --target2): New
12391 2009-11-25 Doug Kwan <dougkwan@google.com>
12393 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12394 class definition. Add code to handle --target1-rel, --target1-abs
12395 and --target2= options.
12396 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12398 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12399 member declaration.
12400 (Target_arm::Scan::local, Target_arm::Scan::global,
12401 Target_arm::Relocate::relocate,
12402 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12403 call to Target_arm::get_real_reloc_type.
12404 (Target_arm::get_real_reloc_type): Use command line options to
12405 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12406 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12409 2009-11-25 Doug Kwan <dougkwan@google.com>
12411 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12412 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12413 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12415 (Arm_relocate_functions::thm_call): Replace body with a call to
12416 Arm_relocate_functions::thumb_branch_common.
12417 (Arm_relocate_functions::thm_jump24,
12418 Arm_relocate_functions::thm_xpc22): New method definitions.
12419 (Arm_relocate_functions::thumb_branch_common): New method definition.
12420 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12422 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12423 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12425 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12427 * Makefile.am: Build incremental-dump
12428 * Makefile.in: Regenerate.
12429 * incremental-dump.cc: New.
12430 * incremental.cc (Incremental_inputs_header_data,
12431 Incremental_inputs_entry_data): Move to incremental.h
12432 * incremental.h: (Incremental_inputs_header_data,
12433 Incremental_inputs_entry_data): Move from incremental.cc
12435 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12437 * incremental.cc (Incremental_inputs_header,
12438 Incremental_inputs_header_write, Incremental_inputs_entry,
12439 Incremental_inputs_entry_write): Add a typedef with the data type.
12441 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12443 * incremental.cc (Incremental_inputs_header,
12444 Incremental_inputs_header_write, Incremental_inputs_entry,
12445 Incremental_inputs_entry_write): Update comment about which
12446 type has the filed descriptions.
12448 2009-11-15 Doug Kwan <dougkwan@google.com>
12450 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12451 (Arm_relocate_functions::arm_branch_common): Change method defintion
12452 in class definition to a method declaration and update list of formal
12454 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12455 Arm_relocation_functions::jump24): Adjust call to
12456 Arm_relocate_functions::arm_branch_common. Update list of formal
12458 (Arm_relocate_functions::xpc25): New method definition.
12459 (Arm_relocate_functions::arm_branch_common): Move method defintion
12460 out from class definition. Use stubs for mode-switching and extending
12462 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12463 specially. Change code to enable use of stubs in ARM branches.
12465 2009-11-10 Doug Kwan <dougkwan@google.com>
12467 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12468 in method declaration.
12469 (Target_arm::relocate_stub): New method declaration.
12470 (Target_arm::default_target): Change to return a pointer instead of
12472 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12473 Target_arm::default_target.
12474 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12476 (Target_arm::relocate_section): Adjust view.
12477 (Target_arm::relocate_stub): New method definition.
12479 2009-11-10 Doug Kwan <dougkwan@google.com>
12481 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12483 * incremental.cc (open_incremental_binary): Initialized local
12484 variables to avoid warnings.
12485 * object.cc (make_elf_object): Ditto.
12486 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12489 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12492 * testsuite/plugin_test.c: Include "config.h".
12494 2009-11-09 Doug Kwan <dougkwan@google.com>
12496 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12497 (arm_symbol_value): Remove.
12498 (Arm_relocate_functions::arm_branch_common,
12499 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12500 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12501 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12502 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12503 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12504 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12505 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12506 Arm_relocate_functions::thm_mobw_abs_nc,
12507 Arm_relocate_functions::thm_mov_abs,
12508 Arm_relocate_functions::movw_prel_nc,
12509 Arm_relocate_functions::thm_movt_abs,
12510 Arm_relocate_functions::movt_prel,
12511 Arm_relocate_functions::thm_movw_prel_nc,
12512 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12513 (Target_arm::Relocate::relocate): Only decompose address into two
12514 parts if relocation type uses the thumb-bit and pass the actual
12515 bit instead of a flag indicating that the thumb-bit is used. Adjust
12516 calls to methods in Arm_relocate_functions for this change.
12518 2009-11-08 Ian Lance Taylor <iant@google.com>
12521 * reloc.cc: Instantiate
12522 Sized_relobj::initialize_input_to_output_maps and
12523 Sized_relobj:free_input_to_output_maps.
12525 2009-11-06 Ian Lance Taylor <iant@google.com>
12528 * defstd.cc (in_segment): Set only_if_ref true for "end".
12530 2009-11-06 Doug Kwan <dougkwan@google.com>
12532 * arm.cc (class Reloc_stub): Correct a comment.
12533 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12534 (Target_arm::scan_section_for_stubs): New method declaration.
12535 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12536 Change methods from private to protected.
12537 (Target_arm::do_may_relax): New method definition.
12538 (Target_arm::do_relax, Target_arm::group_sections,
12539 Target_arm::scan_reloc_for_stub,
12540 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12541 (Target_arm::arm_input_section_map_): New data member declaration.
12542 (Target_arm::scan_reloc_for_stub,
12543 Target_arm::scan_reloc_section_for_stubs,
12544 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12545 Target_arm::do_relax): New method definitions.
12547 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12549 * configure.ac: Check for (struct stat)::st_mtim
12550 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12551 * config.in: Regenerate.
12552 * configure: Regenerate.
12554 2009-11-05 Ian Lance Taylor <iant@google.com>
12557 * output.cc (Output_segment::add_output_section): Add missing
12560 2009-11-04 Ian Lance Taylor <iant@google.com>
12563 * object.h (class Object): Add is_needed and set_is_needed
12564 methods. Add is_needed_ field. Make bool fields into bitfields.
12565 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12566 defined in a dynamic object and referenced by a regular object,
12567 set is_needed for the dynamic object.
12568 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12569 if the file is marked with as_needed and it is not needed.
12571 2009-11-04 Ian Lance Taylor <iant@google.com>
12574 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12575 tags if data is discarded by linker script.
12576 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12577 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12578 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12579 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12581 2009-11-04 Ian Lance Taylor <iant@google.com>
12583 * layout.cc (Layout::get_output_section): Add is_interp and
12584 is_dynamic_linker_section parameters. Change all callers.
12585 (Layout::choose_output_section): Likewise.
12586 (Layout::make_output_section): Likewise.
12587 (Layout::add_output_section_data): Add is_dynamic_linker_section
12588 parameter. Change all callers.
12589 * layout.h (class Layout): Update declarations.
12590 * output.h (class Output_section): Add is_interp, set_is_interp,
12591 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12592 Add is_interp_, is_dynamic_linker_section_ fields. Change
12593 generate_code_fills_at_write_ to a bitfield.
12594 * output.cc (Output_section::Output_sections): Initialize new
12596 (Output_segment::add_output_section): Add do_sort parameter.
12597 Change all callers.
12599 2009-11-03 Ian Lance Taylor <iant@google.com>
12602 * options.h (class General_options): Add --warn-common.
12603 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12604 merging two common symbols.
12605 (Symbol_table::should_override): Handle --warn-common when merging
12606 a common symbol with a defined symbol. Use report_resolve_problem
12607 for multiple definitions.
12608 (Symbol_table::report_resolve_problem): New function.
12609 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12611 2009-11-03 Doug Kwan <dougkwan@google.com>
12613 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12615 (Target_arm::stub_factory): New method definition.
12616 (Target_arm::new_arm_input_section,
12617 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12618 Target_arm::reloc_uses_thumb_bit): New method declarations.
12619 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
12620 New type definitions.
12621 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12622 member declarations.
12623 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12624 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12625 New method definitions.
12627 2009-11-03 Ian Lance Taylor <iant@google.com>
12629 * options.h (class General_options): Add --warn_constructors.
12631 2009-11-03 Ian Lance Taylor <iant@google.com>
12634 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12635 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12637 2009-11-03 Ian Lance Taylor <iant@google.com>
12640 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12641 --msgid-bugs-address.
12642 (install-pdf): New target.
12643 (install-data_yes): Look up one directory to find mkinstalldirs.
12645 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12647 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12650 2009-10-30 Doug Kwan <dougkwan@google.com>
12652 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12654 2009-10-30 Doug Kwan <dougkwan@google.com>
12656 * arm.cc (Stub_addend_reader): New struct template definition
12657 and partial specializations.
12658 (Stub_addend_reader::operator()): New method definition for a
12659 partially specialized template.
12661 2009-10-30 Doug Kwan <dougkwan@google.com>
12663 * arm.cc (Arm_relobj::processor_specific_flags): New method
12665 (Arm_relobj::do_read_symbols): New method declaration.
12666 (Arm_relobj::processor_specific_flags_): New data member declaration.
12667 (Arm_dynobj): New class definition.
12668 (Target_arm::do_finalize_sections): Add input_objects parameter.
12669 (Target_arm::do_adjust_elf_header): New method declaration.
12670 (Target_arm::are_eabi_versions_compatible,
12671 (Target_arm::merge_processor_specific_flags): New method declaration.
12672 (Target_arm::do_make_elf_object): New overloaded method definitions
12674 (Arm_relobj::do_read_symbols): New method definition.
12675 (Arm_dynobj::do_read_symbols): Ditto.
12676 (Target_arm::do_finalize_sections): Add input_objects parameters.
12677 Merge processor-specific flags from all input objects.
12678 (Target_arm::are_eabi_versions_compatible,
12679 Target_arm::merge_processor_specific_flags,
12680 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12681 New method definitions.
12682 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12683 Input_objects pointer type parameter.
12684 * layout.cc (Layout::finalize): Pass input objects to target's.
12685 finalize_sections function.
12686 * output.cc (Output_file_header::do_sized_write): Set ELF file
12687 header's processor-specific flags.
12688 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12689 Input_objects pointer type parameter.
12690 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12691 * target.h (Input_objects): New forward class declaration.
12692 (Target::processor_specific_flags,
12693 Target::are_processor_specific_flags_sect): New method definitions.
12694 (Target::finalize_sections): Add input_objects parameter.
12695 (Target::Target): Initialize processor_specific_flags_ and
12696 are_processor_specific_flags_set_.
12697 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12699 (Target::set_processor_specific_flags): New method definition.
12700 (Target::processor_specific_flags_,
12701 Target::are_processor_specific_flags_set_): New data member
12703 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12704 Input_objects pointer type parameter.
12706 2009-10-30 Doug Kwan <dougkwan@google.com>
12708 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12710 2009-10-28 Ian Lance Taylor <iant@google.com>
12712 * object.h (class Relobj): Drop options parameter from
12713 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12714 do_scan_relocs, do_relocate. Change all callers.
12715 (class Sized_relobj): Drop options parameters from
12716 do_gc_process_relocs, do_scan_relocs, do_relocate,
12717 do_relocate_sections, relocate_sections, emit_relocs_scan,
12718 emit_relocs_scan_reltype. Change all callers.
12719 (struct Relocate_info): Remove options field and all references to
12721 * reloc.h (class Read_relocs): Remove options constructor
12722 parameter and options_ field. Change all callers.
12723 (class Gc_process_relocs, class Scan_relocs): Likewise.
12724 (class Relocate_task): Likewise.
12725 * target-reloc.h (scan_relocs): Remove options parameter. Change
12727 (scan_relocatable_relocs): Likewise.
12728 * target.h (class Sized_target): Remove options parameter from
12729 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12731 * gc.h (gc_process_relocs): Remove options parameter. Change all
12733 * arm.cc: Update functions to remove options parameters.
12734 * i386.cc: Likewise.
12735 * powerpc.cc: Likewise.
12736 * sparc.cc: Likewise.
12737 * x86_64.cc: Likewise.
12738 * testsuite/testfile.cc: Likewise.
12740 2009-10-28 Doug Kwan <dougkwan@google.com>
12742 * arm.cc (Arm_relobj): New class definition.
12743 (Arm_relobj::scan_sections_for_stubs,
12744 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12745 New method definitions.
12747 2009-10-28 Cary Coutant <ccoutant@google.com>
12749 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12750 (Plugin::cleanup_done_): New member.
12751 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12752 (Plugin_manager::cleanup_done_): Remove.
12753 (Plugin_manager::add_input_file): Edit error message.
12754 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12755 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12757 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12759 * fileread.cc: (File_read::View::~View): Use the new
12760 data_ownership_ filed.
12761 (File_read::~File_read): Dispose the new whole_file_view_.
12762 (File_read::open): Mmap the whole file if needed.
12763 (File_read::open): Use whole_file_view_ instead of contents_.
12764 (File_read::find_view): Use whole_file_view_ if applicable.
12765 (File_read::do_read): Use whole_file_view_ instead of contents_.
12766 (File_read::make_view): Use whole_file_view_ instead of contents_,
12767 update File_read::View::View call.
12768 (File_read::find_or_make_view): Update File_read::View::View
12770 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12772 (File_read::View::Data_ownership): New enum.
12773 (File_read::View::View): Replace bool mapped_ with Data_ownership
12775 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12776 (File_read::View::data_ownership_): New field.
12777 (File_read::contents_): Remove (replaced by whole_file_view_).
12778 (File_read::whole_file_view_): New field.
12779 * options.h (class General_options): Add --keep-files-mapped.
12781 2009-10-27 Cary Coutant <ccoutant@google.com>
12783 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12784 * testsuite/Makefile.am (plugin_test_5): New test case.
12785 * testsuite/Makefile.in: Regenerate.
12787 2009-10-25 Doug Kwan <dougkwan@google.com>
12789 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12790 from private to protected to allow access by child class.
12791 (Sized_relobj::do_relocate_sections): New method declaration.
12792 (Sized_relobj::relocate_sections): Virtualize.
12793 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
12794 Sized_relobj::relocate_sections. Instantiate template explicitly
12795 for different target sizes and endianity.
12797 2009-10-24 Doug Kwan <dougkwan@google.com>
12799 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12800 (Arm_input_section::as_arm_input_section): New method.
12801 (Arm_output_section): New class definition.
12802 (Arm_output_section::create_stub_group,
12803 Arm_output_section::group_sections): New method definitions.
12805 2009-10-22 Doug Kwan <dougkwan@google.com>
12807 * arm.cc (Arm_input_section): New class definition.
12808 (Arm_input_section::init, Arm_input_section:do_write,
12809 Arm_input_section::set_final_data_size,
12810 Arm_input_section::do_reset_address_and_file_offset): New method
12813 2009-10-21 Doug Kwan <dougkwan@google.com>
12815 * arm.cc (Stub_table, Arm_input_section): New forward class
12817 (Stub_table): New class defintion.
12818 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12819 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12820 New method definition.
12822 2009-10-21 Doug Kwan <dougkwan@google.com>
12824 * arm.cc: Update copyright comments.
12825 (Target_arm): New forward class template declaration.
12826 (Arm_address): New type.
12827 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12828 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12829 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12831 (Insn_template): Same.
12832 (DEF_STUBS): New macro.
12833 (Stub_type): New enum type.
12834 (Stub_template): New class definition.
12836 (Reloc_stub): Same.
12837 (Stub_factory): Same.
12838 (Target_arm::Target_arm): Initialize may_use_blx_ and
12839 should_force_pic_veneer_.
12840 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12841 Target_arm::should_force_pic_veneer,
12842 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12843 Target_arm::using_thumb_only, Target_arm:;default_target): New
12845 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12846 New data member declarations.
12847 (Insn_template::size, Insn_template::alignment): New method defintions.
12848 (Stub_template::Stub_template): New method definition.
12849 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12850 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12851 (Stub_factory::Stub_factory): New method definition.
12852 * gold.h (string_hash): New template.
12853 * output.h (Input_section_specifier::hash_value): Use
12855 (Input_section_specifier::string_hash): Remove.
12856 * stringpool.cc (Stringpool_template::string_hash): Use
12859 2009-10-20 Doug Kwan <dougkwan@google.com>
12861 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12862 symbols of relaxed input sections.
12863 * output.h (Output_section::find_relaxed_input_section): Make
12866 2009-10-16 Doug Kwan <dougkwan@google.com>
12868 * dynobj.cc (Versions::Versions): Initialize version_script_.
12869 Only insert base version symbol definition for a shared object
12870 if version script defines any version versions.
12871 (Versions::define_base_version): New method definition.
12872 (Versions::add_def): Check that base version is not needed.
12873 (Versions::add_need): Define base version lazily.
12874 * dynobj.h (Versions::define_base_version): New method declaration.
12875 (Versions::needs_base_version_): New data member declaration.
12876 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12877 (check_DATA): Add no_version_test.stdout.
12878 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12880 * testsuite/Makefile.in: Regenerate.
12881 * testsuite/no_version_test.c: New file.
12882 * testsuite/no_version_test.sh: Ditto.
12884 2009-10-16 Doug Kwan <dougkwan@google.com>
12886 * expression.cc (class Segment_start_expression): New class definition.
12887 (Segment_start_expression::value): New method definition.
12888 (script_exp_function_segment_start): Return a new
12889 Segment_start_expression.
12890 * gold/script-c.h (script_saw_segment_start_expression): New function
12892 * script-sections.cc (Script_sections::Script_sections): Initialize
12893 SAW_SEGMENT_START_EXPRESSION_ to false.
12894 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12895 and -Tbbs options to specify section addresses if given in
12896 command line and no SEGMENT_START expression is seen in a script.
12897 * script-sections.h (Script_sections::saw_segment_start_expression,
12898 Script_sections::set_saw_segment_start_expression): New method
12900 (Script_sections::saw_segment_start_expression_): New data member
12902 * script.cc (script_saw_segment_start_expression): New function.
12903 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12904 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12905 script_test_7.sh and script_test_8.sh.
12906 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12907 script_test_8.stdout.
12908 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12909 (script_test_6, script_test_6.stdout, script_test_7,
12910 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12911 * Makefile.in: Regenerate.
12912 * testsuite/script_test_6.sh: New file.
12913 * testsuite/script_test_6.t: Same.
12914 * testsuite/script_test_7.sh: Same.
12915 * testsuite/script_test_7.t: Same.
12916 * testsuite/script_test_8.sh: Same.
12918 2009-10-16 Doug Kwan <dougkwan@google.com>
12920 * output.cc (Output_segment::set_section_list_address): Cast
12921 expressions to unsigned long long type to avoid format warnings.
12923 2009-10-15 Ian Lance Taylor <iant@google.com>
12925 * script.cc (Script_options::add_symbol_assignment): Always add a
12926 dot assignment to script_sections_.
12927 * script-sections.cc (Script_sections::add_dot_assignment):
12928 Initialize if necessary.
12930 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12931 program headers with no load segment if there is a linker script.
12933 * layout.cc (Layout::set_segment_offsets): Align the file offset
12934 to the segment aligment for -N or -n with no load segment.
12935 * output.cc (Output_segment::add_output_section): Don't crash if
12936 the first section is a TLS section.
12937 (Output_segment::set_section_list_addresses): Print an error
12938 message if the address moves backward in a linker script.
12939 * script-sections.cc
12940 (Output_section_element_input::set_section_addresses): Don't
12941 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12942 (Orphan_output_section::set_section_addresses): Likewise.
12944 2009-10-15 Doug Kwan <dougkwan@google.com>
12946 * layout.cc (Layout::finish_dynamic_section): Generate tags
12947 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12948 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12949 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12951 2009-10-14 Ian Lance Taylor <iant@google.com>
12953 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12955 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12956 data_shdr fields of relinfo.
12957 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12958 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12959 R_386_TLS_LDO_32, adjust based on section flags.
12960 (Target_i386::Relocate::fix_up_ldo): Remove.
12962 2009-10-13 Ian Lance Taylor <iant@google.com>
12964 Add support for -pie.
12965 * options.h (class General_options): Add -pie and
12967 (General_options::output_is_position_independent): Test -pie.
12968 (General_options::output_is_executable): Return true if not shared
12969 and not relocatable.
12970 (General_options::output_is_pie): Remove.
12971 * options.cc (General_options::finalize): Reject incompatible uses
12973 * gold.cc (queue_middle_tasks): A -pie link is not static.
12974 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12975 * symtab.cc (Symbol::final_value_is_known): Return false if
12976 output_is_position_independent.
12977 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12978 output_is_position_independent.
12979 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12980 output_is_position_independent.
12981 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12982 output_is_position_independent.
12983 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12985 (basic_pie_test.o, basic_pie_test): New targets.
12986 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12987 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12988 (two_file_pie_test): New target.
12989 * testsuite/Makefile.in: Rebuild.
12990 * README: Remove note saying that -pie is not supported.
12992 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12994 * options.h (class General_options): Add -init and -fini.
12995 * layout.cc (Layout::finish_dynamic_section): Emit
12996 given init and fini functions.
12998 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13000 * gc.h (gc_process_relocs): Check if icf is enabled using new
13002 * gold.cc (queue_initial_tasks): Likewise.
13003 (queue_middle_tasks): Likewise.
13004 * object.cc (do_layout): Likewise.
13005 * symtab.cc (is_section_folded): Likewise.
13006 * main.cc (main): Likewise.
13007 * reloc.cc (Read_relocs::run): Likewise.
13008 (Sized_relobj::do_scan_relocs): Likewise.
13009 * icf.cc (is_function_ctor_or_dtor): New function.
13010 (Icf::find_identical_sections): Check if function is ctor or dtor when
13011 safe icf is chosen.
13012 * options.h (General_options::icf): Change option to be an enum.
13013 (Icf_status): New enum.
13014 (icf_enabled): New method.
13015 (icf_safe_folding): New method.
13016 (set_icf_status): New method.
13017 (icf_status_): New variable.
13018 * (options.cc) (General_options::finalize): Set icf_status_.
13019 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13020 icf_test and icf_keep_unique_test to use the --icf enum flag.
13021 * testsuite/icf_safe_test.sh: New file.
13022 * testsuite/icf_safe_test.cc: New file.
13024 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13026 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13027 includes to gc.h and icf.h.
13028 * arm.cc: Include gc.h.
13029 * gold.cc: Likewise.
13030 * i386.cc: Likewise.
13031 * powerpc.cc: Likewise.
13032 * sparc.cc: Likewise.
13033 * x86_64.cc: Likewise.
13034 * gc.h: Include icf.h.
13036 2009-10-11 Ian Lance Taylor <iant@google.com>
13038 * plugin.cc: Include "gold.h" before other header files.
13040 2009-10-10 Chris Demetriou <cgd@google.com>
13042 * options.h (Input_file_argument::Input_file_type): New enum.
13043 (Input_file_argument::is_lib_): Replace with...
13044 (Input_file_argument::type_): New member.
13045 (Input_file_argument::Input_file_argument): Take Input_file_type
13046 'type' rather than boolean 'is_lib' as second argument.
13047 (Input_file_argument::is_lib): Use type_.
13048 (Input_file_argument::is_searched_file): New function.
13049 (Input_file_argument::may_need_search): Handle is_searched_file.
13050 * options.cc (General_options::parse_library): Support -l:filename.
13051 (General_options::parse_just_symbols): Update for Input_file_argument
13053 (Command_line::process): Likewise.
13054 * archive.cc (Archive::get_file_and_offset): Likewise.
13055 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13056 * script.cc (read_script_file, script_add_file): Likewise.
13057 * fileread.cc (Input_file::Input_file): Likewise.
13058 (Input_file::will_search_for): Handle is_searched_file.
13059 (Input_file::open): Likewise.
13060 * readsyms.cc (Read_symbols::get_name): Likewise.
13061 * testsuite/Makefile.am (searched_file_test): New test.
13062 * testsuite/Makefile.in: Regenerate.
13063 * testsuite/searched_file_test.cc: New file.
13064 * testsuite/searched_file_test_lib.cc: New file.
13066 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13067 Ian Lance Taylor <iant@google.com>
13069 * descriptor.cc: Include <cstdio> and "binary-io.h".
13070 (Descriptors::open): Open the files in binary mode always.
13071 * script.cc (Lex::get_token): Treat \r as whitespace.
13073 2009-10-09 Ian Lance Taylor <iant@google.com>
13075 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13077 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13078 Ian Lance Taylor <iant@google.com>
13080 * configure.ac: Check for readv function also.
13081 * fileread.cc (readv): Define if not HAVE_READV.
13082 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13084 * config.in: Regenerate.
13085 * configure: Regenerate.
13087 2009-10-09 Doug Kwan <dougkwan@google.com>
13089 * layout.cc (Layout::make_output_section): Call target hook to make
13090 ordinary output section.
13091 (Layout::finalize): Adjust parameter list of call the
13092 Target::may_relax().
13093 * layout.h (class Layout::section_list): New method.
13094 * merge.h (Output_merge_base::entsize): Change visibility to public.
13095 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13097 (Output_merge_string::do_is_string): New method.
13098 * object.cc (Sized_relobj::do_setup): renamed from
13099 Sized_relobj::set_up.
13100 * object.h (Sized_relobj::adjust_shndx,
13101 Sized_relobj::initializ_input_to_output_maps,
13102 Sized_relobj::free_input_to_output_maps): Change visibilities to
13104 (Sized_relobj::setup): Virtualize.
13105 (Sized_relobj::do_setup): New method declaration.
13106 (Sized_relobj::invalidate_section_offset,
13107 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13108 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13109 * options.cc (parse_int): New function.
13110 * options.h (parse_int): New declaration.
13111 (DEFINE_int): New macro.
13112 (stub_group_size): New option.
13113 * output.cc (Output_section::Output_section): Initialize memebers
13114 merge_section_map_, merge_section_by_properties_map_,
13115 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13116 (Output_section::add_input_section): Handled deferred code-fill
13117 generation and remove an old comment.
13118 (Output_section::add_relaxed_input_section): New method definition.
13119 (Output_section::add_merge_input_section): Use merge section by
13120 properties map to speed to search. Update merge section maps
13122 (Output_section::build_relaxation_map): New method definition.
13123 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13125 (Output_section::relax_input_section): Renamed to
13126 Output_section::convert_input_sections_to_relaxed_sections and change
13127 interface to take a vector of pointers to relaxed sections.
13128 (Output_section::find_merge_section,
13129 Output_section::find_relaxed_input_section): New method definitions.
13130 (Output_section::is_input_address_mapped,
13131 Output_section::output_offset, Output_section::output_address):
13132 Use output section data maps to speed up searching.
13133 (Output_section::find_starting_output_address): Add comments.
13134 (Output_section::do_write,
13135 Output_section::write_to_postprocessing_buffer): Do code-fill
13136 generation as appropriate.
13137 (Output_section::get_input_sections): Invalidate relaxed input section
13139 (Output_section::restore_states): Adjust type of checkpoint .
13140 Invalidate relaxed input section map.
13141 * output.h (Output_merge_base): New class declaration.
13142 (Input_section_specifier): New class defintion.
13143 (class Output_relaxed_input_section) Change base class to
13144 Output_section_data_build.
13145 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13146 base class initializer.
13147 (Output_section::add_relaxed_input_section): New method declaration.
13148 (Output_section::Input_section): Change visibility to protected.
13149 (Output_section::Input_section::relobj,
13150 Output_section::Input_section::shndx): Handle relaxed input sections.
13151 Output_section::input_sections) Change visibility to protected. Also
13152 define overload to return a non-const pointer.
13153 (Output_section::Merge_section_properties): New class defintion.
13154 (Output_section::Merge_section_by_properties_map,
13155 Output_section::Output_section_data_by_input_section_map,
13156 Output_section::Relaxation_map): New types.
13157 (Output_section::relax_input_section): Rename method to
13158 Output_section::convert_input_sections_to_relaxed_sections and change
13159 interface to take a vector of relaxed section pointers.
13160 (Output_section::find_merge_section,
13161 Output_section::find_relaxed_input_section,
13162 Output_section::build_relaxation_map,
13163 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13164 New method declarations.
13165 (Output_section::merge_section_map_
13166 Output_section::merge_section_by_properties_map_,
13167 Output_section::relaxed_input_section_map_,
13168 Output_section::is_relaxed_input_section_map_valid_,
13169 Output_section::generate_code_fills_at_write_): New data members.
13170 * script-sections.cc
13171 (Output_section_element_input::set_section_addresses): Call
13172 current_data_size and addralign methods of relaxed input sections.
13173 (Orphan_output_section::set_section_addresses): Call current_data_size
13174 and addralign methods of relaxed input sections.
13175 * symtab.cc (Symbol_table::compute_final_value): Extract template
13176 from the body of Symbol_table::sized_finalize_symbol.
13177 (Symbol_table::sized_finalized_symbol): Call
13178 Symbol_table::compute_final_value.
13179 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13180 (Symbol_table::compute_final_value): New templated method declaration.
13181 * target.cc (Target::do_make_output_section): New method defintion.
13182 * target.h (Target::make_output_section): New method declaration.
13183 (Target::relax): Add more parameters for input objects, symbol table
13184 and layout. Adjust call to do_relax.
13185 (Target::do_make_output_section): New method declaration.
13186 (Target::do_relax): Add parameters for input objects, symbol table
13189 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13191 * pread.c: Include stdio.h.
13193 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13195 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13198 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13200 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13201 Change read_shndx type to unsigned int.
13202 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13204 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13205 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13206 Change read_shndx type to unsigned int.
13207 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13209 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13210 * layout.cc (Layout::create_symtab_sections): Cast the result of
13211 local_symcount * symsize to off_t in the gold_assert.
13213 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13215 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13216 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13218 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13219 (Arm_relocate_functions::thm_abs5): New function.
13220 (Arm_relocate_functions::abs12): New function.
13221 (Arm_relocate_functions::abs16): New function.
13222 (Arm_relocate_functions::base_abs): New function.
13223 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13224 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13225 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13227 (Scan::global): Likewise.
13228 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13229 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13230 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13231 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13234 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13236 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13237 (Arm_relocate_functions::movt_prel): New function.
13238 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13239 (Arm_relocate_functions::thm_movt_prel): New function.
13240 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13241 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13242 (Scan::global, Relocate::relocate): Likewise.
13243 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13245 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13247 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13248 Incremental_checker.
13249 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13251 (class Incremental_inputs_header): New class.
13252 (Incremental_inputs_header_writer): Edit comment.
13253 (Incremental_inputs_entry): New class.
13254 (Incremental_inputs_entry_writer): Edit comment.
13255 (Sized_incremental_binary::do_find_incremental_inputs_section):
13256 Add *strtab_shndx parameter, fill it.
13257 (Sized_incremental_binary::do_check_inputs): New method.
13258 (Incremental_checker::can_incrementally_link_output_file): Use
13259 Sized_incremental_binary::check_inputs.
13260 (Incremental_inputs::report_command_line): Save command line in
13263 (Incremental_binary::find_incremental_inputs_section): New
13265 (Incremental_binary::do_find_incremental_inputs_section): Add
13266 strtab_shndx parameter.
13267 (Incremental_binary::do_check_inputs): New pure virtual method.
13268 (Sized_incremental_binary::do_check_inputs): Declare.
13269 (Incremental_checker::Incremental_checker): Add incremental_inputs
13270 parameter, use it to initialize incremental_inputs_.
13271 (Incremental_checker::incremental_inputs_): New field.
13272 (Incremental_checker::command_line): New method.
13273 (Incremental_checker::inputs): New method.
13274 (Incremental_checker::command_line_): New field.
13276 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13278 * incremental.cc: Include <cstdarg> and "target-select.h".
13279 (vexplain_no_incremental): New function.
13280 (explain_no_incremental): New function.
13281 (Incremental_binary::error): New method.
13282 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13284 (make_sized_incremental_binary): New function.
13285 (open_incremental_binary): New function.
13286 (can_incrementally_link_file): Add checks if output is ELF and has
13288 * incremental.h: Include "elfcpp_file.h" and "output.h".
13289 (Incremental_binary): New class.
13290 (Sized_incremental_binary): New class.
13291 (open_incremental_binary): Declare.
13292 * object.cc (is_elf_object): Use
13293 elfcpp::Elf_recognizer::is_elf_file.
13294 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13295 * output.h (Output_file::filesize): New method.
13297 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13299 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13301 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13302 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13304 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13306 (Arm_relocate_functions::movw_abs_nc): New function.
13307 (Arm_relocate_functions::movt_abs): New function.
13308 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13309 (Arm_relocate_functions::thm_movt_abs): New function.
13310 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13311 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13312 (Scan::global): Likewise.
13313 (Relocate::relocate): Likewise.
13314 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13316 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13318 * arm.cc (Arm_relocate_functions::got_prel) New function.
13319 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13320 (Relocate::relocate): Likewise.
13321 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13323 2009-10-06 Ian Lance Taylor <iant@google.com>
13325 * options.h (class General_options): Define
13326 split_stack_adjust_size parameter.
13327 * object.h (class Object): Add uses_split_stack_ and
13328 has_no_split_stack_ fields. Add uses_split_stack and
13329 has_no_split_stack accessor functions. Declare
13330 handle_split_stack_section.
13331 (class Reloc_symbol_changes): Define.
13332 (class Sized_relobj): Define Function_offsets. Declare
13333 split_stack_adjust, split_stack_adjust_reltype, and
13335 * object.cc (Object::handle_split_stack_section): New function.
13336 (Sized_relobj::do_layout): Call handle_split_stack_section.
13337 * dynobj.cc (Sized_dynobj::do_layout): Call
13338 handle_split_stack_section.
13339 * reloc.cc (Sized_relobj::relocate_sections): Call
13340 split_stack_adjust for executable sections in split_stack
13341 objects. Pass reloc_map to relocate_section.
13342 (Sized_relobj::split_stack_adjust): New function.
13343 (Sized_relobj::split_stack_adjust_reltype): New function.
13344 (Sized_relobj::find_functions): New function.
13345 * target-reloc.h: Include "object.h".
13346 (relocate_section): Add reloc_symbol_changes parameter. Change
13348 * target.h (class Target): Add calls_non_split method. Declare
13349 do_calls_non_split virtual method. Declare match_view and
13351 * target.cc: Include "elfcpp.h".
13352 (Target::do_calls_non_split): New function.
13353 (Target::match_view): New function.
13354 (Target::set_view_to_nop): New function.
13355 * gold.cc (queue_middle_tasks): Give an error if mixing
13356 split-stack and non-split-stack objects with -r.
13357 * i386.cc (Target_i386::relocate_section): Add
13358 reloc_symbol_changes parameter.
13359 (Target_i386::do_calls_non_split): New function.
13360 * x86_64.cc (Target_x86_64::relocate_section): Add
13361 reloc_symbol_changes parameter.
13362 (Target_x86_64::do_calls_non_split): New function.
13363 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13365 * powerpc.cc (Target_powerpc::relocate_section): Add
13366 reloc_symbol_changes parameter.
13367 * sparc.cc (Target_sparc::relocate_section): Add
13368 reloc_symbol_changes parameter.
13369 * configure.ac: Call AM_CONDITIONAL for the default target.
13370 * configure: Rebuild.
13371 * testsuite/Makefile.am (TEST_AS): New variable.
13372 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13373 (check_DATA): Add split_i386 and split_x86_64 files.
13374 (SPLIT_DEFSYMS): Define.
13375 (split_i386_[1234n].o): New targets.
13376 (split_i386_[124]): New targets.
13377 (split_i386_[1234r].stdout): New targets.
13378 (split_x86_64_[1234n].o): New targets.
13379 (split_x86_64_[124]): New targets.
13380 (split_x86_64_[1234r].stdout): New targets.
13381 (MOSTLYCLEANFILES): Add new executables.
13382 * testsuite/split_i386.sh: New file.
13383 * testsuite/split_x86_64.sh: New file.
13384 * testsuite/split_i386_1.s: New file.
13385 * testsuite/split_i386_2.s: New file.
13386 * testsuite/split_i386_3.s: New file.
13387 * testsuite/split_i386_4.s: New file.
13388 * testsuite/split_i386_n.s: New file.
13389 * testsuite/split_x86_64_1.s: New file.
13390 * testsuite/split_x86_64_2.s: New file.
13391 * testsuite/split_x86_64_3.s: New file.
13392 * testsuite/split_x86_64_4.s: New file.
13393 * testsuite/split_x86_64_n.s: New file.
13394 * testsuite/testfile.cc (Target_test): Update relocation_section
13396 * testsuite/Makefile.in: Rebuild.
13398 2009-10-06 Ian Lance Taylor <iant@google.com>
13400 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13401 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13402 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13403 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13404 the address on ldo_addrs_.
13405 (Target_i386::Relocate::fix_up_ldo): New function.
13407 2009-10-06 Rafael Espindola <espindola@google.com>
13409 * plugin.cc (add_input_library): New.
13410 (Plugin::load): Add add_input_library to tv.
13411 (Plugin_manager::add_input_file): Add the is_lib argument.
13412 (add_input_file): Update call to Plugin_manager::add_input_file.
13413 (add_input_library): New.
13414 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13416 2009-09-30 Doug Kwan <dougkwan@google.com>
13418 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13419 symbol and call Symbol::may_need_copy_reloc to determine if
13420 a copy reloc is needed.
13421 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13422 nocopyreloc is given in command line.
13423 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13424 given in command line.
13425 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13426 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13427 of the removed Target_i386::may_need_copy_reloc.
13428 * options.h (copyreloc): New option with default value false.
13429 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13430 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13431 instead of the removed Target_powerpc::may_need_copy_reloc.
13432 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13433 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13434 instead of the removed Target_sparc::may_need_copy_reloc.
13435 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13436 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13437 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13438 instead of the removed Target_x86_64::may_need_copy_reloc.
13440 2009-09-30 Ian Lance Taylor <iant@google.com>
13442 * object.h (class Object): Remove target_ field, and target,
13443 sized_target, and set_target methods.
13444 (Object::sized_target): Remove.
13445 (class Sized_relobj): Update declarations. Remove sized_target.
13446 * object.cc (Sized_relobj::setup): Remove target parameter.
13447 Change all callers.
13448 (Input_objects::add_object): Don't do anything with the target.
13449 (make_elf_sized_object): Add punconfigured parameter. Change all
13450 callers. Set or test parameter target.
13451 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13452 Change all callers.
13453 * parameters.cc (Parameters::set_target): Change parameter type to
13455 (Parameters::default_target): Remove.
13456 (set_parameters_target): Change parameter type to be non-const.
13457 (parameters_force_valid_target): New function.
13458 (parameters_clear_target): New function.
13459 * parameters.h (class Parameters): Update declarations. Remove
13460 default_target method. Add sized_target and clear_target
13461 methods. Change target_ to be non-const.
13462 (set_parameters_target): Update declaration.
13463 (parameters_force_valid_target): Declare.
13464 (parameters_clear_target): Declare.
13465 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13466 as NULL if we aren't searching.
13467 (Add_symbols::run): Don't check for compatible target.
13468 * fileread.cc (Input_file::open_binary): Call
13469 parameters_force_valid_target.
13470 * gold.cc (queue_middle_tasks): Likewise.
13471 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13472 set_target on object.
13473 * dynobj.h (class Sized_dynobj): Update declarations.
13474 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13475 make_elf_object returns NULL.
13476 (Archive::include_member): Don't check whether object target is
13478 * output.cc (Output_section::add_input_section): Get target from
13480 (Output_section::relax_input_section): Likewise.
13481 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13483 (Sized_relobj::do_scan_relocs): Likewise.
13484 (Sized_relobj::relocate_sections): Likewise.
13485 * resolve.cc (Symbol_table::resolve): Likewise.
13486 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13487 parameter. Change all callers.
13488 (Symbol_table::add_from_object): Get target from parameters.
13489 (Symbol_table::add_from_relobj): Don't check object target.
13490 (Symbol_table::add_from_dynobj): Likewise.
13491 (Symbol_table::define_special_symbol): Get target from
13493 * symtab.h (class Symbol_table): Update declaration.
13494 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13495 parameter. Change all callers. Clear parameter target.
13496 (Binary_test): Test target here.
13497 * testsuite/object_unittest.cc (gold_testsuite): Remove
13498 target_test_pointer parameter. Change all callers.
13499 (Object_test): Test target here.
13501 2009-09-26 Ian Lance Taylor <iant@google.com>
13503 * testsuite/initpri1.c: Don't try to use constructor priorities if
13504 compiling with gcc before 4.3.
13506 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13508 * testsuite/retain_symbols_file_test.sh (check_present): Change
13509 output file name to retain_symbols_file_test.stdout.
13510 (check_absent): Likewise.
13512 2009-09-18 Craig Silverstein <csilvers@google.com>
13514 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13515 * options.cc: Include <cerrno> and <fstream>.
13516 (General_options::finalize): Parse -retain-symbols-file tag.
13517 * options.h: New flag.
13518 (General_options): New method should_retain_symbol, new
13519 variable symbols_to_retain.
13520 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13521 should_retain_symbol map.
13522 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13523 * testsuite/Makefile.in: Regenerate.
13524 * testsuite/retain_symbols_file_test.sh: New file.
13526 2009-09-18 Nick Clifton <nickc@redhat.com>
13528 * po/es.po: Updated Spanish translation.
13530 2009-09-17 Doug Kwan <dougkwan@google.com>
13532 * debug.h (DEBUG_RELAXATION): New constant.
13533 (DEBUG_ALL): Add DEBUG_RELAXATION.
13534 (debug_string_to_enum): Add relaxation debug option.
13536 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13537 Layout::Relaxation_debug_check::read_sections,
13538 Layout::Relaxation_debug_check::read_sections): New method definitions.
13539 (Layout::Layout): Initialize data members
13540 record_output_section_data_from_scrips_,
13541 script_output_section_data_list_ and relaxation_debug_check_.
13542 (Layout::save_segments, Layout::restore_segments,
13543 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13544 Layout::relaxation_loop_body): New method definitions.
13545 (Layout::finalize): Support relaxation. Move section layout code to
13546 Layout::relaxation_loop_body.
13547 (Layout::set_asection_address_from_script): Move code for orphan
13548 section placement out.
13549 (Layout::place_orphan_sections_in_script): New method definition.
13550 * layout.h (Output_segment_headers, Output_file_header):
13551 New forward class declarations.
13552 (Layout::~Layout): Define.
13553 (Layout::new_output_section_data_from_script): New method definition.
13554 (Layout::place_orphan_sections_in_script): New method declaration.
13555 (Layout::Segment_states): New type declaration.
13556 (Layout::save_segments, Layout::restore_segments,
13557 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13558 Layout::relaxation_loop_body): New method declarations.
13559 (Layout::Output_section_data_list): New type declaration.
13560 (Layout::Relaxation_debug_check): New class definition.
13561 (Layout::record_output_section_data_from_script_,
13562 Layout::script_output_section_data_list_, Layout::segment_states_,
13563 Layout::relaxation_debug_check_): New data members.
13564 * output.cc: (Output_section_headers::do_size): New method definition.
13565 (Output_section_headers::Output_section_headers): Move size
13566 computation to Output_section_headers::do_size.
13567 (Output_segment_headers::do_size): New method definition.
13568 (Output_file_header::Output_file_header): Move size computation to
13569 Output_file_header::do_size and call it.
13570 (Output_file_header::do_size): New method definition.
13571 (Output_data_group::Output_data_group): Adjust call to
13572 Output_section_data.
13573 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13574 (Output_symtab_xindex::do_write): Add array bound check.
13575 (Output_section::Input_section::print_to_mapfile): Handle
13576 RELAXED_INPUT_SECTION_CODE.
13577 (Output_section::Output_section): Initialize data member checkpoint_.
13578 (Output_section::~Output_section): Delete checkpoint object pointed
13580 (Output_section::add_input_section): Always add an Input_section if
13582 (Output_section::add_merge_input_section): Add assert.
13583 (Output_section::relax_input_section): New method definition.
13584 (Output_section::set_final_data_size): Set load address to zero for
13585 an unallocated section.
13586 (Output_section::do_address_and_file_offset_have_reset_values):
13587 New method definition.
13588 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13589 Handle relaxed input section.
13590 (Output_section::sort_attached_input_sections): Checkpoint input
13591 section list lazily.
13592 (Output_section::get_input_sections): Change type of input_sections to
13593 list of Simple_input_section pointers. Checkpoint input section list
13594 lazily. Also handle relaxed input sections.
13595 (Output_section::add_input_section_for_script): Take a reference to
13596 a Simple_input_section object instead of Relobj pointer and section
13597 index as parameter. Handle relaxed input sections.
13598 (Output_section::save_states, Output_section::restore_states): New
13599 method definitions.
13600 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13601 (Output_data::is_data_size_fixed): New method definition.
13602 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13604 (Output_data::address_and_file_offset_have_reset_values): New method
13606 (Output_data::do_address_and_file_offset_have_reset_values): New method
13608 (Output_data::set_data_size): Check that data size is not fixed.
13609 (Output_data::fix_data_size): New method definition.
13610 (Output_data::is_data_size_fixed_): New data member.
13611 (Output_section_headers::set_final_data_size): New method definition.
13612 (Output_section_headers::do_size): New method declaration.
13613 (Output_segment_headers::set_final_data_size): New method definition.
13614 (Output_segment_headers::do_size): New method declaration.
13615 (Output_file_header::set_final_data_size)::New method definition.
13616 (Output_file_header::do_size)::New method declaration.
13617 (Output_section_data::Output_section_data): Add new parameter
13618 is_data_size_fixed and use it to fix data size.
13619 (Output_data_const::Output_data_const): Adjust call to base class
13620 constructor and fix data size.
13621 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13622 base class constructor and fix data size.
13623 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13624 base class constructor and fix data size.
13625 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13626 class constructor and fix data size.
13627 (Output_data_group::set_final_data_size): New method definition.
13628 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13629 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13630 class constructor and fix data size.
13631 (Output_relaxed_input_section): New class definition.
13632 (Output_section::Simple_input_section): New class definition.
13633 (Output_section::get_input_sections): Adjust parameter list.
13634 (Output_section::add_input_section_for_script): Same.
13635 (Output_section::save_states, Output_section::restore_states,
13636 Output_section::do_address_and_file_offset_have_reset_values,
13637 (Output_section::Input_section::Input_section): Handle
13638 RELAXED_INPUT_SECTION_CODE. Add new overload for
13639 Output_relaxed_input_section.
13640 (Output_section::Input_section::is_input_section,
13641 Output_section::Input_section::set_output_section): Handle relaxed
13643 (Output_section::Input_section::is_relaxed_input_section,
13644 Output_section::Input_section::output_section_data,
13645 Output_section::Input_section::relaxed_input_section): New method
13647 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13649 (Output_section::Input_section::u1_): Update comments.
13650 (Output_section::Input_section::u2_): Add new union member poris.
13651 (Output_section::Checkpoint_output_section): New classs definition.
13652 (Output_section::relax_input_section): New method declaration.
13653 (Output_section::checkpoint_): New data member.
13654 (Output_segment): Update comments.
13655 (Output_segment::Output_segment): Un-privatize copy constructor.
13656 (Output_segment::operator=): Un-privatize.
13657 * script-sections.cc (Output_section_element::Input_section_list):
13658 Change element type to Output_section::Simple_input_section.
13659 (Output_section_element_dot_assignment::set_section_addresses):
13660 Register output section data for relaxation clean up.
13661 (Output_data_exression::Output_data_expression): Adjust call to base
13662 constructor to fix data size.
13663 (Output_section_element_data::set_section_addresses): Register
13664 Output_data_expression object for relaxation clean up.
13665 (struct Input_section_info): Replace Relobj pointer and section index
13666 pair with Output_section::Simple_input_section and Convert struct to a
13668 (Input_section_sorter::operator()): Adjust access to
13669 Input_section_info data member to use accessors.
13670 (Output_section_element_input::set_section_addresses): Use layout
13671 parameter. Adjust code to use Output_section::Simple_input_section
13672 and Input_secction_info classes. Register filler for relaxation
13674 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13675 and section index pair with Output_section::Simple_input_section
13676 class. Adjust code accordingly.
13677 (Phdrs_element::release_segment): New method definition.
13678 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13680 (Script_sections::release_segments): New method definition.
13681 * gold/script-sections.h (Script_sections::release_segments): New
13682 method declaration.
13683 * gold/target.h (Target::may_relax, Target::relax,
13684 Target::do_may_relax, Target::do_relax): New method definitions.
13686 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13688 * arm.cc (has_signed_unsigned_overflow): New function.
13689 (Arm_relocate_functions::abs8): New function.
13690 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13691 (Target_arm::Scan::global): Likewise.
13692 (Target_arm::relocate::relocate): Likewise.
13693 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13696 2009-09-16 Cary Coutant <ccoutant@google.com>
13698 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13699 * testsuite/Makefile.in: Regenerate.
13701 2009-09-11 Nick Clifton <nickc@redhat.com>
13703 * po/gold.pot: Updated by the Translation project.
13705 2009-09-08 Cary Coutant <ccoutant@google.com>
13707 * output.cc (Output_file::open): Add execute permission to empty file.
13708 * testsuite/Makefile.am (permission_test): New test.
13709 * testsuite/Makefile.in: Regenerate.
13711 2009-09-02 Ian Lance Taylor <iant@google.com>
13713 * output.cc (Output_file::resize): Call map_no_anonymous rather
13716 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13718 * gold.cc: Include "incremental.h".
13719 (queue_initial_tasks): Call Incremental_checker methods.
13720 * incremental.cc: Include "output.h".
13721 (Incremental_checker::can_incrementally_link_output_file): New
13723 * incremental.h (Incremental_checker): New class.
13725 * output.cc (Output_file::open_for_modification): New method.
13726 (Output_file::map_anonymous): Changed return type to bool. Record
13727 map in base_ field.
13728 (Output_file::map_no_anonymous): New method, broken out of map.
13729 (Output_file::map): Use map_no_anonymous and map_anonymous.
13730 * output.h (class Output_file): Update declarations.
13732 2009-08-24 Cary Coutant <ccoutant@google.com>
13734 * options.h (Command_line::Pre_options): New class.
13735 (Command_line::pre_options): New member.
13736 * options.cc (gold::options::ready_to_register): New variable.
13737 (One_option::register_option): Do nothing if not registering options.
13738 Assert if same short option registered twice.
13739 (General_options::General_options): Turn off option registration when
13741 (Command_line::Pre_options::Pre_options): New constructor.
13743 2009-08-24 Cary Coutant <ccoutant@google.com>
13745 * options.h (General_options::no_keep_memory): Remove incorrect
13748 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13750 * Makefile.am (am__skiplex, am__skipyacc): New.
13751 * Makefile.in: Regenerate.
13753 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13755 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13756 (INCLUDES): ... this.
13757 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13758 (AM_CPPFLAGS): Renamed from ...
13759 (INCLUDE): ... this.
13760 * Makefile.in, testsuite/Makefile.in: Regenerate.
13762 * Makefile.in: Regenerate.
13763 * aclocal.m4: Likewise.
13764 * config.in: Likewise.
13765 * configure: Likewise.
13766 * testsuite/Makefile.in: Likewise.
13768 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13769 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13770 * Makefile.in: Regenerate.
13771 * testsuite/Makefile.in: Regenerate.
13773 2009-08-19 Cary Coutant <ccoutant@google.com>
13775 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13776 symbols in shared libraries overridden by hidden or internal symbols
13777 in the main program.
13779 2009-08-19 Chris Demetriou <cgd@google.com>
13781 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13782 checking source file names in error messages.
13784 2009-08-18 Doug Kwan <dougkwan@google.com>
13786 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13787 an elcpp::Ehdr as parameter. Adjust call to set_target.
13788 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13789 an elfcpp::Ehdr as parameter.
13790 * object.cc (Object::set_target): Remove the version that looks up
13791 a target and sets it.
13792 (Sized_relobj::setup): Take a Target object instead of
13793 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13794 (make_elf_sized_object): Find target and ask target to
13795 make an ELF object.
13796 * object.h: (Object::set_target): Remove the version that looks up
13797 a target and sets it.
13798 (Sized_relobj::setup): Take a Target object instead of
13799 an elfcpp:Ehdr as parameter.
13800 * target.cc: Include dynobj.h.
13801 (Target::do_make_elf_object_implementation): New.
13802 (Target::do_make_elf_object): New.
13803 * target.h (Target::make_elf_object): New template declaration.
13804 (Target::do_make_elf_object): New method declarations.
13805 (Target::do_make_elf_object_implementation): New template declaration.
13807 2009-08-14 Ian Lance Taylor <iant@google.com>
13809 * gold.h (FUNCTION_NAME): Define.
13810 (gold_unreachable): Use FUNCTION_NAME.
13812 2009-08-12 Sriraman Tallam <tmsriram@google.com>
13814 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13815 symbol in the --keep-unique list is not found.
13817 2009-08-12 Sriraman Tallam <tmsriram@google.com>
13819 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13820 been maked as --keep-unique.
13821 (Icf::unfold_section): New function.
13822 * icf.h (Icf::unfold_section): New function.
13823 * options.h (General_options::keep_unique): New option.
13824 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13825 * testsuite/Makefile.in: Regenerate.
13826 * testsuite/icf_keep_unique_test.sh: New file.
13827 * testsuite/icf_keep_unique_test.cc: New file.
13829 2009-08-12 Cary Coutant <ccoutant@google.com>
13832 * resolve.cc (Symbol_table::resolve): Check for references from
13833 dynamic objects to hidden and internal symbols.
13834 * testsuite/Makefile.am (hidden_test.sh): New test.
13835 * testsuite/Makefile.in: Regenerate.
13836 * testsuite/hidden_test.sh: New script.
13837 * testsuite/hidden_test_1.c: New test source.
13838 * testsuite/hidden_test_main.c: New test source.
13840 2009-08-11 Doug Kwan <dougkwan@google.com>
13842 * arm.cc: Update comments.
13843 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13844 segment to locate the .ARM.exidx section if present.
13846 2009-08-09 Doug Kwan <dougkwan@google.com>
13848 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13851 2009-08-07 Sriraman Tallam <tmsriram@google.com>
13852 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13855 2009-08-06 Sriraman Tallam <tmsriram@google.com>
13857 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13858 valid tls_segment only for non-debug-section relocations.
13859 * testsuite/Makefile.am: Add gc_tls_test.
13860 * testsuite/Makefile.in: Regenerate.
13861 * testsuite/gc_tls_test.cc: New file.
13862 * testsuite/gc_tls_test.sh: New file.
13864 2009-08-05 Sriraman Tallam <tmsriram@google.com>
13866 * icf.cc: New file.
13868 * Makefile.am (CCFILES): Add icf.cc.
13869 (HFILES): Add icf.h
13870 * Makefile.in: Regenerate.
13871 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13872 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13873 section, symbol and addend information for the relocs.
13874 * gold.cc (queue_middle_tasks): Call identical code folding.
13875 * gold.h: Add defines for multimap.
13876 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13877 to the call of finalize_local_symbols.
13878 * main.cc (main): Create object of class Icf.
13879 * object.cc (Sized_relobj::do_layout): Allow this function to be
13880 called twice during icf.
13881 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13882 to sections marked as identical by icf.
13883 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13885 (Sized_relobj::do_section_entsize): New function.
13886 * object.h (Object::section_entsize): New function.
13887 (Object::do_section_entsize): New pure virtual function.
13888 (Relobj::finalize_local_symbols): Add new parameter.
13889 (Relobj::do_section_entsize): New function.
13890 * options.h (General_options::icf): New option.
13891 (General_options::icf_iterations): New option.
13892 (General_options::print_icf_sections): New option.
13893 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13894 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13895 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13897 * symtab.cc (Symbol_table::is_section_folded): New function.
13898 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13899 to sections marked as identical by icf.
13900 * symtab.h (Symbol_table::set_icf): New function.
13901 (Symbol_table::icf): New function.
13902 (Symbol_table::is_section_folded): New function.
13903 (Symbol_table::icf_): New data member.
13904 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13905 * testsuite/Makefile.am: Add commands to build icf_test.
13906 * testsuite/Makefile.in: Regenerate.
13907 * testsuite/icf_test.sh: New file.
13908 * testsuite/icf_test.cc: New file.
13910 2009-07-24 Chris Demetriou <cgd@google.com>
13912 * layout.cc (is_compressible_debug_section): Fix incorrect
13913 comment about compressed section names.
13915 2009-07-20 Ian Lance Taylor <ian@airs.com>
13918 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13920 2009-07-16 Ian Lance Taylor <iant@google.com>
13923 * layout.h: #include <map>.
13924 (class Kept_section): Change from struct to class. Add accessors
13925 and setters. Add section size to Comdat_group mapping. Change
13926 Comdat_group to std::map. Add is_comdat_ field. Add
13927 linkonce_size field in union.
13928 (class Layout): Update declaration of find_or_add_kept_section.
13929 Don't declare find_kept_object.
13930 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13931 parameter. Add object, shndx, is_comdat, and is_group_name
13932 parameters. Change all callers. Adjust for new Kept_section.
13933 (Layout::find_kept_object): Remove.
13934 * object.cc (Sized_relobj::include_section_group): Update use of
13935 Kept_section. Rename secnum to shndx. Only record
13936 Kept_comdat_section if sections are the same size.
13937 (Sized_relobj::include_linkonce_section): Update use of
13938 Kept_section. Only record Kept_comdat_section if sections are the
13939 same size. Set size of linkonce section.
13940 (Sized_relobj::map_to_kept_section): Update call to
13941 get_kept_comdat_section.
13942 * object.h (class Sized_relobj): Rename fields in
13943 Kept_comdat_section to drop trailing underscores; change object
13944 field to Relobj*. Change Kept_comdat_section_table to store
13945 struct rather than pointer.
13946 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13947 Add kept_object and kept_shndx parameters. Change all callers.
13948 (Sized_relobj::get_kept_comdat_section): Change return type to
13949 bool. Add kept_object and kept_shndx parameters. Change all
13951 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13952 Layout::find_or_add_kept_section.
13954 2009-07-09 Ian Lance Taylor <iant@google.com>
13956 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13957 Reserve space in the hash table.
13959 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13961 * fileread.cc (File_read::get_mtime): New method.
13962 * fileread.h (Timespec): New structure.
13963 (File_read::get_mtime): New method.
13964 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13965 Renamed from timestamp_nsec.
13966 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13968 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
13970 (Incremental_inputs::report_archive): Save mtime; style fix.
13971 (Incremental_inputs::report_obejct): Save mtime; style fix.
13972 (Incremental_inputs::report_script): Save mtime; style fix.
13973 (Incremental_inputs::finalize_inputs): Style fix.
13974 (Incremental_inputs::finalize): Style fix.
13975 (Incremental_inputs::create_input_section_data): Store inputs
13977 * incremental.h (Incremental_inputs::report_script): Add mtime
13979 (Incremental_inputs::Input_info::Input_info): Intialize only one
13981 (Incremental_inputs::Input_info::archive): Move to nameless
13983 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13984 (Incremental_inputs::Input_info::script): Move to nameless union.
13985 (Incremental_inputs::mtime): New field.
13986 * script.cc (read_input_script): Pass file mtime to
13988 * script.h (Script_info::inputs): Style fix.
13990 2009-07-01 Ian Lance Taylor <ian@airs.com>
13992 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13995 2009-06-24 Ian Lance Taylor <iant@google.com>
13998 * layout.cc (Layout::choose_output_section): If we find an
13999 existing section, update the flags.
14000 (Layout::create_notes): New function, broken out of
14002 (Layout::finalize): Don't create note sections.
14003 (Layout::create_note): Don't crash if linker script discards
14005 (Layout::create_gold_note): Likewise.
14006 (Layout::create_build_id): Likewise. Don't set
14007 after_input_sections on the section.
14008 (Layout::create_executable_stack_info): Remove target parameter.
14010 * layout.h (class Layout): Declare create_notes. Update
14011 declaration of create_executable_stack_info.
14012 * gold.cc (queue_middle_tasks): Call create_notes.
14013 * output.cc (Output_section::update_flags_for_input_section): Move
14014 here from output.h. If SHF_ALLOC flag is newly set, mark address
14016 * output.h (Output_data::mark_address_invalid): New function.
14017 (class Output_section): Only declare, not define,
14018 update_flags_for_input_section. Remove set_flags.
14020 2009-06-24 Ian Lance Taylor <iant@google.com>
14022 * script-sections.cc (Output_section_definition::
14023 set_section_addresses): Rename shadowing local load_address to
14026 2009-06-24 Ian Lance Taylor <iant@google.com>
14029 * reloc.cc (relocate_sections): Skip empty relocation sections.
14031 2009-06-23 Ian Lance Taylor <iant@google.com>
14034 * layout.cc (Layout::create_note): Use choose_output_section
14035 rather than make_output_section.
14037 2009-06-23 Ian Lance Taylor <iant@google.com>
14040 * options.cc (General_options::parse_V): Set printed_version_.
14041 (General_options::General_options): Initialize printed_version_.
14042 * options.h (class General_options): Add printed_version_ field.
14043 * gold.cc (queue_initial_tasks): If there are no input files,
14044 don't give a fatal error if we printed the version information.
14045 (queue_middle_tasks): If using -r with a shared object, give a
14046 fatal error rather than an ordinary error.
14048 2009-06-23 Ian Lance Taylor <iant@google.com>
14051 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14052 (Layout::make_output_section): Set have_stabstr_section_ if we see
14053 a .stab*str section.
14054 (Layout::finalize): Call link_stabs_sections.
14055 (Layout::link_stabs_sections): New file.
14056 * layout.h (class Layout): Add have_stabstr_section_ field.
14057 Declare link_stabs_sections.
14059 2009-06-23 Doug Kwan <dougkwan@google.com>
14061 * Makefile.am (libgold_a_LIBADD): New.
14062 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14063 * Makefile.in: Regenerate.
14064 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14065 * configure: Regenerate.
14066 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14067 * fileread.cc: Include sys/state.h
14068 * gold.h: Declare memmem and strndup if found missing.
14069 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14071 2009-06-23 Ian Lance Taylor <iant@google.com>
14073 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14074 * configure: Rebuild.
14076 2009-06-23 Ian Lance Taylor <iant@google.com>
14079 * object.cc (Object::section_contents): Don't try to get a view if
14080 the section has length zero.
14081 (Object::handle_gnu_warning_section): If the section is empty, use
14082 the name of the section as the warning.
14084 2009-06-23 Ian Lance Taylor <iant@google.com>
14087 * stringpool.h (class Stringpool_template): Add optimize_ field.
14088 (Stringpool_template::set_optimize): New function.
14089 * stringpool.cc (Stringpool_template::Stringpool_template):
14090 Initialize optimize_ field.
14091 (Stringpool_template::set_string_offsets): Test local optimize
14092 fild rather than parameter.
14093 * layout.cc (Layout::Layout): Call set_optimize on the section
14096 2009-06-22 Ian Lance Taylor <iant@google.com>
14099 * yyscript.y: Parse TARGET.
14100 * script.cc (script_set_target): New function.
14101 * script-c.h (script_set_target): Declare.
14102 * options.cc (General_options::string_to_object_format): Rename
14103 from string_to_object_format in anonymous namespace. Change
14105 * options.h (class General_options): Declare
14106 string_to_object_format.
14108 2009-06-22 Ian Lance Taylor <iant@google.com>
14110 * script-sections.cc (Script_sections::create_segments): Don't put
14111 program headers in a PT_LOAD segment if -n or -N.
14113 2009-06-22 Ian Lance Taylor <iant@google.com>
14116 * options.h (class General_options): Add -z lazy and -z now. Sort
14117 -z options into alphabetical order.
14118 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14120 2009-06-21 Ian Lance Taylor <iant@google.com>
14122 * layout.cc (Layout::make_output_section): Call
14123 Target::new_output_section.
14124 (Layout::attach_allocated_section_to_segment): Put large section
14125 sections in a separate load segment with the large segment flag
14127 (Layout::segment_precedes): Sort large data segments after other
14129 (align_file_offset): New static function.
14130 (Layout::set_segment_offsets): Use align_file_offset.
14131 * output.h (class Output_section): Add is_small_section_ and
14132 is_large_section_ fields.
14133 (Output_section::is_small_section): New function.
14134 (Output_section::set_is_small_section): New function.
14135 (Output_section::is_large_section): New function.
14136 (Output_section::set_is_large_section): New function.
14137 (Output_section::is_large_data_section): New function.
14138 (class Output_segment): Add is_large_data_segment_ field.
14139 (Output_segment::is_large_data_segment): New function.
14140 (Output_segment::set_is_large_data_segment): New function.
14141 * output.cc (Output_section::Output_section): Initialize new
14143 (Output_segment::Output_segment): Likewise.
14144 (Output_segment::add_output_section): Add assertion that large
14145 data sections always go in large data segments. Force small data
14146 sections to the end of the list of data sections. Force small BSS
14147 sections to the start of the list of BSS sections. For large BSS
14148 sections to the end of the list of BSS sections.
14149 * symtab.h (class Symbol): Declare is_common_shndx.
14150 (Symbol::is_defined): Check Symbol::is_common_shndx.
14151 (Symbol::is_common): Likewise.
14152 (class Symbol_table): Define enum Commons_section_type. Update
14153 declarations. Add small_commons_ and large_commons_ fields.
14154 * symtab.cc (Symbol::is_common_shndx): New function.
14155 (Symbol_table::Symbol_table): Initialize new fields.
14156 (Symbol_table::add_from_object): Put small and large common
14157 symbols in the right list.
14158 (Symbol_table::sized_finalized_symbol): Check
14159 Symbol::is_common_shndx.
14160 (Symbol_table::sized_write_globals): Likewise.
14161 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14162 common symbol lists. Don't call do_allocate_commons_list if the
14164 (Symbol_table::do_allocate_commons_list): Remove is_tls
14165 parameter. Add comons_section_type parameter. Change all
14166 callers. Handle small and large common symbols.
14167 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14168 Symbol::is_common_shndx.
14169 * resolve.cc (symbol_to_bits): Likewise.
14170 * target.h (Target::small_common_shndx): New function.
14171 (Target::small_common_section_flags): New function.
14172 (Target::large_common_shndx): New function.
14173 (Target::large_common_section_flags): New function.
14174 (Target::new_output_section): New function.
14175 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14176 small_common_section_flags, and large_common_section_flags
14178 (Target::do_new_output_section): New virtual function.
14179 * arm.cc (Target_arm::arm_info): Initialize new fields.
14180 * i386.cc (Target_i386::i386_info): Likewise.
14181 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14183 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14184 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14185 (Target_x86_64::do_new_output_section): New function.
14186 * configure.ac: Define conditional MCMODEL_MEDIUM.
14187 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14188 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14189 (large_LDFLAGS): Define.
14190 * testsuite/large.c: New file.
14191 * testsuite/testfile.cc (Target_test::test_target_info):
14192 Initialize new fields.
14193 * configure, testsuite/Makefile.in: Rebuild.
14195 2009-06-05 Doug Kwan <dougkwan@google.com>
14197 * Makefile.am (CCFILES): Add target.cc.
14198 * Makefile.in: Regenerate.
14199 * i386.cc (class Target_i386): Define new virtual method to
14200 override do_is_local_label_name in parent.
14201 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14202 local symbols if --discard-locals or -X is given.
14203 * options.h (class General_options): Declare new options
14204 '--discard-locals' and '-X' for discarding locals.
14205 * target.h (class Target): Define new methods is_local_label_name.
14206 Declare new virtual method do_is_local_label_name.
14207 * target.cc: New file.
14208 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14209 (check_SCRIPTS): Add discard_locals_test.sh.
14210 (check_DATA): Add discard_local_tests.syms.
14211 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14212 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14213 * testsuite/Makefile.in: Regenerate.
14214 * testsuite/discard_locals_test.c: New file.
14215 * testsuite/discard_locals_test.sh: Same.
14217 2009-06-05 Doug Kwan <dougkwan@google.com>
14219 * object.cc (Sized_relobj::Sized_relobj): Initialize
14220 discarded_eh_frame_shndx_ to -1U.
14221 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14223 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14224 a discarded .eh_frame section.
14225 (Sized_relobj::do_finalize_local_symbols): Ditto.
14226 * object.h (class Sized_relobj): Declare new member
14227 discarded_eh_frame_shndx_.
14228 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14229 (local_labels_test.o, local_labels_test): New rules.
14230 * testsuite/Makefile.in: Regenerate.
14232 2009-06-04 Doug Kwan <dougkwan@google.com>
14234 * layout.cc (Layout::section_name_mapping): Add mapping for
14235 special ARM sections.
14237 2009-06-03 Doug Kwan <dougkwan@google.com>
14239 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14240 (utils::has_overflow): Same.
14242 2009-06-03 Ian Lance Taylor <iant@google.com>
14244 * layout.cc (Layout::section_name_mapping): New array, replacing
14245 Layout::linkonce_mapping.
14246 (Layout::section_name_mapping_count): New variable, replacing
14247 Layout::linkonce_mapping_count.
14248 (Layout::linkonce_output_name): Remove.
14249 (Layout::output_section_name): Rewrite.
14250 * layout.h (class Layout): Rename Linkonce_mapping to
14251 Section_name_mapping, linkonce_mapping to section_name_mapping,
14252 linkonce_mapping_count to section_name_mapping_count. Don't
14253 declare linkonce_output_name.
14255 2009-06-03 Doug Kwan <dougkwan@google.com>
14257 * gold/arm.cc (namespace utils): New.
14258 (Target_arm::reloc_is_non_pic): Define new method.
14259 (class Arm_relocate_functions): New.
14260 (Target_arm::Relocate::relocate): Handle relocation types used by
14263 2009-06-03 Ian Lance Taylor <iant@google.com>
14265 * arm.cc (Target_arm::scan::global): Use || instead of |.
14267 2009-06-02 Doug Kwan <dougkwan@google.com>
14269 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14270 issued_non_pic_error_.
14271 (class Target_arm::Scan): Declare new method check_non_pic.
14272 Define new method symbol_needs_plt_entry.
14273 Declare new data member issued_non_pic_error_.
14274 (class Target_arm::Relocate): Declare new method
14275 should_apply_static_reloc.
14276 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14277 (Target_arm::Scan::check_non_pic): Define new method.
14278 (Target_arm::Scan::local): Handle a small subset of reloc types used
14280 (Target_arm::Scan::local): Same.
14281 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14283 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14285 * incremental.cc (Incremental_inputs::report_command_line): Filter
14286 out --incremental-* options.
14288 2009-05-29 Doug Kwan <dougkwan@google.com>
14290 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14292 (class Target_arm): Update comment.
14293 (Target_arm::Target_arm): Initialize new data members GOT_,
14294 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14295 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14296 and Target_arm::rel_dyn_section.
14297 Declare new_enum Target_arm::Got_type.
14298 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14300 Update commments for member do_dynsym_value.
14301 (Target_arm::got_size, Target_arm::plt_section,
14302 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14303 new methods inside class defintion.
14304 (Target_arm::got_section): Define new method.
14305 (Target_arm::rel_dyn_section): Same.
14306 (Output_data_plt_arm): New template class.
14307 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14308 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14309 (Output_data_plt_arm::add_entry): Same.
14310 (Output_data_plt_arm::first_plt_entry): Define new
14311 static data member for PLT instruction template.
14312 (Output_data_plt_arm::plt_entry): Same.
14313 (Output_data_plt_arm::do_write): Define new method.
14314 (Target_arm::make_plt_entry): Same.
14315 (Target_arm::do_finalize_sections): Same.
14316 (Target_arm::do_dynsym_value): Same.
14318 2009-05-28 Doug Kwan <dougkwan@google.com>
14320 * Makefile.am (TARGETSOURCES): Add arm.cc.
14321 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14322 * Makefile.in: Regenerate.
14323 * arm.cc: New file.
14324 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14326 2009-05-26 Doug Kwan <dougkwan@google.com>
14328 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14329 (General_options::check_excluded_libs): Strip off directories in
14330 archive name before matching like GNU ld does.
14331 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14332 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14333 (exclude_libs_test_LDFLAGS): Add linker option
14334 -Wl,--exclude-libs,libexclude_libs_test_3
14335 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14336 an explicit archive without using -l.
14337 (alt/libexclude_libs_test_3.a): New make rule.
14338 * testsuite/Makefile.in: Regenerate.
14339 * testsuite/exclude_libs_test.c : Declare lib3_default().
14341 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14342 * exclude_libs_test_3.c: New file.
14344 2009-05-26 Nick Clifton <nickc@redhat.com>
14346 * po/id.po: New Indonesian translation.
14347 * po/gold.pot: Updated template file.
14349 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14351 * testsuite/Makefile.am: Add -ffunction-sections to compile
14352 gc_comdat_test files. Add -Wl,--gc-sections to build
14354 * testsuite/Makefile.in: Regenerate.
14355 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14357 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14359 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14360 kept comdat section was garbage collected.
14361 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14362 * testsuite/Makefile.in: Regenerate.
14363 * testsuite/gc_comdat_test.sh: New file.
14364 * testsuite/gc_comdat_test_1.cc: New file.
14365 * testsuite/gc_comdat_test_2.cc: New file.
14367 2009-05-19 Doug Kwan <dougkwan@google.com>
14369 * archive.cc (Archive::Archive): Move constructor from archive.h
14370 to here. Initialize no_export_.
14371 (Archive::get_elf_object_for_member): Set no_export flag of object.
14372 * archive.h (Archive::Archive): Move constructor body to
14374 (Archive::no_export): New method.
14375 (Archive::no_export_): New field.
14376 * object.h (Object::Object): Initialize no_export_ to false.
14377 (Object::no_export, Object::set_no_export): New methods.
14378 (Object::no_export_): New field.
14379 * options.cc (General_options::parse_exclude_libs): New method.
14380 (General_options::check_excluded_libs) Same.
14381 * options.h (exclude_libs): New option.
14382 (General_options::check_excluded_libs): New method declaration.
14383 (General_options::excluded_libs_): New field.
14384 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14385 default or protected visibility if an object has no-export flag set.
14386 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14387 (check_SCRIPTS): Add exclude_libs_test.sh.
14388 (check_DATA): Add exclude_libs_test.syms.
14389 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14390 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14391 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14392 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14393 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14394 libexclude_libs_test_2.a): New rules.
14395 * testsuite/Makefile.in: Regenerate.
14396 * testsuite/exclude_libs_test.c: New file.
14397 * testsuite/exclude_libs_test.sh: Ditto.
14398 * testsuite/exclude_libs_test_1.c: Ditto.
14399 * testsuite/exclude_libs_test_2.c: Ditto.
14401 2009-05-15 Ian Lance Taylor <iant@google.com>
14403 * configure.ac: Check for declarations for cases where libiberty.h
14404 checks HAVE_DECL_xxx.
14405 * configure, config.in: Rebuild.
14407 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14409 * gold.h (Incremental_argument_list): Remove (invalid) forward
14411 * incremental.cc (Incremental_inputs::report_achive): New method.
14412 (Incremental_inputs::report_object): New method.
14413 (Incremental_inputs::report_script): New method.
14414 (Incremental_inputs::finalize_inputs): New method.
14415 (Incremental_inputs::finalize): Call finalize_inputs().
14416 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14417 Create inputs entries.
14418 * incremental.h (Incremental_input_type): New enum.
14419 (Incremental_inputs::Incremental_input): Initialize new fields.
14420 (Incremental_inputs::report_inputs): New method.
14421 (Incremental_inputs::report_achive): New method.
14422 (Incremental_inputs::report_object): New method.
14423 (Incremental_inputs::report_script): New method.
14424 (Incremental_inputs::finalize_inputs): New method.
14425 (Incremental_inputs::Input_info): New struct.
14426 (Incremental_inputs::Input_info_map): New typedef.
14427 (Incremental_inputs::lock_): New field.
14428 (Incremental_inputs::Inputs_): New field.
14429 (Incremental_inputs::Inputs_map): New field.
14430 * main.cc (main): Call Incremental_input::report_inputs.
14431 * options.h (Input_argument_list): Typedef moved from
14433 (Input_file_group::Files): Remove, use ::Input_argument_list.
14434 (Input_file_group::Input_argument_list): Remove, use
14435 ::Input_argument_list.
14436 * plugin.cc (Plugin_manager::add_input_file): Add error in
14438 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14440 * script.cc (read_input_script): Call
14441 Incremental_input::report_script.
14442 * script.h (Script_info): New class.
14444 2009-04-27 Ian Lance Taylor <iant@google.com>
14446 * x86_64.cc (do_adjust_output_section): Set entsize to
14449 2009-04-23 Elliott Hughes <enh@google.com>
14451 * output.cc (Output_file::close): After short writes, continue
14452 writing from the correct offset in the buffer being written.
14454 2009-04-23 Chris Demetriou <cgd@google.com>
14456 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14457 * configure: Regenerate.
14458 * config.in: Regenerate.
14459 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14460 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14462 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14464 * incremental.cc (Incremental_inputs_header_data): Renamed from
14465 Incremental_input_header_data.
14466 (Incremental_inputs_header_data::data_size): New field.
14467 (Incremental_inputs_header_data::put_input_file_count): Renamed
14468 from input_file_count.
14469 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14470 from command_line_offset.
14471 (Incremental_inputs_header_data::put_reserved): Renamed from
14473 (Incremental_inputs_entry_data): Renamed from
14474 Incremental_input_entry_data.
14475 (Incremental_inputs_entry_data::data_size): New field.
14476 (Incremental_inputs::report_command_line): New method.
14477 (Incremental_inputs::finalize): New method.
14478 (Incremental_inputs::create_incremental_inputs_data): New method.
14479 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14480 * incremental.h: New file.
14481 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14482 (Layout::finalize): Create incremental inputs section in
14483 incremental builds.
14484 (Layout::create_incremental_info_sections): New method.
14485 * layout.h (Layout::incremental_inputs): New method.
14486 (Layout::create_incremental_info_sections): New method.
14487 (Layout::incremental_inputs_): New field.
14488 * main.cc (main): Notify Incremental_input of the command line.
14490 2009-04-01 Ian Lance Taylor <iant@google.com>
14491 Mikolaj Zalewski <mikolajz@google.com>
14493 * gold.h (reserve_unordered_map): Define, three versions, one for
14494 each version of Unordered_map.
14495 * layout.cc (Layout::Layout): Remove options parameter. Add
14496 number_of_input_files parameter. Don't initialize options_.
14497 Initialize number_of_input_files_ and resized_signatures_. Move
14498 sections_are_attached_.
14499 (Layout::layout_group): Reserve space for group_signatures_.
14500 (Layout::find_or_add_kept_section): Change name parameter to be a
14501 reference. Resize signatures_ map when it gets large enough.
14502 (Layout::layout_eh_frame): Use parameters->options() instead of
14504 (Layout::make_output_section): Likewise.
14505 (Layout::attach_allocated_section_to_segment): Likewise.
14506 (Layout::finalize, Layout::create_executable_stack): Likewise.
14507 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14508 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14509 * layout.h (class Layout): Update declarations. Remove options_
14510 field. Add number_of_input_files_ and resized_signatures_
14511 fields. Move sections_are_attached_ field.
14512 * main.cc (main): Pass number of input files to Layout
14513 constructor. Don't pass options.
14515 2009-03-30 Ian Lance Taylor <iant@google.com>
14517 * ffsll.c (ffsll): Correct implementation.
14519 2009-03-27 Ian Lance Taylor <iant@google.com>
14521 * ffsll.c: New file.
14522 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14523 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14524 * ftruncate.c (ftruncate): Declare before definition.
14525 * mremap.c (mremap): Likewise.
14526 * pread.c (pread): Likewise.
14527 * configure, Makefile.in, config.in: Rebuild.
14529 * mremap.c: New file.
14530 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14531 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14532 (mremap): Declare if HAVE_MREMAP is not defined.
14533 * configure, Makefile.in, config.in: Rebuild.
14535 2009-03-27 Cary Coutant <ccoutant@google.com>
14537 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14538 position independent.
14539 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14540 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14542 2009-03-24 Cary Coutant <ccoutant@google.com>
14544 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14546 (needs_dynamic_reloc): Likewise.
14548 2009-03-24 Ian Lance Taylor <iant@google.com>
14550 * yyscript.y (file_cmd): Recognize EXTERN.
14551 (extern_name_list, extern_name_list_body): New nonterminals.
14552 * script.cc (script_add_extern): Define.
14553 * script-c.h (script_add_extern): Declare.
14555 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
14557 * object.cc (is_elf_object): Define.
14558 * object.h (is_elf_object): Declare.
14559 * archive.cc (Archive::get_elf_object_for_member): Call
14561 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14563 2009-03-24 Elliott Hughes <enh@google.com>
14565 * output.cc (Output_file::map_anonymous): Define.
14566 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14567 try an anonymous one. Report the size if the mmap fails.
14568 * output.h (class Output_file): Declare map_anonymous.
14570 2009-03-24 Ian Lance Taylor <iant@google.com>
14572 * target-select.cc (instantiate_target): Don't acquire the lock if
14573 the instantiated_target_ field has already been set.
14575 2009-03-23 Ian Lance Taylor <iant@google.com>
14577 * gold-threads.h (class Initialize_lock): Define.
14578 * gold-threads.cc (class Initialize_lock_once): Define.
14579 (initialize_lock_control): New static variable.
14580 (initialize_lock_pointer): New static variable.
14581 (initialize_lock_once): New static function.
14582 (Initialize_lock::Initialize_lock): Define.
14583 (Initialize_lock::initialize): Define.
14584 * target-select.h: Include "gold-threads.h".
14585 (class Target_selector): Add lock_ and initialize_lock_ fields.
14586 Don't define instantiate_target, just declare it.
14587 * target-select.cc (Target_selector::Target_selector): Initialize
14589 (Target_selector::instantiate_target): Define.
14590 * descriptors.h: Include "gold-threads.h".
14591 (class Descriptors): Add initialize_lock_ field.
14592 * descriptors.cc (Descriptors::Descriptors): Initialize new
14594 (Descriptors::open): Use initialize_lock_ field
14595 * errors.h (class Errors): Add initialize_lock_ field.
14596 * errors.cc (Errors::Errors): Initialize new field.
14597 (Errors::initialize_lock): Use initialize_lock_ field.
14598 * powerpc.cc (class Target_selector_powerpc): Remove
14599 instantiated_target_ field. In do_recognize call
14600 instantiate_target rather than do_instantiate_target. In
14601 do_instantiate_target just allocate a new target.
14602 * sparc.cc (class Target_selector_sparc): Likewise.
14604 * freebsd.h: New file.
14605 * i386.cc: Include "freebsd.h".
14606 (Target_i386): Derive from Target_freebsd rather than
14608 (Target_selector_i386): Derive from Target_selector_freebsd rather
14609 than Target_selector.
14610 * x86_64.cc: Include "freebsd.h".
14611 (Target_x86_64): Derive from Target_freebsd rather than
14613 (Target_selector_x86_64): Derive from Target_selector_freebsd
14614 rather than Target_selector.
14615 * target.h (class Target): Add adjust_elf_header and
14616 do_adjust_elf_header.
14617 * output.cc (Output_file_header:: do_sized_write): Call target
14618 adjust_elf_header routine.
14619 * configure.tgt: Set targ_osabi.
14620 * configure.ac: Define GOLD_DEFAULT_OSABI.
14621 * parameters.cc (Parameters::default_target): Pass
14622 GOLD_DEFAULT_OSABI to select_target.
14623 * target-select.h (class Target_selector): Make instantiate_target
14624 protected rather than private.
14625 * Makefile.am (HFILES): Add freebsd.h.
14626 * configure, Makefile.in, config.in: Rebuild.
14628 * merge.cc (do_add_input_section): Correct pend value. Change
14629 message about last entry not being null terminated from error to
14632 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14634 * incremental.cc: New file.
14635 * Makefile.am (CCFILES): Add incremental.cc.
14636 * Makefile.in: Rebuild.
14638 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14640 * layout.cc (Layout::output_section_name): Preserve names
14641 of '.note.' sections.
14643 2009-03-19 Ian Lance Taylor <iant@google.com>
14645 * descriptors.cc (Descriptors::open): Check that the options are
14646 valid before using them.
14648 2009-03-18 Ian Lance Taylor <iant@google.com>
14650 * script-sections.h: Include <list>.
14651 (class Script_sections): Change Sections_elements from std::vector
14652 to std::list. Typedef public Elements_iterator. Add
14653 orphan_section_placement_, data_segment_align_start_, and
14654 saw_data_segment_align_ fields. Remove data_segment_align_index_
14656 * script-sections.cc (class Orphan_section_placement): New class.
14657 (class Sections_element): Add virtual functions is_relro and
14658 orphan_section_init. Remove virtual function place_orphan_here.
14659 (class Output_section_definition): Add is_relro and
14660 orphan_section_init. Remove place_orphan_here.
14661 (class Orphan_output_section): Likewise.
14662 (Script_sections::Script_sections): Update for field changes.
14663 (Script_sections::data_segment_align): Set saw_data_segment_align_
14664 and data_segment_align_start_, not data_segment_align_index.
14665 (Script_sections::data_segment_relro_end): Check
14666 saw_data_segment_align_. Use data_segment_align_start_ rather
14667 than data_segment_align_index_.
14668 (Script_sections::place_orphan): Rewrite to use
14669 Orphan_section_placement.
14671 2009-03-17 Ian Lance Taylor <iant@google.com>
14673 * archive.cc (Archive::add_symbols): Check for a version attached
14674 to the symbol name in the archive map.
14675 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14676 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14677 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14678 (ver_test_11.a): New target.
14679 * testsuite/Makefile.in: Rebuild.
14681 * configure.ac: Check for chsize and posix_fallocate. Replace
14683 * ftruncate.c: New file, from gnulib.
14684 * output.cc (posix_fallocate): Define dummy version if not
14685 HAVE_POSIX_FALLOCATE.
14686 (Output_file::map): Call posix_fallocate rather than lseek and
14688 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14689 * configure, Makefile.in, config.in: Rebuild.
14691 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
14693 * layout.h (Layout::create_note): Add section_name parameter.
14694 * layout.cc (Layout::create_note): Likewise.
14695 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
14697 2009-03-17 Ian Lance Taylor <iant@google.com>
14699 * descriptors.cc: Include "options.h".
14700 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14701 (Descriptors::open): Always use O_CLOEXEC when opening a new
14702 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14703 then set FD_CLOEXEC.
14705 * sparc.cc (class Target_sparc): Add has_got_section.
14706 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14707 make sure we have a GOT section.
14709 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14710 (Target_sparc::Scan::local): Likewise.
14711 (Target_sparc::Scan::global): Likewise.
14712 (Target_sparc::Relocate::relocate): Likewise.
14713 (Target_sparc::Relocate::relocate_tls): Likewise.
14715 * symtab.cc (Symbol_table::define_default_version): New function,
14716 broken out of add_from_object.
14717 (Symbol_table::add_from_object): Call define_default_version.
14718 (Symbol_table::define_special_symbol): Add resolve_oldsym
14719 parameter. Change all callers. If the version for a symbol comes
14720 from a version script, resolve it with the symbol with the same
14721 name with no version. Also add the symbol without a version if
14723 (do_define_in_output_data): If resolving with oldsym, don't delete
14725 (do_define_in_output_segment): Likewise.
14726 (do_define_as_constant): Likewise.
14727 * symtab.h (class Symbol_table): Update declarations.
14729 2009-03-13 Ian Lance Taylor <iant@google.com>
14731 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14732 (Read_symbols::requeue): New function.
14733 (Read_symbols::do_read_symbols): If make_elf_object fails because
14734 the target type is not configured, and the file was searched for,
14735 issue a warning and retry with the next directory.
14736 (Add_symbols::run): If the file has an incompatible format, and
14737 it was searched for, requeue the Read_symbols task. On error,
14738 release the object.
14739 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14740 dirindex parameter to constructor. Change all callers. Declare
14741 incompatible_warning and requeue.
14742 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14743 input_argument_ and input_group_ fields. Add them to
14744 constructor. Change all callers.
14745 (class Read_script): Add dirindex_ field. Add it to constructor.
14746 Change all callers.
14747 * archive.cc (Archive::setup): Remove input_objects parameter.
14748 Change all callers.
14749 (Archive::get_file_and_offset): Likewise.
14750 (Archive::read_all_symbols): Likewise.
14751 (Archive::read_symbols): Likewise.
14752 (Archive::get_elf_object_for_member): Remove input_objects
14753 parameter. Add punconfigured parameter. Change all callers.
14754 (Archive::add_symbols): Change return type to bool. Check return
14755 value of include_member.
14756 (Archive::include_all_members): Likewise.
14757 (Archive::include_member): Change return type to bool. Return
14758 false if first included object has incompatible target. Set
14759 included_member_ field.
14760 (Add_archive_symbols::run): If add_symbols returns false, requeue
14762 * archive.h (class Archive): Add included_member_ field.
14763 Initialize it in constructor. Add input_file and searched_for
14764 methods. Update declarations.
14765 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14766 input_argument_ fields. Add them to constructor. Change all
14768 * script.cc: Include "target-select.h".
14769 (class Parser_closure): Add skip_on_incompatible_target_ and
14770 found_incompatible_target_ fields. Add
14771 skip_on_incompatible_target parameter to constructor. Change all
14772 callers. Add methods skip_on_incompatible_target,
14773 clear_skip_on_incompatible_target, found_incompatible_target, and
14774 set_found_incompatible_target.
14775 (read_input_script): Add dirindex parameter. Change all callers.
14776 If parser finds an incompatible target, requeue Read_symbols
14778 (script_set_symbol): Clear skip_on_incompatible_target in
14780 (script_add_assertion, script_parse_option): Likewise.
14781 (script_start_sections, script_add_phdr): Likewise.
14782 (script_check_output_format): New function.
14783 * script.h (read_input_script): Update declaration.
14784 * script-c.h (script_check_output_format): Declare.
14785 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14786 (ignore_cmd): Remove OUTPUT_FORMAT.
14787 * fileread.cc (Input_file::Input_file): Add explicit this.
14788 (Input_file::will_search_for): New function.
14789 (Input_file::open): Add pindex parameter. Change all callers.
14790 * fileread.h (class Input_file): Add input_file_argument method.
14791 Declare will_search_for. Update declarations.
14792 * object.cc (make_elf_object): Add punconfigured parameter.
14793 Change all callers.
14794 * object.h (class Object): Make input_file public. Add
14795 searched_for method.
14796 (make_elf_object): Update declaration.
14797 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14799 * dirsearch.h (class Dirsearch): Update declaration.
14800 * options.h (class General_options): Add --warn-search-mismatch.
14801 * parameters.cc (Parameters::is_compatible_target): New function.
14802 * parameters.h (class Parameters): Declare is_compatible_target.
14803 * workqueue.cc (Workqueue::add_blocker): New function.
14804 * workqueue.h (class Workqueue): Declare add_blocker.
14806 * fileread.cc (Input_file::open): Remove options parameter.
14807 Change all callers.
14808 (Input_file::open_binary): Likewise.
14809 * script.cc (read_input_script): Likewise.
14810 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14811 options parameter from constructor. Change all callers.
14812 (class Read_script): Likewise.
14813 * fileread.h (class Input_file): Update declarations.
14814 * script.h (read_input_script): Update declaration.
14816 2009-03-10 Nick Clifton <nickc@redhat.com>
14818 * po/es.po: New Spanish translation.
14820 2009-03-06 Cary Coutant <ccoutant@google.com>
14822 * options.cc (parse_short_option): Keep dash_z from registering itself.
14824 2009-03-03 Ian Lance Taylor <iant@google.com>
14827 * target-reloc.h (relocate_section): Pass output_section to
14829 * i386.cc (Target_i386::should_apply_static_reloc): Add
14830 output_section parameter. Change all callers.
14831 (Target_i386::Relocate::relocate): Add output_section parameter.
14832 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14833 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14834 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14835 * testsuite/two_file_shared.sh: New script.
14836 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14837 (check_DATA): Add two_file_shared.dbg.
14838 (two_file_shared.dbg): New target.
14839 * testsuite/Makefile.in: Rebuild.
14841 2009-03-01 Ian Lance Taylor <iant@google.com>
14843 * configure.ac: Check for byteswap.h.
14844 * configure: Rebuild.
14845 * config.in: Rebuild.
14847 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14849 * layout.cc (Layout::find_or_add_kept_section): New function.
14850 (Layout::add_comdat): Removed.
14851 * layout.h (struct Kept_section): Move out of class Layout.
14852 Remove trailing underscores from field names. Add group_sections
14853 field. Rename group_ field to is_group. Change all uses.
14854 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14855 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14856 comdat_groups_ field.
14857 (Sized_relobj::include_section_group): Use
14858 find_or_add_kept_section and Kept_section::group_sections.
14859 (Sized_relobj::include_linkonce_section): Likewise.
14860 * object.cc (class Sized_relobj): Don't define Comdat_group or
14861 Comdat_group_table. Remove find_comdat_group and
14862 add_comdat_group. Remove comdat_groups_ field.
14863 * plugin.cc (include_comdat_group): Use
14864 Layout::find_or_add_kept_section.
14866 2009-02-28 Ian Lance Taylor <iant@google.com>
14868 * README: --gc-sections and map files are now supported. Document
14869 some build requirements.
14872 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14873 relocatable link set the value of the section symbol to zero.
14874 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14875 relocatable link don't include the section address in the local
14878 2009-02-27 Ian Lance Taylor <iant@google.com>
14881 * options.h (class Search_directory): Add is_system_directory.
14882 (class General_options): Declare is_in_system_directory.
14883 * options.cc (get_relative_sysroot): Make static.
14884 (get_default_sysroot): Make static.
14885 (General_optoins::is_in_system_directory): New function.
14886 * fileread.cc (Input_file::is_in_system_directory): New function.
14887 * fileread.h (class Input_file): Declare is_in_system_directory.
14888 * object.h (class Object): Add is_in_system_directory.
14889 (class Input_objects): Remove system_library_directory_ field.
14890 * object.cc (Input_objects::add_object): Don't set
14891 system_library_directory_.
14892 (input_objects::found_in_system_library_directory): Remove.
14893 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14894 parameter. Change all callers.
14895 (Symbol_table::sized_write_globals): Likewise.
14896 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14897 Call Object::is_in_system_directory.
14898 * symtab.h (class Symbol_table): Update declarations.
14901 * descriptors.h (Open_descriptor): Add is_on_stack field.
14902 * descriptors.cc (Descriptors::open): If the descriptor is on the
14903 top of the stack, remove it. Initialize is_on_stack field.
14904 (Descriptors::release): Only add pod to stack if it is not on the
14906 (Descriptors::close_some_descriptor): Clear stack_next and
14907 is_on_stack fields.
14910 * output.cc (Output_section::find_starting_output_address): Rename
14911 from starting_output_address; add PADDR parameter; change return
14913 * output.h (class Output_section): Declare
14914 find_starting_output_address instead of starting_output_address.
14915 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14916 section symbol for which we can't find a merge section.
14919 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14920 hidden or internal, force the symbol to be local.
14921 * resolve.cc (Symbol::override_visibility): Define.
14922 (Symbol::override_base): Use override_visibility.
14923 (Symbol_table::resolve): Likewise.
14924 (Symbol::override_base_with_special): Likewise.
14925 (Symbol_table::override_with_special): If the visibility is hidden
14926 or internal, force the symbol to be local.
14927 * symtab.h (class Symbol): Add set_visibility and
14928 override_visibility.
14929 * testsuite/ver_test_1.sh: New file.
14930 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14931 (check_DATA): Add ver_test_1.syms.
14932 (ver_test_1.syms): New target.
14933 * testsuite/Makefile.in: Rebuild.
14935 2009-02-25 Cary Coutant <ccoutant@google.com>
14937 * layout.cc (Layout::choose_output_section): Don't rename sections
14938 when using a linker script that has a SECTIONS clause.
14939 * Makefile.in: Regenerate.
14941 * testsuite/Makefile.am (script_test_5.sh): New test case.
14942 * testsuite/Makefile.in: Regenerate.
14943 * testsuite/script_test_5.cc: New file.
14944 * testsuite/script_test_5.sh: New file.
14945 * testsuite/script_test_5.t: New file.
14947 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
14949 * archive.cc (Archive::include_member): Update calls to add_symbols.
14950 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14951 the Layout argument.
14952 * dynobj.h (do_add_symbols): Add the Layout argument.
14953 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14955 * object.h (Object::add_symbols): Add the Layout argument.
14956 (Object::do_add_symbols): Add the Layout argument.
14957 (Sized_relobj::do_add_symbols): Add the Layout argument.
14958 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14959 Unify the two versions.
14960 (Add_plugin_symbols): Remove.
14961 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14962 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14963 (Add_plugin_symbols): Remove.
14964 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14965 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14966 (Add_symbols::run): Make it work with Pulginobj.
14968 2009-02-06 Ian Lance Taylor <iant@google.com>
14970 * object.cc (Sized_relobj::do_layout): Make info message start
14971 with lower case letter.
14973 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14975 * binary.cc: Fix file comment.
14977 * options.h (enum Incremental_disposition): Define.
14978 (class General_options): Add new options: --incremental,
14979 --incremental_changed, --incremental_unchanged,
14980 --incremental_unknown. Add incremental_disposition_ and
14981 implicit_incremental_ fields.
14982 (General_options::incremental_disposition): New function.
14983 (class Position_dependent_options): Add incremental_disposition
14985 (Position_dependent_options::copy_from_options): Set incremental
14987 * options.cc (General_options::parse_incremental_changed): New
14989 (General_options::parse_incremental_unchanged): New function.
14990 (General_options::parse_incremental_unknown): New function.
14991 (General_options::General_options): Initialize new fields
14992 incremental_disposition_ and implicit_incremental_.
14993 (General_options::finalize): Check for uasge of --incremental-*
14994 without --incremental.
14996 2009-02-06 Chris Demetriou <cgd@google.com>
14998 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14999 pointer and to report location as the file name associated with
15001 (gold_undefined_symbol_at_location): New function to replace the
15002 old gold_undefined_symbol functionality.
15003 * target-reloc.h (relocate_section): Update to use
15004 gold_undefined_symbol_at_location.
15005 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15006 Call gold_undefined_symbol function rather than gold_error.
15007 * errors.h (Errors::undefined_symbol): Take location as a
15008 string, rather than calculating it from a relocation.
15009 * errors.cc (Errors::fatal): Print "fatal error:" before the
15011 (Errors::error, Errors::error_at_location): Print "error: "
15012 before the formatted message.
15013 (Errors::undefined_symbol): Take location as a string, rather
15014 than calculating it from a relocation.
15015 (gold_undefined_symbol_at_location): New function akin to
15016 old gold_undefined_symbol, calculates location from relocation.
15017 (gold_undefined_symbol): Change to take only a Symbol pointer
15018 and to report location as the file name associated with the symbol.
15019 * testsuite/debug_msg.sh: Update for changed error messages.
15020 * testsuite/undef_symbol.sh: Likewise.
15022 2009-02-04 Duncan Sands <baldrick@free.fr>
15025 * reduced_debug_output.h
15026 (Output_reduced_debug_abbrev_section::failed): Use format for
15028 (Output_reduced_debug_info_section::faild): Likewise.
15030 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15032 * script.cc (Lazy_demangler): New class.
15033 (Version_script_info::get_symbol_version_helper): Demangle a
15036 2009-01-29 Cary Coutant <ccoutant@google.com>
15038 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15040 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15042 2009-01-28 Ian Lance Taylor <iant@google.com>
15044 * version.cc (version_string): Bump to 1.9.
15046 * gold.h: Include <cstring> and <stdint.h>.
15047 * version.cc: Include <cstdio>.
15048 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15050 * reduced_debug_output.cc (insert_into_vector): Rename from
15051 Insert_into_vector; change all callers. Use Swap_unaligned to
15052 avoid aliasing issue; remove union since it is unnecessary.
15054 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15056 * Makefile.am (CCFILES): Add gc.cc.
15057 (HFILES): Add gc.h.
15058 * Makefile.in: Regenerate.
15059 * gold.cc (Gc_runner): New class.
15060 (queue_initial_tasks): Call garbage collection related tasks
15061 when corresponding options are invoked.
15062 (queue_middle_gc_tasks): New function.
15063 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15064 processed early before laying out sections during garbage collection.
15065 * gold.h (queue_middle_gc_tasks): New function.
15066 (is_prefix_of): Move from "layout.cc".
15067 * i386.cc (Target_i386::gc_process_relocs): New function.
15068 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15069 * main.cc (main): Create object of class "Garbage_collection".
15070 * object.cc (Relobj::copy_symbols_data): New function.
15071 (Relobj::is_section_name_included): New function.
15072 (Sized_relobj::do_layout): Allow this function to be called twice
15073 during garbage collection and defer layout of section during the
15075 * object.h (Relobj::get_symbols_data): New function.
15076 (Relobj::is_section_name_included): New function.
15077 (Relobj::copy_symbols_data): New function.
15078 (Relobj::set_symbols_data): New function.
15079 (Relobj::get_relocs_data): New function.
15080 (Relobj::set_relocs_data): New function.
15081 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15082 (Relobj::gc_process_relocs): New function.
15083 (Relobj::do_gc_process_relocs): New pure virtual function.
15084 (Relobj::sd_): New data member.
15085 (Sized_relobj::is_output_section_offset_invalid): New function.
15086 (Sized_relobj::do_gc_process_relocs): New function.
15087 * options.h (General_options::gc_sections): Modify to not be a no-op.
15088 (General_options::print_gc_sections): New option.
15089 * plugin.cc (Plugin_finish::run): Remove function call to
15090 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15091 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15092 * reloc.cc (Read_relocs::run): Add task to process relocs and
15093 determine unreferenced sections when doing garbage collection.
15094 (Gc_process_relocs): New class.
15095 (Sized_relobj::do_gc_process_relocs): New function.
15096 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15097 sections that are garbage collected.
15098 * reloc.h (Gc_process_relocs): New class.
15099 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15100 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15101 symbols whose corresponding sections are garbage collected.
15102 (Symbol_table::Symbol_table): Add new parameter for the garbage
15104 (Symbol_table::gc_mark_undef_symbols): New function.
15105 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15106 (Symbol_table::gc_mark_dyn_syms): New function.
15107 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15109 (Symbol_table::add_from_object): Likewise.
15110 (Symbol_table::add_from_relobj): When building shared objects, do not
15111 treat externally visible symbols as garbage.
15112 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15113 table information for static and relocatable links.
15114 * symtab.h (Symbol_table::set_gc): New function.
15115 (Symbol_table::gc): New function.
15116 (Symbol_table::gc_mark_undef_symbols): New function.
15117 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15118 (Symbol_table::gc_mark_dyn_syms): New function.
15119 (Symbol_table::gc_): New data member.
15120 * target.h (Sized_target::gc_process_relocs): New pure virtual
15122 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15123 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15125 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15127 * options.h (General_options::gc_sections): Define as a no-op for now.
15128 (General_options::no_keep_memory): Ditto.
15129 (General_options::Bshareable): Define.
15130 * options.cc (General_options::finalize): Honor -Bshareable.
15132 2009-01-20 Andreas Schwab <schwab@suse.de>
15134 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15135 read the value in the contents, since we don't use it. Use the
15136 template endianness when writing.
15137 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15139 2009-01-19 Andreas Schwab <schwab@suse.de>
15141 * configure.tgt (powerpc64-*): Fix targ_obj.
15143 2009-01-15 Ian Lance Taylor <iant@google.com>
15145 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15146 local symbols when stripping all symbols.
15148 2009-01-14 Cary Coutant <ccoutant@google.com>
15150 * output.cc (Output_reloc): Add explicit instantiations.
15152 2009-01-14 Cary Coutant <ccoutant@google.com>
15154 * archive.cc (Archive::get_elf_object_for_member): Remove call
15155 to File_read::claim_for_plugin.
15156 * descriptors.cc (Descriptors::open): Remove reference to
15158 (Descriptors::claim_for_plugin): Remove.
15159 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15160 (Descriptors::is_claimed): Remove.
15161 (claim_descriptor_for_plugin): Remove.
15162 * fileread.cc (File_read::claim_for_plugin): Remove.
15163 * fileread.h (File_read::claim_for_plugin): Remove.
15164 (File_read::descriptor): Reopen descriptor if necessary.
15165 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15166 (Plugin_manager::all_symbols_read): Add task parameter. Change
15168 (Plugin_manager::get_input_file): New function.
15169 (Plugin_manager::release_input_file): New function.
15170 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15171 corresponding data member.
15172 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15173 and pass to base constructor. Change all callers.
15174 (get_input_file, release_input_file): New functions.
15175 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15176 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15177 (Plugin_manager::all_symbols_read): Add task parameter.
15178 (Plugin_manager::get_input_file): New function.
15179 (Plugin_manager::release_input_file): New function.
15180 (Plugin_manager::task_): New data member.
15181 (Pluginobj::Pluginobj): Add filesize parameter.
15182 (Pluginobj::filename): New function.
15183 (Pluginobj::descriptor): New function.
15184 (Pluginobj::filesize): New function.
15185 (Pluginobj::filesize_): New data member.
15186 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15187 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15188 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15190 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15191 with archive libraries.
15192 * testsuite/Makefile.in: Regenerate.
15193 * testsuite/plugin_test.c (struct sym_info): New type.
15194 (get_input_file, release_input_file): New static variables.
15195 (onload): Capture new transfer vector entries.
15196 (claim_file_hook): Stop reading at end of file according to filesize.
15197 Factor out parsing of readelf output into separate function.
15198 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15199 APIs and get the source file name from the symbol table. Convert
15200 source file name to corresponding object file name. Print info
15201 message when adding new input files.
15202 (parse_readelf_line): New function.
15203 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15204 * testsuite/plugin_test_2.sh: Likewise.
15205 * testsuite/plugin_test_3.sh: Likewise.
15206 * testsuite/plugin_test_4.sh: New test case.
15208 2009-01-07 Ian Lance Taylor <iant@google.com>
15210 * version.cc (version_string): Bump to 1.8.
15212 2008-12-23 Cary Coutant <ccoutant@google.com>
15214 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15215 * plugin.cc (Plugin_manager::finish): Rename as
15216 layout_deferred_objects. Move cleanup to separate function.
15217 (Plugin_manager::cleanup): New function.
15218 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15220 * plugin.h (Plugin_manager::finish): Rename as
15221 layout_deferred_objects.
15222 (Plugin_manager::cleanup): New function.
15223 (Plugin_manager::cleanup_done): New field.
15225 2008-12-23 Cary Coutant <ccoutant@google.com>
15227 * plugin.cc (is_visible_from_outside): New function.
15228 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15229 so we don't return "IR only" status for exported symbols or -r links.
15231 * testsuite/Makefile.am (plugin_test_3): New test case.
15232 * testsuite/Makefile.in: Regenerate.
15233 * testsuite/plugin_test_3.sh: New file.
15235 2008-12-22 Cary Coutant <ccoutant@google.com>
15237 * object.cc (Sized_relobj::layout_section): New function.
15238 (Sized_relobj::do_layout): Defer layout of input sections until after
15239 plugin has provided replacement files.
15240 (Sized_relobj::do_layout_deferred_sections): New function.
15241 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15242 (Relobj::layout_deferred_sections): New function.
15243 (Relobj::do_layout_deferred_sections): New function.
15244 (Sized_relobj::do_layout_deferred_sections): New function.
15245 (Sized_relobj::layout_section): New function.
15246 (Sized_relobj::Deferred_layout): New structure.
15247 (Sized_relobj::deferred_layout_): New field.
15248 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15249 Change all callers. Layout deferred sections.
15250 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15252 (Plugin_hook::run): Move code from do_plugin_hook inline.
15253 (Plugin_hook::do_plugin_hook): Remove.
15254 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15255 (Plugin_manager::finish): Renamed, was cleanup.
15256 (Plugin_manager::should_defer_layout): New function.
15257 (Plugin_manager::add_deferred_layout_object): New function.
15258 (Plugin_manager::Deferred_layout_list): New type.
15259 (Plugin_manager::deferred_layout_objects_): New field.
15260 (Plugin_hook::do_plugin_hook): Remove.
15262 2008-12-17 Ian Lance Taylor <iant@google.com>
15264 * options.h (class General_options): Add --no case for
15267 2008-12-16 Cary Coutant <ccoutant@google.com>
15269 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15271 (Plugin_manager::claim_file): Create plugin object even if
15272 plugin did not call the add_symbols callback.
15273 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15274 asking for more symbols than were added.
15275 * testsuite/Makefile.am (plugin_test_1): Add test case with
15277 (empty.syms): New target.
15278 * testsuite/Makefile.in: Regenerate.
15279 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15280 message. Don't call add_symbols if no globals.
15281 (all_symbols_read_hook): Don't provide replacement for empty
15284 2008-12-12 Ian Lance Taylor <iant@google.com>
15286 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15287 r_type == 0 for a local symbol with r_sym == 0.
15288 (scan_relocatable_relocs): Pass r_sym to
15289 local_non_section_strategy.
15290 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15293 * configure.ac: Update test for TLS descriptors: they are
15294 supported as of glibc 2.9.
15295 * configure: Rebuild.
15297 2008-12-11 Ian Lance Taylor <iant@google.com>
15300 * target-reloc.h (Default_scan_relocatable_relocs): For each
15301 function, map r_type == 0 to RELOC_DISCARD.
15303 2008-12-10 Cary Coutant <ccoutant@google.com>
15305 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15306 object to override a kept COMDAT group from a plugin object.
15308 2008-12-09 Ian Lance Taylor <iant@google.com>
15311 * yyscript.y (file_cmd): Handle INPUT.
15313 * testsuite/initpri1.c: Change all declarations to be full
15314 prototypes by adding void, to avoid compiler warnings.
15316 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15318 * options.cc (General_options::parse_plugin_opt): New.
15319 (General_options::add_plugin): The argument now is just the filename.
15320 (General_options::add_plugin_option): New.
15321 * options.h (plugin_opt): New.
15322 (add_plugin): Change argument name.
15323 (add_plugin_option): New.
15324 * plugin.cc (Plugin::load): Don't parse the plugin option.
15325 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15326 (Plugin::add_option): New.
15327 (Plugin::args_): Change type.
15328 (Plugin::filename_): New.
15329 (Plugin_manager::add_plugin_option): New.
15330 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15331 * testsuite/Makefile.in: Regenerate.
15333 2008-12-05 Cary Coutant <ccoutant@google.com>
15335 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15336 Handle --strip-lto-sections option.
15337 * options.h (strip_lto_sections): New option.
15339 2008-12-01 Cary Coutant <ccoutant@google.com>
15341 * plugin.cc (ld_plugin_message): Change format parameter to const.
15342 Fix mismatch between new[] and delete.
15344 2008-11-14 Cary Coutant <ccoutant@google.com>
15346 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15349 2008-11-05 Craig Silverstein <csilvers@google.com>
15351 * options.cc (General_options::parse_dynamic_list): New function.
15352 * options.h (General_options): New flags dynamic_list,
15353 dynamic_list_data, dynamic_list_cpp_new, and
15354 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15355 (General_options::in_dynamic_list): New function.
15356 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15357 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15358 (Lex::can_continue_name): Likewise.
15360 (read_script_file): New parameter script_options.
15361 (read_dynamic_list): New function.
15362 (Script_options::define_dynamic_list): New function.
15363 (dynamic_list_keyword_parsecodes): New variable.
15364 (dynamic_list_keywords): New variable.
15365 * script.h (Script_options::define_dynamic_list): New function
15367 (read_dynamic_list): New function prototype.
15368 * symtab.cc (strprefix): New macro.
15369 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15370 dynamic_list_data, dynamic_list_cpp_new, and
15371 dynamic_list_cpp_typeinfo.
15372 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15373 (dynamic_list_expr): New rule.
15374 (dynamic_list_nodes): Likewise.
15375 (dynamic_list_node): Likewise.
15376 * testsuite/Makefile.am (dynamic_list): New test.
15377 * testsuite/Makefile.in: Regenerated.
15378 * testsuite/dynamic_list.t: New file.
15379 * testsuite/dynamic_list.sh: New file.
15381 2008-11-05 Craig Silverstein <csilvers@google.com>
15383 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15384 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15385 (t11_last): Likewise.
15386 * testsuite/ver_test_6.c (main): Likewise.
15388 2008-10-07 Cary Coutant <ccoutant@google.com>
15390 * options.c (General_options::finalize): Add check for -static and
15392 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15395 2008-10-02 Cary Coutant <ccoutant@google.com>
15397 * plugin.cc (make_sized_plugin_object): Fix conditional
15398 compilation to work when not all targets are enabled.
15400 2008-09-29 Cary Coutant <ccoutant@google.com>
15402 * archive.cc (Archive::get_file_and_offset): Use filename instead
15403 of name to get library path.
15404 (Archive::include_member): Unlock external member of a thin archive.
15406 * testsuite/Makefile.am (TEST_AR): New variable.
15407 (thin_archive_test_1): New test.
15408 (thin_archive_test_2): New test.
15409 * testsuite/Makefile.in: Regenerate.
15410 * testsuite/thin_archive_main.cc: New file.
15411 * testsuite/thin_archive_test_1.cc: New file.
15412 * testsuite/thin_archive_test_2.cc: New file.
15413 * testsuite/thin_archive_test_3.cc: New file.
15414 * testsuite/thin_archive_test_4.cc: New file.
15416 2008-09-29 Cary Coutant <ccoutant@google.com>
15418 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15419 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15421 (Sized_relobj::do_finalize_local_symbols): Likewise.
15422 (Sized_relobj::map_to_kept_section): Likewise.
15423 * object.h (Sized_relobj::invalid_address): New constant.
15424 (Sized_relobj::do_output_section_offset): Check for invalid_address
15426 * output.cc (Output_reloc::local_section_offset): Use constant
15427 invalid_address instead of -1U.
15428 (Output_reloc::get_address): Likewise.
15429 (Output_section::output_address): Change -1U to -1ULL.
15430 * output.h (Output_reloc::invalid_address): New constant.
15431 * reloc.cc (Sized_relobj::write_sections): Use constant
15432 invalid_address instead of -1U.
15433 (Sized_relobj::relocate_sections): Likewise.
15434 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15435 values for merge sections.
15436 * target-reloc.h (relocate_for_relocatable): Use constant
15437 invalid_address instead of -1U.
15439 2008-09-19 Cary Coutant <ccoutant@google.com>
15441 Add plugin functionality for link-time optimization (LTO).
15442 * configure.ac (plugins): Add --enable-plugins option.
15443 * configure: Regenerate.
15444 * config.in: Regenerate.
15445 * Makefile.am (LIBDL): New variable.
15446 (CCFILES): Add plugin.cc.
15447 (HFILES): Add plugin.h.
15448 (ldadd_var): Add LIBDL.
15449 * Makefile.in: Regenerate.
15451 * archive.cc: Include "plugin.h".
15452 (Archive::setup): Don't preread archive symbols when using a plugin.
15453 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15454 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15456 (Archive::include_member): Add symbols from plugin objects.
15457 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15458 * descriptors.cc (Descriptors::open): Check for file descriptors
15459 abandoned by plugins.
15460 (Descriptors::claim_for_plugin): New function.
15461 * descriptors.h (Descriptors::claim_for_plugin): New function.
15462 (Open_descriptor::is_claimed): New field.
15463 (claim_descriptor_for_plugin): New function.
15464 * fileread.cc (File_read::claim_for_plugin): New function.
15465 * fileread.h (File_read::claim_for_plugin): New function.
15466 (File_read::descriptor): New function.
15467 * gold.cc: Include "plugin.h".
15468 (queue_initial_tasks): Add task to call plugin hooks for generating
15470 * main.cc: Include "plugin.h".
15471 (main): Load plugin libraries.
15472 * object.h (Pluginobj): Declare.
15473 (Object::pluginobj): New function.
15474 (Object::do_pluginobj): New function.
15475 (Object::set_target): New function.
15476 * options.cc: Include "plugin.h".
15477 (General_options::parse_plugin): New function.
15478 (General_options::General_options): Initialize plugins_ field.
15479 (General_options::add_plugin): New function.
15480 * options.h (Plugin_manager): Declare.
15481 (General_options): Add --plugin option.
15482 (General_options::has_plugins): New function.
15483 (General_options::plugins): New function.
15484 (General_options::add_plugin): New function.
15485 (General_options::plugins_): New field.
15486 * plugin.cc: New file.
15487 * plugin.h: New file.
15488 * readsyms.cc: Include "plugin.h".
15489 (Read_symbols::do_read_symbols): Check for archive before checking
15490 for ELF file. Call plugin hooks to claim files.
15491 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15492 from a real object file; force override when processing replacement
15494 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15495 (Symbol::init_base_object): Likewise.
15496 (Symbol::init_base_output_data): Likewise.
15497 (Symbol::init_base_output_segment): Likewise.
15498 (Symbol::init_base_constant): Likewise.
15499 (Symbol::init_base_undefined): Likewise.
15500 (Symbol::output_section): Assert that object is not a plugin.
15501 (Symbol_table::add_from_pluginobj): New function.
15502 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15504 (Symbol_table::sized_write_globals): Likewise.
15505 (Symbol_table::add_from_pluginobj): Instantiate template.
15506 * symtab.h (Sized_pluginobj): Declare.
15507 (Symbol::in_real_elf): New function.
15508 (Symbol::set_in_real_elf): New function.
15509 (Symbol::in_real_elf_): New field.
15510 (Symbol_table::add_from_pluginobj): New function.
15512 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15513 (LIBDL): New variable.
15514 (LDADD): Add LIBDL.
15515 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15516 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15517 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15518 (MOSTLYCLEANFILES): Likewise.
15519 * testsuite/Makefile.in: Regenerate.
15520 * testsuite/plugin_test.c: New file.
15521 * testsuite/plugin_test_1.sh: New file.
15522 * testsuite/plugin_test_2.sh: New file.
15524 2008-09-16 Ian Lance Taylor <iant@google.com>
15526 * target-reloc.h (relocate_section): Check whether a symbol is
15527 defined by the ABI before reporting an undefined symbol error.
15528 * target.h (Target::is_defined_by_abi): Make parameter const.
15529 (Target::do_is_defined_by_abi): Likewise.
15530 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15531 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15532 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15533 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15534 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15535 * testsuite/Makefile.in: Rebuild.
15537 * fileread.cc (make_view): Add casts to avoid warning.
15539 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15541 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15542 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15544 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15546 * options.h (General_options::output_is_executable): New.
15547 (General_options::output_is_pie): New.
15548 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15549 for shared libraries.
15550 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15552 2008-09-11 Chris Demetriou <cgd@google.com>
15554 * options.h (origin): New -z option.
15555 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15556 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15559 2008-09-05 Cary Coutant <ccoutant@google.com>
15561 * fileread.cc (File_read::make_view): Add check for attempt to map
15562 beyond end of file.
15564 2008-09-05 Cary Coutant <ccoutant@google.com>
15566 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15567 explicit instantiations.
15569 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15572 * options.cc (General_options::finalize): Allow undefined symbols
15573 in shlibs if linking -shared.
15576 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15577 symbols as not needing a dynsym entry.
15579 2008-08-20 Craig Silverstein <csilvers@google.com>
15581 * fileread.cc (File_read::open): Do not lock the file unless it
15582 was successfully opened.
15584 2008-08-14 Cary Coutant <ccoutant@google.com>
15586 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15587 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15588 * testsuite/tls_test.cc (struct int128): 128-bit struct
15589 for testing TLS relocs with non-zero addend.
15590 (v12): New TLS variable.
15592 (t_last): Add check for v12.
15593 * testsuite/tls_test.h (t12): New function.
15594 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15596 2008-08-13 Ian Lance Taylor <iant@google.com>
15598 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15599 set tls_segment_ or relro_segment_.
15600 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15602 * output.h (Output_section::clear_is_relro): New function.
15603 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15604 sections specially even when output_data_ is empty.
15605 (Output_segment::maximum_alignment): When first section is relro,
15606 only force alignment for PT_LOAD segments.
15607 * script.cc (script_data_segment_align): New function.
15608 (script_data_segment_relro_end): New function.
15609 * script-c.h (script_data_segment_align): Declare.
15610 (script_data_segment_relro_end): Declare.
15611 * script-sections.h (class Script_sections): Declare
15612 data_segment_align and data_segment_relro_end. Add fields
15613 segment_align_index_ and saw_relro_end_.
15614 * script-sections.cc (class Sections_element): Add set_is_relro
15615 virtual function. Add new bool* parameter to place_orphan_here.
15616 Add get_output_section virtual function.
15617 (class Output_section_definition): Add set_is_relro. Add new
15618 bool* parameter to place_orphan_here. Add get_output_section.
15619 Add is_relro_ field.
15620 (Output_section_definition::Output_section_definition): Initialize
15621 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15622 and is_relro_ fields.
15623 (Output_section_definition::place_orphan_here): Add is_relro
15625 (Output_section_definition::set_section_addresses): Set relro for
15627 (Output_section_definition::alternate_constraint): Likewise.
15628 (class Orphan_output_section): Add new bool* parameter to
15629 place_orphan_here. Add get_output_section.
15630 (Orphan_output_section::place_orphan_here): Add is_relro
15632 (Script_sections::Script_sections): Initialize
15633 data_segment_align_index_ and saw_relro_end_.
15634 (Script_sections::data_segment_align): New function.
15635 (Script_sections::data_segment_relro_end): New function.
15636 (Script_sections::place_orphan): Set or clear is_relro.
15637 (Script_sections::set_section_addresses): Force alignment of first
15639 * yyscript.y (exp): Call script_data_segment_align and
15640 script_data_segment_relro_end.
15641 * testsuite/relro_script_test.t: New file.
15642 * testsuite/relro_test.cc (using_script): Declare.
15643 (t1, t2): Test using_script.
15644 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15645 (relro_script_test_SOURCES): Define.
15646 (relro_script_test_DEPENDENCIES): Define.
15647 (relro_script_test_LDFLAGS): Define.
15648 (relro_script_test_LDADD): Define.
15649 (relro_script_test.so): New target.
15650 * testsuite/Makefile.in: Rebuild.
15652 2008-08-06 Cary Coutant <ccoutant@google.com>
15654 * archive.cc (Archive::total_archives, Archive::total_members)
15655 (Archive::total_members_loaded): New variables.
15656 (Archive::setup): Add parameter. Add option to preread
15658 (Archive::read_armap): Add counter.
15659 (Archive::get_file_and_offset): New function.
15660 (Archive::get_elf_object_for_member): New function.
15661 (Archive::read_all_symbols): New function.
15662 (Archive::read_symbols): New function.
15663 (Archive::add_symbols): Add counters.
15664 (Archive::include_all_members): Use armap to find members if it's
15666 (Archive::include_member): Skip reading symbols if already read.
15667 Factored code into Archive::get_file_and_offset and
15668 Archive::get_elf_object_for_member. Changed call to
15669 Mapfile::report_include_archive_member.
15670 (Archive::print_stats): New function.
15671 * archive.h: Declare Object and Read_symbols_data classes.
15672 (Archive::Archive): Add initializers for new members.
15673 (Archive::setup): Add parameter.
15674 (Archive::print_stats): New function.
15675 (Archive::total_archives, Archive::total_members)
15676 (Archive::total_members_loaded): New variables.
15677 (Archive::get_file_and_offset): New function.
15678 (Archive::get_elf_object_for_member): New function.
15679 (Archive::read_all_symbols): New function.
15680 (Archive::read_symbols): New function.
15681 (Archive::Archive_member): New class.
15682 (Archive::members_): New member.
15683 (Archive::num_members_): New member.
15684 * main.cc: Include archive.h.
15685 (main): Call Archive::print_stats.
15686 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15687 archive parameter; member_name is now the fully-decorated name.
15688 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15689 * options.h: (General_options): Add --preread-archive-symbols option.
15690 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15693 2008-08-04 Ian Lance Taylor <iant@google.com>
15695 * symtab.h (Symbol::use_plt_offset): New function.
15696 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15697 * powerpc.cc (Relocate::relocate): Likewise.
15698 * sparc.cc (Relocate::relocate): Likewise.
15699 * x86_64.cc (Relocate::relocate): Likewise.
15700 * testsuite/weak_plt.sh: New test.
15701 * testsuite/weak_plt_main.cc: New test.
15702 * testsuite/weak_plt_shared.cc: New test.
15703 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15704 (check_PROGRAMS): Add weak_plt.
15705 (check_DATA): Add weak_plt_shared.so.
15706 (weak_plt_main_pic.o, weak_plt): New targets.
15707 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15708 * testsuite/Makefile.in: Rebuild.
15710 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15712 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15713 * testsuite/Makefile.in: Rebuild.
15715 2008-08-04 Alan Modra <amodra@bigpond.net.au>
15717 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15718 * Makefile.in: Regenerate.
15719 * po/POTFILES.in: Regenerate.
15721 2008-07-29 Ian Lance Taylor <iant@google.com>
15723 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15724 symbols before other symbols.
15725 * testsuite/script_test_2.cc (test_addr): Declare.
15726 (test_addr_alias): Declare.
15727 (main): Check that test_addr and test_addr_alias have the right
15729 * testsuite/script_test_2.t: Define test_addr_alias and
15732 2008-07-24 Ian Lance Taylor <iant@google.com>
15735 * descriptors.cc: New file.
15736 * descriptors.h: New file.
15737 * gold-threads.h (class Hold_optional_lock): New class.
15738 * fileread.cc: Include "descriptors.h".
15739 (File_read::~File_read): Release descriptor rather than closing
15741 (File_read::open) [file]: Call open_descriptor rather than open.
15742 Set is_descriptor_opened_.
15743 (File_read::open) [memory]: Assert that descriptor is not open.
15744 (File_read::reopen_descriptor): New function.
15745 (File_read::release): Release descriptor.
15746 (File_read::do_read): Make non-const. Reopen descriptor.
15747 (File_read::read): Make non-const.
15748 (File_read::make_view): Reopen descriptor.
15749 (File_read::do_readv): Likewise.
15750 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15751 Update declarations.
15752 * layout.cc: Include "descriptors.h".
15753 (Layout::create_build_id): Use open_descriptor rather than open.
15754 * output.cc: Include "descriptors.h".
15755 (Output_file::open): Use open_descriptor rather than open.
15756 * archive.cc (Archive::const_iterator): Change Archive to be
15758 (Archive::begin, Archive::end): Make non-const.
15759 (Archive::count_members): Likewise.
15760 * archive.h (class Archive): Update declarations.
15761 * object.h (Object::read): Make non-const.
15762 * Makefile.am (CCFILES): Add descriptors.cc.
15763 (HFILES): Add descriptors.h.
15764 * Makefile.in: Rebuild.
15767 * gold.h: Always include <clocale>. Add Solaris workarounds
15768 following code in binutils/sysdep.h.
15771 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15772 this->eh_frame_hdr_ is NULL before using it.
15774 * dynobj.cc (Versions::Versions): Update comment.
15776 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15777 the base version name.
15779 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15780 array size plus one.
15781 (Stringpool_template::set_string_offsets): Subtract one from key
15782 before using it as an array index.
15783 (Stringpool_template::get_offset_with_length): Likewise.
15784 (Stringpool_template::write_to_buffer): Likewise.
15785 * stringpool.h (Stringpool_template::get_offset_from_key):
15788 2008-07-23 Ian Lance Taylor <iant@google.com>
15791 * object.h (Merged_symbol_value::value): Do our best to handle a
15795 * script.cc (Version_script_info::get_versions): Don't add empty
15796 version tag to return value.
15797 (Version_script_info::get_symbol_version_helper): Change return
15798 type to bool. Add pversion parameter. Change all callers.
15799 (script_register_vers_node): Don't require a non-NULL tag.
15800 * script.h (class Version_script_info): Update declarations.
15801 (Version_script_info::get_symbol_version): Change return type to
15802 bool. Add version parameter. Change all callers.
15803 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15804 handling. Handle an empty version from a version script.
15805 (Symbol_table::define_special_symbol): Likewise.
15806 * testsuite/ver_test_10.script: New file.
15807 * testsuite/ver_test_10.sh: New file.
15808 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15809 (check_DATA): Add ver_test_10.syms.
15810 (ver_test_10.syms, ver_test_10.so): New target.
15811 * testsuite/Makefile.in: Rebuild.
15813 2008-07-23 Simon Baldwin <simonb@google.com>
15815 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15816 to zero for undefined symbols from dynamic libraries.
15818 2008-07-23 Ian Lance Taylor <iant@google.com>
15820 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15821 Change all callers.
15822 * symtab.h (class Symbol_table): Update declaration.
15823 * testsuite/ver_test_9.cc: New file.
15824 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15825 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15826 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15827 (ver_test_9.so, ver_test_9.o): New targets.
15828 * testsuite/Makefile.in: Rebuild.
15830 2008-07-22 Ian Lance Taylor <iant@google.com>
15832 * options.h (class General_options): Define --check-sections.
15833 * layout.cc (Layout::set_segment_offsets): Handle
15836 * options.h (class General_options): Define -n/--nmagic and
15838 * options.cc (General_options::finalize): For -n/--nmagic or
15839 -N/--omagic, set -static.
15840 * layout.cc (Layout::attach_allocated_section_to_segment): If
15841 -N/--omagic, don't put read-only and read-write sections in
15842 different segments.
15843 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15844 finding a read-only segment.
15845 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15846 don't set the minimum segment alignment to the common page size,
15847 and don't set the file offset to the address modulo the page size.
15848 * script-sections.cc (Script_sections::create_segments): If
15849 -n/--omagic, don't put read-only and read-write sections in
15850 different segments.
15852 * cref.cc: New file.
15853 * cref.h: New file.
15854 * options.h (class General_options): Add --print-symbol-counts.
15855 * main.cc (main): Issue defined symbol report if requested.
15856 * archive.cc (Archive::interpret_header): Make into a const member
15858 (Archive::add_symbols): Call Input_objects::archive_start and
15860 (Archive::const_iterator): Define new class.
15861 (Archive::begin, Archive::end): New functions.
15862 (Archive::include_all_members): Rewrite to use iterator.
15863 (Archive::count_members): New function.
15864 * archive.h (class Archive): Update declarations.
15865 (Archive::filename): New function.
15866 * object.cc: Include "cref.h".
15867 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15868 (Sized_relobj::do_get_global_symbol_counts): New function.
15869 (Input_objects::add_object): Add object to cross-referencer.
15870 (Input_objects::archive_start): New function.
15871 (Input_objects::archive_stop): New function.
15872 (Input_objects::print_symbol_counts): New function.
15873 * object.h: Declare Cref and Archive.
15874 (Object::get_global_symbol_counts): New function.
15875 (Object::do_get_global_symbol_counts): New pure virtual function.
15876 (class Sized_relobj): Add defined_count_ field. Update
15878 (class Input_objects): Add cref_ field. Update constructor.
15879 Update declarations.
15880 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15882 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15884 (Sized_dynobj::do_get_global_symbol_counts): New function.
15885 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15886 defined_count_. Update declarations. Define Symbols typedef.
15887 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15888 parameter. Change all callers.
15889 (Symbol_table::add_from_dynobj): Add sympointers and defined
15890 parameters. Change all callers.
15891 * symtab.h (class Symbol_table): Update declarations.
15892 * Makefile.am (CCFILES): Add cref.cc.
15893 (HFILES): Add cref.h.
15894 * Makefile.in: Rebuild.
15896 2008-07-22 Simon Baldwin <simonb@google.com>
15898 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15899 to zero when writing undefined symbols.
15901 2008-07-22 Ian Lance Taylor <iant@google.com>
15903 * output.cc (Output_section::add_input_section): Don't try to
15904 merge empty merge sections.
15906 2008-07-21 Craig Silverstein <csilvers@google.com>
15908 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15909 Include symbol version in error message.
15911 2008-07-20 Chris Demetriou <cgd@google.com>
15913 * configure.ac (gold_cv_c_random_seed): New configured variable.
15914 (RANDOM_SEED_CFLAGS): New substituted variable.
15915 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15916 * configure: Rebuild.
15917 * Makefile.in: Likewise.
15918 * testsuite/Makefile.in: Likewise.
15920 2008-07-18 Ian Lance Taylor <iant@google.com>
15922 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15923 where we see NAME/NULL and NAME/VERSION as separate symbols.
15924 * testsuite/ver_test_main.cc (main): Call t4.
15925 (t4, t4_2a): Define.
15926 * testsuite/ver_test_2.cc (t4_2): Define.
15927 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15928 * testsuite/ver_test_4.cc (t4_2a): Define.
15929 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15930 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15932 2008-07-17 Ian Lance Taylor <iant@google.com>
15934 * dynobj.cc (Versions::add_def): If we give an error about a
15935 missing version, go ahead and create the version anyhow.
15937 2008-07-10 Ian Lance Taylor <iant@google.com>
15939 Handle output sections with more than 0x7fffffff bytes.
15940 * object.h (class Relobj): Change map_to_output_ to
15941 output_sections_, and just keep a section pointer. Change all
15942 uses. Move comdat group support to Sized_relobj.
15943 (Relobj::is_section_specially_mapped): Remove.
15944 (Relobj::output_section): Remove poff parameter. Change all
15946 (Relobj::output_section_offset): New function.
15947 (Relobj::set_section_offset): Rewrite.
15948 (Relobj::map_to_output): Remove.
15949 (Relobj::output_sections): New function.
15950 (Relobj::do_output_section_offset): New pure virtual function.
15951 (Relobj::do_set_section_offset): Likewise.
15952 (class Sized_relobj): Add section_offsets_ field. Add comdat
15953 group support from Relobj. Update declarations.
15954 (Sized_relobj::get_output_section_offset): New function.
15955 (Sized_relobj::do_output_section_offset): New function.
15956 (Sized_relobj::do_set_section_offset): New function.
15957 * object.cc (Relobj::output_section_address): Remove.
15958 (Sized_relobj::Sized_relobj): Initialize new fields.
15959 (Sized_relobj::include_section_group): Cast find_kept_object to
15961 (Sized_relobj::include_linkonce_section): Likewise.
15962 (Sized_relobj::do_layout): Use separate arrays for output section
15964 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15966 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15967 output_sections and section_offsets.
15968 (Sized_relobj::write_local_symbols): Likewise.
15969 (map_to_kept_section): Compute output address directly.
15970 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15971 output_sections and section_offsets.
15972 (Sized_relobj::write_sections): Likewise.
15973 (Sized_relobj::relocate_sections): Likewise.
15974 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15975 * output.h (class Output_reloc): Update declarations. Change
15976 u2_.relobj to Sized_relobj*.
15977 (class Output_data_reloc): Change add functions to use
15979 * output.cc (Output_reloc::Output_reloc): Change relobj to
15981 (Output_reloc::local_section_offset): Change return type to
15982 Elf_Addr. Use get_output_section_offset.
15983 (Output_reloc::get_address): Likewise.
15984 (Output_section::is_input_address_mapped): Don't call
15985 is_section_specially_mapped.
15986 (Output_section::output_offset): Likewise.
15987 (Output_section::output_address): Likewise.
15988 (Output_section::starting_output_address): Likewise.
15989 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15990 parameter to Sized_relobj*.
15991 (Copy_relocs::need_copy_reloc): Likewise.
15992 (Copy_relocs::save): Likewise.
15993 * copy-relocs.h (class Copy_relocs): Update declarations.
15994 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15995 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15996 * target-reloc.h (relocate_for_relocatable): Change
15997 offset_in_output_section type to Elf_Addr. Change code that uses
15999 * layout.cc (Layout::layout): Always set *off.
16000 * mapfile.cc (Mapfile::print_input_section): Use
16001 output_section_offset.
16002 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16004 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16005 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16006 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16008 2008-07-03 Ian Lance Taylor <iant@google.com>
16010 * layout.cc (Layout::include_section): Do not discard unrecognized
16011 SHT_STRTAB sections.
16013 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16015 * script.cc (Lex::can_continue_name): Make '?' allowable in
16016 version-script names.
16017 * testsuite/version_script.map: Change glob pattern to use '?'
16019 2008-06-30 Manish Singh <yosh@gimp.org>
16022 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16025 2008-06-30 Ian Lance Taylor <iant@google.com>
16029 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16030 versions]: Don't try to read the value in the contents, since we
16031 don't use it. Use the template endianness when writing.
16033 2008-06-25 Cary Coutant <ccoutant@google.com>
16035 * fileread.cc (File_read::make_view): Assert on zero-length view.
16036 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16037 symbol table when there are no symbols to read.
16039 2008-06-23 Craig Silverstein <csilvers@google.com>
16041 * version.cc (version_string): Bump to 1.7
16043 2008-06-18 Craig Silverstein <csilvers@google.com>
16045 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16046 constant 0xFFFF to type Valtype.
16047 (Powerpc_relocate_functions::rel16_ha): Likewise.
16049 2008-06-17 Ian Lance Taylor <iant@google.com>
16051 * output.h (Output_section::Input_section): Initialize p2align_ to
16052 zero for Output_section_data constructors.
16053 (Output_section::Input_section::addralign): If not an input
16054 section, return the alignment of the Output_section_data.
16055 * testsuite/copy_test.cc: New file.
16056 * testsuite/copy_test_1.cc: New file.
16057 * testsuite/copy_test_2.cc: New file.
16058 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16059 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16060 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16061 (copy_test_1_pic.o, copy_test_1.so): New targets.
16062 (copy_test_2_pic.o, copy_test_2.so): New targets.
16063 * testsuite/Makefile.in: Rebuild.
16065 * script-sections.cc (Script_sections::place_orphan): Initialize
16066 local variable exact.
16068 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16070 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16072 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16073 David S. Miller <davem@davemloft.net>
16075 * powerpc.cc: New file.
16076 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16077 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16078 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16079 * Makefile.in: Rebuild.
16081 2008-06-09 Ian Lance Taylor <iant@google.com>
16083 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16085 (throwing, orig_terminate): New static variables.
16086 (terminate_handler): New static function.
16087 (t2): Set terminate handler.
16089 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16092 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16095 2008-05-30 Cary Coutant <ccoutant@google.com>
16097 * archive.cc (Archive::include_all_members) Correct to step
16098 over symbol table and extended name table in thin archives.
16100 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16103 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16106 2008-05-28 Caleb Howe <cshowe@google.com>
16108 * reduced_debug_output.cc: New file.
16109 * reduced_debug_output.h: New file.
16110 * options.h (class General_options): Add --strip-debug-non-line.
16111 * options.cc (General_options::finalize): Add strip_debug_non_line
16112 to the strip heirarchy.
16113 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16115 * layout.cc: Include "reduced_debug_output.h".
16116 (Layout::Layout): Initialize new fields.
16117 (line_only_debug_sections): New static array.
16118 (is_lines_only_debug_sections): New static inline function.
16119 (Layout::include_section): Handle --strip-debug-non-line.
16120 (Layout::make_output_section): If --strip-debug-non-line, build
16121 new output sections for .debug_abbrev and .debug_info.
16122 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16123 gold. Warn about possible overflow.
16124 (read_signed_LEB_128): Likewise.
16125 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16126 (read_signed_LEB_128): Declare.
16127 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16128 (HFILES): Add reduced_debug_output.h.
16129 * Makefile.in: Rebuild.
16131 2008-05-21 Ian Lance Taylor <iant@google.com>
16133 * mapfile.cc: New file.
16134 * mapfile.h: New file.
16135 * options.h (class General_options): Add -M/--print-map and -Map.
16136 * options.cc (General_options::finalize): Make -M equivalent to
16138 * main.cc: Include <cstdio> and "mapfile.h".
16139 (main): Open mapfile if requested.
16140 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16141 constructor. Change caller.
16142 (queue_initial_tasks): Add mapfile parameter. Change caller.
16143 (queue_middle_tasks): Likewise.
16144 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16146 * archive.cc: Include "mapfile.h".
16147 (Archive::add_symbols): Add mapfile parameter. Change all
16148 callers. Pass mapfile, symbol, and reason to include_member.
16149 (Archive::include_all_members): Add mapfile parameter. Change all
16151 (Archive::include_member): Add mapfile, sym, and why parameters.
16152 Change all callers. Report inclusion to map file.
16153 * archive.h: Include "fileread.h".
16154 (class Archive): Update declarations.
16155 (Archive::file): New const method.
16156 (class Add_archive_symbols): Add mapfile_ field. Update
16157 constructor. Change all callers.
16158 * readsyms.h (class Read_symbols): Likewise.
16159 (class Finish_group): Likewise.
16160 (class Read_script): Likewise.
16161 * common.cc: Include "mapfile.h".
16162 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16164 (Symbol_table::do_allocate_commons): Likewise.
16165 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16166 symbol allocation to mapfile.
16167 * common.h (class Allocate_commons_task): Add mapfile_ field.
16168 Update constructor. Change all callers.
16169 * symtab.h (class Symbol_table): Update declarations.
16170 * layout.cc: Include "mapfile.h".
16171 (Layout_task_runner::run): Print information to mapfile.
16172 (Layout::create_gold_note): Change Output_data_fixed_space to
16173 Output_data_zero_fill.
16174 (Layout::create_build_id): Likewise.
16175 (Layout::print_to_mapfile): New function.
16176 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16177 constructor. Change caller.
16178 (class Layout): Declare print_to_mapfile.
16179 * output.cc (Output_section::Input_section::print_to_mapfile): New
16181 (Output_section::add_input_section): If producing a map, always
16182 add to input_sections_ list.
16183 (Output_section::do_print_to_mapfile): New function.
16184 (Output_segment::print_sections_to_mapfile): New function.
16185 (Output_segment::print_section_list_to_mapfile): New function.
16186 * output.h: Include "mapfile.h".
16187 (Output_data::print_to_mapfile): New function.
16188 (Output_data::do_print_to_mapfile): New virtual function.
16189 (Output_segment_headers::do_print_to_mapfile): New function.
16190 (Output_file_header::do_print_to_mapfile): New function.
16191 (Output_data_const::do_print_to_mapfile): New function.
16192 (class Output_data_const_buffer): Add map_name_ field. Update
16193 constructor. Change all callers. Add do_print_to_mapfile
16195 (class Output_data_fixed_space): Likewise.
16196 (class Output_data_space): Likewise.
16197 (class Output_data_zero_fill): New class.
16198 (Output_data_strtab::do_print_to_mapfile): New function.
16199 (Output_data_reloc_base::do_print_to_mapfile): New function.
16200 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16201 (Output_data_group::do_print_to_mapfile): New function.
16202 (Output_data_got::do_print_to_mapfile): New function.
16203 (Output_data_dynamic::do_print_to_mapfile): New function.
16204 (Output_symtab_xindex::do_print_to_mapfile): New function.
16205 (class Output_section): Declare do_print_to_mapflie. Declare
16206 print_to_mapfile in Input_section.
16207 (class Output_segment): Declare new functions.
16208 * object.h (Sized_relobj::symbol_count): New function.
16209 * script-sections.cc
16210 (Output_section_element_dot_assignment::set_section_addresses):
16211 Change Output_data_fixed_space to Output_data_zero_fill.
16212 (Output_data_expression::do_print_to_mapfile): New function.
16213 * script.cc (read_input_script): Add mapfile parameter. Change
16215 * script.h (read_input_script): Update declaration.
16216 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16217 (Eh_frame::do_print_to_mapfile): New function.
16218 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16219 (Output_merge_string::do_print_to_mapfile): New function.
16220 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16222 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16224 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16226 * Makefile.am (CCFILES): Add mapfile.cc.
16227 (HFILES): Add mapfile.h.
16228 * Makefile.in: Rebuild.
16230 2008-05-19 Ian Lance Taylor <iant@google.com>
16232 * options.h (class General_options): Add -z relro.
16233 * layout.cc (Layout::Layout): Initialize relro_segment_.
16234 (Layout::add_output_section_data): Return the output section.
16235 (Layout::make_output_section): Rcognize relro sections and mark
16236 them appropriately.
16237 (Layout::attach_allocated_section_to_segment): Put relro sections
16238 in a PT_GNU_RELRO segment.
16239 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16241 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16243 (Layout::linkonce_mapping): Map d.rel.ro.local to
16244 .data.rel.ro.local.
16245 (Layout::output_section_name): Us .data.rel.ro.local for any
16246 section which begins with that.
16247 * layout.h (class Layout): Update add_output_section_data
16248 declaration. Add relro_segment_ field.
16249 * output.cc (Output_section::Output_section): Initialize is_relro_
16250 and is_relro_local_ fields.
16251 (Output_segment::add_output_section): Group relro sections.
16252 (Output_segment::is_first_section_relro): New function.
16253 (Output_segment::maximum_alignment): If there is a relro section,
16254 align the segment to the common page size.
16255 (Output_segment::set_section_addresses): Track whether we are
16256 looking at relro sections. If the last section is a relro
16257 section, align to the common page size.
16258 (Output_segment::set_section_list_addresses): Add in_relro
16259 parameter. Change all callers. Align to the page size when
16260 moving from relro to non-relro section.
16261 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16263 * output.h (class Output_section): Add is_relro_ and
16264 is_relro_local_ fields.
16265 (Output_section::is_relro): New function.
16266 (Output_section::set_is_relro): New function.
16267 (Output_section::is_relro_local): New function.
16268 (Output_section::set_is_relro_local): New function.
16269 (class Output_segment): Update declarations.
16270 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16271 * sparc.cc (Target_sparc::got_section): Likewise.
16272 * x86_64.cc (Target_x86_64::got_section): Likewise.
16273 * testsuite/relro_test_main.cc: New file.
16274 * testsuite/relro_test.cc: New file.
16275 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16276 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16277 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16278 (relro_test.so, relro_test_pic.o): New targets.
16279 * testsuite/Makefile.in: Rebuild.
16281 2008-05-16 Ian Lance Taylor <iant@google.com>
16283 * output.cc (Output_segment::add_output_section): Remove front
16285 * output.h (class Output_segment): Remove
16286 add_initial_output_section and overloaded add_output_section.
16287 Update declaration of remaining add_output_section.
16288 * layout.cc (Layout::create_interp): Call add_output_section
16289 rather than add_initial_output_section.
16290 (Layout::finish_dynamic_section): Likewise.
16292 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16293 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16294 know the dynamic type.
16295 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16296 field. Initialize it in constructor.
16297 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16298 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16299 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16302 * output.cc (Output_reloc::get_address): Change return type to
16304 * output.h (class Output_reloc): Update get_address declaration.
16305 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16306 for section addresses.
16308 2008-05-09 Ian Lance Taylor <iant@google.com>
16311 * gold.cc (gold_nomem): Use return value of write.
16313 2008-05-08 Ian Lance Taylor <iant@google.com>
16315 * symtab.c (Symbol::init_base_output_data): Add version
16316 parameter. Change all callers.
16317 (Symbol::init_base_output_segment): Likewise.
16318 (Symbol::init_base_constant): Likewise.
16319 (Symbol::init_base_undefined): Likewise.
16320 (Sized_symbol::init_output_data): Likewise.
16321 (Sized_symbol::init_output_segment): Likewise.
16322 (Sized_symbol::init_constant): Likewise.
16323 (Sized_symbol::init_undefined): Likewise.
16324 (Symbol_table::do_define_in_output_data): If the new symbol has a
16325 version, mark it as the default.
16326 (Symbol_table::do_define_in_output_segment): Likewise.
16327 (Symbol_table::do_define_as_constant): Likewise.
16328 * symtab.h (class Symbol): Update declarations.
16329 (class Sized_symbol): Likewise.
16330 * resolve.cc (Symbol::override_version): New function.
16331 (Symbol::override_base): Call override_version.
16332 (Symbol::override_base_with_special): Likewise.
16333 * testsuite/ver_script_8.script: New file.
16334 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16335 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16336 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16337 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16339 2008-05-06 Ian Lance Taylor <iant@google.com>
16342 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16344 (class General_options): Remove existing --undefined, and add
16345 --no-undefined instead. Add new --undefined as synonym for -u.
16346 * archive.cc (Archive::add_symbols): Check whether symbol was
16348 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16349 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16350 all uses. Add IS_UNDEFINED. Update declarations to split
16351 different versions of init_base. Declare init_base_undefined.
16352 (Symbol::is_defined): Handle IS_UNDEFINED.
16353 (Symbol::is_undefined): Likewise.
16354 (Symbol::is_weak_undefined): Call is_undefined.
16355 (Symbol::is_absolute): Handle IS_CONSTANT.
16356 (class Sized_symbol): Update declarations to split different
16357 versions of init. Declare init_undefined.
16358 (class Symbol_table): Declare new functions.
16359 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16360 Change all callers.
16361 (Symbol::init_base_output_data): Likewise.
16362 (Symbol::init_base_output_segment): Likewise.
16363 (Symbol::init_base_constant): Likewise.
16364 (Symbol::init_base_undefined): New function.
16365 (Sized_symbol::init_object): Rename from init. Change all
16367 (Sized_symbol::init_output_data): Likewise.
16368 (Sized_symbol::init_output_segment): Likewise.
16369 (Sized_symbol::init_constant): Likewise.
16370 (Sized_symbol::init_undefined): New function.
16371 (Symbol_table::add_undefined_symbols_from_command_line): New
16373 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16375 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16376 (Symbol::output_section): Likewise.
16377 (Symbol::set_output_section): Likewise.
16378 (Symbol_table::sized_finalize_symbol): Likewise.
16379 (Symbol_table::sized_write_globals): Likewise.
16380 * resolve.cc (Symbol_table::should_override): Likewise.
16381 (Symbol::override_base_with_special): Likewise.
16383 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16384 symbol, change it to have default visibility.
16385 * testsuite/protected_1.cc: New file.
16386 * testsuite/protected_2.cc: New file.
16387 * testsuite/protected_3.cc: New file.
16388 * testsuite/protected_main_1.cc: New file.
16389 * testsuite/protected_main_2.cc: New file.
16390 * testsuite/protected_main_3.cc: New file.
16391 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16392 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16393 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16394 (protected_1.so): New target.
16395 (protected_1_pic.o, protected_2_pic.o): New targets.
16396 (protected_3_pic.o): New target.
16397 (check_PROGRAMS): Add protected_2.
16398 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16399 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16400 * testsuite/Makefile.in: Rebuild.
16402 * options.h (DEFINE_var): Add set_user_set_##varname__.
16403 (DEFINE_bool_alias): New macro.
16404 (class General_options): Define -Bstatic using DEFINE_bool_alias
16405 rather than DEFINE_special. Add --undefined as an alias for -z
16407 * options.cc (General_options::parse_Bstatic): Remove.
16409 * options.h (class General_options): Add --fatal-warnings.
16410 * main.cc (main): Implement --fatal-warnings.
16411 * errors.h (Errors::warning_count): New function.
16413 * options.h (class General_options): Add -Bsymbolic-functions.
16414 * symtab.h (Symbol::is_preemptible): Check for
16415 -Bsymbolic-functions.
16417 2008-05-05 Ian Lance Taylor <iant@google.com>
16419 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16420 as noVARNAME rather than no-VARNAME.
16421 (class General_options): Add option -z combreloc.
16422 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16424 (Output_reloc::sort_before) [SHT_REL]: New function.
16425 (Output_reloc::sort_before) [SHT_RELA]: New function.
16426 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16427 Sort_relocs_comparison.
16428 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16429 parameter. Change all callers.
16430 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16431 sort_relocs parameter. Change all callers.
16432 * output.cc (Output_reloc::get_address): New function, broken out
16434 (Output_reloc::write_rel): Call it.
16435 (Output_reloc::compare): New function.
16436 (Output_data_reloc_base::do_write): Optionally sort relocs.
16438 * configure.ac: If targ_extra_obj is set, link it in.
16439 * configure.tgt: Initialize all variables.
16440 (x86_64*): Set targ_extra_obj and targ_extra_size.
16441 * configure: Rebuild.
16443 * object.cc (Sized_relobj::include_section_group): Adjust section
16444 indexes read from group data. Build vector to pass to
16446 * layout.cc (Layout::layout_group): Add flags and shndxes
16447 parameters. Remove contents parameter. Change caller. Update
16448 explicit instantiations.
16449 * layout.h (class Layout): Update layout_group declaration.
16450 * output.cc (Output_data_group::Output_data_group): Add flags and
16451 input_shndxes parameters. Remove contents parameter. Change
16453 (Output_data_group::do_write): Change input_sections_ to
16455 * output.h (class Output_data_group): Update constructor
16456 declaration. Rename input_sections_ to input_shndxes_.
16457 * testsuite/many_sections_test.cc: Add template.
16459 2008-04-30 Cary Coutant <ccoutant@google.com>
16461 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16463 * layout.cc (Layout::include_section): Refactored check for debug
16465 (Layout::add_comdat): Add new parameters. Change type
16466 of signature parameter. Add object and shndx to signatures table.
16467 (Layout::find_kept_object): New function.
16468 * layout.h: Include <cstring>.
16469 (Layout::is_debug_info_section): New function.
16470 (Layout::add_comdat): Add new parameters.
16471 (Layout::find_kept_object): New function.
16472 (Layout::Kept_section): New struct.
16473 (Layout::Signatures): Change type of map range.
16474 * object.cc (Relobj::output_section_address): New function.
16475 (Sized_relobj::include_section_group): Add new parameters. Change
16476 calls to Layout::add_comdat. Change to build table of kept comdat
16477 groups and table mapping discarded sections to kept sections.
16478 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16479 (Sized_relobj::do_layout): Change calls to include_section_group and
16480 include_linkonce_section.
16481 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16482 value to zero when section is discarded.
16483 (Sized_relobj::map_to_kept_section): New function.
16484 * object.h (Relobj::output_section_address): New function.
16485 (Relobj::Comdat_group): New type.
16486 (Relobj::find_comdat_group): New function.
16487 (Relobj::Comdat_group_table): New type.
16488 (Relobj::Kept_comdat_section): New type.
16489 (Relobj::Kept_comdat_section_table): New type.
16490 (Relobj::add_comdat_group): New function.
16491 (Relobj::set_kept_comdat_section): New function.
16492 (Relobj::get_kept_comdat_section): New function.
16493 (Relobj::comdat_groups_): New field.
16494 (Relobj::kept_comdat_sections_): New field.
16495 (Symbol_value::input_value): Update comment.
16496 (Sized_relobj::map_to_kept_section) New function.
16497 (Sized_relobj::include_linkonce_section): Add new parameter.
16498 * target-reloc.h (Comdat_behavior): New type.
16499 (get_comdat_behavior): New function.
16500 (relocate_section): Add code to map a discarded section to the
16501 corresponding kept section when applying a relocation.
16503 2008-04-30 Craig Silverstein <csilvers@google.com>
16505 * dwarf_reader.cc (next_generation_count): New static var.
16506 (Addr2line_cache_entry): New struct.
16507 (addr2line_cache): New static var.
16508 (Dwarf_line_info::one_addr2line): Added caching.
16509 (Dwarf_line_info::clear_addr2line_cache): New function.
16510 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16511 cache-size parameter.
16512 (Dwarf_line_info::one_addr2line_cache): New function.
16513 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16514 new cache-size argument to one_addr2line(), and clear cache.
16516 2008-04-28 Cary Coutant <ccoutant@google.com>
16518 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16519 R_386_PC8 relocations.
16521 2008-04-23 Ian Lance Taylor <iant@google.com>
16523 * object.cc (Sized_relobj::include_section_group): Check for
16524 invalid section group.
16526 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16529 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16530 than read for file header.
16531 * archive.cc (Archive::include_member): Likewise.
16533 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
16535 * aclocal.m4: Regenerate.
16536 * configure: Regenerate.
16538 2008-04-19 Ian Lance Taylor <iant@google.com>
16540 * version.cc (version_string): Bump to 1.6.
16542 * testsuite/Makefile.am (many_sections_r_test): New target.
16543 (many_sections_r_test_SOURCES): Remove.
16544 (many_sections_r_test_DEPENDENCIES): Remove.
16545 (many_sections_r_test_LDFLAGS): Remove.
16546 (many_sections_r_test_LDADD): Remove.
16548 * object.cc (Sized_relobj::do_add_symbols): Always pass
16549 local_symbol_count_ to add_from_relobj.
16551 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16552 every thousand variables.
16553 * testsuite/Makefile.in: Rebuild.
16555 * object.cc (Xindex::initialize_symtab_xindex): New function.
16556 (Xindex::read_symtab_xindex): New function.
16557 (Xindex::sym_xindex_to_shndx): New function.
16558 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16560 (Sized_relobj::do_initialize_xindex): New function.
16561 (Sized_relobj::do_read_symbols): Adjust section links.
16562 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16563 parameter. Change all callers.
16564 (Sized_relobj::include_section_group): Adjust section links and
16565 symbol section indexes.
16566 (Sized_relobj::do_layout): Adjust section links.
16567 (Sized_relobj::do_count_local_symbols): Adjust section links and
16568 symbol section indexes.
16569 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16570 ordinary and special symbols.
16571 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16572 dynsym_xindex parameters. Change all callers. Adjust section
16573 links. Use SHN_XINDEX when needed.
16574 (Sized_relobj::get_symbol_location_info): Adjust section links.
16575 Don't get fooled by special symbols.
16576 * object.h (class Xindex): Define.
16577 (class Object): Add xindex_ parameter. Declare virtual functoin
16578 do_initialize_xindex.
16579 (Object::adjust_sym_shndx): New function.
16580 (Object::set_xindex): New protected function.
16581 (class Symbol_value): Add is_ordinary_shndx_ field.
16582 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16583 (Symbol_value::value): Assert ordinary section.
16584 (Symbol_value::initialize_input_to_output_map): Likewise.
16585 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16586 Change all callers.
16587 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16589 (class Sized_relobj): Update declarations.
16590 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16591 parameter. Change all callers.
16592 (Sized_relobj::adjust_shndx): New function.
16593 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16595 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16596 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16597 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16598 (Sized_dynobj::read_dynsym_section): Adjust section links.
16599 (Sized_dynobj::read_dynamic): Likewise.
16600 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16602 (Sized_dynobj::do_initialize_xindex): New function.
16603 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16604 do_initialize_xindex.
16605 (Sized_dynobj::adjust_shndx): New function.
16606 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16607 dynsym_xindex_ fields.
16608 (Layout::finalize): Add a call to set_section_indexes before
16609 creating the symtab sections.
16610 (Layout::set_section_indexes): Don't do anything if the section
16611 already has a section index.
16612 (Layout::create_symtab_sections): Add shnum parameter. Change
16613 caller. Create .symtab_shndx section if needed.
16614 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16616 (Layout::allocated_output_section_count): New function.
16617 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16619 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16620 fields. Update declarations.
16621 (Layout::symtab_xindex): New function.
16622 (Layout::dynsym_xindex): New function.
16623 (class Write_symbols_task): Add layout_ field.
16624 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16626 * output.cc (Output_section_headers::Output_section_headers): Add
16627 shstrtab_section parameter. Change all callers.
16628 (Output_section_headers::do_sized_write): Store overflow values
16629 for section count and section string table section index in
16630 section header zero.
16631 (Output_file_header::do_sized_write): Check for overflow of
16632 section count and section string table section index.
16633 (Output_symtab_xindex::do_write): New function.
16634 (Output_symtab_xindex::endian_do_write): New function.
16635 * output.h (class Output_section_headers): Add shstrtab_section_.
16636 Update declarations.
16637 (class Output_symtab_xindex): Define.
16638 (Output_section::has_out_shndx): New function.
16639 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16641 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16642 Change all callers.
16643 (Sized_symbol::init): Likewise.
16644 (Symbol::output_section): Check for ordinary symbol.
16645 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16646 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16648 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16649 Change all callers. Simplify handling of symbols from sections
16650 not included in the link.
16651 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16653 (Weak_alias_sorter::operator()): Assert that symbols are
16655 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16657 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16658 parameters. Change all callers.
16659 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16660 symbol distinction. Use SHN_XINDEX when needed.
16661 (Symbol_table::write_section_symbol): Add symtab_xindex
16662 parameter. Change all callers.
16663 (Symbol_table::sized_write_section_symbol): Likewise. Use
16664 SHN_XINDEX when needed.
16665 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16667 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16668 (Symbol::is_defined): Check is_ordinary.
16669 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16670 (Symbol::is_absolute, Symbol::is_common): Likewise.
16671 (class Sized_symbol): Update declarations.
16672 (class Symbol_table): Update declarations.
16673 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16674 parameters. Change all callers.
16675 (Sized_symbol::override): Likewise.
16676 (Symbol_table::override): Likewise.
16677 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16678 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16679 is_ordinary, and orig_st_shndx parameters. Change all callers.
16680 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16681 to be in an ordinary section.
16682 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16683 object and is_ordinary parameters. Change all callers.
16684 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16685 Change all callers. Don't add undefined or non-ordinary symbols
16687 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16688 Change all callers.
16689 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16691 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16692 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16693 (Sized_relobj::relocate_sections): Likewise.
16694 * target-reloc.h (scan_relocs): Adjust section symbol index.
16695 (scan_relocatable_relocs): Likewise.
16696 * i386.cc (Scan::local): Check for ordinary symbols.
16697 * sparc.cc (Scan::local): Likewise.
16698 * x86_64.cc (Scan::local): Likewise.
16699 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16700 to symbol_section_and_value.
16701 * testsuite/many_sections_test.cc: New file.
16702 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16703 (check_PROGRAMS): Add many_sections_test.
16704 (many_sections_test_SOURCES): Define.
16705 (many_sections_test_DEPENDENCIES): Define.
16706 (many_sections_test_LDFLAGS): Define.
16707 (BUILT_SOURCES): Add many_sections_define.h.
16708 (many_sections_define.h): New target.
16709 (BUILT_SOURCES): Add many_sections_check.h.
16710 (many_sections_check.h): New target.
16711 (check_PROGRAMS): Add many_sections_r_test.
16712 (many_sections_r_test_SOURCES): Define.
16713 (many_sections_r_test_DEPENDENCIES): Define.
16714 (many_sections_r_test_LDFLAGS): Define.
16715 (many_sections_r_test_LDADD): Define.
16716 (many_sections_r_test.o): New target.
16717 * testsuite/Makefile.in: Rebuild.
16719 2008-04-17 Cary Coutant <ccoutant@google.com>
16721 * errors.cc (Errors::info): New function.
16722 (gold_info): New function.
16723 * errors.h (Errors::info): New function.
16724 * gold.h (gold_info): New function.
16725 * object.cc (Input_objects::add_object): Print trace output.
16726 * options.cc (options::parse_set): New function.
16727 (General_options::parse_wrap): Deleted.
16728 (General_options::General_options): Deleted initializer.
16729 * options.h (options::String_set): New typedef.
16730 (options::parse_set): New function.
16731 (DEFINE_set): New macro.
16732 (General_options::wrap): Changed to use DEFINE_set. Changed
16733 callers of any_wrap_symbols and is_wrap_symbol.
16734 (General_options::trace, General_options::trace_symbol):
16736 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16737 (General_options::wrap_symbols_): Deleted.
16738 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16740 2008-04-17 David S. Miller <davem@davemloft.net>
16742 * options.cc (General_options::parse_V): New function.
16743 * options.h: Add entries for -V and -Qy.
16745 2008-04-17 Ian Lance Taylor <iant@google.com>
16747 * common.cc (Symbol_table::allocate_commons): Remove options
16748 parameter. Change caller.
16749 (Symbol_table::do_allocate_commons): Remove options parameter.
16750 Change caller. Just call do_allocate_commons_list twice.
16751 (Symbol_table::do_allocate_commons_list): New function, broken out
16752 of do_allocate_commons.
16753 * common.h (class Allocate_commons_task): Remove options_ field.
16754 Update constructor.
16755 * symtab.cc (Symbol_table::Symbol_table): Initialize
16757 (Symbol_table::add_from_object): Put TLS common symbols on
16759 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16760 which are IN_OUTPUT_DATA.
16761 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16762 allocate_commons and do_allocate_commons declarations. Declare
16763 do_allocate_commons_list.
16764 * gold.cc (queue_middle_tasks): Update creation of
16765 Allocate_commons_task to not pass options.
16766 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16767 (TLS_TEST_C_FLAGS): New variable.
16768 (tls_test_c_pic.o): New target.
16769 (tls_test_shared.so): Link in tls_test_c_pic.o.
16770 (tls_test_c_pic_ie.o): New target.
16771 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16772 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16773 (tls_test_c.o): New target.
16774 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16775 (tls_pic_test_LDADD): Likewise.
16776 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16777 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16778 (tls_test_c_gnu2.o): New target.
16779 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16781 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16782 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16783 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16784 * testsuite/tls_test.cc: Include "config.h".
16785 (t_last): Call t11_last.
16786 * testsuite/tls_test.h (t11, t11_last): Declare.
16787 * testsuite/tls_test_c.c: New file.
16788 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16789 * configure.ac: Check for OpenMP support.
16790 * configure, config.in, Makefile.in: Rebuild.
16791 * testsuite/Makefile.in: Rebuild.
16793 2008-04-16 Cary Coutant <ccoutant@google.com>
16795 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16796 (Target_i386::tls_base_symbol_defined_): New field.
16797 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16798 (Target_i386::Scan::global): Likewise.
16799 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16800 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16801 (Target_x86_64::tls_base_symbol_defined_): New field.
16802 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16803 (Target_x86_64::Scan::global): Likewise.
16805 2008-04-16 Cary Coutant <ccoutant@google.com>
16807 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16808 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16809 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16810 building shared libraries.
16811 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16812 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16813 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16814 * testsuite/Makefile.in: Rebuild.
16815 * testsuite/weak_undef.h: New file.
16816 * testsuite/weak_undef_file1.cc: Add extra test cases.
16817 * testsuite/weak_undef_file2.cc: Likewise.
16818 * testsuite/weak_undef_test.cc: Likewise.
16820 2008-04-16 David S. Miller <davem@davemloft.net>
16822 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16823 Add issued_non_pic_error_ field. Declare check_non_pic.
16824 (Target_sparc::Scan::check_non_pic): New function.
16825 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16826 (Target_sparc::Scan::global): Likewise.
16828 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16829 * configure: Rebuild.
16831 * options.h (DEFINE_enable): New macro.
16832 (new_dtags): New enable option.
16833 (initfirst, interpose, loadfltr, nodefaultlib,
16834 nodelete, nodlopen, nodump): New -z options.
16835 * layout.cc (Layout:finish_dynamic_section): If new
16836 dtags enabled, emit DT_RUNPATH. Also, emit a
16837 DT_FLAGS_1 containing any specified -z flags.
16839 2008-04-16 Ian Lance Taylor <iant@google.com>
16841 * copy-relocs.cc: New file.
16842 * copy-relocs.h: New file.
16843 * reloc.cc: Remove Copy_relocs code.
16844 * reloc.h: Likewise.
16845 * reloc-types.h (struct Reloc_types) [both versions]: Add
16846 get_reloc_addend_noerror.
16847 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16848 variants of add_global which take an addend which must be zero.
16849 * i386.cc: Include "copy-relocs.h".
16850 (class Target_i386): Change type of copy_relocs_ to variable,
16851 update initializer.
16852 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16853 Change all callers.
16854 (Target_i386::do_finalize_sections): Change handling of
16856 * sparc.cc: Include "copy-relocs.h".
16857 (class Target_sparc): Change type of copy_relocs_ to variable,
16858 update initializer.
16859 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16860 Change all callers.
16861 (Target_sparc::do_finalize_sections): Change handling of
16863 * x86_64.cc: Include "copy-relocs.h".
16864 (class Target_x86_64): Change type of copy_relocs_ to variable,
16865 update initializer.
16866 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16867 class. Change all callers.
16868 (Target_x86_64::do_finalize_sections): Change handling of
16870 * Makefile.am (CCFILES): Add copy-relocs.cc.
16871 (HFILES): Add copy-relocs.h.
16873 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16875 * testsuite/script_test_4.sh: Permit leading zeroes.
16877 2008-04-15 Ian Lance Taylor <iant@google.com>
16879 * script-sections.cc (Script_sections::create_segments): Use
16880 header_size_adjustment even when there is enough room for the
16882 * testsuite/script_test_4.sh: New file.
16883 * testsuite/script_test_4.t: New file.
16884 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16885 (check_DATA): Add script_test_4.stdout.
16886 (MOSTLYCLEANFILES): Likewise.
16887 (script_test_4): New target.
16888 (script_test_4.stdout): New target.
16889 * testsuite/Makefile.in: Rebuild.
16891 * sparc.cc: Add definitions for Output_data_plt_sparc class
16894 2008-04-14 David S. Miller <davem@davemloft.net>
16896 * sparc.cc: New file.
16897 * Makefile.am (TARGETSOURCES): Add sparc.cc
16898 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16899 * configure.tgt: Document targ_extra_size and
16900 targ_extra_big_endian. Add entries for sparc-* and
16902 * configure.ac: Handle targ_extra_size and
16903 targ_extra_big_endian.
16904 * Makefile.in: Rebuild.
16905 * configure: Likewise.
16906 * po/POTFILES.in: Likewise.
16907 * po/gold.pot: Likewise.
16909 2008-04-14 Ian Lance Taylor <iant@google.com>
16911 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16912 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16913 in the name/type/flags to section mapping. Don't call
16914 allocate_output_section.
16915 (Layout::choose_output_section): Change parameter from adjust_name
16916 to is_input_section. Don't permit input sections after sections
16917 are attached to segments. Don't call allocate_output_section.
16918 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16919 not write_enable_output_section.
16920 (Layout::make_output_section): Don't push to
16921 unattached_section_list_ nor call attach_to_segment. Call
16922 attach_section_to_segment if sections are attached.
16923 (Layout::attach_sections_to_segments): New function.
16924 (Layout::attach_section_to_segment): New function.
16925 (Layout::attach_allocated_section_to_segment): Rename from
16926 attach_to_segment. Remove flags parameter.
16927 (Layout::allocate_output_section): Remove function.
16928 (Layout::write_enable_output_section): Remove function.
16929 * layout.h (class Layout): Update for above changes. Add new
16930 field sections_are_attached_.
16931 * output.h (Output_section::update_flags_for_input_section): New
16933 * output.cc (Output_section::add_input_section): Call
16934 update_flags_for_input_section.
16935 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16937 2008-04-11 Cary Coutant <ccoutant@google.com>
16939 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16940 thought unnecessary.
16941 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16943 2008-04-11 Ian Lance Taylor <iant@google.com>
16945 * output.h (class Output_section_data): Remove inline definition
16947 * output.cc (Output_section_data::set_addralign): New function.
16949 2008-04-11 Cary Coutant <ccoutant@google.com>
16951 Add support for TLS descriptors for i386 and x86_64.
16952 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16953 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16954 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16956 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16957 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16958 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16960 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16961 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16962 Fix problem with initial-exec relocations.
16963 (Target_i386::Relocate::relocate_tls): Likewise.
16964 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16966 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16967 support for section-plus-offset dynamic table entries.
16968 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16969 (Output_data_dynamic::Dynamic_entry): Add support for
16970 section-plus-offset dynamic table entries.
16971 (Output_data_dynamic::Classification): Likewise.
16972 (Output_data_dynamic::classification_): Renamed offset_.
16973 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16974 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16975 (Target_x86_64::make_plt_section): New function.
16976 (Target_x86_64::reserve_tlsdesc_entries): New function.
16977 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16978 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16979 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16980 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16981 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16982 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16983 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16984 add extra PLT entry for TLS descriptors.
16985 (Output_data_plt_x86_64::got_): New field.
16986 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16987 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16989 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16991 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16992 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16993 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16994 R_386_TLS_DESC_CALL relocations.
16995 (Target_x86_64::Scan::global): Likewise.
16996 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16997 for TLS descriptors.
16998 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16999 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17000 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17001 GD-to-IE relaxation.
17002 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17003 and TLS_DESCRIPTORS.
17004 * Makefile.in: Rebuild.
17005 * configure: Rebuild.
17006 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17007 (tls_test_shared2.so): New target.
17008 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17009 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17010 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17011 (tls_shared_gd_to_ie_test_LDADD): New variable.
17012 (tls_shared_gnu2_gd_to_ie_test): New target.
17013 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17015 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17016 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17017 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17018 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17019 (tls_shared_gnu2_test): New target.
17020 (tls_test_gnu2_shared.so): New target.
17021 (tls_shared_gnu2_test_SOURCES): New variable.
17022 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17023 (tls_shared_gnu2_test_LDFLAGS): New variable.
17024 (tls_shared_gnu2_test_LDADD): New variable.
17025 * testsuite/Makefile.in: Rebuild.
17026 * testsuite/Makefile.
17028 2008-04-11 Ian Lance Taylor <iant@google.com>
17030 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17032 * testsuite/Makefile.in: Rebuild.
17034 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17036 * testsuite/script_test_2.cc (main): Adjust test.
17038 2008-04-11 David S. Miller <davem@davemloft.net>
17039 Ian Lance Taylor <iant@google.com>
17041 * options.h (General_options): Add entries for '-Y' and
17043 * options.cc (General_options:finalize): If -Y was used, add those
17044 entries to the library path instead of the default "/lib" and
17047 2008-04-11 David S. Miller <davem@davemloft.net>
17049 * testsuite/justsyms.t: Start at 0x100.
17050 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17051 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17053 * testsuite/script_test_2.cc: Adjust string and section length
17056 2008-04-09 Ian Lance Taylor <iant@google.com>
17059 * script-sections.cc (Sections_element::allocate_to_segment): Add
17061 (Output_section_definition::allocate_to_segment): Likewise.
17062 (Orphan_output_section::allocate_to_segment): Likewise.
17063 (Script_sections::attach_sections_using_phdrs_clause): Don't
17064 propagate non-PT_LOAD segments to orphan sections.
17065 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17066 readelf rather than objdump.
17067 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17068 .interp section and PT_INTERP segment are the same size.
17069 * testsuite/Makefile.in: Rebuild.
17071 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17072 aliases for symbols defined in the same object.
17073 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17074 (weak_alias_test_SOURCES): New variable.
17075 (weak_alias_test_DEPENDENCIES): New variable.
17076 (weak_alias_test_LDFLAGS): New variable.
17077 (weak_alias_test_LDADD): New variable.
17078 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17079 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17080 (weak_alias_test_3.o): New target.
17081 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17082 * testsuite/weak_alias_test_main.cc: New file.
17083 * testsuite/weak_alias_test_1.cc: New file.
17084 * testsuite/weak_alias_test_2.cc: New file.
17085 * testsuite/weak_alias_test_3.cc: New file.
17087 2008-04-08 Ian Lance Taylor <iant@google.com>
17089 * options.h (class General_options): Add --noinhibit-exec option.
17090 * main.cc (main): Check --noinhibit-exec.
17092 * options.h (class General_options): Define --wrap as a special
17093 option. Add wrap_symbols_ field.
17094 (General_options::any_wrap_symbols): New function.
17095 (General_options::is_wrap_symbol): New function.
17096 * options.cc (General_options::parse_wrap): New function.
17097 (General_options::General_options): Initialize wrap_symbols_.
17098 * symtab.cc (Symbol_table::wrap_symbol): New function.
17099 (Symbol_table::add_from_object): Handle --wrap.
17100 * symtab.h (class Symbol_table): Declare wrap_symbol.
17101 * target.h (Target::wrap_char): New function.
17102 (Target::Target_info): Add wrap_char field.
17103 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17104 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17105 * testsuite/testfile.cc (Target_test::test_target_info):
17108 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17111 * layout.h (class Layout): Add added_eh_frame_data_ field.
17112 * layout.cc (Layout::Layout): Initialize new field.
17113 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17114 output section until we find a section we merged successfully.
17115 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17116 that the size be non-zero.
17118 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17121 2008-04-08 Craig Silverstein <csilvers@google.com>
17123 * configure.ac: Export new conditional variable HAVE_ZLIB.
17124 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17126 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17127 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17129 2008-04-07 Ian Lance Taylor <iant@google.com>
17131 * version.cc (version_string): Set to "1.5".
17133 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17134 Add issued_non_pic_error_ field. Declare check_non_pic.
17135 (Target_x86_64::Scan::check_non_pic): New function.
17136 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17137 (Target_x86_64::Scan::global): Likewise.
17139 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17140 addend parameter. Change caller. Handle merge sections.
17141 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17142 Address to Addend. Don't add in the result of
17143 local_section_offset, pass down the addend and use the returned
17145 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17146 Update declarations of local_section_offset and symbol_value.
17147 * testsuite/two_file_test_1.cc (t18): New function.
17148 * testsuite/two_file_test_2.cc (f18): New function.
17149 * testsuite/two_file_test_main.cc (main): Call t18.
17150 * testsuite/two_file_test.h (t18, f18): Declare.
17152 * configure.ac: Don't test for objdump, c++filt, or readelf.
17153 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17155 (TEST_READELF): New variable.
17156 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17157 (check_PROGRAMS): Add two_file_strip_test.
17158 (two_file_strip_test): New target.
17159 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17160 (two_file_same_shared_strip_test_SOURCES): New variable.
17161 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17162 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17163 (two_file_same_shared_strip_test_LDADD): New variable.
17164 (two_file_shared_strip.so): New target.
17165 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17166 (ver_test_5.syms, ver_test_7.syms): Likewise.
17167 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17168 (strip_test_3.stdout): Use TEST_OBJDUMP.
17169 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17171 2008-04-04 Cary Coutant <ccoutant@google.com>
17173 * symtab.h (Symbol::is_weak_undefined): New function.
17174 (Symbol::is_strong_undefined): New function.
17175 (Symbol::is_absolute): New function.
17176 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17177 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17179 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17180 (weak_undef_test): New target.
17181 * testsuite/Makefile.in: Rebuild.
17182 * testsuite/weak_undef_file1.cc: New file.
17183 * testsuite/weak_undef_file2.cc: New file.
17184 * testsuite/weak_undef_test.cc: New file.
17186 2008-04-03 Craig Silverstein <csilvers@google.com>
17188 * compressed_output.h (class Output_compressed_section): Use
17190 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17192 (zlib_compressed_suffix): Removed.
17193 (Output_compressed_section::set_final_data_size): Use unsigned
17195 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17196 Fix linker invocation.
17197 (flagstest_o_specialfile_and_compress_debug_sections):
17199 * testsuite/Makefile.in: Regenerated.
17201 2008-04-02 David S. Miller <davem@davemloft.net>
17203 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17204 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17206 2008-04-02 Craig Silverstein <csilvers@google.com>
17210 2008-04-02 Ian Lance Taylor <iant@google.com>
17212 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17213 parameters. Update for new key type to views_. Change all
17215 (File_read::read): Adjust for byteshift in returned view.
17216 (File_read::add_view): New function, broken out of
17217 find_and_make_view.
17218 (File_read::make_view): New function, broken out of
17219 find_and_make_view.
17220 (File_read::find_or_make_view): Add offset and aligned
17221 parameters. Rewrite accordingly. Change all callers.
17222 (File_read::get_view): Add offset and aligned parameters. Adjust
17223 for byteshift in return value.
17224 (File_read::get_lasting_view): Likewise.
17225 * fileread.h (class File_read): Update declarations.
17226 (class File_read::View): Add byteshift_ field. Add byteshift to
17227 constructor. Add byteshift method.
17228 * archive.h (Archive::clear_uncached_views): New function.
17229 (Archive::get_view): Add aligned parameter. Change all callers.
17230 * object.h (Object::get_view): Add aligned parameter. Change all
17232 (Object::get_lasting_view): Likewise.
17234 * fileread.cc (File_read::release): Don't call clear_views if
17235 there are multiple objects.
17236 * fileread.h (File_read::clear_uncached_views): New function.
17237 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17240 2008-03-31 Cary Coutant <ccoutant@google.com>
17242 Add thin archive support.
17243 * archive.cc (Archive::armagt): New const.
17244 (Archive::setup): Remove task parameter and calls to unlock.
17245 (Archive::unlock_nested_archives): New function.
17246 (Archive::read_header): Add nested_off parameter. Change
17248 (Archive::interpret_header): Likewise.
17249 (Archive::include_all_members): Change to handle thin
17251 (Archive::include_member): Likewise.
17252 * archive.h (Archive::Archive): Add new parameters and
17254 (Archive::armagt): New const.
17255 (Archive::setup): Remove task parameter.
17256 (Archive::unlock_nested_archives): New function.
17257 (Archive::read_header): Add nested_off parameter.
17258 (Archive::interpret_header): Likewise.
17259 (Archive::Nested_archive_table): New typedef.
17260 (Archive::is_thin_archive_): New field.
17261 (Archive::nested_archives_): New field.
17262 (Archive::options_): New field.
17263 (Archive::dirpath_): New field.
17264 (Archive::task_): New field.
17265 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17266 for thin archives. Pass additional parameters to
17267 Archive::Archive. Unlock the archive file after calling
17270 2008-03-29 Ian Lance Taylor <iant@google.com>
17272 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17273 version symbol to be local.
17274 * testsuite/ver_test_4.sh: New file.
17275 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17276 (check_DATA): Add ver_test_4.syms.
17277 (ver_test_4.syms): New target.
17278 * testsuite/Makefile.in: Rebuild.
17281 (Output_section::Input_section_sort_entry::has_priority): New
17283 (Output_section::Input_section_sort_entry::match_file_name): New
17285 (Output_section::Input_section_sort_entry::match_section_name):
17287 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17289 (Output_section::Input_section_sort_entry::match_section_file):
17291 (Output_section::Input_section_sort_compare::operator()): Rewrite
17292 using new Input_section_sort_entry functions. Sort crtbegin and
17293 crtend first. Sort sections with no priority before sections with
17295 * testsuite/initpri1.c (d3): Check j != 4.
17296 (cd5): New constructor/destructor function.
17297 (main): Check j != 2.
17299 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17300 new symbol when resolving, don't call set_is_default.
17301 * testsuite/ver_test_7.cc: New file.
17302 * testsuite/ver_test_7.sh: New file.
17303 * testsuite/Makefile.am (ver_test_7.so): New target.
17304 (ver_test_7.o): New target.
17305 (check_SCRIPTS): Add ver_test_7.sh.
17306 (check_DATA): Add ver_test_7.syms.
17307 (ver_test_7.syms): New target.
17309 2008-03-28 Ian Lance Taylor <iant@google.com>
17311 * layout.cc (Layout::layout): If we see an input section with a
17312 name that needs sorting, set the must_sort flag for the output
17314 (Layout::make_output_section): If the name of the output section
17315 indicates that it might require sorting, set the may_sort flag.
17316 * output.h (Output_section::may_sort_attached_input_sections): New
17318 (Output_section::set_may_sort_attached_input_sections): New
17320 (Output_section::must_sort_attached_input_sections): New
17322 (Output_section::set_must_sort_attached_input_sections): New
17324 (class Output_section): Declare Input_section_sort_entry. Define
17325 Input_section_sort_compare. Declare
17326 sort_attached_input_sections. Add new fields:
17327 may_sort_attached_input_sections_,
17328 must_sort_attached_input_sections_,
17329 attached_input_sections_are_sorted_.
17330 * output.cc (Output_section::Output_section): Initialize new
17332 (Output_section::add_input_section): Add an entry to
17333 input_sections_ if may_sort or must_sort are true.
17334 (Output_section::set_final_data_size): Call
17335 sort_attached_input_sections if necessary.
17336 (Output_section::Input_section_sort_entry): Define new class.
17337 (Output_section::Input_section_sort_compare::operator()): New
17339 (Output_section::sort_attached_input_sections): New function.
17340 * configure.ac: Check whether the compiler supports constructor
17341 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17342 * testsuite/initpri1.c: New file.
17343 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17344 CONSTRUCTOR_PRIORITY.
17345 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17346 (initpri1_LDFLAGS): New variable.
17347 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17349 2008-03-27 Ian Lance Taylor <iant@google.com>
17351 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17352 * testsuite/common_test_1.c: New file.
17353 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17354 (common_test_1_SOURCES): New variable.
17355 (common_test_1_DEPENDENCIES): New variable.
17356 (common_test_1_LDFLAGS): New variable.
17358 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17359 and commons_ correctly when NAME/VERSION does not override
17361 * testsuite/ver_test_6.c: New file.
17362 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17363 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17364 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17366 2008-03-26 Ian Lance Taylor <iant@google.com>
17368 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17369 of an undefined symbol from a version script.
17370 * testsuite/Makefile.am (ver_test_5.so): New target.
17371 (ver_test_5.o): New target.
17372 (check_SCRIPTS): Add ver_test_5.sh.
17373 (check_DATA): Add ver_test_5.syms.
17374 (ver_test_5.syms): New target.
17375 * testsuite/ver_test_5.cc: New file.
17376 * testsuite/ver_test_5.script: New file.
17377 * testsuite/ver_test_5.sh: New file.
17378 * Makefile.in, testsuite/Makefile.in: Rebuild.
17381 Fix problems building gold with gcc 4.3.0.
17382 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17383 (gold_error_at_location, gold_warning_at_location): Use it.
17384 * configure.ac: Check whether we can compile and use a template
17385 function with a printf attribute.
17386 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17387 when jumping over bytes.
17388 * object.cc: Instantiate Object::read_section_data.
17389 * debug.h: Include <cstring>
17390 * dwarf_reader.cc: Include <algorithm>
17391 * main.cc: Include <cstring>.
17392 * options.cc: Include <cstring>.
17393 * output.cc: Include <cstring>.
17394 * script.cc: Include <cstring>.
17395 * script.h: Include <string>.
17396 * symtab.cc: Include <cstring> and <algorithm>.
17397 * target-select.cc: Include <cstring>.
17398 * version.cc: Include <string>.
17399 * testsuite/testmain.cc: Include <cstdlib>.
17400 * configure, config.in: Rebuild.
17402 2008-03-25 Ian Lance Taylor <iant@google.com>
17404 * options.cc: Include "../bfd/bfdver.h".
17405 (options::help): Print bug reporting address.
17407 * version.cc (print_version): Adjust output for current value of
17408 BFD_VERSION_STRING.
17412 * options.cc (options::help): Print list of supported targets.
17413 * target-select.h: Include <vector>.
17414 (class Target_selector): Make machine_, size_, and is_big_endian_
17415 fields const. Add bfd_name_ and instantiated_target_ fields.
17416 (Target_selector::Target_selector): Add bfd_name parameter.
17417 (Target_selector::recognize): Make non-virtual, call
17419 (Target_selector::recognize_by_name): Make non-virtual, call
17420 do_recognize_by_name.
17421 (Target_selector::supported_names): New function.
17422 (Target_selector::bfd_name): New function.
17423 (Target_selector::do_instantiate_target): New pure virtual
17425 (Target_selector::do_recognize): New virtual function.
17426 (Target_selector::do_recognize_by_name): New virtual function.
17427 (Target_selector::instantiate_target): New private function.
17428 (supported_target_names): Declare.
17429 * target-select.cc (Target_selector::Target_selector): Update for
17430 new parameter and fields.
17431 (select_target_by_name): Check that the name matches before
17432 calling recognize_by_name.
17433 (supported_target_names): New function.
17434 * i386.cc (class Target_selector_i386): Update Target_selector
17435 constructor call. Remove recognize and recognize_by_name. Add
17436 do_instantiate_target.
17437 * x86_64.cc (class Target_selector_x86_64): Likewise.
17438 * testsuite/testfile.cc (class Target_selector_test): Update for
17439 changes to Target_selector.
17441 * README: Rewrite, with some notes on unsupported features.
17443 2008-03-24 Cary Coutant <ccoutant@google.com>
17445 * i386.cc (Target_i386::Got_type): New enum declaration.
17446 (Target_i386::Scan::local): Updated callers of Output_data_got
17448 (Target_i386::Scan::global): Likewise.
17449 (Target_i386::Relocate::relocate): Likewise.
17450 (Target_i386::Relocate::relocate_tls): Likewise.
17451 * object.h (Got_offset_list): New class.
17452 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17453 (Sized_relobj::local_got_offset): Likewise.
17454 (Sized_relobj::set_local_got_offset): Likewise.
17455 (Sized_relobj::local_has_tls_got_offset): Removed.
17456 (Sized_relobj::local_tls_got_offset): Removed.
17457 (Sized_relobj::set_local_tls_got_offset): Removed.
17458 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17459 * output.cc (Output_data_got::add_global): Added got_type parameter.
17460 (Output_data_got::add_global_with_rel): Likewise.
17461 (Output_data_got::add_global_with_rela): Likewise.
17462 (Output_data_got::add_global_pair_with_rel): New function.
17463 (Output_data_got::add_global_pair_with_rela): New function.
17464 (Output_data_got::add_local): Added got_type parameter.
17465 (Output_data_got::add_local_with_rel): Likewise.
17466 (Output_data_got::add_local_with_rela): Likewise.
17467 (Output_data_got::add_local_pair_with_rel): New function.
17468 (Output_data_got::add_local_pair_with_rela): New function.
17469 (Output_data_got::add_global_tls): Removed.
17470 (Output_data_got::add_global_tls_with_rel): Removed.
17471 (Output_data_got::add_global_tls_with_rela): Removed.
17472 (Output_data_got::add_local_tls): Removed.
17473 (Output_data_got::add_local_tls_with_rel): Removed.
17474 (Output_data_got::add_local_tls_with_rela): Removed.
17475 * output.h (Output_data_got::add_global): Added got_type parameter.
17476 (Output_data_got::add_global_with_rel): Likewise.
17477 (Output_data_got::add_global_with_rela): Likewise.
17478 (Output_data_got::add_global_pair_with_rel): New function.
17479 (Output_data_got::add_global_pair_with_rela): New function.
17480 (Output_data_got::add_local): Added got_type parameter.
17481 (Output_data_got::add_local_with_rel): Likewise.
17482 (Output_data_got::add_local_with_rela): Likewise.
17483 (Output_data_got::add_local_pair_with_rel): New function.
17484 (Output_data_got::add_local_pair_with_rela): New function.
17485 (Output_data_got::add_global_tls): Removed.
17486 (Output_data_got::add_global_tls_with_rel): Removed.
17487 (Output_data_got::add_global_tls_with_rela): Removed.
17488 (Output_data_got::add_local_tls): Removed.
17489 (Output_data_got::add_local_tls_with_rel): Removed.
17490 (Output_data_got::add_local_tls_with_rela): Removed.
17491 * resolve.cc (Symbol::override_base_with_special): Removed
17492 reference to has_got_offset_ field.
17493 * symtab.cc (Symbol::init_fields): Replaced initialization
17494 of got_offset_ with got_offsets_. Removed initialization
17496 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
17497 (Symbol::got_offset): Likewise.
17498 (Symbol::set_got_offset): Likewise.
17499 (Symbol::has_tls_got_offset): Removed.
17500 (Symbol::tls_got_offset): Removed.
17501 (Symbol::set_tls_got_offset): Removed.
17502 (Symbol::got_offset_): Removed.
17503 (Symbol::tls_mod_got_offset_): Removed.
17504 (Symbol::tls_pair_got_offset_): Removed.
17505 (Symbol::got_offsets_): New field.
17506 (Symbol::has_got_offset): Removed.
17507 (Symbol::has_tls_mod_got_offset): Removed.
17508 (Symbol::has_tls_pair_got_offset): Removed.
17509 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17510 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17512 (Target_x86_64::Scan::global): Likewise.
17513 (Target_x86_64::Relocate::relocate): Likewise.
17514 (Target_x86_64::Relocate::relocate_tls): Likewise.
17516 2008-03-25 Ben Elliston <bje@au.ibm.com>
17518 * yyscript.y: Fix spelling error in comment.
17520 2008-03-24 Ian Lance Taylor <iant@google.com>
17522 * options.h (class General_options): Define build_id option.
17523 * layout.h (class Layout): Declare write_build_id, create_note,
17524 create_build_id. Add build_id_note_ member.
17525 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17526 "libiberty.h", "md5.h", "sha1.h".
17527 (Layout::Layout): Initialize eh_frame_data_,
17528 eh_frame_hdr_section_, and build_id_note_.
17529 (Layout::finalize): Call create_build_id.
17530 (Layout::create_note): New function, broken out of
17531 Layout::create_gold_note.
17532 (Layout::create_gold_note): Call create_note.
17533 (Layout::create_build_id): New function.
17534 (Layout::write_build_id): New function.
17535 (Close_task_runner::run): Call write_build_id.
17537 * x86_64.cc: Correct license to GPLv3.
17539 2008-03-23 Ian Lance Taylor <iant@google.com>
17541 * options.cc: Include "demangle.h".
17542 (parse_optional_string): New function.
17543 (parse_long_option): Handle takes_optional_argument.
17544 (parse_short_option): Update dash_z initializer. Handle
17545 takes_optional_argument.
17546 (General_options::General_options): Initialize do_demangle_.
17547 (General_options::finalize): Set do_demangle_. Handle demangling
17549 * options.h (parse_optional_string): Declare.
17550 (struct One_option): Add optional_arg field. Update constructor.
17551 Update call constructor calls. Add takes_optional_argument
17553 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17554 (DEFINE_optional_string): Define.
17555 (General_options::demangle): Change from DEFINE_bool to
17556 DEFINE_optional_string.
17557 (General_options::no_demangle): New function.
17558 (General_options::do_demangle): New function.
17559 (General_options::set_do_demangle): New function.
17560 (General_options::execstack_status_): Move definition to end of
17562 (General_options::static_): Likewise.
17563 (General_options::do_demangle_): New field.
17564 * object.cc (big_endian>::get_symbol_location_info): Call
17565 Options::do_demangle, not Options::demangle.
17566 * symtab.cc (demangle): Likewise.
17568 2008-03-22 Ian Lance Taylor <iant@google.com>
17570 * gold.h: Include <cstddef> and <sys/types.h>
17571 * options.h: Include <cstring>.
17573 2008-03-21 Ian Lance Taylor <iant@google.com>
17575 * Added source code to GNU binutils.
17577 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17579 Copying and distribution of this file, with or without modification,
17580 are permitted in any medium without royalty provided the copyright
17581 notice and this notice are preserved.
17587 version-control: never